瀏覽代碼

根据医院获取质控类型

zhoutg 5 年之前
父節點
當前提交
ef2a3e11e5

+ 13 - 0
mrman-service/src/main/java/com/diagbot/facade/QcCacesEntryFacade.java

@@ -33,6 +33,7 @@ import com.diagbot.vo.QcEntryTypeIndexVO;
 import com.diagbot.vo.QcEntryTypePageVO;
 import com.diagbot.vo.QcEntryTypeSaveVO;
 import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -63,6 +64,8 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
     @Autowired
     @Qualifier("qcTypeCasesEntryServiceImpl")
     QcTypeCasesEntryService qcTypeCasesEntryService;
+    @Autowired
+    QcTypeFacade qcTypeFacade;
 
     /**
      * 分页获取病例条目
@@ -237,5 +240,15 @@ public class QcCacesEntryFacade extends QcCasesEntryServiceImpl {
         }
         return true;
     }
+
+    /**
+     * 根据医院获取质控类型列表
+     *
+     * @param qcTypeHospitalVO
+     * @return
+     */
+    public List<QcTypeSimpDTO> getTypeByHospitalFac(QcTypeHospitalVO qcTypeHospitalVO) {
+        return this.getTypeByHospital(qcTypeHospitalVO);
+    }
     /********************************质控条目和质控类型关系映射结束******************************************/
 }

+ 3 - 0
mrman-service/src/main/java/com/diagbot/mapper/QcCasesEntryMapper.java

@@ -16,6 +16,7 @@ import com.diagbot.vo.QcEntryTypeIndexVO;
 import com.diagbot.vo.QcEntryTypePageVO;
 import com.diagbot.vo.QcEntryTypeSaveVO;
 import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -56,4 +57,6 @@ public interface QcCasesEntryMapper extends BaseMapper<QcCasesEntry> {
     public List<QcTypeSimpDTO> indexQcType(QcEntryTypeIndexVO qcEntryTypeIndexVO);
 
     public void deleteQcTypeEntry(QcEntryTypeSaveVO qcEntryTypeSaveVO);
+
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO);
 }

+ 3 - 0
mrman-service/src/main/java/com/diagbot/service/QcCasesEntryService.java

@@ -16,6 +16,7 @@ import com.diagbot.vo.QcEntryTypeIndexVO;
 import com.diagbot.vo.QcEntryTypePageVO;
 import com.diagbot.vo.QcEntryTypeSaveVO;
 import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 
 import java.util.List;
@@ -56,4 +57,6 @@ public interface QcCasesEntryService extends IService<QcCasesEntry> {
     public List<QcTypeSimpDTO> indexQcType(QcEntryTypeIndexVO qcEntryTypeIndexVO);
 
     public void deleteQcTypeEntry(QcEntryTypeSaveVO qcEntryTypeSaveVO);
+
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO);
 }

+ 6 - 0
mrman-service/src/main/java/com/diagbot/service/impl/QcCasesEntryServiceImpl.java

@@ -18,6 +18,7 @@ import com.diagbot.vo.QcEntryTypeIndexVO;
 import com.diagbot.vo.QcEntryTypePageVO;
 import com.diagbot.vo.QcEntryTypeSaveVO;
 import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import com.diagbot.vo.QcTypeIndexVO;
 import org.springframework.stereotype.Service;
 
@@ -84,4 +85,9 @@ public class QcCasesEntryServiceImpl extends ServiceImpl<QcCasesEntryMapper, QcC
         baseMapper.deleteQcTypeEntry(qcEntryTypeSaveVO);
     }
 
+    @Override
+    public List<QcTypeSimpDTO> getTypeByHospital(QcTypeHospitalVO qcTypeHospitalVO) {
+        return baseMapper.getTypeByHospital(qcTypeHospitalVO);
+    }
+
 }

+ 14 - 0
mrman-service/src/main/java/com/diagbot/vo/QcTypeHospitalVO.java

@@ -0,0 +1,14 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Data
+public class QcTypeHospitalVO {
+    // 医院id
+    private Long hospitalId;
+}

+ 11 - 0
mrman-service/src/main/java/com/diagbot/web/QcEntryTypeController.java

@@ -11,6 +11,7 @@ import com.diagbot.vo.QcEntryTypeIndexVO;
 import com.diagbot.vo.QcEntryTypePageVO;
 import com.diagbot.vo.QcEntryTypeSaveVO;
 import com.diagbot.vo.QcEntryTypeVO;
+import com.diagbot.vo.QcTypeHospitalVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -91,4 +92,14 @@ public class QcEntryTypeController {
         QcEntryTypeDetailDTO data = qcCacesEntryFacade.getByIdFac(qcEntryTypeVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "根据医院获取质控类型列表[by:zhoutg]",
+            notes = "// 医院id\n" +
+                    " Long hospitalId;")
+    @PostMapping("/getTypeByHospital")
+    @SysLogger("getTypeByHospital")
+    public RespDTO<List<QcTypeSimpDTO>> getTypeByHospital(@RequestBody QcTypeHospitalVO qcTypeHospitalVO) {
+        List<QcTypeSimpDTO> data = qcCacesEntryFacade.getTypeByHospitalFac(qcTypeHospitalVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 14 - 0
mrman-service/src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -267,4 +267,18 @@
         AND t1.id = t2.type_id
         AND t2.case_entry_id = #{entryId}
     </delete>
+
+    <select id="getTypeByHospital" resultType="com.diagbot.dto.QcTypeSimpDTO">
+        SELECT DISTINCT
+            NAME
+        FROM
+            `qc_type`
+        WHERE
+            is_deleted = 'N'
+        <if test="hospitalId != null">
+            and hospital_id = #{hospitalId}
+        </if>
+        ORDER BY
+            id
+    </select>
 </mapper>