提交 25202112 编写于 作者: wenlei.liao's avatar wenlei.liao

登录返回修改

上级 71e31bc8
流水线 #42929 已取消 于阶段
......@@ -33,4 +33,8 @@ public interface PermissionDoctorRoleMapper {
List<PermissionDoctorRole> selectByRoleId(Long id);
int upsertDefaultRole(Map<String, Object> map);
List<PermissionDoctorRole> queryDoctorMenu(Integer doctorId);
PermissionDoctorRole selectByHospitalIdRoleId(Integer hospitalId, Integer roleId);
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ import com.pica.cloud.foundation.utils.utils.ValidateUtils;
import com.pica.cloud.patient.smartcontract.common.utils.HttpClientCloudUtils;
import io.jsonwebtoken.*;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -46,10 +47,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.PublicKey;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.*;
@Service
public class LoginServiceImpl implements LoginService {
......@@ -101,6 +99,9 @@ public class LoginServiceImpl implements LoginService {
@Autowired
private IntactUtil intactUtil;
@Autowired
private PermissionDoctorRoleMapper permissionDoctorRoleMapper;
@Value("${doubleWritingMode}")
private boolean doubleWritingMode;
......@@ -1241,6 +1242,23 @@ public class LoginServiceImpl implements LoginService {
logger.error("此手机号无用户:{}", mobile);
intactUtil.sendIntact(batchNo, "pwdLoginCorrect", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "request:" + JSON.toJSONString(request) + ",+mobile 此手机号无用户:" + mobile + ",encrypt:" + ",accountInfoEntity:" + JSON.toJSONString(accountInfoEntity));
}
if(null == doctorInfo.getHospitalId() || 0 == doctorInfo.getHospitalId()){
throw new PicaException(AccountExceptionEnum.PICA_PARAMS_ERROR.getCode(), "请先加入机构");
}
//查询登录用户角色权限信息
List<PermissionDoctorRole> doctorRoles = permissionDoctorRoleMapper.queryDoctorMenu(doctorInfo.getId());
if(CollectionUtils.isEmpty(doctorRoles)){
PermissionDoctorRole role = permissionDoctorRoleMapper.selectByHospitalIdRoleId(doctorInfo.getHospitalId(), 3);
String name = "";
if(null != role){
Doctor doctor = doctorInfoMapper.selectByPrimaryKey(Math.toIntExact(role.getDoctorId()));
if(null != doctor){
name = doctor.getName();
}
}
throw new PicaException(AccountExceptionEnum.PICA_PARAMS_ERROR.getCode(), "请先联系系统管理员"+ name +"开通账号");
}
Integer userId = 0;
if (productType != AccountTypeEnum.PRODUCT_TYPE_HEALTH.getCode()) {
userId = doctorInfo.getId();
......
......@@ -180,4 +180,28 @@
and delete_flag = 1
</update>
<select id="queryDoctorMenu" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
pr.*
FROM
permission_doctor_role pr,
p_saas_menu pm
WHERE
pr.doctor_id = #{doctorId}
AND pr.role_id = pm.permission_role_id
AND pr.delete_flag = 1
AND pm.delete_flag = 1
AND pm.system_type = 42
GROUP BY
pm. NAME
</select>
<select id="selectByHospitalIdRoleId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
pr.*
FROM
permission_doctor_role pr
WHERE pr.hospital_id = #{hospitalId}
and pr.role_id = #{roleId} AND pr.delete_flag = 1 order by pr.modified_time desc limit 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册