|
|
|
@ -2,7 +2,6 @@ package com.weaver.sxjg.esb;
|
|
|
|
|
|
|
|
|
|
import com.weaver.ebuilder.common.exception.BusinessException;
|
|
|
|
|
import com.weaver.esb.api.rpc.EsbRpcRemoteInterface;
|
|
|
|
|
import org.apache.commons.configuration.Configuration;
|
|
|
|
|
import org.apache.commons.configuration.ConfigurationException;
|
|
|
|
|
import org.apache.commons.configuration.PropertiesConfiguration;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
@ -23,11 +22,16 @@ import java.util.Map;
|
|
|
|
|
@Service("esbRpcRemoteSendDx_sj")
|
|
|
|
|
public class EsbRpcRemoteSendDx implements EsbRpcRemoteInterface {
|
|
|
|
|
public EsbRpcRemoteSendDx() {
|
|
|
|
|
PropertiesConfiguration p = null;
|
|
|
|
|
try {
|
|
|
|
|
Configuration p = new PropertiesConfiguration("config/sxjg.properties");
|
|
|
|
|
p = new PropertiesConfiguration();
|
|
|
|
|
p.setEncoding("utf-8");
|
|
|
|
|
p.setFileName("config/sxjg.properties");
|
|
|
|
|
p.load();
|
|
|
|
|
this.setPwd(p.getString("message.Pwd"));
|
|
|
|
|
this.setUrl(p.getString("message.url"));
|
|
|
|
|
this.setCorpID(p.getString("message.CorpID"));
|
|
|
|
|
this.setQm(p.getString("message.qm"));
|
|
|
|
|
}catch (ConfigurationException e) {
|
|
|
|
|
throw new BusinessException("获取sxjg.properties配置文件失败,", e);
|
|
|
|
|
}
|
|
|
|
@ -36,10 +40,19 @@ public class EsbRpcRemoteSendDx implements EsbRpcRemoteInterface {
|
|
|
|
|
private String corpID;
|
|
|
|
|
private String pwd;
|
|
|
|
|
private String url;
|
|
|
|
|
private String qm;
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> execute(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> rs = new HashMap<>();
|
|
|
|
|
String content = (String)params.get("content");
|
|
|
|
|
String content1 = (String)params.get("content");
|
|
|
|
|
log.error("sj二开qm配置:"+this.getQm());
|
|
|
|
|
String content = "";
|
|
|
|
|
//处理系统中的签名问题,第三方系统会在短信尾加上签名,这里需要将系统拼接的去掉。
|
|
|
|
|
if(content1.startsWith(this.getQm())) {
|
|
|
|
|
content = content1.split(this.getQm(),2)[1].trim();
|
|
|
|
|
}else {
|
|
|
|
|
content = content1;
|
|
|
|
|
}
|
|
|
|
|
String mobile = (String)params.get("mobile");
|
|
|
|
|
String send_time = "";
|
|
|
|
|
String cell = "";
|
|
|
|
@ -80,7 +93,6 @@ public class EsbRpcRemoteSendDx implements EsbRpcRemoteInterface {
|
|
|
|
|
rs.put("description",String.valueOf(inputLine));
|
|
|
|
|
return rs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getCorpID() {
|
|
|
|
|
return corpID;
|
|
|
|
|
}
|
|
|
|
@ -104,4 +116,13 @@ public class EsbRpcRemoteSendDx implements EsbRpcRemoteInterface {
|
|
|
|
|
public void setUrl(String url) {
|
|
|
|
|
this.url = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getQm() {
|
|
|
|
|
return qm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setQm(String qm1) {
|
|
|
|
|
String qm2 = "【"+qm1+"】";
|
|
|
|
|
this.qm = qm2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|