Commit bc49cc1f authored by chenzhao's avatar chenzhao

修改资料下载 发货单

parent 39b72109
......@@ -691,8 +691,8 @@ public class CommonServiceImpl {
fillSheet(secondSheet6, returnDto.getPowerStationEngineeringInfo());
Sheet secondSheet7 = workbook.getSheetAt(7);
fillSheet(secondSheet7, preparationMoneyDto);
fillSheetFH(secondSheet7, preparationMoneyDto);
// fillSheet(secondSheet7, preparationMoneyDto);
fillSheetFH(secondSheet7, preparationMoneyDto == null?new PreparationMoney():preparationMoneyDto);
Sheet secondSheet8 = workbook.getSheetAt(8);
fillSheet(secondSheet8, returnDto.getPowerStationConstructionData());
......@@ -998,60 +998,79 @@ public class CommonServiceImpl {
private void fillSheetFH(Sheet sheet, PreparationMoney preparationMoney){
if (Objects.isNull(preparationMoney)){
return;
if (Objects.isNull(preparationMoney)){
return;
}
int startRow = 1;
for (int i = 0; i < sheet.getLastRowNum() + 1; i++) {
Row row = sheet.getRow(i);
if (row != null && i >= startRow) {
for (Cell cell : row) {
if (cell.getCellType() == CellType.STRING) {
String cellValue = cell.getStringCellValue();
String fieldName = removePlaceholders(cellValue);
setCellValue(cell, fieldName, preparationMoney);
}
}
}
}
LambdaQueryWrapper<DocumentStation> q = new LambdaQueryWrapper<>();
q.eq(DocumentStation::getPreparationMoneyId, preparationMoney.getSequenceNbr());
List<DocumentStation> lih = documentStationMapper.selectList(q);
DesignInformation designInformation = new DesignInformation();
if (CollectionUtil.isNotEmpty(lih)){
if(lih != null && lih.size() > 0) {
lih.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
e.setRealScale(powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNo()));
}
});
if(lih != null && lih.size() > 0) {
lih.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
e.setRealScale(powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNo()));
}
});
}
}
List<Long> ids = new ArrayList<>();
for (DocumentStation documentStation : lih) {
ids.add(documentStation.getStationId());
}
//获取所有电站Bom,分组合并,暂时不相加
List<Long> ids = new ArrayList<>();
for (DocumentStation documentStation : lih) {
ids.add(documentStation.getStationId());
}
//获取所有电站Bom,分组合并,暂时不相加
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.in("peasant_household_id", ids);
List<DesignInformation> li = designInformationMapper.selectList(designInformationQueryWrapper);
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.in("peasant_household_id", ids);
List<DesignInformation> li = designInformationMapper.selectList(designInformationQueryWrapper);
DesignInformation designInformation = new DesignInformation();
//组件
List<Object> assembly = new ArrayList<>();
//逆变器
List<Object> inverter = new ArrayList<>();
//电表箱
List<Object> electricityMeter = new ArrayList<>();
//电缆
List<Object> cable = new ArrayList<>();
for (DesignInformation des : li) {
if (des.getAssembly() != null && !des.getAssembly().isEmpty()) {
assembly.addAll(des.getAssembly());
}
if (des.getInverter() != null && !des.getInverter().isEmpty()) {
inverter.addAll(des.getInverter());
}
if (des.getElectricityMeter() != null && !des.getElectricityMeter().isEmpty()) {
electricityMeter.addAll(des.getElectricityMeter());
}
if (des.getCable() != null && !des.getCable().isEmpty()) {
cable.addAll(des.getCable());
//组件
List<Object> assembly = new ArrayList<>();
//逆变器
List<Object> inverter = new ArrayList<>();
//电表箱
List<Object> electricityMeter = new ArrayList<>();
//电缆
List<Object> cable = new ArrayList<>();
for (DesignInformation des : li) {
if (des.getAssembly() != null && !des.getAssembly().isEmpty()) {
assembly.addAll(des.getAssembly());
}
if (des.getInverter() != null && !des.getInverter().isEmpty()) {
inverter.addAll(des.getInverter());
}
if (des.getElectricityMeter() != null && !des.getElectricityMeter().isEmpty()) {
electricityMeter.addAll(des.getElectricityMeter());
}
if (des.getCable() != null && !des.getCable().isEmpty()) {
cable.addAll(des.getCable());
}
}
designInformation.setAssembly(assembly);
designInformation.setInverter(inverter);
designInformation.setElectricityMeter(electricityMeter);
designInformation.setCable(cable);
}
designInformation.setAssembly(assembly);
designInformation.setInverter(inverter);
designInformation.setElectricityMeter(electricityMeter);
designInformation.setCable(cable);
;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment