Browse Source

Merge branch 'master' of http://121.42.41.42:7070/r/epmet-cloud into yantai_zhengwu_master

dev
yinzuomei 2 years ago
parent
commit
eea41134b6
  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. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  9. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  10. 2
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__group_add_orgidpath_agencyid.sql
  11. 2
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java
  12. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

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());

3
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 Integer level;
private String agencyId;
private String orgIdPath;
} }

11
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.EpmetException;
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.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.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO; 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.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
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.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant; import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
@ -609,6 +608,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType()); resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType());
resiGroupEntity.setPartyOrgId(applyCreateGroupFormDTO.getPartyOrgId()); resiGroupEntity.setPartyOrgId(applyCreateGroupFormDTO.getPartyOrgId());
resiGroupEntity.setPartyOrgPids(applyCreateGroupFormDTO.getPartyOrgPids()); resiGroupEntity.setPartyOrgPids(applyCreateGroupFormDTO.getPartyOrgPids());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(applyCreateGroupFormDTO.getGridId());
resiGroupEntity.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()));
resiGroupEntity.setAgencyId(gridInfo.getPid());
return resiGroupEntity; return resiGroupEntity;
} }

2
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.28__group_add_orgidpath_agencyid.sql

@ -0,0 +1,2 @@
alter table resi_group add column AGENCY_ID varchar(64) comment '所属组织id' after GRID_ID;
alter table resi_group add column ORG_ID_PATH varchar(512) comment '组织idpath' after AGENCY_ID;

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;
} }

2
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -335,7 +335,7 @@
</when> </when>
<otherwise> <otherwise>
ORDER BY ORDER BY
IC_RESI_USER.GRID_ID desc, IC_RESI_USER.GRID_ID asc,
IC_RESI_USER.VILLAGE_ID ASC, IC_RESI_USER.VILLAGE_ID ASC,
IC_RESI_USER.BUILD_ID ASC, IC_RESI_USER.BUILD_ID ASC,
IC_RESI_USER.UNIT_ID ASC, IC_RESI_USER.UNIT_ID ASC,

Loading…
Cancel
Save