水质分析BUG修改
正在显示
2 个修改的文件
包含
22 行增加
和
22 行删除
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/WaterAnalysisNewMapper.xml
... | @@ -343,7 +343,7 @@ | ... | @@ -343,7 +343,7 @@ |
343 | IFNULL( a.totalCount, 0 ) AS totalCount | 343 | IFNULL( a.totalCount, 0 ) AS totalCount |
344 | FROM | 344 | FROM |
345 | sys_factory_info sfi | 345 | sys_factory_info sfi |
346 | LEFT JOIN alarm_level_standard_config alsc ON alsc.alarm_standard_level_code = sfi.out_level | 346 | LEFT JOIN alarm_level_standard_config alsc ON alsc.id = sfi.out_level |
347 | LEFT JOIN sys_depart d ON sfi.depart_id = d.id | 347 | LEFT JOIN sys_depart d ON sfi.depart_id = d.id |
348 | LEFT JOIN ( | 348 | LEFT JOIN ( |
349 | SELECT | 349 | SELECT | ... | ... |
... | @@ -17,18 +17,18 @@ import java.util.concurrent.atomic.AtomicReference; | ... | @@ -17,18 +17,18 @@ import java.util.concurrent.atomic.AtomicReference; |
17 | @Service | 17 | @Service |
18 | public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | 18 | public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
19 | private static String REPOART_ID_HY = "9bffaf9187093d6e6a4390e8c56acca8"; | 19 | private static String REPOART_ID_HY = "9bffaf9187093d6e6a4390e8c56acca8"; |
20 | private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," + | 20 | // private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," + |
21 | " 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," + | 21 | // " 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," + |
22 | " 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," + | 22 | // " 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," + |
23 | " 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344"; | 23 | // " 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344"; |
24 | @Autowired | 24 | @Autowired |
25 | private WaterAnalysisNewMapper waterAnalysisNewMapper; | 25 | private WaterAnalysisNewMapper waterAnalysisNewMapper; |
26 | @Override | 26 | @Override |
27 | public Map<String, Object> queryTotalBySummary(String time) { | 27 | public Map<String, Object> queryTotalBySummary(String time) { |
28 | Map<String, Object> result = Maps.newHashMap(); | 28 | Map<String, Object> result = Maps.newHashMap(); |
29 | // String departIds = BaseContextHandler.getDeparts(); | 29 | String departIds = BaseContextHandler.getDeparts(); |
30 | List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,FACTORYIDS); | 30 | List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,departIds); |
31 | Long facCount = waterAnalysisNewMapper.queryTotalCount(FACTORYIDS); | 31 | Long facCount = waterAnalysisNewMapper.queryTotalCount(departIds); |
32 | Long summaryCount = facCount; | 32 | Long summaryCount = facCount; |
33 | Long noSummaryCount = 0L; | 33 | Long noSummaryCount = 0L; |
34 | StringBuilder facInfo = new StringBuilder(); | 34 | StringBuilder facInfo = new StringBuilder(); |
... | @@ -67,10 +67,10 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -67,10 +67,10 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
67 | 67 | ||
68 | @Override | 68 | @Override |
69 | public List<Map<String, Object>> queryFacListWaterQCL(String time) { | 69 | public List<Map<String, Object>> queryFacListWaterQCL(String time) { |
70 | // String factoryIds = BaseContextHandler.getDeparts(); | 70 | String departIds = BaseContextHandler.getDeparts(); |
71 | List<Map<String, Object>> result = Lists.newArrayList(); | 71 | List<Map<String, Object>> result = Lists.newArrayList(); |
72 | String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time); | 72 | String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time); |
73 | List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,FACTORYIDS,dataViewName); | 73 | List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName); |
74 | if (list != null) { | 74 | if (list != null) { |
75 | for (Map<String, Object> map : list) { | 75 | for (Map<String, Object> map : list) { |
76 | Double jsCODAvgSum = Double.parseDouble(map.get("jscod").toString()); | 76 | Double jsCODAvgSum = Double.parseDouble(map.get("jscod").toString()); |
... | @@ -110,9 +110,9 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -110,9 +110,9 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
110 | @Override | 110 | @Override |
111 | public Map<String, Object> queryWaterQCL(String time) { | 111 | public Map<String, Object> queryWaterQCL(String time) { |
112 | Map<String, Object> result = Maps.newHashMap(); | 112 | Map<String, Object> result = Maps.newHashMap(); |
113 | // String factoryIds = BaseContextHandler.getDeparts(); | 113 | String departIds = BaseContextHandler.getDeparts(); |
114 | String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time); | 114 | String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time); |
115 | result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, FACTORYIDS); | 115 | result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds); |
116 | if(result==null){ | 116 | if(result==null){ |
117 | result = new HashMap<>(); | 117 | result = new HashMap<>(); |
118 | result.put("COD", 0.00); | 118 | result.put("COD", 0.00); |
... | @@ -124,7 +124,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -124,7 +124,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
124 | } | 124 | } |
125 | @Override | 125 | @Override |
126 | public List<Map<String, Object>> queryCSAnalysis(String time) { | 126 | public List<Map<String, Object>> queryCSAnalysis(String time) { |
127 | // String factoryIds = BaseContextHandler.getDeparts(); | 127 | String departIds = BaseContextHandler.getDeparts(); |
128 | //获取负荷比例 | 128 | //获取负荷比例 |
129 | List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion"); | 129 | List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion"); |
130 | Double low = 0.0; | 130 | Double low = 0.0; |
... | @@ -143,7 +143,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -143,7 +143,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
143 | Double finalUp = up; | 143 | Double finalUp = up; |
144 | data.forEach(v -> { | 144 | data.forEach(v -> { |
145 | String code = (String) v.get("id"); | 145 | String code = (String) v.get("id"); |
146 | List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, FACTORYIDS); | 146 | List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds); |
147 | if (datan != null && datan.size() > 0) { | 147 | if (datan != null && datan.size() > 0) { |
148 | DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics(); | 148 | DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics(); |
149 | //取最大值 | 149 | //取最大值 |
... | @@ -168,18 +168,18 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -168,18 +168,18 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
168 | @Override | 168 | @Override |
169 | public List<Map<String, Object>> queryNoSummaryList(String time) { | 169 | public List<Map<String, Object>> queryNoSummaryList(String time) { |
170 | Map<String, Map<String, Object>> tmpMap = Maps.newHashMap(); | 170 | Map<String, Map<String, Object>> tmpMap = Maps.newHashMap(); |
171 | // String factoryIds = BaseContextHandler.getDeparts(); | 171 | String departIds = BaseContextHandler.getDeparts(); |
172 | List<Map<String, Object>> facs = new ArrayList<>(); | 172 | List<Map<String, Object>> facs = new ArrayList<>(); |
173 | facs = waterAnalysisNewMapper.queryNewFacList(time,FACTORYIDS); | 173 | facs = waterAnalysisNewMapper.queryNewFacList(time,departIds); |
174 | return facs; | 174 | return facs; |
175 | } | 175 | } |
176 | 176 | ||
177 | @Override | 177 | @Override |
178 | public Map<String, Object> queryNewSummaryCount(String time) { | 178 | public Map<String, Object> queryNewSummaryCount(String time) { |
179 | // String factoryIds = BaseContextHandler.getDeparts(); | 179 | String departIds = BaseContextHandler.getDeparts(); |
180 | Map<String, Object> csbzCharData = Maps.newHashMap(); | 180 | Map<String, Object> csbzCharData = Maps.newHashMap(); |
181 | //上个月DateUtils.getLastMonthOfMonth(time) | 181 | //上个月DateUtils.getLastMonthOfMonth(time) |
182 | List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,FACTORYIDS); | 182 | List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,departIds); |
183 | List<String> names = Lists.newArrayList(); | 183 | List<String> names = Lists.newArrayList(); |
184 | List<Long> data = Lists.newArrayList(); | 184 | List<Long> data = Lists.newArrayList(); |
185 | List<Long> max = Lists.newArrayList(); | 185 | List<Long> max = Lists.newArrayList(); |
... | @@ -307,8 +307,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -307,8 +307,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
307 | } | 307 | } |
308 | @Override | 308 | @Override |
309 | public List<Map<String, Object>> queryFacListBySummary(String time) { | 309 | public List<Map<String, Object>> queryFacListBySummary(String time) { |
310 | // String factoryIds = BaseContextHandler.getDeparts(); | 310 | String departIds = BaseContextHandler.getDeparts(); |
311 | List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),FACTORYIDS); | 311 | List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),departIds); |
312 | maps.forEach(v -> { | 312 | maps.forEach(v -> { |
313 | Double db = Double.parseDouble(String.valueOf(v.get("db"))); | 313 | Double db = Double.parseDouble(String.valueOf(v.get("db"))); |
314 | if (db < 90) { | 314 | if (db < 90) { | ... | ... |
-
请 注册 或 登录 后发表评论