|
@@ -428,6 +428,7 @@ public class DeviceCollectionTaskJob {
|
|
|
//机床报警信息数据采集
|
|
|
@Scheduled(cron = "*/20 * * * * ?")
|
|
|
public void toolWarinCJ() {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
Set<Map.Entry<String, String>> entries = map.entrySet();
|
|
|
entries.stream().parallel().forEach(vo->{
|
|
|
try{
|
|
@@ -466,22 +467,24 @@ public class DeviceCollectionTaskJob {
|
|
|
@Scheduled(cron = "*/20 * * * * ?")
|
|
|
public void plcWarinCJ() {
|
|
|
try{
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
Object map = msgUtil.redis_get(CacheKey.PLC_COSTOM_ADDRESS);
|
|
|
List<PlcCostomAddress> list=null;
|
|
|
if(map == null) {
|
|
|
list = plcCostomAddressMapper.getAddressList();
|
|
|
List<String> addressList=list.stream().map(PlcCostomAddress::getAddress).collect(Collectors.toList());
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String addressListJson = objectMapper.writeValueAsString(addressList);
|
|
|
- msgUtil.redis_set(CacheKey.PLC_COSTOM_ADDRESS , addressListJson);
|
|
|
+ String str=String.join(",",addressList);
|
|
|
+ msgUtil.redis_set(CacheKey.PLC_COSTOM_ADDRESS , str);
|
|
|
}
|
|
|
|
|
|
long l = System.currentTimeMillis();
|
|
|
//log.info("成航发PLC报警信息数据采集——开始:"+l);
|
|
|
- BaseContextHandler.setTenant("0000");
|
|
|
String httpserverUrl="http://localhost:8089/api/JobTasks/DataCollectS7JobWarn";
|
|
|
//log.info("成航PLC报警信息数据采集,已请求");
|
|
|
String resultData = msgUtil.httpForPost(httpserverUrl, null);
|
|
|
+ if(resultData==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
//log.info("成航发PLC报警信息数据采集——返回:"+resultData);
|
|
|
//long l1 = System.currentTimeMillis() - l;
|
|
|
PlcCostomAddressHistory plcCostomAddressHistory=new PlcCostomAddressHistory();
|