| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | 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>() {{ |
| | |
| | | |
| | | @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}); |
| | | } |
| | | |
| | | // 按selectCount降序排序(最大的排第一位) |
| | | 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")){ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |