Merge remote-tracking branch 'origin/master' into master
正在显示
14 个修改的文件
包含
229 行增加
和
11 行删除
... | @@ -159,8 +159,16 @@ public class AjhRectificationInfoController { | ... | @@ -159,8 +159,16 @@ public class AjhRectificationInfoController { |
159 | public Result<List<Map<String,Object>>> getDefectHandleCount(AjhRectificationInfo ajhRectificationInfo, HttpServletRequest req){ | 159 | public Result<List<Map<String,Object>>> getDefectHandleCount(AjhRectificationInfo ajhRectificationInfo, HttpServletRequest req){ |
160 | Result<List<Map<String,Object>>> result = new Result<>(); | 160 | Result<List<Map<String,Object>>> result = new Result<>(); |
161 | QueryWrapper<AjhRectificationInfo> queryWrapper = QueryGenerator.initQueryWrapper(ajhRectificationInfo, req.getParameterMap()); | 161 | QueryWrapper<AjhRectificationInfo> queryWrapper = QueryGenerator.initQueryWrapper(ajhRectificationInfo, req.getParameterMap()); |
162 | |||
162 | queryWrapper.select("count(id) count,handle_result handleResult"); | 163 | queryWrapper.select("count(id) count,handle_result handleResult"); |
163 | queryWrapper.groupBy("handle_result"); | 164 | queryWrapper.groupBy("handle_result"); |
165 | /* if(StringUtils.isEmpty(ajhRectificationInfo.getDepartId())){ | ||
166 | ajhRectificationInfo.setDepartId(BaseContextHandler.getDeparts()); | ||
167 | }*/ | ||
168 | if (!"1".equals(BaseContextHandler.get("userType"))) { | ||
169 | queryWrapper.in("depart_id",BaseContextHandler.getDeparts()); | ||
170 | } | ||
171 | |||
164 | List<Map<String,Object>> list = ajhRectificationInfoService.listMaps(queryWrapper); | 172 | List<Map<String,Object>> list = ajhRectificationInfoService.listMaps(queryWrapper); |
165 | result.setSuccess(true); | 173 | result.setSuccess(true); |
166 | result.setResult(list); | 174 | result.setResult(list); | ... | ... |
... | @@ -18,4 +18,23 @@ public interface IAlarmLimitCustomService { | ... | @@ -18,4 +18,23 @@ public interface IAlarmLimitCustomService { |
18 | 18 | ||
19 | Map<String, Map<String,Double>> getAlarmLimitData(String departIds); | 19 | Map<String, Map<String,Double>> getAlarmLimitData(String departIds); |
20 | 20 | ||
21 | public Map<String, Map<String, Map<String, Double>>> riverAlarmMap(String alarmParamCodes); | ||
22 | |||
23 | /** | ||
24 | * 指标值报警预警 | ||
25 | * @param value 指标值 | ||
26 | * @param stringIntegerMap key->factoryId+_+code val->报警上下限值 | ||
27 | * @return | ||
28 | */ | ||
29 | public String alarmValue(Double value, Map<String, Double> stringIntegerMap); | ||
30 | |||
31 | /*** | ||
32 | * 指标值超上下限 | ||
33 | * @param value | ||
34 | * @param stringIntegerMap key->factoryId+_+code val->报警上下限值 | ||
35 | * @return | ||
36 | */ | ||
37 | public String alarmValueLimit(Double value, Map<String, Double> stringIntegerMap); | ||
38 | public Double riverAlarm(Map<String, Map<String, Map<String, Double>>> riverAlarmMap, String paramId,Double paramValue); | ||
39 | |||
21 | } | 40 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/algorithm/handle/impl/IAlarmLimitCustomServiceImpl.java
1 | package com.skua.modules.algorithm.handle.impl; | 1 | package com.skua.modules.algorithm.handle.impl; |
2 | 2 | ||
3 | import cn.hutool.core.util.ObjectUtil; | ||
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | import com.skua.core.util.ConvertUtils; | ||
6 | import com.skua.modules.alarmtmp.entity.AlarmLevelStandardConfig; | ||
7 | import com.skua.modules.alarmtmp.entity.AlarmParamStandardConfig; | ||
8 | import com.skua.modules.alarmtmp.service.AlarmLevelStandardConfigService; | ||
9 | import com.skua.modules.alarmtmp.service.AlarmParamStandardConfigService; | ||
3 | import com.skua.modules.algorithm.handle.IAlarmLimitCustomService; | 10 | import com.skua.modules.algorithm.handle.IAlarmLimitCustomService; |
11 | import org.springframework.beans.factory.annotation.Autowired; | ||
4 | import org.springframework.stereotype.Component; | 12 | import org.springframework.stereotype.Component; |
5 | 13 | ||
6 | import java.util.HashMap; | 14 | import java.util.HashMap; |
15 | import java.util.List; | ||
7 | import java.util.Map; | 16 | import java.util.Map; |
8 | 17 | ||
9 | /** | 18 | /** |
... | @@ -14,10 +23,103 @@ import java.util.Map; | ... | @@ -14,10 +23,103 @@ import java.util.Map; |
14 | */ | 23 | */ |
15 | @Component("alarmLimitCustomServiceImpl") | 24 | @Component("alarmLimitCustomServiceImpl") |
16 | public class IAlarmLimitCustomServiceImpl implements IAlarmLimitCustomService { | 25 | public class IAlarmLimitCustomServiceImpl implements IAlarmLimitCustomService { |
26 | @Autowired | ||
27 | private AlarmLevelStandardConfigService alarmLevelStandardConfigService; | ||
28 | @Autowired | ||
29 | private AlarmParamStandardConfigService alarmParamStandardConfigService; | ||
17 | 30 | ||
31 | /** | ||
32 | * 指标值报警预警 | ||
33 | * | ||
34 | * @param value 指标值 | ||
35 | * @param stringIntegerMap key->alarmUpperLimit val->报警上限值 | ||
36 | * key->alarmLowerLimit val->报警下限值 | ||
37 | * @author Gao Ran, | ||
38 | * @Description: | ||
39 | */ | ||
40 | @Override | ||
41 | public String alarmValue(Double value, Map<String, Double> stringIntegerMap) { | ||
42 | if ((stringIntegerMap != null && stringIntegerMap.get("alarmUpperLimit") != null && value > stringIntegerMap.get("alarmUpperLimit")) || | ||
43 | (stringIntegerMap != null && stringIntegerMap.get("alarmLowerLimit") != null && value < stringIntegerMap.get("alarmLowerLimit"))) { | ||
44 | //报警 | ||
45 | return ("2"); | ||
46 | } else if ((stringIntegerMap != null && stringIntegerMap.get("warnUpperLimit") != null && value > stringIntegerMap.get("warnUpperLimit")) || | ||
47 | (stringIntegerMap != null && stringIntegerMap.get("warnLowerLimit") != null && value < stringIntegerMap.get("warnLowerLimit"))) { | ||
48 | //预警 | ||
49 | return ("1"); | ||
50 | } else { | ||
51 | //正常 | ||
52 | return ("0"); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | public String alarmValueLimit(Double value, Map<String, Double> stringIntegerMap) { | ||
57 | if ((stringIntegerMap != null && stringIntegerMap.get("alarmUpperLimit") != null && value > stringIntegerMap.get("alarmUpperLimit"))) { | ||
58 | //超上限 | ||
59 | return ("2"); | ||
60 | } else if ((stringIntegerMap != null && stringIntegerMap.get("alarmLowerLimit") != null && value < stringIntegerMap.get("alarmLowerLimit"))) { | ||
61 | //低于下限 | ||
62 | return ("1"); | ||
63 | } else { | ||
64 | //正常 | ||
65 | return ("0"); | ||
66 | } | ||
67 | } | ||
68 | @Override | ||
69 | public Double riverAlarm(Map<String, Map<String, Map<String, Double>>> riverAlarmMap, String paramId, Double paramValue) { | ||
70 | //河道地表水标准 | ||
71 | //三类水标准 | ||
72 | Map<String, Map<String, Double>> threeMap = riverAlarmMap.get("DBSSL"); | ||
73 | //四类水标准 | ||
74 | Map<String, Map<String, Double>> fourMap = riverAlarmMap.get("DBSSIL"); | ||
75 | //五类水标准 | ||
76 | Map<String, Map<String, Double>> fiveMap = riverAlarmMap.get("DBSWL"); | ||
77 | Map<String, Object> paramMap = new HashMap<>(); | ||
78 | if ((threeMap != null && threeMap.get(paramId) != null && paramValue <= threeMap.get(paramId).get("alarmUpperLimit")) | ||
79 | && (paramValue > threeMap.get(paramId).get("alarmLowerLimit"))) { | ||
80 | paramMap.put("paramLevel", 3); | ||
81 | } else if ((fourMap != null && fourMap.get(paramId) != null && paramValue <= fourMap.get(paramId).get("alarmUpperLimit")) | ||
82 | && (paramValue > fourMap.get(paramId).get("alarmLowerLimit"))) { | ||
83 | paramMap.put("paramLevel", 4); | ||
84 | } else if ((fiveMap != null && fiveMap.get(paramId) != null && paramValue <= fiveMap.get(paramId).get("alarmUpperLimit")) | ||
85 | && (paramValue > fiveMap.get(paramId).get("alarmLowerLimit"))) { | ||
86 | paramMap.put("paramLevel", 5); | ||
87 | } else if ((fiveMap != null && fiveMap.get(paramId) != null && paramValue > fiveMap.get(paramId).get("alarmUpperLimit"))) { | ||
88 | paramMap.put("paramLevel", 6); | ||
89 | } else { | ||
90 | paramMap.put("paramLevel", 3); | ||
91 | } | ||
92 | return ConvertUtils.getDouble(paramMap.get("paramLevel"), 0); | ||
93 | } | ||
18 | @Override | 94 | @Override |
19 | public Map<String, Map<String, Double>> getAlarmLimitData(String departIds) { | 95 | public Map<String, Map<String, Double>> getAlarmLimitData(String departIds) { |
20 | return new HashMap<>(); | 96 | return new HashMap<>(); |
21 | } | 97 | } |
98 | public Map<String, Map<String, Map<String, Double>>> riverAlarmMap(String alarmParamCodes) { | ||
99 | Map<String, Map<String, Map<String, Double>>> alarmParamMap = new HashMap<>(); | ||
100 | for (String alarmParamCode : alarmParamCodes.split(",")) { | ||
101 | AlarmLevelStandardConfig levelCode = alarmLevelStandardConfigService.getOne(new QueryWrapper<AlarmLevelStandardConfig>().eq("alarm_standard_level_code", alarmParamCode), false); | ||
102 | if (ObjectUtil.isEmpty(levelCode)) { | ||
103 | return new HashMap<>(); | ||
104 | } | ||
105 | List<AlarmParamStandardConfig> standardConfig = alarmParamStandardConfigService.list(new QueryWrapper<AlarmParamStandardConfig>(). | ||
106 | eq("alarm_level_standard_id", levelCode.getId())); | ||
107 | //保存厂站指标报警 | ||
108 | Map<String, Map<String, Double>> factoryParamLimitMap = new HashMap<>(); | ||
109 | Map<String, Double> paramLimitMap; | ||
110 | for (AlarmParamStandardConfig alarmParamStandardDepartVO : standardConfig) { | ||
111 | paramLimitMap = new HashMap<>(); | ||
112 | paramLimitMap.put("alarmUpperLimit", Double.parseDouble(alarmParamStandardDepartVO.getAlarmParamUpperLimit())); | ||
113 | paramLimitMap.put("alarmLowerLimit", Double.parseDouble(alarmParamStandardDepartVO.getAlarmParamLowerLimit())); | ||
114 | |||
115 | factoryParamLimitMap.put(alarmParamStandardDepartVO.getAlarmParamCode(), paramLimitMap); | ||
116 | } | ||
117 | |||
118 | alarmParamMap.put(alarmParamCode, factoryParamLimitMap); | ||
119 | |||
120 | } | ||
121 | return alarmParamMap; | ||
122 | |||
123 | } | ||
22 | 124 | ||
23 | } | 125 | } | ... | ... |
... | @@ -97,4 +97,9 @@ public class QuestionDB { | ... | @@ -97,4 +97,9 @@ public class QuestionDB { |
97 | @TableField(exist=false) | 97 | @TableField(exist=false) |
98 | @ApiModelProperty(value = "判断题数目") | 98 | @ApiModelProperty(value = "判断题数目") |
99 | private Integer judgeNum; | 99 | private Integer judgeNum; |
100 | |||
101 | |||
102 | @TableField(exist=false) | ||
103 | @ApiModelProperty(value = "所属厂站") | ||
104 | private String departName; | ||
100 | } | 105 | } | ... | ... |
... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
4 | <resultMap type="com.skua.modules.edu.entity.QuestionDB" id="EduQuestionDbResult"> | 4 | <resultMap type="com.skua.modules.edu.entity.QuestionDB" id="EduQuestionDbResult"> |
5 | <result property="id" column="id" /> | 5 | <result property="id" column="id" /> |
6 | <result property="departId" column="depart_id" /> | 6 | <result property="departId" column="depart_id" /> |
7 | <result property="departName" column="depart_name" /> | ||
7 | <result property="userId" column="user_id" /> | 8 | <result property="userId" column="user_id" /> |
8 | <result property="parentId" column="parent_id" /> | 9 | <result property="parentId" column="parent_id" /> |
9 | <result property="dbName" column="db_name" /> | 10 | <result property="dbName" column="db_name" /> |
... | @@ -25,7 +26,7 @@ | ... | @@ -25,7 +26,7 @@ |
25 | </sql> | 26 | </sql> |
26 | 27 | ||
27 | <select id="selectQuestionDbList" parameterType="com.skua.modules.edu.entity.QuestionDB" resultMap="EduQuestionDbResult"> | 28 | <select id="selectQuestionDbList" parameterType="com.skua.modules.edu.entity.QuestionDB" resultMap="EduQuestionDbResult"> |
28 | select t.* , ifnull(aaa.single_num,0) single_num , ifnull(aaa.multiple_num,0) multiple_num , ifnull(aaa.judge_num,0) judge_num from edu_question_db t | 29 | select d.depart_name,t.* , ifnull(aaa.single_num,0) single_num , ifnull(aaa.multiple_num,0) multiple_num , ifnull(aaa.judge_num,0) judge_num from edu_question_db t |
29 | left join ( | 30 | left join ( |
30 | SELECT question_db_id , question_type, | 31 | SELECT question_db_id , question_type, |
31 | SUM(IF(`question_type`='1',1,0))as 'single_num', | 32 | SUM(IF(`question_type`='1',1,0))as 'single_num', |
... | @@ -34,6 +35,7 @@ | ... | @@ -34,6 +35,7 @@ |
34 | FROM edu_question | 35 | FROM edu_question |
35 | group by question_db_id , question_type | 36 | group by question_db_id , question_type |
36 | )aaa on aaa.question_db_id = t.id | 37 | )aaa on aaa.question_db_id = t.id |
38 | left join sys_depart d on t.depart_id = d.id | ||
37 | <where> | 39 | <where> |
38 | <if test="departId != null and departId != ''"> and t.depart_id = #{departId}</if> | 40 | <if test="departId != null and departId != ''"> and t.depart_id = #{departId}</if> |
39 | <if test="userId != null and userId != ''"> and t.user_id = #{userId}</if> | 41 | <if test="userId != null and userId != ''"> and t.user_id = #{userId}</if> | ... | ... |
此文件的差异被折叠,
点击展开。
... | @@ -29,4 +29,16 @@ public interface ScreenMapper { | ... | @@ -29,4 +29,16 @@ public interface ScreenMapper { |
29 | @Param("dataViewName3a24") String dataViewName3a24, @Param("dataViewName2119") String dataViewName2119, | 29 | @Param("dataViewName3a24") String dataViewName3a24, @Param("dataViewName2119") String dataViewName2119, |
30 | @Param("startMonth") String startMonth, @Param("endMonth") String endMonth, | 30 | @Param("startMonth") String startMonth, @Param("endMonth") String endMonth, |
31 | @Param("dataViewName4411") String dataViewName4411); | 31 | @Param("dataViewName4411") String dataViewName4411); |
32 | |||
33 | @Select(" select sd.depart_name,( SELECT depart_name from sys_depart WHERE id = sd.parent_id )parent_depart_name,sd.depart_type,smd.metricd_name, smmi.id,smmi.metric_name,smmi.metric_type,smmi.metric_uid_tag ,g.group_name groupName,g.group_type groupType , COALESCE(smmi.metric_unit,smd.metric_unit) metric_unit,smmi.depart_id ,COALESCE(g.sort_num,smmi.sort_num) sort_num from sys_monitor_metric_info smmi left join sys_metric_dict smd on smd.id =smmi.metric_uid_tag " + | ||
34 | "inner join sys_depart sd on smmi.depart_id =sd.id left join sys_metric_dict_group g on g.dict_id =smmi.metric_uid_tag " + | ||
35 | " ${ew.customSqlSegment}") | ||
36 | List<Map<String, Object>> getDictGroupData(@Param(Constants.WRAPPER) QueryWrapper dictGroupQueryWrapper); | ||
37 | |||
38 | /** | ||
39 | * 水厂档案相关查询 | ||
40 | * @param queryWrapper | ||
41 | */ | ||
42 | @Select("select sd.id depart_id,sd.parent_id,sd.depart_name,( SELECT depart_name from sys_depart WHERE id = sd.parent_id )parent_depart_name,sd.depart_type,sf.* from sys_depart sd left join sys_factory_info sf on sd.id =sf.depart_id ${ew.customSqlSegment}") | ||
43 | List<Map<String, Object>> factoryDesign(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); | ||
32 | } | 44 | } | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.threedimensional.service; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.threedimensional.service; |
3 | import java.util.List; | 3 | import java.util.List; |
4 | import java.util.Map; | 4 | import java.util.Map; |
5 | 5 | ||
6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
6 | import com.skua.modules.threedimensional.vo.StatisticsParams; | 7 | import com.skua.modules.threedimensional.vo.StatisticsParams; |
7 | import org.apache.ibatis.annotations.Param; | 8 | import org.apache.ibatis.annotations.Param; |
8 | import org.springframework.jdbc.core.JdbcTemplate; | 9 | import org.springframework.jdbc.core.JdbcTemplate; |
... | @@ -24,4 +25,13 @@ public interface IScreenDataService{ | ... | @@ -24,4 +25,13 @@ public interface IScreenDataService{ |
24 | List<Map<String, Object>> getYhdlqs(StatisticsParams statisticsParams); | 25 | List<Map<String, Object>> getYhdlqs(StatisticsParams statisticsParams); |
25 | 26 | ||
26 | List<Map<String, Object>> getYhylqs(StatisticsParams statisticsParams); | 27 | List<Map<String, Object>> getYhylqs(StatisticsParams statisticsParams); |
28 | |||
29 | List<Map<String, Object>> getDictGroupData(QueryWrapper dictGroupQueryWrapper); | ||
30 | |||
31 | /** | ||
32 | * 水厂档案相关查询 | ||
33 | * @param queryWrapper | ||
34 | * @return | ||
35 | */ | ||
36 | List<Map<String, Object>> factoryDesign(QueryWrapper<Object> queryWrapper); | ||
27 | } | 37 | } | ... | ... |
1 | package com.skua.modules.threedimensional.service.impl; | 1 | package com.skua.modules.threedimensional.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
3 | import com.skua.common.constant.ReportConstant; | 4 | import com.skua.common.constant.ReportConstant; |
4 | import com.skua.common.report.ReportViewUtil; | 5 | import com.skua.common.report.ReportViewUtil; |
5 | import com.skua.core.service.IFactoryInfoService; | 6 | import com.skua.core.service.IFactoryInfoService; |
... | @@ -338,6 +339,22 @@ public class ScreenDataServiceImpl implements IScreenDataService { | ... | @@ -338,6 +339,22 @@ public class ScreenDataServiceImpl implements IScreenDataService { |
338 | return months; | 339 | return months; |
339 | } | 340 | } |
340 | 341 | ||
342 | |||
343 | |||
344 | public List<Map<String, Object>> getDictGroupData(QueryWrapper dictGroupQueryWrapper){ | ||
345 | return screenMapper.getDictGroupData(dictGroupQueryWrapper); | ||
346 | } | ||
347 | |||
348 | /*** | ||
349 | * 水厂档案相关查询 | ||
350 | * @param queryWrapper | ||
351 | * @return | ||
352 | */ | ||
353 | @Override | ||
354 | public List<Map<String, Object>> factoryDesign(QueryWrapper<Object> queryWrapper) { | ||
355 | return screenMapper.factoryDesign(queryWrapper); | ||
356 | } | ||
357 | |||
341 | public static void main(String[] args) { | 358 | public static void main(String[] args) { |
342 | String startTime = "2024-01-01";// | 359 | String startTime = "2024-01-01";// |
343 | String endTime = "2024-12-31"; | 360 | String endTime = "2024-12-31"; | ... | ... |
1 | package com.skua.modules.threedimensional.vo; | 1 | package com.skua.modules.threedimensional.vo; |
2 | 2 | ||
3 | import com.skua.core.util.ConvertUtils; | ||
3 | import com.skua.modules.threedimensional.entity.RealTimeData; | 4 | import com.skua.modules.threedimensional.entity.RealTimeData; |
4 | import lombok.Data; | 5 | import lombok.Data; |
5 | 6 | ||
... | @@ -16,4 +17,18 @@ public class RealTimeDataVO extends RealTimeData { | ... | @@ -16,4 +17,18 @@ public class RealTimeDataVO extends RealTimeData { |
16 | 17 | ||
17 | private String departName; | 18 | private String departName; |
18 | 19 | ||
20 | private String metricRealName; | ||
21 | |||
22 | |||
23 | private String waterType; | ||
24 | private String groupType; | ||
25 | private String groupName; | ||
26 | private String alarmValue; | ||
27 | private String alarmStatus; | ||
28 | private String parentDepartName; | ||
29 | private String alarmLimit; | ||
30 | private String warnLimit; | ||
31 | private String riverAlarm; | ||
32 | |||
33 | |||
19 | } | 34 | } | ... | ... |
... | @@ -15,26 +15,28 @@ public class PowerCutDownVO { | ... | @@ -15,26 +15,28 @@ public class PowerCutDownVO { |
15 | @ApiModelProperty(value = "部门编号") | 15 | @ApiModelProperty(value = "部门编号") |
16 | public String departId ; | 16 | public String departId ; |
17 | 17 | ||
18 | @ApiModelProperty(value = "部门名称") | ||
19 | public String departName; | ||
18 | 20 | ||
19 | @ApiModelProperty(value = "名称") | 21 | @ApiModelProperty(value = "处理水量") |
20 | public String clsl ; | 22 | public String clsl ; |
21 | 23 | ||
22 | @ApiModelProperty(value = "名称") | 24 | @ApiModelProperty(value = "COD") |
23 | public String codValue; | 25 | public String codValue; |
24 | 26 | ||
25 | @ApiModelProperty(value = "名称") | 27 | @ApiModelProperty(value = "耗电量") |
26 | public String hdl; | 28 | public String hdl; |
27 | 29 | ||
28 | @ApiModelProperty(value = "名称") | 30 | @ApiModelProperty(value = "氨氮") |
29 | public String nh3nValue; | 31 | public String nh3nValue; |
30 | 32 | ||
31 | @ApiModelProperty(value = "名称") | 33 | @ApiModelProperty(value = "数量") |
32 | public String num; | 34 | public String num; |
33 | 35 | ||
34 | @ApiModelProperty(value = "名称") | 36 | @ApiModelProperty(value = "总氮") |
35 | public String tnValue; | 37 | public String tnValue; |
36 | 38 | ||
37 | @ApiModelProperty(value = "名称") | 39 | @ApiModelProperty(value = "总磷") |
38 | public String tpValue; | 40 | public String tpValue; |
39 | 41 | ||
40 | } | 42 | } | ... | ... |
... | @@ -106,7 +106,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -106,7 +106,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
106 | /***************** 实际水量同比下降水务公司原因分析一览表************************/ | 106 | /***************** 实际水量同比下降水务公司原因分析一览表************************/ |
107 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); | 107 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); |
108 | sql = " select aaa.depart_id , d.depart_name departName, round(100*(sum(ifnull(aaa.ysjsl,0)) - sum(ifnull(aaa.tqysjsl,0)) )/ sum(ifnull(aaa.tqysjsl,0)),2) 'ratio', "; | 108 | sql = " select aaa.depart_id , d.depart_name departName, round(100*(sum(ifnull(aaa.ysjsl,0)) - sum(ifnull(aaa.tqysjsl,0)) )/ sum(ifnull(aaa.tqysjsl,0)),2) 'ratio', "; |
109 | sql += " round( sum(ifnull(aaa.ysjsl,0)),2 ) 'ysjsl' ,round( sum(ifnull(aaa.tqysjsl,0)),2 ) 'tqysjsl' ,GROUP_CONCAT(aaa.ysjsldyqntqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa"; | 109 | sql += " round( sum(ifnull(aaa.ysjsl,0)),2 ) 'ysjsl' ,round( sum(ifnull(aaa.tqysjsl,0)),2 ) 'tqysjsl' ,GROUP_CONCAT(aaa.ysjsldyqntqyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa"; |
110 | sql += " left join sys_depart d on d.id = aaa.depart_id"; | 110 | sql += " left join sys_depart d on d.id = aaa.depart_id"; |
111 | sql += " group by aaa.depart_id HAVING sum(ifnull(aaa.ysjsl,0)) < sum(ifnull(aaa.tqysjsl,0)) "; | 111 | sql += " group by aaa.depart_id HAVING sum(ifnull(aaa.ysjsl,0)) < sum(ifnull(aaa.tqysjsl,0)) "; |
112 | List<FReportWaterMonthDataVO> waterMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportWaterMonthDataVO>(FReportWaterMonthDataVO.class)); | 112 | List<FReportWaterMonthDataVO> waterMonthDataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<FReportWaterMonthDataVO>(FReportWaterMonthDataVO.class)); |
... | @@ -115,7 +115,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -115,7 +115,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
115 | //水电耗高于控制目标--水务公司列表 | 115 | //水电耗高于控制目标--水务公司列表 |
116 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); | 116 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); |
117 | sql = "select * from ( "; | 117 | sql = "select * from ( "; |
118 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.ydh),2) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; | 118 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.ydh),2) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";; |
119 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; | 119 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; |
120 | sql += " left join sys_depart d on d.id = aaa.depart_id "; | 120 | sql += " left join sys_depart d on d.id = aaa.depart_id "; |
121 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | 121 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; |
... | @@ -126,7 +126,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -126,7 +126,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
126 | //药剂成本高于控制目标--水务公司列表 | 126 | //药剂成本高于控制目标--水务公司列表 |
127 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); | 127 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); |
128 | sql = "select * from ( "; | 128 | sql = "select * from ( "; |
129 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.yyh),2) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; | 129 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.yyh),2) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy SEPARATOR '') 'causeAnalysis' from "+ dataViewName4411+" aaa";; |
130 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; | 130 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; |
131 | sql += " left join sys_depart d on d.id = aaa.depart_id "; | 131 | sql += " left join sys_depart d on d.id = aaa.depart_id "; |
132 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | 132 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | ... | ... |
... | @@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse; | ... | @@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletResponse; |
9 | 9 | ||
10 | import cn.hutool.json.JSONObject; | 10 | import cn.hutool.json.JSONObject; |
11 | import com.skua.core.context.BaseContextHandler; | 11 | import com.skua.core.context.BaseContextHandler; |
12 | import com.skua.core.query.QueryGenerator; | ||
12 | import org.apache.commons.lang.StringUtils; | 13 | import org.apache.commons.lang.StringUtils; |
13 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; | 14 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
14 | import org.apache.poi.ss.usermodel.Sheet; | 15 | import org.apache.poi.ss.usermodel.Sheet; |
... | @@ -110,6 +111,28 @@ public class EquipmentController { | ... | @@ -110,6 +111,28 @@ public class EquipmentController { |
110 | @Autowired | 111 | @Autowired |
111 | private Key2ValueService key2ValueService; | 112 | private Key2ValueService key2ValueService; |
112 | 113 | ||
114 | @AutoLog(value = "设备台账-所有设备") | ||
115 | @ApiOperation(value = "设备台账-所有设备", notes = "设备台账-所有设备") | ||
116 | @GetMapping(value = "/allList") | ||
117 | public Result<List<EquipmentInfo>> allList(EquipmentInfo equipmentInfo, @RequestParam(name="model", defaultValue="0") Integer model,HttpServletRequest req ) throws Exception { | ||
118 | |||
119 | Result<List<EquipmentInfo>> result = new Result<List<EquipmentInfo>>(); | ||
120 | QueryWrapper<EquipmentInfo> queryWrapper = QueryGenerator.initQueryWrapper(equipmentInfo, req.getParameterMap()); | ||
121 | // queryWrapper.eq("depart_id", BaseContextHandler.getRealDepartId()); | ||
122 | if(equipmentInfo.getDepartId()==null){ | ||
123 | equipmentInfo.setDepartId(BaseContextHandler.getDeparts()); | ||
124 | } | ||
125 | /* if(model==1){ | ||
126 | queryWrapper.isNotNull("is_model"); | ||
127 | queryWrapper.last(" and is_model != ''"); | ||
128 | }*/ | ||
129 | queryWrapper.orderByDesc("create_time"); | ||
130 | List<EquipmentInfo> dataList = equipmentInfoService.list(queryWrapper); | ||
131 | result.setSuccess(true); | ||
132 | result.setResult(dataList); | ||
133 | return result; | ||
134 | } | ||
135 | |||
113 | @CustomExceptionAnno(description = "设备台账-设备排序") | 136 | @CustomExceptionAnno(description = "设备台账-设备排序") |
114 | @AutoLog(value = "设备台账-设备排序") | 137 | @AutoLog(value = "设备台账-设备排序") |
115 | @ApiOperation(value = "设备台账-设备排序", notes = "设备台账-设备排序") | 138 | @ApiOperation(value = "设备台账-设备排序", notes = "设备台账-设备排序") | ... | ... |
-
请 注册 或 登录 后发表评论