Browse Source

Merge branch 'lingshan_master' into dev

# Conflicts:
#	epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
master
wxz 2 years ago
parent
commit
88c600fbd1
  1. 37
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  2. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
  3. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java
  4. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java
  5. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  6. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  7. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java
  8. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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);
} }
// 其他类型暂时不可解析 // 其他类型暂时不可解析

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java

@ -78,4 +78,11 @@ public class AddStaffV2FromDTO implements Serializable {
* 烟台用当前登录用户 * 烟台用当前登录用户
*/ */
private String currentUserId; private String currentUserId;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
*/
private String culture;
private String idCard;
} }

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java

@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -74,4 +75,16 @@ public class StaffSubmitFromDTO implements Serializable {
* 社会自组织: community_org * 社会自组织: community_org
*/ */
private String deptType; private String deptType;
private String idCard;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
*/
private String culture;
// /**
// * 出生日期
// */
// private Date birthday;
} }

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -99,8 +99,5 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/ */
private Integer level; private Integer level;
private String agencyId; private String agencyId;
private String orgIdPath; private String orgIdPath;
private String pids;
} }

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -2009,7 +2009,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
LambdaQueryWrapper<ResiGroupEntity> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ResiGroupEntity> query = new LambdaQueryWrapper<>();
query.eq(ResiGroupEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); query.eq(ResiGroupEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
query.eq(ResiGroupEntity::getPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids())); query.eq(ResiGroupEntity::getGroupType, "branch"); // 党小组
query.likeRight(ResiGroupEntity::getOrgIdPath, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
return baseDao.selectCount(query); return baseDao.selectCount(query);
} }
} }

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java

@ -111,4 +111,14 @@ public class CustomerStaffEntity extends BaseEpmetEntity {
* 身份证号 * 身份证号
*/ */
private String idCard; private String idCard;
/**
* 出生日期
*/
private Date birthday;
/**
* 文化程度0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专
*/
private String culture;
} }

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

@ -37,6 +37,8 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.CustomerStaffConstant;
import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.RoleKeyConstants;
@ -73,6 +75,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -370,6 +373,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setWorkType(fromDTO.getWorkType()); staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE);
staffEntity.setPassword(PasswordUtils.encode("12345678")); staffEntity.setPassword(PasswordUtils.encode("12345678"));
staffEntity.setIdCard(fromDTO.getIdCard());
if (StringUtils.isNotBlank(fromDTO.getIdCard())) {
LocalDate birthday = IdCardRegexUtils.parse(fromDTO.getIdCard()).getParsedResult().getBirthday();
staffEntity.setBirthday(DateUtils.localDate2Date(birthday));
}
staffEntity.setCulture(fromDTO.getCulture());
baseDao.insert(staffEntity); baseDao.insert(staffEntity);
//工作人员角色关联表 //工作人员角色关联表
@ -484,6 +495,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setMobile(fromDTO.getMobile()); staffEntity.setMobile(fromDTO.getMobile());
staffEntity.setGender(fromDTO.getGender()); staffEntity.setGender(fromDTO.getGender());
staffEntity.setWorkType(fromDTO.getWorkType()); staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setCulture(fromDTO.getCulture());
staffEntity.setIdCard(fromDTO.getIdCard());
if (StringUtils.isNotBlank(fromDTO.getIdCard())) {
LocalDate birthday = IdCardRegexUtils.parse(fromDTO.getIdCard()).getParsedResult().getBirthday();
staffEntity.setBirthday(DateUtils.localDate2Date(birthday));
}
staffEntity.setCulture(fromDTO.getCulture());
baseDao.updateById(staffEntity); baseDao.updateById(staffEntity);
//清空权限关联 //清空权限关联

Loading…
Cancel
Save