提交 398ca97e 编写于 作者: wenhao.qin's avatar wenhao.qin

SaaS/运营平台添加人员校验

上级 f9402a90
流水线 #43629 已取消 于阶段
...@@ -123,8 +123,18 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService { ...@@ -123,8 +123,18 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
return 1; return 1;
} }
Account byMobilePhone = accountMapper.getByMobilePhone(mobileEncrypt); Account byMobilePhone = accountMapper.getByMobilePhone(mobileEncrypt);
Integer hospitalId = byMobilePhone.getHospitalId();
Hospital hospital;
if (null == hospitalId || null == (hospital = hospitalMapper.selectByPrimaryKey(hospitalId))){
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "该手机号已存在,但未加入机构,请至云鹊医App中加入机构");
}
if (hospitalId.equals(req.getHospitalId())){
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "该手机号已存在本机构中");
}
if (!req.getHospitalId().equals(byMobilePhone.getHospitalId())) { if (!req.getHospitalId().equals(byMobilePhone.getHospitalId())) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "正在添加的用户非本机构下用户"); throw new PicaException(
PicaResultCode.PARAM_IS_INVALID.code(),
String.format("该手机号已存在于\"%s\"中,如需修改请至云鹊医App中修改所属机构",hospital.getName()));
} }
Account account = new Account(); Account account = new Account();
account.setId(byMobilePhone.getId()); account.setId(byMobilePhone.getId());
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from p_hospital from p_hospital
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} and delete_flag = 1
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from p_hospital delete from p_hospital
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册