Commit 5145b9c821d0a3a0ed32cc7dd6983c649664fd88

Authored by 周鸿
1 parent 36739b9b

格林美成品入库回传重量字段-1时,单据数量按照重量计算,回传也是;

src/main/java/com/huaheng/api/general/service/BarCodeApiService.java
@@ -118,15 +118,15 @@ public class BarCodeApiService { @@ -118,15 +118,15 @@ public class BarCodeApiService {
118 String materialCode = detail.getMaterialCode(); 118 String materialCode = detail.getMaterialCode();
119 BigDecimal qty = detail.getQty(); 119 BigDecimal qty = detail.getQty();
120 BigDecimal weight = detail.getWeight(); 120 BigDecimal weight = detail.getWeight();
  121 +
121 //平均重量 122 //平均重量
122 BigDecimal AverageWeight=weight.divide(new BigDecimal(totalLines),3,BigDecimal.ROUND_HALF_UP); 123 BigDecimal AverageWeight=weight.divide(new BigDecimal(totalLines),3,BigDecimal.ROUND_HALF_UP);
123 -  
124 //没有子条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量 124 //没有子条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量
125 //if (detail.getCode()==null || "".equals(detail.getCode())) { 125 //if (detail.getCode()==null || "".equals(detail.getCode())) {
126 // qty=weight; 126 // qty=weight;
127 //} 127 //}
128 128
129 - totalQty=totalQty.add(qty); 129 +
130 //totalWeight=totalWeight.add(weight); 130 //totalWeight=totalWeight.add(weight);
131 Material material = materialService.getOne(new LambdaQueryWrapper<Material>().eq(Material::getCode,materialCode)); 131 Material material = materialService.getOne(new LambdaQueryWrapper<Material>().eq(Material::getCode,materialCode));
132 barCodeDetail.setMaterialCode(material.getCode()); 132 barCodeDetail.setMaterialCode(material.getCode());
@@ -134,6 +134,11 @@ public class BarCodeApiService { @@ -134,6 +134,11 @@ public class BarCodeApiService {
134 barCodeDetail.setMaterialSpec(material.getSpec()); 134 barCodeDetail.setMaterialSpec(material.getSpec());
135 barCodeDetail.setMaterialUnit(material.getUnit()); 135 barCodeDetail.setMaterialUnit(material.getUnit());
136 barCodeDetail.setTotalQty(qty); 136 barCodeDetail.setTotalQty(qty);
  137 + if(barCodeHeader.getReceiptNote()==-1){
  138 + barCodeDetail.setTotalQty(AverageWeight);
  139 + }
  140 + totalQty=totalQty.add(barCodeDetail.getTotalQty());
  141 +
137 barCodeDetail.setSn(detail.getSn()); 142 barCodeDetail.setSn(detail.getSn());
138 barCodeDetail.setWeight(AverageWeight); 143 barCodeDetail.setWeight(AverageWeight);
139 if(barCodeDetail.getCode().length() == 17 || barCodeDetail.getCode().length() == 19){ 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,10 +242,10 @@ public class ReceiptTaskService {
242 taskDetail.setMaterialNetWeight(item.getMaterialNetWeight()); 242 taskDetail.setMaterialNetWeight(item.getMaterialNetWeight());
243 taskDetail.setMaterialTareWeight(item.getMaterialTareWeight()); 243 taskDetail.setMaterialTareWeight(item.getMaterialTareWeight());
244 taskDetail.setMaterialBatch(item.getMaterialBatch()); 244 taskDetail.setMaterialBatch(item.getMaterialBatch());
245 - if(task.getToLocation() != null) { 245 + if(StringUtils.isNotEmpty(task.getToLocation() )) {
246 taskDetail.setToLocation(task.getToLocation()); 246 taskDetail.setToLocation(task.getToLocation());
247 } 247 }
248 - if(item.getSn() != null){ 248 + if(StringUtils.isNotEmpty(item.getSn() )){
249 taskDetail.setSn(item.getSn()); 249 taskDetail.setSn(item.getSn());
250 } 250 }
251 taskDetail.setBatch(item.getBatch()); 251 taskDetail.setBatch(item.getBatch());
@@ -266,17 +266,17 @@ public class ReceiptTaskService { @@ -266,17 +266,17 @@ public class ReceiptTaskService {
266 }else{ 266 }else{
267 taskDetail.setDischargeReview(1); 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 item.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); 270 item.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK);
277 if (!receiptContainerDetailService.updateById(item)) { 271 if (!receiptContainerDetailService.updateById(item)) {
278 throw new ServiceException("更新入库组盘明细状态出错"); 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 ReceiptDetail receiptDetail = receiptDetailService.getById(item.getReceiptDetailId()); 282 ReceiptDetail receiptDetail = receiptDetailService.getById(item.getReceiptDetailId());