Explorar o código

改善百分比调整

chengyao %!s(int64=3) %!d(string=hai) anos
pai
achega
347fd9dc97

+ 8 - 0
src/main/java/com/diagbot/facade/DataAnalysisDeptFacade.java

@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -49,6 +50,7 @@ public class DataAnalysisDeptFacade {
         entryDefectDeptSet(getEntryDefectImproveDeptVO);
         IPage<GetEntryDefectImproveDeptDTO> page = new Page<>();
         List<GetEntryDefectImproveDeptDTO> getEntryDefectImproveDeptDTOList = new ArrayList<>();
+        DecimalFormat df = new DecimalFormat("#.00");
         //获取标准缺陷信息
         List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
         //查询基础数据源
@@ -77,6 +79,12 @@ public class DataAnalysisDeptFacade {
                         getEntryDefectImproveDeptDTO.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
                     }
                     getEntryDefectImproveDeptDTO.setHandleNum(getEntryDefectImproveDeptDTO.getTotalNum() - getEntryDefectImproveDeptDTO.getImproveleNum());
+                    double handleRatio = 0d;
+                    if(getEntryDefectImproveDeptDTO.getTotalNum()!=0 && getEntryDefectImproveDeptDTO.getHandleNum()!=0){
+                        handleRatio = getEntryDefectImproveDeptDTO.getHandleNum().doubleValue()*100/getEntryDefectImproveDeptDTO.getTotalNum().doubleValue();
+                        String handleStr = df.format(handleRatio)+"%";
+                        getEntryDefectImproveDeptDTO.setHandleStr(handleStr);
+                    }
                     getEntryDefectImproveDeptDTOList.add(getEntryDefectImproveDeptDTO);
                 }
             }

+ 8 - 0
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -206,6 +207,7 @@ public class DataAnalysisFacade {
         int size = (int) getEntryDefectImproveVO.getSize();
         IPage<GetEntryDefectImproveDTO> page = new Page<>();
         entryDefectSet(getEntryDefectImproveVO);
+        DecimalFormat df = new DecimalFormat("#.00");
         List<GetEntryDefectImproveDTO> getEntryDefectImproveDTO = new ArrayList<>();
         //获取标准缺陷信息
         List<GetEntryInfoDTO> entryInfo = medClickInfoService.getBaseMapper().getEntryInfo();
@@ -231,6 +233,12 @@ public class DataAnalysisFacade {
                     getEntryDefectImprove.setImproveleNum(improveleMap.get(stringLongEntry.getKey()));
                 }
                 getEntryDefectImprove.setHandleNum(getEntryDefectImprove.getTotalNum() - getEntryDefectImprove.getImproveleNum());
+                double handleRatio = 0d;
+                if(getEntryDefectImprove.getTotalNum()!=0 && getEntryDefectImprove.getHandleNum()!=0){
+                    handleRatio = getEntryDefectImprove.getHandleNum().doubleValue()*100/getEntryDefectImprove.getTotalNum().doubleValue();
+                    String handleStr = df.format(handleRatio)+"%";
+                    getEntryDefectImprove.setHandleStr(handleStr);
+                }
                 getEntryDefectImproveDTO.add(getEntryDefectImprove);
             }
         }

+ 27 - 23
src/main/resources/mapper/MedClickInfoMapper.xml

@@ -194,23 +194,27 @@
 
     <select id="getEntryDefectImprove" resultMap="entryDefectImproveMap">
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as deptName,
-        a.behospital_code as behospitalCode,
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as deptName,
+        b.behospital_code as behospitalCode,
         a.cases_entry_ids as casesEntryIds
         FROM
-        med_qcresult_click a
+        med_qcresult_click a,
+        med_behospital_info b
         WHERE
         a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.hospital_id =b.hospital_id
+        AND a.behospital_code =b.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            and b.beh_dept_id = #{deptId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name like CONCAT('%',#{deptName},'%')
+            and b.beh_dept_name like CONCAT('%',#{deptName},'%')
         </if>
         <if test="startDate != null and startDate != ''">
             <![CDATA[ AND a.gmt_create >= #{startDate}]]>
@@ -218,7 +222,7 @@
         <if test="endDate != null and endDate != ''">
             <![CDATA[ AND a.gmt_create <= #{endDate}]]>
         </if>
-        order by gmt_create
+        order by a.gmt_create
     </select>
 
     <select id="getEntryDefectImproveInner" resultMap="entryDefectImproveInnerMap">
@@ -227,11 +231,11 @@
         IF( n.age IS NULL,NULL,CONCAT(ifnull(n.age, ''),ifnull(n.age_unit, ''))) AS age
         from (
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as behDeptName,
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as behDeptName,
         b.file_code AS fileCode,
-        a.behospital_code as behospitalCode,
+        b.behospital_code as behospitalCode,
         b.name,
         b.behospital_date AS behospitalDate,
         b.leave_hospital_date AS leaveHospitalDate,
@@ -254,13 +258,13 @@
         AND a.behospital_code =b.behospital_code
         AND a.behospital_code =c.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            and b.beh_dept_id = #{deptId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name = #{deptName}
+            and b.beh_dept_name = #{deptName}
         </if>
         <if test="patName != null and patName != ''">
             and b.name like CONCAT('%',#{patName},'%')
@@ -292,10 +296,10 @@
 
     <select id="getEntryDefectImproveDept" resultMap="entryDefectImproveInnerExportMap">
         SELECT
-        a.hospital_id as hospitalId,
-        a.dept_id as deptId,
-        a.dept_name as deptName,
-        a.behospital_code as behospitalCode,
+        b.hospital_id as hospitalId,
+        b.beh_dept_id as deptId,
+        b.beh_dept_name as deptName,
+        b.behospital_code as behospitalCode,
         b.doctor_id AS doctorId,
         b.doctor_name AS doctorName,
         a.cases_entry_ids as casesEntryIds
@@ -308,13 +312,13 @@
         AND a.hospital_id =b.hospital_id
         AND a.behospital_code =b.behospital_code
         <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
+            AND b.hospital_id = #{hospitalId}
         </if>
         <if test="deptId != null and deptId != ''">
-            and a.dept_id = #{deptId}
+            and b.beh_dept_id = #{deptId}
         </if>
         <if test="deptName != null and deptName != ''">
-            and a.dept_name = #{deptName}
+            and b.beh_dept_name = #{deptName}
         </if>
         <if test="doctorId != null and doctorId != ''">
             and b.doctor_id like CONCAT('%',#{doctorId},'%')