|
@@ -88,7 +88,7 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
|
|
|
@Override
|
|
|
public Integer edit(PayControlRule payControlRule){
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
- if(ExitsData(null,payControlRule.getName(),new BigInteger(String.valueOf(loginUser.getCustomerId()))))
|
|
|
+ if(ExitsData(payControlRule.getId().toString(),payControlRule.getName(),new BigInteger(String.valueOf(loginUser.getCustomerId()))))
|
|
|
throw new ServiceException(-99,"该阀控规则已存在!");
|
|
|
|
|
|
if(IsUsed(payControlRule.getId().intValue(),new BigInteger(loginUser.getCustomerId().toString()))){
|
|
@@ -166,14 +166,8 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
|
|
|
* @return true数据存在 false数据不存在
|
|
|
*/
|
|
|
public boolean ExitsData(String id,String name,BigInteger customerId){
|
|
|
- if(id != null){
|
|
|
- List<PayControlRule> payControlRules = payControlRuleMapper.ExitsData(id,null,customerId );
|
|
|
- if(payControlRules != null && payControlRules.size() >0)
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
if(name != null){
|
|
|
- List<PayControlRule> payControlRules = payControlRuleMapper.ExitsData(null,name,customerId);
|
|
|
+ List<PayControlRule> payControlRules = payControlRuleMapper.ExitsData(id,name,customerId);
|
|
|
if(payControlRules != null && payControlRules.size() > 0)
|
|
|
return true;
|
|
|
}
|