Commit dd89a4adafd38e1fc353d0a40a7430fb62a59638
1 parent
071cbc60
增加托盘返回接口,判断是叠盘还是回库
Showing
5 changed files
with
77 additions
and
5 deletions
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptHeaderModal.vue
... | ... | @@ -117,8 +117,8 @@ export default { |
117 | 117 | }, |
118 | 118 | methods: { |
119 | 119 | add() { |
120 | - this.edit(this.modelDefault); | |
121 | - this.model.companyCode = this.companyList[0].code; | |
120 | + let record={companyCode: this.companyList[0].code, type:'YCLR'} | |
121 | + this.edit(record); | |
122 | 122 | }, |
123 | 123 | edit(record) { |
124 | 124 | this.model = Object.assign({}, record); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... | ... | @@ -291,4 +291,28 @@ public class WcsController extends HuahengBaseController { |
291 | 291 | }); |
292 | 292 | return result; |
293 | 293 | } |
294 | + | |
295 | + /** | |
296 | + * 查询钢托盘是否返回 | |
297 | + */ | |
298 | + @PostMapping("/back") | |
299 | + @ApiOperation("查询托盘是否返回") | |
300 | + @ApiLogger(apiName = "查询托盘是否返回", from = "WCS") | |
301 | + @ResponseBody | |
302 | + public Result back(@RequestBody WcsBack wcsBack) { | |
303 | + String taskNo = wcsBack.getTaskNo(); | |
304 | + int weight = wcsBack.getWeight(); | |
305 | + if (StringUtils.isEmpty(taskNo)) { | |
306 | + return Result.error("没有taskNo值"); | |
307 | + } | |
308 | + String lockKey = taskNo; | |
309 | + Result result = handleMultiProcess("back", lockKey, new MultiProcessListener() { | |
310 | + @Override | |
311 | + public Result<?> doProcess() { | |
312 | + Result result = wcsService.back(taskNo); | |
313 | + return result; | |
314 | + } | |
315 | + }); | |
316 | + return result; | |
317 | + } | |
294 | 318 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/WcsBack.java
0 → 100644
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java
... | ... | @@ -62,11 +62,13 @@ public interface WcsService { |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * 获取可用巷道 |
65 | - * @author TanYibin | |
66 | - * @createDate 2023年10月16日 | |
67 | - * @param zoneCode | |
65 | + * @author TanYibin | |
66 | + * @createDate 2023年10月16日 | |
67 | + * @param zoneCode | |
68 | 68 | * @return |
69 | 69 | */ |
70 | 70 | Result<List<Integer>> getAvailableRowdway(String zoneCode); |
71 | 71 | |
72 | + Result back(String taskNo); | |
73 | + | |
72 | 74 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -30,6 +30,8 @@ import org.jeecg.modules.wms.config.material.service.IMaterialService; |
30 | 30 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
31 | 31 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
32 | 32 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
33 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | |
34 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | |
33 | 35 | import org.jeecg.modules.wms.lockStation.service.ILockStationService; |
34 | 36 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail; |
35 | 37 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
... | ... | @@ -49,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional; |
49 | 51 | import com.alibaba.fastjson.JSON; |
50 | 52 | import com.alibaba.fastjson.TypeReference; |
51 | 53 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
54 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
52 | 55 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
53 | 56 | |
54 | 57 | import cn.hutool.core.collection.CollUtil; |
... | ... | @@ -108,6 +111,9 @@ public class WcsServiceImpl implements WcsService { |
108 | 111 | @Resource |
109 | 112 | private ILockStationService lockStationService; |
110 | 113 | |
114 | + @Resource | |
115 | + private IInventoryDetailService inventoryDetailService; | |
116 | + | |
111 | 117 | /** |
112 | 118 | * 库位分配 |
113 | 119 | * @throws SocketException |
... | ... | @@ -334,6 +340,33 @@ public class WcsServiceImpl implements WcsService { |
334 | 340 | |
335 | 341 | @Override |
336 | 342 | @Transactional(rollbackFor = Exception.class) |
343 | + public Result back(String taskNo) { | |
344 | + TaskHeader taskHeader = taskHeaderService.getById(taskNo); | |
345 | + if (taskHeader == null) { | |
346 | + return Result.error("没有找到任务,不允许回库, 任务号:" + taskNo); | |
347 | + } | |
348 | + // 返回1 表示回库 | |
349 | + // 返回2 表示去叠盘 | |
350 | + int flag = 1; | |
351 | + int taskType = taskHeader.getTaskType(); | |
352 | + if (taskType != QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { | |
353 | + return Result.error("任务号" + taskNo + "不是分拣任务"); | |
354 | + } | |
355 | + String containerCode = taskHeader.getContainerCode(); | |
356 | + if (StringUtils.isEmpty(containerCode)) { | |
357 | + return Result.error("任务号" + taskNo + "没有托盘号"); | |
358 | + } | |
359 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, taskHeader.getWarehouseCode()); | |
360 | + if (CollectionUtils.isEmpty(inventoryDetailList)) { | |
361 | + flag = 2; // 返回2 表示叠盘 | |
362 | + return Result.OK("任务ID:" + taskHeader.getId() + " 允许去叠盘", flag); | |
363 | + } | |
364 | + flag = 1; // 返回1 表示回库 | |
365 | + return Result.OK("任务ID:" + taskHeader.getId() + " 允许回库", flag); | |
366 | + } | |
367 | + | |
368 | + @Override | |
369 | + @Transactional(rollbackFor = Exception.class) | |
337 | 370 | @OperationLog(bizId = "#taskHeader == null ? '' : #taskHeader.getId()", bizType = "'任务追踪'", tag = "'任务下发'", extra = "''", |
338 | 371 | msg = "#taskHeader == null ? '' : '任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", |
339 | 372 | recordReturnValue = true) |
... | ... |