| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.handler.AutoLocMoveHandler; |
| | | import com.zy.common.properties.SlaveWmsParameterProperties; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | @Component |
| | | public class AutoLocMoveScheduler { |
| | | |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private AutoLocMoveHandler autoLocMoveHandler; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private SlaveWmsParameterProperties slaveWmsParameterProperties; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private AutoMoveService autoMoveService; |
| | | private OrderPakoutService orderPakoutService; |
| | | |
| | | //定时出库 经典双伸 |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | Order order = orderService.selectOrderMoveStatus(); |
| | | if (!Cools.isEmpty(order)){ |
| | | OrderPakout orderPakout = orderPakoutService.selectOrderMoveStatus(); |
| | | if (!Cools.isEmpty(orderPakout)){ |
| | | // autoMoveService.selectList() |
| | | }else { |
| | | order = orderService.selectOrderMoveStatusInitial(); |
| | | if (Cools.isEmpty(order)){ |
| | | orderPakout = orderPakoutService.selectOrderMoveStatusInitial(); |
| | | if (Cools.isEmpty(orderPakout)){ |
| | | return; |
| | | } |
| | | order.setMoveStatus(2); |
| | | orderService.updateById(order); |
| | | orderPakout.setMoveStatus(2); |
| | | orderPakoutService.updateById(orderPakout); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //定时出库 |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void locToLoc11(){ |
| | | if (slaveWmsParameterProperties.isAutoLocMoveUnilateralBoolean()){ |
| | | Config config = configService.selectConfigByCode("AutoLocMoveUnilateral"); |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | int crnCount = basCrnpService.selectCount(new EntityWrapper<>()); |
| | | for (int crnNo = 1;crnNo < crnCount;crnNo++){ |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 11).eq("crn_no", crnNo)); |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 111).eq("crn_no", crnNo)); |
| | | if (Cools.isEmpty(wrkMast) && Cools.isEmpty(wrkMast1)){ |
| | | autoLocMoveHandler.start(crnNo,11); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //定时入库 |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void locToLoc111() { |
| | | if (slaveWmsParameterProperties.isAutoLocMoveUnilateralBoolean()){ |
| | | Config config = configService.selectConfigByCode("AutoLocMoveUnilateral"); |
| | | if (Cools.isEmpty(config) || config.getValue().equals("false")) { |
| | | return; |
| | | } |
| | | int crnCount = basCrnpService.selectCount(new EntityWrapper<>()); |
| | | for (int crnNo = 1;crnNo < crnCount;crnNo++){ |
| | | BasCrnp basCrnp = basCrnpService.selectById(crnNo); |
| | | if (basCrnp == null) { |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 111).eq("crn_no", crnNo)); |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 11).eq("crn_no", crnNo)); |
| | | if (Cools.isEmpty(wrkMast) && Cools.isEmpty(wrkMast1)){ |
| | | autoLocMoveHandler.start(crnNo,111); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |