Browse Source

Merge remote-tracking branch 'origin/dev_ic_v2' into develop

dev_shibei_match
yinzuomei 4 years ago
parent
commit
8710be2f4a
  1. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java
  2. 20
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java
  3. 15
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  4. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  5. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  6. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserFormDTO.java
  7. 16
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java
  8. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  9. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  10. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
  11. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java
  12. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  13. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  14. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java

16
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java

@ -93,4 +93,20 @@ public class CustomerStaffInfoCacheResult implements Serializable {
*/
private List<IdAndNameDTO> deptList;
/**
* 组织级别
*/
private String level;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

20
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java

@ -93,4 +93,24 @@ public class CustomerStaffResultDTO implements Serializable {
*/
private String twoOrgName;
/**
* 社区名称0409
*/
private String community;
/**
* 组织级别
*/
private String level;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

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

@ -142,4 +142,19 @@ public class CustomerAgencyDTO implements Serializable {
* 社区
*/
private String community;
/**
* 坐标
*/
private String coordinates;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -602,6 +602,9 @@ public class EpmetUserServiceImpl implements EpmetUserService {
result.setAgencyId(agencyDTO.getId());
result.setAgencyName(agencyDTO.getOrganizationName());
result.setAgencyPIds(agencyDTO.getPids());
result.setLevel(agencyDTO.getLevel());
result.setLongitude(agencyDTO.getLongitude());
result.setLatitude(agencyDTO.getLatitude());
StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId);
String fromOrgType = OrgTypeEnum.AGENCY.getCode();
if (fromOrgTypeDto != null){

18
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -26,7 +26,23 @@
ca.organization_name,
ca.level,
ca.area_code,
ca.parent_area_code
ca.parent_area_code,
( CASE WHEN ca.longitude is THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.longitude
END
) longitude,
( CASE WHEN ca.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.latitude
END
) latitude
FROM
customer_staff_agency csa
INNER JOIN customer_agency ca ON csa.agency_id = ca.id

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiUserFormDTO.java

@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 根据身份证号找人也可根据epmetUserId查询或者icResiUserId
* 根据身份证号||ic_resi_user.id找居民端小程序里的人
*/
@Data
public class ResiUserFormDTO implements Serializable {
@ -18,11 +18,6 @@ public class ResiUserFormDTO implements Serializable {
*/
private String idNum;
/**
* epemt_user.user.id
*/
private String epmetUserId;
/**
* ic_resi_user.id
*/
@ -30,7 +25,4 @@ public class ResiUserFormDTO implements Serializable {
@NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class)
private String customerId;
//@NotBlank(message = "findType不能为空;根据身份证号:byIdNum;根据ic居民:byIc;根据小程序里的居民:byEpmetUser", groups = AddUserInternalGroup.class)
//private String findType;
}

16
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java

@ -77,4 +77,20 @@ public class StaffBasicInfoResultDTO implements Serializable {
*/
private String agencyName;
/**
* 组织级别
*/
private String level;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -662,11 +662,11 @@ public interface EpmetUserOpenFeignClient {
Result<List<CustomerStaffDTO>> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO);
/**
* 根据身份证号找人也可根据epmetUserId查询或者icResiUserId
* 根据身份证号||ic_resi_user.id找居民端小程序里的人
*
* @param formDTO
* @return
*/
@PostMapping(value = "/epmetuser/user/finduser")
Result<ResiUserResDTO> findUser(@RequestBody ResiUserFormDTO formDTO);
@PostMapping(value = "/epmetuser/user/findepmetuser")
Result<ResiUserResDTO> findEpmetUser(@RequestBody ResiUserFormDTO formDTO);
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -481,13 +481,13 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
}
/**
* 根据身份证号找人
* 根据身份证号||ic_resi_user.id居民端小程序里的
*
* @param formDTO
* @return
*/
@Override
public Result<ResiUserResDTO> findUser(ResiUserFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findUser", formDTO);
public Result<ResiUserResDTO> findEpmetUser(ResiUserFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findEpmetUser", formDTO);
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java

@ -187,15 +187,15 @@ public class UserController {
}
/**
* 根据身份证号找人也可根据epmetUserId查询或者icResiUserId
* 根据身份证号||ic_resi_user.id找居民端小程序里的人
*
*
* @param formDTO
* @return
*/
@PostMapping("finduser")
public Result<ResiUserResDTO> findUser(@RequestBody ResiUserFormDTO formDTO){
@PostMapping("findepmetuser")
public Result<ResiUserResDTO> findEpmetUser(@RequestBody ResiUserFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ResiUserFormDTO.AddUserInternalGroup.class);
return new Result<ResiUserResDTO>().ok(userService.findUser(formDTO));
return new Result<ResiUserResDTO>().ok(userService.findEpmetUser(formDTO));
}
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java

@ -106,11 +106,11 @@ public interface UserService extends BaseService<UserEntity> {
UserDTO queryUserClient(String userId);
/**
* 根据身份证号找人
* 根据身份证号||ic_resi_user.id居民端小程序里的
*
*
* @param formDTO
* @return
*/
ResiUserResDTO findUser(ResiUserFormDTO formDTO);
ResiUserResDTO findEpmetUser(ResiUserFormDTO formDTO);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -717,6 +717,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
if (null != staffInfo){
resultDTO.setAgencyId(staffInfo.getAgencyId());
resultDTO.setAgencyName(staffInfo.getAgencyName());
resultDTO.setLevel(staffInfo.getLevel());
resultDTO.setLongitude(staffInfo.getLongitude());
resultDTO.setLatitude(staffInfo.getLatitude());
}
}
return new Result<StaffBasicInfoResultDTO>().ok(resultDTO);

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -534,8 +534,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//新增以下2个返参
ResiUserFormDTO resiUserFormDTO = new ResiUserFormDTO();
resiUserFormDTO.setIcResiUserId(formDTO.getUserId());
resiUserFormDTO.setIdNum(personData.getIdCard());
resiUserFormDTO.setCustomerId(formDTO.getCustomerId());
ResiUserResDTO resiUserResDTO = userService.findUser(resiUserFormDTO);
//根据身份证号+ic_resi_user.id找epmetUserId
ResiUserResDTO resiUserResDTO = userService.findEpmetUser(resiUserFormDTO);
personData.setEpmetUserId(null != resiUserResDTO ? resiUserResDTO.getEpmetUserId() : StrConstant.EPMETY_STR);
personData.setIcResiUserId(formDTO.getUserId());

31
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java

@ -350,33 +350,32 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
}
/**
* 根据身份证号找人也可根据epmetUserId查询或者icResiUserId
* 根据身份证号||ic_resi_user.id找居民端小程序里的人
*
* @param formDTO
* @return
*/
@Override
public ResiUserResDTO findUser(ResiUserFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getIdNum()) && StringUtils.isBlank(formDTO.getEpmetUserId()) && StringUtils.isBlank(formDTO.getIcResiUserId())) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"身份证号、epmetuserId、icResiUserId至少输入一个","至少选择一种查询方式");
}
ResiUserResDTO resiUserResDTO = ConvertUtils.sourceToTarget(formDTO, ResiUserResDTO.class);
//可以根据身份证号查询,也可以根据ic_resi_user.id查询
if (StringUtils.isBlank(formDTO.getIcResiUserId())) {
IcResiUserDTO icResiUser = icResiUserService.getByIdCard(formDTO.getCustomerId(), formDTO.getIdNum(), formDTO.getIcResiUserId());
resiUserResDTO.setIcResiUserId(null != icResiUser ? icResiUser.getId() : StrConstant.EPMETY_STR);
resiUserResDTO.setIdNum(null != icResiUser ? icResiUser.getIdCard() : StrConstant.EPMETY_STR);
public ResiUserResDTO findEpmetUser(ResiUserFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getIdNum()) && StringUtils.isBlank(formDTO.getIcResiUserId())) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "身份证号、icResiUserId至少输入一个", "至少选择一种查询方式");
}
//可以根据身份证号查询,也可以根据epmet_user.user.id查询
if (StringUtils.isBlank(formDTO.getEpmetUserId())) {
if (StringUtils.isNotBlank(formDTO.getIcResiUserId()) && StringUtils.isBlank(formDTO.getIdNum())) {
IcResiUserDTO icResiUserDTO = icResiUserService.getByIdCard(formDTO.getCustomerId(), null, formDTO.getIcResiUserId());
if (null == icResiUserDTO) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据ic_resi_user.id没有找到记录id=" + formDTO.getIcResiUserId(), "至少选择一种查询方式");
}
formDTO.setIdNum(icResiUserDTO.getIdCard());
}
ResiUserResDTO resiUserResDTO = ConvertUtils.sourceToTarget(formDTO, ResiUserResDTO.class);
if (StringUtils.isNotBlank(formDTO.getIdNum())) {
UserBaseInfoDTO userBaseInfoDTO = userBaseInfoService.getUserIdByIdNum(formDTO.getCustomerId(),
formDTO.getIdNum(),
formDTO.getEpmetUserId());
formDTO.getIdNum(), null);
if (null == userBaseInfoDTO || StringUtils.isBlank(userBaseInfoDTO.getUserId())) {
log.info("user_base_info没有找到,去查下user_resi_info表吧");
UserResiInfoDTO userResiInfoDTO = userResiInfoDao.selectByIdNum(formDTO.getCustomerId(),
formDTO.getIdNum(),
formDTO.getEpmetUserId());
formDTO.getIdNum(), null);
resiUserResDTO.setEpmetUserId(null != userResiInfoDTO ? userResiInfoDTO.getId() : StrConstant.EPMETY_STR);
} else {
resiUserResDTO.setEpmetUserId(userBaseInfoDTO.getUserId());

Loading…
Cancel
Save