提交 60f441dd 编写于 作者: wenhao.qin's avatar wenhao.qin

补充上次修改(考虑doctor和account数据不一致情况)

上级 6efc39ce
流水线 #43756 已取消 于阶段
......@@ -321,6 +321,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
}
@Override
@Transactional
public HospitalSaasUserEditResp edit(Long id) {
HospitalSaasUserEditResp resp = accountMapper.selectUserRoleById(id);
List<RoleDto> roleDtos = doctorRoleMapper.selectRoleByUserId(resp.getId());
......@@ -330,13 +331,28 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
return new HospitalSaasUserEditResp();
}
resp.setPwdFlag(2);
if (resp.getAcctId() != null){
AccountInfoEntity accountInfo = accountInfoDetailMapper.selectByPrimaryKey(resp.getAcctId());
if (resp.getAcctId() == null){
if (StringUtils.isNotEmpty(resp.getPassword())){
resp.setPwdFlag(1);
}
//维护account表信息
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;
if (resp.getAcctId() != null && null!=(accountInfo = accountInfoDetailMapper.selectByPrimaryKey(resp.getAcctId()))){
if (StringUtils.isNotBlank(accountInfo.getPassword())) {
resp.setPwdFlag(1);
resp.setPassword(accountInfo.getPassword());
}
}
else {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "数据有误");
}
//手机号不为空 解密脱敏
if (StringUtils.isNotBlank(resp.getMobile())) {
String phone = EncryptUtils.decryptContent(resp.getMobile(), EncryptConstants.ENCRYPT_TYPE_MOBILE, EncryptConstants.ENCRYPT_DECRYPT_KEY);
......
......@@ -319,6 +319,9 @@
<if test="birthday != null">
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="acctId != null">
acct_id = #{accId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -394,6 +397,7 @@
p.hospital_id as hospitalId,
p.mobile_phone as mobile,
p.comment as comment,
p.password as password,
p.acct_id as acctId
from p_doctor as p
where p.id = #{id, jdbcType=INTEGER}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册