e730e4f0 张雷

水质分析BUG修改

1 个父辈 cf18e8d5
1 package com.skua.modules.dataAnalysis.service.impl; 1 package com.skua.modules.dataAnalysis.service;
2 2
3 import java.util.List; 3 import java.util.List;
4 import java.util.Map; 4 import java.util.Map;
......
...@@ -7,7 +7,7 @@ import com.skua.core.api.vo.DictModel; ...@@ -7,7 +7,7 @@ import com.skua.core.api.vo.DictModel;
7 import com.skua.core.context.BaseContextHandler; 7 import com.skua.core.context.BaseContextHandler;
8 import com.skua.core.util.DateUtils; 8 import com.skua.core.util.DateUtils;
9 import com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper; 9 import com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper;
10 import com.skua.modules.dataAnalysis.service.impl.WaterAnalysisNewService; 10 import com.skua.modules.dataAnalysis.service.WaterAnalysisNewService;
11 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
13 13
......
...@@ -20,25 +20,21 @@ import java.util.Map; ...@@ -20,25 +20,21 @@ import java.util.Map;
20 @Service 20 @Service
21 public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService { 21 public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService {
22 private static String REPOART_ID_SL = "2119ecbf53a1d2d0708258ff67cfd9e1"; 22 private static String REPOART_ID_SL = "2119ecbf53a1d2d0708258ff67cfd9e1";
23 private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," +
24 " 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," +
25 " 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," +
26 " 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344";
27 @Autowired 23 @Autowired
28 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper; 24 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
29 @Autowired 25 @Autowired
30 private ISysMonitorMetricInfoService sysMonitorMetricInfoService; 26 private ISysMonitorMetricInfoService sysMonitorMetricInfoService;
31 @Override 27 @Override
32 public Map<String, Object> querySLDeatailList(String startTime, String endTime) { 28 public Map<String, Object> querySLDeatailList(String startTime, String endTime) {
33 // String factoryIds = BaseContextHandler.getDeparts(); 29 String departIds = BaseContextHandler.getDeparts();
34 DecimalFormat df = new DecimalFormat("#.##"); 30 DecimalFormat df = new DecimalFormat("#.##");
35 Map<String, Object> result = Maps.newHashMap(); 31 Map<String, Object> result = Maps.newHashMap();
36 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap(); 32 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
37 List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year"); 33 List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year");
38 String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", FACTORYIDS, startTime, endTime); 34 String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", departIds, startTime, endTime);
39 //查询年度水量数据 35 //查询年度水量数据
40 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",FACTORYIDS); 36 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
41 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, FACTORYIDS); 37 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, departIds);
42 if (data != null && data.size() > 0) { 38 if (data != null && data.size() > 0) {
43 data.forEach(v -> { 39 data.forEach(v -> {
44 String ti = (String) v.get("time"); 40 String ti = (String) v.get("time");
...@@ -87,19 +83,19 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -87,19 +83,19 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
87 83
88 @Override 84 @Override
89 public List<Map<String, Object>> queryZLSAnalysis(String time) { 85 public List<Map<String, Object>> queryZLSAnalysis(String time) {
90 // String factoryIds = BaseContextHandler.getDeparts(); 86 String departIds = BaseContextHandler.getDeparts();
91 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", FACTORYIDS, time); 87 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", departIds, time);
92 List<Map<String, Object>> list = new ArrayList<>(); 88 List<Map<String, Object>> list = new ArrayList<>();
93 list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, FACTORYIDS); 89 list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
94 return list; 90 return list;
95 } 91 }
96 92
97 @Override 93 @Override
98 public Map<String, Object> querySLFHLAnalysis(String time) { 94 public Map<String, Object> querySLFHLAnalysis(String time) {
99 // String factoryIds = BaseContextHandler.getDeparts(); 95 String departIds = BaseContextHandler.getDeparts();
100 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time); 96 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
101 Map<String, Object> result = Maps.newHashMap(); 97 Map<String, Object> result = Maps.newHashMap();
102 List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, FACTORYIDS); 98 List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, departIds);
103 List<Map<String, Object>> upList = Lists.newArrayList(); 99 List<Map<String, Object>> upList = Lists.newArrayList();
104 List<Map<String, Object>> lowList = Lists.newArrayList(); 100 List<Map<String, Object>> lowList = Lists.newArrayList();
105 List<Map<String, Object>> list = Lists.newArrayList(); 101 List<Map<String, Object>> list = Lists.newArrayList();
...@@ -157,22 +153,22 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -157,22 +153,22 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
157 } 153 }
158 @Override 154 @Override
159 public Map<String, Object> querySLAnalysis(String time) { 155 public Map<String, Object> querySLAnalysis(String time) {
160 // String factoryIds = BaseContextHandler.getDeparts(); 156 String departIds = BaseContextHandler.getDeparts();
161 String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time); 157 String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
162 String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, DateUtils.getLastMonthOfMonth(time)); 158 String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, DateUtils.getLastMonthOfMonth(time));
163 Map<String, Object> result = Maps.newHashMap(); 159 Map<String, Object> result = Maps.newHashMap();
164 //增长率 160 //增长率
165 List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), FACTORYIDS); 161 List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
166 //下降率 162 //下降率
167 List<Map<String, Object>> lowData = waterCountAnalysisNewMapper.queryLowFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), FACTORYIDS); 163 List<Map<String, Object>> lowData = waterCountAnalysisNewMapper.queryLowFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
168 result.put("upData", upData); 164 result.put("upData", upData);
169 result.put("lowData", lowData); 165 result.put("lowData", lowData);
170 return result; 166 return result;
171 } 167 }
172 @Override 168 @Override
173 public Map<String, Object> queryTotalSLList(String time) { 169 public Map<String, Object> queryTotalSLList(String time) {
174 // String factoryIds = BaseContextHandler.getDeparts(); 170 String departIds = BaseContextHandler.getDeparts();
175 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time); 171 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
176 Map<String, Object> result = Maps.newHashMap(); 172 Map<String, Object> result = Maps.newHashMap();
177 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap(); 173 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
178 String nowYear = DateUtils.getDate("yyyy"); 174 String nowYear = DateUtils.getDate("yyyy");
...@@ -183,8 +179,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -183,8 +179,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
183 list = DateUtils.sliceUpDateRange(time + "-01", time + "-12", "year"); 179 list = DateUtils.sliceUpDateRange(time + "-01", time + "-12", "year");
184 } 180 }
185 //查询年度水量数据 181 //查询年度水量数据
186 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",FACTORYIDS); 182 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
187 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLDataByFac(dataViewName, time, FACTORYIDS); 183 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLDataByFac(dataViewName, time, departIds);
188 if (data != null && data.size() > 0) { 184 if (data != null && data.size() > 0) {
189 data.forEach(v -> { 185 data.forEach(v -> {
190 String ti = (String) v.get("time"); 186 String ti = (String) v.get("time");
...@@ -219,16 +215,16 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -219,16 +215,16 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
219 } 215 }
220 @Override 216 @Override
221 public Map<String, Object> queryTotalSLData(String time) { 217 public Map<String, Object> queryTotalSLData(String time) {
222 // String factoryIds = BaseContextHandler.getDeparts(); 218 String departIds = BaseContextHandler.getDeparts();
223 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time); 219 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
224 Map<String, Object> result = Maps.newHashMap(); 220 Map<String, Object> result = Maps.newHashMap();
225 StringBuilder stringBuilder = new StringBuilder(); 221 StringBuilder stringBuilder = new StringBuilder();
226 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, FACTORYIDS); 222 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, departIds);
227 223
228 String time2 = String.valueOf(Integer.parseInt(time) - 1); 224 String time2 = String.valueOf(Integer.parseInt(time) - 1);
229 225
230 String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time2); 226 String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time2);
231 List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, FACTORYIDS); 227 List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, departIds);
232 228
233 for (int i =0 ;i<data.size();i++){ 229 for (int i =0 ;i<data.size();i++){
234 Map<String, Object> map = data.get(i); 230 Map<String, Object> map = data.get(i);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!