| | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.WorkMastHandler; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private String shuttleWcsUrl; |
| | | @Autowired |
| | | private LocMastServiceImpl locMastService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") //入库任务下发 |
| | | private void ShuttleInTaskSend() { |
| | | procesMode(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .eq("wrk_sts", 2).in("io_type", 1, 10, 53, 54, 57).eq("crn_no", 7)); |
| | | if (Cools.isEmpty(wrkMasts)) { |
| | |
| | | |
| | | try { |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (wrkMast.getStaNo() == 1031) { |
| | | Config config = configService.selectConfigByCode("2.5F_Mode"); |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | if (config.getValue().equalsIgnoreCase("1")) { |
| | | log.info("模式不对2"); |
| | | return; |
| | | } |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | if (locMast == null) { |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | | } |
| | | |
| | | String loc; |
| | | if ((locMast.getRow1() - 4) >= 10) { |
| | | loc = (locMast.getRow1() - 4) + locMast.getLocNo().substring(2); |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") //出库库任务下发 |
| | | private void ShuttleOutTaskSend() { |
| | | procesMode(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 101, 110, 103, 104, 107) |
| | | .eq("wrk_sts", 11).eq("crn_no", 7)); |
| | | if (Cools.isEmpty(wrkMasts)) { |
| | | return; |
| | | } |
| | | // List<WrkMast> wrkMasts = wrkMastService.selectToShuttleOutTask(); |
| | | // if (wrkMasts.isEmpty()) { |
| | | // return; |
| | | // } |
| | | try { |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (wrkMast.getStaNo() == 1031) { |
| | | Config config = configService.selectConfigByCode("2.5F_Mode"); |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | if (config.getValue().equalsIgnoreCase("2")) { |
| | | log.info("模式不对2"); |
| | | return; |
| | | } |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (locMast == null) { |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | |
| | | |
| | | } |
| | | |
| | | //@Scheduled(cron = "0/3 * * * * ? ") //移库任务下发 |
| | | public void switchMode() { |
| | | procesMode(); |
| | | } |
| | | |
| | | //1:从四向库到堆垛机库 |
| | | //2:从堆垛机库到四向库 |
| | | private void procesMode() { |
| | | Config config = configService.selectConfigByCode("2.5F_Mode"); |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | List<WrkMast> wrkMastList1 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 1, 10).eq("crn_no", 1).eq("sta_no", 1131)); |
| | | List<WrkMast> wrkMastList2 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 101, 110).eq("crn_no", 7).eq("sta_no", 1031)); |
| | | if (wrkMastList1.isEmpty() && wrkMastList2.isEmpty()) { |
| | | List<WrkMast> wrkMastList3 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 101, 110).eq("crn_no", 1).eq("sta_no", 1135)); |
| | | List<WrkMast> wrkMastList4 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 1, 10).eq("crn_no", 7).eq("sta_no", 1032)); |
| | | if (!wrkMastList3.isEmpty() || !wrkMastList4.isEmpty()) { |
| | | if (!config.getValue().equalsIgnoreCase("2")) { |
| | | log.info("存在调拨任务去四向库,切换模式"); |
| | | config.setValue("2"); |
| | | configService.updateById(config); |
| | | } |
| | | } else { |
| | | if (!config.getValue().equalsIgnoreCase("0")) { |
| | | log.info("不存在任务"); |
| | | config.setValue("0"); |
| | | configService.updateById(config); |
| | | } |
| | | } |
| | | } else { |
| | | List<WrkMast> wrkMastList3 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 101, 110).eq("crn_no", 1).eq("sta_no", 1135)); |
| | | List<WrkMast> wrkMastList4 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 1, 10).eq("crn_no", 7).eq("sta_no", 1032)); |
| | | if (wrkMastList3.isEmpty() && wrkMastList4.isEmpty()) { |
| | | if (!config.getValue().equalsIgnoreCase("1")) { |
| | | log.info("存在调拨任务去duiduo,切换模式"); |
| | | config.setValue("1"); |
| | | configService.updateById(config); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |