| | |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.enums.LocAreaType; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.enums.TaskIOType; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.service.*; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private BasStationDetlService basStationDetlService; |
| | | @Autowired |
| | | private BasAreasService basAreasService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | // 判断是否是盘点单 |
| | | String orderNo = taskDto.getLocDtos().get(0).getOrderNo(); |
| | | // OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo); |
| | | CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo)); |
| | | int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103); |
| | | |
| | | int ioType = (taskDto.isAll() ? 101 : 103); |
| | | if(ioType == 101){ |
| | | boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto -> |
| | | locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locDto.getLocNo()) |
| | | .eq("matnr", locDto.getMatnr()) |
| | | .eq("batch", locDto.getBatch()) |
| | | .eq("standby1",locDto.getStandby2()) |
| | | .eq("standby1",locDto.getStandby1()) |
| | | ).getDiffQty().compareTo(BigDecimal.ZERO) == 0 |
| | | ); |
| | | if (!DiffQty){ |
| | |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | BasAreas basAreas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", LocAreaType.LOC_AREA_TYPE_CRN.type)); |
| | | if (Objects.isNull(basAreas)) { |
| | | throw new CoolException("数据错误,库区不存在!!"); |
| | | } |
| | | // 入出库类型判断 |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) { |
| | | throw new CoolException("当前入出库类型无法进行操作"); |
| | |
| | | if (wrkMast.getWrkSts() < 11 || wrkMast.getWrkSts() == 15) { |
| | | throw new CoolException("当前工作状态无法进行操作"); |
| | | } |
| | | |
| | | // 保存工作明细档历史档 |
| | | // if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存工作明细档历史档失败"); |
| | |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("库位不存在:" + wrkMast.getLocNo()); |
| | | } |
| | | locMast.setLocSts("Q"); |
| | | locMast.setAreaId(basAreas.getId()); |
| | | locMast.setAreaName(basAreas.getName()); |
| | | locMast.setBarcode(locMast.getBarcode()); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("修改库位状态失败"); |
| | | } |
| | | |
| | | |
| | | // .修改并托入库明细托码 |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("area_id", locMast.getAreaId()) |
| | | .eq("loc_no", locMast.getLocNo())); |
| | | if (!Objects.isNull(locDetls) && !locDetls.isEmpty()) { |
| | | locDetls.forEach(locDetl -> { |
| | | locDetl.setZpallet(locMast.getBarcode()); |
| | | locDetl.setBarcode(locMast.getBarcode()); |
| | | if (!locDetlService.updateById(locDetl)) { |
| | | throw new CoolException("库存明细修改失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // .修改任务档明细托盘码 |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (!Objects.isNull(wrkDetls) && !wrkDetls.isEmpty()) { |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | wrkDetl.setBarcode(wrkMast.getBarcode()); |
| | | if (!wrkDetlService.update(wrkDetl, new EntityWrapper<WrkDetl>() |
| | | .eq("matnr", wrkDetl.getMatnr()) |
| | | .eq("standby1", wrkDetl.getStandby1()) |
| | | .eq("wrk_no", wrkMast.getWrkNo()))) { |
| | | throw new CoolException("任务档明细修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |