Commit 3b7eba159a8a3e26461e7904a0728e8ad2f3bea6
Merge remote-tracking branch 'origin/develop' into develop
Showing
6 changed files
with
96 additions
and
28 deletions
src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java
src/main/java/com/huaheng/api/wcs/service/taskFinish/TaskFinishServiceImpl.java
... | ... | @@ -9,7 +9,9 @@ import com.huaheng.common.constant.QuantityConstant; |
9 | 9 | import com.huaheng.common.support.Convert; |
10 | 10 | import com.huaheng.common.utils.StringUtils; |
11 | 11 | import com.huaheng.framework.web.domain.AjaxResult; |
12 | +import com.huaheng.pc.config.container.domain.Container; | |
12 | 13 | import com.huaheng.pc.config.container.service.ContainerService; |
14 | +import com.huaheng.pc.config.location.domain.Location; | |
13 | 15 | import com.huaheng.pc.config.location.service.LocationService; |
14 | 16 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
15 | 17 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
... | ... | @@ -39,10 +41,26 @@ public class TaskFinishServiceImpl implements TaskFinishService { |
39 | 41 | if(StringUtils.isEmpty(taskFinishDomain.getTaskNo())){ |
40 | 42 | return AjaxResult.error("任务号为空"); |
41 | 43 | } |
44 | + if(StringUtils.isEmpty(taskFinishDomain.getLocation())){ | |
45 | + return AjaxResult.error("库位为空"); | |
46 | + } | |
47 | + //判断库位是否有货 | |
48 | + Location location=locationService.getLocationByCode(taskFinishDomain.getLocation()); | |
49 | + if(location!=null){ | |
50 | + if(!location.getStatus().equals(QuantityConstant.STATUS_LOCATION_EMPTY)){ | |
51 | + return AjaxResult.error("库位非空闲状态"); | |
52 | + } | |
53 | + if(StringUtils.isNotEmpty(location.getContainerCode())){ | |
54 | + return AjaxResult.error("库位已有货物"); | |
55 | + } | |
56 | + }else{ | |
57 | + return AjaxResult.error("库位不存在"); | |
58 | + } | |
59 | + | |
42 | 60 | TaskHeader taskHeader = taskHeaderService.getById(taskFinishDomain.getTaskNo()); |
43 | 61 | String warehouseCode = taskHeader.getWarehouseCode(); |
44 | 62 | //1、空出处理 |
45 | - if(taskFinishDomain.getIsEmptyOut() == 1) { | |
63 | + if(StringUtils.isNotNull(taskFinishDomain.getIsEmptyOut())&&taskFinishDomain.getIsEmptyOut() == 1) { | |
46 | 64 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
47 | 65 | boolean result = taskHeaderService.updateById(taskHeader); |
48 | 66 | if(!result) { |
... | ... | @@ -51,6 +69,17 @@ public class TaskFinishServiceImpl implements TaskFinishService { |
51 | 69 | return AjaxResult.success(result); |
52 | 70 | } |
53 | 71 | |
72 | + taskHeader.setFromLocation(taskFinishDomain.getLocation()); | |
73 | + taskHeader.setToLocation(taskFinishDomain.getLocation()); | |
74 | + taskHeaderService.updateById(taskHeader); | |
75 | + //库位绑定容器 | |
76 | + //location.setStatus(QuantityConstant.STATUS_LOCATION_LOCK); | |
77 | + location.setContainerCode(taskHeader.getContainerCode()); | |
78 | + locationService.updateById(location); | |
79 | + //库位绑定容器 | |
80 | + Container container=containerService.getContainerByCode(taskHeader.getContainerCode()); | |
81 | + container.setLocationCode(location.getCode()); | |
82 | + containerService.updateById(container); | |
54 | 83 | |
55 | 84 | String[] weight = new String[1]; |
56 | 85 | if (StringUtils.isNotEmpty(taskFinishDomain.getWeight())) { |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -262,7 +262,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
262 | 262 | checkReciptContainer(barCodeHeaderId); |
263 | 263 | } |
264 | 264 | |
265 | - List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(new LambdaQueryWrapper<ReceiptContainerDetail>().eq(ReceiptContainerDetail::getLocationCode, locationCode)); | |
265 | + //List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(new LambdaQueryWrapper<ReceiptContainerDetail>().eq(ReceiptContainerDetail::getLocationCode, locationCode)); | |
266 | 266 | |
267 | 267 | //检查容器编码合法性 |
268 | 268 | Integer taskType = checkContainer(containerCode, detail.getMaterialCode()); |
... | ... | @@ -275,13 +275,13 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
275 | 275 | } |
276 | 276 | |
277 | 277 | if (taskType == 1) { |
278 | - if (receiptContainerDetailList.size()==0) { | |
278 | + /*if (receiptContainerDetailList.size()==0) { | |
279 | 279 | //创建临时容器 |
280 | 280 | containerCode = createContainer(); |
281 | 281 | }else { |
282 | 282 | containerCode = receiptContainerDetailList.get(0).getContainerCode(); |
283 | - } | |
284 | - | |
283 | + }*/ | |
284 | + containerCode = createContainer(); | |
285 | 285 | taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; |
286 | 286 | } else if (taskType == 2) { |
287 | 287 | throw new ServiceException("该物料不能放在这个容器上,请检查该物料是否可以混放"); |
... | ... | @@ -294,11 +294,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
294 | 294 | locationCode = container.getLocationCode(); |
295 | 295 | } |
296 | 296 | } |
297 | - WcsTask wcsTask = new WcsTask(); | |
297 | + //库位在上架任务时完成任务接口pda扫码传过来 | |
298 | + /*WcsTask wcsTask = new WcsTask(); | |
298 | 299 | wcsTask.setArea(area); |
299 | 300 | wcsTask.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
300 | 301 | wcsTask.setContainerCode(containerCode); |
301 | - | |
302 | 302 | if(StringUtils.isEmpty(locationCode)) { |
303 | 303 | AjaxResult ajaxResult = warecellAllocationService.gemWarecellAllocation(wcsTask); |
304 | 304 | if(StringUtils.isNullNew(ajaxResult.getData())){ |
... | ... | @@ -307,12 +307,12 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
307 | 307 | Object data = ajaxResult.getData(); |
308 | 308 | WcsTask wcsTask1 = (WcsTask)data; |
309 | 309 | locationCode = wcsTask1.getToLocationCode(); |
310 | - } | |
310 | + }*/ | |
311 | 311 | //检查库位编码合法性 |
312 | 312 | //checkLocationCode(locationCode, containerCode, taskType); |
313 | - if(locationCode != null) { | |
313 | + /*if(locationCode != null) { | |
314 | 314 | locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK); |
315 | - } | |
315 | + }*/ | |
316 | 316 | |
317 | 317 | int unCompleteCombineNumber = shipmentContainerHeaderService.getUnCompleteCombineNumber(containerCode); |
318 | 318 | if(unCompleteCombineNumber > 0) { |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -679,16 +679,23 @@ public class ReceiptTaskService { |
679 | 679 | // inventoryDetail.setMaterialBatch(); |
680 | 680 | } |
681 | 681 | else { |
682 | - BarCodeHeader barCodeHeader = barCodeHeaderService.getById(barCodeDetail.getReceiptId()); | |
683 | - //barCodeHeader锁定成品入库信息状态修改 | |
684 | - barCodeHeader.setLocked(QuantityConstant.BARCODEHEADER_LOCKED_OFF); | |
685 | - barCodeHeader.setLastUpdated(new Date()); | |
686 | - barCodeHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
687 | - barCodeHeaderService.updateById(barCodeHeader); | |
688 | -// ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | |
689 | 682 | inventoryDetail = new InventoryDetail(); |
690 | - inventoryDetail.setDayShift(barCodeDetail.getDayShift()); | |
691 | - inventoryDetail.setRegenerationCode(barCodeDetail.getRegenerationCode()); | |
683 | + if(null!=barCodeDetail){ | |
684 | + BarCodeHeader barCodeHeader = barCodeHeaderService.getById(barCodeDetail.getReceiptId()); | |
685 | + //barCodeHeader锁定成品入库信息状态修改 | |
686 | + barCodeHeader.setLocked(QuantityConstant.BARCODEHEADER_LOCKED_OFF); | |
687 | + barCodeHeader.setLastUpdated(new Date()); | |
688 | + barCodeHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
689 | + barCodeHeaderService.updateById(barCodeHeader); | |
690 | + inventoryDetail.setDayShift(barCodeDetail.getDayShift()); | |
691 | + inventoryDetail.setRegenerationCode(barCodeDetail.getRegenerationCode()); | |
692 | + inventoryDetail.setReceiptCode(barCodeHeader.getCode()); | |
693 | + inventoryDetail.setMaterialBatch(barCodeHeader.getMaterialBatch()); | |
694 | + inventoryDetail.setBatch(barCodeDetail.getBatch()); | |
695 | + inventoryDetail.setMaterialGrossWeight(barCodeDetail.getWeight()); | |
696 | + inventoryDetail.setReceiptDetailId(barCodeDetail.getId()); | |
697 | + } | |
698 | +// ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | |
692 | 699 | |
693 | 700 | inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); |
694 | 701 | inventoryDetail.setWarehouseCode(taskDetail.getWarehouseCode()); |
... | ... | @@ -720,7 +727,7 @@ public class ReceiptTaskService { |
720 | 727 | // inventoryDetail.setSupplierCode(receiptDetail.getSupplierCode()); |
721 | 728 | // inventoryDetail.setReferCode(barCodeDetail.getReferCode()); |
722 | 729 | // inventoryDetail.setReferDetailId(receiptDetail.getReferLineNum()); |
723 | - inventoryDetail.setBatch(barCodeDetail.getBatch()); | |
730 | + | |
724 | 731 | // inventoryDetail.setLot(receiptDetail.getLot()); |
725 | 732 | // inventoryDetail.setProjectNo(receiptDetail.getProjectNo());; |
726 | 733 | // inventoryDetail.setManufactureDate(receiptDetail.getManufactureDate()); |
... | ... | @@ -729,10 +736,8 @@ public class ReceiptTaskService { |
729 | 736 | // inventoryDetail.setAttribute1(receiptDetail.getAttribute1()); |
730 | 737 | // inventoryDetail.setAttribute2(receiptDetail.getAttribute2()); |
731 | 738 | // inventoryDetail.setAttribute3(receiptDetail.getAttribute3()); |
732 | - inventoryDetail.setReceiptCode(barCodeHeader.getCode()); | |
733 | - inventoryDetail.setMaterialBatch(barCodeHeader.getMaterialBatch()); | |
734 | - inventoryDetail.setMaterialGrossWeight(barCodeDetail.getWeight()); | |
735 | - inventoryDetail.setReceiptDetailId(barCodeDetail.getId()); | |
739 | + | |
740 | + | |
736 | 741 | inventoryHeader.setTotalLines(inventoryHeader.getTotalLines()+1); |
737 | 742 | } |
738 | 743 | if (!inventoryDetailService.saveOrUpdate(inventoryDetail)) { |
... | ... | @@ -753,7 +758,7 @@ public class ReceiptTaskService { |
753 | 758 | inventoryTransaction.setMaterialUnit(material.getUnit()); |
754 | 759 | inventoryTransaction.setBillCode(taskDetail.getBillCode()); |
755 | 760 | inventoryTransaction.setBillDetailId(taskDetail.getBillDetailId()); |
756 | - inventoryTransaction.setBatch(barCodeDetail.getBatch()); | |
761 | + inventoryTransaction.setBatch(barCodeDetail==null?null:barCodeDetail.getBatch()); | |
757 | 762 | // inventoryTransaction.setLot(receiptDetail.getLot()); |
758 | 763 | // inventoryTransaction.setInventorySts(receiptDetail.getInventorySts()); |
759 | 764 | inventoryTransaction.setTaskQty(receiptQty); |
... | ... |
src/main/resources/templates/receipt/receiving/receiving.html
... | ... | @@ -64,7 +64,7 @@ |
64 | 64 | <li>收货数量:<input type="text" id="receiveNum"/></li> |
65 | 65 | <!-- <li>收货重量:<input type="text" id="receiveWeight"/></li>--> |
66 | 66 | <li hidden>容器编号:<input type="text" id="containerCode"/></li> |
67 | - <li>库位编码:<input type="text" id="locationCoder"/></li> | |
67 | + <li hidden>库位编码:<input type="text" id="locationCoder"/></li> | |
68 | 68 | <li> 主条码:<input type="text" id="barCodeHeaderCode" readonly style="width: 50%"/> |
69 | 69 | <input type="hidden" id="barCodeHeaderId" /> |
70 | 70 | <button class="btn btn-sm btn-success" onclick="selectCode()">请选择</button> |
... | ... |
src/main/resources/templates/task/taskHeader/taskHeader.html
... | ... | @@ -555,11 +555,43 @@ |
555 | 555 | |
556 | 556 | /*任务列表-完成任务*/ |
557 | 557 | function complete(taskId) { |
558 | - $.modal.confirm("确定完成任务?", function() { | |
558 | + layer.prompt({ | |
559 | + formType: 0, | |
560 | + value: ' ', | |
561 | + title: '库位', | |
562 | + // area: ['800px', '350px'] //自定义文本域宽高 | |
563 | + }, function(value, index, elem) { | |
564 | + var data = { | |
565 | + TaskNo: taskId, | |
566 | + location: value | |
567 | + }; | |
568 | + $.modal.loading("正在处理中,请稍后..."); | |
569 | + // $.operate.submit(prefix+"/confirmGapQty", "post", "json", data); | |
570 | + $.ajax({ | |
571 | + url: ctx + "API/WMS/v2/complete", | |
572 | + type: "post", | |
573 | + contentType:"application/json;charset=UTF-8;", | |
574 | + dataType: "json", | |
575 | + data: JSON.stringify(data), | |
576 | + success: function (result) { | |
577 | + if (result.code == web_status.SUCCESS) { | |
578 | + $.modal.msgSuccess(result.msg); | |
579 | + $("[name='refresh']").click(); | |
580 | + update(); | |
581 | + } else { | |
582 | + $.modal.alertError(result.msg); | |
583 | + } | |
584 | + $.modal.closeLoading(); | |
585 | + } | |
586 | + }); | |
587 | + layer.close(index); | |
588 | + $.modal.closeLoading(); | |
589 | + }) | |
590 | + /*$.modal.confirm("确定完成任务?", function() { | |
559 | 591 | var url = ctx + 'task/taskHeader/completeTaskByWMS'; |
560 | 592 | var data = { "taskId" : taskId }; |
561 | 593 | $.operate.post(url, data); |
562 | - }); | |
594 | + });*/ | |
563 | 595 | } |
564 | 596 | |
565 | 597 | /*任务列表-批量完成任务*/ |
... | ... |