Browse Source

Merge remote-tracking branch 'origin/master'

lizhenhao 2 years ago
parent
commit
a00d5e9f0b

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApply/mapper/xml/ReportCancellApplyMapper.xml

@@ -101,6 +101,7 @@
         on c.create_by = h.id
         left join cw_project_report_cancell_apply_archived cw_ar
         on a.id = cw_ar.archive_id
+        left join cw_project_report_review cw_rev on c.id = cw_rev.report_id and cw_rev.del_flag = '0'
         left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
         ${ew.customSqlSegment}
         order by a.create_date desc

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/controller/ReportCancellApplyArchivedController.java

@@ -4,18 +4,27 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.DictUtils;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import com.jeeplus.test.cw.reportCancellApplyArchived.service.ReportCancellApplyArchivedService;
 import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ApplyArchiveReportDTO;
 import com.jeeplus.test.cw.reportCancellApplyArchived.service.dto.ArchivedReportInfoDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author: 王强
@@ -90,4 +99,31 @@ public class ReportCancellApplyArchivedController {
     public ApplyArchiveReportDTO findByContractInfoId(@RequestParam String id) {
         return applyService.findByContractInfoId(id);
     }
+    /**
+     * 导出分所报销数据
+     * @param cwProjectReportData
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出报告作废归档数据信息")
+    @GetMapping("export")
+    @ApiOperation(value = "导出报告作废归档数据信息excel")
+    public void exportFile(ArchivedReportInfoDto cwProjectReportData, Page <ArchivedReportInfoDto> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename ( );
+
+        List<ArchivedReportInfoDto> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = applyService.getList ( page, cwProjectReportData ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = applyService.getList ( page, cwProjectReportData ).getRecords().stream ( ).filter ( info ->
+                    options.getSelectIds ( ).contains ( info.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = applyService.getList ( page, cwProjectReportData ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "报告作废归档信息",  options.getSheetName ( ), ArchivedReportInfoDto.class, fileName, response );
+    }
 }

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/mapper/xml/ReportCancellApplyArchivedMapper.xml

@@ -57,6 +57,7 @@
         a.id,
         a.create_by as createById,
         a.create_date,
+        a.create_date as "createDateT",
         a.update_by,
         a.update_date,
         a.del_flag,
@@ -65,6 +66,8 @@
         ifnull(a.apply_file_type,'0') as apply_file_type,
 				a.proc_ins_id,
         a.process_definition_id,
+        b.report_no,
+        b.id as "reportId",
 				c.document_no,
 				c.office_id,
 				d.project_number as projectNumber,

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/ReportCancellApplyArchivedService.java

@@ -109,6 +109,9 @@ public class ReportCancellApplyArchivedService extends ServiceImpl<ReportCancell
         if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
             queryWrapper.like("a.create_by", projectReportData.getCreateBy().getId());
         }
+        if (StringUtils.isNotEmpty(projectReportData.getApplyFileType())) { // 状态筛选
+            queryWrapper.eq("a.apply_file_type", projectReportData.getApplyFileType());
+        }
         //创建时间
         String[] contractDates = projectReportData.getContractDates();
         if (contractDates != null) {

+ 21 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reportCancellApplyArchived/service/dto/ArchivedReportInfoDto.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.cw.reportCancellApplyArchived.service.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.jeeplus.core.service.dto.BaseDTO;
 import lombok.Data;
@@ -24,26 +25,42 @@ public class ArchivedReportInfoDto extends BaseDTO {
     /**
      * 项目编号
      */
+    @Excel(name = "项目编号",width = 25,orderNum = "2")
     private String projectNumber;
 
     /**
      * 创建人
      */
+    @Excel(name = "创建人",width = 10,orderNum = "8")
     private String userName;
 
     /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间",exportFormat = "yyyy-MM-dd",width = 25,orderNum = "9")
+    private String createDateT;
+
+    /**
      * 报告所属部门
      */
+    @Excel(name = "报告所属部门",width = 25,orderNum = "5")
     private String departmentName;
 
     /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
      * 报告文号
      */
+    @Excel(name = "报告文号",width = 25,orderNum = "4")
     private String reportNo;
 
     /**
      * 项目名称
      */
+    @Excel(name = "项目名称",width = 35,orderNum = "3")
     private String projectName;
 
     /**
@@ -59,6 +76,7 @@ public class ArchivedReportInfoDto extends BaseDTO {
     /**
      * 报告申请单号
      */
+    @Excel(name = "单据编号",width = 14,orderNum = "1")
     private String documentNo;
 
     /**
@@ -69,6 +87,7 @@ public class ArchivedReportInfoDto extends BaseDTO {
     /**
      * 项目经理姓名
      */
+    @Excel(name = "项目经理1",width = 10,orderNum = "6")
     private String projectMasterName;
 
     /**
@@ -103,6 +122,7 @@ public class ArchivedReportInfoDto extends BaseDTO {
     /**
      * 报告作废归档状态
      */
+    @Excel(name = "作废归档状态",width = 14,orderNum = "10",dict = "filed_type")
     private String applyFileType;
 
     /**
@@ -127,6 +147,7 @@ public class ArchivedReportInfoDto extends BaseDTO {
      * 项目经理2name
      */
     @TableField(exist = false)
+    @Excel(name = "项目经理2",width = 10,orderNum = "7")
     private String projectMaster2Name;
 
     @TableField(exist = false)

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/mapper/xml/WareHouseBasicMapper.xml

@@ -174,7 +174,7 @@
 			(select sum(collect_number) as collect_number,goods_name,status from material_management_collect_detailed e
 			left join material_management_collect_basics f on e.basic_id = f.id and f.del_flag = 0
 			WHERE f.`status` = 5 and e.collect_type = #{collectTypeId}
-			) b
+			GROUP BY e.goods_name) b
 			on a.trade_name = b.goods_name
 
 			LEFT JOIN material_management_warehouse_basics bas on a.basic_id = bas.id