|
@@ -1,15 +1,19 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.dto.DoctorInfoDTO;
|
|
|
import com.diagbot.dto.DoctorInfoFindDTO;
|
|
|
import com.diagbot.entity.DoctorInfo;
|
|
|
+import com.diagbot.entity.SysSet;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.SysTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.DoctorInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.vo.DoctorInfoVO;
|
|
|
import com.diagbot.vo.HospitalCodeSetVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -23,6 +27,8 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Component
|
|
|
public class DoctorInfoFacade extends DoctorInfoServiceImpl {
|
|
|
+ @Autowired
|
|
|
+ private SysSetFacade sysSetFacade;
|
|
|
|
|
|
/**
|
|
|
* 获取医生信息
|
|
@@ -60,6 +66,20 @@ public class DoctorInfoFacade extends DoctorInfoServiceImpl {
|
|
|
|| doctorInfo.getIsDeleted().equals(IsDeleteEnum.Y.getKey())) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医生不存在!");
|
|
|
}
|
|
|
+
|
|
|
+ if (doctorInfo.getHospitalCode().equals("LT")) {
|
|
|
+ QueryWrapper<SysSet> sysSetInfo = new QueryWrapper<>();
|
|
|
+ sysSetInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ sysSetInfo.eq("hospital_code", doctorInfo.getHospitalCode());
|
|
|
+ sysSetInfo.eq("code", "template_admin");
|
|
|
+ sysSetInfo.eq("sys_type", SysTypeEnum.ICSS_SERVICE.getKey());
|
|
|
+ sysSetInfo.apply("find_in_set({0}, value)", doctorInfo.getCode());
|
|
|
+ if (sysSetFacade.count(sysSetInfo) > 0) {
|
|
|
+ throw new CommonException(CommonErrorCode.NOPERMISSION_ERROR,
|
|
|
+ "该人员为管理员无需记录引用信息!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
DoctorInfoDTO doctorInfoDTO = new DoctorInfoDTO();
|
|
|
BeanUtil.copyProperties(doctorInfo, doctorInfoDTO);
|
|
|
return doctorInfoDTO;
|