Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-10-18 11:18:43 +08:00
commit f5ff6df7ca
3 changed files with 236 additions and 7 deletions

View File

@ -9,6 +9,7 @@ import io.renren.common.annotation.LogOperation;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dao.ResourceDao; import io.renren.modules.resource.dao.ResourceDao;
import io.renren.modules.resource.excel.census.SelectApplyDeptDetailTypeCountListExcel;
import io.renren.modules.resource.excel.census.SelectDeptDetailTypeCountListExcel; import io.renren.modules.resource.excel.census.SelectDeptDetailTypeCountListExcel;
import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
@ -385,8 +386,25 @@ public class CensusController {
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
}) })
public void exportSelectApplyDeptDetailTypeCountList(@RequestParam Map<String, Object> params) { public void exportSelectApplyDeptDetailTypeCountList(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
// TODO 导出按照部门能力类型组件类型统计能力使用情况 ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectApplyDeptDetailTypeCountList(params);
List<SelectApplyDeptDetailTypeCountListExcel> date = resultList.stream().map(index -> {
SelectApplyDeptDetailTypeCountListExcel temp = new SelectApplyDeptDetailTypeCountListExcel(
index.getOrDefault("name", "").toString(),
Integer.valueOf(index.getOrDefault("znsf", "0").toString()),
Integer.valueOf(index.getOrDefault("tcfw", "0").toString()),
Integer.valueOf(index.getOrDefault("kfzj", "0").toString()),
Integer.valueOf(index.getOrDefault("ywzy", "0").toString()),
Integer.valueOf(index.getOrDefault("yyzy", "0").toString()),
Integer.valueOf(index.getOrDefault("hys", "0").toString()),
Integer.valueOf(index.getOrDefault("count", "0").toString()));
return temp;
}).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("按照部门_能力类型_组件类型统计能力使用情况", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), SelectApplyDeptDetailTypeCountListExcel.class).sheet("使用情况").doWrite(date);
} }
@GetMapping("/selectDeptDetailTypeCountList") @GetMapping("/selectDeptDetailTypeCountList")
@ -424,12 +442,11 @@ public class CensusController {
temp.setYyzy(Integer.valueOf(index.getOrDefault("yyzy", "0").toString())); temp.setYyzy(Integer.valueOf(index.getOrDefault("yyzy", "0").toString()));
return temp; return temp;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// TODO 导出按照部门能力类型组件类型统计能力上架情况
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").replaceAll("\\+", "%20"); String fileName = URLEncoder.encode("按照部门_能力类型_组件类型统计能力上架情况", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), SelectDeptDetailTypeCountListExcel.class).sheet("数据").doWrite(date); EasyExcel.write(response.getOutputStream(), SelectDeptDetailTypeCountListExcel.class).sheet("上架情况").doWrite(date);
} }
@GetMapping("/selectCensusResourceTable") @GetMapping("/selectCensusResourceTable")
@ -446,6 +463,54 @@ public class CensusController {
return new Result().ok(resourceService.selectCensusResourceTable(params)); return new Result().ok(resourceService.selectCensusResourceTable(params));
} }
@GetMapping("/exportSelectCensusResourceTable")
@ApiOperation("查询部门上架资源及审批结果详细信息")
@LogOperation("查询部门上架资源及审批结果详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@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 = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public void exportSelectCensusResourceTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusResourceTable(params);
List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("deptName", "").toString());
data.add(index.getOrDefault("type", "").toString());
data.add(index.getOrDefault("resourceName", "").toString());
data.add(index.getOrDefault("createDate", "").toString());
data.add(index.getOrDefault("approveStatus", "").toString());
return data;
}).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("部门上架资源及审批结果详细信息", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(exportSelectCensusResourceTableHead()).sheet("上架情况").doWrite(date);
}
private List<List<String>> exportSelectCensusResourceTableHead() {
List<List<String>> list = new ArrayList<>();
List<String> head0 = new ArrayList<>();
head0.add("上架部门");
List<String> head1 = new ArrayList<>();
head0.add("类型");
List<String> head2 = new ArrayList<>();
head0.add("资源名称");
List<String> head3 = new ArrayList<>();
head0.add("日期");
List<String> head4 = new ArrayList<>();
head0.add("状态");
list.add(head0);
list.add(head1);
list.add(head2);
list.add(head3);
list.add(head4);
return list;
}
@GetMapping("/selectCensusApplyTable") @GetMapping("/selectCensusApplyTable")
@ApiOperation("查询部门申请资源及审批结果详细信息") @ApiOperation("查询部门申请资源及审批结果详细信息")
@LogOperation("查询部门申请资源及审批结果详细信息") @LogOperation("查询部门申请资源及审批结果详细信息")
@ -460,4 +525,56 @@ public class CensusController {
return new Result().ok(resourceService.selectCensusApplyTable(params)); return new Result().ok(resourceService.selectCensusApplyTable(params));
} }
@GetMapping("/exportSelectCensusApplyTable")
@ApiOperation("导出查询部门申请资源及审批结果详细信息")
@LogOperation("导出查询部门申请资源及审批结果详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@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 = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public void exportSelectCensusApplyTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusApplyTable(params);
List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("resourceDeptName", "").toString());
data.add(index.getOrDefault("resourceName", "").toString());
data.add(index.getOrDefault("type", "").toString());
data.add(index.getOrDefault("deptName", "").toString());
data.add(index.getOrDefault("createDate", "").toString());
data.add(index.getOrDefault("approveStatus", "").toString());
return data;
}).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("部门申请资源及审批结果详细信息", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(exportSelectCensusApplyTableHead()).sheet("申请情况").doWrite(date);
}
private List<List<String>> exportSelectCensusApplyTableHead() {
List<List<String>> list = new ArrayList<>();
List<String> head0 = new ArrayList<>();
head0.add("提供部门");
List<String> head1 = new ArrayList<>();
head0.add("资源名称");
List<String> head2 = new ArrayList<>();
head0.add("类型");
List<String> head3 = new ArrayList<>();
head0.add("申请部门");
List<String> head4 = new ArrayList<>();
head0.add("日期");
List<String> head5 = new ArrayList<>();
head0.add("状态");
list.add(head0);
list.add(head1);
list.add(head2);
list.add(head3);
list.add(head4);
list.add(head5);
return list;
}
} }

View File

@ -0,0 +1,112 @@
package io.renren.modules.resource.excel.census;
import com.alibaba.excel.annotation.ExcelProperty;
import java.util.Objects;
public class SelectApplyDeptDetailTypeCountListExcel {
@ExcelProperty({"申请部门"})
private String name;
@ExcelProperty({"组件", "智能算法"})
private Integer znsf;
@ExcelProperty({"组件", "图层服务"})
private Integer tcfw;
@ExcelProperty({"组件", "通用开发组件"})
private Integer kfzj;
@ExcelProperty({"组件", "业务能力组件"})
private Integer ywzj;
@ExcelProperty({"应用资源"})
private Integer yyzy;
@ExcelProperty({"会议室"})
private Integer hys;
@ExcelProperty({"总计"})
private Integer count;
public SelectApplyDeptDetailTypeCountListExcel(String name, Integer znsf, Integer tcfw, Integer kfzj, Integer ywzj, Integer yyzy, Integer hys, Integer count) {
this.name = name;
this.znsf = znsf;
this.tcfw = tcfw;
this.kfzj = kfzj;
this.ywzj = ywzj;
this.yyzy = yyzy;
this.hys = hys;
this.count = count;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getZnsf() {
return znsf;
}
public void setZnsf(Integer znsf) {
this.znsf = znsf;
}
public Integer getTcfw() {
return tcfw;
}
public void setTcfw(Integer tcfw) {
this.tcfw = tcfw;
}
public Integer getKfzj() {
return kfzj;
}
public void setKfzj(Integer kfzj) {
this.kfzj = kfzj;
}
public Integer getYwzj() {
return ywzj;
}
public void setYwzj(Integer ywzj) {
this.ywzj = ywzj;
}
public Integer getYyzy() {
return yyzy;
}
public void setYyzy(Integer yyzy) {
this.yyzy = yyzy;
}
public Integer getHys() {
return hys;
}
public void setHys(Integer hys) {
this.hys = hys;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SelectApplyDeptDetailTypeCountListExcel that = (SelectApplyDeptDetailTypeCountListExcel) o;
return name.equals(that.name) && znsf.equals(that.znsf) && tcfw.equals(that.tcfw) && kfzj.equals(that.kfzj) && ywzj.equals(that.ywzj) && yyzy.equals(that.yyzy) && hys.equals(that.hys) && count.equals(that.count);
}
@Override
public int hashCode() {
return Objects.hash(name, znsf, tcfw, kfzj, ywzj, yyzy, hys, count);
}
}

View File

@ -1647,7 +1647,7 @@
MATCH (type) AGAINST ( '应用资源' IN BOOLEAN MODE) MATCH (type) AGAINST ( '应用资源' IN BOOLEAN MODE)
UNION UNION
SELECT SELECT
( CASE tda.attr_value WHEN '智能算法' THEN '组件' WHEN '图层服务' THEN '图层' ELSE '其他' END ) AS "type", ( CASE tda.attr_value WHEN '开发组件' THEN '组件' WHEN '图层服务' THEN '图层' ELSE '其他' END ) AS "type",
COUNT( tdr.id ) AS "count" COUNT( tdr.id ) AS "count"
FROM FROM
tb_data_resource tdr, tb_data_resource tdr,
@ -1659,7 +1659,7 @@
AND tdr.dept_id = #{deptId} AND tdr.dept_id = #{deptId}
AND MATCH (tdr.type) AGAINST ( '组件服务' IN BOOLEAN MODE) AND MATCH (tdr.type) AGAINST ( '组件服务' IN BOOLEAN MODE)
AND tda.attr_type = '组件类型' AND tda.attr_type = '组件类型'
AND tda.attr_value IN ( '智能算法', '图层服务' ) AND tda.attr_value IN ( '开发组件', '图层服务' )
GROUP BY GROUP BY
tda.attr_value tda.attr_value
</select> </select>