浏览代码

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

zhoutg 6 年之前
父节点
当前提交
ce2d859f8e

+ 6 - 0
icss-service/src/main/java/com/diagbot/dto/ReadInquiryDTO.java

@@ -1,5 +1,9 @@
 package com.diagbot.dto;
 
+import java.util.List;
+
+import com.diagbot.entity.InquiryDetail;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
@@ -21,4 +25,6 @@ public class ReadInquiryDTO{
 	@ApiModelProperty(value="内容JSON字符串")
 	private String dataJson;
 	
+	private List<InquiryDetail> details;
+	
 }

+ 21 - 12
icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -1,15 +1,16 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
+import com.diagbot.entity.DeptInfo;
+import com.diagbot.entity.HospitalDept;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.DeptInfoServiceImpl;
-import com.diagbot.util.ListUtil;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.DeptInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-
 /**
  * @Description:
  * @author: wangyu
@@ -18,18 +19,26 @@ import java.util.List;
 @Component
 public class DeptInfoFacade extends DeptInfoServiceImpl {
 
+    @Autowired
+    HospitalDeptFacade hospitalDeptFacade;
     /**
      * 获取科室信息
      *
      * @param deptInfoVO
      * @return
      */
-    public List<DeptInfoDTO> getDeptInfo(DeptInfoVO deptInfoVO) {
-        List<DeptInfoDTO> deptInfoDTOList = this.getDeptInfos(deptInfoVO.getDeptCode(), deptInfoVO.getHospitalCode());
-        if (ListUtil.isEmpty(deptInfoDTOList)) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "获取科室信息失败");
-        }
-        return deptInfoDTOList;
+    public DeptInfoDTO getDeptInfo(DeptInfoVO deptInfoVO) {
+        QueryWrapper<HospitalDept> hospitalDeptQueryWrapper = new QueryWrapper<>();
+        hospitalDeptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_code",deptInfoVO.getHospitalCode())
+                .eq("code",deptInfoVO.getDeptCode());
+        HospitalDept hospitalDept = hospitalDeptFacade.getOne(hospitalDeptQueryWrapper);
+        QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
+        deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id",hospitalDept.getDeptId());
+        DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
+        DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
+        BeanUtil.copyProperties(deptInfo,deptInfoDTO);
+        return deptInfoDTO;
     }
 }

+ 4 - 0
icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -136,6 +136,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
 
         if (inquiryInfo != null) {
             readInquiryDTO.setDataJson(inquiryInfo.getDataJson());
+            
+            QueryWrapper<InquiryDetail> inquiryDetailQe = new QueryWrapper<>();
+            inquiryDetailQe.eq("inquiry_id", inquiryInfo.getId());
+            readInquiryDTO.setDetails(inquiryDetailFacade.list(inquiryDetailQe));
         }
 
         return readInquiryDTO;

+ 20 - 16
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,9 +1,5 @@
 package com.diagbot.facade;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
@@ -15,6 +11,9 @@ import com.diagbot.service.impl.PatientInfoServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * @Description: 患者业务逻辑
@@ -23,11 +22,11 @@ import com.diagbot.vo.PatientInfoVO;
  */
 @Component
 public class PatientInfoFacade extends PatientInfoServiceImpl {
-	
-	@Autowired
-	private DoctorPageModeFacade doctorPageModeFacade;
-	@Autowired
-	private DeptInfoFacade deptInfoFacade;
+
+    @Autowired
+    private DoctorPageModeFacade doctorPageModeFacade;
+    @Autowired
+    private DeptInfoFacade deptInfoFacade;
 
     /**
      * 获取患者信息
@@ -50,17 +49,22 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
         GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
         getTopPatientInfoDTO.setSystemTime(DateUtil.now());
         getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
-        
-        DeptInfo deptInfo = deptInfoFacade.getById(getTopPatientInfoDTO.getSelfDeptId());
-        getTopPatientInfoDTO.setSelfDeptName(deptInfo.getName()); 
-        
+
+        QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
+        deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", getTopPatientInfoDTO.getSelfDeptId());
+        DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQ);
+        if (null != deptInfo) {
+            getTopPatientInfoDTO.setSelfDeptName(deptInfo.getName());
+        }
+
         QueryWrapper<DoctorPageMode> doctorPageModeQe = new QueryWrapper<>();
         doctorPageModeQe.eq("is_deleted", IsDeleteEnum.N.getKey());
         doctorPageModeQe.eq("doctor_id", getTopPatientInfoDTO.getDoctorId());
         DoctorPageMode doctorPageMode = doctorPageModeFacade.getOne(doctorPageModeQe);
-        if(doctorPageMode!=null){
-        	getTopPatientInfoDTO.setModeClassify(doctorPageMode.getModeClassify());
-        	getTopPatientInfoDTO.setModeValue(doctorPageMode.getModeValue());
+        if (doctorPageMode != null) {
+            getTopPatientInfoDTO.setModeClassify(doctorPageMode.getModeClassify());
+            getTopPatientInfoDTO.setModeValue(doctorPageMode.getModeValue());
         }
         return getTopPatientInfoDTO;
     }

+ 1 - 12
icss-service/src/main/java/com/diagbot/mapper/DeptInfoMapper.java

@@ -1,11 +1,7 @@
 package com.diagbot.mapper;
 
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.entity.DeptInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
+import com.diagbot.entity.DeptInfo;
 
 /**
  * <p>
@@ -17,11 +13,4 @@ import java.util.List;
  */
 public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
 
-    /**
-     *  获取科室信息
-     * @param deptCode
-     * @param hospitalCode
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptInfos(@Param("deptCode")String deptCode, @Param("hospitalCode")String hospitalCode);
 }

+ 0 - 11
icss-service/src/main/java/com/diagbot/service/DeptInfoService.java

@@ -1,11 +1,8 @@
 package com.diagbot.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.entity.DeptInfo;
 
-import java.util.List;
-
 /**
  * <p>
  * 科室信息表 服务类
@@ -16,12 +13,4 @@ import java.util.List;
  */
 public interface DeptInfoService extends IService<DeptInfo> {
 
-    /**
-     * 获取科室信息
-     *
-     * @param deptCode
-     * @param hospitalCode
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode);
 }

+ 0 - 4
icss-service/src/main/java/com/diagbot/service/impl/DeptInfoServiceImpl.java

@@ -20,8 +20,4 @@ import java.util.List;
 @Service
 public class DeptInfoServiceImpl extends ServiceImpl<DeptInfoMapper, DeptInfo> implements DeptInfoService {
 
-    @Override
-    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode) {
-        return baseMapper.getDeptInfos(deptCode, hospitalCode);
-    }
 }

+ 2 - 3
icss-service/src/main/java/com/diagbot/web/DeptInfoController.java

@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
-import java.util.List;
 
 /**
  * <p>
@@ -41,8 +40,8 @@ public class DeptInfoController {
                     "hospitalCode:医院编号,必填<br>")
     @PostMapping("/getDeptInfo")
     @SysLogger("getDeptInfo")
-    public RespDTO<List<DeptInfoDTO>> getDeptInfo(@Valid @RequestBody DeptInfoVO deptInfoVO) {
-        List<DeptInfoDTO> data = deptInfoFacade.getDeptInfo(deptInfoVO);
+    public RespDTO<DeptInfoDTO> getDeptInfo(@Valid @RequestBody DeptInfoVO deptInfoVO) {
+        DeptInfoDTO data = deptInfoFacade.getDeptInfo(deptInfoVO);
         return RespDTO.onSuc(data);
     }
 }

+ 0 - 7
icss-service/src/main/resources/mapper/DeptInfoMapper.xml

@@ -13,11 +13,4 @@
         <result column="name" property="name" />
         <result column="remark" property="remark" />
     </resultMap>
-
-    <select id="getDeptInfos" resultType="com.diagbot.dto.DeptInfoDTO">
-        SELECT a.* FROM `icss_dept_info` a
-        LEFT JOIN tran_hospital_dept b ON a.id = b.dept_id
-        WHERE a.is_deleted = 'N' AND b.is_deleted = 'N'
-        AND b.`code` = #{deptCode} AND b.hospital_code = #{hospitalCode}
-    </select>
 </mapper>

+ 0 - 8
icssman-service/src/main/java/com/diagbot/mapper/DeptInfoMapper.java

@@ -27,14 +27,6 @@ public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
      */
     public IPage<GetDeptInfoDTO> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
 
-    /**
-     *  获取科室信息和
-     * @param deptCode
-     * @param hospitalCode
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptInfos(@Param("deptCode") String deptCode,@Param("hospitalCode") String hospitalCode);
-
     /**
      * 获取科室名称
      * @return

+ 0 - 8
icssman-service/src/main/java/com/diagbot/service/DeptInfoService.java

@@ -27,14 +27,6 @@ public interface DeptInfoService extends IService<DeptInfo> {
      */
     public IPage<GetDeptInfoDTO> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
 
-    /**
-     * 获取科室信息
-     *
-     * @param deptCode
-     * @param hospitalCode
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode);
 
     /**
      * 获取科室名称

+ 0 - 5
icssman-service/src/main/java/com/diagbot/service/impl/DeptInfoServiceImpl.java

@@ -28,11 +28,6 @@ public class DeptInfoServiceImpl extends ServiceImpl<DeptInfoMapper, DeptInfo> i
         return baseMapper.getAllDeptInfo(getDeptInfoVO);
     }
 
-    @Override
-    public List<DeptInfoDTO> getDeptInfos(String deptCode, String hospitalCode) {
-        return baseMapper.getDeptInfos(deptCode, hospitalCode);
-    }
-
     @Override
     public List<DeptInfoDTO> getDeptName() {
         return baseMapper.getDeptName();

+ 0 - 7
icssman-service/src/main/resources/mapper/DeptInfoMapper.xml

@@ -22,13 +22,6 @@
         order by gmt_modified desc
     </select>
 
-    <select id="getDeptInfos" resultType="com.diagbot.dto.DeptInfoDTO">
-        SELECT a.* FROM `icss_dept_info` a
-        LEFT JOIN tran_hospital_dept b ON a.id = b.dept_id
-        WHERE a.is_deleted = 'N' AND b.is_deleted = 'N'
-        AND b.`code` = #{deptCode} AND b.hospital_code = #{hospitalCode}
-    </select>
-
     <select id="getDeptName" resultType="com.diagbot.dto.DeptInfoDTO">
         SELECT
 	      *