Commit 89b6bfe34b3aa9d4d0a9769f29d9220aef428c8e

Authored by 肖超群
1 parent 70332032

1. 选择的时候 不能合计

2. 入库时,可收数量由后台计算
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
@@ -402,7 +402,8 @@ export default { @@ -402,7 +402,8 @@ export default {
402 { 402 {
403 title:'序列号', 403 title:'序列号',
404 align:"center", 404 align:"center",
405 - dataIndex: 'sn' 405 + dataIndex: 'sn',
  406 + ellipsis: true,
406 }, 407 },
407 { 408 {
408 title: '入库日期', 409 title: '入库日期',
@@ -693,6 +694,7 @@ export default { @@ -693,6 +694,7 @@ export default {
693 if (selectedRowKeys != null && selectedRowKeys.length > 0) { 694 if (selectedRowKeys != null && selectedRowKeys.length > 0) {
694 this.selectedMainId = selectedRowKeys[0].toString(); 695 this.selectedMainId = selectedRowKeys[0].toString();
695 } 696 }
  697 + selectedRowKeys = selectedRowKeys.filter((item) => item !== '合计');
696 this.selectedRowKeys = selectedRowKeys; 698 this.selectedRowKeys = selectedRowKeys;
697 this.selectRecord = selectionRows; 699 this.selectRecord = selectionRows;
698 }, 700 },
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/SelfCheck.java
@@ -72,7 +72,8 @@ public class SelfCheck implements Job { @@ -72,7 +72,8 @@ public class SelfCheck implements Job {
72 LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); 72 LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
73 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); 73 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
74 // 锁定的容器查看是否有任务 74 // 锁定的容器查看是否有任务
75 - containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_LOCK); 75 + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_LOCK).ne(Container::getContainerTypeCode,
  76 + QuantityConstant.CONTAINER_TYPE_LS);
76 containerList = containerService.list(containerLambdaQueryWrapper); 77 containerList = containerService.list(containerLambdaQueryWrapper);
77 if (!CollectionUtils.isEmpty(containerList)) { 78 if (!CollectionUtils.isEmpty(containerList)) {
78 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList()); 79 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList());
@@ -112,7 +113,8 @@ public class SelfCheck implements Job { @@ -112,7 +113,8 @@ public class SelfCheck implements Job {
112 // } 113 // }
113 // 有货或满盘的容器 查看是否有库存 114 // 有货或满盘的容器 查看是否有库存
114 containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 115 containerLambdaQueryWrapper = Wrappers.lambdaQuery();
115 - containerLambdaQueryWrapper.in(Container::getFillStatus, QuantityConstant.STATUS_CONTAINER_FILL_SOME, QuantityConstant.STATUS_CONTAINER_FILL_FULL); 116 + containerLambdaQueryWrapper.ne(Container::getContainerTypeCode, QuantityConstant.CONTAINER_TYPE_LS).in(Container::getFillStatus,
  117 + QuantityConstant.STATUS_CONTAINER_FILL_SOME, QuantityConstant.STATUS_CONTAINER_FILL_FULL);
116 containerList = containerService.list(containerLambdaQueryWrapper); 118 containerList = containerService.list(containerLambdaQueryWrapper);
117 if (!CollectionUtils.isEmpty(containerList)) { 119 if (!CollectionUtils.isEmpty(containerList)) {
118 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList()); 120 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList());
@@ -133,7 +135,8 @@ public class SelfCheck implements Job { @@ -133,7 +135,8 @@ public class SelfCheck implements Job {
133 } 135 }
134 // 空盘容器 是否有库存 136 // 空盘容器 是否有库存
135 containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 137 containerLambdaQueryWrapper = Wrappers.lambdaQuery();
136 - containerLambdaQueryWrapper.in(Container::getFillStatus, QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_MANY); 138 + containerLambdaQueryWrapper.ne(Container::getContainerTypeCode, QuantityConstant.CONTAINER_TYPE_LS).in(Container::getFillStatus,
  139 + QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_MANY);
137 containerList = containerService.list(containerLambdaQueryWrapper); 140 containerList = containerService.list(containerLambdaQueryWrapper);
138 if (!CollectionUtils.isEmpty(containerList)) { 141 if (!CollectionUtils.isEmpty(containerList)) {
139 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList()); 142 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList());
@@ -150,7 +153,8 @@ public class SelfCheck implements Job { @@ -150,7 +153,8 @@ public class SelfCheck implements Job {
150 } 153 }
151 // 容器有库位=对应库位有这个容器 154 // 容器有库位=对应库位有这个容器
152 containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 155 containerLambdaQueryWrapper = Wrappers.lambdaQuery();
153 - containerLambdaQueryWrapper.ne(Container::getLocationCode, QuantityConstant.EMPTY_STRING); 156 + containerLambdaQueryWrapper.ne(Container::getContainerTypeCode, QuantityConstant.CONTAINER_TYPE_LS).ne(Container::getLocationCode,
  157 + QuantityConstant.EMPTY_STRING);
154 containerList = containerService.list(containerLambdaQueryWrapper); 158 containerList = containerService.list(containerLambdaQueryWrapper);
155 if (!CollectionUtils.isEmpty(containerList)) { 159 if (!CollectionUtils.isEmpty(containerList)) {
156 common = new ArrayList<>(); 160 common = new ArrayList<>();
@@ -213,7 +217,8 @@ public class SelfCheck implements Job { @@ -213,7 +217,8 @@ public class SelfCheck implements Job {
213 // } 217 // }
214 // 容器没库位 查看库位是否有容器 218 // 容器没库位 查看库位是否有容器
215 containerLambdaQueryWrapper = Wrappers.lambdaQuery(); 219 containerLambdaQueryWrapper = Wrappers.lambdaQuery();
216 - containerLambdaQueryWrapper.eq(Container::getLocationCode, QuantityConstant.EMPTY_STRING); 220 + containerLambdaQueryWrapper.ne(Container::getContainerTypeCode, QuantityConstant.CONTAINER_TYPE_LS).eq(Container::getLocationCode,
  221 + QuantityConstant.EMPTY_STRING);
217 containerList = containerService.list(containerLambdaQueryWrapper); 222 containerList = containerService.list(containerLambdaQueryWrapper);
218 if (!CollectionUtils.isEmpty(containerList)) { 223 if (!CollectionUtils.isEmpty(containerList)) {
219 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList()); 224 container = containerList.stream().map(i -> i.getCode()).collect(Collectors.toList());
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
@@ -224,8 +224,12 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -224,8 +224,12 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
224 List<ReceiptDetail> receiptDetailList = new ArrayList<>(); 224 List<ReceiptDetail> receiptDetailList = new ArrayList<>();
225 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); 225 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>();
226 for (Receive receive : receiveList) { 226 for (Receive receive : receiveList) {
  227 + ReceiptDetail receiptDetail = receiptDetailService.getById(receive.getId());
  228 + if (receiptDetail == null) {
  229 + throw new JeecgBootException("入库组盘,没有找到入库单详情ID:" + receive.getId());
  230 + }
227 // 可收数量 231 // 可收数量
228 - BigDecimal qty = receive.getQty(); 232 + BigDecimal qty = receiptDetail.getQty().subtract(receiptDetail.getTaskQty());
229 // 收货数量 233 // 收货数量
230 BigDecimal taskQty = receive.getTaskQty(); 234 BigDecimal taskQty = receive.getTaskQty();
231 if (qty == null || taskQty == null) { 235 if (qty == null || taskQty == null) {
@@ -241,10 +245,6 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -241,10 +245,6 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
241 if (taskQty.compareTo(BigDecimal.ZERO) <= 0) { 245 if (taskQty.compareTo(BigDecimal.ZERO) <= 0) {
242 continue; 246 continue;
243 } 247 }
244 - ReceiptDetail receiptDetail = receiptDetailService.getById(receive.getId());  
245 - if (receiptDetail == null) {  
246 - throw new JeecgBootException("入库组盘,没有找到入库单详情ID:" + receive.getId());  
247 - }  
248 ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); 248 ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId());
249 if (receiptHeader == null) { 249 if (receiptHeader == null) {
250 throw new JeecgBootException("入库组盘,没有找到入库单ID:" + receiptDetail.getReceiptId()); 250 throw new JeecgBootException("入库组盘,没有找到入库单ID:" + receiptDetail.getReceiptId());
@@ -281,6 +281,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -281,6 +281,7 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
281 LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); 281 LambdaQueryWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
282 receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptId, receiptDetail.getReceiptId()) 282 receiptContainerDetailLambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptId, receiptDetail.getReceiptId())
283 .eq(ReceiptContainerDetail::getReceiptDetailId, receiptDetail.getId()) 283 .eq(ReceiptContainerDetail::getReceiptDetailId, receiptDetail.getId())
  284 + .eq(StringUtils.isNotEmpty(receive.getSn()), ReceiptContainerDetail::getSn, receive.getSn())
284 .eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId()); 285 .eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId());
285 ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getOne(receiptContainerDetailLambdaQueryWrapper); 286 ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getOne(receiptContainerDetailLambdaQueryWrapper);
286 if (receiptContainerDetail != null) { 287 if (receiptContainerDetail != null) {
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/impl/ShipmentContainerAdviceServiceImpl.java
@@ -280,10 +280,14 @@ public class ShipmentContainerAdviceServiceImpl extends ServiceImpl&lt;ShipmentCont @@ -280,10 +280,14 @@ public class ShipmentContainerAdviceServiceImpl extends ServiceImpl&lt;ShipmentCont
280 throw new JeecgBootException("预配盘扣减库存失败, 没有找到" + containerCode + "库存表头"); 280 throw new JeecgBootException("预配盘扣减库存失败, 没有找到" + containerCode + "库存表头");
281 } 281 }
282 List<InventoryDetail> inventoryDetailList1 = inventoryDetailService.getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId()); 282 List<InventoryDetail> inventoryDetailList1 = inventoryDetailService.getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId());
283 - if (inventoryDetailList1.size() == 0) { 283 + if (CollectionUtils.isEmpty(inventoryDetailList1)) {
284 if (!inventoryHeaderService.removeById(inventoryHeader.getId())) { 284 if (!inventoryHeaderService.removeById(inventoryHeader.getId())) {
285 throw new JeecgBootException("预配盘扣减库存失败,删除库存头失败" + inventoryHeader.getId()); 285 throw new JeecgBootException("预配盘扣减库存失败,删除库存头失败" + inventoryHeader.getId());
286 } 286 }
  287 + } else {
  288 + if (!taskHeaderService.combineInventoryDetail(containerCode, warehouseCode)) {
  289 + throw new JeecgBootException("预配盘扣减库存失败,托盘:" + containerCode + "调整库存失败");
  290 + }
287 } 291 }
288 return Result.OK("预配盘扣减库存成功"); 292 return Result.OK("预配盘扣减库存成功");
289 } 293 }