Commit ebffcb0b8d434096e14eeb9abc757d1c7b24c02f
1 parent
87e0d95d
出入库单导入修改
Showing
2 changed files
with
10 additions
and
0 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
... | ... | @@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
31 | 31 | |
32 | 32 | import cn.monitor4all.logRecord.annotation.OperationLog; |
33 | 33 | import cn.monitor4all.logRecord.context.LogRecordContext; |
34 | +import org.springframework.util.CollectionUtils; | |
34 | 35 | |
35 | 36 | /** |
36 | 37 | * @Description: 入库单详情 |
... | ... | @@ -156,10 +157,16 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
156 | 157 | @Override |
157 | 158 | @Transactional(rollbackFor = Exception.class) |
158 | 159 | public void importFinishedProduct(List<ReceiptDetail> receiptDetailList) { |
160 | + if (CollectionUtils.isEmpty(receiptDetailList)) { | |
161 | + throw new JeecgBootException("导入信息为空"); | |
162 | + } | |
163 | + BigDecimal totalQty = receiptDetailList.stream().map(i -> i.getQty()).reduce(BigDecimal.ZERO, BigDecimal::add); | |
159 | 164 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
160 | 165 | receiptHeader.setType(QuantityConstant.RECEIPT_BILL_TYPE_QTR); |
161 | 166 | receiptHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY); |
162 | 167 | receiptHeader.setWarehouseCode(QuantityConstant.DEFAULT_WAREHOUSE); |
168 | + receiptHeader.setTotallines(receiptDetailList.size()); | |
169 | + receiptHeader.setTotalqty(totalQty); | |
163 | 170 | Result<ReceiptHeader> rs1 = receiptHeaderService.saveReceiptHeader(receiptHeader); |
164 | 171 | if (rs1.isSuccess()) { |
165 | 172 | receiptHeader = rs1.getResult(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
... | ... | @@ -160,6 +160,9 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
160 | 160 | @Override |
161 | 161 | @Transactional(rollbackFor = Exception.class) |
162 | 162 | public void importFinishedProduct(List<ShipmentDetail> shipmentDetailList) { |
163 | + if (CollectionUtils.isEmpty(shipmentDetailList)) { | |
164 | + throw new JeecgBootException("导入信息为空"); | |
165 | + } | |
163 | 166 | List<String> zoneCodeList = shipmentDetailList.stream().map(i -> i.getZoneCode()).distinct().collect(Collectors.toList()); |
164 | 167 | if (CollectionUtils.isEmpty(zoneCodeList)) { |
165 | 168 | throw new JeecgBootException("出库单导入失败,库区没有填写"); |
... | ... |