添加结算打印小票

This commit is contained in:
韩鹏辉 2024-04-03 14:20:39 +08:00
parent 2c46de7e9d
commit 9b518d8426
6 changed files with 29 additions and 7 deletions

View File

@ -35,5 +35,9 @@ public interface ShopUserDutyMapper {
ShopUserDuty selectByShopIdAndTrade(@Param("shopId") Integer shopId,@Param("day") String day);
ShopUserDuty selectByShopIdAndDay(@Param("shopId") Integer shopId,@Param("day") String day);
// List<String> selectByShopIdAndTradeAll(@Param("shopId") Integer shopId,@Param("day") String day,@Param("tokenId") Integer tokenId);
}

View File

@ -18,6 +18,7 @@ public class WebAppConfigurer implements WebMvcConfigurer {
registry.addInterceptor(signInterceptor)
.addPathPatterns("/**")
.excludePathPatterns("/login/login")
;
.excludePathPatterns("/cloudPrinter/print")
.excludePathPatterns("/cloudPrinter/handoverPrint");
}
}

View File

@ -30,9 +30,11 @@ public class HandoverInfo implements Serializable {
private String handIn;
private String returnAmount;
private String orderNum;
public HandoverInfo(String merchantName, String startTime, String endTime, String staff, List<PayInfo> payInfos, List<HandoverInfo.MemberData> memberData, String totalAmount, String imprest, String payable, String handIn, String orderNum) {
public HandoverInfo(String merchantName, String startTime, String endTime, String staff, List<PayInfo> payInfos, List<HandoverInfo.MemberData> memberData, String totalAmount, String imprest, String payable, String handIn, String returnAmount,String orderNum) {
this.merchantName = merchantName;
this.startTime = startTime;
this.endTime = endTime;
@ -43,6 +45,7 @@ public class HandoverInfo implements Serializable {
this.imprest = imprest;
this.payable = payable;
this.handIn = handIn;
this.returnAmount=returnAmount;
this.orderNum = orderNum;
}

View File

@ -401,7 +401,7 @@ public class CloudPrinterService {
return;
}
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndTrade(tbShopInfo.getId(),tradeDay);
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay);
MsgException.checkNull(shopUserDuty,"交班信息不存在");
@ -422,8 +422,17 @@ public class CloudPrinterService {
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"储值卡支付"));
}
HandoverInfo handoverInfo=new HandoverInfo(tbShopInfo.getShopName(),ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime())?DateUtils.getTime(shopUserDuty.getLoginTime()):null,ObjectUtil.isNotEmpty(shopUserDuty.getLoginOutTime())?DateUtils.getTime(shopUserDuty.getLoginOutTime()):"",ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),list,memberData,shopUserDuty.getAmount().toPlainString(),"0",shopUserDuty.getAmount().toPlainString(),shopUserDuty.getAmount().toPlainString(),shopUserDuty.getOrderNum().toString());
HandoverInfo handoverInfo=new HandoverInfo(tbShopInfo.getShopName(),
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime())?DateUtils.getTime(shopUserDuty.getLoginTime()):null,
ObjectUtil.isNotEmpty(shopUserDuty.getLoginOutTime())?DateUtils.getTime(shopUserDuty.getLoginOutTime()):"",
ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
list,memberData,shopUserDuty.getAmount().toPlainString(),
"0",
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
shopUserDuty.getReturnAmount().toPlainString(),
shopUserDuty.getOrderNum().toString()
);
PrinterUtils.printTickets(1,1,it.getAddress(),PrinterUtils.handoverprintData(handoverInfo));

View File

@ -167,12 +167,13 @@ public class PrinterUtils {
sb.append("<S> "+payInfo.getPayType()+": "+payInfo.getAmount()+"</S><BR>");
}
}
sb.append("<S>会员数据</S><BR>");
if(ObjectUtil.isNotEmpty(handoverInfo.getMemberData())&&handoverInfo.getMemberData().size()>0){
sb.append("<S>会员数据</S><BR>");
for (HandoverInfo.MemberData memberDatum : handoverInfo.getMemberData()) {
sb.append("<S> "+memberDatum.getDeposit()+": "+memberDatum.getAmount()+"</S><BR>");
}
}
sb.append("<S>退款金额 :".concat(handoverInfo.getReturnAmount())+"</S><BR>");
sb.append("<S>总收入: "+handoverInfo.getTotalAmount()+"</S><BR>");
sb.append("<S>备用金: "+handoverInfo.getImprest()+"</S><BR>");
sb.append("<S>应交金额: "+handoverInfo.getPayable()+"</S><BR>");
@ -182,7 +183,7 @@ public class PrinterUtils {
sb.append("<S>总订单数:"+handoverInfo.getOrderNum()+"</S><BR>");
sb.append("<S>打印时间:"+DateUtils.getTime(new Date())+"</S><BR>");
sb.append("<OUT:180>");
sb.append("<OUT:200>");
sb.append("<PCUT>");
return sb.toString();

View File

@ -224,4 +224,8 @@
<update id="updateStatusByTokenId">
update tb_shop_user_duty set status = '1' , login_out_time = now(),user_id = #{staffId} where shop_id = #{shopId} and trade_day = #{day} and status = '0'
</update>
<select id="selectByShopIdAndDay" resultMap="BaseResultMap">
select * from tb_shop_user_duty where trade_day = #{day} and shop_id = #{shopId} order by id desc limit 1
</select>
</mapper>