浏览代码

新加申诉列表页和审核列表页导出功能

songxinlu 3 年之前
父节点
当前提交
30f69bc912

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

@@ -271,6 +271,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/appealExamineInfo/getApprovedView").permitAll()
                 .antMatchers("/qc/appealExamineInfo/getAppealReviewDictionary").permitAll()
                 .antMatchers("/qc/appealExamineInfo/getAuditNumber").permitAll()
+                .antMatchers("/qc/appealExamineInfo/getAppealReviewExport").permitAll()
+                .antMatchers("/qc/appealExamineInfo/getComplaintRecordExport").permitAll()
                 .antMatchers("/qc/appealInfo/addAppealInfo").permitAll()
                 .antMatchers("/qc/appealInfo/addAppealInfoApi").permitAll()
                 .antMatchers("/qc/appealInfo/getReviewer").permitAll()

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

@@ -348,6 +348,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/appealExamineInfo/getApprovedView", request)
                 || matchers("/qc/appealExamineInfo/getAppealReviewDictionary", request)
                 || matchers("/qc/appealExamineInfo/getAuditNumber", request)
+                || matchers("/qc/appealExamineInfo/getAppealReviewExport", request)
+                || matchers("/qc/appealExamineInfo/getComplaintRecordExport", request)
                 || matchers("/qc/appealInfo/addAppealInfo", request)
                 || matchers("/qc/appealInfo/addAppealInfoApi", request)
                 || matchers("/qc/appealInfo/getReviewer", request)

+ 59 - 0
src/main/java/com/diagbot/dto/ExportGetAppealReviewDTO.java

@@ -0,0 +1,59 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 审核excle
+ *
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class ExportGetAppealReviewDTO {
+
+    @Excel(name = "申述id", needMerge = true)
+    private Long id;
+
+    @Excel(name = "申述人", needMerge = true)
+    private String claimantName;
+
+    @Excel(name = "所属科室", needMerge = true)
+    private String behDeptName;
+
+    @Excel(name = "病人住院序号", needMerge = true)
+    private String behospitalCode;
+
+    @Excel(name = "患者姓名", needMerge = true)
+    private String name;
+
+    @Excel(name = "申述模块", needMerge = true)
+    private String casesName;
+
+    @Excel(name = "缺陷详情", needMerge = true)
+    private String qcresultDetailMsg;
+
+    @ApiModelProperty(value = "审核人")
+    @Excel(name = "缺陷详情", needMerge = true)
+    private String checkName;
+
+    @Excel(name = "申述申诉时间", needMerge = true, exportFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date claimantGmtCreate;
+
+    @Excel(name = "审核时间", needMerge = true, exportFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date checkGmtCreate;
+
+    @Excel(name = "操作类型", needMerge = true, replace = {"删改_0","新增已有_1","新增缺失_2","恢复条目_3"})
+    private String appealOperationType;
+
+    @Excel(name = "状态", needMerge = true, replace = {"待审核_0","已驳回_1","审核通过_2"})
+    private String exampleStatus;
+
+}

+ 58 - 0
src/main/java/com/diagbot/dto/ExportGetComplaintRecordDTO.java

@@ -0,0 +1,58 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 申述记录excle
+ * @Description:
+ * @author: cy
+ * @time: 2020/9/4 14:59
+ */
+@Getter
+@Setter
+public class ExportGetComplaintRecordDTO {
+
+    @Excel(name = "申述id", needMerge = true)
+    private Long id;
+
+    @Excel(name = "申述人", needMerge = true)
+    private String claimantName;
+
+    @Excel(name = "所属科室", needMerge = true)
+    private String behDeptName;
+
+    @Excel(name = "病人住院序号", needMerge = true)
+    private String behospitalCode;
+
+    @Excel(name = "患者姓名", needMerge = true)
+    private String name;
+
+    @Excel(name = "申述模块", needMerge = true)
+    private String casesName;
+
+    @Excel(name = "缺陷详情", needMerge = true)
+    private String qcresultDetailMsg;
+
+    @ApiModelProperty(value = "审核人")
+    @Excel(name = "缺陷详情", needMerge = true)
+    private String checkName;
+
+    @Excel(name = "申述申诉时间", needMerge = true, exportFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date claimantGmtCreate;
+
+    @Excel(name = "审核时间", needMerge = true, exportFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date checkGmtCreate;
+
+    @Excel(name = "操作类型", needMerge = true, replace = {"删改_0","新增已有_1","新增缺失_2","恢复条目_3"})
+    private String appealOperationType;
+
+    @Excel(name = "状态", needMerge = true, replace = {"待审核_0","已驳回_1","审核通过_2"})
+    private String exampleStatus;
+}

+ 40 - 0
src/main/java/com/diagbot/facade/MedAppealExamineInfoManagementFacade.java

@@ -3,8 +3,17 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.MedAppealExamineInfoServiceClient;
 import com.diagbot.dto.AnalyzeDTO;
 
+import com.diagbot.dto.ExportExcelByDeptDTO;
+import com.diagbot.dto.ExportGetAppealReviewDTO;
+import com.diagbot.dto.ExportGetComplaintRecordDTO;
+import com.diagbot.dto.ExportSevenByDeptDTO;
+import com.diagbot.dto.GetAppealReviewDTO;
+import com.diagbot.dto.GetComplaintRecordDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.MedAppealExamineInfo;
 import com.diagbot.entity.MedAppealInfo;
 
@@ -15,15 +24,24 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedAppealExamineInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ApprovedVo;
+import com.diagbot.vo.GetAppealReviewVO;
+import com.diagbot.vo.GetComplaintRecordVO;
 import com.diagbot.vo.QcResultAlgVO;
+import com.diagbot.vo.QcResultShortPageVO;
 import com.diagbot.vo.QcresultVO;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @Description:申述记录
@@ -202,4 +220,26 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
             return false;
         }
     }
+
+    public void getAppealReviewExport(HttpServletResponse response, GetAppealReviewVO getAppealReviewVO, MedAppealExamineInfoServiceClient medAppealExamineInfoServiceClient) {
+        getAppealReviewVO.setCurrent(1L);
+        getAppealReviewVO.setSize(Long.MAX_VALUE);
+        getAppealReviewVO.setSearchCount(false);
+        RespDTO<Page<GetAppealReviewDTO>> appealReview = medAppealExamineInfoServiceClient.getAppealReview(getAppealReviewVO);
+        //格式转换
+        List<ExportGetAppealReviewDTO> out = BeanUtil.listCopyTo(appealReview.data.getRecords(),ExportGetAppealReviewDTO.class);
+        String fileName = "申诉审核.xls";
+        ExcelUtils.exportExcelUser(out, null, "sheet1", ExportGetAppealReviewDTO.class, fileName, response);
+    }
+
+    public void getComplaintRecordExport(HttpServletResponse response, GetComplaintRecordVO getComplaintRecordVO, MedAppealExamineInfoServiceClient medAppealExamineInfoServiceClient) {
+        getComplaintRecordVO.setCurrent(1L);
+        getComplaintRecordVO.setSize(Long.MAX_VALUE);
+        getComplaintRecordVO.setSearchCount(false);
+        RespDTO<Page<GetComplaintRecordDTO>> complaintRecord = medAppealExamineInfoServiceClient.getComplaintRecord(getComplaintRecordVO);
+        //格式转换
+        List<ExportGetComplaintRecordDTO> out = BeanUtil.listCopyTo(complaintRecord.data.getRecords(),ExportGetComplaintRecordDTO.class);
+        String fileName = "申诉记录.xls";
+        ExcelUtils.exportExcelUser(out, null, "sheet1", ExportGetComplaintRecordDTO.class, fileName, response);
+    }
 }

+ 26 - 0
src/main/java/com/diagbot/web/MedAppealExamineInfoController.java

@@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -139,4 +141,28 @@ public class MedAppealExamineInfoController {
         getAuditNumberVO.setId(Long.valueOf(userId));
         return RespDTO.onSuc(medAppealExamineInfoServiceClient.getAuditNumber(getAuditNumberVO));
     }
+
+
+    @ApiOperation(value = "申诉记录导出[by:songxl]")
+    @PostMapping("/getComplaintRecordExport")
+    @SysLogger("getComplaintRecordExport")
+    public void getComplaintRecordExport(HttpServletResponse response, @RequestBody @Valid GetComplaintRecordVO getComplaintRecordVO) {
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        getComplaintRecordVO.setHospitalId(Long.valueOf(hospitalId));
+        getComplaintRecordVO.setComplaintId(Long.valueOf(userId));
+        medAppealExamineInfoManagementFacade.getComplaintRecordExport(response, getComplaintRecordVO,medAppealExamineInfoServiceClient);
+    }
+
+    @ApiOperation(value = "申诉审核导出[by:songxl]")
+    @PostMapping("/getAppealReviewExport")
+    @SysLogger("getAppealReviewExport")
+    public void getAppealReviewExport(HttpServletResponse response, @RequestBody @Valid GetAppealReviewVO getAppealReviewVO) {
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        getAppealReviewVO.setHospitalId(Long.valueOf(hospitalId));
+        getAppealReviewVO.setAppealId(Long.valueOf(userId));
+        medAppealExamineInfoManagementFacade.getAppealReviewExport(response, getAppealReviewVO,medAppealExamineInfoServiceClient);
+    }
+
 }