diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index 81c74a4c38..6e9944c316 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/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; + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; + /** * 工作人员所属组织ID的pids */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index bb5526afe6..a80ba6e727 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/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 */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 8ddbea5066..f13ecd1297 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/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.ParseException; import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.LocalDateTime; import java.time.ZoneId; import java.util.*; @@ -1112,4 +1114,39 @@ public class DateUtils { cal.setTime(date); 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()); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java index ff1f0b0549..78c061b395 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java +++ b/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.LocalDate; import java.time.Period; +import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -56,6 +57,7 @@ public class IdCardRegexUtils { private String birthdayDay; private String sex; private Integer age; + private LocalDate birthday; } /** @@ -122,17 +124,18 @@ public class IdCardRegexUtils { String month = matcher.group("month"); String day = matcher.group("day"); String sex = matcher.group("sex"); + LocalDate birthday; // ------- 年龄Start---------- Integer age; 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(); } catch (DateTimeException e) { throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e)); } // ------- 年龄End---------- - return new ParsedContent(year, month, day, sex, age); + return new ParsedContent(year, month, day, sex, age, birthday); } // 其他类型暂时不可解析 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java index 3269ebcb26..0bc9203d45 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java +++ b/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 */ private String agencyId; - + /** + * agencyId的上级 + */ + private String pid; + /** + * 工作人员所属组织的org_id_path + */ + private String orgIdPath; /** * 工作人员所属组织ID的pids */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 24d9c5a738..2498606f80 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -268,7 +268,7 @@ public class EpmetUserController { * remark: */ @PostMapping("getStaffInfo/{staffId}") - public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ + public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){ return new Result().ok(epmetUserService.getStaffInfo(staffId)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 75f863dd58..ea9980e7af 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/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.IcResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.BadgeConstant; import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; @@ -650,6 +647,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { } result.setStaffId(staffEntity.getUserId()); result.setAgencyId(agencyDTO.getId()); + //新增pid,orgIdPath + result.setPid(agencyDTO.getPid()); + result.setOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyDTO.getId(),agencyDTO.getPids())); result.setAgencyName(agencyDTO.getOrganizationName()); result.setAgencyPIds(agencyDTO.getPids()); result.setLevel(agencyDTO.getLevel()); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java index cc35c91b5b..23279882cb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java @@ -98,4 +98,7 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 * 小组等级 */ private Integer level; + private String agencyId; + + private String orgIdPath; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 8c2d43f75f..63065ee322 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -37,10 +39,7 @@ import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.*; @@ -609,6 +608,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl ORDER BY - IC_RESI_USER.GRID_ID desc, + IC_RESI_USER.GRID_ID asc, IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.UNIT_ID ASC,