员工信息管理,重置密码(用户自行输入密码)

dev
zhanglei 2026-08-06 14:24:02 +08:00
parent d49b451112
commit b5f0c0992f
4 changed files with 27 additions and 7 deletions

View File

@ -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("导入人员信息")

View File

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

View File

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

View File

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