自动化立体仓库 - WMS系统
*
L
6 天以前 534c10d070b5396d22dad2778d159899c36cfa3c
*
1个文件已修改
48 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/task/WrkMastStaInIt3Scheduler.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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});
        }
// 按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")){
@@ -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;
        }
    }
}