修改机构参数判断

This commit is contained in:
yuyang 2022-01-11 17:26:29 +08:00
parent 9f41267206
commit 060054078f
2 changed files with 9 additions and 7 deletions

View File

@ -206,7 +206,7 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
BigDecimal rechargeMoney = xhpcCommunityPersonnel.getRechargeMoney(); BigDecimal rechargeMoney = xhpcCommunityPersonnel.getRechargeMoney();
Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId(); Long communityPersonnelId = xhpcCommunityPersonnel.getCommunityPersonnelId();
if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ if(rechargeMoney !=null &&new BigDecimal(0).compareTo(rechargeMoney)==-1){
//增加社区用户的剩余金额 //增加社区用户的剩余金额
Map<String, Object> communityPersonnelById = xhpcCommunityMapper.getCommunityPersonnelById(communityPersonnelId, null, null, 1); Map<String, Object> communityPersonnelById = xhpcCommunityMapper.getCommunityPersonnelById(communityPersonnelId, null, null, 1);
if(communityPersonnelById !=null){ if(communityPersonnelById !=null){

View File

@ -55,7 +55,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
@Override @Override
public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) { public AjaxResult addCustomers(HttpServletRequest request, XhpcCustomers xhpcCustomers) {
boolean b = judgeXhpcCustomers(xhpcCustomers); boolean b = judgeXhpcCustomers(xhpcCustomers);
if(b){ if(!b){
return AjaxResult.error("参数比传"); return AjaxResult.error("参数比传");
} }
//名称重复不能入库 //名称重复不能入库
@ -114,7 +114,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
@Override @Override
public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) { public AjaxResult updateCustomers(XhpcCustomers xhpcCustomers) {
boolean b = judgeXhpcCustomers(xhpcCustomers); boolean b = judgeXhpcCustomers(xhpcCustomers);
if(b){ if(!b){
return AjaxResult.error("参数比传"); return AjaxResult.error("参数比传");
} }
//名称重复不能入库 //名称重复不能入库
@ -166,9 +166,11 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
} }
} }
xhpcCustomersMapper.addCustomersPersonnel(xhpcCustomersPersonnel); xhpcCustomersMapper.addCustomersPersonnel(xhpcCustomersPersonnel);
//增加一条充值记录 if(rechargeMoney !=null){
if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ //增加一条充值记录
mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT); if(new BigDecimal(0).compareTo(rechargeMoney)==-1){
mechanismService.addRechargeOrder(xhpcCustomersPersonnel.getCustomersPersonnelId(),UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,rechargeMoney,UserTypeUtil.RECHARGE_PT);
}
} }
return AjaxResult.success(); return AjaxResult.success();
} }
@ -217,7 +219,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
public AjaxResult addRecharge(XhpcCustomersPersonnel xhpcCustomersPersonnel) { public AjaxResult addRecharge(XhpcCustomersPersonnel xhpcCustomersPersonnel) {
BigDecimal rechargeMoney = xhpcCustomersPersonnel.getRechargeMoney(); BigDecimal rechargeMoney = xhpcCustomersPersonnel.getRechargeMoney();
Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId(); Long customersPersonnelId = xhpcCustomersPersonnel.getCustomersPersonnelId();
if(new BigDecimal(0).compareTo(rechargeMoney)==-1){ if(rechargeMoney !=null && new BigDecimal(0).compareTo(rechargeMoney)==-1){
//增加社区用户的剩余金额 //增加社区用户的剩余金额
Map<String, Object> communityPersonnelById = xhpcCustomersMapper.getCustomersPersonnelById(customersPersonnelId, null, null, 1); Map<String, Object> communityPersonnelById = xhpcCustomersMapper.getCustomersPersonnelById(customersPersonnelId, null, null, 1);
if(communityPersonnelById !=null){ if(communityPersonnelById !=null){