Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-11-23 17:02:26 +08:00
commit b278681f47
5 changed files with 110 additions and 26 deletions

View File

@ -559,6 +559,7 @@ public class CensusController {
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @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 = "resourceName", value = "资源名称", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
}) })

View File

@ -42,7 +42,7 @@ public class TMeetingroomBookDTO implements Serializable {
private Date createDate; private Date createDate;
@ApiModelProperty(value = "创建者") @ApiModelProperty(value = "创建者")
private Long creator; private Long creator;
@ApiModelProperty(value = "审核状态,审核时传,2-通过3-不通过") @ApiModelProperty(value = "审核状态,审核时传,默认0为待审核2-通过3-不通过")
private Integer state; private Integer state;
@ApiModelProperty(value = "审核意见") @ApiModelProperty(value = "审核意见")
private String auditViem; private String auditViem;

View File

@ -7,6 +7,7 @@ import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant; import io.renren.common.constant.Constant;
import io.renren.common.page.PageData; import io.renren.common.page.PageData;
import io.renren.common.utils.ConvertUtils; import io.renren.common.utils.ConvertUtils;
import io.renren.common.utils.DateUtils;
import io.renren.common.utils.ExcelUtils; import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils; import io.renren.common.validator.AssertUtils;
@ -54,6 +55,8 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -482,6 +485,7 @@ public class TAbilityApplicationController {
@ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "resourceName", 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 = "pageNum", value = "页码", paramType = "query", dataType = "INTEGER"),
@ApiImplicitParam(name = "pageSize", 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 = "provideDept", value = "提供部门", paramType = "query", dataType = "Long"),
@ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "resourceType", 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") @ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String")
}) })
public void exportFundStatementTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException { public void exportFundStatementTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
List<Map> resultList = (List<Map>) tAbilityApplicationService.exportFundStatementTable(params); List<Map> resultList = (List<Map>) tAbilityApplicationService.exportFundStatementTable(params);
BigDecimal decimal = new BigDecimal(tAbilityApplicationDao.getFundStatementSum(params));
BigDecimal divide = decimal.divide(new BigDecimal("10000"));
divide.setScale(1, RoundingMode.HALF_UP);
List<List<Object>> date = resultList.stream().map(index -> { List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>(); List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString()); data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString());
@ -514,29 +522,25 @@ public class TAbilityApplicationController {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); 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"); 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 CustomCellWriteWeightConfig())
.registerWriteHandler(new CustomCellWriteHeightConfig()) .registerWriteHandler(new CustomCellWriteHeightConfig())
.sheet("资金报表").doWrite(date); .sheet("资金报表").doWrite(date);
} }
private List<List<String>> exportSelectCensusApplyTableHead() { private List<List<String>> exportSelectCensusApplyTableHead(BigDecimal priceTotal) {
String total = "累计节省财政资金约" + priceTotal + "万元";
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
List<String> head0 = new ArrayList<>(); List<String> head0 = new ArrayList<>(Arrays.asList(total, "资源名称"));
head0.add("资源名称"); List<String> head1 = new ArrayList<>(Arrays.asList(total, "类型"));
List<String> head1 = new ArrayList<>(); List<String> head2 = new ArrayList<>(Arrays.asList(total, "提供部门"));
head1.add("类型"); List<String> head3 = new ArrayList<>(Arrays.asList(total, "申请部门"));
List<String> head2 = new ArrayList<>(); List<String> head4 = new ArrayList<>(Arrays.asList(total, "申请时间"));
head2.add("提供部门"); List<String> head5 = new ArrayList<>(Arrays.asList(total, "参考价格(元)"));
List<String> head3 = new ArrayList<>();
head3.add("申请部门");
List<String> head4 = new ArrayList<>();
head4.add("申请时间");
List<String> head5 = new ArrayList<>();
head5.add("参考价格");
list.add(head0); list.add(head0);
list.add(head1); list.add(head1);
list.add(head2); list.add(head2);

View File

@ -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 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 WHERE
1 = 1 1 = 1
AND taa.approve_status IN ( '审核中', '通过' ) <choose>
<when test="params.applyResult == null or params.applyResult == ''">
AND taa.approve_status IN ( '审核中', '通过' )
</when>
<otherwise>
AND taa.approve_status = #{params.applyResult}
</otherwise>
</choose>
AND taa.del_flag = 0 AND taa.del_flag = 0
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
@ -383,7 +390,7 @@
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
</if> </if>
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
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}
</if> </if>
UNION ALL UNION ALL
@ -400,6 +407,17 @@
LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id
WHERE WHERE
tm.del_flag = 0 tm.del_flag = 0
<choose>
<when test="params.applyResult == '审核中'">
AND tmb.state = 0
</when>
<when test="params.applyResult == '通过'">
AND tmb.state = 2
</when>
<otherwise>
AND tmb.state IN (0, 2)
</otherwise>
</choose>
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
AND tmb.create_date >= #{params.startDate} AND tmb.create_date >= #{params.startDate}
</if> </if>
@ -418,7 +436,8 @@
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
AND '会客厅' = #{params.resourceType} AND '会客厅' = #{params.resourceType}
</if> </if>
ORDER BY applyDate
ORDER BY applyDate DESC
LIMIT ${params.pageNum}, ${params.pageSize} LIMIT ${params.pageNum}, ${params.pageSize}
</select> </select>
@ -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 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 WHERE
1 = 1 1 = 1
AND taa.approve_status IN ( '审核中', '通过' ) <choose>
<when test="params.applyResult == null or params.applyResult == ''">
AND taa.approve_status IN ( '审核中', '通过' )
</when>
<otherwise>
AND taa.approve_status = #{params.applyResult}
</otherwise>
</choose>
AND taa.del_flag = 0 AND taa.del_flag = 0
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
@ -452,7 +478,7 @@
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
</if> </if>
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
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}
</if> </if>
UNION ALL UNION ALL
@ -463,6 +489,17 @@
LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id
WHERE WHERE
tm.del_flag = 0 tm.del_flag = 0
<choose>
<when test="params.applyResult == '审核中'">
AND tmb.state = 0
</when>
<when test="params.applyResult == '通过'">
AND tmb.state = 2
</when>
<otherwise>
AND tmb.state IN (0, 2)
</otherwise>
</choose>
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
AND tmb.create_date >= #{params.startDate} AND tmb.create_date >= #{params.startDate}
</if> </if>
@ -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 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 WHERE
1 = 1 1 = 1
AND taa.approve_status IN ( '审核中', '通过' ) <choose>
<when test="params.applyResult == null or params.applyResult == ''">
AND taa.approve_status IN ( '审核中', '通过' )
</when>
<otherwise>
AND taa.approve_status = #{params.applyResult}
</otherwise>
</choose>
AND taa.del_flag = 0 AND taa.del_flag = 0
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
@ -519,7 +563,7 @@
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
</if> </if>
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
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}
</if> </if>
UNION ALL UNION ALL
@ -536,6 +580,17 @@
LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id
WHERE WHERE
tm.del_flag = 0 tm.del_flag = 0
<choose>
<when test="params.applyResult == '审核中'">
AND tmb.state = 0
</when>
<when test="params.applyResult == '通过'">
AND tmb.state = 2
</when>
<otherwise>
AND tmb.state IN (0, 2)
</otherwise>
</choose>
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
AND tmb.create_date >= #{params.startDate} AND tmb.create_date >= #{params.startDate}
</if> </if>
@ -554,7 +609,7 @@
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
AND '会客厅' = #{params.resourceType} AND '会客厅' = #{params.resourceType}
</if> </if>
ORDER BY applyDate ORDER BY applyDate DESC
</select> </select>
<select id="getFundStatementCount" resultType="java.lang.Long"> <select id="getFundStatementCount" resultType="java.lang.Long">
@ -568,7 +623,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 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 WHERE
1 = 1 1 = 1
AND taa.approve_status IN ( '审核中', '通过' ) <choose>
<when test="params.applyResult == null or params.applyResult == ''">
AND taa.approve_status IN ( '审核中', '通过' )
</when>
<otherwise>
AND taa.approve_status = #{params.applyResult}
</otherwise>
</choose>
AND taa.del_flag = 0 AND taa.del_flag = 0
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
@ -587,7 +649,7 @@
AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%') AND tdr.NAME LIKE CONCAT('%', #{params.resourceName} ,'%')
</if> </if>
<if test = "params.resourceType != null and params.resourceType != ''" > <if test = "params.resourceType != null and params.resourceType != ''" >
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}
</if> </if>
UNION ALL UNION ALL
@ -600,6 +662,17 @@
LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id LEFT JOIN t_meetingroom tm ON tmb.room_id = tm.id
WHERE WHERE
tm.del_flag = 0 tm.del_flag = 0
<choose>
<when test="params.applyResult == '审核中'">
AND tmb.state = 0
</when>
<when test="params.applyResult == '通过'">
AND tmb.state = 2
</when>
<otherwise>
AND tmb.state IN (0, 2)
</otherwise>
</choose>
<if test = "params.startDate != null and params.startDate != ''" > <if test = "params.startDate != null and params.startDate != ''" >
AND tmb.create_date >= #{params.startDate} AND tmb.create_date >= #{params.startDate}
</if> </if>

View File

@ -2018,6 +2018,9 @@
<if test="resourceName != null and resourceName != ''"> <if test="resourceName != null and resourceName != ''">
AND tdr.name LIKE CONCAT( '%', #{resourceName}, '%' ) AND tdr.name LIKE CONCAT( '%', #{resourceName}, '%' )
</if> </if>
<if test="provideDept != null and provideDept != ''">
AND dept.`name` LIKE CONCAT( '%', #{provideDept}, '%' )
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''"> <if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate} AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if> </if>
@ -2053,6 +2056,9 @@
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
AND tmb.dept = #{deptId} AND tmb.dept = #{deptId}
</if> </if>
<if test="provideDept != null and provideDept != ''">
AND '青岛市大数据发展管理局' LIKE CONCAT( '%', #{provideDept}, '%' )
</if>
<if test="resourceName != null and resourceName != ''"> <if test="resourceName != null and resourceName != ''">
AND tm.name LIKE CONCAT( '%', #{resourceName}, '%' ) AND tm.name LIKE CONCAT( '%', #{resourceName}, '%' )
</if> </if>