kangwei :修复bug
正在显示
15 个修改的文件
包含
202 行增加
和
124 行删除
... | @@ -14,6 +14,7 @@ import com.skua.tool.util.DigitalUtils; | ... | @@ -14,6 +14,7 @@ import com.skua.tool.util.DigitalUtils; |
14 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
15 | import io.swagger.annotations.ApiOperation; | 15 | import io.swagger.annotations.ApiOperation; |
16 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
17 | import org.apache.commons.lang3.StringUtils; | ||
17 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
18 | import org.springframework.web.bind.annotation.GetMapping; | 19 | import org.springframework.web.bind.annotation.GetMapping; |
19 | import org.springframework.web.bind.annotation.RequestBody; | 20 | import org.springframework.web.bind.annotation.RequestBody; |
... | @@ -116,17 +117,12 @@ public class SysCommandCentreController { | ... | @@ -116,17 +117,12 @@ public class SysCommandCentreController { |
116 | public Result<DepartLoadRateResultVO> statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception { | 117 | public Result<DepartLoadRateResultVO> statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception { |
117 | DepartLoadRateResultVO loadRateResultVO = new DepartLoadRateResultVO(); | 118 | DepartLoadRateResultVO loadRateResultVO = new DepartLoadRateResultVO(); |
118 | //SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class); | 119 | //SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class); |
119 | |||
120 | |||
121 | //报表数据项值 | 120 | //报表数据项值 |
122 | String reitId = sysConfigService.queryValueByKey("REIT_ID_CSL"); | 121 | String reitId = sysConfigService.queryValueByKey("REIT_ID_CSL"); |
123 | 122 | ||
124 | reportItemvParam.setReitId( reitId ); | 123 | reportItemvParam.setReitId( reitId ); |
125 | Integer loadRateType = 1;//默认查询 | 124 | if(reportItemvParam.getLoadRateType() == null){ |
126 | if(reportItemvParam.getLoadRateType() != null){ | 125 | reportItemvParam.setLoadRateType(1);////默认查询 |
127 | loadRateType = reportItemvParam.getLoadRateType(); | ||
128 | }else{ | ||
129 | reportItemvParam.setLoadRateType(loadRateType); | ||
130 | } | 126 | } |
131 | List<DepartLoadRateVO> departLoadRateVOList = commandCentreService.statisticsByLoadRate(reportItemvParam); | 127 | List<DepartLoadRateVO> departLoadRateVOList = commandCentreService.statisticsByLoadRate(reportItemvParam); |
132 | 128 | ||
... | @@ -138,8 +134,8 @@ public class SysCommandCentreController { | ... | @@ -138,8 +134,8 @@ public class SysCommandCentreController { |
138 | loadRateResultVO.setDepartLoadRateVOList(departLoadRateVOList ); | 134 | loadRateResultVO.setDepartLoadRateVOList(departLoadRateVOList ); |
139 | //统计总数 | 135 | //统计总数 |
140 | int normalNum = commandCentreService.statisticsByLoadRateNum(1, reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//正常 | 136 | int normalNum = commandCentreService.statisticsByLoadRateNum(1, reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//正常 |
141 | int lowLoadNum = commandCentreService.statisticsByLoadRateNum(2 ,reitId , reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//低负荷 | 137 | int lowLoadNum = commandCentreService.statisticsByLoadRateNum(3 ,reitId , reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//低负荷 |
142 | int overloadNum = commandCentreService.statisticsByLoadRateNum(3 , reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//超负荷 | 138 | int overloadNum = commandCentreService.statisticsByLoadRateNum(2 , reitId,reportItemvParam.getStartDate(), reportItemvParam.getEndDate());//超负荷 |
143 | loadRateResultVO.setNormalNum( normalNum ); | 139 | loadRateResultVO.setNormalNum( normalNum ); |
144 | loadRateResultVO.setLowLoadNum( lowLoadNum ); | 140 | loadRateResultVO.setLowLoadNum( lowLoadNum ); |
145 | loadRateResultVO.setOverloadNum( overloadNum ); | 141 | loadRateResultVO.setOverloadNum( overloadNum ); | ... | ... |
... | @@ -84,6 +84,9 @@ public class DistributContractController { | ... | @@ -84,6 +84,9 @@ public class DistributContractController { |
84 | Result<List<DistributContract>> result = new Result<List<DistributContract>>(); | 84 | Result<List<DistributContract>> result = new Result<List<DistributContract>>(); |
85 | QueryWrapper<DistributContract> queryWrapper = QueryGenerator.initQueryWrapper(distributContract, req.getParameterMap()); | 85 | QueryWrapper<DistributContract> queryWrapper = QueryGenerator.initQueryWrapper(distributContract, req.getParameterMap()); |
86 | 86 | ||
87 | // 需要添加条件判断 | ||
88 | queryWrapper.eq("status" , "3");// 审核通过 | ||
89 | |||
87 | List<DistributContract> dataList = distributContractService.list(queryWrapper); | 90 | List<DistributContract> dataList = distributContractService.list(queryWrapper); |
88 | result.setSuccess(true); | 91 | result.setSuccess(true); |
89 | result.setResult(dataList); | 92 | result.setResult(dataList); | ... | ... |
... | @@ -145,9 +145,9 @@ public class MaterialINController { | ... | @@ -145,9 +145,9 @@ public class MaterialINController { |
145 | if(StringUtils.isNotBlank(materialIN.getAuditStatus())){ | 145 | if(StringUtils.isNotBlank(materialIN.getAuditStatus())){ |
146 | queryWrapper.eq("audit_status",materialIN.getAuditStatus()); | 146 | queryWrapper.eq("audit_status",materialIN.getAuditStatus()); |
147 | } | 147 | } |
148 | if(StringUtils.isNotBlank(materialIN.getConfirmStatus())){ | 148 | /*if(StringUtils.isNotBlank(materialIN.getConfirmStatus())){ |
149 | queryWrapper.eq("confirm_status",materialIN.getConfirmStatus()); | 149 | queryWrapper.eq("confirm_status",materialIN.getConfirmStatus()); |
150 | } | 150 | }*/ |
151 | if(StringUtils.isNotBlank(materialIN.getGoodCode())){ | 151 | if(StringUtils.isNotBlank(materialIN.getGoodCode())){ |
152 | queryWrapper.like("good_code",materialIN.getGoodCode()); | 152 | queryWrapper.like("good_code",materialIN.getGoodCode()); |
153 | } | 153 | } |
... | @@ -157,7 +157,13 @@ public class MaterialINController { | ... | @@ -157,7 +157,13 @@ public class MaterialINController { |
157 | if(StringUtils.isNotBlank(materialIN.getEndTime())){ | 157 | if(StringUtils.isNotBlank(materialIN.getEndTime())){ |
158 | queryWrapper.le("arrive_time",materialIN.getEndTime()); | 158 | queryWrapper.le("arrive_time",materialIN.getEndTime()); |
159 | } | 159 | } |
160 | queryWrapper.gt("audit_tatus",0); | 160 | |
161 | // 需要添加条件判断 | ||
162 | queryWrapper.gt("status" , "0");// >0 | ||
163 | queryWrapper.ne("status" , "2"); // 不等于2 | ||
164 | |||
165 | |||
166 | queryWrapper.eq("confirm_status","2"); | ||
161 | IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper); | 167 | IPage<MaterialIN> pageList = materialINService.page(page, queryWrapper); |
162 | result.setSuccess(true); | 168 | result.setSuccess(true); |
163 | result.setResult(pageList); | 169 | result.setResult(pageList); | ... | ... |
... | @@ -66,6 +66,9 @@ public class PurchaseContractController { | ... | @@ -66,6 +66,9 @@ public class PurchaseContractController { |
66 | Page<ERPPurchaseContract> page = new Page<ERPPurchaseContract>(pageNo, pageSize); | 66 | Page<ERPPurchaseContract> page = new Page<ERPPurchaseContract>(pageNo, pageSize); |
67 | 67 | ||
68 | // 需要添加条件判断 | 68 | // 需要添加条件判断 |
69 | queryWrapper.gt("status" , "0");// >0 | ||
70 | queryWrapper.ne("status" , "2"); // 不等于2 | ||
71 | |||
69 | IPage<ERPPurchaseContract> pageList = purchaseContractService.page(page, queryWrapper); | 72 | IPage<ERPPurchaseContract> pageList = purchaseContractService.page(page, queryWrapper); |
70 | result.setSuccess(true); | 73 | result.setSuccess(true); |
71 | result.setResult(pageList); | 74 | result.setResult(pageList); | ... | ... |
... | @@ -301,8 +301,9 @@ public class PurchasePlanController { | ... | @@ -301,8 +301,9 @@ public class PurchasePlanController { |
301 | if(sparepartTypeSet.size() > 0 ){ | 301 | if(sparepartTypeSet.size() > 0 ){ |
302 | // 使用String.join()方法转换Set为字符串,以逗号分隔 | 302 | // 使用String.join()方法转换Set为字符串,以逗号分隔 |
303 | sparepartTypeStr = String.join(",", sparepartTypeSet); | 303 | sparepartTypeStr = String.join(",", sparepartTypeSet); |
304 | |||
304 | } | 305 | } |
305 | purchasePlanSearchVO.setSparepartType( sparepartTypeStr ); | 306 | purchasePlanSearchVO.setSparepartType( sparepartTypeStr ); |
306 | } | 307 | } |
307 | log.debug("查询物料子分类集合:{}",sparepartTypeStr); | 308 | log.debug("查询物料子分类集合:{}",sparepartTypeStr); |
308 | //查询下一级部门集合 | 309 | //查询下一级部门集合 |
... | @@ -316,7 +317,7 @@ public class PurchasePlanController { | ... | @@ -316,7 +317,7 @@ public class PurchasePlanController { |
316 | purchasePlanSearchVO.setDepartIds( departIds ); | 317 | purchasePlanSearchVO.setDepartIds( departIds ); |
317 | log.debug("查询部门集合:{}",departIds); | 318 | log.debug("查询部门集合:{}",departIds); |
318 | }else{ | 319 | }else{ |
319 | purchasePlanSearchVO.setDepartIds( BaseContextHandler.getDeparts() ); | 320 | purchasePlanSearchVO.setDepartIds( BaseUtil.quoteEach(BaseContextHandler.getDeparts(),",") ); |
320 | log.debug("查询权限部门集合:{}", BaseUtil.quoteEach(BaseContextHandler.getDeparts(),",")); | 321 | log.debug("查询权限部门集合:{}", BaseUtil.quoteEach(BaseContextHandler.getDeparts(),",")); |
321 | } | 322 | } |
322 | } | 323 | } | ... | ... |
... | @@ -27,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; | ... | @@ -27,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; |
27 | @Accessors(chain = true) | 27 | @Accessors(chain = true) |
28 | @ApiModel(value="erp_purchase_plan对象", description="erp采购计划表") | 28 | @ApiModel(value="erp_purchase_plan对象", description="erp采购计划表") |
29 | public class PurchasePlan implements Serializable{ | 29 | public class PurchasePlan implements Serializable{ |
30 | 30 | ||
31 | /**主键*/ | 31 | /**主键*/ |
32 | @TableId(type = IdType.ID_WORKER_STR) | 32 | @TableId(type = IdType.ID_WORKER_STR) |
33 | @ApiModelProperty(value = "主键") | 33 | @ApiModelProperty(value = "主键") |
... | @@ -98,4 +98,7 @@ public class PurchasePlan implements Serializable{ | ... | @@ -98,4 +98,7 @@ public class PurchasePlan implements Serializable{ |
98 | /**审批意见*/ | 98 | /**审批意见*/ |
99 | @ApiModelProperty(value = "审批意见") | 99 | @ApiModelProperty(value = "审批意见") |
100 | private String approveMessage; | 100 | private String approveMessage; |
101 | |||
102 | @ApiModelProperty(value = "备注") | ||
103 | private String remark ; | ||
101 | } | 104 | } | ... | ... |
... | @@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; | ... | @@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; |
25 | @Accessors(chain = true) | 25 | @Accessors(chain = true) |
26 | @ApiModel(value="erp_purchase_plan_item对象", description="采购计划物料清单") | 26 | @ApiModel(value="erp_purchase_plan_item对象", description="采购计划物料清单") |
27 | public class PurchasePlanItem implements Serializable{ | 27 | public class PurchasePlanItem implements Serializable{ |
28 | 28 | ||
29 | /**主键*/ | 29 | /**主键*/ |
30 | @TableId(type = IdType.ID_WORKER_STR) | 30 | @TableId(type = IdType.ID_WORKER_STR) |
31 | @ApiModelProperty(value = "主键") | 31 | @ApiModelProperty(value = "主键") |
... | @@ -37,7 +37,7 @@ public class PurchasePlanItem implements Serializable{ | ... | @@ -37,7 +37,7 @@ public class PurchasePlanItem implements Serializable{ |
37 | /**物料类别编号*/ | 37 | /**物料类别编号*/ |
38 | @Excel(name = "物料类别编号", width = 15) | 38 | @Excel(name = "物料类别编号", width = 15) |
39 | @ApiModelProperty(value = "物料类别编号") | 39 | @ApiModelProperty(value = "物料类别编号") |
40 | //@Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text") | 40 | @Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text") |
41 | private String sparepartType; | 41 | private String sparepartType; |
42 | 42 | ||
43 | /**物料编号*/ | 43 | /**物料编号*/ |
... | @@ -46,7 +46,7 @@ public class PurchasePlanItem implements Serializable{ | ... | @@ -46,7 +46,7 @@ public class PurchasePlanItem implements Serializable{ |
46 | private String sparepartName; | 46 | private String sparepartName; |
47 | 47 | ||
48 | @ApiModelProperty(value = "物料编号") | 48 | @ApiModelProperty(value = "物料编号") |
49 | //@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") | 49 | @Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name") |
50 | private String sparepartId; | 50 | private String sparepartId; |
51 | /**规格型号*/ | 51 | /**规格型号*/ |
52 | @Excel(name = "规格型号", width = 15) | 52 | @Excel(name = "规格型号", width = 15) | ... | ... |
... | @@ -54,7 +54,7 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM | ... | @@ -54,7 +54,7 @@ public class DistributContractServiceImpl extends ServiceImpl<DistributContractM |
54 | } | 54 | } |
55 | } | 55 | } |
56 | } | 56 | } |
57 | if(errMsg != null ){ | 57 | if(errMsg == null ){ |
58 | int count = this.baseMapper.insert( distributContractVO ); | 58 | int count = this.baseMapper.insert( distributContractVO ); |
59 | if(count > 0 && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){ | 59 | if(count > 0 && distributContractVO.getMaterialList() != null && !distributContractVO.getMaterialList().isEmpty()){ |
60 | for(DistributMaterial material : distributContractVO.getMaterialList()){ | 60 | for(DistributMaterial material : distributContractVO.getMaterialList()){ | ... | ... |
1 | package com.skua.modules.process.controller; | 1 | package com.skua.modules.process.controller; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
4 | import com.skua.core.api.vo.Result; | 7 | import com.skua.core.api.vo.Result; |
5 | import com.skua.core.aspect.annotation.AutoLog; | 8 | import com.skua.core.aspect.annotation.AutoLog; |
6 | import com.skua.core.context.BaseContextHandler; | 9 | import com.skua.core.context.BaseContextHandler; |
7 | import com.skua.core.context.SpringContextUtils; | 10 | import com.skua.core.context.SpringContextUtils; |
8 | import com.skua.modules.equipment.entity.EquipmentMaintainTask; | 11 | import com.skua.modules.equipment.entity.EquipmentMaintainTask; |
9 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; | 12 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; |
13 | import com.skua.modules.flow.business.service.FlowBusinessService; | ||
14 | import com.skua.modules.flow.core.entity.BladeFlow; | ||
10 | import com.skua.modules.flow.core.utils.TaskUtil; | 15 | import com.skua.modules.flow.core.utils.TaskUtil; |
11 | import com.skua.modules.flow.utils.Func; | ||
12 | import com.skua.modules.inspection.entity.InspectionUserWorkingGroup; | 16 | import com.skua.modules.inspection.entity.InspectionUserWorkingGroup; |
13 | import com.skua.modules.inspection.service.IInspectionTaskService; | 17 | import com.skua.modules.inspection.service.IInspectionTaskService; |
14 | import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService; | 18 | import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService; |
... | @@ -17,12 +21,9 @@ import com.skua.modules.quartz.util.BaseUtil; | ... | @@ -17,12 +21,9 @@ import com.skua.modules.quartz.util.BaseUtil; |
17 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
18 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
19 | import lombok.extern.slf4j.Slf4j; | 23 | import lombok.extern.slf4j.Slf4j; |
20 | import org.flowable.task.api.TaskQuery; | ||
21 | import org.flowable.engine.TaskService; | ||
22 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
23 | import org.springframework.jdbc.core.JdbcTemplate; | 25 | import org.springframework.jdbc.core.JdbcTemplate; |
24 | import org.springframework.web.bind.annotation.GetMapping; | 26 | import org.springframework.web.bind.annotation.GetMapping; |
25 | import org.springframework.web.bind.annotation.PostMapping; | ||
26 | import org.springframework.web.bind.annotation.RequestMapping; | 27 | import org.springframework.web.bind.annotation.RequestMapping; |
27 | import org.springframework.web.bind.annotation.RestController; | 28 | import org.springframework.web.bind.annotation.RestController; |
28 | 29 | ||
... | @@ -35,9 +36,8 @@ import java.util.List; | ... | @@ -35,9 +36,8 @@ import java.util.List; |
35 | @RequestMapping("/web/process") | 36 | @RequestMapping("/web/process") |
36 | public class ProcessStatisticsController { | 37 | public class ProcessStatisticsController { |
37 | 38 | ||
38 | // 注入TaskService | ||
39 | @Autowired | 39 | @Autowired |
40 | private TaskService taskService; | 40 | private FlowBusinessService flowBusinessService; |
41 | @Autowired | 41 | @Autowired |
42 | private IEquipmentMaintainTaskService equipMaintainExecuteService; | 42 | private IEquipmentMaintainTaskService equipMaintainExecuteService; |
43 | @Autowired | 43 | @Autowired |
... | @@ -60,36 +60,45 @@ public class ProcessStatisticsController { | ... | @@ -60,36 +60,45 @@ public class ProcessStatisticsController { |
60 | public Result<List<ProcessStatisticsVO>> statistics() { | 60 | public Result<List<ProcessStatisticsVO>> statistics() { |
61 | Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>(); | 61 | Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>(); |
62 | List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>(); | 62 | List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>(); |
63 | String taskUser = TaskUtil.getTaskUser(); | 63 | /* String taskUser = TaskUtil.getTaskUser(); |
64 | String taskGroup = TaskUtil.getCandidateGroup(); | 64 | String taskGroup = TaskUtil.getCandidateGroup();*/ |
65 | List<String> userGroupList = Func.toStrList(taskGroup); | 65 | |
66 | String userId = BaseContextHandler.getUserId(); | ||
67 | IPage<BladeFlow> page = new Page<BladeFlow>(); | ||
68 | page.setCurrent(1); | ||
69 | page.setSize(10000); | ||
70 | BladeFlow bladeFlow = new BladeFlow(); | ||
66 | try { | 71 | try { |
67 | //巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库 | 72 | //巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库 |
73 | |||
74 | |||
68 | // 、、、、、药剂入库 | 75 | // 、、、、、药剂入库 |
69 | String process_key = "AjhRectification"; | 76 | String process_key = "AjhRectification"; |
70 | processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,taskUser,taskGroup) ) ; | 77 | processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,page,bladeFlow) ) ; |
71 | process_key = "problemReport"; | 78 | process_key = "problemReport"; |
72 | processStatisticsList.add( queryProcessStatistics("问题上报", process_key,taskUser,taskGroup)) ; | 79 | processStatisticsList.add( queryProcessStatistics("问题上报", process_key,page,bladeFlow)) ; |
73 | process_key = "EmergencyRiskEvent"; | 80 | process_key = "EmergencyRiskEvent"; |
74 | processStatisticsList.add( queryProcessStatistics("事故事件", process_key,taskUser,taskGroup) ) ; | 81 | processStatisticsList.add( queryProcessStatistics("事故事件", process_key,page,bladeFlow) ) ; |
75 | process_key = "DangerousOperationManage"; | 82 | process_key = "DangerousOperationManage"; |
76 | processStatisticsList.add( queryProcessStatistics("危险作业", process_key,taskUser,taskGroup) ) ; | 83 | processStatisticsList.add( queryProcessStatistics("危险作业", process_key,page,bladeFlow) ) ; |
77 | process_key = "EquipmentRepair"; | 84 | process_key = "EquipmentRepair"; |
78 | processStatisticsList.add( queryProcessStatistics("维修任务", process_key,taskUser,taskGroup)) ; | 85 | processStatisticsList.add( queryProcessStatistics("维修任务", process_key,page,bladeFlow)) ; |
79 | 86 | ||
80 | Integer todoCount = 0; | 87 | Integer baoyangTodoCount = 0; |
81 | QueryWrapper equipmentMaintainTaskQueryWrapper = new QueryWrapper<EquipmentMaintainTask>(); | 88 | QueryWrapper equipmentMaintainTaskQueryWrapper = new QueryWrapper<EquipmentMaintainTask>(); |
82 | equipmentMaintainTaskQueryWrapper.eq("maintainer_id", taskUser); | 89 | equipmentMaintainTaskQueryWrapper.eq("maintainer_id", userId); |
83 | equipmentMaintainTaskQueryWrapper.eq("results_enforcement", 1); | 90 | //equipmentMaintainTaskQueryWrapper.eq("results_enforcement", 1); |
84 | todoCount = equipMaintainExecuteService.count(equipmentMaintainTaskQueryWrapper); | 91 | baoyangTodoCount = equipMaintainExecuteService.count(equipmentMaintainTaskQueryWrapper); |
85 | ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", todoCount.toString() ); | 92 | ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", baoyangTodoCount.toString() ); |
86 | processStatisticsList.add( maintainerProcessStatisticsVO ); | 93 | processStatisticsList.add( maintainerProcessStatisticsVO ); |
94 | |||
95 | |||
96 | |||
87 | //巡检 | 97 | //巡检 |
88 | //得到巡检任务 | 98 | //得到巡检任务 |
89 | //得到进行中的任务 | 99 | //得到进行中的任务 |
90 | //获取用户所在的班组 | 100 | //获取用户所在的班组 |
91 | Integer xunjian_count = 0; | 101 | Integer xunjian_count = 0; |
92 | String userId = BaseContextHandler.getUserId(); | ||
93 | QueryWrapper<InspectionUserWorkingGroup> inspectionUserWorkingGroupQueryWrapper = new QueryWrapper<>(); | 102 | QueryWrapper<InspectionUserWorkingGroup> inspectionUserWorkingGroupQueryWrapper = new QueryWrapper<>(); |
94 | inspectionUserWorkingGroupQueryWrapper.eq("user_id", userId); | 103 | inspectionUserWorkingGroupQueryWrapper.eq("user_id", userId); |
95 | List<InspectionUserWorkingGroup> inspectionUserWorkingGroupList = inspectionUserWorkingGroupService.list(inspectionUserWorkingGroupQueryWrapper); | 104 | List<InspectionUserWorkingGroup> inspectionUserWorkingGroupList = inspectionUserWorkingGroupService.list(inspectionUserWorkingGroupQueryWrapper); |
... | @@ -106,7 +115,11 @@ public class ProcessStatisticsController { | ... | @@ -106,7 +115,11 @@ public class ProcessStatisticsController { |
106 | } else { | 115 | } else { |
107 | xunjian_count = 0; | 116 | xunjian_count = 0; |
108 | } | 117 | } |
109 | ProcessStatisticsVO xunjianProcessStatisticsVO = new ProcessStatisticsVO("巡检任务" ,"" , "0",xunjian_count.toString() ); | 118 | |
119 | //得到当前未开始的 | ||
120 | String moduleType = "1"; | ||
121 | List<JSONObject> inspectionTaskByUserIdList = inspectionTaskService.getInspectionTaskByUserId(userId, moduleType); | ||
122 | ProcessStatisticsVO xunjianProcessStatisticsVO = new ProcessStatisticsVO("巡检任务" ,"" , "0", inspectionTaskByUserIdList.size()+"" ); | ||
110 | 123 | ||
111 | processStatisticsList.add( xunjianProcessStatisticsVO ); | 124 | processStatisticsList.add( xunjianProcessStatisticsVO ); |
112 | 125 | ||
... | @@ -114,13 +127,20 @@ public class ProcessStatisticsController { | ... | @@ -114,13 +127,20 @@ public class ProcessStatisticsController { |
114 | String userRoleIds = BaseContextHandler.getRoles(); | 127 | String userRoleIds = BaseContextHandler.getRoles(); |
115 | String roleIds = BaseUtil.quoteEach(userRoleIds,","); | 128 | String roleIds = BaseUtil.quoteEach(userRoleIds,","); |
116 | 129 | ||
117 | Integer materialINCount = 0; | 130 | |
118 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | 131 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); |
119 | StringBuffer sql = new StringBuffer(" select count(1) from sys_role_permission rp ,sys_config c "); | 132 | Integer materialINCount = 0; |
120 | sql.append(" where rp.permission_id = c.config_value and c.config_id = 'MaterialIN_ID' and rp.role_id in ("+roleIds+") " ); | 133 | Integer authFlag = 0; |
121 | Integer authFlag = masterDB.queryForObject(sql.toString(),Integer.class); | 134 | //如果为管理员,则跳过权限 |
135 | if ("1".equals(BaseContextHandler.get("userType"))) { | ||
136 | authFlag = 1; | ||
137 | }else{ | ||
138 | StringBuffer sql = new StringBuffer(" select count(1) from sys_role_permission rp ,sys_config c "); | ||
139 | sql.append(" where rp.permission_id = c.config_value and c.config_id = 'MaterialIN_ID' and rp.role_id in ("+roleIds+") " ); | ||
140 | authFlag = masterDB.queryForObject(sql.toString(),Integer.class); | ||
141 | } | ||
122 | if(authFlag.intValue() > 0){ | 142 | if(authFlag.intValue() > 0){ |
123 | String sql2 = "select count(1) from erp_material_in where confirm_status =2 and audit_status>0 and audit_status<3"; | 143 | String sql2 = "select count(1) from erp_material_in where confirm_status =2 and audit_status>0 and audit_status<3 and apply_time >= '"+BaseUtil.getLastYearDate()+"' and apply_time<='"+BaseUtil.getCurrentDate()+"' "; |
124 | materialINCount = masterDB.queryForObject(sql2,Integer.class); | 144 | materialINCount = masterDB.queryForObject(sql2,Integer.class); |
125 | } | 145 | } |
126 | 146 | ||
... | @@ -140,11 +160,22 @@ public class ProcessStatisticsController { | ... | @@ -140,11 +160,22 @@ public class ProcessStatisticsController { |
140 | * @param process_key | 160 | * @param process_key |
141 | * @return | 161 | * @return |
142 | */ | 162 | */ |
143 | private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){ | 163 | /* private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){ |
144 | TaskQuery taskQuery = taskService.createTaskQuery(); | 164 | TaskQuery taskQuery = taskService.createTaskQuery(); |
145 | taskQuery.processDefinitionKey( process_key ); | 165 | taskQuery.processDefinitionKey( process_key ); |
146 | Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数 | 166 | Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数 |
147 | Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount | 167 | Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount |
148 | return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() ); | 168 | return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() ); |
169 | }*/ | ||
170 | |||
171 | |||
172 | private ProcessStatisticsVO queryProcessStatistics(String processName, String process_key, IPage<BladeFlow> page,BladeFlow bladeFlow){ | ||
173 | // String repairProcessDefinitionKey = "equipServicewx"; | ||
174 | bladeFlow.setProcessDefinitionKey(process_key); | ||
175 | long repairClaimCount = flowBusinessService.selectClaimPage(page, bladeFlow).getTotal(); | ||
176 | long repairToDoCount = flowBusinessService.selectTodoPage(page, bladeFlow).getTotal(); | ||
177 | // long repairDoneCount = flowBusinessService.selectDonePage(page, bladeFlow).getTotal(); | ||
178 | |||
179 | return new ProcessStatisticsVO(processName ,process_key , repairToDoCount+"", repairClaimCount+"" ); | ||
149 | } | 180 | } |
150 | } | 181 | } | ... | ... |
... | @@ -21,7 +21,7 @@ public class ProcessStatisticsVO { | ... | @@ -21,7 +21,7 @@ public class ProcessStatisticsVO { |
21 | private String totalCount; | 21 | private String totalCount; |
22 | 22 | ||
23 | public String getTotalCount() { | 23 | public String getTotalCount() { |
24 | return DigitalUtils.add( this.getTotalCount() , this.getClaimCount() ) ; | 24 | return DigitalUtils.add( this.getTodoCount() , this.getClaimCount() ) ; |
25 | } | 25 | } |
26 | 26 | ||
27 | public ProcessStatisticsVO(){ | 27 | public ProcessStatisticsVO(){ | ... | ... |
... | @@ -186,6 +186,30 @@ public class BaseUtil { | ... | @@ -186,6 +186,30 @@ public class BaseUtil { |
186 | return defaultStartDate; | 186 | return defaultStartDate; |
187 | } | 187 | } |
188 | 188 | ||
189 | public static String getCurrentDate() { | ||
190 | Date dNow = new Date(); // 当前时间 | ||
191 | Calendar calendar = Calendar.getInstance(); // 得到日历 | ||
192 | calendar.setTime(dNow);// 把当前时间赋给日历 | ||
193 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 设置时间格式 | ||
194 | String defaultStartDate = sdf.format(calendar); // 格式化时间 | ||
195 | // String defaultEndDate = sdf.format(dNow); //格式化当前时间 | ||
196 | return defaultStartDate; | ||
197 | } | ||
198 | public static String getLastYearDate() { | ||
199 | Date dNow = new Date(); // 当前时间 | ||
200 | Date dBefore = null;//new Date(); | ||
201 | Calendar calendar = Calendar.getInstance(); // 得到日历 | ||
202 | calendar.setTime(dNow);// 把当前时间赋给日历 | ||
203 | //calendar.add(Calendar.DAY_OF_MONTH, -1); // 设置为前一天 | ||
204 | calendar.add(Calendar.YEAR, -1); // 设置为上一年 | ||
205 | dBefore = calendar.getTime(); // 得到去年的时间 | ||
206 | |||
207 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 设置时间格式 | ||
208 | String defaultStartDate = sdf.format(dBefore); // 格式化时间 | ||
209 | // String defaultEndDate = sdf.format(dNow); //格式化当前时间 | ||
210 | return defaultStartDate; | ||
211 | } | ||
212 | |||
189 | /** | 213 | /** |
190 | * 保留两位小数 | 214 | * 保留两位小数 |
191 | * | 215 | * | ... | ... |
... | @@ -158,8 +158,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -158,8 +158,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
158 | return valueMapList; | 158 | return valueMapList; |
159 | } | 159 | } |
160 | 160 | ||
161 | |||
162 | |||
163 | /*public List<Map<String, Object>> getDataFromHY(String year, String departId,String startTime,String endTime) { | 161 | /*public List<Map<String, Object>> getDataFromHY(String year, String departId,String startTime,String endTime) { |
164 | List<Map<String, Object>> valueMapList = new ArrayList<>(); | 162 | List<Map<String, Object>> valueMapList = new ArrayList<>(); |
165 | String tbYear = String.valueOf(Integer.parseInt(year) - 1); | 163 | String tbYear = String.valueOf(Integer.parseInt(year) - 1); |
... | @@ -273,7 +271,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -273,7 +271,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
273 | 271 | ||
274 | //节能环保 大屏展示 | 272 | //节能环保 大屏展示 |
275 | public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ | 273 | public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ |
276 | //long startTime = System.nanoTime(); | 274 | long startTime = System.nanoTime(); |
277 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); | 275 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); |
278 | //当月数据 | 276 | //当月数据 |
279 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 277 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
... | @@ -298,10 +296,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -298,10 +296,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
298 | LoadRateVO loadRateVO = null; | 296 | LoadRateVO loadRateVO = null; |
299 | PowerConsumeVO powerConsumeVO = null; | 297 | PowerConsumeVO powerConsumeVO = null; |
300 | ResultNumberVO c02NumberVO = null;//CO2排放对象 | 298 | ResultNumberVO c02NumberVO = null;//CO2排放对象 |
301 | ResultNumberVO cod_NumberVO = null;//COD | ||
302 | ResultNumberVO nh3n_NumberVO = null;//NH3-N | ||
303 | ResultNumberVO tp_NumberVO = null;//TP | ||
304 | ResultNumberVO tn_NumberVO = null;//TN | ||
305 | 299 | ||
306 | List<PowerConsumeVO> powerConsumeVOList = new ArrayList();//各站点能源消耗排名 | 300 | List<PowerConsumeVO> powerConsumeVOList = new ArrayList();//各站点能源消耗排名 |
307 | List<LoadRateVO> loadRateVOList = new ArrayList<>();//负荷率对象 | 301 | List<LoadRateVO> loadRateVOList = new ArrayList<>();//负荷率对象 |
... | @@ -311,54 +305,53 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -311,54 +305,53 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
311 | JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData | 305 | JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData |
312 | JnhbReportData lastYearReportDataTemp ;//lastYearMapData | 306 | JnhbReportData lastYearReportDataTemp ;//lastYearMapData |
313 | ResultChartsVO energyConsumeChart = null; | 307 | ResultChartsVO energyConsumeChart = null; |
308 | JnhbLargeScreenExpressionVO largeScreenExpressionVO = new JnhbLargeScreenExpressionVO();//表达式 | ||
314 | for(JnhbReportData reportData : jnhbReportDataList){ | 309 | for(JnhbReportData reportData : jnhbReportDataList){ |
315 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 | 310 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 |
316 | largeScreenVO.setHeadStatisticsValue( reportData); | 311 | //largeScreenVO.setHeadStatisticsValue( reportData); |
317 | lastMonthReportDataTemp = lastMonthMapData.get(reportData.getDepartId()); | 312 | //largeScreenExpressionVO.setHeadStatisticsValue(reportData); |
318 | lastYearReportDataTemp = lastYearMapData.get(reportData.getDepartId()); | 313 | largeScreenExpressionVO.setHeadStatisticsValue(reportData ); |
314 | |||
315 | lastMonthReportDataTemp = lastMonthMapData.get(reportData.getDepartId());// 上月环比 | ||
316 | lastYearReportDataTemp = lastYearMapData.get(reportData.getDepartId());// 去年 同比 | ||
319 | //各站点系统负荷率排名: | 317 | //各站点系统负荷率排名: |
320 | loadRateVO = new LoadRateVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getWsclgm(),reportData.getWssjcll(),reportData.getWsfhl()); | 318 | loadRateVO = new LoadRateVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getWsclgm(),reportData.getWssjcll(),reportData.getWsfhl()); |
321 | //各站点能源消耗排名: | 319 | //各站点能源消耗排名: |
322 | powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); | 320 | powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); |
323 | 321 | ||
324 | |||
325 | c02NumberVO = new ResultNumberVO(); | 322 | c02NumberVO = new ResultNumberVO(); |
326 | c02NumberVO.setName( reportData.getDepartName() ); | 323 | c02NumberVO.setName( reportData.getDepartName() ); |
327 | c02NumberVO.setValue( reportData.getCodxjl() ); | 324 | c02NumberVO.setValue( reportData.getCodxjl() ); |
328 | cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl()); | 325 | |
329 | nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl()); | 326 | largeScreenExpressionVO.setReduceStatistics(reportData); |
330 | tp_NumberVO = new ResultNumberVO();tp_NumberVO.setValue(reportData.getTpxjl()); | ||
331 | tn_NumberVO = new ResultNumberVO();tn_NumberVO.setValue(reportData.getTnxjl()); | ||
332 | /*************同比环比数据设置****************/ | 327 | /*************同比环比数据设置****************/ |
333 | if ( lastMonthReportDataTemp != null ){ | 328 | if ( lastMonthReportDataTemp != null ){ |
334 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 | 329 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 |
335 | largeScreenVO.setHeadStatisticsValueHB( lastMonthReportDataTemp); | 330 | //largeScreenVO.setHeadStatisticsValueHB( lastMonthReportDataTemp); |
331 | largeScreenExpressionVO.setHeadStatisticsValueHB( lastMonthReportDataTemp); | ||
336 | 332 | ||
337 | loadRateVO.setValueHb(lastMonthReportDataTemp.getWsfhl() ); | 333 | loadRateVO.setValueHb(lastMonthReportDataTemp.getWsfhl() ); |
338 | powerConsumeVO.setValueHb(lastMonthReportDataTemp.getDsdh() ); | 334 | powerConsumeVO.setValueHb(lastMonthReportDataTemp.getDsdh() ); |
339 | c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() ); | 335 | c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() ); |
340 | 336 | ||
341 | cod_NumberVO.setValueHb(reportData.getCodxjl()); | 337 | //消减量统计 环比 |
342 | nh3n_NumberVO.setValueHb(reportData.getTnxjl()); | 338 | largeScreenExpressionVO.setReduceStatisticsHB(reportData); |
343 | tp_NumberVO.setValueHb(reportData.getTpxjl()); | ||
344 | tn_NumberVO.setValueHb(reportData.getTnxjl()); | ||
345 | } | 339 | } |
346 | if ( lastYearReportDataTemp != null ){ | 340 | if ( lastYearReportDataTemp != null ){ |
347 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 | 341 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 |
348 | largeScreenVO.setHeadStatisticsValueTB( lastYearReportDataTemp); | 342 | //largeScreenVO.setHeadStatisticsValueTB( lastYearReportDataTemp); |
343 | largeScreenExpressionVO.setHeadStatisticsValueTB( lastYearReportDataTemp ); | ||
349 | 344 | ||
350 | loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() ); | 345 | loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() ); |
351 | powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() ); | 346 | powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() ); |
352 | c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() ); | 347 | c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() ); |
353 | 348 | ||
354 | cod_NumberVO.setValueHb(reportData.getCodxjl()); | 349 | //消减量统计 同比 |
355 | nh3n_NumberVO.setValueHb(reportData.getTnxjl()); | 350 | largeScreenExpressionVO.setReduceStatisticsTB(reportData); |
356 | tp_NumberVO.setValueHb(reportData.getTpxjl()); | ||
357 | tn_NumberVO.setValueHb(reportData.getTnxjl()); | ||
358 | } | 351 | } |
359 | //loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb ); | 352 | //loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb ); |
360 | largeScreenVO.getLoadRateVOList().add(loadRateVO ); | 353 | loadRateVOList.add(loadRateVO ); |
361 | largeScreenVO.getPowerConsumeVOList().add( powerConsumeVO ); | 354 | powerConsumeVOList.add( powerConsumeVO ); |
362 | 355 | ||
363 | //ESG减排趋势 | 356 | //ESG减排趋势 |
364 | energyConsumeChart = new ResultChartsVO(); | 357 | energyConsumeChart = new ResultChartsVO(); |
... | @@ -370,17 +363,39 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -370,17 +363,39 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
370 | largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ; | 363 | largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ; |
371 | 364 | ||
372 | //消减量统计 | 365 | //消减量统计 |
373 | largeScreenVO.setReduceStatistics(1,cod_NumberVO); | 366 | /*largeScreenVO.setReduceStatistics(1,cod_NumberVO); |
374 | largeScreenVO.setReduceStatistics(2,nh3n_NumberVO); | 367 | largeScreenVO.setReduceStatistics(2,nh3n_NumberVO); |
375 | largeScreenVO.setReduceStatistics(3,tp_NumberVO); | 368 | largeScreenVO.setReduceStatistics(3,tp_NumberVO); |
376 | largeScreenVO.setReduceStatistics(4,tn_NumberVO); | 369 | largeScreenVO.setReduceStatistics(4,tn_NumberVO);*/ |
370 | |||
371 | largeScreenExpressionVO.setReduceStatistics(reportData); | ||
377 | //CO2排放排名 | 372 | //CO2排放排名 |
378 | largeScreenVO.getCo2DataList().add( c02NumberVO ) ; | 373 | co2DataList.add( c02NumberVO ); |
379 | //排放指标 | 374 | //排放指标 |
380 | // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl | 375 | // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl |
381 | wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; | 376 | wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; |
382 | } | 377 | } |
383 | largeScreenVO.getCo2DataList().add( c02NumberVO ) ; | 378 | //设置计算表达式 |
379 | largeScreenVO.setLargeScreenExpressionVO( largeScreenExpressionVO ); | ||
380 | |||
381 | //头文件Head | ||
382 | //largeScreenVO.setHeadStatisticsValueTB(); | ||
383 | //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 | ||
384 | largeScreenVO.setHeadStatisticsValue( ); | ||
385 | |||
386 | //各站点能源消耗排名 | ||
387 | largeScreenVO.setPowerConsumeVOList( powerConsumeVOList ); | ||
388 | //负荷率对象 | ||
389 | largeScreenVO.setLoadRateVOList( loadRateVOList ); | ||
390 | |||
391 | //消减量统计 | ||
392 | largeScreenVO.setReduceStatistics(); | ||
393 | |||
394 | //CO2排放排名 | ||
395 | largeScreenVO.setCo2DataList( co2DataList ) ; | ||
396 | |||
397 | //largeScreenVO.getCo2DataList().add( c02NumberVO ) ; | ||
398 | //废物处理对象集合 | ||
384 | largeScreenVO.setWasteMaterialList( wasteMaterialList ) ; | 399 | largeScreenVO.setWasteMaterialList( wasteMaterialList ) ; |
385 | //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | 400 | //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); |
386 | //主库数据源 | 401 | //主库数据源 |
... | @@ -391,6 +406,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -391,6 +406,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
391 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); | 406 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); |
392 | largeScreenVO.setEquipmentL2( count2 ); | 407 | largeScreenVO.setEquipmentL2( count2 ); |
393 | //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | 408 | //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); |
409 | |||
394 | // 各站点系统负荷率排名:负荷率排序、设置排名 | 410 | // 各站点系统负荷率排名:负荷率排序、设置排名 |
395 | /* if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){ | 411 | /* if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){ |
396 | // 根据分数排序 | 412 | // 根据分数排序 |
... | @@ -404,7 +420,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -404,7 +420,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
404 | loadRateVORank.setRank( rank++); | 420 | loadRateVORank.setRank( rank++); |
405 | }*//* | 421 | }*//* |
406 | }*/ | 422 | }*/ |
407 | //各站点能源消耗排名 吨水电耗 | 423 | //各站点能源消耗排名 吨水电耗 |
408 | /*if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) { | 424 | /*if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) { |
409 | // 根据分数排序 | 425 | // 根据分数排序 |
410 | Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() { | 426 | Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() { | ... | ... |
... | @@ -75,10 +75,10 @@ | ... | @@ -75,10 +75,10 @@ |
75 | <if test="loadRateType != null and loadRateType == 1"> | 75 | <if test="loadRateType != null and loadRateType == 1"> |
76 | avg(ri.item_value)/(100*fi.pro_scale) >= 60 and avg(ri.item_value)/(100*fi.pro_scale) <= 120 | 76 | avg(ri.item_value)/(100*fi.pro_scale) >= 60 and avg(ri.item_value)/(100*fi.pro_scale) <= 120 |
77 | </if> | 77 | </if> |
78 | <if test="loadRateType != null and loadRateType == 2"> | 78 | <if test="loadRateType != null and loadRateType == 3"> |
79 | avg(ri.item_value)/(100*fi.pro_scale) < 60 | 79 | avg(ri.item_value)/(100*fi.pro_scale) < 60 |
80 | </if> | 80 | </if> |
81 | <if test="loadRateType != null and loadRateType == 3"> | 81 | <if test="loadRateType != null and loadRateType == 2"> |
82 | avg(ri.item_value)/(100*fi.pro_scale) > 120 | 82 | avg(ri.item_value)/(100*fi.pro_scale) > 120 |
83 | </if> | 83 | </if> |
84 | </trim> | 84 | </trim> |
... | @@ -99,10 +99,10 @@ | ... | @@ -99,10 +99,10 @@ |
99 | <if test="loadRateType != null and loadRateType == 1"> | 99 | <if test="loadRateType != null and loadRateType == 1"> |
100 | avg(ri.item_value)/(100*fi.pro_scale) >= 60 and avg(ri.item_value)/(100*fi.pro_scale) <= 120 | 100 | avg(ri.item_value)/(100*fi.pro_scale) >= 60 and avg(ri.item_value)/(100*fi.pro_scale) <= 120 |
101 | </if> | 101 | </if> |
102 | <if test="loadRateType != null and loadRateType == 2"> | 102 | <if test="loadRateType != null and loadRateType == 3"> |
103 | avg(ri.item_value)/(100*fi.pro_scale) < 60 | 103 | avg(ri.item_value)/(100*fi.pro_scale) < 60 |
104 | </if> | 104 | </if> |
105 | <if test="loadRateType != null and loadRateType == 3"> | 105 | <if test="loadRateType != null and loadRateType == 2"> |
106 | avg(ri.item_value)/(100*fi.pro_scale) > 120 | 106 | avg(ri.item_value)/(100*fi.pro_scale) > 120 |
107 | </if> | 107 | </if> |
108 | </trim> | 108 | </trim> | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/report/vo/JnhbLargeScreenExpressionVO.java
0 → 100644
此文件的差异被折叠,
点击展开。
... | @@ -2,6 +2,7 @@ package com.skua.modules.report.vo; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.report.vo; |
2 | 2 | ||
3 | import com.skua.modules.report.vo.largeScreen.*; | 3 | import com.skua.modules.report.vo.largeScreen.*; |
4 | import com.skua.tool.util.DigitalUtils; | 4 | import com.skua.tool.util.DigitalUtils; |
5 | import com.skua.tool.util.JSUtils; | ||
5 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
6 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
7 | import lombok.Data; | 8 | import lombok.Data; |
... | @@ -16,7 +17,7 @@ import java.util.List; | ... | @@ -16,7 +17,7 @@ import java.util.List; |
16 | @ApiModel(value="生产运营--大屏对象", description="生产运营--月度生产数据报表") | 17 | @ApiModel(value="生产运营--大屏对象", description="生产运营--月度生产数据报表") |
17 | public class JnhbLargeScreenVO { | 18 | public class JnhbLargeScreenVO { |
18 | @ApiModelProperty(value = "头部统计数值") | 19 | @ApiModelProperty(value = "头部统计数值") |
19 | private List<ResultNumberVO> headStatisticsList = new ArrayList<>(8); | 20 | private List<ResultNumberVO> headStatisticsList = new ArrayList<>(); |
20 | 21 | ||
21 | @ApiModelProperty(value = "各站点能源消耗排名") | 22 | @ApiModelProperty(value = "各站点能源消耗排名") |
22 | private List<PowerConsumeVO> powerConsumeVOList = new ArrayList(); | 23 | private List<PowerConsumeVO> powerConsumeVOList = new ArrayList(); |
... | @@ -44,50 +45,48 @@ public class JnhbLargeScreenVO { | ... | @@ -44,50 +45,48 @@ public class JnhbLargeScreenVO { |
44 | private Integer equipmentL1; | 45 | private Integer equipmentL1; |
45 | @ApiModelProperty(value = "二级能耗设备") | 46 | @ApiModelProperty(value = "二级能耗设备") |
46 | private Integer equipmentL2; | 47 | private Integer equipmentL2; |
48 | |||
49 | private JnhbLargeScreenExpressionVO largeScreenExpressionVO; | ||
47 | /*** | 50 | /*** |
48 | * 设置消减统计记录 | 51 | * 设置头文件 |
49 | */ | 52 | */ |
50 | public void setHeadStatisticsValue(JnhbReportData reportData){ | ||
51 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | ||
52 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | ||
53 | this.getHeadStatisticsList().get(0).setValue( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValue() , reportData.getWssjcll()) ); | ||
54 | this.getHeadStatisticsList().get(1).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValue() , reportData.getWsfhl()) ); | ||
55 | this.getHeadStatisticsList().get(2).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValue() , reportData.getDh() )); | ||
56 | this.getHeadStatisticsList().get(3).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValue() , reportData.getQy()) ); | ||
57 | this.getHeadStatisticsList().get(4).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValue() , reportData.getXssyl()) ); | ||
58 | this.getHeadStatisticsList().get(5).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValue() , reportData.getZhnyxhl()) ); | ||
59 | this.getHeadStatisticsList().get(6).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValue() , reportData.getEyhtpfl() )); | ||
60 | this.getHeadStatisticsList().get(7).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValue() , reportData.getDsdh() )); | ||
61 | } | ||
62 | public void setHeadStatisticsValueTB(JnhbReportData reportData){ | ||
63 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | ||
64 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | ||
65 | 53 | ||
66 | this.getHeadStatisticsList().get(0).setValueTb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueTb() , reportData.getWssjcll()) ); | 54 | public void setHeadStatisticsValue(){ |
67 | this.getHeadStatisticsList().get(1).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueTb() , reportData.getWsfhl()) ); | ||
68 | this.getHeadStatisticsList().get(2).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueTb() , reportData.getDh() )); | ||
69 | this.getHeadStatisticsList().get(3).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueTb() , reportData.getQy()) ); | ||
70 | this.getHeadStatisticsList().get(4).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueTb() , reportData.getXssyl()) ); | ||
71 | this.getHeadStatisticsList().get(5).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueTb() , reportData.getZhnyxhl()) ); | ||
72 | this.getHeadStatisticsList().get(6).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueTb() , reportData.getEyhtpfl() )); | ||
73 | this.getHeadStatisticsList().get(7).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueTb() , reportData.getDsdh() )); | ||
74 | } | ||
75 | public void setHeadStatisticsValueHB(JnhbReportData reportData){ | ||
76 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh | 55 | // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh |
77 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 | 56 | ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 |
78 | this.getHeadStatisticsList().get(0).setValueHb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueHb() , reportData.getWssjcll()) ); | 57 | this.getHeadStatisticsList().add( getResultNumberVO( "wssjcll", this.getLargeScreenExpressionVO().getHead_wssjcll_expression() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_hb() , this.getLargeScreenExpressionVO().getHead_wssjcll_expression_tb()) );//污水处理量 |
79 | this.getHeadStatisticsList().get(1).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueHb() , reportData.getWsfhl()) ); | 58 | this.getHeadStatisticsList().add( getResultNumberVO( "wsfhl",this.getLargeScreenExpressionVO().getHead_wsfhl_expression() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_wsfhl_expression_tb()) );//系统负荷率 |
80 | this.getHeadStatisticsList().get(2).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueHb() , reportData.getDh() )); | 59 | this.getHeadStatisticsList().add( getResultNumberVO( "dh",this.getLargeScreenExpressionVO().getHead_dh_expression() , this.getLargeScreenExpressionVO().getHead_dh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dh_expression_tb()) );//电耗 |
81 | this.getHeadStatisticsList().get(3).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueHb() , reportData.getQy()) ); | 60 | this.getHeadStatisticsList().add( getResultNumberVO( "qy",this.getLargeScreenExpressionVO().getHead_qy_expression() , this.getLargeScreenExpressionVO().getHead_qy_expression_hb() , this.getLargeScreenExpressionVO().getHead_qy_expression_tb()) );//汽油 |
82 | this.getHeadStatisticsList().get(4).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueHb() , reportData.getXssyl()) ); | 61 | this.getHeadStatisticsList().add( getResultNumberVO( "xinshui",this.getLargeScreenExpressionVO().getHead_xssyl_expression() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_hb() , this.getLargeScreenExpressionVO().getHead_xssyl_expression_tb()) );//薪水 |
83 | this.getHeadStatisticsList().get(5).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueHb() , reportData.getZhnyxhl()) ); | 62 | this.getHeadStatisticsList().add( getResultNumberVO( "zhnyxhl",this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_hb() , this.getLargeScreenExpressionVO().getHead_zhnyxhl_expression_tb()) );//综合能耗 |
84 | this.getHeadStatisticsList().get(6).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueHb() , reportData.getEyhtpfl() )); | 63 | this.getHeadStatisticsList().add( getResultNumberVO( "eyhtpfl",this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_hb() , this.getLargeScreenExpressionVO().getHead_eyhtpfl_expression_tb()) );//C02 |
85 | this.getHeadStatisticsList().get(7).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueHb() , reportData.getDsdh() )); | 64 | this.getHeadStatisticsList().add( getResultNumberVO( "dsdh",this.getLargeScreenExpressionVO().getHead_dsdh_expression() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_hb() , this.getLargeScreenExpressionVO().getHead_dsdh_expression_tb()) );//吨水电耗 |
86 | } | 65 | } |
87 | 66 | ||
67 | |||
88 | /*** | 68 | /*** |
89 | * 设置:消减统计记录 | 69 | * 设置:消减统计记录 |
90 | */ | 70 | */ |
71 | public void setReduceStatistics(){ | ||
72 | this.getReduceStatisticsList().add( getResultNumberVO( "cod",this.getLargeScreenExpressionVO().getReduce_statistics_cod() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_tb()) );//吨水电耗 | ||
73 | this.getReduceStatisticsList().add( getResultNumberVO( "NH3-N",this.getLargeScreenExpressionVO().getReduce_statistics_nh3n() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_tb()) );//吨水电耗 | ||
74 | this.getReduceStatisticsList().add( getResultNumberVO( "TP",this.getLargeScreenExpressionVO().getReduce_statistics_tp() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_tb()) );//吨水电耗 | ||
75 | this.getReduceStatisticsList().add( getResultNumberVO( "TN",this.getLargeScreenExpressionVO().getReduce_statistics_tn() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_tb()) );//吨水电耗 | ||
76 | } | ||
77 | |||
78 | |||
79 | |||
80 | private ResultNumberVO getResultNumberVO(String name , String valueExpression ,String valueHbExpression,String valueTbExpression){ | ||
81 | ResultNumberVO head_wssjcll = new ResultNumberVO();//污水处理量 | ||
82 | //head_wssjcll.setName( name); | ||
83 | head_wssjcll.setValue( JSUtils.executeExpression(valueExpression , "0") ); | ||
84 | head_wssjcll.setValueHb( JSUtils.executeExpression( valueHbExpression , "0") ); | ||
85 | head_wssjcll.setValueTb(JSUtils.executeExpression( valueTbExpression , "0") ); | ||
86 | return head_wssjcll; | ||
87 | } | ||
88 | |||
89 | |||
91 | public void setReduceStatistics(int index , ResultNumberVO resultNumberVO){ | 90 | public void setReduceStatistics(int index , ResultNumberVO resultNumberVO){ |
92 | ResultNumberVO resultNumberVOTemp = reduceStatisticsList.get( index - 1); | 91 | ResultNumberVO resultNumberVOTemp = reduceStatisticsList.get( index - 1); |
93 | resultNumberVOTemp.setValue(DigitalUtils.add(resultNumberVOTemp.getValue() , resultNumberVO.getValue() ) ); | 92 | resultNumberVOTemp.setValue(DigitalUtils.add(resultNumberVOTemp.getValue() , resultNumberVO.getValue() ) ); |
... | @@ -97,7 +96,7 @@ public class JnhbLargeScreenVO { | ... | @@ -97,7 +96,7 @@ public class JnhbLargeScreenVO { |
97 | 96 | ||
98 | 97 | ||
99 | public JnhbLargeScreenVO(){ | 98 | public JnhbLargeScreenVO(){ |
100 | //头部数值统计 | 99 | /*//头部数值统计 |
101 | String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水"; | 100 | String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水"; |
102 | String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨"; | 101 | String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨"; |
103 | String[] nameList = names.split(","); | 102 | String[] nameList = names.split(","); |
... | @@ -109,7 +108,6 @@ public class JnhbLargeScreenVO { | ... | @@ -109,7 +108,6 @@ public class JnhbLargeScreenVO { |
109 | numberVO.setUnit(unitList[i] ); | 108 | numberVO.setUnit(unitList[i] ); |
110 | this.getHeadStatisticsList().add(numberVO) ; | 109 | this.getHeadStatisticsList().add(numberVO) ; |
111 | } | 110 | } |
112 | |||
113 | //消减量统计 | 111 | //消减量统计 |
114 | names= "COD,NH3-N,TP,TN"; | 112 | names= "COD,NH3-N,TP,TN"; |
115 | nameList = names.split(","); | 113 | nameList = names.split(","); |
... | @@ -117,10 +115,7 @@ public class JnhbLargeScreenVO { | ... | @@ -117,10 +115,7 @@ public class JnhbLargeScreenVO { |
117 | numberVO = new ResultNumberVO(); | 115 | numberVO = new ResultNumberVO(); |
118 | numberVO.setName( name); | 116 | numberVO.setName( name); |
119 | this.getReduceStatisticsList().add(numberVO) ; | 117 | this.getReduceStatisticsList().add(numberVO) ; |
120 | } | 118 | }*/ |
121 | |||
122 | |||
123 | |||
124 | } | 119 | } |
125 | 120 | ||
126 | } | 121 | } | ... | ... |
-
请 注册 或 登录 后发表评论