| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | .eq("in_enable", "Y") |
| | | .eq("status", 1); |
| | | |
| | | if (hasConfig) { |
| | | wrapper.in("crn_no", allowedCrnNos); |
| | | } |
| | | |
| | | 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$(); |
| | |
| | | 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") |
| | | .eq("status", 1); |
| | | |
| | | if (hasConfig) { |
| | | wrapper.in("crn_no", allowedCrnNos); |
| | | } |
| | | |
| | | HashMap<Integer, Integer> map = new HashMap<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(wrapper); |