Browse Source

1.修改:新增工作人员addstaffv2接口,增加文化程度的字段、idCard的字段,并且内部逻辑中,通过解析idCard得到出生日期,并且存储

2.修改:编辑工作人员editstaff接口,增加文化程度的字段、idCard的字段,并且内部逻辑中,通过解析idCard得到出生日期,并且存储
master
wxz 2 years ago
parent
commit
4f442eff01
  1. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java
  2. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java
  3. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java
  4. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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

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 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.security.password.PasswordUtils;
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.constant.CustomerStaffConstant;
import com.epmet.constant.RoleKeyConstants;
@ -73,6 +75,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
@ -370,6 +373,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setWorkType(fromDTO.getWorkType());
staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE);
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);
//工作人员角色关联表
@ -484,6 +495,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setMobile(fromDTO.getMobile());
staffEntity.setGender(fromDTO.getGender());
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);
//清空权限关联

Loading…
Cancel
Save