提交 54c51c3f 编写于 作者: Administrator's avatar Administrator

Merge branch 'dev-0801' into 'release'

合作机构人员管理-没有密码和姓名时赋值、角色赋值、saas标签

See merge request !120
流水线 #50745 已取消 于阶段
......@@ -146,17 +146,36 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
Hospital hospital = null;
if (null == hospitalId || null == (hospital = hospitalMapper.selectByPrimaryKey(hospitalId))){
doctorService.joinHospital(req.getHospitalName(),picaUser.getId(),byMobilePhone.getId().intValue(),req.getHospitalId());
// throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "该手机号已存在,但未加入机构,请至云鹊医App中加入机构");
return 1;
}
if (hospitalId.equals(req.getHospitalId())){
}else if (hospitalId.equals(req.getHospitalId())){
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "该手机号已存在本机构中");
}
if (!req.getHospitalId().equals(byMobilePhone.getHospitalId())) {
}else if (!req.getHospitalId().equals(byMobilePhone.getHospitalId())) {
throw new PicaException(
PicaResultCode.PARAM_IS_INVALID.code(),
String.format("该手机号已存在于\"%s\"中,如需修改请至云鹊医App中修改所属机构",hospital.getName()));
}
//没有密码和姓名时赋值
boolean updateNameOrPwd = false;
Account account = new Account();
if (StringUtils.isBlank(byMobilePhone.getName())) {
account.setName(req.getName());
updateNameOrPwd = true;
}
if (StringUtils.isBlank(byMobilePhone.getPassword()) && StringUtils.isNotBlank(req.getPassword())) {
account.setPassword(StringUtils.upperCase(MD5Util.MD5(req.getPassword())));
account.setEntireFlag(3);
updateNameOrPwd = true;
}
if (updateNameOrPwd) {
account.setId(byMobilePhone.getId());
account.setModifyId(picaUser.getId().longValue());
account.setModifyTime(new Date());
accountMapper.updateByIdSelective(account);
}
//角色
insertSaasRole(req.getRoleId(), req.getHospitalId().longValue(), byMobilePhone.getId(), byMobilePhone.getId());
//saas用户标签
CompletableFuture.runAsync(() -> this.refreshTag(byMobilePhone.getId(), picaUser.getToken()));
}
return 1;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册