Просмотр исходного кода

入院记录24小时未填写统计

zhaops 4 лет назад
Родитель
Сommit
055ce318b6

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -107,6 +107,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/unModifyMRPage").permitAll()
                 .antMatchers("/console/reHos31DaysPage").permitAll()
                 .antMatchers("/console/beHosCount").permitAll()
+                .antMatchers("/console/casesEntryStatisticsById").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByCaseAndDept").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByCaseAndDeptPage").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByEntryAndDept").permitAll()

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -150,6 +150,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/unModifyMRPage", request)
                 || matchers("/console/reHos31DaysPage", request)
                 || matchers("/console/beHosCount", request)
+                || matchers("/console/casesEntryStatisticsById", request)
                 || matchers("/consoleByDept/entryCountGroupByCaseAndDept", request)
                 || matchers("/consoleByDept/entryCountGroupByCaseAndDeptPage", request)
                 || matchers("/consoleByDept/entryCountGroupByEntryAndDept", request)

+ 24 - 3
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -1259,9 +1259,30 @@ public class ConsoleFacade {
                 .map(NumDTO::getNum)
                 .reduce(0, Integer::sum);
         globleRecord.setNum(num);
-        globleRecord.setTotleNum(num);
-        globleRecord.setPercent(1d);
-        globleRecord.setPercentStr("100%");
+        records.add(0, globleRecord);
+
+        if (records.size() > filterVO.getLimitCount()) {
+            records = records.subList(0, 10);
+        }
+        return records;
+    }
+
+    /**
+     * 单条条目缺陷统计(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsById(FilterVO filterVO) {
+        filterFacade.filterVOSet(filterVO);
+        List<NumDTO> records = behospitalInfoFacade.casesEntryStatisticsById(filterVO);
+
+        NumDTO globleRecord = new NumDTO();
+        globleRecord.setName("全院");
+        Integer num = records.stream()
+                .map(NumDTO::getNum)
+                .reduce(0, Integer::sum);
+        globleRecord.setNum(num);
         records.add(0, globleRecord);
 
         if (records.size() > filterVO.getLimitCount()) {

+ 8 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -372,4 +372,12 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<NumDTO> beHosCount(FilterVO filterVO);
+
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsById(FilterVO filterVO);
 }

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

@@ -364,4 +364,12 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public List<NumDTO> beHosCount(FilterVO filterVO);
+
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> casesEntryStatisticsById(FilterVO filterVO);
 }

+ 11 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -495,4 +495,15 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public List<NumDTO> beHosCount(FilterVO filterVO) {
         return baseMapper.beHosCount(filterVO);
     }
+
+    /**
+     * 单条条目缺陷统计-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<NumDTO> casesEntryStatisticsById(FilterVO filterVO){
+        return baseMapper.casesEntryStatisticsById(filterVO);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -653,4 +653,19 @@ public class ConsoleController {
     public RespDTO<List<NumDTO>> beHosCount(@RequestBody @Valid FilterVO filterVO) {
         return RespDTO.onSuc(consoleFacade.beHosCount(filterVO));
     }
+
+    /**
+     * 单条条目缺陷统计(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "单条条目缺陷统计(首页)[by:zhaops]",
+            notes = "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>")
+    @PostMapping("/casesEntryStatisticsById")
+    @SysLogger("casesEntryStatisticsById")
+    public RespDTO<List<NumDTO>> casesEntryStatisticsById(@RequestBody @Valid FilterVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.casesEntryStatisticsById(filterVO));
+    }
 }

+ 45 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -7402,4 +7402,49 @@
         AND t.hospitalId = mqi_last.hospital_id
         AND t.lastBehospitalCode = mqi_last.behospital_code
     </select>
+
+
+    <!-- 单条条目缺陷统计-->
+    <select id="casesEntryStatisticsById" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.NumDTO">
+        SELECT
+        a.beh_dept_id AS id,
+        a.beh_dept_name AS NAME,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail 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
+        AND a.qc_type_id != 0
+        and b.cases_entry_id=2658
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            AND ifnull(a.leave_hospital_date ,'') = ''
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+    </select>
 </mapper>