Commit eee16a89afd6268e3697e9e5af3a2bdbde504d88

Authored by 易文鹏
1 parent d4773982

ReceiptNote不为空,就替换qty

src/main/java/com/huaheng/api/general/service/BarCodeApiService.java
... ... @@ -91,7 +91,6 @@ public class BarCodeApiService {
91 91 }
92 92 barCodeHeader.setCreatedBy(QuantityConstant.PLATFORM_MES);
93 93 barCodeHeader.setBarCodeHeaderCode(header.getCode());
94   - barCodeHeader.setReceiptNote(header.getReceiptNote());
95 94 barCodeHeader.setEchelon(header.getEchelon());
96 95 //barCodeHeader.setTotalQty(BigDecimal.ZERO);
97 96 //barCodeHeader.setTotalLines(0);
... ... @@ -120,9 +119,19 @@ public class BarCodeApiService {
120 119 BigDecimal qty = detail.getQty();
121 120 BigDecimal weight = detail.getWeight();
122 121  
123   - if (detail.getCode()==null || "".equals(detail.getCode())) { //没有子条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量
  122 + //没有子条码,属于拆解中的散装,只有重量没有数量,重量赋值给数量
  123 + if (detail.getCode()==null || "".equals(detail.getCode())) {
124 124 qty=weight;
125 125 }
  126 + try {
  127 + //ReceiptNote不为空,就把值给数量
  128 + if (header.getReceiptNote().trim().length()>0 || header.getReceiptNote()==null) {
  129 + qty=new BigDecimal(header.getReceiptNote());
  130 + }
  131 + }catch (Exception e) {
  132 + throw new ServiceException("ReceiptNote字段非法异常:"+header.getReceiptNote());
  133 + }
  134 +
126 135 totalQty=totalQty.add(qty);
127 136 //totalWeight=totalWeight.add(weight);
128 137 Material material = materialService.getOne(new LambdaQueryWrapper<Material>().eq(Material::getCode,materialCode));
... ...