Browse Source

调整

master
zouhantao 1 week ago
parent
commit
a020d62edb

+ 41
- 11
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/manager/hltSendShort/SendShortManager.java View File

@@ -9,7 +9,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import cn.com.taiji.common.pub.BeanTools;
import cn.com.taiji.core.model.comm.protocol.ats.sendShort.*;
import com.esms.MOMsg;
import com.esms.PostMsg;
import com.esms.common.entity.Account;
import org.springframework.stereotype.Service;

import cn.com.taiji.ats.manager.request.HltSmsSendRequest;
@@ -82,20 +86,46 @@ public class SendShortManager {
}

public UpwardShortQueryResponse upwardShort(UpwardShortQueryRequest request) throws ServiceHandleException {
MTReport mtReport = new MTReport();
mtReport.setId("f97f1629be7e4363b1f109bc447ad594");
mtReport.setBatchID("123");
mtReport.setPhone("13888889999");
mtReport.setMsgID("测试");
mtReport.setCustomMsgID("13888889999");
mtReport.setState(1);
mtReport.setSubmitTime(1755484481);
mtReport.setDoneTime(1755484492);
List<MTReport> list = new ArrayList<>();
list.add(mtReport);
// MTReport mtReport = new MTReport();
// mtReport.setId("f97f1629be7e4363b1f109bc447ad594");
// mtReport.setBatchID("123");
// mtReport.setPhone("13888889999");
// mtReport.setMsgID("测试");
// mtReport.setCustomMsgID("13888889999");
// mtReport.setState(1);
// mtReport.setSubmitTime(1755484481);
// mtReport.setDoneTime(1755484492);
List<MTReport> list = test(request.getFetchSize());
// list.add(mtReport);
UpwardShortQueryResponse response = new UpwardShortQueryResponse();
response.setMTReports(list);
return response;
}

public List<MTReport> test(int fetchSize) {
Account account = new Account("admin@test1", "123456"); // 账号
final PostMsg pm = new PostMsg(false, 7000, 1); // 注意, 请使用单例模式, 而非每次下发new一次
pm.getCmHost().setHost("192.168.100.44", 9080); //设置网关的IP和port,用于发送信息
pm.getWsHost().setHost("192.168.100.44", 9070);
// pm.getCmHost().setHost("211.147.239.62", 9080); //设置网关的IP和port,用于发送信息
// pm.getWsHost().setHost("211.147.239.62", 9070);
MOMsg[] mos = new MOMsg[0];
List<MTReport> mtReportList = new ArrayList<>();
try {
mos = pm.getMOMsgs(account, fetchSize);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (mos != null) {
for (MOMsg mo : mos) {
System.out.println(mo);
MTReport mtReport = new MTReport();
BeanTools.copyProperties(mo, mtReport);
mtReportList.add(mtReport);
}
}
return mtReportList;
}


}

Loading…
Cancel
Save