| | |
| | | @ManagerAuth(memo = "出库确认获取信息") |
| | | public R wrkDetlSearchByBatch(@RequestBody String batch){ |
| | | if (Cools.isEmpty(batch)){ |
| | | return R.error().add("参数为空"); |
| | | return R.error("参数为空"); |
| | | } |
| | | String[] batch1 = batch.split("箱号:"); |
| | | String[] batch2 = batch1[1].split("规格:"); |
| | |
| | | WrkDetlLog wrkDetlLog = wrkDetlLogService.selectWrkDetlLogByOrderNoNotNull(batch); |
| | | // WrkDetlLog wrkDetlLog = wrkDetlLogService.selectOne(new EntityWrapper<WrkDetlLog>().eq("batch", batch).and().ne("order_no","").and().isNotNull("order_no").orderBy("io_time",false)); |
| | | if (Cools.isEmpty(wrkDetlLog)){ |
| | | return R.error().add("未查到数据"); |
| | | return R.error("未查到数据"); |
| | | } |
| | | wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(wrkDetlLog); |
| | |
| | | wrkDetl.setDeadTime(wrkDetlLog.getDeadTime()); |
| | | } |
| | | if (Cools.isEmpty(wrkDetl)){ |
| | | return R.error().add("未查到数据"); |
| | | return R.error("未查到数据"); |
| | | } |
| | | return R.ok().add(wrkDetl); |
| | | } |
| | |
| | | public R orderSearchByBatch(@RequestBody String batch){ |
| | | try{ |
| | | if (Cools.isEmpty(batch)){ |
| | | return R.error().add("参数为空"); |
| | | return R.error("参数为空"); |
| | | } |
| | | // String[] batch1 = batch.split("箱号:"); |
| | | // String[] batch2 = batch1[1].split("规格:"); |
| | |
| | | // WrkDetlLog wrkDetlLog = wrkDetlLogService.selectOne(new EntityWrapper<WrkDetlLog>().eq("batch", batch).and().ne("order_no","").and().isNotNull("order_no").orderBy("io_time",false)); |
| | | WrkDetlLog wrkDetlLog = wrkDetlLogService.selectWrkDetlLogByOrderNoNotNull(batch); |
| | | if (Cools.isEmpty(wrkDetlLog)) { |
| | | return R.error().add("未查到数据:工作明细为空"); |
| | | return R.error("未查到数据:工作明细为空"); |
| | | } |
| | | if (wrkDetlLog.getDeadTime().equals("已确认")) { |
| | | return R.error("当前任务已确认,请重置!"); |
| | | } |
| | | wrkDetlLog.setSource(1); |
| | | wrkDetlLogService.update(wrkDetlLog,new EntityWrapper<WrkDetlLog>().eq("batch",wrkDetlLog.getBatch()).eq("wrk_no",wrkDetlLog.getWrkNo())); |
| | | orderNo=wrkDetlLog.getOrderNo(); |
| | | }else { |
| | | if (wrkDetl.getDeadTime().equals("已确认")) { |
| | | return R.error("当前任务已确认,请重置!"); |
| | | } |
| | | wrkDetl.setSource(1); |
| | | wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()).eq("wrk_no",wrkDetl.getWrkNo())); |
| | | orderNo=wrkDetl.getOrderNo(); |
| | | } |
| | | // List<Order> orders = orderService.selectorderNoL(batch); |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("batch", batch).eq("order_no",orderNo)); |
| | | if (Cools.isEmpty(orderDetl)){ |
| | | return R.error().add("未查到数据:订单明细为空"+orderNo); |
| | | return R.error("未查到数据:订单明细为空"+orderNo); |
| | | } |
| | | if (!orderDetl.getQty$().equals("已完成")){ |
| | | return R.error().add("任务未完成"); |
| | | return R.error("任务未完成"); |
| | | } |
| | | if (orderDetl.getSource()==1){ |
| | | return R.error().add("任务已确认,请勿重复确认!!!"); |
| | | if (!Cools.isEmpty(orderDetl.getSource()) && orderDetl.getSource()==1){ |
| | | return R.error("任务已确认,请勿重复确认!!!"); |
| | | } |
| | | orderDetl.setSource(1); |
| | | orderDetlService.updateById(orderDetl); |