Browse Source

"editagency"修改

dev_shibei_match
yinzuomei 4 years ago
parent
commit
c4f6d4469c
  1. 10
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  2. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java
  4. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java
  5. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java
  6. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  7. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  8. 36
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

10
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -114,17 +114,17 @@ public class CustomerAgencyDTO implements Serializable {
private Integer totalUser;
/**
* 区域编码字典中的省份名称
* 省份名称
*/
private String province;
/**
* 区域编码字典中的城市名称
* 城市名称
*/
private String city;
/**
* 区域编码字典中的区县名称
* 区县名称
*/
private String district;
@ -134,12 +134,12 @@ public class CustomerAgencyDTO implements Serializable {
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区
*/
private String community;
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 区域编码字典中的省份名称
* 省份名称
*/
private String province;
/**
* 区域编码字典中的城市名称
* 城市名称
*/
private String city;
/**
* 区域编码字典中的区县名称
* 区县名称
*/
private String district;
@ -100,12 +100,12 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区
*/
private String community;
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 区域编码字典中的省份名称
* 省份名称
*/
private String province;
/**
* 区域编码字典中的城市名称
* 城市名称
*/
private String city;
/**
* 区域编码字典中的区县名称
* 区县名称
*/
private String district;
@ -100,12 +100,12 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区
*/
private String community;
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java

@ -114,17 +114,17 @@ public class CustomerAgencyDTO implements Serializable {
private Integer totalUser;
/**
* 区域编码字典中的名称
*
*/
private String province;
/**
* 区域编码字典中的名称
*
*/
private String city;
/**
* 域编码字典中的名称
* 区县
*/
private String district;
@ -134,12 +134,12 @@ public class CustomerAgencyDTO implements Serializable {
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区
*/
private String community;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java

@ -75,12 +75,12 @@ public class AddAgencyV2FormDTO implements Serializable {
private String district;
/**
* 区域编码字典中的街道名称来源于/data/aggregator/org/nextlevelareacodelist接口里的areaName
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称来源于/data/aggregator/org/nextlevelareacodelist接口里的areaName
* 社区
*/
private String community;
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java

@ -58,17 +58,17 @@ public class AgencysResultDTO implements Serializable {
private String areaCode = "";
/**
* 区域编码字典中的省份名称
* 省份名称
*/
private String province = "";
/**
* 区域编码字典中的城市名称
* 城市名称
*/
private String city = "";
/**
* 区域编码字典中的区县名称
* 区县名称
*/
private String district = "";
@ -78,12 +78,12 @@ public class AgencysResultDTO implements Serializable {
private List<ParentListResultDTO> parentList;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区
*/
private String community;

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 区域编码字典中的名称
*
*/
private String province;
/**
* 区域编码字典中的城市名称
* 城市名称
*/
private String city;
/**
* 区域编码字典中的区县名称
* 区县名称
*/
private String district;
@ -100,12 +100,12 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
* 街道
*/
private String street;
/**
* 区域编码字典中的社区名称0409
* 社区名称0409
*/
private String community;
}

36
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -133,9 +133,7 @@ public class AgencyServiceImpl implements AgencyService {
@Transactional(rollbackFor = Exception.class)
public Result editAgency(EditAgencyFormDTO formDTO) {
Result result = new Result();
CustomerAgencyEntity entity = new CustomerAgencyEntity();
entity.setId(formDTO.getAgencyId());
entity.setOrganizationName(formDTO.getAgencyName());
CustomerAgencyEntity entity = getUpdateEntity(formDTO);
//1:更新当前组织信息
if (customerAgencyDao.updateById(entity) < NumConstant.ONE) {
log.error(CustomerAgencyConstant.UPDATE_EXCEPTION);
@ -152,7 +150,6 @@ public class AgencyServiceImpl implements AgencyService {
List<CustomerAgencyEntity> editList = new ArrayList<>();
Date date = new Date();
agencyList.forEach(agency->{
CustomerAgencyEntity customerAgencyEntity = new CustomerAgencyEntity();
//3-1:查询当前组织的所有上级组织
List<String> listStr = Arrays.asList(agency.getPids().split(":"));
List<ParentListResultDTO> parentList = customerAgencyDao.selectPAgencyById(listStr);
@ -165,10 +162,20 @@ public class AgencyServiceImpl implements AgencyService {
allParentName.append("-").append(parents.getName());
}
});
customerAgencyEntity.setId(agency.getId());
CustomerAgencyEntity customerAgencyEntity = ConvertUtils.sourceToTarget(agency,CustomerAgencyEntity.class);
customerAgencyEntity.setAllParentName(allParentName.toString());
customerAgencyEntity.setUpdatedBy(formDTO.getUserId());
customerAgencyEntity.setUpdatedTime(date);
if (CustomerAgencyConstant.PROVINCE_LEVEL.equals(entity.getLevel())) {
customerAgencyEntity.setProvince(entity.getOrganizationName());
} else if (CustomerAgencyConstant.CITY_LEVEL.equals(entity.getLevel())) {
customerAgencyEntity.setCity(entity.getOrganizationName());
} else if (CustomerAgencyConstant.DISTRICT.equals(entity.getLevel())) {
customerAgencyEntity.setDistrict(entity.getOrganizationName());
} else if (CustomerAgencyConstant.STREET_LEVEL.equals(entity.getLevel())) {
customerAgencyEntity.setStreet(entity.getOrganizationName());
} else if (CustomerAgencyConstant.COMMUNITY_LEVEL.equals(entity.getLevel())) {
customerAgencyEntity.setCommunity(entity.getOrganizationName());
}
editList.add(customerAgencyEntity);
});
//4:批量更新因一个组织名称变动而引起的其他组织字段值的变动
@ -182,6 +189,23 @@ public class AgencyServiceImpl implements AgencyService {
return result;
}
private CustomerAgencyEntity getUpdateEntity(EditAgencyFormDTO formDTO) {
CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId());
entity.setOrganizationName(formDTO.getAgencyName());
if (CustomerAgencyConstant.PROVINCE_LEVEL.equals(entity.getLevel())) {
entity.setProvince(entity.getOrganizationName());
} else if (CustomerAgencyConstant.CITY_LEVEL.equals(entity.getLevel())) {
entity.setCity(entity.getOrganizationName());
} else if (CustomerAgencyConstant.DISTRICT.equals(entity.getLevel())) {
entity.setDistrict(entity.getOrganizationName());
} else if (CustomerAgencyConstant.STREET_LEVEL.equals(entity.getLevel())) {
entity.setStreet(entity.getOrganizationName());
} else if (CustomerAgencyConstant.COMMUNITY_LEVEL.equals(entity.getLevel())) {
entity.setCommunity(entity.getOrganizationName());
}
return entity;
}
/**
* @param formDTO
* @return

Loading…
Cancel
Save