| | |
| | | if (Objects.isNull(params.getBsCode())) { |
| | | throw new CoolException("BS码不能为空!!"); |
| | | } |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | .eq("io_type", TaskIOType.PICK_OUT.type) |
| | | .eq("wrk_sts", 14) |
| | | .eq("barcode", params.getCarBarcode())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误:任务信息存在!!"); |
| | | } |
| | | // Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | // .eq("io_type", TaskIOType.PICK_OUT.type) |
| | | // .eq("wrk_sts", 14) |
| | | // .eq("barcode", params.getCarBarcode())); |
| | | // if (Objects.isNull(task)) { |
| | | // throw new CoolException("数据错误:任务信息存在!!"); |
| | | // } |
| | | |
| | | List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>() |
| | | List<BasStationDetl> taskDetl = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>() |
| | | .eq("three_code", params.getBsCode()) |
| | | .eq("wrk_no", task.getWrkNo()) |
| | | .eq("zpallet", params.getCarBarcode())); |
| | | |
| | | if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) { |
| | |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + ", 超出当前托盘装载上限!!"); |
| | | } |
| | | |
| | | BasStationDetl stationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>() |
| | | .eq("zpallet", param.getCarBarcode()) |
| | | .eq("three_code", detlDto.getThreeCode())); |
| | | if (Objects.isNull(stationDetl)) { |
| | | throw new CoolException("明细内容不存在!!"); |
| | | } |
| | | |
| | | Double v = stationDetl.getAnfme() - stationDetl.getWorkQty(); |
| | | if (detlDto.getAnfme().compareTo(v) > 0) { |
| | | throw new CoolException("组托上限为:" + stationDetl.getAnfme() + ", 已组托:" + stationDetl.getWorkQty() + ", 还可组托:" + v); |
| | | } |
| | | |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setType(param.getType()); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | | // 设置组托类型 |
| | | waitPakin.setType(param.getType()); |
| | |
| | | waitPakin.setAnfme(detlDto.getAnfme()); |
| | | waitPakin.setThreeCode(detlDto.getThreeCode()); |
| | | waitPakin.setStatus("Y"); |
| | | waitPakin.setSuppCode(detlDto.getStandby1()); |
| | | waitPakin.setStandby1(detlDto.getStandby1()); |
| | | waitPakin.setStandby2(detlDto.getStandby2()); |
| | | waitPakin.setStandby3(detlDto.getStandby3()); |
| | |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | |
| | | Double v1 = stationDetl.getWorkQty() + detlDto.getAnfme(); |
| | | stationDetl.setWorkQty(v1); |
| | | |
| | | if (!basStationDetlService.updateById(stationDetl)) { |
| | | throw new CoolException("站点明细修改失败"); |
| | | } |
| | | |
| | | if (v1.compareTo(stationDetl.getWorkQty()) >= 0) { |
| | | if (!basStationDetlService.deleteById(stationDetl)) { |
| | | throw new CoolException("原始数据移除失败!"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | .setOrderNo(orderPakin.getOrderNo()) |
| | | .setDevNo(basStation.getDevNo()) |
| | | .setBarcode(params.getTarBarcode()) |
| | | .setZpallet(params.getTarBarcode()) |
| | | .setBatch(combMat.getBatch()) |
| | | .setStandby1(combMat.getStandby1()) |
| | | .setAnfme(combMat.getWorkQty().doubleValue()); |
| | |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(11L) // 工作状态:11.生成出库ID |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 103) // 入出库状态: 11.库格移载 |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setFullPlt(loc.getLocSts().equals("D") ? "N" : "Y") // 满板:Y |