作者 kgy

项目部署

... ... @@ -1932,13 +1932,11 @@ public class ProjectServiceImpl implements ProjectService {
@Override
public Map<String, Object> no2_1Save(String synthesize_no_2_1_new, Double electricityAh) {
String id = "";
log.warn("建筑信息 集合 -------------------------- --------------------------------{}", synthesize_no_2_1_new.toString());
List<Synthesize_no_2_1New> synthesize_no_2_1s = JSON.parseArray(synthesize_no_2_1_new, Synthesize_no_2_1New.class);
if (org.apache.commons.lang3.StringUtils.isNotEmpty(synthesize_no_2_1s.get(0).getPid()) && !synthesize_no_2_1s.isEmpty()) {
synthesize_no_2_1Service.remove(new QueryWrapper<Synthesize_no_2_1>().lambda().eq(Synthesize_no_2_1::getPid, synthesize_no_2_1s.get(0).getPid()));
calculateLoadService.remove(new QueryWrapper<CalculateLoad>().lambda().eq(CalculateLoad::getCid, synthesize_no_2_1s.get(0).getPid()));
CalculateLoad serviceOne = calculateLoadService.getOne(new LambdaQueryWrapper<CalculateLoad>().eq(CalculateLoad::getCid, synthesize_no_2_1s.get(0).getPid()));
//calculateLoadService.remove(new QueryWrapper<CalculateLoad>().lambda().eq(CalculateLoad::getCid, synthesize_no_2_1s.get(0).getPid()));
//CalculateLoad serviceOne = calculateLoadService.getOne(new LambdaQueryWrapper<CalculateLoad>().eq(CalculateLoad::getCid, synthesize_no_2_1s.get(0).getPid()));
for (Synthesize_no_2_1New synthesize_no_2_1 : synthesize_no_2_1s) {
Synthesize_no_2_1 synthesizeNo21 = new Synthesize_no_2_1();
BeanUtils.copyProperties(synthesize_no_2_1, synthesizeNo21);
... ... @@ -2029,13 +2027,19 @@ public class ProjectServiceImpl implements ProjectService {
}
//CalculateLoad serviceOne = calculateLoadService.getById(synthesizeNo21.getId());
CalculateLoad serviceOne = calculateLoadService.getById(synthesizeNo21.getId());
if (!StringUtils.isEmpty(serviceOne)) {
calculateLoad.setId(serviceOne.getId());
calculateLoad.setNo1(Double.valueOf(df.format(annualTotalElectricityDemand)));
calculateLoad.setNo2(Double.valueOf(df.format(annualTotalHeatRequirement)));
calculateLoad.setNo3(Double.valueOf(df.format(annualTotalCoolingDemand)));
calculateLoad.setNo4(Double.valueOf(df.format(totalAnnualTotalHotWaterRequirement)));
calculateLoad.setAid(synthesizeNo21.getBuildingTypeId());
serviceOne.setNo1(Double.valueOf(df.format(annualTotalElectricityDemand)));
serviceOne.setNo2(Double.valueOf(df.format(annualTotalHeatRequirement)));
serviceOne.setNo3(Double.valueOf(df.format(annualTotalCoolingDemand)));
serviceOne.setNo4(Double.valueOf(df.format(totalAnnualTotalHotWaterRequirement)));
serviceOne.setCid(synthesizeNo21.getPid());
serviceOne.setAid(synthesizeNo21.getBuildingTypeId());
serviceOne.setNo11(serviceOne.getNo11());
serviceOne.setNo22(serviceOne.getNo22());
serviceOne.setNo33(serviceOne.getNo33());
serviceOne.setNo44(serviceOne.getNo44());
calculateLoadService.updateById(serviceOne);
} else {
calculateLoad.setId(synthesizeNo21.getId());
calculateLoad.setNo1(Double.valueOf(df.format(annualTotalElectricityDemand)));
... ... @@ -2048,8 +2052,8 @@ public class ProjectServiceImpl implements ProjectService {
calculateLoad.setNo44(Double.valueOf(df.format(totalAnnualTotalHotWaterRequirement)));
calculateLoad.setCid(synthesizeNo21.getPid());
calculateLoad.setAid(synthesizeNo21.getBuildingTypeId());
calculateLoadService.saveOrUpdate(calculateLoad);
}
calculateLoadService.saveOrUpdate(calculateLoad);
}
}
... ...