From aaf4f788120b7221c5b9377e196848dd9ec4e962 Mon Sep 17 00:00:00 2001 From: wangfei <3597712270@qq.com> Date: 星期四, 22 八月 2024 10:18:25 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes --- hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java | 34 ++++++++++++++-------------------- 1 files changed, 14 insertions(+), 20 deletions(-) diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java index 0f2d45c..3dcf2d7 100644 --- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java +++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java @@ -21,7 +21,6 @@ import com.mes.glassinfo.service.GlassInfoService; import com.mes.taskcache.entity.TaskCache; import com.mes.taskcache.service.TaskCacheService; -import com.mes.temperingglass.entity.TemperingGlassInfo; import com.mes.tools.WebSocketServer; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -87,9 +86,9 @@ @Value("${mes.min.two.secondLength}") private String minTwoSecondLength; - public static String engineerId=""; + public static String engineerId = ""; - @Scheduled(fixedDelay = 1000) +// @Scheduled(fixedDelay = 1000) public void plcHomeEdgTask() { Date startDate = new Date(); log.info("鏈浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate); @@ -140,11 +139,12 @@ Date endDate = new Date(); log.info("鏈浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms", endDate, endDate.getTime() - startDate.getTime()); } + @Scheduled(fixedDelay = 1000) - public void temperingIsRun(){ + public void temperingIsRun() { JSONObject jsonObject = new JSONObject(); //姝e湪杩涜鐨勪换鍔� - List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun(); + List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun(); jsonObject.append("taskCaches", taskCaches); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun"); if (sendwServer != null) { @@ -157,6 +157,7 @@ } } } + /** * 杩涚墖浠诲姟 * @@ -316,7 +317,7 @@ BeanUtils.copyProperties(one, resultDetails); glassInfo = resultDetails; } else { - log.info("鑾峰彇绗煎唴鐜荤拑鍜屽甫杩涚墖鐜荤拑涓虹┖鎴栬�呬笉绗﹀悎纾ㄨ竟灏哄"); + log.info("鑾峰彇绗煎唴鐜荤拑鍜屽緟杩涚墖鐜荤拑涓虹┖鎴栬�呬笉绗﹀悎纾ㄨ竟灏哄"); } } else { glassInfo = queryMinGlass(list.get(0).getWidth(), list.get(0).getHeight(), glassId); @@ -530,12 +531,12 @@ if (endcell == Const.A10_OUT_TARGET_POSITION) { wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + - "on t.glass_id = t1.glass_id and (t1.first_length between " + minTwoFirstLength + " and " + firstLength - + " and t1.second_length between " + minTwoSecondLength + " and " + secondLength + ") "); + "on t.glass_id = t1.glass_id and (t1.first_length >= " + minOneFirstLength + " and t1.second_length >= " + minOneSecondLength); } else { wrapper.innerJoin("(select glass_id, case when height <= width then width else height end as first_length, " + "case when width < height then width else height end as second_length from edg_storage_cage_details) t1 " + - "on t.glass_id = t1.glass_id and (t1.first_length >=" + minOneFirstLength + " and t1.second_length>=" + minOneSecondLength + ") "); + "on t.glass_id = t1.glass_id and (t1.first_length between " + minTwoFirstLength + " and " + firstLength + + " and t1.second_length between " + minTwoSecondLength + " and " + secondLength + ") "); } wrapper.last("order by count(t.glass_id) desc limit 2"); List<EdgStorageCageDetails> list = edgStorageCageDetailsService.list(wrapper); @@ -698,15 +699,7 @@ @Scheduled(fixedDelay = 1000) public void CacheGlassTasks() { JSONObject jsonObject = new JSONObject(); - List<Map<String, Object>> currentCutTerritorys= edgStorageCageDetailsService.selectCutTerritory(); -// List<Map<String, Object>> currentCutTerritorys=new ArrayList<>(); -// if(engineerId==null||engineerId.isEmpty()){ -// //璇嗗埆鎽嗙墖 褰撳墠鐗堝浘鏁版嵁 -// currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); -// }else{ -// //璇嗗埆鎽嗙墖 姝ngineerId 宸ョ▼鐗堝浘鏁版嵁 -// currentCutTerritorys = edgStorageCageDetailsService.selectCurrentCutTerritory(engineerId); -// } + List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); jsonObject.append("currentCutTerritory", currentCutTerritorys); //log.info("鏈璇嗗埆鐗堝浘{},++++{}",engineerId,currentCutTerritorys); //纾ㄨ竟淇℃伅 @@ -736,10 +729,10 @@ } } @Scheduled(fixedDelay = 1000) - public void cacheGlassIsRun(){ + public void cacheGlassIsRun() { JSONObject jsonObject = new JSONObject(); //姝e湪杩涜鐨勪换鍔� - List<TaskCache>taskCaches=taskCacheService.selectTaskCacheIsRun(); + List<TaskCache> taskCaches = taskCacheService.selectTaskCacheIsRun(); jsonObject.append("taskCaches", taskCaches); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlassIsRun"); if (sendwServer != null) { @@ -753,4 +746,5 @@ } } + } -- Gitblit v1.8.0