Commit 8d813deb authored by chenzhao's avatar chenzhao

存量合同新增

parent ffca4df9
......@@ -1315,21 +1315,17 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
//更新施工信息
PowerStationConstructionData powerStationConstructionData = surveyInfoAllDto.getPowerStationConstructionData();
powerStationConstructionData.setWorkOrderPowerStationId(peasantHousehold.getSequenceNbr());
// 避免生成多份数据
powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData, new LambdaQueryWrapper<PowerStationConstructionData>()
.eq(PowerStationConstructionData::getWorkOrderPowerStationId, peasantHousehold.getSequenceNbr()));
LambdaUpdateWrapper<PowerStationConstructionData> powerStationConstructionDataWrapper1 = new LambdaUpdateWrapper<>();
powerStationConstructionDataWrapper1.eq(PowerStationConstructionData::getWorkOrderPowerStationId, peasantHousehold.getSequenceNbr());
PowerStationConstructionData data = powerStationConstructionDataService.getBaseMapper().selectOne(powerStationConstructionDataWrapper1);
if(Objects.isNull(data)){
powerStationConstructionData.setWorkOrderPowerStationId(peasantHousehold.getSequenceNbr());
powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData);
}
//更新工程
PowerStationEngineeringInfo powerStationEngineeringInfo = surveyInfoAllDto.getPowerStationEngineeringInfo();
if(Objects.nonNull(powerStationEngineeringInfo)){
powerStationEngineeringInfo.setWorkOrderPowerStationId(peasantHousehold.getSequenceNbr());
powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo);
powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo, new LambdaQueryWrapper<PowerStationEngineeringInfo>()
.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId, peasantHousehold.getSequenceNbr()));
//更新施工组件信息
LambdaUpdateWrapper<PowerStationConstructionData> powerStationConstructionDataWrapper = new LambdaUpdateWrapper<>();
powerStationConstructionDataWrapper.set(PowerStationConstructionData::getConstructionComponentInfo, JSONArray.toJSONString(powerStationEngineeringInfo.getConstructionComponentInfo()));
......@@ -1345,6 +1341,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
HygfOnGrid hygfOnGrid = surveyInfoAllDto.getHygfOnGrid();
if(Objects.nonNull(hygfOnGrid)){
hygfOnGrid.setPeasantHouseholdId( peasantHousehold.getSequenceNbr());
// 避免生成多份数据
hygfOnGridService.saveOrUpdate(hygfOnGrid, new LambdaQueryWrapper<HygfOnGrid>()
.eq(HygfOnGrid::getPeasantHouseholdId, peasantHousehold.getSequenceNbr()));
hygfOnGridService.saveOrUpdate(hygfOnGrid);
}
//更新设计信息
......@@ -1354,7 +1353,10 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
DesignInformation designInformation = BeanDtoUtils.convert(designInformationDto,
DesignInformation.class);
designInformation.setPeasantHouseholdId(String.valueOf(peasantHousehold.getSequenceNbr()));
designInformationService.saveOrUpdate(designInformation);
designInformationService.saveOrUpdate(designInformation, new LambdaQueryWrapper<DesignInformation>()
.eq(DesignInformation::getPeasantHouseholdId, peasantHousehold.getSequenceNbr()));
}
}
......
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