fa509430 张雷

feat(module): 优化报表查询功能并添加 APP 列表接口- 在 AjhRectificationInfo 实体中添加上报部门字段

- 在 FCustomReportInfo 和 FReportManage 实体中添加排序序号字段
- 实现自定义报表和报表管理的 APP 列表查询接口
- 优化目标统计报表查询功能,支持批量查询多个区域
1 个父辈 415ad99b
......@@ -47,6 +47,11 @@ public class AjhRectificationInfo extends FlowEntity {
@Excel(name = "隐患描述附件", width = 15)
@ApiModelProperty(value = "隐患描述附件")
private String recOrdDescFile;
/**上报部门*/
@Excel(name = "上报部门", width = 15)
@ApiModelProperty(value = "上报部门")
@Dict(dicCode = "rec_depart")
private String recDepart;
/**整改建议*/
@Excel(name = "整改建议", width = 15)
@ApiModelProperty(value = "整改建议")
......
package com.skua.modules.statistics.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.core.api.vo.Result;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.statistics.service.IReportTargetStatisticsService;
import com.skua.modules.statistics.vo.ReportTargetEnergyVO;
import com.skua.modules.statistics.vo.ReportTargetStatisticsVO;
import com.skua.modules.supplies.entity.EquipmentSparepartType;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.service.ISysDepartService;
import com.skua.tool.util.JSUtils;
......@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
......@@ -48,26 +52,18 @@ public class ReportTargetStatisticsController {
}
ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime);
SysDepart depart = departService.getById("1892199062790823936");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1");
ReportTargetStatisticsVO targetStatisticsVO_nj = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId());
depart = departService.getById("1892199890272477184");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1");
ReportTargetStatisticsVO targetStatisticsVO_wh = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId());
depart = departService.getById("1818215543140909056");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1");
ReportTargetStatisticsVO targetStatisticsVO_ef = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId());
List<ReportTargetStatisticsVO> dataList = new ArrayList<>();
dataList.add( targetStatisticsVO_nj);
dataList.add(targetStatisticsVO_wh );
dataList.add(targetStatisticsVO_ef );
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
//三个分区域
String departs = "1892199062790823936,1892199890272477184,1818215543140909056";
queryWrapper.in("id", Arrays.asList(departs.split(",")));
List<SysDepart> departList = departService.list(queryWrapper);
for (SysDepart depart : departList) {
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1");
ReportTargetStatisticsVO qyTargetStatisticsVO = targetStatisticsService.targetWaterStatistics(departIds,year,startTime,endTime);
qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId());
dataList.add(qyTargetStatisticsVO);
}
targetStatisticsVO.setDataList( dataList );
result.setSuccess(true);
result.setResult(targetStatisticsVO);
......@@ -108,33 +104,24 @@ public class ReportTargetStatisticsController {
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1");
}
ReportTargetEnergyVO targetStatisticsVO = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime);
SysDepart depart = departService.getById("1892199062790823936");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1");
ReportTargetEnergyVO targetStatisticsVO_nj = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId());
depart = departService.getById("1892199890272477184");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1");
ReportTargetEnergyVO targetStatisticsVO_wh = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId());
depart = departService.getById("1818215543140909056");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1");
ReportTargetEnergyVO targetStatisticsVO_ef = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId());
List<ReportTargetEnergyVO> dataList = new ArrayList<>();
dataList.add( targetStatisticsVO_nj);
dataList.add(targetStatisticsVO_wh );
dataList.add(targetStatisticsVO_ef );
targetStatisticsVO.setDataList( dataList );
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
//三个分区域
String departs = "1892199062790823936,1892199890272477184,1818215543140909056";
queryWrapper.in("id", Arrays.asList(departs.split(",")));
List<SysDepart> departList = departService.list(queryWrapper);
for (SysDepart depart : departList) {
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1");
ReportTargetEnergyVO qyTargetStatisticsVO = targetStatisticsService.targetEnergyStatistics(departIds,year,startTime,endTime);
qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId());
dataList.add(qyTargetStatisticsVO);
}
targetStatisticsVO.setDataList(dataList);
result.setSuccess(true);
result.setResult(targetStatisticsVO);
} catch (Exception e) {
log.error("分析经营分析", e.getMessage());
result.error500("费用经营分析"+e.getMessage());
log.error("能耗经营分析", e.getMessage());
result.error500("能耗经营分析"+e.getMessage());
}
return result;
}
......@@ -172,28 +159,19 @@ public class ReportTargetStatisticsController {
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),departId,"1");
}
ReportTargetStatisticsVO targetStatisticsVO = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime);
SysDepart depart = departService.getById("1892199062790823936");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199062790823936","1");
ReportTargetStatisticsVO targetStatisticsVO_nj = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_nj.setDepartName(depart.getDepartName()); targetStatisticsVO_nj.setDepartId(depart.getId());
depart = departService.getById("1892199890272477184");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1892199890272477184","1");
ReportTargetStatisticsVO targetStatisticsVO_wh = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_wh.setDepartName(depart.getDepartName()); targetStatisticsVO_wh.setDepartId(depart.getId());
depart = departService.getById("1818215543140909056");
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),"1818215543140909056","1");
ReportTargetStatisticsVO targetStatisticsVO_ef = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime);
targetStatisticsVO_ef.setDepartName(depart.getDepartName()); targetStatisticsVO_ef.setDepartId(depart.getId());
List<ReportTargetStatisticsVO> dataList = new ArrayList<>();
dataList.add( targetStatisticsVO_nj);
dataList.add(targetStatisticsVO_wh );
dataList.add(targetStatisticsVO_ef );
targetStatisticsVO.setDataList( dataList );
QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
//三个分区域
String departs = "1892199062790823936,1892199890272477184,1818215543140909056";
queryWrapper.in("id", Arrays.asList(departs.split(",")));
List<SysDepart> departList = departService.list(queryWrapper);
for (SysDepart depart : departList) {
departIds = departService.getChildDepartId(BaseContextHandler.getDeparts(),depart.getId(),"1");
ReportTargetStatisticsVO qyTargetStatisticsVO = targetStatisticsService.targetCostStatistics(departIds,year,startTime,endTime);
qyTargetStatisticsVO.setDepartName(depart.getDepartName()); qyTargetStatisticsVO.setDepartId(depart.getId());
dataList.add(qyTargetStatisticsVO);
}
targetStatisticsVO.setDataList(dataList);
result.setSuccess(true);
result.setResult(targetStatisticsVO);
} catch (Exception e) {
......
......@@ -2,6 +2,7 @@ package com.skua.modules.custom.controller;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletOutputStream;
......@@ -66,13 +67,10 @@ public class FCustomReportInfoController {
public Result<IPage<FCustomReportInfo>> queryPageList(FCustomReportInfo fCustomReportInfo,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
//String orgType = ConvertUtils.getString(BaseContextHandler.get("orgType"));
Result<IPage<FCustomReportInfo>> result = new Result<IPage<FCustomReportInfo>>();
QueryWrapper<FCustomReportInfo> queryWrapper = QueryGenerator.initQueryWrapper(fCustomReportInfo,
req.getParameterMap());
// if(!"1".equals(orgType)) {
// queryWrapper.eq("create_depart", ConvertUtils.getString(BaseContextHandler.get("realDepartId")));
// }
queryWrapper.orderByAsc("sort_num");
Page<FCustomReportInfo> page = new Page<FCustomReportInfo>(pageNo, pageSize);
IPage<FCustomReportInfo> pageList = fCustomReportInfoService.page(page, queryWrapper);
result.setSuccess(true);
......@@ -80,6 +78,20 @@ public class FCustomReportInfoController {
return result;
}
@AutoLog(value = "自定义报表信息表-APP列表查询")
@ApiOperation(value = "自定义报表信息表-APP列表查询", notes = "自定义报表信息表-APP列表查询")
@GetMapping(value = "/app/list")
public Result<List<FCustomReportInfo>> queryAPPList() {
Result<List<FCustomReportInfo>> result = new Result<List<FCustomReportInfo>>();
QueryWrapper<FCustomReportInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.ne("sort_num", 77);
queryWrapper.orderByAsc("sort_num");
List<FCustomReportInfo> list = fCustomReportInfoService.list(queryWrapper);
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* <pre>
* 自定义报表展示
......
......@@ -97,4 +97,9 @@ public class FCustomReportInfo {
@ApiModelProperty(value = "锁定状态,1锁定,锁定后不允许删除")
private java.lang.String lockState;
/**排序序号*/
@Excel(name = "排序序号", width = 15)
@ApiModelProperty(value = "排序序号")
private java.lang.Integer sortNum;
}
......
......@@ -93,15 +93,9 @@ public class FReportManageController {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// 查询集团报表
//String orgCode = BaseContextHandler.getOrgCode(); // 查询集团编码
//String orgType = ConvertUtils.getString(BaseContextHandler.get("orgType"));
//fReportManage.setCreateDept(orgCode);
Result<IPage<FReportManage>> result = new Result<IPage<FReportManage>>();
QueryWrapper<FReportManage> queryWrapper = QueryGenerator.initQueryWrapper(fReportManage, req.getParameterMap());
//if(!"1".equals(orgType)) {
// queryWrapper.eq("create_dept", ConvertUtils.getString(BaseContextHandler.get("realDepartId")));
//}
queryWrapper.orderByAsc("sort_num");
Page<FReportManage> page = new Page<FReportManage>(pageNo, pageSize);
IPage<FReportManage> pageList = fReportManageService.page(page, queryWrapper);
result.setSuccess(true);
......@@ -109,6 +103,20 @@ public class FReportManageController {
return result;
}
@AutoLog(value = "报表管理-APP列表查询")
@ApiOperation(value="报表管理-APP列表查询", notes="报表管理-APP列表查询")
@GetMapping(value = "/app/list")
public Result<List<FReportManage>> queryAPPList() {
Result<List<FReportManage>> result = new Result<List<FReportManage>>();
QueryWrapper<FReportManage> queryWrapper = new QueryWrapper<>();
queryWrapper.ne("sort_num", 77);
queryWrapper.orderByAsc("sort_num");
List<FReportManage> list = fReportManageService.list(queryWrapper);
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* 添加
* @param fReportManage
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!