| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.CanFinMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.OrderDetlPakinServiceImpl; |
| | |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private CanFinMapper canFinMapper; |
| | | |
| | | @Resource |
| | | private StaDescService staDescService; |
| | |
| | | @PostMapping("/callEmptyBinOutBound") |
| | | @ManagerAuth(memo = "pda呼叫空料框出库") |
| | | public synchronized R callEmptyBinOutBound(@RequestParam(required = false) String locNo |
| | | , @RequestParam(required = false) String size) { |
| | | , @RequestParam(required = false) String size |
| | | , @RequestParam(required = false) String agvTaskNo) { |
| | | if (Cools.isEmpty(locNo) || Cools.isEmpty(size)) { |
| | | return R.error("站点或者大小不能为空"); |
| | | } |
| | |
| | | if (wrkMast != null) { |
| | | return R.error("该站点="+locNo+"已经有空板出库任务,为了不堵塞堆垛机接驳站点,禁止下发多个空板出库任务"); |
| | | } |
| | | return mobileService.callEmptyBinOutBound(locNo,size,getUserId()); |
| | | return mobileService.callEmptyBinOutBound(locNo,size,getUserId(), agvTaskNo); |
| | | } |
| | | |
| | | /** |
| | |
| | | .setAppeTime(date) |
| | | .setModiUser(9945L) |
| | | .setModiTime(date); |
| | | if (!taskService.insert(task)) { |
| | | if (taskService.insert(task)) { |
| | | Date now = new Date(); |
| | | CanFin canFin = new CanFin(); |
| | | canFin.setAgvType("agv-in"); |
| | | canFin.setInNo(TaskNo); |
| | | canFin.setApplyTime(now); |
| | | canFinMapper.insert(canFin); |
| | | }else{ |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | |
| | | |
| | | @RequestMapping("/orderOut") |
| | | public synchronized R AGVOrderOutReturn() { |
| | | List<OrderPakout> settle = orderPakoutService.selectList(new EntityWrapper<OrderPakout>().in("settle", 1, 2).eq("doc_type",11)); |
| | | List<OrderPakout> settle = orderPakoutService.selectList(new EntityWrapper<OrderPakout>().in("settle", 1, 2).eq("doc_type", 11)); |
| | | List<String> list = new ArrayList<>(); |
| | | for (OrderPakout orderPakout: settle) { |
| | | if (orderPakout.getSettle()==2){ |
| | | List<OrderDetlPakout> orderId = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_id", orderPakout.getId())); |
| | | Boolean boo=true; |
| | | for (OrderDetlPakout orderDetlPakout: orderId) { |
| | | if (orderDetlPakout.getAnfme()>orderDetlPakout.getWorkQty()){ |
| | | boo=false; |
| | | |
| | | // 使用迭代器遍历,可以安全删除 |
| | | Iterator<OrderPakout> iterator = settle.iterator(); |
| | | while (iterator.hasNext()) { |
| | | OrderPakout orderPakout = iterator.next(); |
| | | |
| | | if (orderPakout.getSettle() == 2) { |
| | | List<OrderDetlPakout> orderId = orderDetlPakoutService.selectList( |
| | | new EntityWrapper<OrderDetlPakout>().eq("order_id", orderPakout.getId())); |
| | | Boolean boo = true; |
| | | for (OrderDetlPakout orderDetlPakout : orderId) { |
| | | if (orderDetlPakout.getAnfme() > orderDetlPakout.getWorkQty()) { |
| | | boo = false; |
| | | break; |
| | | } |
| | | } |
| | | if (boo) { |
| | | settle.remove(orderPakout); |
| | | iterator.remove(); // 使用迭代器的remove方法 |
| | | }else { |
| | | list.add(orderPakout.getOrderNo()); |
| | | } |