From 060054078f99e1b62f831b5875c15f5788c6331f Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 11 Jan 2022 17:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=BA=E6=9E=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/XhpcCommunityServiceImpl.java | 2 +- .../service/impl/XhpcCustomersServiceImpl.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java index 0df70871..7f8926f5 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java @@ -206,7 +206,7 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService { BigDecimal rechargeMoney = xhpcCommunityPersonnel.getRechargeMoney(); Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId(); - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + if(rechargeMoney !=null &&new BigDecimal(0).compareTo(rechargeMoney)==-1){ //增加社区用户的剩余金额 Map communityPersonnelById = xhpcCommunityMapper.getCommunityPersonnelById(communityPersonnelId, null, null, 1); if(communityPersonnelById !=null){ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java index 0a0c2e67..a7f59f76 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java @@ -55,7 +55,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) { boolean b = judgeXhpcCustomers(xhpcCustomers); - if(b){ + if(!b){ return AjaxResult.error("参数比传"); } //名称重复不能入库 @@ -114,7 +114,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { @Override public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) { boolean b = judgeXhpcCustomers(xhpcCustomers); - if(b){ + if(!b){ return AjaxResult.error("参数比传"); } //名称重复不能入库 @@ -166,9 +166,11 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { } } xhpcCustomersMapper.addCustomersPersonnel(xhpcCustomersPersonnel); - //增加一条充值记录 - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ - mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); + if(rechargeMoney !=null){ + //增加一条充值记录 + if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); + } } return AjaxResult.success(); } @@ -217,7 +219,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService { public AjaxResult addRecharge(XhpcCustomersPersonnel xhpcCustomersPersonnel) { BigDecimal rechargeMoney = xhpcCustomersPersonnel.getRechargeMoney(); Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId(); - if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ + if(rechargeMoney !=null && new BigDecimal(0).compareTo(rechargeMoney)==-1){ //增加社区用户的剩余金额 Map communityPersonnelById = xhpcCustomersMapper.getCustomersPersonnelById(customersPersonnelId, null, null, 1); if(communityPersonnelById !=null){