|
@@ -1,22 +1,31 @@
|
|
package com.jeeplus.finance.reportCancellApply.controller;
|
|
package com.jeeplus.finance.reportCancellApply.controller;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
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.jeeplus.common.excel.ExcelOptions;
|
|
|
|
+import com.jeeplus.common.excel.annotation.ExportMode;
|
|
import com.jeeplus.common.utils.ResponseUtil;
|
|
import com.jeeplus.common.utils.ResponseUtil;
|
|
|
|
+import com.jeeplus.finance.invoice.util.EasyPoiUtil;
|
|
import com.jeeplus.finance.projectReport.domain.CwProjectReportData;
|
|
import com.jeeplus.finance.projectReport.domain.CwProjectReportData;
|
|
import com.jeeplus.finance.reportCancellApply.service.ReportCancellApplyService;
|
|
import com.jeeplus.finance.reportCancellApply.service.ReportCancellApplyService;
|
|
import com.jeeplus.finance.reportCancellApply.service.dto.ReportInfoDto;
|
|
import com.jeeplus.finance.reportCancellApply.service.dto.ReportInfoDto;
|
|
import com.jeeplus.logging.annotation.ApiLog;
|
|
import com.jeeplus.logging.annotation.ApiLog;
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
import com.jeeplus.logging.constant.enums.LogTypeEnum;
|
|
|
|
+import com.jeeplus.sys.feign.IDictApi;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
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.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author: 王强
|
|
* @author: 王强
|
|
@@ -116,4 +125,45 @@ public class ReportCancellApplyController {
|
|
CwProjectReportData projectReportData = applyService.queryByNo ( no );
|
|
CwProjectReportData projectReportData = applyService.queryByNo ( no );
|
|
return ResponseEntity.ok(projectReportData);
|
|
return ResponseEntity.ok(projectReportData);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出报告报废数据
|
|
|
|
+ * @param reportInfoDto
|
|
|
|
+ * @param page
|
|
|
|
+ * @param response
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @ApiLog("导出报告作废数据信息")
|
|
|
|
+ @GetMapping("export")
|
|
|
|
+ @ApiOperation(value = "导出报告作废数据信息excel")
|
|
|
|
+ public void exportFile(ReportInfoDto reportInfoDto, Page <ReportInfoDto> page, ExcelOptions options, HttpServletResponse response) throws Exception {
|
|
|
|
+ String fileName = options.getFilename ( );
|
|
|
|
+
|
|
|
|
+ List<ReportInfoDto> result;
|
|
|
|
+ if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
|
|
|
|
+ result = applyService.getList ( page, reportInfoDto ).getRecords();
|
|
|
|
+ } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
|
|
|
|
+ result = applyService.getList ( page, reportInfoDto ).getRecords().stream ( ).filter ( info ->
|
|
|
|
+ options.getSelectIds ( ).contains ( info.getId ( ) )
|
|
|
|
+ ).collect ( Collectors.toList ( ) );
|
|
|
|
+ } else {
|
|
|
|
+ page.setSize ( -1 );
|
|
|
|
+ page.setCurrent ( 0 );
|
|
|
|
+ result = applyService.getList ( page, reportInfoDto ).getRecords();
|
|
|
|
+ }
|
|
|
|
+ if(result.size()>0){
|
|
|
|
+ for (ReportInfoDto info : result) {
|
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus())){
|
|
|
|
+ info.setLabelStatus(SpringUtil.getBean ( IDictApi.class ).getDictLabel(info.getStatus(), "cw_status", ""));
|
|
|
|
+ }
|
|
|
|
+ info.setProjectNo("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ EasyPoiUtil.exportExcel ( result, "报告作废信息", options.getSheetName ( ), ReportInfoDto.class, fileName, response );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|