From 4512a446740b9e14fb97bf32ab6ef73844db9475 Mon Sep 17 00:00:00 2001 From: lijiarao Date: Mon, 24 Jul 2023 13:46:22 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E9=A6=96=E9=A1=B5=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=BA=94=E6=94=B6=E8=B4=A6=E6=AC=BE=E7=BB=9F=E8=AE=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/index/contoller/IndexController.java | 32 +++++++++++++++++ .../entity/AllProjectStatistics.java | 34 +++++++++---------- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java b/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java index 7f3e452f..e5f983d3 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/index/contoller/IndexController.java @@ -15,11 +15,16 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.enmus.ExcelType; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import java.text.DecimalFormat; @@ -132,4 +137,31 @@ public class IndexController { } + @ApiOperation(value = "导出应收账款统计列表") + @GetMapping(value = "/exportUncollectedList") + public ModelAndView exportUncollectedList( + @RequestParam(name="type",defaultValue = "1")String type, + @RequestParam(name="departCode",required = false)String departCode, + @RequestParam(name="column",required = false)String column, + @RequestParam(name="order",required = false)String order) { + + Page page = new Page<>(-1, -1); + HashMap hashMap = indexService.uncollectedList(type,departCode,page,column,order); + IPage pageList = (IPage) hashMap.get("pageList"); + List records = pageList.getRecords(); + + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + String title = "应收账款统计"; + mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.CLASS, AllProjectStatistics.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams=new ExportParams(title, title); + exportParams.setType(ExcelType.XSSF); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS,exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, records); + return mv; + + } + } diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/statistics/entity/AllProjectStatistics.java b/jero-boot-incoming-payment/src/main/java/com/jero/statistics/entity/AllProjectStatistics.java index a5a90b5c..c811e4c2 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/statistics/entity/AllProjectStatistics.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/statistics/entity/AllProjectStatistics.java @@ -22,10 +22,26 @@ public class AllProjectStatistics { @ApiModelProperty(value = "来款项目") private String projectName; + @Excel(name = "项目负责人", width = 15) + @ApiModelProperty(value = "项目负责人") + private String principalName; + + @Excel(name = "科室", width = 15) + @ApiModelProperty(value = "科室") + private String depart; + @Excel(name = "来款单位", width = 15) @ApiModelProperty(value = "来款单位") private String chargeCompanyTemporaryName; + @ApiModelProperty(value = "打包") + private Integer pack; + + @TableField(exist = false) + @Excel(name = "打包", width = 15) + @ApiModelProperty(value = "打包") + private String packText; + @Excel(name = "年度待确收金额", width = 15) @ApiModelProperty(value = "合同金额") private String allMoney; @@ -49,24 +65,6 @@ public class AllProjectStatistics { @ApiModelProperty(value = "来款用途") private String ChargeUse_text; - - @ApiModelProperty(value = "打包") - private Integer pack; - - @TableField(exist = false) - @Excel(name = "打包", width = 15) - @ApiModelProperty(value = "打包") - private String packText; - - @Excel(name = "科室", width = 15) - @ApiModelProperty(value = "科室") - private String depart; - - @Excel(name = "项目负责人", width = 15) - @ApiModelProperty(value = "项目负责人") - private String principalName; - - @Excel(name = "到账时间", width = 15) @ApiModelProperty(value = "到账时间") private String paymentDate;