Commit 5145b9c821d0a3a0ed32cc7dd6983c649664fd88
1 parent
36739b9b
格林美成品入库回传重量字段-1时,单据数量按照重量计算,回传也是;
Showing
2 changed files
with
15 additions
and
10 deletions
src/main/java/com/huaheng/api/general/service/BarCodeApiService.java
... | ... | @@ -118,15 +118,15 @@ public class BarCodeApiService { |
118 | 118 | String materialCode = detail.getMaterialCode(); |
119 | 119 | BigDecimal qty = detail.getQty(); |
120 | 120 | BigDecimal weight = detail.getWeight(); |
121 | + | |
121 | 122 | //平均重量 |
122 | 123 | BigDecimal AverageWeight=weight.divide(new BigDecimal(totalLines),3,BigDecimal.ROUND_HALF_UP); |
123 | - | |
124 | 124 | //没有子条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量 |
125 | 125 | //if (detail.getCode()==null || "".equals(detail.getCode())) { |
126 | 126 | // qty=weight; |
127 | 127 | //} |
128 | 128 | |
129 | - totalQty=totalQty.add(qty); | |
129 | + | |
130 | 130 | //totalWeight=totalWeight.add(weight); |
131 | 131 | Material material = materialService.getOne(new LambdaQueryWrapper<Material>().eq(Material::getCode,materialCode)); |
132 | 132 | barCodeDetail.setMaterialCode(material.getCode()); |
... | ... | @@ -134,6 +134,11 @@ public class BarCodeApiService { |
134 | 134 | barCodeDetail.setMaterialSpec(material.getSpec()); |
135 | 135 | barCodeDetail.setMaterialUnit(material.getUnit()); |
136 | 136 | barCodeDetail.setTotalQty(qty); |
137 | + if(barCodeHeader.getReceiptNote()==-1){ | |
138 | + barCodeDetail.setTotalQty(AverageWeight); | |
139 | + } | |
140 | + totalQty=totalQty.add(barCodeDetail.getTotalQty()); | |
141 | + | |
137 | 142 | barCodeDetail.setSn(detail.getSn()); |
138 | 143 | barCodeDetail.setWeight(AverageWeight); |
139 | 144 | if(barCodeDetail.getCode().length() == 17 || barCodeDetail.getCode().length() == 19){ |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -242,10 +242,10 @@ public class ReceiptTaskService { |
242 | 242 | taskDetail.setMaterialNetWeight(item.getMaterialNetWeight()); |
243 | 243 | taskDetail.setMaterialTareWeight(item.getMaterialTareWeight()); |
244 | 244 | taskDetail.setMaterialBatch(item.getMaterialBatch()); |
245 | - if(task.getToLocation() != null) { | |
245 | + if(StringUtils.isNotEmpty(task.getToLocation() )) { | |
246 | 246 | taskDetail.setToLocation(task.getToLocation()); |
247 | 247 | } |
248 | - if(item.getSn() != null){ | |
248 | + if(StringUtils.isNotEmpty(item.getSn() )){ | |
249 | 249 | taskDetail.setSn(item.getSn()); |
250 | 250 | } |
251 | 251 | taskDetail.setBatch(item.getBatch()); |
... | ... | @@ -266,17 +266,17 @@ public class ReceiptTaskService { |
266 | 266 | }else{ |
267 | 267 | taskDetail.setDischargeReview(1); |
268 | 268 | } |
269 | - | |
270 | - taskDetail.setPoundCode(item.getPoundCode()); | |
271 | - taskDetail.setSupplierCode(item.getSupplierCode()); | |
272 | - if (!taskDetailService.save(taskDetail)) { | |
273 | - throw new ServiceException("生成任务明细失败"); | |
274 | - } | |
275 | 269 | //更新入库组盘明细状态 |
276 | 270 | item.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); |
277 | 271 | if (!receiptContainerDetailService.updateById(item)) { |
278 | 272 | throw new ServiceException("更新入库组盘明细状态出错"); |
279 | 273 | } |
274 | + taskDetail.setPoundCode(item.getPoundCode()); | |
275 | + taskDetail.setSupplierCode(item.getSupplierCode()); | |
276 | + if (!taskDetailService.save(taskDetail)) { | |
277 | + throw new ServiceException("生成任务明细失败"); | |
278 | + } | |
279 | + | |
280 | 280 | |
281 | 281 | /* 修改明细状态为上架*/ |
282 | 282 | ReceiptDetail receiptDetail = receiptDetailService.getById(item.getReceiptDetailId()); |
... | ... |