#
Junjie
2026-01-15 e14a4372b6bd4a38e40a3a68bde32350d96071ab
src/main/java/com/zy/asrs/utils/Utils.java
@@ -11,9 +11,11 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.BasDualCrnp;
import com.zy.asrs.entity.BasStationDevice;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.BasDualCrnpService;
import com.zy.asrs.service.BasStationDeviceService;
import com.zy.asrs.service.WrkMastService;
import com.zy.common.model.NavigateNode;
import com.zy.common.utils.NavigateUtils;
@@ -168,6 +170,18 @@
            NavigateUtils navigateUtils = SpringUtils.getBean(NavigateUtils.class);
            WrkMastService wrkMastService = SpringUtils.getBean(WrkMastService.class);
            BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class);
            BasStationDeviceService basStationDeviceService = SpringUtils.getBean(BasStationDeviceService.class);
            List<BasStationDevice> stationDevices = basStationDeviceService.selectList(new EntityWrapper<BasStationDevice>().eq("station_id", stationId));
            boolean hasConfig = !stationDevices.isEmpty();
            List<Integer> allowedCrnNos = new ArrayList<>();
            if (hasConfig) {
                for (BasStationDevice sd : stationDevices) {
                    if (SlaveType.Crn.toString().equals(sd.getDeviceType())) {
                        allowedCrnNos.add(sd.getDeviceNo());
                    }
                }
            }
            Integer currentCircleTaskCrnNo = null;
            Object object = redisUtil.get(RedisKeyType.CURRENT_CIRCLE_TASK_CRN_NO.key);
@@ -181,8 +195,14 @@
            if (currentCircleTaskCrnNo != null) {
                currentCircleTaskCrnNo = currentCircleTaskCrnNo + 1;
                BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", currentCircleTaskCrnNo));
                List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", currentCircleTaskCrnNo));
                BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>()
                        .eq("crn_no", currentCircleTaskCrnNo)
                        .eq("in_enable", "Y")
                        .eq("status", 1)
                );
                List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                        .eq("crn_no", currentCircleTaskCrnNo)
                );
                if (currentCrnTask.size() <= 1) {
                    if (basCrnp != null) {
                        List<List<Integer>> rowList = basCrnp.getControlRows$();
@@ -257,12 +277,21 @@
            enabledCrnps.sort(Comparator.comparingInt(o -> map.getOrDefault(o.getCrnNo(), 0)));
            List<Integer> recommendList = new ArrayList<>();
            List<Integer> baseRowList = new ArrayList<>();
            for (BasCrnp basCrnp : enabledCrnps) {
                List<List<Integer>> rowList = basCrnp.getControlRows$();
                for (List<Integer> rows : rowList) {
                    list.addAll(rows);
                    if(allowedCrnNos.contains(basCrnp.getCrnNo())) {
                        recommendList.addAll(rows);
                    }else {
                        baseRowList.addAll(rows);
                    }
                }
            }
            list.addAll(recommendList);
            list.addAll(baseRowList);
        } catch (Exception e) {
            e.printStackTrace();
        }
@@ -277,6 +306,18 @@
            NavigateUtils navigateUtils = SpringUtils.getBean(NavigateUtils.class);
            WrkMastService wrkMastService = SpringUtils.getBean(WrkMastService.class);
            BasDualCrnpService basDualCrnpService = SpringUtils.getBean(BasDualCrnpService.class);
            BasStationDeviceService basStationDeviceService = SpringUtils.getBean(BasStationDeviceService.class);
            List<BasStationDevice> stationDevices = basStationDeviceService.selectList(new EntityWrapper<BasStationDevice>().eq("station_id", stationId));
            boolean hasConfig = !stationDevices.isEmpty();
            List<Integer> allowedCrnNos = new ArrayList<>();
            if (hasConfig) {
                for (BasStationDevice sd : stationDevices) {
                    if (SlaveType.Crn.toString().equals(sd.getDeviceType())) {
                        allowedCrnNos.add(sd.getDeviceNo());
                    }
                }
            }
            Wrapper<BasDualCrnp> wrapper = new EntityWrapper<BasDualCrnp>()
                    .eq("in_enable", "Y")
@@ -345,12 +386,21 @@
            enabledCrnps.sort(Comparator.comparingInt(o -> map.getOrDefault(o.getCrnNo(), 0)));
            List<Integer> recommendList = new ArrayList<>();
            List<Integer> baseRowList = new ArrayList<>();
            for (BasDualCrnp basDualCrnp : enabledCrnps) {
                List<List<Integer>> rowList = basDualCrnp.getControlRows$();
                for (List<Integer> rows : rowList) {
                    list.addAll(rows);
                    if(allowedCrnNos.contains(basDualCrnp.getCrnNo())) {
                        recommendList.addAll(rows);
                    }else {
                        baseRowList.addAll(rows);
                    }
                }
            }
            list.addAll(recommendList);
            list.addAll(baseRowList);
        } catch (Exception e) {
            e.printStackTrace();
        }