Browse Source

储运中心导出牌号直接从钢坯基础信息获取

lingpeng.li 3 weeks ago
parent
commit
6ccf2735be

+ 3 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/vo/StorageCenterHeatNoInvoicingVO.java

@@ -169,6 +169,9 @@ public class StorageCenterHeatNoInvoicingVO {
         @ApiModelProperty(value = "修改日期")
         private Date updateTime;
 
+        @ApiModelProperty(value = "牌号")
+        private String brandNum;
+
     }
 
 

+ 5 - 56
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/carUnit/service/impl/CarUnitServiceImpl.java

@@ -113,34 +113,6 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                             .map(list -> list.get(0).getHeatNo())
                             .orElse("");
 
-                    String shift = Optional.ofNullable(vo.getHeatNoDetails())
-                            .filter(list -> !list.isEmpty())
-                            .map(list -> list.get(0).getShift())
-                            .orElse("");
-
-                    String shiftGroup = Optional.ofNullable(vo.getHeatNoDetails())
-                            .filter(list -> !list.isEmpty())
-                            .map(list -> list.get(0).getShiftGroup())
-                            .orElse("");
-
-                    if (StringUtils.isNotBlank(shift) && StringUtils.isNotBlank(shiftGroup)) {
-                        LambdaQueryWrapper<ShiftConfiguration> shiftConfigurationWrapper = new LambdaQueryWrapper<>();
-                        shiftConfigurationWrapper.eq(ShiftConfiguration::getDate, row.getFactoryDate())
-                                .eq(ShiftConfiguration::getShift, shift)
-                                .eq(ShiftConfiguration::getShiftGroup, shiftGroup)
-                                .last("limit 1");
-
-                        ShiftConfiguration shiftConfiguration = shiftConfigurationMapper.selectOne(shiftConfigurationWrapper);
-
-                        if (shiftConfiguration != null) {
-                            row.setBrand(sysDictService.queryDictTextByKey("billet_spec", shiftConfiguration.getSteelGrade()));
-                        } else {
-                            log.warn("未找到班次配置:日期={},shift={},shiftGroup={}", row.getFactoryDate(), shift, shiftGroup);
-                        }
-                    } else {
-                        log.warn("shift 或 shiftGroup 为空,跳过 ShiftConfiguration 查询,heatNo={}", vo.getHeatNoDetails().get(0).getHeatNo());
-                    }
-
                     row.setHeatNo(heatNo);
                     rows.add(row);
                 }
@@ -180,34 +152,6 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                             .map(list -> list.get(0).getHeatNo())
                             .orElse("");
 
-                    String shift = Optional.ofNullable(vo.getHeatNoDetails())
-                            .filter(list -> !list.isEmpty())
-                            .map(list -> list.get(0).getShift())
-                            .orElse("");
-
-                    String shiftGroup = Optional.ofNullable(vo.getHeatNoDetails())
-                            .filter(list -> !list.isEmpty())
-                            .map(list -> list.get(0).getShiftGroup())
-                            .orElse("");
-
-                    if (StringUtils.isNotBlank(shift) && StringUtils.isNotBlank(shiftGroup)) {
-                        LambdaQueryWrapper<ShiftConfiguration> shiftConfigurationWrapper = new LambdaQueryWrapper<>();
-                        shiftConfigurationWrapper.eq(ShiftConfiguration::getDate, row.getFactoryDate())
-                                .eq(ShiftConfiguration::getShift, shift)
-                                .eq(ShiftConfiguration::getShiftGroup, shiftGroup)
-                                .last("limit 1");
-
-                        ShiftConfiguration shiftConfiguration = shiftConfigurationMapper.selectOne(shiftConfigurationWrapper);
-
-                        if (shiftConfiguration != null) {
-                            row.setBrand(sysDictService.queryDictTextByKey("billet_spec", shiftConfiguration.getSteelGrade()));
-                        } else {
-                            log.warn("未找到班次配置:日期={},shift={},shiftGroup={}", row.getFactoryDate(), shift, shiftGroup);
-                        }
-                    } else {
-                        log.warn("shift 或 shiftGroup 为空,跳过 ShiftConfiguration 查询,heatNo={}", vo.getHeatNoDetails().get(0).getHeatNo());
-                    }
-
                     row.setHeatNo(heatNo);
                     rows.add(row);
                 }
@@ -274,6 +218,7 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                 totalWeight = totalWeight.add(weight);
 
                 String spec = Optional.ofNullable(billets.get(0).getSpec()).orElse("Unknown");
+                String brandNum = Optional.ofNullable(billets.get(0).getBrandNum()).orElse("HRB400E");
                 Date latestUpdateTime = billets.stream()
                         .map(BilletBasicInfo::getUpdateTime)
                         .filter(Objects::nonNull)
@@ -293,6 +238,7 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                 rollSendDetail.setWeight(weight);
                 rollSendDetail.setAmount(amount);
                 rollSendDetail.setSpec(spec);
+                rollSendDetail.setBrandNum(brandNum);
                 rollSendDetail.setUpdateTime(latestUpdateTime);
 
                 rollSendDetailList.add(rollSendDetail);
@@ -350,6 +296,7 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                 totalWeight = totalWeight.add(weight);
 
                 String spec = Optional.ofNullable(billets.get(0).getSpec()).orElse("Unknown");
+                String brandNum = Optional.ofNullable(billets.get(0).getBrandNum()).orElse("HRB400E");
                 Date latestUpdateTime = billets.stream()
                         .map(BilletBasicInfo::getUpdateTime)
                         .filter(Objects::nonNull)
@@ -369,6 +316,7 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
                 rollSendDetail.setWeight(weight);
                 rollSendDetail.setAmount(amount);
                 rollSendDetail.setSpec(spec);
+                rollSendDetail.setBrandNum(brandNum);
                 rollSendDetail.setUpdateTime(latestUpdateTime);
 
                 rollSendDetailList.add(rollSendDetail);
@@ -864,6 +812,7 @@ public class CarUnitServiceImpl extends ServiceImpl<CarUnitMapper, CarUnit> impl
         row.setAmount(detail.getAmount());
         row.setTotalWeight(detail.getWeight());
         row.setCcmNo(ccmNo);
+        row.setBrand(detail.getBrandNum());
         row.setWeightPerPiece(calcWeightPerPiece(detail.getWeight(), detail.getAmount()));
         BigDecimal result = BigDecimal.valueOf(detail.getSize()).divide(BigDecimal.valueOf(1000));
         if (result != null) {