交班修改业务逻辑 ,跨天统计
This commit is contained in:
@@ -34,6 +34,7 @@ public interface ShopUserDutyMapper {
|
||||
ShopUserDuty selectByTokenIdAndTradeDay(@Param("tokenId") int tokenId, @Param("day") String day,@Param("shopId") String shopId);
|
||||
|
||||
ShopUserDuty selectByShopIdAndTrade(@Param("shopId") Integer shopId,@Param("day") String day);
|
||||
ShopUserDuty selectByShopIdAndStatus(@Param("shopId") Integer shopId,@Param("status") String status);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,8 +73,10 @@ public class DutyService {
|
||||
throw new MsgException("订单不存在");
|
||||
}
|
||||
List<TbOrderDetail> list = orderDetailMapper.selectAllByOrderId(orderId);
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(shopId);
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenId(tokenId);
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId, day);
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0");
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId, day);
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenIdAndTradeDay(tokenId, day, orderInfo.getShopId());
|
||||
BigDecimal cashAmount = BigDecimal.ZERO;
|
||||
|
||||
@@ -83,7 +85,7 @@ public class DutyService {
|
||||
cashAmount = orderInfo.getPayAmount();
|
||||
}
|
||||
if (Objects.isNull(shopUserDuty)) {
|
||||
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, orderInfo.getOrderAmount(), loginName, "0",
|
||||
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, orderInfo.getOrderAmount(), shopInfo.getShopName(), "0",
|
||||
orderInfo.getOrderAmount(), shopId, BigDecimal.ZERO, cashAmount, BigDecimal.ZERO, "");
|
||||
shopUserDuty.setTokenId(tokenId);
|
||||
shopUserDuty.setReturnAmount(BigDecimal.ZERO);
|
||||
@@ -187,7 +189,8 @@ public class DutyService {
|
||||
if (orderInfo.getPayType().equals("cash")) {
|
||||
cashAmount = orderInfo.getPayAmount();
|
||||
}
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(Integer.valueOf(orderInfo.getShopId()), day);
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(Integer.valueOf(orderInfo.getShopId()), "0");
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(Integer.valueOf(orderInfo.getShopId()), day);
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenIdAndTradeDay(0, day, orderInfo.getShopId());
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
if (Objects.isNull(shopUserDuty)) {
|
||||
@@ -199,6 +202,7 @@ public class DutyService {
|
||||
shopUserDuty.setUserName(shopInfo.getShopName());
|
||||
}
|
||||
shopUserDuty.setTradeDay(DateUtils.getDay());
|
||||
shopUserDuty.setReturnAmount(BigDecimal.ZERO);
|
||||
shopUserDutyMapper.insert(shopUserDuty);
|
||||
List<ShopUserDutyDetail> detaiList = new ArrayList<>();
|
||||
for (TbOrderDetail orderDetail : list) {
|
||||
|
||||
Reference in New Issue
Block a user