|
@@ -112,20 +112,30 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
|
|
|
public Integer disable(String id,String disable){
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
|
|
|
- if(disable.equals("1")){
|
|
|
+ /*if(disable.equals("1")){
|
|
|
if(IsUsed(Integer.parseInt(id),new BigInteger(loginUser.getCustomerId().toString()))){
|
|
|
throw new ServiceException(-99,"该阀控规则已有用户应用,关闭后将对所有对应用户停用该规则,是否继续?");
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
PayControlRule payControlRule = new PayControlRule();
|
|
|
payControlRule.setId(new BigInteger(id));
|
|
|
payControlRule.setDisable(Integer.parseInt(disable));
|
|
|
+ payControlRule.setCustomerId(new BigInteger(loginUser.getCustomerId().toString()));
|
|
|
|
|
|
Integer result = payControlRuleMapper.edit(payControlRule);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Integer used(String id){
|
|
|
+ LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
+ if(IsUsed(Integer.parseInt(id),new BigInteger(loginUser.getCustomerId().toString()))){
|
|
|
+ return 1; //已使用
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 阀控规则已使用
|
|
|
* @param id 规则id
|
|
@@ -133,6 +143,7 @@ public class PayControlRuleServiceImpl implements PayControlRuleService {
|
|
|
* @return true已使用
|
|
|
*/
|
|
|
public boolean IsUsed(Integer id,BigInteger custoemrId){
|
|
|
+
|
|
|
String result = payControlRuleMapper.isUsed(id,custoemrId);
|
|
|
if(result != null){
|
|
|
String[] sp = result.split(",");
|