calyrex 7.1 威威项目更新,亨通短信服务更新
parent
8a44b40d67
commit
973c3d3429
@ -1,15 +1,99 @@
|
|||||||
package com.weaver.seconddev.interfaces.workflow.message;
|
package com.weaver.seconddev.interfaces.workflow.message;
|
||||||
|
|
||||||
|
import com.linkage.netmsg.NetMsgclient;
|
||||||
|
import com.linkage.netmsg.server.ReceiveMsg;
|
||||||
import com.weaver.common.base.entity.result.WeaResult;
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
|
import com.weaver.common.i18n.tool.autocheck.util.RecordSet;
|
||||||
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
@Service("Message")
|
@Service("Message")
|
||||||
|
@Slf4j
|
||||||
public class SmsServiceImpl implements EsbServerlessRpcRemoteInterface {
|
public class SmsServiceImpl implements EsbServerlessRpcRemoteInterface {
|
||||||
|
|
||||||
|
private static NetMsgclient client = null;
|
||||||
|
|
||||||
|
private RecordSet rSet = null;
|
||||||
|
|
||||||
|
BufferedReader in = null;
|
||||||
|
|
||||||
|
// public static boolean init() {
|
||||||
|
// this.client = new NetMsgclient();
|
||||||
|
//// ReceiveDemo receiveDemo = new ReceiveDemo();
|
||||||
|
// ReceiveMsg receiveMsg = null;
|
||||||
|
// this.rSet = new RecordSet();
|
||||||
|
// this.client = this.client.initParameters("202.102.41.101", 9005, "0512C00119026", "htjt6800", receiveMsg);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public static boolean init() {
|
||||||
|
client = new NetMsgclient();
|
||||||
|
ReceiveDemo receiveDemo = new ReceiveDemo();
|
||||||
|
client = client.initParameters("202.102.41.101", 9005, "0512C00119026", "htjt6800", receiveDemo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean sendSMS(String paramString1, String paramString2, String paramString3) {
|
||||||
|
if (paramString2 == null || paramString3 == null)
|
||||||
|
return false;
|
||||||
|
if (!init())
|
||||||
|
return false;
|
||||||
|
// String str1 = Util.passwordBuilderNo(6);
|
||||||
|
// this.rSet.executeSql("update SMS_Message set smsCode = '" + str1 + "' where id =" + paramString1);
|
||||||
|
Vector vector = new Vector();
|
||||||
|
StringTokenizer stringTokenizer = new StringTokenizer(paramString2, ",");
|
||||||
|
while (stringTokenizer.hasMoreElements()) {
|
||||||
|
String str = (String)stringTokenizer.nextElement();
|
||||||
|
if (str.indexOf("-") != -1) {
|
||||||
|
long l1 = Long.parseLong(str.substring(0, str.indexOf("-")));
|
||||||
|
long l2 = Long.parseLong(str.substring(str.indexOf("-") + 1));
|
||||||
|
long l3 = l1;
|
||||||
|
while (l3 <= l2) {
|
||||||
|
vector.addElement(Long.toString(l3));
|
||||||
|
l3++;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
vector.addElement(str);
|
||||||
|
}
|
||||||
|
int i = vector.size();
|
||||||
|
String[] arrayOfString = new String[i];
|
||||||
|
String str2 = "";
|
||||||
|
try {
|
||||||
|
boolean bool = this.client.anthenMsg(this.client);
|
||||||
|
for (byte b = 0; b < i; b++) {
|
||||||
|
arrayOfString[b] = (String) vector.elementAt(b);
|
||||||
|
this.log.info("====mobiles[i]====" + arrayOfString[b]);
|
||||||
|
String str = this.client.sendMsg(this.client, 1, arrayOfString[b], paramString3, 1);
|
||||||
|
this.log.info("====returnvalue====" + str);
|
||||||
|
}
|
||||||
|
this.client.closeConn();
|
||||||
|
} catch (Exception exception) {
|
||||||
|
exception.printStackTrace();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
|
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
client = new NetMsgclient();
|
||||||
|
ReceiveDemo receiveDemo = new ReceiveDemo();
|
||||||
|
client = client.initParameters("202.102.41.101", 9005, "0512C00119026", "htjt6800", receiveDemo);
|
||||||
|
client.anthenMsg(client);
|
||||||
|
String str = client.sendMsg(client, 1, "1585856015", "test", 1);
|
||||||
|
System.out.println(str);
|
||||||
|
client.closeConn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.weaver.seconddev.interfaces.workflow.message;
|
||||||
|
|
||||||
|
import com.linkage.netmsg.NetMsgclient;
|
||||||
|
import com.weaver.common.base.entity.result.WeaResult;
|
||||||
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: calyrex
|
||||||
|
* @CreateTime: 2025-07-01
|
||||||
|
* @Description: 短信服务测试
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service("workflow_action_SmsTestAction")
|
||||||
|
@Slf4j
|
||||||
|
public class SmsTestAction implements EsbServerlessRpcRemoteInterface {
|
||||||
|
|
||||||
|
private NetMsgclient client = null;
|
||||||
|
@Override
|
||||||
|
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
|
||||||
|
String bs = String.valueOf(params.getOrDefault("bs", -1));
|
||||||
|
String fsr = String.valueOf(params.getOrDefault("fsr", -1));
|
||||||
|
String jsr = String.valueOf(params.getOrDefault("jsr", -1));
|
||||||
|
String nr = String.valueOf(params.getOrDefault("nr", -1));
|
||||||
|
log.info("bs:"+bs+" fsr:"+fsr+" jsr:"+jsr+" nr:"+nr);
|
||||||
|
client = new NetMsgclient();
|
||||||
|
ReceiveDemo receiveDemo = new ReceiveDemo();
|
||||||
|
client = client.initParameters("202.102.41.101", 9005, "0512C00119026", "htjt6800", receiveDemo);
|
||||||
|
try {
|
||||||
|
client.anthenMsg(client);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
String str = client.sendMsg(client, 1, "1585856015", "test", 1);
|
||||||
|
log.info("str====="+str);
|
||||||
|
client.closeConn();
|
||||||
|
return WeaResult.success();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue