修改交班数据

This commit is contained in:
韩鹏辉 2024-05-30 11:21:05 +08:00
parent 29293fd093
commit 92df7d1ba6
4 changed files with 36 additions and 36 deletions

View File

@ -616,17 +616,18 @@ public class CloudPrinterService {
list= JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(mapList), HandoverInfo.PayInfo.class);
}
// ShopUserDutyPay shopUserDutyPay=shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(),"deposit");
// if(ObjectUtil.isNotEmpty(shopUserDutyPay)){
// memberData=new ArrayList<>();
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount())? BigDecimal.ONE.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(),"储值卡充值"));
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ONE.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"储值卡支付"));
// }
memberData=new ArrayList<>();
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(),"储值卡充值"));
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"储值卡支付"));
ShopUserDutyPay shopUserDutyPay=shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(),"deposit");
if(ObjectUtil.isNotEmpty(shopUserDutyPay)){
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"会员卡支付"));
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"会员卡支付"));
// memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberOutAmount())? BigDecimal.ONE.toPlainString() : shopUserDuty.getMemberOutAmount().toPlainString(),"储值卡支付"));
}
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount())? BigDecimal.ONE.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(),"会员卡充值"));
List<Map<String,Object>> categries= shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId());

View File

@ -70,7 +70,7 @@ public class DutyService {
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(shopId);
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0");
if(Objects.isNull(shopUserDuty)){
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, BigDecimal.ZERO, shopInfo.getShopName(), "0",
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 0, BigDecimal.ZERO, shopInfo.getShopName(), "0",
BigDecimal.ZERO, shopId, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, "");
shopUserDuty.setTokenId(tokenId);
shopUserDuty.setReturnAmount(BigDecimal.ZERO);
@ -94,7 +94,7 @@ public class DutyService {
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(shopId);
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0");
if(Objects.isNull(shopUserDuty)){
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, BigDecimal.ZERO, shopInfo.getShopName(), "0",
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 0, BigDecimal.ZERO, shopInfo.getShopName(), "0",
BigDecimal.ZERO, shopId, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, "");
shopUserDuty.setTokenId(tokenId);
shopUserDuty.setReturnAmount(BigDecimal.ZERO);
@ -116,7 +116,7 @@ public class DutyService {
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
if(Objects.isNull(shopUserDuty)){
shopUserDuty = new ShopUserDuty(Integer.valueOf(shopId), tbToken.getCreateTime(), 1, BigDecimal.ZERO, shopInfo.getShopName(), "0",
shopUserDuty = new ShopUserDuty(Integer.valueOf(shopId), tbToken.getCreateTime(), 0, BigDecimal.ZERO, shopInfo.getShopName(), "0",
BigDecimal.ZERO, Integer.valueOf(shopId), BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, "");
shopUserDuty.setTokenId(0);
@ -342,18 +342,16 @@ public class DutyService {
}
}
if(!orderInfo.getOrderType().equals("deposit")){
ShopUserDutyPay shopUserDutyPay = shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(), orderInfo.getPayType());
if (Objects.nonNull(shopUserDutyPay)) {
shopUserDutyPay.setAmount(orderInfo.getOrderAmount().add(shopUserDutyPay.getAmount()));
shopUserDutyPayMapper.updateByPrimaryKeySelective(shopUserDutyPay);
} else {
shopUserDutyPay = new ShopUserDutyPay();
shopUserDutyPay.setDutyId(shopUserDuty.getId());
shopUserDutyPay.setType(orderInfo.getPayType());
shopUserDutyPay.setAmount(orderInfo.getOrderAmount());
shopUserDutyPayMapper.insert(shopUserDutyPay);
}
ShopUserDutyPay shopUserDutyPay = shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(), orderInfo.getPayType());
if (Objects.nonNull(shopUserDutyPay)) {
shopUserDutyPay.setAmount(orderInfo.getOrderAmount().add(shopUserDutyPay.getAmount()));
shopUserDutyPayMapper.updateByPrimaryKeySelective(shopUserDutyPay);
} else {
shopUserDutyPay = new ShopUserDutyPay();
shopUserDutyPay.setDutyId(shopUserDuty.getId());
shopUserDutyPay.setType(orderInfo.getPayType());
shopUserDutyPay.setAmount(orderInfo.getOrderAmount());
shopUserDutyPayMapper.insert(shopUserDutyPay);
}
} else {

View File

@ -285,7 +285,7 @@ public class MemberService {
TbShopUserFlow flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberIn");
flow.setBizName("会员扫码充值");
flow.setBizName("线下充值");
flow.setAmount(amount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
@ -311,7 +311,7 @@ public class MemberService {
flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberAwardIn");
flow.setBizName("会员充值奖励");
flow.setBizName("充值活动奖励");
flow.setAmount(awardAmount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
@ -424,7 +424,7 @@ public class MemberService {
TbShopUserFlow flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberIn");
flow.setBizName("会员扫码充值");
flow.setBizName("线下充值");
flow.setAmount(memberIn.getAmount());
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
@ -450,16 +450,16 @@ public class MemberService {
flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberAwardIn");
flow.setBizName("会员充值奖励");
flow.setBizName("充值活动奖励");
flow.setAmount(awardAmount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
JSONObject jsonObject = new JSONObject();
jsonObject.put("token", token);
jsonObject.put("quick", "quick");
jsonObject.put("consumeType","in");
jsonObject.put("amount",memberIn.getAmount());
jsonObject.put("type", "memberIn");
jsonObject.put("amount", memberIn.getAmount());
producer.putOrderCollect(jsonObject.toJSONString());
@ -525,7 +525,7 @@ public class MemberService {
TbShopUserFlow flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("cashMemberIn");
flow.setBizName("会员现金充值");
flow.setBizName("线下充值");
flow.setAmount(amount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
@ -550,16 +550,17 @@ public class MemberService {
flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberAwardIn");
flow.setBizName("会员充值奖励");
flow.setBizName("充值活动奖励");
flow.setAmount(awardAmount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
JSONObject jsonObject = new JSONObject();
jsonObject.put("token", token);
jsonObject.put("type", "memberIn");
jsonObject.put("amount",memberIn.getAmount());
jsonObject.put("amount", memberIn.getAmount());
producer.putOrderCollect(jsonObject.toJSONString());
}

View File

@ -90,7 +90,7 @@
when 'scanCode' then '扫码支付'
when 'cash' then '现金支付'
when 'wx_lite' then '小程序支付'
when 'deposit' then '储值卡支付'
when 'deposit' then '会员支付'
when 'bank' then '银行卡支付'
end as payType,
amount as amount