Commit 7c82f8530c3ebf1696bfcb1d53c9361fec69a815
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop
Showing
8 changed files
with
290 additions
and
26 deletions
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerStatusSelectModal.vue
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | <!-- <a-input placeholder="请输入入库口" v-model="quickMainModel.toPort"/>--> |
30 | 30 | <j-search-select-tag |
31 | 31 | placeholder="请选择入库口" |
32 | - v-model="model.fromPort" | |
32 | + v-model="model.toPort" | |
33 | 33 | dict="port,name,code,type !='2'" |
34 | 34 | :pageSize="5" |
35 | 35 | :async="true"> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java
1 | 1 | package org.jeecg.modules.wms.api.tv; |
2 | 2 | |
3 | +import cn.hutool.core.collection.CollUtil; | |
4 | +import cn.hutool.core.collection.CollectionUtil; | |
5 | +import cn.hutool.core.date.DateUtil; | |
3 | 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
7 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
4 | 8 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 9 | import io.swagger.annotations.Api; |
10 | +import io.swagger.annotations.ApiOperation; | |
6 | 11 | import lombok.extern.slf4j.Slf4j; |
7 | 12 | import org.jeecg.common.api.vo.Result; |
8 | 13 | import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo; |
14 | +import org.jeecg.modules.wms.config.location.entity.Location; | |
15 | +import org.jeecg.modules.wms.config.location.service.ILocationService; | |
9 | 16 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
17 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | |
18 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | |
19 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | |
20 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | |
21 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | |
22 | +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; | |
10 | 23 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
11 | 24 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
25 | +import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; | |
26 | +import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; | |
12 | 27 | import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; |
13 | 28 | import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; |
14 | 29 | import org.jeecg.utils.StringUtils; |
15 | 30 | import org.jeecg.utils.constant.QuantityConstant; |
31 | +import org.jeecg.utils.support.PassApiAuthentication; | |
16 | 32 | import org.springframework.beans.factory.annotation.Value; |
17 | 33 | import org.springframework.web.bind.annotation.GetMapping; |
18 | 34 | import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | @@ -20,10 +36,9 @@ import org.springframework.web.bind.annotation.RestController; |
20 | 36 | |
21 | 37 | import javax.annotation.Resource; |
22 | 38 | import javax.servlet.http.HttpServletResponse; |
23 | -import java.util.ArrayList; | |
24 | -import java.util.Arrays; | |
25 | -import java.util.HashMap; | |
26 | -import java.util.List; | |
39 | +import java.math.BigDecimal; | |
40 | +import java.util.*; | |
41 | +import java.util.stream.Collectors; | |
27 | 42 | |
28 | 43 | /** |
29 | 44 | */ |
... | ... | @@ -45,6 +60,18 @@ public class TvController { |
45 | 60 | @Resource |
46 | 61 | private TaskDetailServiceImpl taskDetailService; |
47 | 62 | |
63 | + @Resource | |
64 | + private ILocationService locationService; | |
65 | + | |
66 | + @Resource | |
67 | + private IShipmentDetailService shipmentDetailService; | |
68 | + | |
69 | + @Resource | |
70 | + private IInventoryTransactionService inventoryTransactionService; | |
71 | + | |
72 | + @Resource | |
73 | + private IInventoryDetailService inventoryDetailService; | |
74 | + | |
48 | 75 | @GetMapping("taskOfStation") |
49 | 76 | public Result<List<TvTaskVo>> importExcel(String code, HttpServletResponse response) { |
50 | 77 | |
... | ... | @@ -110,4 +137,222 @@ public class TvController { |
110 | 137 | log.error("查找电视版本参数错误", e); |
111 | 138 | } |
112 | 139 | } |
140 | + | |
141 | + /** | |
142 | + * 当天出入库量 | |
143 | + * @param zoneCode 库区编码 | |
144 | + * @return | |
145 | + */ | |
146 | + @GetMapping("todayTaskNum") | |
147 | + public Result todayTaskNum(String zoneCode, HttpServletResponse response) { | |
148 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
149 | + ArrayList<Object> result = CollUtil.newArrayList(); | |
150 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
151 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getZoneCode, zoneCode); | |
152 | + taskHeaderLambdaQueryWrapper.likeRight(TaskHeader::getCreateTime, DateUtil.today()); | |
153 | + taskHeaderLambdaQueryWrapper.in(TaskHeader::getInnernalTaskType, QuantityConstant.TASK_INTENERTYPE_RECEIPT, QuantityConstant.TASK_INTENERTYPE_SHIPMENT, | |
154 | + QuantityConstant.TASK_INTENERTYPE_TRANSFER_POSITION); | |
155 | + List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | |
156 | + Map<Integer, List<TaskHeader>> taskTypeMap = taskHeaderList.stream().collect(Collectors.groupingBy(TaskHeader::getInnernalTaskType)); | |
157 | + List<TaskHeader> receiptTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
158 | + List<TaskHeader> shipmentTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
159 | + HashMap<String, Integer> resultMap = new HashMap<>(); | |
160 | + int receiptNum = 0; | |
161 | + int shipmentNum = 0; | |
162 | + if (CollectionUtils.isNotEmpty(receiptTaskList)) { | |
163 | + receiptNum = receiptTaskList.size(); | |
164 | + resultMap.put("receiptNum", receiptNum); | |
165 | + } else { | |
166 | + resultMap.put("receiptNum", 0); | |
167 | + } | |
168 | + if (CollectionUtils.isNotEmpty(shipmentTaskList)) { | |
169 | + shipmentNum = shipmentTaskList.size(); | |
170 | + resultMap.put("shipmentNum", shipmentNum); | |
171 | + } else { | |
172 | + resultMap.put("shipmentNum", 0); | |
173 | + } | |
174 | + if (shipmentNum != 0 && receiptNum != 0) { | |
175 | + float proportion = (Math.round(receiptTaskList.size() / (float)shipmentTaskList.size() * 100)) / 100f; | |
176 | + resultMap.put("proportion", (int)(proportion * 100)); | |
177 | + } else { | |
178 | + resultMap.put("proportion", 100); | |
179 | + } | |
180 | + result.add(resultMap); | |
181 | + return Result.OK(result); | |
182 | + } | |
183 | + | |
184 | + /** | |
185 | + * 当周出入库量 | |
186 | + * @param zoneCode 库区编码 | |
187 | + * @return | |
188 | + */ | |
189 | + @GetMapping("weekTaskNum") | |
190 | + public Result weekTaskNum(String zoneCode, HttpServletResponse response) { | |
191 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
192 | + ArrayList<Object> result = CollUtil.newArrayList(); | |
193 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
194 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getZoneCode, zoneCode); | |
195 | + taskHeaderLambdaQueryWrapper.ge(TaskHeader::getCreateTime, DateUtil.offsetDay(new Date(), -7)); | |
196 | + taskHeaderLambdaQueryWrapper.in(TaskHeader::getInnernalTaskType, QuantityConstant.TASK_INTENERTYPE_RECEIPT, QuantityConstant.TASK_INTENERTYPE_SHIPMENT, | |
197 | + QuantityConstant.TASK_INTENERTYPE_TRANSFER_POSITION); | |
198 | + List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | |
199 | + Map<Integer, List<TaskHeader>> taskTypeMap = taskHeaderList.stream().collect(Collectors.groupingBy(TaskHeader::getInnernalTaskType)); | |
200 | + List<TaskHeader> receiptTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
201 | + List<TaskHeader> shipmentTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
202 | + HashMap<String, Integer> resultMap = new HashMap<>(); | |
203 | + int receiptNum = 0; | |
204 | + int shipmentNum = 0; | |
205 | + if (CollectionUtils.isNotEmpty(receiptTaskList)) { | |
206 | + receiptNum = receiptTaskList.size(); | |
207 | + resultMap.put("receiptNum", receiptNum); | |
208 | + } else { | |
209 | + resultMap.put("receiptNum", 0); | |
210 | + } | |
211 | + if (CollectionUtils.isNotEmpty(shipmentTaskList)) { | |
212 | + shipmentNum = shipmentTaskList.size(); | |
213 | + resultMap.put("shipmentNum", shipmentNum); | |
214 | + } else { | |
215 | + resultMap.put("shipmentNum", 0); | |
216 | + } | |
217 | + if (shipmentNum != 0 && receiptNum != 0) { | |
218 | + float proportion = (Math.round(receiptTaskList.size() / (float)shipmentTaskList.size() * 100)) / 100f; | |
219 | + resultMap.put("proportion", (int)(proportion * 100)); | |
220 | + } else { | |
221 | + resultMap.put("proportion", 100); | |
222 | + } | |
223 | + result.add(resultMap); | |
224 | + return Result.OK(result); | |
225 | + } | |
226 | + | |
227 | + /** | |
228 | + * 当月出入库量 | |
229 | + * @param zoneCode 库区编码 | |
230 | + * @return | |
231 | + */ | |
232 | + @GetMapping("monthTaskNum") | |
233 | + public Result monthTaskNum(String zoneCode, HttpServletResponse response) { | |
234 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
235 | + ArrayList<Object> result = CollUtil.newArrayList(); | |
236 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
237 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getZoneCode, zoneCode); | |
238 | + taskHeaderLambdaQueryWrapper.ge(TaskHeader::getCreateTime, DateUtil.offsetDay(new Date(), -30)); | |
239 | + taskHeaderLambdaQueryWrapper.in(TaskHeader::getInnernalTaskType, QuantityConstant.TASK_INTENERTYPE_RECEIPT, QuantityConstant.TASK_INTENERTYPE_SHIPMENT, | |
240 | + QuantityConstant.TASK_INTENERTYPE_TRANSFER_POSITION); | |
241 | + List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | |
242 | + Map<Integer, List<TaskHeader>> taskTypeMap = taskHeaderList.stream().collect(Collectors.groupingBy(TaskHeader::getInnernalTaskType)); | |
243 | + List<TaskHeader> receiptTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
244 | + List<TaskHeader> shipmentTaskList = taskTypeMap.get(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
245 | + HashMap<String, Integer> resultMap = new HashMap<>(); | |
246 | + int receiptNum = 0; | |
247 | + int shipmentNum = 0; | |
248 | + if (CollectionUtils.isNotEmpty(receiptTaskList)) { | |
249 | + receiptNum = receiptTaskList.size(); | |
250 | + resultMap.put("receiptNum", receiptNum); | |
251 | + } else { | |
252 | + resultMap.put("receiptNum", 0); | |
253 | + } | |
254 | + if (CollectionUtils.isNotEmpty(shipmentTaskList)) { | |
255 | + shipmentNum = shipmentTaskList.size(); | |
256 | + resultMap.put("shipmentNum", shipmentNum); | |
257 | + } else { | |
258 | + resultMap.put("shipmentNum", 0); | |
259 | + } | |
260 | + if (shipmentNum != 0 && receiptNum != 0) { | |
261 | + float proportion = (Math.round(receiptTaskList.size() / (float)shipmentTaskList.size() * 100)) / 100f; | |
262 | + resultMap.put("proportion", (int)(proportion * 100)); | |
263 | + } else { | |
264 | + resultMap.put("proportion", 100); | |
265 | + } | |
266 | + result.add(resultMap); | |
267 | + return Result.OK(result); | |
268 | + } | |
269 | + | |
270 | + /** | |
271 | + * 库位使用情况(按巷道来) | |
272 | + * @param zoneCode 库区编码 | |
273 | + * @return | |
274 | + */ | |
275 | + @GetMapping("roadWayLocation") | |
276 | + public Result<?> roadWayLocation(String zoneCode, HttpServletResponse response) { | |
277 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
278 | + ArrayList<Object> result = CollUtil.newArrayList(); | |
279 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
280 | + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode); | |
281 | + List<Location> locationList = locationService.list(locationLambdaQueryWrapper); | |
282 | + Map<Integer, List<Location>> locationMap = locationList.stream().collect(Collectors.groupingBy(Location::getRoadWay)); | |
283 | + for (Map.Entry<Integer, List<Location>> entry : locationMap.entrySet()) { | |
284 | + HashMap<String, String> resultMap = new HashMap<>(); | |
285 | + Integer roadWay = entry.getKey(); | |
286 | + List<Location> sumLocationList = entry.getValue(); | |
287 | + long sumNum = sumLocationList.size(); | |
288 | + long haveContainerNum = sumLocationList.stream().filter(l -> StringUtils.isNotEmpty(l.getContainerCode())).count(); | |
289 | + long unHaveContainerNum = sumNum - haveContainerNum; | |
290 | + //巷道 | |
291 | + resultMap.put("roadWay", roadWay + "号巷道"); | |
292 | + //库位总数 | |
293 | + resultMap.put("sumNum", String.valueOf(sumNum)); | |
294 | + //有托盘库位 | |
295 | + resultMap.put("haveContainerNum", String.valueOf(haveContainerNum)); | |
296 | + //空闲库位 | |
297 | + resultMap.put("unHaveContainerNum", String.valueOf(unHaveContainerNum)); | |
298 | + float usagerate = (Math.round(haveContainerNum / (float)sumNum * 100)) / 100f; | |
299 | + resultMap.put("usagerate", (int)(usagerate * 100) + "%"); | |
300 | + result.add(resultMap); | |
301 | + } | |
302 | + return Result.OK(result); | |
303 | + } | |
304 | + | |
305 | + /** | |
306 | + * produce 生产情况 | |
307 | + * @param zoneCode 库区编码 | |
308 | + * @return | |
309 | + */ | |
310 | + @GetMapping("produceSituation") | |
311 | + public Result produceSituation(String zoneCode, HttpServletResponse response) { | |
312 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
313 | + ArrayList<Object> result = CollUtil.newArrayList(); | |
314 | + LambdaQueryWrapper<InventoryTransaction> inventoryTransactionLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
315 | + inventoryTransactionLambdaQueryWrapper.eq(InventoryTransaction::getZoneCode, zoneCode); | |
316 | + inventoryTransactionLambdaQueryWrapper.ge(InventoryTransaction::getCreateTime, DateUtil.offsetHour(new Date(), -24)); | |
317 | + inventoryTransactionLambdaQueryWrapper.eq(InventoryTransaction::getType, QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT); | |
318 | + List<InventoryTransaction> inventoryTransactionList = inventoryTransactionService.list(inventoryTransactionLambdaQueryWrapper); | |
319 | + Map<String, List<InventoryTransaction>> map = | |
320 | + inventoryTransactionList.stream().filter(i -> i.getMaterialCode() != null).collect(Collectors.groupingBy(InventoryTransaction::getMaterialCode)); | |
321 | + for (Map.Entry<String, List<InventoryTransaction>> entry : map.entrySet()) { | |
322 | + HashMap<String, String> resultMap = new HashMap<>(); | |
323 | + String materialCode = entry.getKey(); | |
324 | + List<InventoryTransaction> inventoryTransactions = entry.getValue(); | |
325 | + BigDecimal sumCosumeQty = inventoryTransactions.stream().map(InventoryTransaction::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | |
326 | + LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
327 | + shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getMaterialCode, materialCode); | |
328 | + shipmentDetailLambdaQueryWrapper.ge(ShipmentDetail::getCreateTime, DateUtil.offsetHour(new Date(), -24)); | |
329 | + List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(shipmentDetailLambdaQueryWrapper); | |
330 | + BigDecimal sumNeedQty = shipmentDetailList.stream().map(ShipmentDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | |
331 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
332 | + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getMaterialCode, materialCode).eq(InventoryDetail::getZoneCode, zoneCode); | |
333 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
334 | + BigDecimal inventorySumQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | |
335 | + if (sumCosumeQty != null) { | |
336 | + // 交易记录使用数量 | |
337 | + resultMap.put("sumCosumeQty", sumCosumeQty.toString()); | |
338 | + } | |
339 | + if (sumNeedQty != null) { | |
340 | + // 出库单明细数量 | |
341 | + resultMap.put("sumNeedQty", sumNeedQty.toString()); | |
342 | + } | |
343 | + if (inventorySumQty != null) { | |
344 | + // 库存明细数量 | |
345 | + resultMap.put("inventorySumQty", inventorySumQty.toString()); | |
346 | + // 物料名称 | |
347 | + resultMap.put("materialName", inventoryDetailList.get(0).getMaterialName()); | |
348 | + } | |
349 | + resultMap.put("materialCode", materialCode); | |
350 | + result.add(resultMap); | |
351 | + if (result.size() > 30) { | |
352 | + return Result.OK(result); | |
353 | + } | |
354 | + } | |
355 | + return Result.OK(result); | |
356 | + } | |
357 | + | |
113 | 358 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java
... | ... | @@ -103,8 +103,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
103 | 103 | public String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
104 | 104 | String materialCode) { |
105 | 105 | if (roadWays == null || roadWays.size() < 1) { |
106 | - List<Location> locationList = locationService.getLocationListByZoneCode(zoneCode, warehouseCode); | |
107 | - roadWays = locationList.stream().map(Location::getRoadWay).distinct().collect(toList()); | |
106 | + roadWays = locationService.getRoadWayByZoneCode(zoneCode,warehouseCode); | |
108 | 107 | } |
109 | 108 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_RESERVE_LOCATION); |
110 | 109 | int reserveNumber = 4; |
... | ... | @@ -192,8 +191,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
192 | 191 | public String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
193 | 192 | String materialCode) { |
194 | 193 | if (roadWays == null || roadWays.size() < 1) { |
195 | - List<Location> locationList = locationService.getLocationListByZoneCode(zoneCode, warehouseCode); | |
196 | - roadWays = locationList.stream().map(Location::getRoadWay).distinct().collect(toList()); | |
194 | + roadWays = locationService.getRoadWayByZoneCode(zoneCode,warehouseCode); | |
197 | 195 | } |
198 | 196 | List<Integer> removeRoadWays = new ArrayList<>(); |
199 | 197 | // 寻找可用巷道,空闲的空库位低于设定值,那么这个巷道就不能用来分配库位 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -30,6 +30,7 @@ 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.lockStation.service.ILockStationService; | |
33 | 34 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail; |
34 | 35 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
35 | 36 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerDetailService; |
... | ... | @@ -104,6 +105,9 @@ public class WcsServiceImpl implements WcsService { |
104 | 105 | @Resource |
105 | 106 | private IContainerTypeService containerTypeService; |
106 | 107 | |
108 | + @Resource | |
109 | + private ILockStationService lockStationService; | |
110 | + | |
107 | 111 | /** |
108 | 112 | * 库位分配 |
109 | 113 | * @throws SocketException |
... | ... | @@ -197,7 +201,6 @@ public class WcsServiceImpl implements WcsService { |
197 | 201 | } |
198 | 202 | } |
199 | 203 | } |
200 | - | |
201 | 204 | locationCode = locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, |
202 | 205 | materialAreaCode, materialCode); |
203 | 206 | if (StringUtils.isEmpty(locationCode)) { |
... | ... | @@ -236,7 +239,6 @@ public class WcsServiceImpl implements WcsService { |
236 | 239 | } |
237 | 240 | } |
238 | 241 | } |
239 | - | |
240 | 242 | // 修改任务明细目标库位 |
241 | 243 | Location location = locationService.getLocationByCode(locationCode, warehouseCode); |
242 | 244 | int rowFlag = location.getRowFlag().intValue(); |
... | ... | @@ -266,7 +268,11 @@ public class WcsServiceImpl implements WcsService { |
266 | 268 | } |
267 | 269 | } |
268 | 270 | } |
269 | - | |
271 | + if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT) { | |
272 | + if (!lockStationService.unlockStation(taskHeader.getToPortCode(), warehouseCode)) { | |
273 | + throw new JeecgBootException("分配库位,解锁站台失败:" + taskHeader.getToPortCode()); | |
274 | + } | |
275 | + } | |
270 | 276 | taskHeader = new TaskHeader(); |
271 | 277 | taskHeader.setId(Integer.parseInt(taskNo)); |
272 | 278 | taskHeader.setZoneCode(location.getZoneCode()); |
... | ... | @@ -278,7 +284,6 @@ public class WcsServiceImpl implements WcsService { |
278 | 284 | if (!taskHeaderService.updateById(taskHeader)) { |
279 | 285 | throw new JeecgBootException("更新任务头表目标库位失败"); |
280 | 286 | } |
281 | - | |
282 | 287 | WcsTask wcsTask = new WcsTask(); |
283 | 288 | wcsTask.setToLocationCode(locationCode); |
284 | 289 | wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); |
... | ... | @@ -289,7 +294,7 @@ public class WcsServiceImpl implements WcsService { |
289 | 294 | log.info("完成分配库位,任务号:" + taskNo + ", 库位编码:" + locationCode); |
290 | 295 | return Result.OK(wcsTask); |
291 | 296 | } |
292 | - | |
297 | + | |
293 | 298 | @Override |
294 | 299 | @Cacheable(cacheNames = "getAvailableRowdway#10", key = "#root.methodName + '_' + #zoneCode", unless = "#result == null ") |
295 | 300 | public Result<List<Integer>> getAvailableRowdway(String zoneCode) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
... | ... | @@ -27,6 +27,8 @@ public interface ILocationService extends IService<Location> { |
27 | 27 | |
28 | 28 | List<Location> getLocationListByZoneCode(String zoneCode, String warehouseCode); |
29 | 29 | |
30 | + List<Integer> getRoadWayByZoneCode(String zoneCode, String warehouseCode); | |
31 | + | |
30 | 32 | boolean updateStatus(String locationCode, String status, String warehouseCode); |
31 | 33 | |
32 | 34 | boolean updateContainerCodeAndStatus(String locationCode, String containerCode, String status, String warehouseCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -7,6 +7,7 @@ import java.util.stream.Collectors; |
7 | 7 | |
8 | 8 | import javax.annotation.Resource; |
9 | 9 | |
10 | +import cn.hutool.core.collection.CollUtil; | |
10 | 11 | import org.apache.commons.collections4.ListUtils; |
11 | 12 | import org.apache.shiro.util.CollectionUtils; |
12 | 13 | import org.jeecg.common.api.vo.Result; |
... | ... | @@ -113,6 +114,18 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
113 | 114 | } |
114 | 115 | |
115 | 116 | @Override |
117 | + public List<Integer> getRoadWayByZoneCode(String zoneCode, String warehouseCode) { | |
118 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
119 | + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE) | |
120 | + .eq(Location::getWarehouseCode, warehouseCode).select(Location::getRoadWay).groupBy(Location::getRoadWay); | |
121 | + List<Location> locationList = locationService.list(locationLambdaQueryWrapper); | |
122 | + if (CollectionUtils.isEmpty(locationList)) { | |
123 | + return CollUtil.newArrayList(); | |
124 | + } | |
125 | + return locationList.stream().map(Location::getRoadWay).collect(Collectors.toList()); | |
126 | + } | |
127 | + | |
128 | + @Override | |
116 | 129 | @Transactional |
117 | 130 | public boolean updateStatus(String locationCode, String status, String warehouseCode) { |
118 | 131 | LambdaUpdateWrapper<Location> updateWrapper = Wrappers.lambdaUpdate(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -137,6 +137,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
137 | 137 | String toLocationCode = receiptContainerHeader.getToLocationCode(); |
138 | 138 | int taskType = receiptContainerHeader.getTaskType(); |
139 | 139 | String fromPort = receiptContainerHeader.getFromPort(); |
140 | + String toPort = receiptContainerHeader.getToPort(); | |
140 | 141 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
141 | 142 | if (container == null) { |
142 | 143 | return Result.error("托盘:" + containerCode + " 信息为空"); |
... | ... | @@ -183,7 +184,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
183 | 184 | taskHeader.setReceiptContainerHeaderId(receiptContainerHeader.getId()); |
184 | 185 | taskHeader.setWarehouseCode(warehouseCode); |
185 | 186 | taskHeader.setZoneCode(zoneCode); |
186 | - taskHeader.setToPortCode(receiptContainerHeader.getToPort()); | |
187 | + taskHeader.setToPortCode(toPort); | |
187 | 188 | success = taskHeaderService.save(taskHeader); |
188 | 189 | if (!success) { |
189 | 190 | throw new JeecgBootException("创建入库任务, 任务生成失败"); |
... | ... | @@ -263,8 +264,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
263 | 264 | if (StringUtils.isNotEmpty(value)) { |
264 | 265 | int lockStation = Integer.parseInt(value); |
265 | 266 | if (lockStation == QuantityConstant.START_LOCK_STATION) { |
266 | - if (!lockStationService.lockStation(fromPort, warehouseCode)) { | |
267 | - throw new JeecgBootException("生成入库任务时,站台已经锁定:" + fromPort); | |
267 | + if (!lockStationService.lockStation(toPort, warehouseCode)) { | |
268 | + throw new JeecgBootException("生成入库任务时,站台已经锁定:" + toPort); | |
268 | 269 | } |
269 | 270 | } |
270 | 271 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1069,14 +1069,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1069 | 1069 | // if (StringUtils.isEmpty(toPortCode)) { |
1070 | 1070 | // return Result.error("创建空托盘入库时, 站台编码为空"); |
1071 | 1071 | // } |
1072 | -// Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
1073 | -// if (container == null) { | |
1074 | -// return Result.error("托盘:" + containerCode + " 信息为空"); | |
1075 | -// } | |
1076 | -// String zoneCode = container.getZoneCode(); | |
1077 | -// if (StringUtils.isEmpty(zoneCode)) { | |
1078 | -// return Result.error("容器没有配置库区,请配置!"); | |
1079 | -// } | |
1072 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
1073 | + if (container == null) { | |
1074 | + return Result.error("托盘:" + containerCode + " 信息为空"); | |
1075 | + } | |
1076 | + String zoneCode = container.getZoneCode(); | |
1077 | + if (StringUtils.isEmpty(zoneCode)) { | |
1078 | + return Result.error("容器没有配置库区,请配置!"); | |
1079 | + } | |
1080 | 1080 | |
1081 | 1081 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYRECEIPT, containerCode, QuantityConstant.EMPTY_STRING, |
1082 | 1082 | toLocationCode, warehouseCode); |
... | ... | @@ -1090,7 +1090,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1090 | 1090 | taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); |
1091 | 1091 | taskHeader.setToLocationCode(toLocationCode); |
1092 | 1092 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
1093 | -// taskHeader.setZoneCode(zoneCode); | |
1093 | + taskHeader.setZoneCode(zoneCode); | |
1094 | 1094 | boolean success = taskHeaderService.save(taskHeader); |
1095 | 1095 | // String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode); |
1096 | 1096 | // if (StringUtils.isNotEmpty(value)) { |
... | ... |