From 90596ce75f2a1e910fea4d180a3ebd7d70d38ab1 Mon Sep 17 00:00:00 2001 From: zhangc <zc@123> Date: 星期四, 12 十二月 2024 16:53:08 +0800 Subject: [PATCH] 修复配置及代码逻辑,优化异常处理和日志记录 --- src/main/java/com/zy/asrs/task/AgvWrkMastScheduler.java | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/AgvWrkMastScheduler.java b/src/main/java/com/zy/asrs/task/AgvWrkMastScheduler.java index 14544b6..7e56563 100644 --- a/src/main/java/com/zy/asrs/task/AgvWrkMastScheduler.java +++ b/src/main/java/com/zy/asrs/task/AgvWrkMastScheduler.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; import com.core.common.Cools; +import com.core.common.DateUtils; import com.zy.asrs.entity.AgvBasDevp; import com.zy.asrs.entity.AgvWrkMast; import com.zy.asrs.service.AgvBasDevpService; @@ -18,6 +19,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -44,7 +46,7 @@ 瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负205.宸ヤ綔瀹屾垚 涓� 锛�1.鍏ュ簱 || 53锛屾嫞鏂欏叆搴� || 57.鐩樼偣鍏ュ簱 || 10.绌烘澘鍏ュ簱 || 11.鍗曞眰绉诲簱 || 12.璺ㄥ眰绉诲簱 || 108.鑷姩璋冩嫧 || 109.鎵嬪姩璋冩嫧)鐨勬暟鎹� */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) + @Scheduled(fixedDelay = 1000) public void excutePutwayWrk(){ List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() .eq("wrk_sts", 205) @@ -68,6 +70,7 @@ try{ agvWrkMastHandler.completedPutWayWrk(agvWrkMast); } catch (Exception e){ + e.printStackTrace(); log.error("宸ヤ綔鍙�"+agvWrkMast.getWrkNo()+"瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负205,澶勭悊澶辫触锛�===銆嬪紓甯稿師鍥狅細"+e.getMessage()); } }); @@ -78,7 +81,7 @@ 瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负206.鍑哄簱瀹屾垚 涓� (101.鍑哄簱 || 110.绌烘澘鍑哄簱) */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) + @Scheduled(fixedDelay = 1000) public void excuteCarryWrk(){ List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() .eq("wrk_sts", 206) @@ -101,7 +104,7 @@ 瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负206.鍑哄簱瀹屾垚 涓� (101.鍑哄簱 || 110.绌烘澘鍑哄簱) */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) + @Scheduled(fixedDelay = 1000) public void excuteCarryWrk2(){ List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() .eq("wrk_sts", 208) @@ -124,8 +127,8 @@ 瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负201.鐢熸垚鍏ュ簱浠诲姟ID 涓�(鍑哄簱绫诲瀷涓� 53.鎷f枡鍐嶅叆搴� || 1.鍏ュ簱 || 10.绌烘澘鍏ュ簱鏍� || 57.鐩樼偣鍐嶅叆搴�)鐨勬暟鎹� */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) - public void startPutwayWrk(){ + @Scheduled(fixedDelay = 3000) + public synchronized void startPutwayWrk(){ List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) ,new EntityWrapper<AgvWrkMast>() .eq("wrk_sts", 201) @@ -159,7 +162,7 @@ 瀹氭椂澶勭悊AGV宸ヤ綔妗d腑宸ヤ綔鐘舵�佷负201.鐢熸垚鍏ュ簱浠诲姟ID 涓�(鍑哄簱绫诲瀷涓� 53.鎷f枡鍐嶅叆搴� || 1.鍏ュ簱 || 10.绌烘澘鍏ュ簱鏍� || 57.鐩樼偣鍐嶅叆搴�)鐨勬暟鎹� */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) + @Scheduled(fixedDelay = 1000) public void startAllcationIn(){ List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) ,new EntityWrapper<AgvWrkMast>() @@ -250,7 +253,7 @@ 鑷姩鐢熸垚绌烘澘鍑哄簱浠诲姟 */ //@Scheduled(cron = "0/1 * * * * ? ") - @Scheduled(fixedDelay = 2000) + @Scheduled(fixedDelay = 1000) public void autoEmptyOut(){ boolean packageEmptyAutoOUt = Cools.eq("Y",Parameter.get().getPackageEmptyAutoOUt()); boolean mateEmptyAutoOut = Cools.eq("Y",Parameter.get().getMateEmptyAutoOut()); -- Gitblit v1.9.1