feat(module): 优化报表查询功能并添加 APP 列表接口- 在 AjhRectificationInfo 实体中添加上报部门字段
- 在 FCustomReportInfo 和 FReportManage 实体中添加排序序号字段 - 实现自定义报表和报表管理的 APP 列表查询接口 - 优化目标统计报表查询功能,支持批量查询多个区域
正在显示
5 个修改的文件
包含
82 行增加
和
74 行删除
... | @@ -47,6 +47,11 @@ public class AjhRectificationInfo extends FlowEntity { | ... | @@ -47,6 +47,11 @@ public class AjhRectificationInfo extends FlowEntity { |
47 | @Excel(name = "隐患描述附件", width = 15) | 47 | @Excel(name = "隐患描述附件", width = 15) |
48 | @ApiModelProperty(value = "隐患描述附件") | 48 | @ApiModelProperty(value = "隐患描述附件") |
49 | private String recOrdDescFile; | 49 | private String recOrdDescFile; |
50 | /**上报部门*/ | ||
51 | @Excel(name = "上报部门", width = 15) | ||
52 | @ApiModelProperty(value = "上报部门") | ||
53 | @Dict(dicCode = "rec_depart") | ||
54 | private String recDepart; | ||
50 | /**整改建议*/ | 55 | /**整改建议*/ |
51 | @Excel(name = "整改建议", width = 15) | 56 | @Excel(name = "整改建议", width = 15) |
52 | @ApiModelProperty(value = "整改建议") | 57 | @ApiModelProperty(value = "整改建议") | ... | ... |
1 | package com.skua.modules.statistics.controller; | 1 | package com.skua.modules.statistics.controller; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
3 | import com.skua.core.api.vo.Result; | 5 | import com.skua.core.api.vo.Result; |
4 | import com.skua.core.context.BaseContextHandler; | 6 | import com.skua.core.context.BaseContextHandler; |
5 | import com.skua.modules.statistics.service.IReportTargetStatisticsService; | 7 | import com.skua.modules.statistics.service.IReportTargetStatisticsService; |
6 | import com.skua.modules.statistics.vo.ReportTargetEnergyVO; | 8 | import com.skua.modules.statistics.vo.ReportTargetEnergyVO; |
7 | import com.skua.modules.statistics.vo.ReportTargetStatisticsVO; | 9 | import com.skua.modules.statistics.vo.ReportTargetStatisticsVO; |
10 | import com.skua.modules.supplies.entity.EquipmentSparepartType; | ||
8 | import com.skua.modules.system.entity.SysDepart; | 11 | import com.skua.modules.system.entity.SysDepart; |
9 | import com.skua.modules.system.service.ISysDepartService; | 12 | import com.skua.modules.system.service.ISysDepartService; |
10 | import com.skua.tool.util.JSUtils; | 13 | import com.skua.tool.util.JSUtils; |
... | @@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ... | @@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
18 | import org.springframework.web.bind.annotation.RestController; | 21 | import org.springframework.web.bind.annotation.RestController; |
19 | 22 | ||
20 | import java.util.ArrayList; | 23 | import java.util.ArrayList; |
24 | import java.util.Arrays; | ||
21 | import java.util.List; | 25 | import java.util.List; |
22 | 26 | ||
23 | /** | 27 | /** |
... | @@ -48,26 +52,18 @@ public class ReportTargetStatisticsController { | ... | @@ -48,26 +52,18 @@ public class ReportTargetStatisticsController { |
48 | } | 52 | } |
49 | ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); | 53 | ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); |
50 | 54 | ||
51 | SysDepart depart = departService.getById("1892199062790823936"); | ||
52 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1"); | ||
53 | ReportTargetStatisticsVO targetStatisticsVO_nj = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); | ||
54 | targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId()); | ||
55 | |||
56 | depart = departService.getById("1892199890272477184"); | ||
57 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1"); | ||
58 | ReportTargetStatisticsVO targetStatisticsVO_wh = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); | ||
59 | targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId()); | ||
60 | |||
61 | depart = departService.getById("1818215543140909056"); | ||
62 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1"); | ||
63 | ReportTargetStatisticsVO targetStatisticsVO_ef = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); | ||
64 | targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId()); | ||
65 | |||
66 | List<ReportTargetStatisticsVO> dataList = new ArrayList<>(); | 55 | List<ReportTargetStatisticsVO> dataList = new ArrayList<>(); |
67 | dataList.add( targetStatisticsVO_nj); | 56 | QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>(); |
68 | dataList.add(targetStatisticsVO_wh ); | 57 | //三个分区域 |
69 | dataList.add(targetStatisticsVO_ef ); | 58 | String departs = "1892199062790823936,1892199890272477184,1818215543140909056"; |
70 | 59 | queryWrapper.in("id", Arrays.asList(departs.split(","))); | |
60 | List<SysDepart> departList = departService.list(queryWrapper); | ||
61 | for (SysDepart depart : departList) { | ||
62 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1"); | ||
63 | ReportTargetStatisticsVO qyTargetStatisticsVO = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime); | ||
64 | qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId()); | ||
65 | dataList.add(qyTargetStatisticsVO); | ||
66 | } | ||
71 | targetStatisticsVO.setDataList( dataList ); | 67 | targetStatisticsVO.setDataList( dataList ); |
72 | result.setSuccess(true); | 68 | result.setSuccess(true); |
73 | result.setResult(targetStatisticsVO); | 69 | result.setResult(targetStatisticsVO); |
... | @@ -108,33 +104,24 @@ public class ReportTargetStatisticsController { | ... | @@ -108,33 +104,24 @@ public class ReportTargetStatisticsController { |
108 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1"); | 104 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1"); |
109 | } | 105 | } |
110 | ReportTargetEnergyVO targetStatisticsVO = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); | 106 | ReportTargetEnergyVO targetStatisticsVO = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); |
111 | |||
112 | SysDepart depart = departService.getById("1892199062790823936"); | ||
113 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1"); | ||
114 | ReportTargetEnergyVO targetStatisticsVO_nj = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); | ||
115 | targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId()); | ||
116 | |||
117 | depart = departService.getById("1892199890272477184"); | ||
118 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1"); | ||
119 | ReportTargetEnergyVO targetStatisticsVO_wh = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); | ||
120 | targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId()); | ||
121 | |||
122 | depart = departService.getById("1818215543140909056"); | ||
123 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1"); | ||
124 | ReportTargetEnergyVO targetStatisticsVO_ef = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); | ||
125 | targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId()); | ||
126 | |||
127 | List<ReportTargetEnergyVO> dataList = new ArrayList<>(); | 107 | List<ReportTargetEnergyVO> dataList = new ArrayList<>(); |
128 | dataList.add( targetStatisticsVO_nj); | 108 | QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>(); |
129 | dataList.add(targetStatisticsVO_wh ); | 109 | //三个分区域 |
130 | dataList.add(targetStatisticsVO_ef ); | 110 | String departs = "1892199062790823936,1892199890272477184,1818215543140909056"; |
131 | 111 | queryWrapper.in("id", Arrays.asList(departs.split(","))); | |
132 | targetStatisticsVO.setDataList( dataList ); | 112 | List<SysDepart> departList = departService.list(queryWrapper); |
113 | for (SysDepart depart : departList) { | ||
114 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1"); | ||
115 | ReportTargetEnergyVO qyTargetStatisticsVO = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime); | ||
116 | qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId()); | ||
117 | dataList.add(qyTargetStatisticsVO); | ||
118 | } | ||
119 | targetStatisticsVO.setDataList(dataList); | ||
133 | result.setSuccess(true); | 120 | result.setSuccess(true); |
134 | result.setResult(targetStatisticsVO); | 121 | result.setResult(targetStatisticsVO); |
135 | } catch (Exception e) { | 122 | } catch (Exception e) { |
136 | log.error("分析经营分析", e.getMessage()); | 123 | log.error("能耗经营分析", e.getMessage()); |
137 | result.error500("费用经营分析"+e.getMessage()); | 124 | result.error500("能耗经营分析"+e.getMessage()); |
138 | } | 125 | } |
139 | return result; | 126 | return result; |
140 | } | 127 | } |
... | @@ -172,28 +159,19 @@ public class ReportTargetStatisticsController { | ... | @@ -172,28 +159,19 @@ public class ReportTargetStatisticsController { |
172 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1"); | 159 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1"); |
173 | } | 160 | } |
174 | ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); | 161 | ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); |
175 | |||
176 | SysDepart depart = departService.getById("1892199062790823936"); | ||
177 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1"); | ||
178 | ReportTargetStatisticsVO targetStatisticsVO_nj = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); | ||
179 | targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId()); | ||
180 | |||
181 | depart = departService.getById("1892199890272477184"); | ||
182 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1"); | ||
183 | ReportTargetStatisticsVO targetStatisticsVO_wh = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); | ||
184 | targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId()); | ||
185 | |||
186 | depart = departService.getById("1818215543140909056"); | ||
187 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1"); | ||
188 | ReportTargetStatisticsVO targetStatisticsVO_ef = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); | ||
189 | targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId()); | ||
190 | |||
191 | List<ReportTargetStatisticsVO> dataList = new ArrayList<>(); | 162 | List<ReportTargetStatisticsVO> dataList = new ArrayList<>(); |
192 | dataList.add( targetStatisticsVO_nj); | 163 | QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>(); |
193 | dataList.add(targetStatisticsVO_wh ); | 164 | //三个分区域 |
194 | dataList.add(targetStatisticsVO_ef ); | 165 | String departs = "1892199062790823936,1892199890272477184,1818215543140909056"; |
195 | 166 | queryWrapper.in("id", Arrays.asList(departs.split(","))); | |
196 | targetStatisticsVO.setDataList( dataList ); | 167 | List<SysDepart> departList = departService.list(queryWrapper); |
168 | for (SysDepart depart : departList) { | ||
169 | departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1"); | ||
170 | ReportTargetStatisticsVO qyTargetStatisticsVO = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime); | ||
171 | qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId()); | ||
172 | dataList.add(qyTargetStatisticsVO); | ||
173 | } | ||
174 | targetStatisticsVO.setDataList(dataList); | ||
197 | result.setSuccess(true); | 175 | result.setSuccess(true); |
198 | result.setResult(targetStatisticsVO); | 176 | result.setResult(targetStatisticsVO); |
199 | } catch (Exception e) { | 177 | } catch (Exception e) { | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/custom/controller/FCustomReportInfoController.java
... | @@ -2,6 +2,7 @@ package com.skua.modules.custom.controller; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.custom.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 3 | import java.util.Arrays; |
4 | import java.util.HashMap; | 4 | import java.util.HashMap; |
5 | import java.util.List; | ||
5 | import java.util.Map; | 6 | import java.util.Map; |
6 | 7 | ||
7 | import javax.servlet.ServletOutputStream; | 8 | import javax.servlet.ServletOutputStream; |
... | @@ -66,13 +67,10 @@ public class FCustomReportInfoController { | ... | @@ -66,13 +67,10 @@ public class FCustomReportInfoController { |
66 | public Result<IPage<FCustomReportInfo>> queryPageList(FCustomReportInfo fCustomReportInfo, | 67 | public Result<IPage<FCustomReportInfo>> queryPageList(FCustomReportInfo fCustomReportInfo, |
67 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 68 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
68 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 69 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
69 | //String orgType = ConvertUtils.getString(BaseContextHandler.get("orgType")); | ||
70 | Result<IPage<FCustomReportInfo>> result = new Result<IPage<FCustomReportInfo>>(); | 70 | Result<IPage<FCustomReportInfo>> result = new Result<IPage<FCustomReportInfo>>(); |
71 | QueryWrapper<FCustomReportInfo> queryWrapper = QueryGenerator.initQueryWrapper(fCustomReportInfo, | 71 | QueryWrapper<FCustomReportInfo> queryWrapper = QueryGenerator.initQueryWrapper(fCustomReportInfo, |
72 | req.getParameterMap()); | 72 | req.getParameterMap()); |
73 | // if(!"1".equals(orgType)) { | 73 | queryWrapper.orderByAsc("sort_num"); |
74 | // queryWrapper.eq("create_depart", ConvertUtils.getString(BaseContextHandler.get("realDepartId"))); | ||
75 | // } | ||
76 | Page<FCustomReportInfo> page = new Page<FCustomReportInfo>(pageNo, pageSize); | 74 | Page<FCustomReportInfo> page = new Page<FCustomReportInfo>(pageNo, pageSize); |
77 | IPage<FCustomReportInfo> pageList = fCustomReportInfoService.page(page, queryWrapper); | 75 | IPage<FCustomReportInfo> pageList = fCustomReportInfoService.page(page, queryWrapper); |
78 | result.setSuccess(true); | 76 | result.setSuccess(true); |
... | @@ -80,6 +78,20 @@ public class FCustomReportInfoController { | ... | @@ -80,6 +78,20 @@ public class FCustomReportInfoController { |
80 | return result; | 78 | return result; |
81 | } | 79 | } |
82 | 80 | ||
81 | @AutoLog(value = "自定义报表信息表-APP列表查询") | ||
82 | @ApiOperation(value = "自定义报表信息表-APP列表查询", notes = "自定义报表信息表-APP列表查询") | ||
83 | @GetMapping(value = "/app/list") | ||
84 | public Result<List<FCustomReportInfo>> queryAPPList() { | ||
85 | Result<List<FCustomReportInfo>> result = new Result<List<FCustomReportInfo>>(); | ||
86 | QueryWrapper<FCustomReportInfo> queryWrapper = new QueryWrapper<>(); | ||
87 | queryWrapper.ne("sort_num", 77); | ||
88 | queryWrapper.orderByAsc("sort_num"); | ||
89 | List<FCustomReportInfo> list = fCustomReportInfoService.list(queryWrapper); | ||
90 | result.setSuccess(true); | ||
91 | result.setResult(list); | ||
92 | return result; | ||
93 | } | ||
94 | |||
83 | /** | 95 | /** |
84 | * <pre> | 96 | * <pre> |
85 | * 自定义报表展示 | 97 | * 自定义报表展示 | ... | ... |
... | @@ -97,4 +97,9 @@ public class FCustomReportInfo { | ... | @@ -97,4 +97,9 @@ public class FCustomReportInfo { |
97 | @ApiModelProperty(value = "锁定状态,1锁定,锁定后不允许删除") | 97 | @ApiModelProperty(value = "锁定状态,1锁定,锁定后不允许删除") |
98 | private java.lang.String lockState; | 98 | private java.lang.String lockState; |
99 | 99 | ||
100 | /**排序序号*/ | ||
101 | @Excel(name = "排序序号", width = 15) | ||
102 | @ApiModelProperty(value = "排序序号") | ||
103 | private java.lang.Integer sortNum; | ||
104 | |||
100 | } | 105 | } | ... | ... |
... | @@ -93,15 +93,9 @@ public class FReportManageController { | ... | @@ -93,15 +93,9 @@ public class FReportManageController { |
93 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 93 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
94 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 94 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
95 | HttpServletRequest req) { | 95 | HttpServletRequest req) { |
96 | // 查询集团报表 | ||
97 | //String orgCode = BaseContextHandler.getOrgCode(); // 查询集团编码 | ||
98 | //String orgType = ConvertUtils.getString(BaseContextHandler.get("orgType")); | ||
99 | //fReportManage.setCreateDept(orgCode); | ||
100 | Result<IPage<FReportManage>> result = new Result<IPage<FReportManage>>(); | 96 | Result<IPage<FReportManage>> result = new Result<IPage<FReportManage>>(); |
101 | QueryWrapper<FReportManage> queryWrapper = QueryGenerator.initQueryWrapper(fReportManage, req.getParameterMap()); | 97 | QueryWrapper<FReportManage> queryWrapper = QueryGenerator.initQueryWrapper(fReportManage, req.getParameterMap()); |
102 | //if(!"1".equals(orgType)) { | 98 | queryWrapper.orderByAsc("sort_num"); |
103 | // queryWrapper.eq("create_dept", ConvertUtils.getString(BaseContextHandler.get("realDepartId"))); | ||
104 | //} | ||
105 | Page<FReportManage> page = new Page<FReportManage>(pageNo, pageSize); | 99 | Page<FReportManage> page = new Page<FReportManage>(pageNo, pageSize); |
106 | IPage<FReportManage> pageList = fReportManageService.page(page, queryWrapper); | 100 | IPage<FReportManage> pageList = fReportManageService.page(page, queryWrapper); |
107 | result.setSuccess(true); | 101 | result.setSuccess(true); |
... | @@ -109,6 +103,20 @@ public class FReportManageController { | ... | @@ -109,6 +103,20 @@ public class FReportManageController { |
109 | return result; | 103 | return result; |
110 | } | 104 | } |
111 | 105 | ||
106 | @AutoLog(value = "报表管理-APP列表查询") | ||
107 | @ApiOperation(value="报表管理-APP列表查询", notes="报表管理-APP列表查询") | ||
108 | @GetMapping(value = "/app/list") | ||
109 | public Result<List<FReportManage>> queryAPPList() { | ||
110 | Result<List<FReportManage>> result = new Result<List<FReportManage>>(); | ||
111 | QueryWrapper<FReportManage> queryWrapper = new QueryWrapper<>(); | ||
112 | queryWrapper.ne("sort_num", 77); | ||
113 | queryWrapper.orderByAsc("sort_num"); | ||
114 | List<FReportManage> list = fReportManageService.list(queryWrapper); | ||
115 | result.setSuccess(true); | ||
116 | result.setResult(list); | ||
117 | return result; | ||
118 | } | ||
119 | |||
112 | /** | 120 | /** |
113 | * 添加 | 121 | * 添加 |
114 | * @param fReportManage | 122 | * @param fReportManage | ... | ... |
-
请 注册 或 登录 后发表评论