wxz 2 years ago
parent
commit
7954fa73e8
  1. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java
  2. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java
  3. 37
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
  5. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  7. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  8. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  9. 2
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java

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

@ -22,6 +22,15 @@ public class CustomerStaffInfoCacheResult implements Serializable {
*/ */
private String agencyId; private String agencyId;
/**
* agencyId的上级
*/
private String pid;
/**
* 工作人员所属组织的org_id_path
*/
private String orgIdPath;
/** /**
* 工作人员所属组织ID的pids * 工作人员所属组织ID的pids
*/ */

9
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java

@ -21,7 +21,14 @@ public class CustomerStaffInfoCache implements Serializable {
* 工作人员所属组织ID * 工作人员所属组织ID
*/ */
private String agencyId; private String agencyId;
/**
* agencyId的上级
*/
private String pid;
/**
* 工作人员所属组织的org_id_path
*/
private String orgIdPath;
/** /**
* 工作人员所属组织ID的pids * 工作人员所属组织ID的pids
*/ */

37
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -22,6 +22,8 @@ import org.joda.time.format.DateTimeFormatter;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
@ -1112,4 +1114,39 @@ public class DateUtils {
cal.setTime(date); cal.setTime(date);
return str.contains(String.valueOf(cal.get(Calendar.DAY_OF_WEEK))); return str.contains(String.valueOf(cal.get(Calendar.DAY_OF_WEEK)));
} }
/**
* @description: java.time.LocalDate转Date
* @param localDate:
* @return
* @author: WangXianZhang
* @date: 2023/5/4 3:00 PM
*/
public static Date localDate2Date(java.time.LocalDate localDate) {
Instant instant = localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
}
/**
* @description: java.time.LocalDateTime转Date
* @param localDate:
* @return
* @author: WangXianZhang
* @date: 2023/5/4 3:00 PM
*/
public static Date localDateTime2Date(java.time.LocalDateTime localDate) {
Instant instant = localDate.atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
}
/**
* @description: date转化为DateTime
* @param date:
* @return
* @author: WangXianZhang
* @date: 2023/5/4 3:04 PM
*/
public static java.time.LocalDateTime date2LocalDateTime(Date date) {
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
}
} }

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java

@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
import java.time.DateTimeException; import java.time.DateTimeException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.Period; import java.time.Period;
import java.util.Date;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -56,6 +57,7 @@ public class IdCardRegexUtils {
private String birthdayDay; private String birthdayDay;
private String sex; private String sex;
private Integer age; private Integer age;
private LocalDate birthday;
} }
/** /**
@ -122,17 +124,18 @@ public class IdCardRegexUtils {
String month = matcher.group("month"); String month = matcher.group("month");
String day = matcher.group("day"); String day = matcher.group("day");
String sex = matcher.group("sex"); String sex = matcher.group("sex");
LocalDate birthday;
// ------- 年龄Start---------- // ------- 年龄Start----------
Integer age; Integer age;
try { try {
LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
age = Period.between(birthday, LocalDate.now()).getYears(); age = Period.between(birthday, LocalDate.now()).getYears();
} catch (DateTimeException e) { } catch (DateTimeException e) {
throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e)); throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e));
} }
// ------- 年龄End---------- // ------- 年龄End----------
return new ParsedContent(year, month, day, sex, age); return new ParsedContent(year, month, day, sex, age, birthday);
} }
// 其他类型暂时不可解析 // 其他类型暂时不可解析

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

@ -20,7 +20,14 @@ public class CustomerStaffResultDTO implements Serializable {
* 工作人员所属组织ID * 工作人员所属组织ID
*/ */
private String agencyId; private String agencyId;
/**
* agencyId的上级
*/
private String pid;
/**
* 工作人员所属组织的org_id_path
*/
private String orgIdPath;
/** /**
* 工作人员所属组织ID的pids * 工作人员所属组织ID的pids
*/ */

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -268,7 +268,7 @@ public class EpmetUserController {
* remark: * remark:
*/ */
@PostMapping("getStaffInfo/{staffId}") @PostMapping("getStaffInfo/{staffId}")
public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ public Result<CustomerStaffResultDTO> getStaffInfo(@PathVariable(name = "staffId") String staffId){
return new Result<CustomerStaffResultDTO>().ok(epmetUserService.getStaffInfo(staffId)); return new Result<CustomerStaffResultDTO>().ok(epmetUserService.getStaffInfo(staffId));
} }

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

@ -18,10 +18,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.BadgeConstant; import com.epmet.constant.BadgeConstant;
import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.NeighborhoodConstant;
import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.OrgInfoConstant;
@ -650,6 +647,9 @@ public class EpmetUserServiceImpl implements EpmetUserService {
} }
result.setStaffId(staffEntity.getUserId()); result.setStaffId(staffEntity.getUserId());
result.setAgencyId(agencyDTO.getId()); result.setAgencyId(agencyDTO.getId());
//新增pid,orgIdPath
result.setPid(agencyDTO.getPid());
result.setOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyDTO.getId(),agencyDTO.getPids()));
result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyName(agencyDTO.getOrganizationName());
result.setAgencyPIds(agencyDTO.getPids()); result.setAgencyPIds(agencyDTO.getPids());
result.setLevel(agencyDTO.getLevel()); result.setLevel(agencyDTO.getLevel());

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.commons.tools.enums.CollectUrlEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -134,6 +135,7 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao,I
try { try {
neiEntity.setQrcodeUrl(createNeiQrcodeUrl(entity)); neiEntity.setQrcodeUrl(createNeiQrcodeUrl(entity));
} catch (Exception e) { } catch (Exception e) {
log.error("【新增小区】二维码生成失败:" + ExceptionUtils.getErrorStackTrace(e));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败");
} }
baseDao.updateById(neiEntity); baseDao.updateById(neiEntity);

2
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java

@ -31,6 +31,6 @@ public class EditPrincipalFormDTO implements Serializable {
@NotBlank(message = "principalMobile不能为空",groups = AddGroup.class) @NotBlank(message = "principalMobile不能为空",groups = AddGroup.class)
private String principalMobile; private String principalMobile;
@NotBlank(message = "principalStaffId不能为空",groups = AddGroup.class) // @NotBlank(message = "principalStaffId不能为空",groups = AddGroup.class)
private String principalStaffId; private String principalStaffId;
} }

Loading…
Cancel
Save