Forráskód Böngészése

配合演示的操作日志&&历史评分

zhanghang 3 éve
szülő
commit
6631152efa

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

@@ -289,6 +289,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/analysisDept/getEntryDefectImproveByDeptExport").permitAll()
                 .antMatchers("/qc/analysisDept/getEntryDefectImproveInnerDept").permitAll()
                 .antMatchers("/qc/analysisDept/getDefectImproveInnerByDeptExport").permitAll()
+                .antMatchers("/qc/behospitalInfo/historyAnalyze").permitAll()
+                .antMatchers("/qc/behospitalInfo/operationLog").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -341,6 +341,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/analysisDept/getEntryDefectImproveByDeptExport", request)
                 || matchers("/qc/analysisDept/getEntryDefectImproveInnerDept", request)
                 || matchers("/qc/analysisDept/getDefectImproveInnerByDeptExport", request)
+                || matchers("/qc/behospitalInfo/historyAnalyze", request)
+                || matchers("/qc/behospitalInfo/operationLog", request)
                 || matchers("/", request)) {
             return true;
         }

+ 38 - 0
src/main/java/com/diagbot/dto/QcCasesHistoryDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/12 13:58
+ */
+@Getter
+@Setter
+public class QcCasesHistoryDTO {
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 评分人
+     */
+    private String name;
+
+    /**
+     * 模块总分
+     */
+    private BigDecimal scoreRes;
+
+    /**
+     * 病历等级
+     */
+    private String level;
+
+}

+ 52 - 0
src/main/java/com/diagbot/entity/operationLog.java

@@ -0,0 +1,52 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院科室信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-27
+ */
+@Data
+public class operationLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 序号
+     */
+    private String id;
+    /**
+     * 操作时间
+     */
+    private String gmtCreate;
+    /**
+     * 操作类型
+     */
+    private String Type;
+    /**
+     * 操作模块
+     */
+    private String module;
+    /**
+     * 操作账号
+     */
+    private String account;
+    /**
+     * IP地址
+     */
+    private String IPAddress;
+    /**
+     * 操作内容
+     */
+    private String content;
+
+
+}

+ 47 - 1
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -18,6 +18,7 @@ import com.diagbot.service.impl.MedClickInfoServiceImpl;
 import com.diagbot.service.impl.StrInformedConsentServiceImpl;
 import com.diagbot.util.*;
 import com.diagbot.vo.*;
+import com.fasterxml.jackson.databind.exc.InvalidFormatException;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.apache.commons.lang3.StringUtils;
@@ -28,12 +29,18 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.text.ParseException;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.diagbot.util.ReadExcelUtils.read2007Xlsx;
+
 /**
  * @Description:
  * @author: zhoutg
@@ -154,7 +161,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     QcresultDetailFacade qcresultDetailFacade;
 
 
-
     /**
      * 分页
      *
@@ -2580,4 +2586,44 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
         return qcresultDetails;
     }
+
+    /**
+     * 评分历史
+     * @param behospitalCode
+     * @return
+     */
+    public List<QcCasesHistoryDTO> getHistoryAnalyze(String behospitalCode) {
+        Long hospitalID =Long.valueOf(SysUserUtils.getCurrentHospitalID());
+        List<QcCasesHistoryDTO> medQcresultResultList = qcresultInfoFacade.getMedQcresultResultList(hospitalID, behospitalCode);
+
+        return medQcresultResultList;
+    }
+
+    /**
+     * 操作日志
+     * @param behospitalCode
+     * @throws InvalidFormatException
+     * @throws IOException
+     * @throws ParseException
+     */
+    public List<operationLog> getOperationLog(String behospitalCode){
+        String fullFileName = "src\\main\\resources\\操作日志.xlsx";
+        List<operationLog> list = new ArrayList<>();
+        try {
+            InputStream is = new FileInputStream(fullFileName);
+            list = read2007Xlsx(is);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        System.out.println("size==>" + list.size());
+        return list;
+        //  获取resource目录下的 41473.xlsx 文件:
+//        String resource = "41473.xlsx";
+//        ClassPathResource classPathResource = new ClassPathResource(resource);
+//        List<Order> list = read2007Xlsx(classPathResource.getInputStream());
+//        System.out.println("size==>" + list.size());
+    }
+
+
+
 }

+ 11 - 1
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.AlgorithmDTO;
 import com.diagbot.dto.AnalyzeDTO;
+import com.diagbot.dto.QcCasesHistoryDTO;
 import com.diagbot.dto.QcResultDTO;
 import com.diagbot.entity.BehospitalInfo;
-import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.entity.MedQcresultCases;
 import com.diagbot.entity.QcresultDetail;
 import com.diagbot.entity.QcresultInfo;
@@ -425,4 +425,14 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         }
         return res;
     }
+
+    /**
+     * 历史评分
+     * @param hospitalId
+     * @param behospitalCode
+     * @return
+     */
+    public List<QcCasesHistoryDTO> getMedQcresultResultList(Long hospitalId ,String behospitalCode){
+        return getMedQcresultResult(hospitalId,behospitalCode);
+    }
 }

+ 9 - 7
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -2,13 +2,7 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.DeptEntryNumDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultPercentDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
@@ -213,4 +207,12 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
+
+    /**
+     * 历史评分
+     * @param hospitalId
+     * @param behospitalCode
+     * @return
+     */
+    public List<QcCasesHistoryDTO> getMedQcresultResult(@Param("hospitalId") Long hospitalId, @Param("behospitalCode") String behospitalCode);
 }

+ 9 - 7
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -2,13 +2,7 @@ package com.diagbot.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.DeptEntryNumDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultPercentDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;
@@ -188,4 +182,12 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @return
      */
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
+
+    /**
+     * 历史评分
+     * @param hospitalId
+     * @param behospitalInfo
+     * @return
+     */
+    public List<QcCasesHistoryDTO> getMedQcresultResult(Long hospitalId , String behospitalInfo);
 }

+ 12 - 7
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -2,13 +2,7 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.dto.AverageStatisticsDTO;
-import com.diagbot.dto.DeptEntryNumDTO;
-import com.diagbot.dto.DeptNumDTO;
-import com.diagbot.dto.EntryNumDTO;
-import com.diagbot.dto.EntryNumGroupDTO;
-import com.diagbot.dto.NumDTO;
-import com.diagbot.dto.QcResultPercentDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.mapper.QcresultInfoMapper;
 import com.diagbot.service.QcresultInfoService;
@@ -289,4 +283,15 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
         return baseMapper.qcResultLevelPercent(filterVO);
     }
+
+    /**
+     * 历史评分
+     * @param hospitalId
+     * @param behospitalCode
+     * @return
+     */
+    @Override
+    public List<QcCasesHistoryDTO> getMedQcresultResult(Long hospitalId , String behospitalCode){
+        return baseMapper.getMedQcresultResult(hospitalId,behospitalCode);
+    }
 }

+ 55 - 0
src/main/java/com/diagbot/util/ReadExcelUtils.java

@@ -0,0 +1,55 @@
+package com.diagbot.util;
+
+import com.diagbot.entity.operationLog;
+import com.fasterxml.jackson.databind.exc.InvalidFormatException;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ReadExcelUtils {
+    public static List<operationLog> read2007Xlsx(InputStream in) throws IOException, InvalidFormatException, ParseException {
+
+        List<operationLog> list = new ArrayList<>();
+        XSSFWorkbook xWorkbook = new XSSFWorkbook(in);
+        // Read the Sheet
+        XSSFSheet xssfSheet = xWorkbook.getSheetAt(0);
+
+        // Read the Row
+        for (int rowNum = 1; rowNum <= xssfSheet.getLastRowNum(); rowNum++) {
+            XSSFRow xssfRow = xssfSheet.getRow(rowNum);
+            if (xssfRow != null) {
+                operationLog operationLog =new operationLog();
+                // 单元格从 0 开始
+                xssfRow.getCell(0).setCellType(CellType.STRING);
+                xssfRow.getCell(1).setCellType(CellType.STRING);
+                xssfRow.getCell(2).setCellType(CellType.STRING);
+                xssfRow.getCell(3).setCellType(CellType.STRING);
+                xssfRow.getCell(4).setCellType(CellType.STRING);
+                xssfRow.getCell(5).setCellType(CellType.STRING);
+                xssfRow.getCell(6).setCellType(CellType.STRING);
+                operationLog.setId(xssfRow.getCell(0).getStringCellValue());
+                operationLog.setGmtCreate(xssfRow.getCell(1).getStringCellValue());
+                operationLog.setType(xssfRow.getCell(2).getStringCellValue());
+                operationLog.setModule(xssfRow.getCell(3).getStringCellValue());
+                operationLog.setAccount(xssfRow.getCell(4).getStringCellValue());
+                operationLog.setIPAddress(xssfRow.getCell(5).getStringCellValue());
+                operationLog.setContent(xssfRow.getCell(6).getStringCellValue());
+                list.add(operationLog);
+
+            }
+
+        }
+
+        xWorkbook.close();
+        return list;
+    }
+
+}

+ 18 - 1
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -3,7 +3,7 @@ package com.diagbot.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.*;
-import com.diagbot.entity.QcCasesRelevanceEntry;
+import com.diagbot.entity.operationLog;
 import com.diagbot.facade.BehospitalInfoFacade;
 import com.diagbot.facade.QcresultInfoFacade;
 import com.diagbot.vo.*;
@@ -284,5 +284,22 @@ public class BehospitalInfoController {
         return RespDTO.onSuc(behospitalInfoFacade.analyzeCds(analyzeCdsVO));
     }
 
+    @ApiOperation(value = "历史评分[by:zhanghang]",
+            notes = "behospitalCode:病人住院序号<br>")
+    @PostMapping("/historyAnalyze")
+    @SysLogger("historyAnalyze")
+    @Transactional
+    public RespDTO<List<QcCasesHistoryDTO>> historyAnalyze(@RequestBody String behospitalCode) {
+        return RespDTO.onSuc(behospitalInfoFacade.getHistoryAnalyze(behospitalCode));
+    }
+
+    @ApiOperation(value = "操作日志[by:zhanghang]",
+            notes = "")
+    @PostMapping("/operationLog")
+    @SysLogger("operationLog")
+    @Transactional
+    public RespDTO<List<operationLog>> operationLog(@RequestBody String behospitalCode)  {
+        return RespDTO.onSuc(behospitalInfoFacade.getOperationLog(behospitalCode));
+    }
 
 }

+ 23 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -2440,4 +2440,27 @@
         ) t2
         )t
     </select>
+    <select id="getMedQcresultResult" resultType="com.diagbot.dto.QcCasesHistoryDTO">
+            SELECT
+                a.gmt_modified,
+                a.behospital_code,
+                a.score_res,
+                a.`level`,
+              IFNULL(b.linkman,"系统评分") as name
+            FROM
+                (
+                    SELECT
+                        a.gmt_modified,
+                        a.behospital_code,
+                        a.score_res,
+                        a.`level`,
+                        a.modifier
+                    FROM
+                        med_qcresult_info a
+                    WHERE
+                        a.behospital_code = #{behospitalCode}
+                    AND a.hospital_id = #{hospitalId}
+                ) a
+            LEFT JOIN sys_user b ON a.modifier = b.id
+    </select>
 </mapper>

BIN
src/main/resources/操作日志.xlsx