|
@@ -1,30 +1,22 @@
|
|
package com.jeeplus.test.cw.projectReport.controller;
|
|
package com.jeeplus.test.cw.projectReport.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
-import com.alibaba.fastjson.TypeReference;
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
-import com.google.common.collect.Maps;
|
|
|
|
import com.jeeplus.aop.logging.annotation.ApiLog;
|
|
import com.jeeplus.aop.logging.annotation.ApiLog;
|
|
import com.jeeplus.common.redis.RedisUtils;
|
|
import com.jeeplus.common.redis.RedisUtils;
|
|
import com.jeeplus.common.utils.ResponseUtil;
|
|
import com.jeeplus.common.utils.ResponseUtil;
|
|
-import com.jeeplus.flowable.model.Flow;
|
|
|
|
|
|
+import com.jeeplus.core.excel.ExcelOptions;
|
|
|
|
+import com.jeeplus.core.excel.ExportMode;
|
|
|
|
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
|
|
import com.jeeplus.flowable.service.FlowTaskService;
|
|
import com.jeeplus.flowable.service.FlowTaskService;
|
|
import com.jeeplus.sys.constant.enums.LogTypeEnum;
|
|
import com.jeeplus.sys.constant.enums.LogTypeEnum;
|
|
|
|
+import com.jeeplus.sys.utils.DictUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
-import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
|
|
|
|
-import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
|
|
|
|
-import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
|
|
|
|
-import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
|
|
|
|
import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
|
|
import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
|
|
import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
|
|
import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
|
|
-import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper;
|
|
|
|
import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
|
|
import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
|
|
import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
|
|
import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
|
|
-import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
|
|
|
|
import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
|
|
import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
|
|
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
|
|
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
@@ -33,17 +25,18 @@ import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.flowable.engine.TaskService;
|
|
import org.flowable.engine.TaskService;
|
|
-import org.flowable.task.api.Task;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: 王强
|
|
* @author: 王强
|
|
@@ -249,4 +242,47 @@ public class CwProjectReportController {
|
|
String s = "projectReportService.updateSignatureStatusById(data);";
|
|
String s = "projectReportService.updateSignatureStatusById(data);";
|
|
return ResponseEntity.ok(s);
|
|
return ResponseEntity.ok(s);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出分所报销数据
|
|
|
|
+ * @param cwProjectReportData
|
|
|
|
+ * @param page
|
|
|
|
+ * @param response
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @ApiLog("导出报告数据信息")
|
|
|
|
+ @GetMapping("export")
|
|
|
|
+ @ApiOperation(value = "导出报告数据信息excel")
|
|
|
|
+ public void exportFile(CwProjectReportData cwProjectReportData, Page <CwProjectReportData> page, ExcelOptions options, HttpServletResponse response) throws Exception {
|
|
|
|
+ String fileName = options.getFilename ( );
|
|
|
|
+
|
|
|
|
+ List<CwProjectReportData> result;
|
|
|
|
+ if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
|
|
|
|
+ result = projectReportService.findList ( page, cwProjectReportData ).getRecords();
|
|
|
|
+ } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
|
|
|
|
+ result = projectReportService.findList ( page, cwProjectReportData ).getRecords().stream ( ).filter ( info ->
|
|
|
|
+ options.getSelectIds ( ).contains ( info.getId ( ) )
|
|
|
|
+ ).collect ( Collectors.toList ( ) );
|
|
|
|
+ } else {
|
|
|
|
+ page.setSize ( -1 );
|
|
|
|
+ page.setCurrent ( 0 );
|
|
|
|
+ result = projectReportService.findList ( page, cwProjectReportData ).getRecords();
|
|
|
|
+ }
|
|
|
|
+ if(result.size()>0){
|
|
|
|
+ for (CwProjectReportData info : result) {
|
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus())){
|
|
|
|
+ info.setStatus(DictUtils.getDictLabel(info.getStatus(), "cw_status", ""));
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus1())){
|
|
|
|
+ info.setStatus1(DictUtils.getDictLabel(info.getStatus1(), "cw_status", ""));
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus2())){
|
|
|
|
+ info.setStatus1(DictUtils.getDictLabel(info.getStatus2(), "cw_project_report_sign_status", ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ EasyPoiUtil.exportExcel ( result, "报告信息", options.getSheetName ( ), CwProjectReportData.class, fileName, response );
|
|
|
|
+ }
|
|
}
|
|
}
|