Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2024-08-03 10:15:04 +08:00
8 changed files with 105 additions and 37 deletions

View File

@@ -48,6 +48,8 @@ public interface TbOrderInfoMapper {
List<SkuInfoPo> selectSkuByOrderId(String orderId); List<SkuInfoPo> selectSkuByOrderId(String orderId);
List<SkuInfoPo> selectSkuByOrderIdAndType(String orderId);
TbOrderInfo selectById(Integer id); TbOrderInfo selectById(Integer id);
} }

View File

@@ -20,4 +20,5 @@ public interface TbPlussShopStaffMapper {
int updateByPrimaryKey(TbPlussShopStaff record); int updateByPrimaryKey(TbPlussShopStaff record);
TbPlussShopStaff selectByAccount(String account); TbPlussShopStaff selectByAccount(String account);
TbPlussShopStaff selectByAccountAndShopId(String account,String shopId);
} }

View File

@@ -150,6 +150,38 @@ public class DataService {
null,null null,null
); );
tbHandover tbHandover=new tbHandover();
if(ObjectUtil.isNotNull(shopStaff)){
tbHandover.setStaffId(shopStaff.getId());
tbHandover.setStaffName(shopStaff.getName());
}
tbHandover.setTradeDay(DateUtils.getDays());
tbHandover.setPrintNo("usb");
tbHandover.setDutyId(shopUserDuty.getId());
tbHandover.setShopId(shopInfo.getId());
tbHandover.setMerchantName(handoverInfo.getMerchantName());
tbHandover.setStartTime(handoverInfo.getStartTime());
tbHandover.setEndTime(handoverInfo.getEndTime());
tbHandover.setPayInfos(JSONUtil.toJSONString(handoverInfo.getPayInfos()));
tbHandover.setMemberData(JSONUtil.toJSONString(handoverInfo.getMemberData()));
tbHandover.setProductCategories(JSONUtil.toJSONString(handoverInfo.getProductCategories()));
tbHandover.setTotalAmount(handoverInfo.getTotalAmount());
tbHandover.setImprest(handoverInfo.getImprest());
tbHandover.setPayable(handoverInfo.getPayable());
tbHandover.setHandIn(handoverInfo.getHandIn());
tbHandover.setReturnAmount(handoverInfo.getReturnAmount());
tbHandover.setOrderNum(handoverInfo.getOrderNum());
tbHandover.setQuickAmount(handoverInfo.getQuickAmount());
tbHandover.setProductInfoPos(JSONUtil.toJSONString(handoverInfo.getProductInfoPOS()));
tbHandover.setProductInfos(JSONUtil.toJSONString(handoverInfo.getProductInfos()));
tbHandover.setCreateTime(new Date());
tbHandoverMapper.insert(tbHandover);
return Result.success(CodeEnum.SUCCESS,handoverInfo); return Result.success(CodeEnum.SUCCESS,handoverInfo);
} }
@@ -261,38 +293,35 @@ public class DataService {
); );
tbHandover tbHandover=new tbHandover(); // tbHandover tbHandover=new tbHandover();
//
if(ObjectUtil.isNotNull(shopStaff)){ // if(ObjectUtil.isNotNull(shopStaff)){
tbHandover.setStaffId(shopStaff.getId()); // tbHandover.setStaffId(shopStaff.getId());
tbHandover.setStaffName(shopStaff.getName()); // tbHandover.setStaffName(shopStaff.getName());
} // }
tbHandover.setTradeDay(DateUtils.getDays()); // tbHandover.setTradeDay(DateUtils.getDays());
tbHandover.setPrintNo(it.getAddress()); // tbHandover.setPrintNo(it.getAddress());
tbHandover.setDutyId(shopUserDuty.getId()); // tbHandover.setDutyId(shopUserDuty.getId());
tbHandover.setShopId(shopInfo.getId()); // tbHandover.setShopId(shopInfo.getId());
tbHandover.setMerchantName(handoverInfo.getMerchantName()); // tbHandover.setMerchantName(handoverInfo.getMerchantName());
tbHandover.setStartTime(handoverInfo.getStartTime()); // tbHandover.setStartTime(handoverInfo.getStartTime());
tbHandover.setEndTime(handoverInfo.getEndTime()); // tbHandover.setEndTime(handoverInfo.getEndTime());
tbHandover.setPayInfos(JSONUtil.toJSONString(handoverInfo.getPayInfos())); // tbHandover.setPayInfos(JSONUtil.toJSONString(handoverInfo.getPayInfos()));
tbHandover.setMemberData(JSONUtil.toJSONString(handoverInfo.getMemberData())); // tbHandover.setMemberData(JSONUtil.toJSONString(handoverInfo.getMemberData()));
tbHandover.setProductCategories(JSONUtil.toJSONString(handoverInfo.getProductCategories())); // tbHandover.setProductCategories(JSONUtil.toJSONString(handoverInfo.getProductCategories()));
tbHandover.setTotalAmount(handoverInfo.getTotalAmount()); // tbHandover.setTotalAmount(handoverInfo.getTotalAmount());
tbHandover.setImprest(handoverInfo.getImprest()); // tbHandover.setImprest(handoverInfo.getImprest());
tbHandover.setPayable(handoverInfo.getPayable()); // tbHandover.setPayable(handoverInfo.getPayable());
tbHandover.setHandIn(handoverInfo.getHandIn()); // tbHandover.setHandIn(handoverInfo.getHandIn());
tbHandover.setReturnAmount(handoverInfo.getReturnAmount()); // tbHandover.setReturnAmount(handoverInfo.getReturnAmount());
tbHandover.setOrderNum(handoverInfo.getOrderNum()); // tbHandover.setOrderNum(handoverInfo.getOrderNum());
tbHandover.setQuickAmount(handoverInfo.getQuickAmount()); // tbHandover.setQuickAmount(handoverInfo.getQuickAmount());
tbHandover.setProductInfoPos(JSONUtil.toJSONString(handoverInfo.getProductInfoPOS())); // tbHandover.setProductInfoPos(JSONUtil.toJSONString(handoverInfo.getProductInfoPOS()));
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));
}); });
} }

View File

@@ -267,7 +267,7 @@ public class DutyService {
} }
List<TbOrderDetail> list = orderDetailMapper.selectAllByOrderId(orderId); List<TbOrderDetail> list = orderDetailMapper.selectAllByOrderId(orderId);
BigDecimal cashAmount = BigDecimal.ZERO; BigDecimal cashAmount = BigDecimal.ZERO;
if (orderInfo.getPayType().equals("cash")) { if ("cash".equals(orderInfo.getPayType())) {
cashAmount = orderInfo.getPayAmount(); cashAmount = orderInfo.getPayAmount();
} }
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(Integer.valueOf(orderInfo.getShopId()), "0"); ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(Integer.valueOf(orderInfo.getShopId()), "0");
@@ -364,7 +364,10 @@ public class DutyService {
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0"); ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0");
// cloudPrinterService.handoverprintData(token, shopUserDuty.getId(), "",true); // cloudPrinterService.handoverprintData(token, shopUserDuty.getId(), "",true);
// shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId); // shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId);
shopUserDutyMapper.updateStatusById(shopUserDuty.getId(), staffId); if(Objects.nonNull(shopUserDuty)){
shopUserDutyMapper.updateStatusById(shopUserDuty.getId(), staffId);
}
} }
} }
} }

View File

@@ -87,7 +87,7 @@ public class LoginService {
return Result.fail(CodeEnum.MERCHANTEIXST); return Result.fail(CodeEnum.MERCHANTEIXST);
} }
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffMapper.selectByAccount(loginReq.getLoginName()); TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffMapper.selectByAccountAndShopId(loginReq.getLoginName(),account.getShopId());
if (ObjectUtil.isEmpty(tbPlussShopStaff)) { if (ObjectUtil.isEmpty(tbPlussShopStaff)) {
return Result.fail(CodeEnum.ACCOUNTEIXST); return Result.fail(CodeEnum.ACCOUNTEIXST);
} else if (!tbPlussShopStaff.getStatus()) { } else if (!tbPlussShopStaff.getStatus()) {

View File

@@ -914,11 +914,21 @@ public class OrderService {
orderInfo.setImgUrl("https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240223/a04e0d3beef74d099ebd0fd1f7c41873.jpg"); orderInfo.setImgUrl("https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240223/a04e0d3beef74d099ebd0fd1f7c41873.jpg");
} }
List<SkuInfoPo> skuInfoPos=tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
if(Objects.isNull(skuInfoPos)||skuInfoPos.size()<0){ if(orderInfo.getOrderType().equals("return")){
skuInfoPos=new ArrayList<>(); List<SkuInfoPo> skuInfoPos=tbOrderInfoMapper.selectSkuByOrderIdAndType(orderInfo.getId().toString());
if(Objects.isNull(skuInfoPos)||skuInfoPos.size()<0){
skuInfoPos=new ArrayList<>();
}
orderInfo.setSkuInfos(skuInfoPos);
}else {
List<SkuInfoPo> skuInfoPos=tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
if(Objects.isNull(skuInfoPos)||skuInfoPos.size()<0){
skuInfoPos=new ArrayList<>();
}
orderInfo.setSkuInfos(skuInfoPos);
} }
orderInfo.setSkuInfos(skuInfoPos);
orderInfo.setZdNo("POS"); orderInfo.setZdNo("POS");
orderInfo.setNames(orderInfo.getProductName() == null ? new String[]{""} : orderInfo.getProductName().split(",")); orderInfo.setNames(orderInfo.getProductName() == null ? new String[]{""} : orderInfo.getProductName().split(","));
} }

View File

@@ -610,5 +610,22 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
<select id="selectById" resultMap="BaseResultMap"> <select id="selectById" resultMap="BaseResultMap">
select * from tb_order_info where id=#{id} and status='closed' select * from tb_order_info where id=#{id} and status='closed'
</select>
<select id="selectSkuByOrderIdAndType" resultType="com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo">
SELECT
d.product_name AS productName,
d.num,
d.product_sku_name AS productSkuName,
'' AS categoryId,
d.price_amount as priceAmount,
d.pack_amount as packAmount
FROM
tb_order_detail d
where d.order_id=#{orderId}
</select> </select>
</mapper> </mapper>

View File

@@ -202,4 +202,10 @@
<select id="selectByAccount" resultMap="BaseResultMap"> <select id="selectByAccount" resultMap="BaseResultMap">
select * from tb_pluss_shop_staff where account=#{account} select * from tb_pluss_shop_staff where account=#{account}
</select> </select>
<select id="selectByAccountAndShopId" resultMap="BaseResultMap">
select * from tb_pluss_shop_staff where account=#{account}
<if test="shopId != null and shopId!=''">
and shop_id=#{shopId}
</if>
</select>
</mapper> </mapper>