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

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

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