Browse Source

湘雅三院条目缺陷改善逻辑完善

chengyao 3 years ago
parent
commit
4d130dc328

+ 15 - 15
pom.xml

@@ -217,21 +217,21 @@
             <artifactId>ojdbc6</artifactId>
             <version>11.2.0.3</version>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.JoSQL</groupId>-->
-            <!--<artifactId>JoSQL</artifactId>-->
-            <!--<version>2.2</version>-->
-            <!--<scope>system</scope>-->
-            <!--<systemPath>${project.basedir}/src/main/resources/lib/josql-2.2.jar</systemPath>-->
-        <!--</dependency>-->
-
-        <!--<dependency>-->
-            <!--<groupId>net.sf.josql</groupId>-->
-            <!--<artifactId>gentlyweb-utils</artifactId>-->
-            <!--<version>1.5</version>-->
-            <!--<scope>system</scope>-->
-            <!--<systemPath>${project.basedir}/src/main/resources/lib/gentlyweb-utils-1.5.jar</systemPath>-->
-        <!--</dependency>-->
+        <dependency>
+            <groupId>org.JoSQL</groupId>
+            <artifactId>JoSQL</artifactId>
+            <version>2.2</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/josql-2.2.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.josql</groupId>
+            <artifactId>gentlyweb-utils</artifactId>
+            <version>1.5</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/gentlyweb-utils-1.5.jar</systemPath>
+        </dependency>
 
         <dependency>
             <groupId>com.microsoft.sqlserver</groupId>

+ 11 - 0
src/main/java/com/diagbot/entity/MedQcresultClick.java

@@ -43,6 +43,17 @@ public class MedQcresultClick implements Serializable {
      */
     private String deptName;
 
+
+    /**
+     * 医生id
+     */
+    private String doctorId;
+
+    /**
+     * 医生name
+     */
+    private String doctorName;
+
     /**
      * 评分结果id
      */

+ 31 - 35
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -41,6 +41,10 @@ import com.diagbot.vo.GetQcClickInnerPageVO;
 import com.diagbot.vo.GetQcClickVO;
 import com.diagbot.vo.MedClickInfoVO;
 import org.apache.commons.lang3.StringUtils;
+import org.josql.Query;
+import org.josql.QueryExecutionException;
+import org.josql.QueryParseException;
+import org.josql.QueryResults;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -132,6 +136,8 @@ public class DataAnalysisFacade {
             if (null != behospitalInfo) {
                 medQcresultClick.setDeptId(behospitalInfo.getBehDeptId());
                 medQcresultClick.setDeptName(behospitalInfo.getBehDeptName());
+                medQcresultClick.setDoctorId(behospitalInfo.getDoctorId());
+                medQcresultClick.setDoctorName(behospitalInfo.getDoctorName());
             }
             medQcresultClick.setQcresultInfoId(qcresultInfo.getId());
             medQcresultClick.setCasesEntryIds(sbFir.toString());
@@ -201,8 +207,8 @@ public class DataAnalysisFacade {
     }
 
     public IPage<GetEntryDefectImproveDTO> getEntryDefectImprove(GetEntryDefectImproveVO getEntryDefectImproveVO) {
-        long size = getEntryDefectImproveVO.getSize();
-        long current = getEntryDefectImproveVO.getCurrent();
+        int current = (int)getEntryDefectImproveVO.getCurrent();
+        int size = (int)getEntryDefectImproveVO.getSize();
         getEntryDefectImproveVO.setCurrent(1L);
         getEntryDefectImproveVO.setSize(Long.MAX_VALUE);
         IPage<GetEntryDefectImproveDTO> page = new Page<>();
@@ -255,42 +261,31 @@ public class DataAnalysisFacade {
         page.setSize(size);
         page.setTotal(getEntryDefectImproveDTO.size());
         page.setCurrent(current);
-        List<GetEntryDefectImproveDTO> getEntryDefectImproveDTOS = indexPaging(getEntryDefectImproveDTO, current, size);
-       String orderByAsc = null;
-       String orderByDesc = null;
-        for (Object order : getEntryDefectImproveVO.getOrders()) {
-            OrderItem e = (OrderItem) order;
-            String column = e.getColumn();
-            boolean asc = e.isAsc();
-           if(asc){
-               orderByAsc= column;
-           }else{
-               orderByDesc=column;
-           }
-
-        }
-      //  getEntryDefectImproveDTOS= sortList(getEntryDefectImproveDTOS, orderByAsc != null ? orderByAsc : orderByDesc);
+        List<GetEntryDefectImproveDTO> getEntryDefectImproveDTOS = page(getEntryDefectImproveDTO, size, current);
+        getEntryDefectImproveDTOS= sortList(getEntryDefectImproveDTOS, getEntryDefectImproveVO.getAsc() != null ? getEntryDefectImproveVO.getAsc() : getEntryDefectImproveVO.getDesc()+" desc");
         page.setRecords(getEntryDefectImproveDTOS);
-        return new Page<>();
+        return page;
     }
-    public List<GetEntryDefectImproveDTO> indexPaging(List<GetEntryDefectImproveDTO> retRecords ,long current,long size){
-        //数据返回索引处理
-        if(0 == current){
-            current = 1;
-        }
-        int startIndex = ((int)current -1)*10;
-        int endIndex = startIndex + (int) size;
-
-        if(retRecords.size()>1){
-            if( retRecords.size()-startIndex<(int)size){
-                retRecords = retRecords.subList(startIndex,retRecords.size());
-            }else{
-                retRecords = retRecords.subList(startIndex,endIndex );
+
+
+    /**
+     * @Description:分页数据
+     * @Param: [dataList, pageSize, currentPage]
+     * @return: java.util.List<java.lang.String>
+     * @Author: cy
+     * @Date: 2021/12/2
+     */
+    public static List<GetEntryDefectImproveDTO> page(List<GetEntryDefectImproveDTO> retRecords, int pageSize,int currentPage) {
+        List<GetEntryDefectImproveDTO> currentPageList = new ArrayList<>();
+        if (retRecords != null && retRecords.size() > 0) {
+            int currIdx = (currentPage > 1 ? (currentPage - 1) * pageSize : 0);
+            for (int i = 0; i < pageSize && i < retRecords.size() - currIdx; i++) {
+                GetEntryDefectImproveDTO data = retRecords.get(currIdx + i);
+                currentPageList.add(data);
             }
         }
-        return retRecords;
+        return currentPageList;
     }
-
     /**
      * 内存数据排序 使用JoSQL
    //  * @param list
@@ -299,7 +294,7 @@ public class DataAnalysisFacade {
      */
 
 
-/*    public static<T> List<T> sortList(List<T> list, String orderByString) {
+    public static<T> List<T> sortList(List<T> list, String orderByString) {
         String josql = " select * from " + list.get(0).getClass().getName() + " order by "+ orderByString;
         Query query = new Query();
         try {
@@ -312,7 +307,7 @@ public class DataAnalysisFacade {
             e.printStackTrace();
         }
         return list;
-    }*/
+    }
 
     public Map getEntryTotalMap(List<QcResultDetailInfo> qcResultDetailInfos, Map<String, Long> totalMap) {
         Set<String> totalSet = new HashSet<String>();
@@ -361,6 +356,7 @@ public class DataAnalysisFacade {
 
         public void getEntryDefectImproveByExport (HttpServletResponse response, GetEntryDefectImproveVO
         getEntryDefectImproveVO){
+            getEntryDefectImproveVO.setExportType(1L);
             getEntryDefectImproveVO.setCurrent(1L);
             getEntryDefectImproveVO.setSize(Long.MAX_VALUE);
             getEntryDefectImproveVO.setSearchCount(false);

+ 10 - 0
src/main/java/com/diagbot/vo/GetEntryDefectImproveVO.java

@@ -52,4 +52,14 @@ public class GetEntryDefectImproveVO extends Page {
      */
     private Long exportType = 0L;
 
+    /**
+     * 排序(升序)
+     */
+    private String asc;
+
+    /**
+     * 排序(降序)
+     */
+    private String desc;
+
 }

BIN
src/main/resources/lib/JoSQL-2.2.jar


BIN
src/main/resources/lib/gentlyweb-utils-1.5.jar


+ 2 - 0
src/main/resources/mapper/MedQcresultClickMapper.xml

@@ -9,6 +9,8 @@
         <result column="behospital_code" property="behospitalCode" />
         <result column="dept_id" property="deptId" />
         <result column="dept_name" property="deptName" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="doctor_name" property="doctorName" />
         <result column="qcresult_info_id" property="qcresultInfoId" />
         <result column="cases_entry_ids" property="CasesEntryIds" />
         <result column="gmt_create" property="gmtCreate" />