瀏覽代碼

上行单例模式

master
zouhantao 1 周之前
父節點
當前提交
6fa3ce824f

+ 12
- 0
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/config/AppConfig.java 查看文件



import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;


import com.esms.PostMsg;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
.callTimeout(4000, TimeUnit.SECONDS)// 整个调用过程超时 .callTimeout(4000, TimeUnit.SECONDS)// 整个调用过程超时
.build(); .build();
} }

@Bean
public PostMsg postMsg() {
PostMsg postMsg = new PostMsg();
// 内网地址
// 设置发送短信的网关
postMsg.getCmHost().setHost("192.168.100.112", 8090);
// 设置用户获取账号信息、上行、状态报告等的网关
postMsg.getWsHost().setHost("192.168.100.112", 8088);
return postMsg;
}
} }

+ 7
- 13
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/manager/hltSendShort/SendShortManager.java 查看文件

import com.esms.MOMsg; import com.esms.MOMsg;
import com.esms.PostMsg; import com.esms.PostMsg;
import com.esms.common.entity.Account; import com.esms.common.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


import cn.com.taiji.ats.manager.request.HltSmsSendRequest; import cn.com.taiji.ats.manager.request.HltSmsSendRequest;
return response; return response;
} }


// private static PostMsg pm;
// static {
// pm = new PostMsg();
// // 内网地址
// // 设置发送短信的网关
// pm.getCmHost().setHost("192.168.100.112", 8090);
// // 设置用户获取账号信息、上行、状态报告等的网关
// pm.getWsHost().setHost("192.168.100.112", 8088);
// }
@Autowired
private PostMsg pm;
public List<MTReport> getUpward(int fetchSize) { public List<MTReport> getUpward(int fetchSize) {
System.out.println("-----------------------------------开始初始化------------------------------------"); System.out.println("-----------------------------------开始初始化------------------------------------");
Account account = new Account("QTZL20240529", "ATuwRFkX"); // 账号
PostMsg pm = new PostMsg();
pm.getCmHost().setHost("192.168.100.112", 9080);
pm.getWsHost().setHost("192.168.100.112", 8088);
Account account = new Account("chexingzhushou", "TYOIsakY"); // 账号
// PostMsg pm = new PostMsg();
// pm.getCmHost().setHost("192.168.100.112", 8090);
// pm.getWsHost().setHost("192.168.100.112", 8088);
MOMsg[] mos = new MOMsg[0]; MOMsg[] mos = new MOMsg[0];
List<MTReport> mtReportList = new ArrayList<>(); List<MTReport> mtReportList = new ArrayList<>();
System.out.println("-----------------------------------开始访问------------------------------------"); System.out.println("-----------------------------------开始访问------------------------------------");

Loading…
取消
儲存