58 lines
1.0 KiB
Java
58 lines
1.0 KiB
Java
package com.tenwa.customer.controller.group;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.tenwa.reckon.util.Conn;
|
|
|
|
public class CheckMessageWay {
|
|
|
|
private String dealersnumber;//渠道编号
|
|
private String id;
|
|
|
|
|
|
|
|
public String getDealersnumber() {
|
|
return dealersnumber;
|
|
}
|
|
|
|
|
|
|
|
public void setDealersnumber(String dealersnumber) {
|
|
this.dealersnumber = dealersnumber;
|
|
}
|
|
|
|
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
|
|
|
|
//校验自动卡扣取消设置渠道商是否重复
|
|
public String checkMessageWay(JBOTransaction tx) throws Exception{
|
|
Conn conn = new Conn(tx);
|
|
String sql = "select id from DEDUCTIONS_WAY where dealers_number=? ";
|
|
List<Map<String, String>> results = conn.executeQuery(sql, dealersnumber);
|
|
if(id==null&&results.size()>0){
|
|
return "渠道商已存在!!!";
|
|
}else if (id != null ){
|
|
for (Map<String, String> map : results) {
|
|
if(!id.equals(map.get("id"))){
|
|
return "渠道商已存在!!!";
|
|
}
|
|
}
|
|
}
|
|
return "true";
|
|
|
|
}
|
|
}
|