员工信息管理,重置密码(用户自行输入密码)
parent
d49b451112
commit
b5f0c0992f
|
|
@ -67,8 +67,8 @@ public class OrgPersonnelController {
|
||||||
|
|
||||||
@ApiOperation("重置人员密码")
|
@ApiOperation("重置人员密码")
|
||||||
@PostMapping("/reset-password")
|
@PostMapping("/reset-password")
|
||||||
public SingleResponse<Void> resetPassword(@ApiParam("主键ID") @RequestBody Req<Long> req) {
|
public SingleResponse<Void> resetPassword(@ApiParam("主键ID") @RequestBody Req<ResetPasswordCDTO> req) {
|
||||||
return orgPersonnelApi.resetPassword(req.getData());
|
return orgPersonnelApi.resetPassword(req.getData().getId(), req.getData().getResetPassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("导入人员信息")
|
@ApiOperation("导入人员信息")
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ import org.qinan.safetyeval.infrastructure.adapter.gbs.GbsUserFacadeClient;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingPersonnelCertMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.QualFilingPersonnelCertMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
import org.qinan.safetyeval.infrastructure.dataobject.OrgPersonnelDO;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.OrgPersonnelMapper;
|
|
||||||
import org.qinan.safetyeval.infrastructure.support.UserOrgIdResolver;
|
import org.qinan.safetyeval.infrastructure.support.UserOrgIdResolver;
|
||||||
import org.qinan.safetyeval.infrastructure.utils.CommonUtil;
|
import org.qinan.safetyeval.infrastructure.utils.CommonUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -55,7 +54,6 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员信息执行器(App层)
|
* 人员信息执行器(App层)
|
||||||
|
|
@ -189,7 +187,7 @@ public class OrgPersonnelExecutor implements OrgPersonnelApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<Void> resetPassword(Long id) {
|
public SingleResponse<Void> resetPassword(Long id, String resetPassword) {
|
||||||
OrgPersonnelEntity entity = orgPersonnelDomainService.get(id);
|
OrgPersonnelEntity entity = orgPersonnelDomainService.get(id);
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new BizException(ErrorCode.ORG_PERSONNEL_NOT_FOUND);
|
throw new BizException(ErrorCode.ORG_PERSONNEL_NOT_FOUND);
|
||||||
|
|
@ -197,7 +195,11 @@ public class OrgPersonnelExecutor implements OrgPersonnelApi {
|
||||||
// 联调阶段:密码重置占位,后续对接统一用户中心
|
// 联调阶段:密码重置占位,后续对接统一用户中心
|
||||||
UserUpdatePasswordCmd userUpdatePasswordCmd = new UserUpdatePasswordCmd();
|
UserUpdatePasswordCmd userUpdatePasswordCmd = new UserUpdatePasswordCmd();
|
||||||
userUpdatePasswordCmd.setId(entity.getId());
|
userUpdatePasswordCmd.setId(entity.getId());
|
||||||
String encrypt = Sm2Util.encryptHex(MD5.md5(defPassword), publicKey);
|
String pass = defPassword;
|
||||||
|
if (resetPassword != null) {
|
||||||
|
pass = resetPassword;
|
||||||
|
}
|
||||||
|
String encrypt = Sm2Util.encryptHex(MD5.md5(pass), publicKey);
|
||||||
userUpdatePasswordCmd.setPassword(encrypt);
|
userUpdatePasswordCmd.setPassword(encrypt);
|
||||||
gbsUserFacadeClient.updatePassword(userUpdatePasswordCmd);
|
gbsUserFacadeClient.updatePassword(userUpdatePasswordCmd);
|
||||||
return SingleResponse.success();
|
return SingleResponse.success();
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public interface OrgPersonnelApi {
|
||||||
|
|
||||||
PageResponse<QualFilingPersonnelInfoCO> filingPage(OrgFilingPersonnelPageQuery query);
|
PageResponse<QualFilingPersonnelInfoCO> filingPage(OrgFilingPersonnelPageQuery query);
|
||||||
|
|
||||||
SingleResponse<Void> resetPassword(Long id);
|
SingleResponse<Void> resetPassword(Long id, String resetPassword);
|
||||||
|
|
||||||
SingleResponse<OrgPersonnelCO> updateOriginFace(OrgPersonnelUpdateOriginFaceCmd cmd);
|
SingleResponse<OrgPersonnelCO> updateOriginFace(OrgPersonnelUpdateOriginFaceCmd cmd);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package org.qinan.safetyeval.client.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员信息修改命令
|
||||||
|
*
|
||||||
|
* @author safety-eval
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ResetPasswordCDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String resetPassword;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue