From 92df7d1ba63ca874a639a3bf7a902331c5c415da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E9=B9=8F=E8=BE=89?= <18322780655@163.com> Date: Thu, 30 May 2024 11:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=A4=E7=8F=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/CloudPrinterService.java | 21 +++++++------- .../cashierservice/service/DutyService.java | 28 +++++++++---------- .../cashierservice/service/MemberService.java | 21 +++++++------- .../mapper/ShopUserDutyPayMapper.xml | 2 +- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java index 9a56d34..76f7d6f 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java @@ -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> categries= shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId()); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java index 4bacf73..f0bbfda 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java @@ -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 { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/MemberService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/MemberService.java index 487e681..70e64ef 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/MemberService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/MemberService.java @@ -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()); } diff --git a/src/main/resources/mapper/ShopUserDutyPayMapper.xml b/src/main/resources/mapper/ShopUserDutyPayMapper.xml index 371b820..b095647 100644 --- a/src/main/resources/mapper/ShopUserDutyPayMapper.xml +++ b/src/main/resources/mapper/ShopUserDutyPayMapper.xml @@ -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