Commit fb8ab508c64c921a3bf9b5c290c38296d8ebc336
1 parent
6e89f046
任务完成
Showing
5 changed files
with
117 additions
and
133 deletions
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -278,28 +278,26 @@ public class ReceiptTaskService { |
278 | 278 | for (TaskDetail taskDetail : taskDetailList) { |
279 | 279 | if (taskDetail.getStatus() < QuantityConstant.TASK_STATUS_COMPLETED) { |
280 | 280 | totalQty = totalQty.add(taskDetail.getQty()); |
281 | - /*查询入库单明细*/ | |
282 | - ReceiptDetail receiptDetail = receiptDetailService.getById(taskDetail.getBillDetailId()); | |
283 | - if (StringUtils.isNotNull(receiptDetail)) { | |
281 | +// /*查询入库单明细*/ | |
282 | +// ReceiptDetail receiptDetail = receiptDetailService.getById(taskDetail.getBillDetailId()); | |
283 | +// if (StringUtils.isNotNull(receiptDetail)) { | |
284 | 284 | |
285 | - totalQty = this.addInventoryDetail(taskDetail, receiptDetail, inventoryHeader); | |
285 | + totalQty = this.addInventoryDetail(taskDetail, inventoryHeader); | |
286 | 286 | //修改组盘表状态为完成 |
287 | - ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); | |
288 | - receiptContainerDetail.setStatus(QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
289 | - LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
290 | - receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getId, taskDetail.getAllocationId()); | |
291 | - if (!receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)){ | |
292 | - throw new ServiceException("更新组盘状态失败"); | |
293 | - } | |
287 | +// ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); | |
288 | +// receiptContainerDetail.setStatus(QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
289 | +// LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
290 | +// receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getId, taskDetail.getAllocationId()); | |
291 | +// if (!receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)){ | |
292 | +// throw new ServiceException("更新组盘状态失败"); | |
293 | +// } | |
294 | 294 | |
295 | - } else { | |
296 | - throw new ServiceException("未找到id:" + taskDetail.getBillDetailId() + "入库单明细"); | |
297 | 295 | } |
298 | - receiptDetail.setProcessStamp(String.valueOf(QuantityConstant.RECEIPT_HEADER_POSTING)); | |
299 | - receiptDetailService.updateById(receiptDetail); | |
300 | - receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
296 | +// receiptDetail.setProcessStamp(String.valueOf(QuantityConstant.RECEIPT_HEADER_POSTING)); | |
297 | +// receiptDetailService.updateById(receiptDetail); | |
298 | +// receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); | |
301 | 299 | materialWarningService.materialWarning(taskDetail.getMaterialCode(), taskDetail.getCompanyCode()); |
302 | - } | |
300 | +// } | |
303 | 301 | } |
304 | 302 | if (StringUtils.isNull(inventoryHeader)) { |
305 | 303 | throw new ServiceException("库存添加失败"); |
... | ... | @@ -333,13 +331,13 @@ public class ReceiptTaskService { |
333 | 331 | throw new ServiceException("更新容器失败"); |
334 | 332 | } |
335 | 333 | |
336 | - //修改入库组盘头表状态 | |
337 | - ReceiptContainerHeader receiptContainerHeader = new ReceiptContainerHeader(); | |
338 | - receiptContainerHeader.setId(task.getAllocationHeadId()); | |
339 | - receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
340 | - if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) { | |
341 | - throw new ServiceException("更新入库组盘头表状态失败"); | |
342 | - } | |
334 | +// //修改入库组盘头表状态 | |
335 | +// ReceiptContainerHeader receiptContainerHeader = new ReceiptContainerHeader(); | |
336 | +// receiptContainerHeader.setId(task.getAllocationHeadId()); | |
337 | +// receiptContainerHeader.setStatus(QuantityConstant.RECEIPT_CONTAINER_FINISHED); | |
338 | +// if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) { | |
339 | +// throw new ServiceException("更新入库组盘头表状态失败"); | |
340 | +// } | |
343 | 341 | return AjaxResult.success(); |
344 | 342 | } |
345 | 343 | |
... | ... | @@ -350,7 +348,7 @@ public class ReceiptTaskService { |
350 | 348 | * @param inventoryHeader 库存头表 |
351 | 349 | * @return 任务数量 |
352 | 350 | */ |
353 | - private BigDecimal addInventoryDetail(TaskDetail taskDetail, ReceiptDetail receiptDetail, InventoryHeader inventoryHeader) { | |
351 | + private BigDecimal addInventoryDetail(TaskDetail taskDetail, InventoryHeader inventoryHeader) { | |
354 | 352 | /*该入库明细是否已存在库存明细记录,已存在更新数量、不存在新增记录*/ |
355 | 353 | LambdaQueryWrapper<InventoryDetail> inventory = Wrappers.lambdaQuery(); |
356 | 354 | inventory.eq(InventoryDetail::getWarehouseCode, taskDetail.getWarehouseCode()) |
... | ... | @@ -358,17 +356,17 @@ public class ReceiptTaskService { |
358 | 356 | .eq(InventoryDetail::getMaterialCode, taskDetail.getMaterialCode()) |
359 | 357 | .eq(InventoryDetail::getContainerCode, inventoryHeader.getContainerCode()) |
360 | 358 | .eq(InventoryDetail::getCompanyCode, taskDetail.getCompanyCode()) |
361 | - .eq(InventoryDetail::getReceiptDetailId, taskDetail.getBillDetailId()); | |
359 | + .eq(InventoryDetail::getReceiptDetailId, taskDetail.getId()); | |
362 | 360 | InventoryDetail inventoryDetail = inventoryDetailService.getOne(inventory); |
363 | - Material material = materialService.findAllByCode(receiptDetail.getMaterialCode()); | |
361 | + Material material = materialService.findAllByCode(taskDetail.getMaterialCode()); | |
364 | 362 | /*单位换算*/ |
365 | 363 | BigDecimal receiptQty = taskDetail.getQty(); |
366 | - if (StringUtils.isNotEmpty(receiptDetail.getMaterialUnit()) && | |
364 | + if (StringUtils.isNotEmpty(taskDetail.getMaterialUnit()) && | |
367 | 365 | StringUtils.isNotEmpty(material.getUnit()) && |
368 | - !receiptDetail.getMaterialUnit().equals(material.getUnit())) { | |
366 | + !taskDetail.getMaterialUnit().equals(material.getUnit())) { | |
369 | 367 | LambdaQueryWrapper<MaterialMultiple> queryWrapper = Wrappers.lambdaQuery(); |
370 | - queryWrapper.eq(MaterialMultiple::getMaterialCode, receiptDetail.getMaterialCode()) | |
371 | - .eq(MaterialMultiple::getUnitId1, receiptDetail.getMaterialUnit()) | |
368 | + queryWrapper.eq(MaterialMultiple::getMaterialCode, taskDetail.getMaterialCode()) | |
369 | + .eq(MaterialMultiple::getUnitId1, taskDetail.getMaterialUnit()) | |
372 | 370 | .eq(MaterialMultiple::getUnitId2, material.getUnit()); |
373 | 371 | MaterialMultiple materialMultiple = materialMultipleService.getOne(queryWrapper); |
374 | 372 | if (StringUtils.isNull(materialMultiple)) { |
... | ... | @@ -381,7 +379,6 @@ public class ReceiptTaskService { |
381 | 379 | inventoryDetail.setQty(inventoryDetail.getQty().add(taskDetail.getQty())); |
382 | 380 | } |
383 | 381 | else { |
384 | - ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | |
385 | 382 | inventoryDetail = new InventoryDetail(); |
386 | 383 | inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); |
387 | 384 | inventoryDetail.setWarehouseCode(taskDetail.getWarehouseCode()); |
... | ... | @@ -396,20 +393,8 @@ public class ReceiptTaskService { |
396 | 393 | inventoryDetail.setTaskQty(new BigDecimal(0)); |
397 | 394 | inventoryDetail.setLockedQty(new BigDecimal(0)); |
398 | 395 | inventoryDetail.setInventorySts(taskDetail.getInventorySts()); |
399 | - inventoryDetail.setSupplierCode(receiptDetail.getSupplierCode()); | |
400 | - inventoryDetail.setReferCode(receiptDetail.getReferCode()); | |
401 | - inventoryDetail.setReferDetailId(receiptDetail.getReferLineNum()); | |
402 | - inventoryDetail.setBatch(receiptDetail.getBatch()); | |
403 | - inventoryDetail.setLot(receiptDetail.getLot()); | |
404 | - inventoryDetail.setProjectNo(receiptDetail.getProjectNo());; | |
405 | - inventoryDetail.setManufactureDate(receiptDetail.getManufactureDate()); | |
406 | - inventoryDetail.setExpirationDate(receiptDetail.getExpirationDate()); | |
407 | - inventoryDetail.setAgingDate(receiptDetail.getAgingDate()); | |
408 | - inventoryDetail.setAttribute1(receiptDetail.getAttribute1()); | |
409 | - inventoryDetail.setAttribute2(receiptDetail.getAttribute2()); | |
410 | - inventoryDetail.setAttribute3(receiptDetail.getAttribute3()); | |
411 | - inventoryDetail.setReceiptCode(receiptHeader.getCode()); | |
412 | - inventoryDetail.setReceiptDetailId(receiptDetail.getId()); | |
396 | + inventoryDetail.setReceiptCode(taskDetail.getTaskId().toString()); | |
397 | + inventoryDetail.setReceiptDetailId(taskDetail.getId()); | |
413 | 398 | inventoryHeader.setTotalLines(inventoryHeader.getTotalLines()+1); |
414 | 399 | } |
415 | 400 | if (!inventoryDetailService.saveOrUpdate(inventoryDetail)) { |
... | ... | @@ -428,11 +413,9 @@ public class ReceiptTaskService { |
428 | 413 | inventoryTransaction.setMaterialName(taskDetail.getMaterialName()); |
429 | 414 | inventoryTransaction.setMaterialSpec(taskDetail.getMaterialSpec()); |
430 | 415 | inventoryTransaction.setMaterialUnit(material.getUnit()); |
431 | - inventoryTransaction.setBillCode(taskDetail.getBillCode()); | |
432 | - inventoryTransaction.setBillDetailId(taskDetail.getBillDetailId()); | |
433 | - inventoryTransaction.setBatch(receiptDetail.getBatch()); | |
434 | - inventoryTransaction.setLot(receiptDetail.getLot()); | |
435 | - inventoryTransaction.setInventorySts(receiptDetail.getInventorySts()); | |
416 | + inventoryTransaction.setBillCode(taskDetail.getTaskId().toString()); | |
417 | + inventoryTransaction.setBillDetailId(taskDetail.getId()); | |
418 | + inventoryTransaction.setInventorySts(taskDetail.getInventorySts()); | |
436 | 419 | inventoryTransaction.setTaskQty(receiptQty); |
437 | 420 | if (!inventoryTransactionService.save(inventoryTransaction)) { |
438 | 421 | throw new ServiceException("新增库存记录失败"); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... | ... | @@ -280,12 +280,12 @@ public class ShipmentTaskService { |
280 | 280 | |
281 | 281 | for (TaskDetail taskDetail : taskDetails) { |
282 | 282 | if (taskDetail.getStatus() < QuantityConstant.TASK_STATUS_RUNNING) { |
283 | - //获取出库子货箱 | |
284 | - ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getAllocationId()); | |
285 | - //取出子单据 | |
286 | - ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId()); | |
287 | - //暂存id,为更新单据状态准备 | |
288 | - shipmentHeadIds.add(shipmentDetail.getShipmentId()); | |
283 | +// //获取出库子货箱 | |
284 | +// ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getAllocationId()); | |
285 | +// //取出子单据 | |
286 | +// ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId()); | |
287 | +// //暂存id,为更新单据状态准备 | |
288 | +// shipmentHeadIds.add(shipmentDetail.getShipmentId()); | |
289 | 289 | //获取对应库存记录 |
290 | 290 | InventoryDetail inventoryDetail = inventoryDetailService.getById(taskDetail.getToInventoryId()); |
291 | 291 | if (inventoryDetail == null) { |
... | ... | @@ -321,29 +321,29 @@ public class ShipmentTaskService { |
321 | 321 | //设置子任务状态为已执行 |
322 | 322 | taskDetail.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
323 | 323 | taskDetailService.updateById(taskDetail); |
324 | - //修改出库组盘明细状态 | |
325 | - shipmentContainerDetail.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
326 | - shipmentContainerDetailService.updateById(shipmentContainerDetail); | |
324 | +// //修改出库组盘明细状态 | |
325 | +// shipmentContainerDetail.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
326 | +// shipmentContainerDetailService.updateById(shipmentContainerDetail); | |
327 | 327 | //记录库存交易记录 |
328 | 328 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
329 | 329 | inventoryTransaction.setWarehouseCode(task.getWarehouseCode()); |
330 | - inventoryTransaction.setCompanyCode(shipmentDetail.getCompanyCode()); | |
330 | + inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); | |
331 | 331 | inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); |
332 | 332 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
333 | 333 | inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT); |
334 | - inventoryTransaction.setMaterialCode(shipmentDetail.getMaterialCode()); | |
335 | - inventoryTransaction.setMaterialName(shipmentDetail.getMaterialName()); | |
336 | - inventoryTransaction.setMaterialSpec(shipmentDetail.getMaterialSpec()); | |
337 | - inventoryTransaction.setMaterialUnit(shipmentDetail.getMaterialUnit()); | |
338 | - inventoryTransaction.setBillCode(taskDetail.getBillCode()); | |
339 | - inventoryTransaction.setBillDetailId(shipmentDetail.getId()); | |
340 | - inventoryTransaction.setBatch(shipmentDetail.getBatch()); | |
341 | - inventoryTransaction.setLot(shipmentDetail.getLot()); | |
342 | - inventoryTransaction.setProjectNo(shipmentDetail.getProjectNo()); | |
334 | + inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); | |
335 | + inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); | |
336 | + inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); | |
337 | + inventoryTransaction.setMaterialUnit(inventoryDetail.getMaterialUnit()); | |
338 | + inventoryTransaction.setBillCode(taskDetail.getTaskId().toString()); | |
339 | + inventoryTransaction.setBillDetailId(taskDetail.getId()); | |
340 | +// inventoryTransaction.setBatch(shipmentDetail.getBatch()); | |
341 | +// inventoryTransaction.setLot(shipmentDetail.getLot()); | |
342 | +// inventoryTransaction.setProjectNo(shipmentDetail.getProjectNo()); | |
343 | 343 | inventoryTransaction.setQcCheck(inventoryDetail.getQcCheck()); |
344 | 344 | inventoryTransaction.setSupplierCode(inventoryDetail.getSupplierCode()); |
345 | - inventoryTransaction.setManufactureDate(shipmentDetail.getManufactureDate()); | |
346 | - inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate()); | |
345 | +// inventoryTransaction.setManufactureDate(shipmentDetail.getManufactureDate()); | |
346 | +// inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate()); | |
347 | 347 | inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts()); |
348 | 348 | //这里取反,更符合出库的语义,同时方便对记录进行统计 |
349 | 349 | inventoryTransaction.setTaskQty(taskDetail.getQty()); |
... | ... | @@ -358,46 +358,46 @@ public class ShipmentTaskService { |
358 | 358 | updateShipmentLocationContainer(task.getFromLocation(), task.getToLocation(), task.getContainerCode(), task.getTaskType()); |
359 | 359 | |
360 | 360 | //设置出库货箱表头状态为拣货任务完成 |
361 | - LambdaUpdateWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
362 | - shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId, task.getAllocationHeadId()) | |
363 | - .set(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS); | |
364 | - if (!containerHeaderService.update(shipmentContainerHeaderLambdaUpdateWrapper)) { | |
365 | - throw new ServiceException("更新组盘头状态失败"); | |
366 | - } | |
361 | +// LambdaUpdateWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); | |
362 | +// shipmentContainerHeaderLambdaUpdateWrapper.eq(ShipmentContainerHeader::getId, task.getAllocationHeadId()) | |
363 | +// .set(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS); | |
364 | +// if (!containerHeaderService.update(shipmentContainerHeaderLambdaUpdateWrapper)) { | |
365 | +// throw new ServiceException("更新组盘头状态失败"); | |
366 | +// } | |
367 | 367 | |
368 | 368 | //修改出库单状态 |
369 | - List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(task.getId()); | |
370 | - HashSet<Integer> ids = new HashSet<>(); | |
371 | - for (TaskDetail taskDetail : taskDetailList) { | |
372 | - ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId()); | |
373 | - if (StringUtils.isNull(shipmentDetail)) { | |
374 | - throw new ServiceException("查找出库单明细失败"); | |
375 | - } | |
376 | - if (shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()) == 0) { | |
377 | - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
378 | - shipmentDetailService.updateById(shipmentDetail); | |
379 | - } | |
380 | - ids.add(shipmentDetail.getShipmentId()); | |
381 | - } | |
369 | +// List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(task.getId()); | |
370 | +// HashSet<Integer> ids = new HashSet<>(); | |
371 | +// for (TaskDetail taskDetail : taskDetailList) { | |
372 | +// ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId()); | |
373 | +// if (StringUtils.isNull(shipmentDetail)) { | |
374 | +// throw new ServiceException("查找出库单明细失败"); | |
375 | +// } | |
376 | +// if (shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()) == 0) { | |
377 | +// shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
378 | +// shipmentDetailService.updateById(shipmentDetail); | |
379 | +// } | |
380 | +// ids.add(shipmentDetail.getShipmentId()); | |
381 | +// } | |
382 | 382 | |
383 | 383 | /*更新出库单状态*/ |
384 | - for (Integer id : ids) { | |
385 | - ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); | |
386 | - if (shipmentHeader != null) { | |
387 | - Map<String, Integer> status = shipmentDetailService.selectStatus(shipmentHeader.getId()); | |
388 | - Integer maxStatus = status.get("maxStatus"); | |
389 | - Integer minStatus = status.get("minStatus"); | |
390 | - if (maxStatus.equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)) { | |
391 | - shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
392 | - } | |
393 | - if (minStatus.equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)) { | |
394 | - shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
395 | - } | |
396 | - shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
397 | - shipmentHeader.setLastUpdated(new Date()); | |
398 | - shipmentHeaderService.updateById(shipmentHeader); | |
399 | - } | |
400 | - } | |
384 | +// for (Integer id : ids) { | |
385 | +// ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); | |
386 | +// if (shipmentHeader != null) { | |
387 | +// Map<String, Integer> status = shipmentDetailService.selectStatus(shipmentHeader.getId()); | |
388 | +// Integer maxStatus = status.get("maxStatus"); | |
389 | +// Integer minStatus = status.get("minStatus"); | |
390 | +// if (maxStatus.equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)) { | |
391 | +// shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
392 | +// } | |
393 | +// if (minStatus.equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)) { | |
394 | +// shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
395 | +// } | |
396 | +// shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
397 | +// shipmentHeader.setLastUpdated(new Date()); | |
398 | +// shipmentHeaderService.updateById(shipmentHeader); | |
399 | +// } | |
400 | +// } | |
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -361,17 +361,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
361 | 361 | } |
362 | 362 | //整盘入库,空托入库库位自动分配 |
363 | 363 | //整盘入库手动完成分配库位,已分配则略过 |
364 | - if(task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)){ | |
365 | - if(StringUtils.isEmpty(task.getToLocation())){ | |
366 | - //自动分配库位 | |
367 | - // AjaxResult ajaxResult = this.setLocationCode(task.getId(),0 ); | |
368 | - // task.setToLocation((String)ajaxResult.getData()); | |
369 | - } | |
370 | - } | |
371 | - //如果没有库位不能完成 | |
372 | - if (StringUtils.isEmpty(task.getFromLocation()) && StringUtils.isEmpty(task.getToLocation())) { | |
373 | - throw new ServiceException("任务" + task.getId() + "没有库位,执行中止"); | |
374 | - } | |
364 | +// if(task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)){ | |
365 | +// if(StringUtils.isEmpty(task.getToLocation())){ | |
366 | +// //自动分配库位 | |
367 | +// // AjaxResult ajaxResult = this.setLocationCode(task.getId(),0 ); | |
368 | +// // task.setToLocation((String)ajaxResult.getData()); | |
369 | +// } | |
370 | +// } | |
371 | +// //如果没有库位不能完成 | |
372 | +// if (StringUtils.isEmpty(task.getFromLocation()) && StringUtils.isEmpty(task.getToLocation())) { | |
373 | +// throw new ServiceException("任务" + task.getId() + "没有库位,执行中止"); | |
374 | +// } | |
375 | 375 | |
376 | 376 | this.completeTask(task); |
377 | 377 | } |
... | ... | @@ -400,9 +400,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
400 | 400 | workTaskService.completeCheckOutTask(task); |
401 | 401 | } |
402 | 402 | // 700 盘点 |
403 | - if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_CYCLECOUNT)) { | |
404 | - cycleCountTaskService.completeCycleCountTask(task); | |
405 | - } | |
403 | +// if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_CYCLECOUNT)) { | |
404 | +// cycleCountTaskService.completeCycleCountTask(task); | |
405 | +// } | |
406 | 406 | if (task.getTaskType().equals( QuantityConstant.TASK_TYPE_TRANSFER)) { |
407 | 407 | // //移库 |
408 | 408 | transferTaskService.completeTransferTask(task); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/WorkTaskService.java
... | ... | @@ -434,21 +434,22 @@ public class WorkTaskService { |
434 | 434 | if(inventoryDetails != null && inventoryDetails.size() > 0) { |
435 | 435 | for(InventoryDetail inventoryDetail : inventoryDetails) { |
436 | 436 | inventoryDetail.setLocationCode(taskHeader.getToLocation()); |
437 | + inventoryDetail.setLockedQty(new BigDecimal(0)); | |
437 | 438 | inventoryDetailService.updateById(inventoryDetail); |
438 | 439 | } |
439 | 440 | } |
440 | 441 | } |
441 | 442 | |
442 | - if ("some".equals(container.getStatus())) { | |
443 | - LambdaUpdateWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaUpdate(); | |
444 | - queryWrapper.eq(InventoryDetail::getLocationCode, taskHeader.getToLocation()) | |
445 | - .eq(InventoryDetail::getContainerCode, taskHeader.getContainerCode()) | |
446 | - .eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
447 | - .set(InventoryDetail::getLockedQty, BigDecimal.ZERO); | |
448 | - if (!inventoryDetailService.update(queryWrapper)) { | |
449 | - throw new ServiceException("更新失败"); | |
450 | - } | |
451 | - } | |
443 | +// if ("some".equals(container.getStatus())) { | |
444 | +// LambdaUpdateWrapper<InventoryDetail> queryWrapper = Wrappers.lambdaUpdate(); | |
445 | +// queryWrapper.eq(InventoryDetail::getLocationCode, taskHeader.getToLocation()) | |
446 | +// .eq(InventoryDetail::getContainerCode, taskHeader.getContainerCode()) | |
447 | +// .eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) | |
448 | +// .set(InventoryDetail::getLockedQty, BigDecimal.ZERO); | |
449 | +// if (!inventoryDetailService.update(queryWrapper)) { | |
450 | +// throw new ServiceException("更新失败"); | |
451 | +// } | |
452 | +// } | |
452 | 453 | return AjaxResult.success(); |
453 | 454 | } |
454 | 455 | |
... | ... |