소스 검색

储运中心重量改为公式计算

lingpeng.li 2 일 전
부모
커밋
69c03d79cb

+ 9 - 14
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/controller/StorageBillPrintController.java

@@ -487,21 +487,16 @@ public class StorageBillPrintController extends JeecgController<StorageBillPrint
                         .orElseGet(() -> sysDictService.queryDictTextByKey("billet_spec", "5"));
                 exportRow.setBrand(brandNum);
 
-                // 查询定尺规则
-                LambdaQueryWrapper<BilletRulerConfig> queryWrapperbilletRulerConfig = new LambdaQueryWrapper<BilletRulerConfig>().eq(BilletRulerConfig::getLength, Integer.valueOf(safeToInteger(x.getSize())));
-                BilletRulerConfig billetRulerConfig = billetRulerConfigMapper.selectOne(queryWrapperbilletRulerConfig);
-                Double weight = 0.0;
-                if (oConvertUtils.isEmpty(billetRulerConfig)) {
-                    exportRow.setWeightPerPiece(new BigDecimal(0.0));
-                } else {
-                    weight = billetRulerConfig.getWeight();
-                    exportRow.setWeightPerPiece(BigDecimal.valueOf(weight));
-                    Integer amount = x.getAmountTotal();
-                    BigDecimal totalWeight = (amount == null) ? BigDecimal.ZERO :
-                            BigDecimal.valueOf(weight).multiply(BigDecimal.valueOf(amount));
-                    exportRow.setTotalWeight(totalWeight);
-                }
+                BigDecimal singleWeight = new BigDecimal(x.getSize())
+                        .divide(new BigDecimal("1000"), 3, RoundingMode.HALF_UP)
+                        .multiply(meterWeightFactor)
+                        .setScale(3, RoundingMode.HALF_UP);
+
+                exportRow.setWeightPerPiece(singleWeight);
 
+                BigDecimal weight = singleWeight.multiply(BigDecimal.valueOf(x.getAmountTotal()));
+
+                exportRow.setTotalWeight(weight);
 
                 String btype = Optional.ofNullable(x.getBtype()).orElse("");
                 exportRow.setBtype("0".equals(btype) ? "热坯" : "凉坯");