Commit 02773d8b authored by 位宇华's avatar 位宇华

范各庄电--代码提交

parent bd8b2da8
...@@ -319,6 +319,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService { ...@@ -319,6 +319,8 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
v.setLevelOneClassification(powerSourceModel.getLevelOneClassification()); v.setLevelOneClassification(powerSourceModel.getLevelOneClassification());
} }
} }
v.setPowerTotal(new BigDecimal(v.getPowerTotal()).toPlainString());
v.setElectricityTotal(new BigDecimal(v.getElectricityTotal()).toPlainString());
}); });
powerDisplayMapper.deleteRepeat(month, minId); powerDisplayMapper.deleteRepeat(month, minId);
powerDisplayMapper.insert(collect); powerDisplayMapper.insert(collect);
...@@ -357,7 +359,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService { ...@@ -357,7 +359,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
} }
})); }));
Map<String, List<SourceIndfoModel>> stringListMap = sourceIndfoModelList.stream().collect(Collectors.groupingBy(SourceIndfoModel::getSourceName)); Map<String, List<SourceIndfoModel>> stringListMap = sourceIndfoModelList.stream().collect(Collectors.groupingBy(SourceIndfoModel::getSourceName));
List<SourceIndfoModel> sourceIndfoModels = new ArrayList<>(); List<SourceIndfoModel> sourceInfoModels = new ArrayList<>();
stringListMap.forEach((k, v) -> { stringListMap.forEach((k, v) -> {
SourceIndfoModel sourceIndfoModel = new SourceIndfoModel(); SourceIndfoModel sourceIndfoModel = new SourceIndfoModel();
List<BigDecimal> capacityList = v.stream().filter(a -> StringUtils.equals("电量总额", a.getKeyName())).map(a -> new BigDecimal(a.getValueName())).collect(Collectors.toList()); List<BigDecimal> capacityList = v.stream().filter(a -> StringUtils.equals("电量总额", a.getKeyName())).map(a -> new BigDecimal(a.getValueName())).collect(Collectors.toList());
...@@ -366,7 +368,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService { ...@@ -366,7 +368,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
BigDecimal feeReduce = feeList.stream().reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal feeReduce = feeList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
sourceIndfoModel.setSourceName(k); sourceIndfoModel.setSourceName(k);
sourceIndfoModel.setUnitPrice(feeReduce.divide(capacityReduce, 2, RoundingMode.HALF_UP)); sourceIndfoModel.setUnitPrice(feeReduce.divide(capacityReduce, 2, RoundingMode.HALF_UP));
sourceIndfoModels.add(sourceIndfoModel); sourceInfoModels.add(sourceIndfoModel);
}); });
List<PowerSourceModel> powerSourceModelList = powerDisplayMapper.selectSource("011701"); List<PowerSourceModel> powerSourceModelList = powerDisplayMapper.selectSource("011701");
displayDtoList.forEach(v -> powerSourceModelList.forEach(s -> { displayDtoList.forEach(v -> powerSourceModelList.forEach(s -> {
...@@ -374,7 +376,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService { ...@@ -374,7 +376,7 @@ public class PowerDisplayServiceImpl implements PowerDisplayService {
v.setLevelOneClassification(s.getLevelOneClassification()); v.setLevelOneClassification(s.getLevelOneClassification());
} }
})); }));
displayDtoList.forEach(v -> sourceIndfoModels.forEach(s -> { displayDtoList.forEach(v -> sourceInfoModels.forEach(s -> {
if (StringUtils.equals(v.getLevelOneClassification(), s.getSourceName())) { if (StringUtils.equals(v.getLevelOneClassification(), s.getSourceName())) {
v.setElectricityTotal(String.valueOf(new BigDecimal(v.getPowerTotal()).multiply(s.getUnitPrice()).setScale(2, RoundingMode.HALF_UP))); v.setElectricityTotal(String.valueOf(new BigDecimal(v.getPowerTotal()).multiply(s.getUnitPrice()).setScale(2, RoundingMode.HALF_UP)));
} }
......
...@@ -30,7 +30,8 @@ public class SalaryPowerUnifyExposeServiceImpl implements SalaryPowerUnifyExpose ...@@ -30,7 +30,8 @@ public class SalaryPowerUnifyExposeServiceImpl implements SalaryPowerUnifyExpose
} }
//电力 //电力
if (StringUtils.equals(CoalConstant.ONE, salaryPowerUnifyExposeRequestModel.getType())) { if (StringUtils.equals(CoalConstant.ONE, salaryPowerUnifyExposeRequestModel.getType())) {
powerDisplayService.peek(salaryPowerUnifyExposeRequestModel.getNewRuleSalaryModelList()); // powerDisplayService.peek(salaryPowerUnifyExposeRequestModel.getNewRuleSalaryModelList());
powerDisplayService.save(salaryPowerUnifyExposeRequestModel.getNewRuleSalaryModelList());
} }
return AjaxResult.success(); return AjaxResult.success();
} }
......
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