Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c300f61def
|
|
@ -253,77 +253,72 @@ public class DataService {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TbPrintMachineWithBLOBs> bloBsList = tbPrintMachineMapper.selectByShopId(tbShopInfo.getId().toString());
|
List<TbPrintMachineWithBLOBs> bloBsList = tbPrintMachineMapper.selectByShopId(tbShopInfo.getId().toString());
|
||||||
|
if(Objects.nonNull(bloBsList)&&ObjectUtil.isNotEmpty(bloBsList)){
|
||||||
|
bloBsList.parallelStream().forEach(it-> {
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(bloBsList) || bloBsList.size() <= 0) {
|
if (!"network".equals(it.getConnectionType())) {
|
||||||
log.error("此店铺没有对应的打印机设备");
|
log.error("非网络打印机");
|
||||||
return Result.fail(CodeEnum.printmachinenoexsit);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bloBsList.parallelStream().forEach(it-> {
|
if (!"1".equals(it.getStatus().toString())) {
|
||||||
|
log.error("打印机状态异常");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!"network".equals(it.getConnectionType())) {
|
if (!it.getSubType().equals("cash")) {
|
||||||
log.error("非网络打印机");
|
log.error("非小票打印机");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!"1".equals(it.getStatus().toString())) {
|
|
||||||
log.error("打印机状态异常");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!it.getSubType().equals("cash")) {
|
|
||||||
log.error("非小票打印机");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<HandoverInfo.PayInfo> list = null;
|
List<HandoverInfo.PayInfo> list = null;
|
||||||
List<HandoverInfo.MemberData> memberData = null;
|
List<HandoverInfo.MemberData> memberData = null;
|
||||||
List<HandoverInfo.ProductCategory> productCategories = null;
|
List<HandoverInfo.ProductCategory> productCategories = null;
|
||||||
List<Map<String, Object>> mapList = shopUserDutyPayMapper.selectByDutyId(shopUserDuty.getId());
|
List<Map<String, Object>> mapList = shopUserDutyPayMapper.selectByDutyId(shopUserDuty.getId());
|
||||||
if (ObjectUtil.isNotEmpty(mapList) && mapList.size() > 0) {
|
if (ObjectUtil.isNotEmpty(mapList) && mapList.size() > 0) {
|
||||||
list = JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(mapList), HandoverInfo.PayInfo.class);
|
list = JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(mapList), HandoverInfo.PayInfo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
memberData = new ArrayList<>();
|
memberData = new ArrayList<>();
|
||||||
ShopUserDutyPay shopUserDutyPay = shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(), "deposit");
|
ShopUserDutyPay shopUserDutyPay = shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(), "deposit");
|
||||||
if (ObjectUtil.isNotEmpty(shopUserDutyPay)) {
|
if (ObjectUtil.isNotEmpty(shopUserDutyPay)) {
|
||||||
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(), "会员卡消费"));
|
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(), "会员卡消费"));
|
||||||
}
|
}
|
||||||
|
|
||||||
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount()) ? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(), "会员卡充值"));
|
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount()) ? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(), "会员卡充值"));
|
||||||
|
|
||||||
|
|
||||||
List<Map<String, Object>> categries = shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId());
|
List<Map<String, Object>> categries = shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId());
|
||||||
if (ObjectUtil.isNotEmpty(categries) && categries.size() > 0) {
|
if (ObjectUtil.isNotEmpty(categries) && categries.size() > 0) {
|
||||||
productCategories = JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(categries), HandoverInfo.ProductCategory.class);
|
productCategories = JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(categries), HandoverInfo.ProductCategory.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<ProductInfoPO> productInfoPOS = null;
|
List<ProductInfoPO> productInfoPOS = null;
|
||||||
List<ProductInfo> productInfos = null;
|
List<ProductInfo> productInfos = null;
|
||||||
if (isprintProduct) {
|
if (isprintProduct) {
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// productInfoPOS=shopUserDutyPayMapper.selectProductByDutyId(shopUserDuty.getId());
|
// productInfoPOS=shopUserDutyPayMapper.selectProductByDutyId(shopUserDuty.getId());
|
||||||
productInfos = shopUserDutyMapper.selectByDutyId(shopUserDuty.getId());
|
productInfos = shopUserDutyMapper.selectByDutyId(shopUserDuty.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
HandoverInfo handoverInfo = new HandoverInfo(tbShopInfo.getShopName(),
|
HandoverInfo handoverInfo = new HandoverInfo(tbShopInfo.getShopName(),
|
||||||
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime()) ? DateUtils.getTime(shopUserDuty.getLoginTime()) : null,
|
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime()) ? DateUtils.getTime(shopUserDuty.getLoginTime()) : null,
|
||||||
DateUtils.getTime(new Date()),
|
DateUtils.getTime(new Date()),
|
||||||
ObjectUtil.isNull(shopStaff)?"":ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
|
ObjectUtil.isNull(shopStaff)?"":ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
|
||||||
list, memberData, shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
list, memberData, shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
||||||
"0",
|
"0",
|
||||||
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
||||||
shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
||||||
shopUserDuty.getReturnAmount().toPlainString(),
|
shopUserDuty.getReturnAmount().toPlainString(),
|
||||||
shopUserDuty.getOrderNum().toString(),
|
shopUserDuty.getOrderNum().toString(),
|
||||||
productCategories, ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? "0" : shopUserDuty.getQuickAmount().toPlainString(),
|
productCategories, ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? "0" : shopUserDuty.getQuickAmount().toPlainString(),
|
||||||
null, productInfos
|
null, productInfos
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// tbHandover tbHandover=new tbHandover();
|
// tbHandover tbHandover=new tbHandover();
|
||||||
//
|
//
|
||||||
|
|
@ -352,10 +347,10 @@ public class DataService {
|
||||||
// tbHandover.setProductInfos(JSONUtil.toJSONString(handoverInfo.getProductInfos()));
|
// tbHandover.setProductInfos(JSONUtil.toJSONString(handoverInfo.getProductInfos()));
|
||||||
// tbHandover.setCreateTime(new Date());
|
// tbHandover.setCreateTime(new Date());
|
||||||
// tbHandoverMapper.insert(tbHandover);
|
// tbHandoverMapper.insert(tbHandover);
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
|
String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
|
||||||
PrinterUtils.printTickets(voiceJson, 1, 1, it.getAddress(), PrinterUtils.handoverprintData(handoverInfo));
|
PrinterUtils.printTickets(voiceJson, 1, 1, it.getAddress(), PrinterUtils.handoverprintData(handoverInfo));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -743,7 +743,7 @@ public class OrderService {
|
||||||
} else {
|
} else {
|
||||||
String orderNo = generateOrderNumber();
|
String orderNo = generateOrderNumber();
|
||||||
TbOrderInfo orderInfo = new TbOrderInfo(orderNo, totalAmount, packAMount, totalAmount, saleAmount, totalAmount, feeAmount, "",
|
TbOrderInfo orderInfo = new TbOrderInfo(orderNo, totalAmount, packAMount, totalAmount, saleAmount, totalAmount, feeAmount, "",
|
||||||
"table", "case", userId, shopId.toString(),
|
"table", "cash", userId, shopId.toString(),
|
||||||
"", (byte) 1, day, masterId);
|
"", (byte) 1, day, masterId);
|
||||||
orderInfo.setStatus("pending");
|
orderInfo.setStatus("pending");
|
||||||
tbOrderInfoMapper.insert(orderInfo);
|
tbOrderInfoMapper.insert(orderInfo);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue