diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 81cb72b6..46be3847 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -559,6 +559,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), + @ApiImplicitParam(name = "provideDept", value = "提供部门", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java index bdeba7c3..07453a75 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java @@ -42,7 +42,7 @@ public class TMeetingroomBookDTO implements Serializable { private Date createDate; @ApiModelProperty(value = "创建者") private Long creator; - @ApiModelProperty(value = "审核状态,审核时传,2-通过,3-不通过") + @ApiModelProperty(value = "审核状态,审核时传,默认0为待审核,2-通过,3-不通过") private Integer state; @ApiModelProperty(value = "审核意见") private String auditViem; diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index fbceb8f9..3c73dcf4 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -7,6 +7,7 @@ import io.renren.common.annotation.LogOperation; import io.renren.common.constant.Constant; import io.renren.common.page.PageData; import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.DateUtils; import io.renren.common.utils.ExcelUtils; import io.renren.common.utils.Result; import io.renren.common.validator.AssertUtils; @@ -54,6 +55,8 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.URLEncoder; import java.time.LocalDateTime; import java.util.*; @@ -482,6 +485,7 @@ public class TAbilityApplicationController { @ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "applyResult", value = "审核状态", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", dataType = "INTEGER"), @ApiImplicitParam(name = "pageSize", value = "页数大小", paramType = "query", dataType = "INTEGER") }) @@ -497,11 +501,15 @@ public class TAbilityApplicationController { @ApiImplicitParam(name = "provideDept", value = "提供部门", paramType = "query", dataType = "Long"), @ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "applyResult", value = "审核状态", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String") }) public void exportFundStatementTable(@RequestParam Map params, HttpServletResponse response) throws IOException { List resultList = (List) tAbilityApplicationService.exportFundStatementTable(params); + BigDecimal decimal = new BigDecimal(tAbilityApplicationDao.getFundStatementSum(params)); + BigDecimal divide = decimal.divide(new BigDecimal("10000")); + divide.setScale(1, RoundingMode.HALF_UP); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString()); @@ -514,29 +522,25 @@ public class TAbilityApplicationController { }).collect(Collectors.toList()); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); - String fileName = URLEncoder.encode("资金报表", "UTF-8"); + String fileName = URLEncoder.encode("UCS节约资金报表" + DateUtils.format(new Date(), "yyyyMMdd"), "UTF-8"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - EasyExcel.write(response.getOutputStream()).head(exportSelectCensusApplyTableHead()) + EasyExcel.write(response.getOutputStream()).head(exportSelectCensusApplyTableHead(divide)) .registerWriteHandler(new CustomCellWriteWeightConfig()) .registerWriteHandler(new CustomCellWriteHeightConfig()) .sheet("资金报表").doWrite(date); } - private List> exportSelectCensusApplyTableHead() { + private List> exportSelectCensusApplyTableHead(BigDecimal priceTotal) { + + String total = "累计节省财政资金约" + priceTotal + "万元"; List> list = new ArrayList<>(); - List head0 = new ArrayList<>(); - head0.add("资源名称"); - List head1 = new ArrayList<>(); - head1.add("类型"); - List head2 = new ArrayList<>(); - head2.add("提供部门"); - List head3 = new ArrayList<>(); - head3.add("申请部门"); - List head4 = new ArrayList<>(); - head4.add("申请时间"); - List head5 = new ArrayList<>(); - head5.add("参考价格"); + List head0 = new ArrayList<>(Arrays.asList(total, "资源名称")); + List head1 = new ArrayList<>(Arrays.asList(total, "类型")); + List head2 = new ArrayList<>(Arrays.asList(total, "提供部门")); + List head3 = new ArrayList<>(Arrays.asList(total, "申请部门")); + List head4 = new ArrayList<>(Arrays.asList(total, "申请时间")); + List head5 = new ArrayList<>(Arrays.asList(total, "参考价格(元)")); list.add(head0); list.add(head1); list.add(head2); diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 61932cac..a020b545 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -364,7 +364,14 @@ LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id WHERE 1 = 1 - AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status = #{params.applyResult} + + AND taa.del_flag = 0 AND tdr.del_flag = 0 @@ -383,7 +390,7 @@ AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') - AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN tda.attr_value ELSE tdr.type END ) = #{params.resourceType} + AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType} UNION ALL @@ -400,6 +407,17 @@ LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id WHERE tm.del_flag = 0 + + + AND tmb.state = 0 + + + AND tmb.state = 2 + + + AND tmb.state IN (0, 2) + + AND tmb.create_date >= #{params.startDate} @@ -418,7 +436,8 @@ AND '会客厅' = #{params.resourceType} - ORDER BY applyDate + + ORDER BY applyDate DESC LIMIT ${params.pageNum}, ${params.pageSize} @@ -433,7 +452,14 @@ LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id WHERE 1 = 1 - AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status = #{params.applyResult} + + AND taa.del_flag = 0 AND tdr.del_flag = 0 @@ -452,7 +478,7 @@ AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') - AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN tda.attr_value ELSE tdr.type END ) = #{params.resourceType} + AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType} UNION ALL @@ -463,6 +489,17 @@ LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id WHERE tm.del_flag = 0 + + + AND tmb.state = 0 + + + AND tmb.state = 2 + + + AND tmb.state IN (0, 2) + + AND tmb.create_date >= #{params.startDate} @@ -500,7 +537,14 @@ LEFT JOIN ( SELECT data_resource_id, attr_type, attr_value FROM tb_data_attr tda WHERE del_flag = 0 AND attr_type = '组件类型' ) attr ON tdr.id = attr.data_resource_id WHERE 1 = 1 - AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status IN ( '审核中', '通过' ) + + + AND taa.approve_status = #{params.applyResult} + + AND taa.del_flag = 0 AND tdr.del_flag = 0 @@ -519,7 +563,7 @@ AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') - AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN tda.attr_value ELSE tdr.type END ) = #{params.resourceType} + AND ( CASE tdr.type WHEN '应用资源' THEN tdr.type WHEN '组件服务' THEN attr.attr_value ELSE tdr.type END ) = #{params.resourceType} UNION ALL @@ -536,6 +580,17 @@ LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id WHERE tm.del_flag = 0 + + + AND tmb.state = 0 + + + AND tmb.state = 2 + + + AND tmb.state IN (0, 2) + + AND tmb.create_date >= #{params.startDate} @@ -554,7 +609,7 @@ AND '会客厅' = #{params.resourceType} - ORDER BY applyDate + ORDER BY applyDate DESC