提交 2859ad72 编写于 作者: wenhao.qin's avatar wenhao.qin

优化判断逻辑

上级 442f85b2
流水线 #43765 已取消 于阶段
......@@ -325,33 +325,19 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
public HospitalSaasUserEditResp edit(Long id) {
HospitalSaasUserEditResp resp = accountMapper.selectUserRoleById(id);
if (null == resp) {
return new HospitalSaasUserEditResp();
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "数据有误");
}
List<RoleDto> roleDtos = doctorRoleMapper.selectRoleByUserId(resp.getId());
resp.setRoles(roleDtos);
resp.setRoleIds(roleDtos.stream().map(RoleDto::getId).collect(Collectors.toList()));
resp.setPwdFlag(2);
//维护account信息
if (resp.getAcctId() == null){
if (StringUtils.isNotEmpty(resp.getPassword())){
resp.setPwdFlag(1);
}
AccountInfoEntity account = buildAccountInfo(resp.getMobile(), new Date(),3, resp.getName(),6, resp.getPassword());
accountInfoDetailMapper.insertSelective(account);
Account acc=new Account();
acc.setId(id);
acc.setAcctId(account.getId());
accountMapper.updateByIdSelective(acc);
AccountInfoEntity accountInfo=accountInfoDetailMapper.selectByPrimaryKey(resp.getAcctId());
if (null == resp.getAcctId() || null == accountInfo){
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "数据有误");
}
else{
AccountInfoEntity accountInfo=accountInfoDetailMapper.selectByPrimaryKey(resp.getAcctId());
if (null==accountInfo){
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "数据有误");
}
if (StringUtils.isNotBlank(accountInfo.getPassword())) {
resp.setPwdFlag(1);
resp.setPassword(accountInfo.getPassword());
}
if (StringUtils.isNotBlank(accountInfo.getPassword())) {
resp.setPwdFlag(1);
resp.setPassword(accountInfo.getPassword());
}
//手机号不为空 解密脱敏
if (StringUtils.isNotBlank(resp.getMobile())) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册