From 534c10d070b5396d22dad2778d159899c36cfa3c Mon Sep 17 00:00:00 2001 From: L <L@123> Date: 星期二, 15 七月 2025 11:50:03 +0800 Subject: [PATCH] * --- src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java b/src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java index ddba2a6..15499ea 100644 --- a/src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java +++ b/src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -41,7 +42,7 @@ public static final List<Integer> STA_WORK_CU = new ArrayList<Integer>() {{ - add(101);add(102);add(104);add(105);add(107);add(108); + add(101);add(104);add(107); }}; public static final List<Integer> STA_WORK_CU_CAR = new ArrayList<Integer>() {{ @@ -65,7 +66,19 @@ @Scheduled(cron = "0/1 * * * * ? ") private void execute(){ + List<Integer> integers_STA_WORK_CU = new ArrayList<>(); + List<int[]> list = new ArrayList<>(); for(Integer staNo : STA_WORK_CU){ + Integer crnNo = getCrnNo(staNo); + int selectCount = wrkMastService.selectCount( + new EntityWrapper<WrkMast>().eq("crn_no", crnNo).eq("wrk_sts", 11)); + list.add(new int[]{staNo, selectCount}); + } + +// 鎸塻electCount闄嶅簭鎺掑簭锛堟渶澶х殑鎺掔涓�浣嶏級 + Collections.sort(list, (a, b) -> b[1] - a[1]); // 闄嶅簭鎺掑垪 +// 濡傛灉鎮ㄩ渶瑕佽浆涓烘暟缁勶紙鍙�夛級 + for(Integer staNo : integers_STA_WORK_CU){ try{ BasDevp basDevp = basDevpService.selectById(staNo); if (basDevp.getWrkNo()!=0 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y")){ @@ -322,4 +335,37 @@ return false; } + + + public Integer getCrnNo(Integer staNo){ + switch (staNo){ + case 100: + case 101: + case 102: + return 1; + case 103: + case 104: + case 105: + return 2; + case 106: + case 107: + case 108: + return 3; + case 109: + case 110: + case 111: + return 4; + case 112: + case 113: + case 114: + return 5; + case 115: + case 116: + case 117: + return 6; + default: + return 0; + } + } + } -- Gitblit v1.9.1