6946f063 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 3944f075 ad045639
...@@ -108,7 +108,9 @@ public class DigitalUtils { ...@@ -108,7 +108,9 @@ public class DigitalUtils {
108 */ 108 */
109 public static String division(String dividend , String divisor ){ 109 public static String division(String dividend , String divisor ){
110 String resultStr = null; 110 String resultStr = null;
111 try{ 111 String expression = dividend+ "/ "+ divisor;
112 resultStr = JSUtils.executeExpression(expression,"0.00");
113 /* try{
112 if( isNumber(dividend) && isNumber( divisor) && Double.parseDouble(divisor) != 0 ){ 114 if( isNumber(dividend) && isNumber( divisor) && Double.parseDouble(divisor) != 0 ){
113 BigDecimal dividend_BD = new BigDecimal(dividend); 115 BigDecimal dividend_BD = new BigDecimal(dividend);
114 BigDecimal divisor_BD = new BigDecimal(divisor); 116 BigDecimal divisor_BD = new BigDecimal(divisor);
...@@ -116,8 +118,9 @@ public class DigitalUtils { ...@@ -116,8 +118,9 @@ public class DigitalUtils {
116 resultStr = result.toString(); 118 resultStr = result.toString();
117 } 119 }
118 }catch(Exception e){ 120 }catch(Exception e){
121 System.out.println("dividend = "+ dividend +"; divisor = "+ divisor);
119 e.printStackTrace(); 122 e.printStackTrace();
120 } 123 }*/
121 124
122 //System.out.print("请输入被除数:");double dividend =scanner.nextDouble(); 125 //System.out.print("请输入被除数:");double dividend =scanner.nextDouble();
123 // System.out.print("请输入除数:");double divisor =scanner.nextDouble(); 126 // System.out.print("请输入除数:");double divisor =scanner.nextDouble();
......
...@@ -29,7 +29,6 @@ public class SkApplication { ...@@ -29,7 +29,6 @@ public class SkApplication {
29 "swagger-ui: \thttp://" + ip + ":" + port + path + "/swagger-ui.html\n\t" + 29 "swagger-ui: \thttp://" + ip + ":" + port + path + "/swagger-ui.html\n\t" +
30 "Doc: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" + 30 "Doc: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" +
31 "----------------------------------------------------------"); 31 "----------------------------------------------------------");
32
33 } 32 }
34 33
35 // @Configuration 34 // @Configuration
......
...@@ -55,8 +55,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -55,8 +55,6 @@ import io.swagger.annotations.ApiOperation;
55 public class AjhMeetingSendController { 55 public class AjhMeetingSendController {
56 @Autowired 56 @Autowired
57 private IAjhMeetingSendService ajhMeetingSendService; 57 private IAjhMeetingSendService ajhMeetingSendService;
58 @Autowired
59 private IAjhMeetingService ajhMeetingService;
60 58
61 @Value("${skua.path.upload}") 59 @Value("${skua.path.upload}")
62 private String upLoadPath; 60 private String upLoadPath;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <update id="checkAnswerByUserPaperId" > 6 <update id="checkAnswerByUserPaperId" >
7 update edu_user_answer ua 7 update edu_user_answer ua
8 set ua.score = IFNULL((select pq.score from edu_question q ,edu_paper_question pq where q.id = pq.question_id and ua.answer = q.question_answer and ua.paper_id= pq.paper_id and ua.question_id = q.id) , 0) 8 set ua.score = IFNULL((select pq.score from edu_question q ,edu_paper_question pq where q.id = pq.question_id and ua.answer = q.question_answer and ua.paper_id= pq.paper_id and ua.question_id = q.id) , 0)
9 where ua.user_paper_id = = #{userPaperId} 9 where ua.user_paper_id = #{userPaperId}
10 </update> 10 </update>
11 11
12 </mapper>
...\ No newline at end of file ...\ No newline at end of file
12 </mapper>
......
...@@ -59,8 +59,7 @@ public class EmergencyRiskEventController { ...@@ -59,8 +59,7 @@ public class EmergencyRiskEventController {
59 Result<List<Map<String,Object>>> result = new Result<>(); 59 Result<List<Map<String,Object>>> result = new Result<>();
60 QueryWrapper<EmergencyRiskEvent> queryWrapper = new QueryWrapper<EmergencyRiskEvent>();//QueryGenerator.initQueryWrapper(equipmentDefectManagement, req.getParameterMap()); 60 QueryWrapper<EmergencyRiskEvent> queryWrapper = new QueryWrapper<EmergencyRiskEvent>();//QueryGenerator.initQueryWrapper(equipmentDefectManagement, req.getParameterMap());
61 queryWrapper.select("count(id) count,handle_result handleResult"); 61 queryWrapper.select("count(id) count,handle_result handleResult");
62 queryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); 62
63 queryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime());
64 queryWrapper.groupBy("handle_result"); 63 queryWrapper.groupBy("handle_result");
65 List<Map<String,Object>> list = emergencyRiskEventService.listMaps(queryWrapper); 64 List<Map<String,Object>> list = emergencyRiskEventService.listMaps(queryWrapper);
66 result.setSuccess(true); 65 result.setSuccess(true);
...@@ -79,8 +78,7 @@ public class EmergencyRiskEventController { ...@@ -79,8 +78,7 @@ public class EmergencyRiskEventController {
79 emergencyRiskEventQueryWrapper.eq("handle_result","1"); 78 emergencyRiskEventQueryWrapper.eq("handle_result","1");
80 emergencyRiskEventQueryWrapper.ne("event_type",""); 79 emergencyRiskEventQueryWrapper.ne("event_type","");
81 emergencyRiskEventQueryWrapper.isNotNull("event_type"); 80 emergencyRiskEventQueryWrapper.isNotNull("event_type");
82 emergencyRiskEventQueryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); 81
83 emergencyRiskEventQueryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime());
84 emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); 82 emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type");
85 List<Map<String,Object>> list = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); 83 List<Map<String,Object>> list = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper);
86 //已处理应急事件 84 //已处理应急事件
...@@ -89,8 +87,7 @@ public class EmergencyRiskEventController { ...@@ -89,8 +87,7 @@ public class EmergencyRiskEventController {
89 emergencyRiskEventQueryWrapper.eq("handle_result","3"); 87 emergencyRiskEventQueryWrapper.eq("handle_result","3");
90 emergencyRiskEventQueryWrapper.ne("event_type",""); 88 emergencyRiskEventQueryWrapper.ne("event_type","");
91 emergencyRiskEventQueryWrapper.isNotNull("event_type"); 89 emergencyRiskEventQueryWrapper.isNotNull("event_type");
92 emergencyRiskEventQueryWrapper.ge(StringUtils.isNotEmpty(equipmentDefectManagement.getStartTime()),"report_date",equipmentDefectManagement.getStartTime()); 90
93 emergencyRiskEventQueryWrapper.le(StringUtils.isNotEmpty(equipmentDefectManagement.getEndTime()),"report_date",equipmentDefectManagement.getEndTime());
94 emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type"); 91 emergencyRiskEventQueryWrapper.groupBy("handle_result","event_type");
95 List<Map<String,Object>> yclList = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper); 92 List<Map<String,Object>> yclList = emergencyRiskEventService.listMaps(emergencyRiskEventQueryWrapper);
96 //获取未处理、已处理中的应急事件类型 93 //获取未处理、已处理中的应急事件类型
...@@ -133,40 +130,40 @@ public class EmergencyRiskEventController { ...@@ -133,40 +130,40 @@ public class EmergencyRiskEventController {
133 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 130 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
134 HttpServletRequest req) { 131 HttpServletRequest req) {
135 Result<IPage<EmergencyRiskEvent>> result = new Result<IPage<EmergencyRiskEvent>>(); 132 Result<IPage<EmergencyRiskEvent>> result = new Result<IPage<EmergencyRiskEvent>>();
133 //2023-10-05 00:00:00 2023-10-05 23:59:59
136 QueryWrapper<EmergencyRiskEvent> queryWrapper = QueryGenerator.initQueryWrapper(emergencyRiskEvent, req.getParameterMap()); 134 QueryWrapper<EmergencyRiskEvent> queryWrapper = QueryGenerator.initQueryWrapper(emergencyRiskEvent, req.getParameterMap());
137 Page<EmergencyRiskEvent> page = new Page<EmergencyRiskEvent>(pageNo, pageSize); 135 Page<EmergencyRiskEvent> page = new Page<EmergencyRiskEvent>(pageNo, pageSize);
138 136
139 if(StringUtils.isNotEmpty(emergencyRiskEvent.getStartTime())){ 137
140 queryWrapper.ge("report_date",emergencyRiskEvent.getStartTime());
141 }
142 if(StringUtils.isNotEmpty(emergencyRiskEvent.getEndTime())){
143 queryWrapper.le("report_date",emergencyRiskEvent.getEndTime());
144 }
145 IPage<EmergencyRiskEvent> pageList = emergencyRiskEventService.page(page, queryWrapper); 138 IPage<EmergencyRiskEvent> pageList = emergencyRiskEventService.page(page, queryWrapper);
146 139
147 //获取流程状态 140 //获取流程状态
148 List<EmergencyRiskEvent> records = pageList.getRecords(); 141 List<EmergencyRiskEvent> records = pageList.getRecords();
149 Set<String> processInstanceIdSet = records.stream().filter(data-> StringUtils.isNotBlank(data.getProcessInstanceId())) 142 if(records != null && !records.isEmpty()){
150 .map(EmergencyRiskEvent::getProcessInstanceId).collect(Collectors.toSet()); 143 Set<String> processInstanceIdSet = records.stream().filter(data-> StringUtils.isNotBlank(data.getProcessInstanceId()))
151 Map<String, Map<String, String>> processInstanceMap; 144 .map(EmergencyRiskEvent::getProcessInstanceId).collect(Collectors.toSet());
152 try { 145 Map<String, Map<String, String>> processInstanceMap;
153 processInstanceMap = flowBusinessService.getProcessState(processInstanceIdSet); 146 try {
154 } catch (Exception e) { 147 processInstanceMap = flowBusinessService.getProcessState(processInstanceIdSet);
155 e.printStackTrace(); 148 } catch (Exception e) {
156 processInstanceMap = new HashMap<>(); 149 e.printStackTrace();
157 } 150 processInstanceMap = new HashMap<>();
158 for (EmergencyRiskEvent record : records) { 151 }
159 record.getFlow().setProcessDefinitionKey(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionKey")); 152 for (EmergencyRiskEvent record : records) {
160 record.getFlow().setTaskDefinitionKey(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("taskDefinitionKey")); 153 record.getFlow().setProcessDefinitionKey(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionKey"));
161 record.getFlow().setStatus(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("state")); 154 record.getFlow().setTaskDefinitionKey(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("taskDefinitionKey"));
162 record.getFlow().setTaskName(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionName")); 155 record.getFlow().setStatus(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("state"));
163 } 156 record.getFlow().setTaskName(processInstanceMap.getOrDefault(record.getProcessInstanceId(), new HashMap<>()).get("processDefinitionName"));
157 }
158 }
159
164 160
165 result.setSuccess(true); 161 result.setSuccess(true);
166 result.setResult(pageList); 162 result.setResult(pageList);
167 return result; 163 return result;
168 } 164 }
169 165
166
170 /** 167 /**
171 168
172 /** 169 /**
......
...@@ -143,10 +143,5 @@ public class EmergencyRiskEvent extends FlowEntity { ...@@ -143,10 +143,5 @@ public class EmergencyRiskEvent extends FlowEntity {
143 @Excel(name = "删除标识,0:正常,1:删除", width = 15) 143 @Excel(name = "删除标识,0:正常,1:删除", width = 15)
144 @ApiModelProperty(value = "删除标识,0:正常,1:删除") 144 @ApiModelProperty(value = "删除标识,0:正常,1:删除")
145 private Integer delFlag; 145 private Integer delFlag;
146 @TableField(exist = false) 146
147 @ApiModelProperty(value = "开始时间")
148 private String startTime;
149 @TableField(exist = false)
150 @ApiModelProperty(value = "结束时间")
151 private String endTime;
152 } 147 }
......
1 package com.skua.modules.process.controller;
2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 import com.skua.core.api.vo.Result;
5 import com.skua.core.aspect.annotation.AutoLog;
6 import com.skua.core.context.BaseContextHandler;
7 import com.skua.core.context.SpringContextUtils;
8 import com.skua.modules.equipment.entity.EquipmentMaintainTask;
9 import com.skua.modules.equipment.service.IEquipmentMaintainTaskService;
10 import com.skua.modules.flow.core.utils.TaskUtil;
11 import com.skua.modules.flow.utils.Func;
12 import com.skua.modules.inspection.entity.InspectionUserWorkingGroup;
13 import com.skua.modules.inspection.service.IInspectionTaskService;
14 import com.skua.modules.inspection.service.IInspectionUserWorkingGroupService;
15 import com.skua.modules.process.vo.ProcessStatisticsVO;
16 import com.skua.modules.quartz.util.BaseUtil;
17 import io.swagger.annotations.Api;
18 import io.swagger.annotations.ApiOperation;
19 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;
23 import org.springframework.jdbc.core.JdbcTemplate;
24 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.RestController;
28
29 import java.util.ArrayList;
30 import java.util.List;
31
32 @Slf4j
33 @Api(tags="测试流程")
34 @RestController("testProcessController")
35 @RequestMapping("/web/process")
36 public class ProcessStatisticsController {
37
38 // 注入TaskService
39 @Autowired
40 private TaskService taskService;
41 @Autowired
42 private IEquipmentMaintainTaskService equipMaintainExecuteService;
43 @Autowired
44 private IInspectionTaskService inspectionTaskService;
45 @Autowired
46 private IInspectionUserWorkingGroupService inspectionUserWorkingGroupService;
47
48 /* 问题上报流程 problemReport
49 设备维修流程 EquipmentRepair
50 设备缺陷管理 EquipmentDefectManagement
51 事故事件流程 EmergencyRiskEvent
52 生产任务流程 productive_task
53 数据报警工单 productAlarmProcess
54 安全隐患流程 AjhRectification
55 考核评价流程 dataAssessmentSocreMaster
56 危险作业流程 DangerousOperationManage*/
57 @AutoLog(value = "测试流程" )
58 @ApiOperation(value="测试流程-统计", notes="测试流程-统计")
59 @GetMapping(value = "/statistics")
60 public Result<List<ProcessStatisticsVO>> statistics() {
61 Result<List<ProcessStatisticsVO>> result = new Result<List<ProcessStatisticsVO>>();
62 List<ProcessStatisticsVO> processStatisticsList = new ArrayList<>();
63 String taskUser = TaskUtil.getTaskUser();
64 String taskGroup = TaskUtil.getCandidateGroup();
65 List<String> userGroupList = Func.toStrList(taskGroup);
66 try {
67 //巡检任务、维修任务、保养任务、危险作业、事故事件、安全隐患、、药剂入库
68 // 、、、、、药剂入库
69 String process_key = "AjhRectification";
70 processStatisticsList.add( queryProcessStatistics("安全隐患", process_key,taskUser,taskGroup) ) ;
71 process_key = "problemReport";
72 processStatisticsList.add( queryProcessStatistics("问题上报", process_key,taskUser,taskGroup)) ;
73 process_key = "EmergencyRiskEvent";
74 processStatisticsList.add( queryProcessStatistics("事故事件", process_key,taskUser,taskGroup) ) ;
75 process_key = "DangerousOperationManage";
76 processStatisticsList.add( queryProcessStatistics("危险作业", process_key,taskUser,taskGroup) ) ;
77 process_key = "EquipmentRepair";
78 processStatisticsList.add( queryProcessStatistics("维修任务", process_key,taskUser,taskGroup)) ;
79
80 Integer todoCount = 0;
81 QueryWrapper equipmentMaintainTaskQueryWrapper = new QueryWrapper<EquipmentMaintainTask>();
82 equipmentMaintainTaskQueryWrapper.eq("maintainer_id", taskUser);
83 equipmentMaintainTaskQueryWrapper.eq("results_enforcement", 1);
84 todoCount = equipMaintainExecuteService.count(equipmentMaintainTaskQueryWrapper);
85 ProcessStatisticsVO maintainerProcessStatisticsVO = new ProcessStatisticsVO("保养任务" ,"" , "0", todoCount.toString() );
86 processStatisticsList.add( maintainerProcessStatisticsVO );
87 //巡检
88 //得到巡检任务
89 //得到进行中的任务
90 //获取用户所在的班组
91 Integer xunjian_count = 0;
92 String userId = BaseContextHandler.getUserId();
93 QueryWrapper<InspectionUserWorkingGroup> inspectionUserWorkingGroupQueryWrapper = new QueryWrapper<>();
94 inspectionUserWorkingGroupQueryWrapper.eq("user_id", userId);
95 List<InspectionUserWorkingGroup> inspectionUserWorkingGroupList = inspectionUserWorkingGroupService.list(inspectionUserWorkingGroupQueryWrapper);
96
97 List<String> inspectionWorkingGroupIdList = new ArrayList<>();
98 for (InspectionUserWorkingGroup inspectionUserWorkingGroup : inspectionUserWorkingGroupList) {
99 inspectionWorkingGroupIdList.add(inspectionUserWorkingGroup.getInspectionWorkingGroupId());
100 }
101 if (inspectionWorkingGroupIdList.size() > 0) {
102 QueryWrapper queryWrapper = new QueryWrapper();
103 queryWrapper.eq("task_state", "1");
104 queryWrapper.in("inspection_working_group_id", inspectionWorkingGroupIdList);
105 xunjian_count = inspectionTaskService.count(queryWrapper);
106 } else {
107 xunjian_count = 0;
108 }
109 ProcessStatisticsVO xunjianProcessStatisticsVO = new ProcessStatisticsVO("巡检任务" ,"" , "0",xunjian_count.toString() );
110
111 processStatisticsList.add( xunjianProcessStatisticsVO );
112
113 //药剂入库
114 String userRoleIds = BaseContextHandler.getRoles();
115 String roleIds = BaseUtil.quoteEach(userRoleIds,",");
116
117 Integer materialINCount = 0;
118 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
119 StringBuffer sql = new StringBuffer(" select count(1) from sys_role_permission rp ,sys_config c ");
120 sql.append(" where rp.permission_id = c.config_value and c.config_id = 'MaterialIN_ID' and rp.role_id in ("+roleIds+") " );
121 Integer authFlag = masterDB.queryForObject(sql.toString(),Integer.class);
122 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";
124 materialINCount = masterDB.queryForObject(sql2,Integer.class);
125 }
126
127 ProcessStatisticsVO materialINProcessStatisticsVO = new ProcessStatisticsVO("药剂入库" ,"" , "0",materialINCount.toString() );
128 processStatisticsList.add( materialINProcessStatisticsVO );
129
130 result.setResult( processStatisticsList );
131 result.success("获取统计数据");
132 } catch (Exception e) {
133 log.error(e.getMessage(),e);
134 result.error500("操作失败");
135 }
136 return result;
137 }
138
139 /***
140 * @param process_key
141 * @return
142 */
143 private ProcessStatisticsVO queryProcessStatistics(String processName,String process_key,String taskUser , String taskGroup){
144 TaskQuery taskQuery = taskService.createTaskQuery();
145 taskQuery.processDefinitionKey( process_key );
146 Long todoCount = taskQuery.taskAssignee(taskUser).count();//代办人数
147 Long claimCount = taskQuery.taskCandidateGroupIn( Func.toStrList(taskGroup) ).count() ;//todoCount
148 return new ProcessStatisticsVO(processName ,process_key , todoCount.toString(), claimCount.toString() );
149 }
150 }
1 package com.skua.modules.process.vo;
2
3 import com.skua.tool.util.DigitalUtils;
4 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty;
6 import lombok.Data;
7
8 @Data
9 @ApiModel(value="production_duty_group_user数据传输对象", description="生产值班班组-用户")
10 public class ProcessStatisticsVO {
11 @ApiModelProperty(value = "流程名称")
12 private String processName;
13 @ApiModelProperty(value = "流程key")
14 private String processKey;
15 @ApiModelProperty(value = "未签到数量")
16 private String claimCount;
17 @ApiModelProperty(value = "代办任务数量")
18 private String todoCount;
19
20 @ApiModelProperty(value = "总数")
21 private String totalCount;
22
23 public String getTotalCount() {
24 return DigitalUtils.add( this.getTotalCount() , this.getClaimCount() ) ;
25 }
26
27 public ProcessStatisticsVO(){
28 }
29
30 public ProcessStatisticsVO(String processName, String processKey, String claimCount, String todoCount) {
31 this.processName = processName;
32 this.processKey = processKey;
33 this.claimCount = claimCount;
34 this.todoCount = todoCount;
35 }
36 }
...@@ -52,7 +52,9 @@ public class DangerLevelManageController { ...@@ -52,7 +52,9 @@ public class DangerLevelManageController {
52 @Autowired 52 @Autowired
53 private IDangerLevelManageService dangerLevelManageService; 53 private IDangerLevelManageService dangerLevelManageService;
54 @Value("${skua.path.upload}") 54 @Value("${skua.path.upload}")
55 private String uploadpath; 55 private String upLoadPath;
56 @Value("${skua.web-url}")
57 private String webUrl;
56 @Autowired 58 @Autowired
57 private ISysConfigService configService; 59 private ISysConfigService configService;
58 /** 60 /**
...@@ -104,7 +106,6 @@ public class DangerLevelManageController { ...@@ -104,7 +106,6 @@ public class DangerLevelManageController {
104 public Result<DangerLevelManage> add(@RequestBody DangerLevelManage dangerLevelManage) { 106 public Result<DangerLevelManage> add(@RequestBody DangerLevelManage dangerLevelManage) {
105 Result<DangerLevelManage> result = new Result<DangerLevelManage>(); 107 Result<DangerLevelManage> result = new Result<DangerLevelManage>();
106 try { 108 try {
107
108 dangerLevelManageService.save(dangerLevelManage); 109 dangerLevelManageService.save(dangerLevelManage);
109 dangerLevelManage.setQrCode( this.createQR( dangerLevelManage.getId())) ; 110 dangerLevelManage.setQrCode( this.createQR( dangerLevelManage.getId())) ;
110 dangerLevelManageService.updateById( dangerLevelManage ) ; 111 dangerLevelManageService.updateById( dangerLevelManage ) ;
...@@ -148,15 +149,17 @@ public class DangerLevelManageController { ...@@ -148,15 +149,17 @@ public class DangerLevelManageController {
148 * @return 149 * @return
149 */ 150 */
150 private String createQR(String dangerLevelId){ 151 private String createQR(String dangerLevelId){
151 String qrCodePath = "files"+ File.separator+"qrcode"+File.separator+dangerLevelId+".png"; 152 String qrCodePath = null;
152 try { 153 try {
154 String filePath = upLoadPath + File.separator + "qrcode";
153 String qrUrl = configService.queryValueByKey("DANGER_LEVLE_QRURL"); 155 String qrUrl = configService.queryValueByKey("DANGER_LEVLE_QRURL");
154 QRCodeUtil.encode(qrUrl, "", uploadpath+File.separator+qrCodePath, true); 156 qrUrl = qrUrl + dangerLevelId;//风险巡检二维码地址
157 qrCodePath = com.skua.tool.util.QRCodeUtil.getQRCodeImage(qrUrl, filePath, "DL-" + dangerLevelId);
158 //QRCodeUtil.encode(qrUrl, "", uploadpath+File.separator+qrCodePath, true);
155 } catch (Exception e) { 159 } catch (Exception e) {
156 log.error("生成二维码失败"); 160 log.error("生成二维码失败");
157 qrCodePath = null; 161 qrCodePath = null;
158 } 162 }
159
160 return qrCodePath; 163 return qrCodePath;
161 } 164 }
162 165
......
...@@ -7,19 +7,16 @@ import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; ...@@ -7,19 +7,16 @@ import com.skua.modules.custom.mapper.FCustomReportDatasetMapper;
7 import com.skua.modules.custom.service.IFCustomReportDatasetService; 7 import com.skua.modules.custom.service.IFCustomReportDatasetService;
8 import com.skua.modules.custom.vo.DepartWeekReportVO; 8 import com.skua.modules.custom.vo.DepartWeekReportVO;
9 import com.skua.modules.custom.vo.FCustomReportDatasetVO; 9 import com.skua.modules.custom.vo.FCustomReportDatasetVO;
10
11 import java.time.LocalDate; 10 import java.time.LocalDate;
12 import java.time.format.DateTimeFormatter; 11 import java.time.format.DateTimeFormatter;
13 import java.time.temporal.TemporalAdjusters; 12 import java.time.temporal.TemporalAdjusters;
14 import java.time.temporal.WeekFields; 13 import java.time.temporal.WeekFields;
15 import java.util.*; 14 import java.util.*;
16
17 import com.skua.modules.report.vo.*; 15 import com.skua.modules.report.vo.*;
18 import com.skua.modules.report.vo.largeScreen.*; 16 import com.skua.modules.report.vo.largeScreen.*;
19 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.jdbc.core.JdbcTemplate; 18 import org.springframework.jdbc.core.JdbcTemplate;
21 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
22
23 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 20 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
24 21
25 /** 22 /**
...@@ -276,24 +273,28 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -276,24 +273,28 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
276 273
277 //节能环保 大屏展示 274 //节能环保 大屏展示
278 public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ 275 public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){
276 //long startTime = System.nanoTime();
279 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); 277 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
280 //当月数据 278 //当月数据
281 String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); 279 String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
282 String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); 280 String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
283 List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); 281 List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null);
282 //System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
284 283
285 // 上月数据 同比 284 // 上月数据 同比
286 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); 285 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
287 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); 286 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
288 List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); 287 List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null);
289 288
289 //System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
290 Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); 290 Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList);
291 // 去年数据 环比 291 // 去年数据 环比
292 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); 292 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
293 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); 293 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
294 List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); 294 List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null);
295 Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); 295 Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList);
296 296
297 //System.out.println("333333---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
297 LoadRateVO loadRateVO = null; 298 LoadRateVO loadRateVO = null;
298 PowerConsumeVO powerConsumeVO = null; 299 PowerConsumeVO powerConsumeVO = null;
299 ResultNumberVO c02NumberVO = null;//CO2排放对象 300 ResultNumberVO c02NumberVO = null;//CO2排放对象
...@@ -302,6 +303,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -302,6 +303,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
302 ResultNumberVO tp_NumberVO = null;//TP 303 ResultNumberVO tp_NumberVO = null;//TP
303 ResultNumberVO tn_NumberVO = null;//TN 304 ResultNumberVO tn_NumberVO = null;//TN
304 305
306 List<PowerConsumeVO> powerConsumeVOList = new ArrayList();//各站点能源消耗排名
307 List<LoadRateVO> loadRateVOList = new ArrayList<>();//负荷率对象
308 List<ResultNumberVO> co2DataList = new ArrayList<>();//CO2排放排名
309 List<WasteMaterialVO> wasteMaterialList = new ArrayList<>();//废物处理对象集合
310
305 JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData 311 JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData
306 JnhbReportData lastYearReportDataTemp ;//lastYearMapData 312 JnhbReportData lastYearReportDataTemp ;//lastYearMapData
307 ResultChartsVO energyConsumeChart = null; 313 ResultChartsVO energyConsumeChart = null;
...@@ -315,7 +321,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -315,7 +321,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
315 //各站点能源消耗排名: 321 //各站点能源消耗排名:
316 powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); 322 powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() );
317 323
324
318 c02NumberVO = new ResultNumberVO(); 325 c02NumberVO = new ResultNumberVO();
326 c02NumberVO.setName( reportData.getDepartName() );
319 c02NumberVO.setValue( reportData.getCodxjl() ); 327 c02NumberVO.setValue( reportData.getCodxjl() );
320 cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl()); 328 cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl());
321 nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl()); 329 nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl());
...@@ -370,16 +378,45 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -370,16 +378,45 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
370 largeScreenVO.getCo2DataList().add( c02NumberVO ) ; 378 largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
371 //排放指标 379 //排放指标
372 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl 380 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl
373 largeScreenVO.getWasteMaterialList().add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; 381 wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ;
374 } 382 }
375 383 largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
384 largeScreenVO.setWasteMaterialList( wasteMaterialList ) ;
385 //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
376 //主库数据源 386 //主库数据源
377 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 387 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
378 int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class); 388 int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class);
379 largeScreenVO.setEquipmentL1( count1 ); 389 largeScreenVO.setEquipmentL1( count1 );
380 390 //System.out.println("55555---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
381 int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); 391 int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class);
382 largeScreenVO.setEquipmentL2( count2 ); 392 largeScreenVO.setEquipmentL2( count2 );
393 //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
394 // 各站点系统负荷率排名:负荷率排序、设置排名
395 /* if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){
396 // 根据分数排序
397 Collections.sort(largeScreenVO.getLoadRateVOList(), new Comparator<LoadRateVO>() {
398 public int compare(LoadRateVO s1, LoadRateVO s2) {
399 return Double.compare(ConvertUtils.getDouble(s1.getWsfhl(),0d), ConvertUtils.getDouble(s1.getWsfhl(),0d)); // 降序排序
400 }
401 });
402 *//*int rank = 1; // 设置排名
403 for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){
404 loadRateVORank.setRank( rank++);
405 }*//*
406 }*/
407 //各站点能源消耗排名 吨水电耗
408 /*if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) {
409 // 根据分数排序
410 Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() {
411 public int compare(PowerConsumeVO s1, PowerConsumeVO s2) {
412 return Double.compare(ConvertUtils.getDouble(s1.getDh(), 0d), ConvertUtils.getDouble(s1.getDh(), 0d)); // 降序排序
413 }
414 });
415 *//*int rank = 1; // 设置排名
416 for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){
417 loadRateVORank.setRank( rank++);
418 }*//*
419 }*/
383 return largeScreenVO; 420 return largeScreenVO;
384 } 421 }
385 /**转换为Map<部门编号,JnhbReportData> */ 422 /**转换为Map<部门编号,JnhbReportData> */
...@@ -415,6 +452,4 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -415,6 +452,4 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
415 map.put("qt", "(1)本周暂无其他情况说明");//其他 452 map.put("qt", "(1)本周暂无其他情况说明");//其他
416 return map; 453 return map;
417 } 454 }
418
419
420 } 455 }
......
...@@ -50,38 +50,39 @@ public class JnhbLargeScreenVO { ...@@ -50,38 +50,39 @@ public class JnhbLargeScreenVO {
50 public void setHeadStatisticsValue(JnhbReportData reportData){ 50 public void setHeadStatisticsValue(JnhbReportData reportData){
51 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh 51 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
52 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 52 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
53 this.getHeadStatisticsList().get(0).setValue( reportData.getWssjcll() ); 53 this.getHeadStatisticsList().get(0).setValue( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValue() , reportData.getWssjcll()) );
54 this.getHeadStatisticsList().get(1).setValue( reportData.getWsfhl() ); 54 this.getHeadStatisticsList().get(1).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValue() , reportData.getWsfhl()) );
55 this.getHeadStatisticsList().get(2).setValue( reportData.getDh() ); 55 this.getHeadStatisticsList().get(2).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValue() , reportData.getDh() ));
56 this.getHeadStatisticsList().get(3).setValue( reportData.getQy() ); 56 this.getHeadStatisticsList().get(3).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValue() , reportData.getQy()) );
57 this.getHeadStatisticsList().get(4).setValue( reportData.getXssyl() ); 57 this.getHeadStatisticsList().get(4).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValue() , reportData.getXssyl()) );
58 this.getHeadStatisticsList().get(5).setValue( reportData.getZhnyxhl() ); 58 this.getHeadStatisticsList().get(5).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValue() , reportData.getZhnyxhl()) );
59 this.getHeadStatisticsList().get(6).setValue( reportData.getEyhtpfl() ); 59 this.getHeadStatisticsList().get(6).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValue() , reportData.getEyhtpfl() ));
60 this.getHeadStatisticsList().get(7).setValue( reportData.getDsdh() ); 60 this.getHeadStatisticsList().get(7).setValue(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValue() , reportData.getDsdh() ));
61 } 61 }
62 public void setHeadStatisticsValueTB(JnhbReportData reportData){ 62 public void setHeadStatisticsValueTB(JnhbReportData reportData){
63 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh 63 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
64 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 64 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
65 this.getHeadStatisticsList().get(0).setValueTb( reportData.getWssjcll() ); 65
66 this.getHeadStatisticsList().get(1).setValueTb( reportData.getWsfhl() ); 66 this.getHeadStatisticsList().get(0).setValueTb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueTb() , reportData.getWssjcll()) );
67 this.getHeadStatisticsList().get(2).setValueTb( reportData.getDh() ); 67 this.getHeadStatisticsList().get(1).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueTb() , reportData.getWsfhl()) );
68 this.getHeadStatisticsList().get(3).setValueTb( reportData.getQy() ); 68 this.getHeadStatisticsList().get(2).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueTb() , reportData.getDh() ));
69 this.getHeadStatisticsList().get(4).setValueTb( reportData.getXssyl() ); 69 this.getHeadStatisticsList().get(3).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueTb() , reportData.getQy()) );
70 this.getHeadStatisticsList().get(5).setValueTb( reportData.getZhnyxhl() ); 70 this.getHeadStatisticsList().get(4).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueTb() , reportData.getXssyl()) );
71 this.getHeadStatisticsList().get(6).setValueTb( reportData.getEyhtpfl() ); 71 this.getHeadStatisticsList().get(5).setValueTb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueTb() , reportData.getZhnyxhl()) );
72 this.getHeadStatisticsList().get(7).setValueTb( reportData.getDsdh() ); 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() ));
73 } 74 }
74 public void setHeadStatisticsValueHB(JnhbReportData reportData){ 75 public void setHeadStatisticsValueHB(JnhbReportData reportData){
75 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh 76 // wssjcll, wsfhl, dh, qy, xinshui, zhnyxhl, eyhtpfl, dsdh
76 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水 77 ////水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水
77 this.getHeadStatisticsList().get(0).setValueHb( reportData.getWssjcll() ); 78 this.getHeadStatisticsList().get(0).setValueHb( DigitalUtils.add( this.getHeadStatisticsList().get(0).getValueHb() , reportData.getWssjcll()) );
78 this.getHeadStatisticsList().get(1).setValueHb( reportData.getWsfhl() ); 79 this.getHeadStatisticsList().get(1).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(1).getValueHb() , reportData.getWsfhl()) );
79 this.getHeadStatisticsList().get(2).setValueHb( reportData.getDh() ); 80 this.getHeadStatisticsList().get(2).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(2).getValueHb() , reportData.getDh() ));
80 this.getHeadStatisticsList().get(3).setValueHb( reportData.getQy() ); 81 this.getHeadStatisticsList().get(3).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(3).getValueHb() , reportData.getQy()) );
81 this.getHeadStatisticsList().get(4).setValueHb( reportData.getXssyl() ); 82 this.getHeadStatisticsList().get(4).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(4).getValueHb() , reportData.getXssyl()) );
82 this.getHeadStatisticsList().get(5).setValueHb( reportData.getZhnyxhl() ); 83 this.getHeadStatisticsList().get(5).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(5).getValueHb() , reportData.getZhnyxhl()) );
83 this.getHeadStatisticsList().get(6).setValueHb( reportData.getEyhtpfl() ); 84 this.getHeadStatisticsList().get(6).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(6).getValueHb() , reportData.getEyhtpfl() ));
84 this.getHeadStatisticsList().get(7).setValueHb( reportData.getDsdh() ); 85 this.getHeadStatisticsList().get(7).setValueHb(DigitalUtils.add( this.getHeadStatisticsList().get(7).getValueHb() , reportData.getDsdh() ));
85 } 86 }
86 87
87 /*** 88 /***
...@@ -98,13 +99,17 @@ public class JnhbLargeScreenVO { ...@@ -98,13 +99,17 @@ public class JnhbLargeScreenVO {
98 public JnhbLargeScreenVO(){ 99 public JnhbLargeScreenVO(){
99 //头部数值统计 100 //头部数值统计
100 String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水"; 101 String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水";
102 String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨";
101 String[] nameList = names.split(","); 103 String[] nameList = names.split(",");
104 String[] unitList = unit.split(",");
102 ResultNumberVO numberVO = null; 105 ResultNumberVO numberVO = null;
103 for(String name : nameList){ 106 for(int i = 0 ; i< nameList.length ; i++){
104 numberVO = new ResultNumberVO(); 107 numberVO = new ResultNumberVO();
105 numberVO.setName( name); 108 numberVO.setName( nameList[i]);
109 numberVO.setUnit(unitList[i] );
106 this.getHeadStatisticsList().add(numberVO) ; 110 this.getHeadStatisticsList().add(numberVO) ;
107 } 111 }
112
108 //消减量统计 113 //消减量统计
109 names= "COD,NH3-N,TP,TN"; 114 names= "COD,NH3-N,TP,TN";
110 nameList = names.split(","); 115 nameList = names.split(",");
......
1 package com.skua.modules.report.vo.largeScreen; 1 package com.skua.modules.report.vo.largeScreen;
2 2
3 import com.skua.core.util.ConvertUtils;
3 import com.skua.modules.report.vo.JnhbReportData; 4 import com.skua.modules.report.vo.JnhbReportData;
4 import com.skua.tool.util.DigitalUtils; 5 import com.skua.tool.util.DigitalUtils;
5 import io.swagger.annotations.ApiModel; 6 import io.swagger.annotations.ApiModel;
...@@ -32,10 +33,10 @@ public class ResultChartsVO { ...@@ -32,10 +33,10 @@ public class ResultChartsVO {
32 33
33 public void setData(JnhbReportData reportData ){ 34 public void setData(JnhbReportData reportData ){
34 this.getXLine().add( reportData.getDepartName() ) ; 35 this.getXLine().add( reportData.getDepartName() ) ;
35 this.getCodDataList().add( reportData.getCodxjl() ) ; 36 this.getCodDataList().add(ConvertUtils.getString(reportData.getCodxjl(),"0") ) ;
36 this.getNh3DataList().add( reportData.getTnxjl() ) ; 37 this.getNh3DataList().add( ConvertUtils.getString(reportData.getTnxjl(),"0") ) ;
37 this.getTpDataList().add( reportData.getTpxjl() ) ; 38 this.getTpDataList().add( ConvertUtils.getString( reportData.getTpxjl(),"0") ) ;
38 this.getTnDataList().add( reportData.getTnxjl() ) ; 39 this.getTnDataList().add( ConvertUtils.getString(reportData.getTnxjl(),"0") ) ;
39 } 40 }
40 public void setDataByZhnyxhl(JnhbReportData reportData ){ 41 public void setDataByZhnyxhl(JnhbReportData reportData ){
41 this.getXLine().add( reportData.getDepartName() ) ; 42 this.getXLine().add( reportData.getDepartName() ) ;
......
1 package com.skua.modules.report.vo.largeScreen; 1 package com.skua.modules.report.vo.largeScreen;
2 2
3 import com.skua.tool.util.DigitalUtils; 3 import com.skua.tool.util.DigitalUtils;
4 import com.skua.tool.util.JSUtils;
4 import io.swagger.annotations.ApiModel; 5 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty; 6 import io.swagger.annotations.ApiModelProperty;
6 import lombok.Data; 7 import lombok.Data;
...@@ -14,6 +15,8 @@ public class ResultNumberVO { ...@@ -14,6 +15,8 @@ public class ResultNumberVO {
14 15
15 @ApiModelProperty(value = "名称") 16 @ApiModelProperty(value = "名称")
16 private String name; 17 private String name;
18 @ApiModelProperty(value = "单位")
19 private String unit;
17 20
18 @ApiModelProperty(value = "结果") 21 @ApiModelProperty(value = "结果")
19 private String value; 22 private String value;
...@@ -24,25 +27,71 @@ public class ResultNumberVO { ...@@ -24,25 +27,71 @@ public class ResultNumberVO {
24 @ApiModelProperty(value = "环比(上月)") 27 @ApiModelProperty(value = "环比(上月)")
25 private String valueHb; 28 private String valueHb;
26 29
27 @ApiModelProperty(value = "同比(去年同期)排名") 30 /* @ApiModelProperty(value = "同比(去年同期)排名")
28 private String valueTbRank; 31 private String valueTbRank;*/
29 32
30 @ApiModelProperty(value = "环比(上月)排名") 33 @ApiModelProperty(value = "环比(上月)排名")
31 private String valueHbRank; 34 private Integer rank;
35
36 /* @ApiModelProperty(value = "环比(上月)排名")
37 private String valueHbRank;*/
32 38
33 39
34 @ApiModelProperty(value = "同比比例") 40 @ApiModelProperty(value = "同比比例")
35 private String valueTbRatio; 41 private String valueTbRatio;
42 @ApiModelProperty(value = "同比比例箭头")
43 private Boolean valueTbArrow;
44
45
36 @ApiModelProperty(value = "环比比例") 46 @ApiModelProperty(value = "环比比例")
37 private String valueHbRatio; 47 private String valueHbRatio;
48 @ApiModelProperty(value = "环比比例箭头")
49 private Boolean valueHbArrow;
38 50
39 public String getValueTbRatio() { 51 public String getValueTbRatio() {
40 this.valueTbRatio = DigitalUtils.division( this.value , this.valueTb) ; 52 String expression = this.getValue() +">" + this.getValueTb();
53 Boolean result = JSUtils.executeExpressionForBoolean(expression);
54 if( result != null ){
55 if(result){
56 expression = "" +this.getValue() +"/"+this.getValueTb()+"* 100 - 100";
57 }
58 if( !result ){
59 expression = " 100-" +this.getValue() +"/"+this.getValueTb()+"* 100 ";
60 }
61 }
62 this.valueTbRatio = JSUtils.executeExpression(expression,"0.0");// DigitalUtils.division( this.value , this.valueTb) ;
41 return valueTbRatio; 63 return valueTbRatio;
42 } 64 }
43 65
44 public String getValueHbRatio() { 66 public String getValueHbRatio() {
45 this.valueHbRatio = DigitalUtils.division( this.value , this.valueHb) ; 67 //this.valueHbRatio = DigitalUtils.division( this.value , this.valueHb) ;
68 // String expression = "" +this.value +"/"+this.valueHb+"* 100 - 100";
69
70 String expression = this.getValue() +">" + this.getValueHb();
71 Boolean result = JSUtils.executeExpressionForBoolean(expression);
72 if( result != null ){
73 if(result){
74 expression = "" +this.getValue() +"/"+this.getValueHb()+"* 100 - 100";
75 }
76 if( !result ){
77 expression = " 100 -" +this.getValue() +"/"+this.getValueHb()+"* 100 ";
78 }
79 }
80 this.valueHbRatio = JSUtils.executeExpression(expression,"0.0");// DigitalUtils.division( this.value , this.valueTb) ;
46 return valueHbRatio; 81 return valueHbRatio;
47 } 82 }
83
84 public Boolean getValueTbArrow() {
85 String expression = this.getValue() +">" + this.getValueHb();
86 Boolean result = JSUtils.executeExpressionForBoolean(expression);
87 if(result == null ) result = true;
88 return result;
89 }
90
91 public Boolean getValueHbArrow() {
92 String expression = this.getValue() +">" + this.getValueHb();
93 Boolean result = JSUtils.executeExpressionForBoolean(expression);
94 if(result == null ) result = true;
95 return result;
96 }
48 } 97 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!