Commit cc7d8773b0d0a29df6bb721e2f4d38bd934e14c9
Merge remote-tracking branch 'origin/develop' into develop
Showing
6 changed files
with
20 additions
and
13 deletions
src/main/java/com/huaheng/mobile/invenory/MobileInventoryController.java
... | ... | @@ -218,7 +218,7 @@ public class MobileInventoryController { |
218 | 218 | String containerCode = param.get("containerCode"); |
219 | 219 | String destinationLocation = param.get("destinationLocation"); |
220 | 220 | String companyCode = param.get("companyCode"); |
221 | - return taskService.createEmptyIn(containerCode, destinationLocation, companyCode); | |
221 | + return inventoryService.createEmptyIn(containerCode, destinationLocation); | |
222 | 222 | } |
223 | 223 | |
224 | 224 | @PostMapping("/createEmptyOut") |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
... | ... | @@ -109,11 +109,11 @@ public class InventoryHeaderController extends BaseController |
109 | 109 | @RequiresPermissions("inventory:inventoryHeader:seeOut") |
110 | 110 | @PostMapping("/createCheckOutTask") |
111 | 111 | @ResponseBody |
112 | - public AjaxResult createCheckOutTask(String[] ids){ | |
112 | + public AjaxResult createCheckOutTask(String ids){ | |
113 | 113 | if(StringUtils.isEmpty(ids)){ |
114 | 114 | return AjaxResult.error("库存ID不能为空!"); |
115 | 115 | } |
116 | - return inventoryHeaderService.createCheckOutTask(ids); | |
116 | + return inventoryHeaderService.createCheckOutTask(ids.split(",")); | |
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
... | ... | @@ -135,7 +135,7 @@ public class InventoryHeaderController extends BaseController |
135 | 135 | @Log(title = "任务-任务管理", operating = "生成空托盘入库任务", action = BusinessType.INSERT) |
136 | 136 | @ResponseBody |
137 | 137 | public AjaxResult emptyIn(String containerCode,String destinationLocation){ |
138 | - if(StringUtils.isEmpty(containerCode) || StringUtils.isEmpty(destinationLocation)){ | |
138 | + if(StringUtils.isEmpty(containerCode)){ | |
139 | 139 | throw new ServiceException("容器和目标库位不能有空值!"); |
140 | 140 | } |
141 | 141 | return inventoryHeaderService.createEmptyIn(containerCode, destinationLocation); |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
1 | 1 | package com.huaheng.pc.inventory.inventoryHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
4 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 6 | import com.huaheng.common.constant.QuantityConstant; |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
... | ... | @@ -103,6 +104,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
103 | 104 | if (StringUtils.isNotEmpty(container.getLocationCode())) { |
104 | 105 | return AjaxResult.error("容器已在库位[" + container.getLocationCode() + "]上"); |
105 | 106 | } |
107 | + container.setStatus("lock"); | |
108 | + LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
109 | + containerUpdateWrapper.eq(Container::getCode, container.getCode()); | |
110 | + containerService.update(container, containerUpdateWrapper); | |
106 | 111 | Location loc = null; |
107 | 112 | if(StringUtils.isNotEmpty(destinationLocation)) { |
108 | 113 | //库位 |
... | ... | @@ -220,7 +225,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
220 | 225 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode,loc.getWarehouseCode()) |
221 | 226 | .eq(InventoryDetail::getLocationCode, loc.getCode()); |
222 | 227 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
223 | - if(inventoryDetailList != null || inventoryDetailList.size() > 0){ | |
228 | + if(inventoryDetailList != null && inventoryDetailList.size() > 0){ | |
224 | 229 | return AjaxResult.error("该容器上有库存,无法空托出库!"); |
225 | 230 | } |
226 | 231 | //判断托盘是否已经存在任务 |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -1149,11 +1149,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1149 | 1149 | inventoryTransaction.setSupplierCode(item.getSupplierCode()); |
1150 | 1150 | inventoryTransactionList.add(inventoryTransaction); |
1151 | 1151 | } |
1152 | - if (inventoryDetailService.saveOrUpdateBatch(inventoryDetails)) { | |
1153 | - //更新库存明细成功后,写入库存交易 | |
1154 | - inventoryTransactionService.saveBatch(inventoryTransactionList); | |
1155 | - } else { | |
1156 | - throw new ServiceException("库存明细更新错误!"); | |
1152 | + if(inventoryDetails != null && inventoryDetails.size() > 0) { | |
1153 | + if (inventoryDetailService.saveOrUpdateBatch(inventoryDetails)) { | |
1154 | + //更新库存明细成功后,写入库存交易 | |
1155 | + inventoryTransactionService.saveBatch(inventoryTransactionList); | |
1156 | + } else { | |
1157 | + throw new ServiceException("库存明细更新错误!"); | |
1158 | + } | |
1157 | 1159 | } |
1158 | 1160 | |
1159 | 1161 | } |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyIn.html
src/main/resources/templates/task/task/emptyIn.html
... | ... | @@ -27,14 +27,14 @@ |
27 | 27 | </div> |
28 | 28 | <div th:include="include::footer"></div> |
29 | 29 | <script type="text/javascript"> |
30 | - var prefix = ctx + "task/task" | |
30 | + var prefix = ctx + "inventory/inventoryHeader" | |
31 | 31 | $("#form-task-emptyIn").validate({ |
32 | 32 | rules:{ |
33 | 33 | containerCode:{ |
34 | 34 | required:true, |
35 | 35 | }, |
36 | 36 | destinationLocation:{ |
37 | - required:true, | |
37 | + required:false, | |
38 | 38 | }, |
39 | 39 | }, |
40 | 40 | submitHandler: function(form) { |
... | ... |