|
|
@ -147,6 +147,20 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPoint |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(IcPointNucleicMonitoringDTO dto) { |
|
|
|
// 获取所有地点名称
|
|
|
|
List<String> addressList = baseDao.getAllAddressNameNoCurrent(dto.getId()); |
|
|
|
// 校验数据库是否存在该地点名称
|
|
|
|
if (addressList.contains(dto.getName())){ |
|
|
|
throw new RenException("该监测点名称已存在,请重新输入"); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgName())){ |
|
|
|
// 赋值pid pids
|
|
|
|
OrgInfoPointFormDTO formDTO = ConvertUtils.sourceToTarget(dto, OrgInfoPointFormDTO.class); |
|
|
|
Result<CommunityInfoResultDTO> resultDTOResult = govOrgFeignClient.getCommunityInfo(formDTO); |
|
|
|
CommunityInfoResultDTO communityInfoResultDTO = resultDTOResult.getData(); |
|
|
|
dto.setPid(communityInfoResultDTO.getPid()); |
|
|
|
dto.setPids(communityInfoResultDTO.getPids()); |
|
|
|
} |
|
|
|
IcPointNucleicMonitoringEntity entity = ConvertUtils.sourceToTarget(dto, IcPointNucleicMonitoringEntity.class); |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|