parent
c94f0513b4
commit
3bdec35655
|
@ -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"),
|
||||||
})
|
})
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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 != ''" >
|
||||||
|
@ -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 != ''" >
|
||||||
|
@ -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 != ''" >
|
||||||
|
@ -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 != ''" >
|
||||||
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue