Commit 202c573e582e58ece14de456db99179e3fe49bcf

Authored by 谭毅彬
2 parents b9fdb93e c6b80328

Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4.git into develop

ant-design-vue-jeecg/src/api/api.js
@@ -198,7 +198,11 @@ export const completeAgv = (params) => postAction('/task/agvTask/complete?ids=' @@ -198,7 +198,11 @@ export const completeAgv = (params) => postAction('/task/agvTask/complete?ids='
198 //取消AGV任务 198 //取消AGV任务
199 export const cancelAgv = (params) => postAction('/task/agvTask/cancel?ids=' + params, params); 199 export const cancelAgv = (params) => postAction('/task/agvTask/cancel?ids=' + params, params);
200 //修复空出数据 200 //修复空出数据
201 -export const handleEmptyOut = (params) => postAction('/task/taskHeader/handleEmptyOut?ids=' + params, params); 201 +export const handleEmptyOut = (params) => postAction('/task/taskHeader/handleEmptyOut?id=' + params, params);
  202 +//修复取货错数据
  203 +export const handlePickupError = (params) => postAction('/task/taskHeader/handlePickupError?id=' + params, params);
  204 +//修复重入数据
  205 +export const handleDoubleIn = (params) => postAction('/task/taskHeader/handleDoubleIn?id=' + params, params);
202 // 中转HTTP请求 206 // 中转HTTP请求
203 export const transitRESTful = { 207 export const transitRESTful = {
204 get: (url, parameter) => getAction(getTransitURL(url), parameter), 208 get: (url, parameter) => getAction(getTransitURL(url), parameter),
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
@@ -153,6 +153,12 @@ @@ -153,6 +153,12 @@
153 153
154 <span slot="action" slot-scope="text, record"> 154 <span slot="action" slot-scope="text, record">
155 <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> 155 <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a>
  156 + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据
  157 + <a-divider type="vertical"/></a>
  158 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据
  159 + <a-divider type="vertical"/></a>
  160 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据
  161 + <a-divider type="vertical"/></a>
156 <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> 162 <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a>
157 <a v-if="record.status < 100" v-has="'taskHeader:completeTask'" @click="completeTask(record)">完成<a-divider type="vertical"/></a> 163 <a v-if="record.status < 100" v-has="'taskHeader:completeTask'" @click="completeTask(record)">完成<a-divider type="vertical"/></a>
158 <a-dropdown> 164 <a-dropdown>
@@ -195,7 +201,7 @@ import {initDictOptions, filterMultiDictText} from &#39;@/components/dict/JDictSelec @@ -195,7 +201,7 @@ import {initDictOptions, filterMultiDictText} from &#39;@/components/dict/JDictSelec
195 import '@/assets/less/TableExpand.less' 201 import '@/assets/less/TableExpand.less'
196 import {completeTaskByWMS, cancelTask} from '@/api/api' 202 import {completeTaskByWMS, cancelTask} from '@/api/api'
197 import {execute} from '@/api/api' 203 import {execute} from '@/api/api'
198 -import {getZoneList} from '@/api/api' 204 +import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn} from '@/api/api'
199 import EmptyInTaskModal from './modules/EmptyInTaskModal' 205 import EmptyInTaskModal from './modules/EmptyInTaskModal'
200 import ManyEmptyInTaskModal from "./modules/ManyEmptyInTaskModal"; 206 import ManyEmptyInTaskModal from "./modules/ManyEmptyInTaskModal";
201 207
@@ -444,6 +450,45 @@ export default { @@ -444,6 +450,45 @@ export default {
444 this.searchQuery(); 450 this.searchQuery();
445 }); 451 });
446 }, 452 },
  453 + handleEmptyOutTask(record) {
  454 + this.loading = true;
  455 + this.model = Object.assign({}, record);
  456 + handleEmptyOut(this.model.id).then((res) => {
  457 + this.loading = false;
  458 + if (res.success) {
  459 + this.$message.success(res.message);
  460 + } else {
  461 + this.$message.error(res.message);
  462 + }
  463 + this.searchQuery();
  464 + });
  465 + },
  466 + handlePickupErrorTask(record) {
  467 + this.loading = true;
  468 + this.model = Object.assign({}, record);
  469 + handlePickupError(this.model.id).then((res) => {
  470 + this.loading = false;
  471 + if (res.success) {
  472 + this.$message.success(res.message);
  473 + } else {
  474 + this.$message.error(res.message);
  475 + }
  476 + this.searchQuery();
  477 + });
  478 + },
  479 + handleDoubleInTask(record) {
  480 + this.loading = true;
  481 + this.model = Object.assign({}, record);
  482 + handleDoubleIn(this.model.id).then((res) => {
  483 + this.loading = false;
  484 + if (res.success) {
  485 + this.$message.success(res.message);
  486 + } else {
  487 + this.$message.error(res.message);
  488 + }
  489 + this.searchQuery();
  490 + });
  491 + },
447 getSuperFieldList() { 492 getSuperFieldList() {
448 let fieldList = []; 493 let fieldList = [];
449 fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'}) 494 fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'})
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
@@ -155,7 +155,11 @@ @@ -155,7 +155,11 @@
155 <span slot="action" slot-scope="text, record"> 155 <span slot="action" slot-scope="text, record">
156 <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行 156 <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行
157 <a-divider type="vertical"/></a> 157 <a-divider type="vertical"/></a>
158 - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 0" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 158 + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据
  159 + <a-divider type="vertical"/></a>
  160 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据
  161 + <a-divider type="vertical"/></a>
  162 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据
159 <a-divider type="vertical"/></a> 163 <a-divider type="vertical"/></a>
160 <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消 164 <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消
161 <a-divider type="vertical"/></a> 165 <a-divider type="vertical"/></a>
@@ -202,7 +206,7 @@ import {initDictOptions, filterMultiDictText} from &#39;@/components/dict/JDictSelec @@ -202,7 +206,7 @@ import {initDictOptions, filterMultiDictText} from &#39;@/components/dict/JDictSelec
202 import '@/assets/less/TableExpand.less' 206 import '@/assets/less/TableExpand.less'
203 import {completeTaskByWMS, cancelTask} from '@/api/api' 207 import {completeTaskByWMS, cancelTask} from '@/api/api'
204 import {execute} from '@/api/api' 208 import {execute} from '@/api/api'
205 -import {getZoneList, handleEmptyOut} from '@/api/api' 209 +import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn} from '@/api/api'
206 import EmptyOutTaskModal from './modules/EmptyOutTaskModal' 210 import EmptyOutTaskModal from './modules/EmptyOutTaskModal'
207 import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal"; 211 import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal";
208 212
@@ -462,6 +466,32 @@ export default { @@ -462,6 +466,32 @@ export default {
462 this.searchQuery(); 466 this.searchQuery();
463 }); 467 });
464 }, 468 },
  469 + handlePickupErrorTask(record) {
  470 + this.loading = true;
  471 + this.model = Object.assign({}, record);
  472 + handlePickupError(this.model.id).then((res) => {
  473 + this.loading = false;
  474 + if (res.success) {
  475 + this.$message.success(res.message);
  476 + } else {
  477 + this.$message.error(res.message);
  478 + }
  479 + this.searchQuery();
  480 + });
  481 + },
  482 + handleDoubleInTask(record) {
  483 + this.loading = true;
  484 + this.model = Object.assign({}, record);
  485 + handleDoubleIn(this.model.id).then((res) => {
  486 + this.loading = false;
  487 + if (res.success) {
  488 + this.$message.success(res.message);
  489 + } else {
  490 + this.$message.error(res.message);
  491 + }
  492 + this.searchQuery();
  493 + });
  494 + },
465 getSuperFieldList() { 495 getSuperFieldList() {
466 let fieldList = []; 496 let fieldList = [];
467 fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'}) 497 fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'})
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
@@ -108,24 +108,24 @@ public class WcsController extends HuahengBaseController { @@ -108,24 +108,24 @@ public class WcsController extends HuahengBaseController {
108 @ResponseBody 108 @ResponseBody
109 @ApiOperation("申请空托盘组出库") 109 @ApiOperation("申请空托盘组出库")
110 @ApiLogger(apiName = "申请空托盘组出库", from = "WCS") 110 @ApiLogger(apiName = "申请空托盘组出库", from = "WCS")
111 - public Result manyEmptyOut(@RequestBody ManyEmptyDomain manyEmptyDomain) {  
112 - String containerCode = manyEmptyDomain.getContainerCode();  
113 - String toPortCode = manyEmptyDomain.getPort();  
114 - String warehouseCode = manyEmptyDomain.getWarehouseCode(); 111 + public Result manyEmptyOut(@RequestBody ManyEmptyOutDomain manyEmptyOutDomain) {
  112 + String toPortCode = manyEmptyOutDomain.getPort();
  113 + String warehouseCode = manyEmptyOutDomain.getWarehouseCode();
  114 + String zoneCode = manyEmptyOutDomain.getZoneCode();
115 if (StringUtils.isEmpty(warehouseCode)) { 115 if (StringUtils.isEmpty(warehouseCode)) {
116 return Result.error("申请空托盘组出库, 仓库号为空"); 116 return Result.error("申请空托盘组出库, 仓库号为空");
117 } 117 }
118 if (StringUtils.isEmpty(toPortCode)) { 118 if (StringUtils.isEmpty(toPortCode)) {
119 return Result.error("申请空托盘组出库, 出库口为空"); 119 return Result.error("申请空托盘组出库, 出库口为空");
120 } 120 }
121 - if (StringUtils.isEmpty(containerCode)) {  
122 - return Result.error("申请空托盘组出库, 托盘号为空"); 121 + if (StringUtils.isEmpty(zoneCode)) {
  122 + return Result.error("申请空托盘组出库, 库区为空");
123 } 123 }
124 - String lockKey = warehouseCode + containerCode; 124 + String lockKey = warehouseCode + zoneCode;
125 Result result = handleMultiProcess("manyEmptyOut", lockKey, new MultiProcessListener() { 125 Result result = handleMultiProcess("manyEmptyOut", lockKey, new MultiProcessListener() {
126 @Override 126 @Override
127 public Result<?> doProcess() { 127 public Result<?> doProcess() {
128 - Result result = taskHeaderService.createManyEmptyOutTask(containerCode, toPortCode, warehouseCode); 128 + Result result = wcsService.manyEmptyOut(zoneCode, toPortCode, warehouseCode);
129 return result; 129 return result;
130 } 130 }
131 }); 131 });
@@ -230,7 +230,7 @@ public class WcsController extends HuahengBaseController { @@ -230,7 +230,7 @@ public class WcsController extends HuahengBaseController {
230 String taskNo = taskEntity.getTaskNo(); 230 String taskNo = taskEntity.getTaskNo();
231 String warehouseCode = taskEntity.getWarehouseCode(); 231 String warehouseCode = taskEntity.getWarehouseCode();
232 String lockKey = warehouseCode; 232 String lockKey = warehouseCode;
233 - Result result = handleMultiProcess("pickupErrorHandle", warehouseCode, new MultiProcessListener() { 233 + Result result = handleMultiProcess("pickupErrorHandle", lockKey, new MultiProcessListener() {
234 @Override 234 @Override
235 public Result<?> doProcess() { 235 public Result<?> doProcess() {
236 Result result = wcsService.pickupErrorHandle(taskNo); 236 Result result = wcsService.pickupErrorHandle(taskNo);
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java
@@ -21,8 +21,8 @@ public class ManyEmptyDomain { @@ -21,8 +21,8 @@ public class ManyEmptyDomain {
21 /** 重量 */ 21 /** 重量 */
22 @ApiModelProperty(value = "重量") 22 @ApiModelProperty(value = "重量")
23 private String weight; 23 private String weight;
24 - /** 重量 */  
25 - @ApiModelProperty(value = "重量") 24 + /** 仓库编码 */
  25 + @ApiModelProperty(value = "仓库编码")
26 private String warehouseCode; 26 private String warehouseCode;
27 /** 巷道 */ 27 /** 巷道 */
28 @ApiModelProperty(value = "巷道") 28 @ApiModelProperty(value = "巷道")
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyOutDomain.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.entity;
  2 +
  3 +import io.swagger.annotations.ApiModelProperty;
  4 +import lombok.Data;
  5 +
  6 +/**
  7 + * @author 游杰
  8 + */
  9 +@Data
  10 +public class ManyEmptyOutDomain {
  11 +
  12 + /** 仓库编码 */
  13 + @ApiModelProperty(value = "仓库编码", required = true)
  14 + private String warehouseCode;
  15 + /** 库区 */
  16 + @ApiModelProperty(value = "库区", required = true)
  17 + private String zoneCode;
  18 + /** 分拣口 */
  19 + @ApiModelProperty(value = "分拣口", required = true)
  20 + private String port;
  21 +
  22 +}
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java
@@ -45,4 +45,9 @@ public interface WcsService { @@ -45,4 +45,9 @@ public interface WcsService {
45 * 到达拣选台 45 * 到达拣选台
46 */ 46 */
47 Result arrivedNotice(String taskNo, String port); 47 Result arrivedNotice(String taskNo, String port);
  48 +
  49 + /**
  50 + * 选取空托盘组出库
  51 + */
  52 + Result manyEmptyOut(String zoneCode, String port, String warehouseCode);
48 } 53 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
@@ -485,6 +485,7 @@ public class WcsServiceImpl implements WcsService { @@ -485,6 +485,7 @@ public class WcsServiceImpl implements WcsService {
485 } 485 }
486 486
487 @Override 487 @Override
  488 + @Transactional(rollbackFor = Exception.class)
488 public Result reentryHandle(String taskNo) { 489 public Result reentryHandle(String taskNo) {
489 // 1、判断非空字段 490 // 1、判断非空字段
490 if (StringUtils.isEmpty(taskNo)) { 491 if (StringUtils.isEmpty(taskNo)) {
@@ -585,6 +586,7 @@ public class WcsServiceImpl implements WcsService { @@ -585,6 +586,7 @@ public class WcsServiceImpl implements WcsService {
585 } 586 }
586 587
587 @Override 588 @Override
  589 + @Transactional(rollbackFor = Exception.class)
588 public Result pickupErrorHandle(String taskNo) { 590 public Result pickupErrorHandle(String taskNo) {
589 // 1、判断非空字段 591 // 1、判断非空字段
590 if (StringUtils.isEmpty(taskNo)) { 592 if (StringUtils.isEmpty(taskNo)) {
@@ -599,7 +601,8 @@ public class WcsServiceImpl implements WcsService { @@ -599,7 +601,8 @@ public class WcsServiceImpl implements WcsService {
599 if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { 601 if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) {
600 return Result.OK("取货错处理失败, 任务已完成"); 602 return Result.OK("取货错处理失败, 任务已完成");
601 } 603 }
602 - // 3、修改该任务为取货错,过后处理 604 + // 4、修改该任务为取货错,过后处理
  605 + taskHeader.setIsPickupError(QuantityConstant.PICK_UP_ERROR);
603 taskHeader.setExceptionName("取货错误"); 606 taskHeader.setExceptionName("取货错误");
604 taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_ERROR); 607 taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_ERROR);
605 boolean success = taskHeaderService.updateById(taskHeader); 608 boolean success = taskHeaderService.updateById(taskHeader);
@@ -610,6 +613,7 @@ public class WcsServiceImpl implements WcsService { @@ -610,6 +613,7 @@ public class WcsServiceImpl implements WcsService {
610 } 613 }
611 614
612 @Override 615 @Override
  616 + @Transactional(rollbackFor = Exception.class)
613 public Result arrivedNotice(String taskNo, String port) { 617 public Result arrivedNotice(String taskNo, String port) {
614 TaskHeader taskHeader = taskHeaderService.getById(taskNo); 618 TaskHeader taskHeader = taskHeaderService.getById(taskNo);
615 if (taskHeader == null) { 619 if (taskHeader == null) {
@@ -628,4 +632,33 @@ public class WcsServiceImpl implements WcsService { @@ -628,4 +632,33 @@ public class WcsServiceImpl implements WcsService {
628 return Result.ok("更新到达站台成功"); 632 return Result.ok("更新到达站台成功");
629 } 633 }
630 634
  635 + @Override
  636 + @Transactional(rollbackFor = Exception.class)
  637 + public Result manyEmptyOut(String zoneCode, String port, String warehouseCode) {
  638 + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
  639 + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_MANY).eq(Container::getWarehouseCode, warehouseCode);
  640 + List<Container> containerList = containerService.list(containerLambdaQueryWrapper);
  641 + List<Container> removeContainerList = new ArrayList<>();
  642 + if (containerList != null && containerList.size() > 0) {
  643 + for (Container container : containerList) {
  644 + String locationCode = container.getLocationCode();
  645 + Location location = locationService.getLocationByCode(locationCode, warehouseCode);
  646 + if (!location.getZoneCode().equals(zoneCode)) {
  647 + removeContainerList.add(container);
  648 + }
  649 + }
  650 + }
  651 + containerList.removeAll(removeContainerList);
  652 + if (!(containerList != null && containerList.size() > 0)) {
  653 + return Result.error("没有找到合适的空托盘组!");
  654 + }
  655 + String containerCode = containerList.get(0).getCode();
  656 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  657 + if (container == null) {
  658 + return Result.error("没有找到托盘, 托盘号:" + containerCode);
  659 + }
  660 + Result result = taskHeaderService.createManyEmptyOut(containerCode, port, warehouseCode);
  661 + return result;
  662 + }
  663 +
631 } 664 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
@@ -658,8 +658,8 @@ public class TaskHeaderController extends HuahengBaseController { @@ -658,8 +658,8 @@ public class TaskHeaderController extends HuahengBaseController {
658 @ApiOperation("修复空出的数据") 658 @ApiOperation("修复空出的数据")
659 @ResponseBody 659 @ResponseBody
660 @ApiLogger(apiName = "修复空出的数据", from = "WMS") 660 @ApiLogger(apiName = "修复空出的数据", from = "WMS")
661 - public Result handleEmptyOut(@RequestParam(name = "ids", required = true) String ids) {  
662 - Result result = taskHeaderService.handleEmptyOut(ids); 661 + public Result handleEmptyOut(@RequestParam(name = "id", required = true) String id) {
  662 + Result result = taskHeaderService.handleEmptyOut(id);
663 return result; 663 return result;
664 } 664 }
665 665
@@ -672,8 +672,8 @@ public class TaskHeaderController extends HuahengBaseController { @@ -672,8 +672,8 @@ public class TaskHeaderController extends HuahengBaseController {
672 @ApiOperation("修复重入的数据") 672 @ApiOperation("修复重入的数据")
673 @ResponseBody 673 @ResponseBody
674 @ApiLogger(apiName = "修复重入的数据", from = "WMS") 674 @ApiLogger(apiName = "修复重入的数据", from = "WMS")
675 - public Result handleDoubleIn(@RequestBody String taskNo) {  
676 - Result result = taskHeaderService.handleDoubleIn(taskNo); 675 + public Result handleDoubleIn(@RequestParam(name = "id", required = true) String id) {
  676 + Result result = taskHeaderService.handleDoubleIn(id);
677 return result; 677 return result;
678 } 678 }
679 679
@@ -686,8 +686,8 @@ public class TaskHeaderController extends HuahengBaseController { @@ -686,8 +686,8 @@ public class TaskHeaderController extends HuahengBaseController {
686 @ApiOperation("修复取货错的数据") 686 @ApiOperation("修复取货错的数据")
687 @ResponseBody 687 @ResponseBody
688 @ApiLogger(apiName = "修复取货错的数据", from = "WMS") 688 @ApiLogger(apiName = "修复取货错的数据", from = "WMS")
689 - public Result handlePickupError(@RequestBody String taskNo) {  
690 - Result result = taskHeaderService.handlePickupError(taskNo); 689 + public Result handlePickupError(@RequestParam(name = "id", required = true) String id) {
  690 + Result result = taskHeaderService.handlePickupError(id);
691 return result; 691 return result;
692 } 692 }
693 693
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
@@ -169,15 +169,6 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; { @@ -169,15 +169,6 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
169 Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode); 169 Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode);
170 170
171 /** 171 /**
172 - * WCS申请空托盘组出库  
173 - * @param zoneCode  
174 - * @param toPortCode  
175 - * @param warehouseCode  
176 - * @return  
177 - */  
178 - Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode);  
179 -  
180 - /**  
181 * 创建空托盘组出库 172 * 创建空托盘组出库
182 * @param containerCode 173 * @param containerCode
183 * @param toPortCode 174 * @param toPortCode
@@ -214,8 +205,18 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; { @@ -214,8 +205,18 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
214 */ 205 */
215 Result handlePickupError(String taskNo); 206 Result handlePickupError(String taskNo);
216 207
  208 + /**
  209 + * 完成入库
  210 + * @param taskHeader
  211 + * @return
  212 + */
217 Result completeReceiptTask(TaskHeader taskHeader); 213 Result completeReceiptTask(TaskHeader taskHeader);
218 214
  215 + /**
  216 + * 完成出库
  217 + * @param taskHeader
  218 + * @return
  219 + */
219 Result completeShipmentTask(TaskHeader taskHeader); 220 Result completeShipmentTask(TaskHeader taskHeader);
220 221
221 Result completeCycleCountTask(TaskHeader taskHeader); 222 Result completeCycleCountTask(TaskHeader taskHeader);
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -485,7 +485,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -485,7 +485,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
485 if (StringUtils.isEmpty(toLocationCode)) { 485 if (StringUtils.isEmpty(toLocationCode)) {
486 throw new ServiceException("创建空托盘组入库任务时,目标库位为空"); 486 throw new ServiceException("创建空托盘组入库任务时,目标库位为空");
487 } 487 }
488 - Result result = createManyEmptyIn(containerCode, toLocationCode, warehouseCode); 488 + Result result = taskHeaderService.createManyEmptyIn(containerCode, toLocationCode, warehouseCode);
489 if (!result.isSuccess()) { 489 if (!result.isSuccess()) {
490 throw new ServiceException(result.getMessage()); 490 throw new ServiceException(result.getMessage());
491 } 491 }
@@ -501,6 +501,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -501,6 +501,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
501 if (StringUtils.isEmpty(warehouseCode)) { 501 if (StringUtils.isEmpty(warehouseCode)) {
502 return Result.error("创建空托盘组入库任务时,仓库编码为空"); 502 return Result.error("创建空托盘组入库任务时,仓库编码为空");
503 } 503 }
  504 + String zoneCode = null;
504 Container container = containerService.getContainerByCode(containerCode, warehouseCode); 505 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
505 if (container == null) { 506 if (container == null) {
506 return Result.error("创建空托盘组入库任务时,没有找到容器"); 507 return Result.error("创建空托盘组入库任务时,没有找到容器");
@@ -520,13 +521,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -520,13 +521,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
520 if (toLocation == null) { 521 if (toLocation == null) {
521 return Result.error("创建空托盘组入库任务时,没有找到目标库位"); 522 return Result.error("创建空托盘组入库任务时,没有找到目标库位");
522 } 523 }
523 - if (toLocation.getStatus() != QuantityConstant.STATUS_LOCATION_EMPTY) { 524 + if (!toLocation.getStatus().equals(QuantityConstant.STATUS_LOCATION_EMPTY)) {
524 return Result.error("创建空托盘组入库任务时,目标库位状态不是空闲"); 525 return Result.error("创建空托盘组入库任务时,目标库位状态不是空闲");
525 } 526 }
526 success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); 527 success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
527 if (!success) { 528 if (!success) {
528 throw new ServiceException("创建空托盘组入库任务时, 更新库位状态失败"); 529 throw new ServiceException("创建空托盘组入库任务时, 更新库位状态失败");
529 } 530 }
  531 + zoneCode = toLocation.getZoneCode();
530 } 532 }
531 TaskHeader taskHeader = new TaskHeader(); 533 TaskHeader taskHeader = new TaskHeader();
532 taskHeader.setWarehouseCode(warehouseCode); 534 taskHeader.setWarehouseCode(warehouseCode);
@@ -534,6 +536,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -534,6 +536,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
534 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT); 536 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT);
535 taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); 537 taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT);
536 taskHeader.setToLocationCode(toLocationCode); 538 taskHeader.setToLocationCode(toLocationCode);
  539 + taskHeader.setZoneCode(zoneCode);
537 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); 540 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
538 success = taskHeaderService.save(taskHeader); 541 success = taskHeaderService.save(taskHeader);
539 if (!success) { 542 if (!success) {
@@ -544,51 +547,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -544,51 +547,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
544 547
545 @Override 548 @Override
546 @Transactional(rollbackFor = Exception.class) 549 @Transactional(rollbackFor = Exception.class)
547 - public Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode) {  
548 - if (StringUtils.isEmpty(toPortCode)) {  
549 - return Result.error("创建空托盘组出库任务时,目标出入口为空");  
550 - }  
551 - if (StringUtils.isEmpty(zoneCode)) {  
552 - return Result.error("创建空托盘组出库任务时,库区编码为空");  
553 - }  
554 - if (StringUtils.isEmpty(warehouseCode)) {  
555 - return Result.error("创建空托盘组出库任务时,仓库编码为空");  
556 - }  
557 - List<Container> containerList = containerService.getContainerListByStatus(QuantityConstant.STATUS_CONTAINER_MANY, warehouseCode);  
558 - if (containerList.size() == 0) {  
559 - return Result.error("创建空托盘组出库任务时,没有找到空托盘组");  
560 - }  
561 - List<Container> removeContainerList = new ArrayList<>();  
562 - if (containerList.size() > 0) {  
563 - for (Container container : containerList) {  
564 - String locationCode = container.getLocationCode();  
565 - Location location = locationService.getLocationByCode(locationCode, warehouseCode);  
566 - if (!location.getZoneCode().equals(zoneCode)) {  
567 - removeContainerList.add(container);  
568 - }  
569 - }  
570 - }  
571 - boolean success = containerList.removeAll(removeContainerList);  
572 - if (!success) {  
573 - throw new ServiceException("创建空托盘组出库任务时,删除不符合的空托盘组失败");  
574 - }  
575 - if (containerList.size() <= 0) {  
576 - throw new ServiceException("没有找到合适的空托盘组!");  
577 - }  
578 - String containerCode = containerList.get(0).getCode();  
579 - TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);  
580 - if (taskHeader != null) {  
581 - return Result.ok("创建空托盘组出库任务时, 已经生成空托盘组出库任务");  
582 - }  
583 - Result result = createManyEmptyOut(containerCode, toPortCode, warehouseCode);  
584 - if (!result.isSuccess()) {  
585 - throw new ServiceException(result.getMessage());  
586 - }  
587 - return Result.ok("创建空托盘组出库任务成功");  
588 - }  
589 -  
590 - @Override  
591 - @Transactional(rollbackFor = Exception.class)  
592 public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) { 550 public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) {
593 if (StringUtils.isEmpty(containerCode)) { 551 if (StringUtils.isEmpty(containerCode)) {
594 return Result.error("创建空托盘组出库任务时,托盘号为空"); 552 return Result.error("创建空托盘组出库任务时,托盘号为空");
@@ -720,6 +678,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -720,6 +678,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
720 throw new ServiceException("处理空出失败, 删除库存详情失败"); 678 throw new ServiceException("处理空出失败, 删除库存详情失败");
721 } 679 }
722 } 680 }
  681 + // 9 更新单据
  682 + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE);
  683 + success = taskHeaderService.updateById(taskHeader);
  684 + if (!success) {
  685 + throw new ServiceException("处理空出失败,更新任务失败");
  686 + }
723 return Result.ok("处理空出成功"); 687 return Result.ok("处理空出成功");
724 } 688 }
725 689
@@ -768,7 +732,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -768,7 +732,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
768 throw new ServiceException("处理重入失败,更新库位失败"); 732 throw new ServiceException("处理重入失败,更新库位失败");
769 } 733 }
770 } 734 }
771 - 735 + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE);
  736 + boolean success = taskHeaderService.updateById(taskHeader);
  737 + if (!success) {
  738 + throw new ServiceException("处理重入失败,更新任务失败");
  739 + }
772 return Result.ok("处理重入成功"); 740 return Result.ok("处理重入成功");
773 } 741 }
774 742
@@ -784,11 +752,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea @@ -784,11 +752,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
784 return Result.error("处理取货错失败,没有找到该任务"); 752 return Result.error("处理取货错失败,没有找到该任务");
785 } 753 }
786 // 3、已经完成的任务,不需要在处理 754 // 3、已经完成的任务,不需要在处理
787 - if (taskHeader.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) {  
788 - return Result.OK("处理取货错失败, 任务没有完成"); 755 + if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) {
  756 + return Result.OK("处理取货错失败, 任务已经完成");
789 } 757 }
790 758
791 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); 759 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  760 + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE);
792 boolean success = taskHeaderService.updateById(taskHeader); 761 boolean success = taskHeaderService.updateById(taskHeader);
793 if (!success) { 762 if (!success) {
794 throw new ServiceException("处理取货错失败,更新任务失败"); 763 throw new ServiceException("处理取货错失败,更新任务失败");
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
@@ -492,6 +492,9 @@ public class QuantityConstant { @@ -492,6 +492,9 @@ public class QuantityConstant {
492 public static final int EMPTY_OUT_PROSESS = 2; 492 public static final int EMPTY_OUT_PROSESS = 2;
493 public static final int NORMAL_OUT = 0; 493 public static final int NORMAL_OUT = 0;
494 494
  495 + // 取货错
  496 + public static final int PICK_UP_ERROR = 1;
  497 +
495 public static final int PORT_TYPE_IN = 1; 498 public static final int PORT_TYPE_IN = 1;
496 public static final int PORT_TYPE_OUT = 2; 499 public static final int PORT_TYPE_OUT = 2;
497 public static final int PORT_TYPE_PICK = 3; 500 public static final int PORT_TYPE_PICK = 3;