水厂运营大屏接口、报表编码抽取
正在显示
11 个修改的文件
包含
273 行增加
和
83 行删除
1 | package com.skua.modules.algorithm.service.impl; | 1 | package com.skua.modules.algorithm.service.impl; |
2 | 2 | ||
3 | import com.skua.common.constant.ReportConstant; | ||
3 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
4 | import com.skua.core.context.SpringContextUtils; | 5 | import com.skua.core.context.SpringContextUtils; |
5 | import com.skua.core.util.ConvertUtils; | 6 | import com.skua.core.util.ConvertUtils; |
... | @@ -41,8 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -41,8 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
41 | @Resource | 42 | @Resource |
42 | private FReportItemMapper reportItemMapper; | 43 | private FReportItemMapper reportItemMapper; |
43 | 44 | ||
44 | String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H | ||
45 | String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表 | ||
46 | /** | 45 | /** |
47 | * 指挥中心---运行负荷率分析 | 46 | * 指挥中心---运行负荷率分析 |
48 | * @param reportItemvParam | 47 | * @param reportItemvParam |
... | @@ -135,16 +134,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -135,16 +134,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
135 | public DepartDrugResult getYhTotal(String month) { | 134 | public DepartDrugResult getYhTotal(String month) { |
136 | String monthTb = DateUtils.getTbMonth(month);//同比时间 | 135 | String monthTb = DateUtils.getTbMonth(month);//同比时间 |
137 | String monthHb = DateUtils.getHbMonth(month);//环比时间 | 136 | String monthHb = DateUtils.getHbMonth(month);//环比时间 |
138 | String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1"; | 137 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", month); |
139 | String view3a24 = "3a243d5715b9e1a3753c180872ca0df9"; | 138 | String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthTb); |
140 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", "", month); | 139 | String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthHb); |
141 | String dataViewName2119tb = ReportViewUtil.buildViewLike(view2119,"CSL", "", monthTb); | ||
142 | String dataViewName2119hb = ReportViewUtil.buildViewLike(view2119,"CSL", "", monthHb); | ||
143 | String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 140 | String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
144 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 141 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; |
145 | String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,field3a24, "", month); | 142 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", month); |
146 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(view3a24,field3a24, "", monthTb); | 143 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthTb); |
147 | String dataViewName3a24hb = ReportViewUtil.buildViewLike(view3a24,field3a24, "", monthHb); | 144 | String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthHb); |
148 | DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb, | 145 | DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb, |
149 | dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb); | 146 | dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb); |
150 | if(departDrugResult == null){ | 147 | if(departDrugResult == null){ |
... | @@ -186,7 +183,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -186,7 +183,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
186 | //月产水量 | 183 | //月产水量 |
187 | Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 184 | Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
188 | 185 | ||
189 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 186 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
190 | String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa"; | 187 | String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa"; |
191 | sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id"; | 188 | sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id"; |
192 | sql += " left join sys_depart d on d.id = aaa.depart_id"; | 189 | sql += " left join sys_depart d on d.id = aaa.depart_id"; |
... | @@ -224,7 +221,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -224,7 +221,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
224 | //通用csl查询,返回Map<部门编号,CSL出水量> | 221 | //通用csl查询,返回Map<部门编号,CSL出水量> |
225 | public Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){ | 222 | public Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){ |
226 | Map<String,String> cslMap = new HashMap<>(); | 223 | Map<String,String> cslMap = new HashMap<>(); |
227 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, startTime,endTime); | 224 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime); |
228 | // System.out.println("dataViewName2119 ="+dataViewName2119 ); | 225 | // System.out.println("dataViewName2119 ="+dataViewName2119 ); |
229 | List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); | 226 | List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); |
230 | if(dataMapList != null){ | 227 | if(dataMapList != null){ | ... | ... |
1 | package com.skua.modules.threedimensional.service.impl; | 1 | package com.skua.modules.threedimensional.service.impl; |
2 | 2 | ||
3 | import com.skua.common.constant.ReportConstant; | ||
3 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
4 | import com.skua.core.service.IFactoryInfoService; | 5 | import com.skua.core.service.IFactoryInfoService; |
5 | import com.skua.core.util.DateUtils; | 6 | import com.skua.core.util.DateUtils; |
... | @@ -30,8 +31,6 @@ public class ScreenDataServiceImpl implements IScreenDataService { | ... | @@ -30,8 +31,6 @@ public class ScreenDataServiceImpl implements IScreenDataService { |
30 | private IFactoryInfoService factoryInfoService; | 31 | private IFactoryInfoService factoryInfoService; |
31 | @Resource | 32 | @Resource |
32 | private ScreenMapper screenMapper; | 33 | private ScreenMapper screenMapper; |
33 | private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9"; | ||
34 | private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1"; | ||
35 | 34 | ||
36 | @Override | 35 | @Override |
37 | public Map<String, Object> getDifferData(String startDate, String itemTags, String departId, String type, JdbcTemplate masterDB) { | 36 | public Map<String, Object> getDifferData(String startDate, String itemTags, String departId, String type, JdbcTemplate masterDB) { |
... | @@ -219,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { | ... | @@ -219,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { |
219 | String departIds = statisticsParams.getDepartIds(); | 218 | String departIds = statisticsParams.getDepartIds(); |
220 | Map<String, Object> valueMap = new HashMap<>(); | 219 | Map<String, Object> valueMap = new HashMap<>(); |
221 | List<String> monthList = getMonthsBetween(startDate,endDate); | 220 | List<String> monthList = getMonthsBetween(startDate,endDate); |
222 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24, "DLHJ", departIds, startDate, endDate); | 221 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", departIds, startDate, endDate); |
223 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startDate, endDate); | 222 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate); |
224 | List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); | 223 | List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); |
225 | if(dataList.size()>0){ | 224 | if(dataList.size()>0){ |
226 | for (Map<String, Object> vMap : dataList) { | 225 | for (Map<String, Object> vMap : dataList) { |
... | @@ -264,8 +263,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { | ... | @@ -264,8 +263,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { |
264 | List<String> monthList = getMonthsBetween(startDate,endDate); | 263 | List<String> monthList = getMonthsBetween(startDate,endDate); |
265 | String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 264 | String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
266 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 265 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; |
267 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, departIds, startDate, endDate); | 266 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDate, endDate); |
268 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startDate, endDate); | 267 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate); |
269 | List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); | 268 | List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); |
270 | if(dataList.size()>0){ | 269 | if(dataList.size()>0){ |
271 | for (Map<String, Object> vMap : dataList) { | 270 | for (Map<String, Object> vMap : dataList) { | ... | ... |
1 | package com.skua.modules.custom.service.impl; | 1 | package com.skua.modules.custom.service.impl; |
2 | 2 | ||
3 | import com.skua.common.constant.ReportConstant; | ||
3 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
4 | import com.skua.core.context.SpringContextUtils; | 5 | import com.skua.core.context.SpringContextUtils; |
5 | import com.skua.modules.custom.entity.FCustomReportDataset; | 6 | import com.skua.modules.custom.entity.FCustomReportDataset; |
... | @@ -25,9 +26,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ... | @@ -25,9 +26,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
25 | @Service | 26 | @Service |
26 | public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDatasetMapper, FCustomReportDataset> implements IFCustomReportDatasetService { | 27 | public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDatasetMapper, FCustomReportDataset> implements IFCustomReportDatasetService { |
27 | 28 | ||
28 | private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1"; | ||
29 | private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9"; | ||
30 | private static String view4411 = "4411ed3d78634bcdcd700f6e33724025"; | ||
31 | @Autowired | 29 | @Autowired |
32 | private FCustomReportDatasetMapper mapper; | 30 | private FCustomReportDatasetMapper mapper; |
33 | /* (non-Javadoc) | 31 | /* (non-Javadoc) |
... | @@ -72,17 +70,17 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -72,17 +70,17 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
72 | public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) { | 70 | public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) { |
73 | List<Map<String, Object>> valueMapList = new ArrayList<>(); | 71 | List<Map<String, Object>> valueMapList = new ArrayList<>(); |
74 | String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1); | 72 | String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1); |
75 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dataTime); | 73 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dataTime); |
76 | String dataViewName2119tb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, tbYear); | 74 | String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear); |
77 | 75 | ||
78 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 76 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
79 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 77 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; |
80 | String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,field3a24, departId, dataTime); | 78 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime); |
81 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(view3a24,field3a24, departId, tbYear); | 79 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear); |
82 | 80 | ||
83 | String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy"; | 81 | String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy"; |
84 | String dataViewName4411 = ReportViewUtil.buildViewLike(view4411,field4411, departId, dataTime); | 82 | String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,field4411, departId, dataTime); |
85 | String dataViewName4411tb = ReportViewUtil.buildViewLike(view4411,"qntqsfsl", departId, tbYear); | 83 | String dataViewName4411tb = ReportViewUtil.buildViewLike(ReportConstant.view4411,"qntqsfsl", departId, tbYear); |
86 | //主库数据源 | 84 | //主库数据源 |
87 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | 85 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); |
88 | String sql = "select " + | 86 | String sql = "select " + |
... | @@ -169,9 +167,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -169,9 +167,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
169 | String endDate = weekMap.get("end"); | 167 | String endDate = weekMap.get("end"); |
170 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 168 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
171 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL"; | 169 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL"; |
172 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate); | 170 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate); |
173 | String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS"; | 171 | String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS"; |
174 | String dataViewName2119 = ReportViewUtil.buildView(view2119,field2119, "", startDate, endDate); | 172 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,field2119, "", startDate, endDate); |
175 | valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119); | 173 | valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119); |
176 | if(valueMap==null){ | 174 | if(valueMap==null){ |
177 | valueMap = new HashMap<>(); | 175 | valueMap = new HashMap<>(); |
... | @@ -217,8 +215,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -217,8 +215,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
217 | String start = month.substring(0,4)+"-01-31"; | 215 | String start = month.substring(0,4)+"-01-31"; |
218 | String end = month + "-31"; | 216 | String end = month + "-31"; |
219 | String departIds = mapper.getChildDepartId(departId); | 217 | String departIds = mapper.getChildDepartId(departId); |
220 | String dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", departIds, start, end); | 218 | String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, start, end); |
221 | String dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end); | 219 | String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end); |
222 | List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds); | 220 | List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds); |
223 | return list; | 221 | return list; |
224 | } | 222 | } |
... | @@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
230 | List<JnhbReportDetailsJs> jsList = new ArrayList<>(); | 228 | List<JnhbReportDetailsJs> jsList = new ArrayList<>(); |
231 | List<JnhbReportDetailsHj> hjList = new ArrayList<>(); | 229 | List<JnhbReportDetailsHj> hjList = new ArrayList<>(); |
232 | String year = month.substring(0,4); | 230 | String year = month.substring(0,4); |
233 | String dataViewName2 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, year); | 231 | String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, year); |
234 | String dataViewName3 = ReportViewUtil.buildViewLike(view3a24,"", departId, year); | 232 | String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year); |
235 | dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year); | 233 | dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year); |
236 | jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year); | 234 | jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year); |
237 | hjList = mapper.getHjList(dataViewName2, dataViewName3, departId, year); | 235 | hjList = mapper.getHjList(dataViewName2, dataViewName3, departId, year); |
... | @@ -246,21 +244,21 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -246,21 +244,21 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
246 | long startTime = System.nanoTime(); | 244 | long startTime = System.nanoTime(); |
247 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); | 245 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); |
248 | //当月数据 | 246 | //当月数据 |
249 | String dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 247 | String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
250 | String dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 248 | String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
251 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); | 249 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); |
252 | //System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | 250 | //System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); |
253 | 251 | ||
254 | // 上月数据 同比 | 252 | // 上月数据 同比 |
255 | dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 253 | dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
256 | dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 254 | dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
257 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); | 255 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); |
258 | 256 | ||
259 | //System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | 257 | //System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); |
260 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); | 258 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); |
261 | // 去年数据 环比 | 259 | // 去年数据 环比 |
262 | dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); | 260 | dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); |
263 | dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); | 261 | dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); |
264 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); | 262 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); |
265 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); | 263 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); |
266 | 264 | ||
... | @@ -399,8 +397,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -399,8 +397,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
399 | String endDate = weekMap.get("end"); | 397 | String endDate = weekMap.get("end"); |
400 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 398 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
401 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL"; | 399 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL"; |
402 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate); | 400 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate); |
403 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", "", startDate, endDate); | 401 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", "", startDate, endDate); |
404 | list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119); | 402 | list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119); |
405 | map.put("start", startDate);//开始时间 | 403 | map.put("start", startDate);//开始时间 |
406 | map.put("end", endDate);//结束时间 | 404 | map.put("end", endDate);//结束时间 | ... | ... |
1 | package com.skua.modules.dataAnalysis.controller; | ||
2 | |||
3 | import com.skua.core.api.vo.Result; | ||
4 | import com.skua.modules.dataAnalysis.service.IFactoryCenterService; | ||
5 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; | ||
6 | import com.skua.modules.dataAnalysis.vo.StatisticsParam; | ||
7 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; | ||
8 | import io.swagger.annotations.Api; | ||
9 | import io.swagger.annotations.ApiOperation; | ||
10 | import lombok.extern.slf4j.Slf4j; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | ||
12 | import org.springframework.web.bind.annotation.GetMapping; | ||
13 | import org.springframework.web.bind.annotation.RequestMapping; | ||
14 | import org.springframework.web.bind.annotation.RestController; | ||
15 | |||
16 | import java.util.HashMap; | ||
17 | import java.util.List; | ||
18 | import java.util.Map; | ||
19 | |||
20 | @Slf4j | ||
21 | @Api(tags = "厂区运营考核中心") | ||
22 | @RestController | ||
23 | @RequestMapping("/v1/operate") | ||
24 | public class FactoryOperateCenterController { | ||
25 | |||
26 | @Autowired | ||
27 | private IFactoryOperateCenterService factoryOperateCenterService; | ||
28 | |||
29 | @ApiOperation(value="厂区统计数据", notes="厂区统计数据") | ||
30 | @GetMapping(value = "/getData") | ||
31 | public Result<Map<String,Object>> getData(String departId,String month) { | ||
32 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
33 | Map<String,Object> map = factoryOperateCenterService.getData(departId,month); | ||
34 | result.setSuccess(true); | ||
35 | result.setResult(map); | ||
36 | return result; | ||
37 | } | ||
38 | |||
39 | } |
1 | package com.skua.modules.dataAnalysis.mapper; | ||
2 | |||
3 | import org.apache.ibatis.annotations.Param; | ||
4 | |||
5 | import java.util.List; | ||
6 | import java.util.Map; | ||
7 | |||
8 | public interface FactoryOperateCenterMapper { | ||
9 | |||
10 | Map<String, Object> getData(@Param("month") String month, @Param("departId") String departId, | ||
11 | @Param("view3a24") String view3a24, @Param("view2119") String view2119); | ||
12 | |||
13 | } |
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | <mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper"> | ||
4 | <select id="getData" resultType="java.util.HashMap"> | ||
5 | SELECT | ||
6 | ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl, | ||
7 | ROUND(AVG( v3.DLHJ )/10000,2) AS rjdl, | ||
8 | ROUND(SUM( v3.WNL ),2) AS yzcnl, | ||
9 | ROUND(SUM( v2.CSL )/10000,2) AS yclsl, | ||
10 | ROUND(SUM( v3.DLHJ )/SUM( v2.CSL ),2) as dsdh, | ||
11 | ROUND(AVG( v2.CSL )/10000,2) AS rjclsl, | ||
12 | ROUND(SUM( v3.WNL )/(SUM( v2.CSL )/10000),2) as wdscnl, | ||
13 | LEFT ( v3.time, 7 ) AS time | ||
14 | FROM | ||
15 | ${view3a24} v3 | ||
16 | LEFT JOIN (select v.CSL,v.time from ${view2119} v where LEFT ( v.time, 7 ) = #{month} and v.depart_id = #{departId}) v2 ON v2.time = v3.time | ||
17 | where LEFT ( v3.time, 7 ) = #{month} | ||
18 | and v3.depart_id = #{departId} | ||
19 | </select> | ||
20 | </mapper> |
1 | package com.skua.modules.dataAnalysis.service.impl; | 1 | package com.skua.modules.dataAnalysis.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
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.context.SpringContextUtils; | 6 | import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.service.IFactoryInfoService; | 7 | import com.skua.core.service.IFactoryInfoService; |
... | @@ -40,9 +41,6 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -40,9 +41,6 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
40 | @Autowired | 41 | @Autowired |
41 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; | 42 | private ISysMonitorMetricInfoService sysMonitorMetricInfoService; |
42 | 43 | ||
43 | private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9"; | ||
44 | private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1"; | ||
45 | |||
46 | @Override | 44 | @Override |
47 | public List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId) { | 45 | public List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId) { |
48 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); | 46 | List<WaterQualityMonitoringDetailVO> list = new ArrayList<>(); |
... | @@ -195,14 +193,14 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -195,14 +193,14 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
195 | Map<String, Object> map = new HashMap<>(); | 193 | Map<String, Object> map = new HashMap<>(); |
196 | String monthTb = DateUtils.getTbMonth(month); | 194 | String monthTb = DateUtils.getTbMonth(month); |
197 | String monthHb = DateUtils.getHbMonth(month); | 195 | String monthHb = DateUtils.getHbMonth(month); |
198 | String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, month); | 196 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, month); |
199 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, month); | 197 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month); |
200 | Map<String, Object> valueMap = factoryCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119); | 198 | Map<String, Object> valueMap = factoryCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119); |
201 | String dataViewName3a24Hb = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, monthHb); | 199 | String dataViewName3a24Hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, monthHb); |
202 | String dataViewName2119Hb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, monthHb); | 200 | String dataViewName2119Hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthHb); |
203 | Map<String, Object> hbValueMap = factoryCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb); | 201 | Map<String, Object> hbValueMap = factoryCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb); |
204 | String dataViewName3a24Tb = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, monthTb); | 202 | String dataViewName3a24Tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, monthTb); |
205 | String dataViewName2119Tb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, monthTb); | 203 | String dataViewName2119Tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthTb); |
206 | Map<String, Object> tbValueMap = factoryCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb); | 204 | Map<String, Object> tbValueMap = factoryCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb); |
207 | map.put("yclsl",new HashMap<>()); | 205 | map.put("yclsl",new HashMap<>()); |
208 | Map<String, Object> yclslMap = new HashMap<>(); | 206 | Map<String, Object> yclslMap = new HashMap<>(); |
... | @@ -294,10 +292,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -294,10 +292,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
294 | String endDate = statisticsParam.getEndDate(); | 292 | String endDate = statisticsParam.getEndDate(); |
295 | String startDateTb = DateUtils.getTbDate(startDate); | 293 | String startDateTb = DateUtils.getTbDate(startDate); |
296 | String endDateTb = DateUtils.getTbDate(endDate); | 294 | String endDateTb = DateUtils.getTbDate(endDate); |
297 | String dataView3a24 = ReportViewUtil.buildView(view3a24, "WNL", statisticsParam.getDepartId(), startDate,endDate); | 295 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "WNL", statisticsParam.getDepartId(), startDate,endDate); |
298 | String dataView3a24tb = ReportViewUtil.buildView(view3a24, "WNL", statisticsParam.getDepartId(), startDateTb,endDateTb); | 296 | String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, "WNL", statisticsParam.getDepartId(), startDateTb,endDateTb); |
299 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); | 297 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); |
300 | String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); | 298 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); |
301 | list = factoryCenterMapper.getCnltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(), | 299 | list = factoryCenterMapper.getCnltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(), |
302 | dataView3a24,dataView3a24tb,dataView2119,dataView2119tb); | 300 | dataView3a24,dataView3a24tb,dataView2119,dataView2119tb); |
303 | if(list.size() == 0){ | 301 | if(list.size() == 0){ |
... | @@ -322,10 +320,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -322,10 +320,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
322 | String endDate = statisticsParam.getEndDate(); | 320 | String endDate = statisticsParam.getEndDate(); |
323 | String startDateTb = DateUtils.getTbDate(startDate); | 321 | String startDateTb = DateUtils.getTbDate(startDate); |
324 | String endDateTb = DateUtils.getTbDate(endDate); | 322 | String endDateTb = DateUtils.getTbDate(endDate); |
325 | String dataView3a24 = ReportViewUtil.buildView(view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate); | 323 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate); |
326 | String dataView3a24tb = ReportViewUtil.buildView(view3a24, "DLHJ", statisticsParam.getDepartId(), startDateTb,endDateTb); | 324 | String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDateTb,endDateTb); |
327 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); | 325 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); |
328 | String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); | 326 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); |
329 | list = factoryCenterMapper.getHdltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(), | 327 | list = factoryCenterMapper.getHdltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(), |
330 | dataView3a24,dataView3a24tb,dataView2119,dataView2119tb); | 328 | dataView3a24,dataView3a24tb,dataView2119,dataView2119tb); |
331 | if(list.size() == 0){ | 329 | if(list.size() == 0){ |
... | @@ -350,8 +348,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -350,8 +348,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
350 | String endDate = statisticsParam.getEndDate(); | 348 | String endDate = statisticsParam.getEndDate(); |
351 | String startDateTb = DateUtils.getTbDate(startDate); | 349 | String startDateTb = DateUtils.getTbDate(startDate); |
352 | String endDateTb = DateUtils.getTbDate(endDate); | 350 | String endDateTb = DateUtils.getTbDate(endDate); |
353 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); | 351 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate); |
354 | String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); | 352 | String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb); |
355 | list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119,dataView2119tb); | 353 | list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119,dataView2119tb); |
356 | if(list.size() == 0){ | 354 | if(list.size() == 0){ |
357 | List<String> monthList = getMonthsBetween(startDate,endDate); | 355 | List<String> monthList = getMonthsBetween(startDate,endDate); |
... | @@ -374,8 +372,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -374,8 +372,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
374 | String startDateTb = DateUtils.getTbDate(startDate); | 372 | String startDateTb = DateUtils.getTbDate(startDate); |
375 | String endDateTb = DateUtils.getTbDate(endDate); | 373 | String endDateTb = DateUtils.getTbDate(endDate); |
376 | String yjField = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 374 | String yjField = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; |
377 | String dataView3a24 = ReportViewUtil.buildView(view3a24, yjField, statisticsParam.getDepartId(), startDate,endDate); | 375 | String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDate,endDate); |
378 | String dataView3a24tb = ReportViewUtil.buildView(view3a24, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb); | 376 | String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb); |
379 | list = factoryCenterMapper.getYhtj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView3a24,dataView3a24tb); | 377 | list = factoryCenterMapper.getYhtj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView3a24,dataView3a24tb); |
380 | if(list.size() == 0){ | 378 | if(list.size() == 0){ |
381 | List<String> monthList = getMonthsBetween(startDate,endDate); | 379 | List<String> monthList = getMonthsBetween(startDate,endDate); |
... | @@ -537,7 +535,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -537,7 +535,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
537 | String startDate = statisticsParam.getStartDate(); | 535 | String startDate = statisticsParam.getStartDate(); |
538 | String endDate = statisticsParam.getEndDate(); | 536 | String endDate = statisticsParam.getEndDate(); |
539 | String fields = "CSL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL"; | 537 | String fields = "CSL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL"; |
540 | String dataView2119 = ReportViewUtil.buildView(view2119, fields, statisticsParam.getDepartId(), startDate, endDate); | 538 | String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, fields, statisticsParam.getDepartId(), startDate, endDate); |
541 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); | 539 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); |
542 | return list; | 540 | return list; |
543 | } | 541 | } | ... | ... |
1 | package com.skua.modules.dataAnalysis.service.impl; | ||
2 | |||
3 | import com.skua.common.constant.ReportConstant; | ||
4 | import com.skua.common.report.ReportViewUtil; | ||
5 | import com.skua.core.util.ConvertUtils; | ||
6 | import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper; | ||
7 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; | ||
8 | import com.skua.tool.util.DateUtils; | ||
9 | import org.springframework.stereotype.Service; | ||
10 | import javax.annotation.Resource; | ||
11 | import java.util.HashMap; | ||
12 | import java.util.Map; | ||
13 | |||
14 | @Service | ||
15 | public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterService { | ||
16 | |||
17 | @Resource | ||
18 | private FactoryOperateCenterMapper factoryOperateCenterMapper; | ||
19 | |||
20 | @Override | ||
21 | public Map<String, Object> getData(String departId, String month) { | ||
22 | Map<String, Object> map = new HashMap<>(); | ||
23 | String monthTb = DateUtils.getTbMonth(month); | ||
24 | String monthHb = DateUtils.getHbMonth(month); | ||
25 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | ||
26 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | ||
27 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month); | ||
28 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month); | ||
29 | Map<String, Object> valueMap = factoryOperateCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119); | ||
30 | String dataViewName3a24Hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthHb); | ||
31 | String dataViewName2119Hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthHb); | ||
32 | Map<String, Object> hbValueMap = factoryOperateCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb); | ||
33 | String dataViewName3a24Tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthTb); | ||
34 | String dataViewName2119Tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthTb); | ||
35 | Map<String, Object> tbValueMap = factoryOperateCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb); | ||
36 | map.put("yclsl",new HashMap<>()); | ||
37 | Map<String, Object> yclslMap = new HashMap<>(); | ||
38 | yclslMap.put("unit","万吨"); | ||
39 | map.put("rjclsl",new HashMap<>()); | ||
40 | Map<String, Object> rjclslMap = new HashMap<>(); | ||
41 | rjclslMap.put("unit","万吨"); | ||
42 | map.put("yzdl",new HashMap<>()); | ||
43 | Map<String, Object> yzdlMap = new HashMap<>(); | ||
44 | yzdlMap.put("unit","万Kw.h"); | ||
45 | map.put("dsdh",new HashMap<>()); | ||
46 | Map<String, Object> dsdhMap = new HashMap<>(); | ||
47 | dsdhMap.put("unit","Kw.h/吨水"); | ||
48 | map.put("yzcnl",new HashMap<>()); | ||
49 | Map<String, Object> yzcnlMap = new HashMap<>(); | ||
50 | yzcnlMap.put("unit","吨"); | ||
51 | map.put("wdscnl",new HashMap<>()); | ||
52 | Map<String, Object> wdscnlMap = new HashMap<>(); | ||
53 | wdscnlMap.put("unit","吨/万吨"); | ||
54 | map.put("rjdl",new HashMap<>()); | ||
55 | Map<String, Object> rjdlMap = new HashMap<>(); | ||
56 | rjdlMap.put("unit","万Kw.h"); | ||
57 | if(valueMap != null){ | ||
58 | yclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yclsl")) ? valueMap.get("yclsl").toString() : "-");//月总处理水量 | ||
59 | rjclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjclsl")) ? valueMap.get("rjclsl").toString() : "-");//日均处理水量 | ||
60 | yzdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzdl")) ? valueMap.get("yzdl").toString() : "-");//月总电量 | ||
61 | dsdhMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("dsdh")) ? valueMap.get("dsdh").toString() : "-");//吨水电耗 | ||
62 | yzcnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzcnl")) ? valueMap.get("yzcnl").toString() : "-");//月总产泥量 | ||
63 | wdscnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("wdscnl")) ? valueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | ||
64 | rjdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjdl")) ? valueMap.get("rjdl").toString() : "-");//日均电量 | ||
65 | }else{ | ||
66 | yclslMap.put("value","-");//月总处理水量 | ||
67 | rjclslMap.put("value","-");//日均处理水量 | ||
68 | yzdlMap.put("value","-");//月总电量 | ||
69 | dsdhMap.put("value","-");//吨水电耗 | ||
70 | yzcnlMap.put("value","-");//月总产泥量 | ||
71 | wdscnlMap.put("value","-");//万吨水产泥量 | ||
72 | rjdlMap.put("value","-");//日均电量 | ||
73 | } | ||
74 | if(hbValueMap != null){ | ||
75 | yclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yclsl")) ? hbValueMap.get("yclsl").toString() : "-");//月总处理水量 | ||
76 | rjclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjclsl")) ? hbValueMap.get("rjclsl").toString() : "-");//日均处理水量 | ||
77 | yzdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzdl")) ? hbValueMap.get("yzdl").toString() : "-");//月总电量 | ||
78 | dsdhMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("dsdh")) ? hbValueMap.get("dsdh").toString() : "-");//吨水电耗 | ||
79 | yzcnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzcnl")) ? hbValueMap.get("yzcnl").toString() : "-");//月总产泥量 | ||
80 | wdscnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("wdscnl")) ? hbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | ||
81 | rjdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjdl")) ? hbValueMap.get("rjdl").toString() : "-");//日均电量 | ||
82 | }else{ | ||
83 | yclslMap.put("valueHb","-");//月总处理水量 | ||
84 | rjclslMap.put("valueHb","-");//日均处理水量 | ||
85 | yzdlMap.put("valueHb","-");//月总电量 | ||
86 | dsdhMap.put("valueHb","-");//吨水电耗 | ||
87 | yzcnlMap.put("valueHb","-");//月总产泥量 | ||
88 | wdscnlMap.put("valueHb","-");//万吨水产泥量 | ||
89 | rjdlMap.put("valueHb","-");//日均电量 | ||
90 | } | ||
91 | if(tbValueMap != null){ | ||
92 | yclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yclsl")) ? tbValueMap.get("yclsl").toString() : "-");//月总处理水量 | ||
93 | rjclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjclsl")) ? tbValueMap.get("rjclsl").toString() : "-");//日均处理水量 | ||
94 | yzdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzdl")) ? tbValueMap.get("yzdl").toString() : "-");//月总电量 | ||
95 | dsdhMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("dsdh")) ? tbValueMap.get("dsdh").toString() : "-");//吨水电耗 | ||
96 | yzcnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzcnl")) ? tbValueMap.get("yzcnl").toString() : "-");//月总产泥量 | ||
97 | wdscnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("wdscnl")) ? tbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | ||
98 | rjdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjdl")) ? tbValueMap.get("rjdl").toString() : "-");//日均电量 | ||
99 | }else{ | ||
100 | yclslMap.put("valueTb","-");//月总处理水量 | ||
101 | rjclslMap.put("valueTb","-");//日均处理水量 | ||
102 | yzdlMap.put("valueTb","-");//月总电量 | ||
103 | dsdhMap.put("valueTb","-");//吨水电耗 | ||
104 | yzcnlMap.put("valueTb","-");//月总产泥量 | ||
105 | wdscnlMap.put("valueTb","-");//万吨水产泥量 | ||
106 | rjdlMap.put("valueTb","-");//日均电量 | ||
107 | } | ||
108 | //汇总 | ||
109 | map.put("yclsl", yclslMap); | ||
110 | map.put("rjclsl", rjclslMap); | ||
111 | map.put("yzdl", yzdlMap); | ||
112 | map.put("dsdh", dsdhMap); | ||
113 | map.put("yzcnl", yzcnlMap); | ||
114 | map.put("wdscnl", wdscnlMap); | ||
115 | map.put("rjdl", rjdlMap); | ||
116 | return map; | ||
117 | } | ||
118 | |||
119 | } |
1 | package com.skua.modules.equipment.service.impl; | 1 | package com.skua.modules.equipment.service.impl; |
2 | 2 | ||
3 | import com.google.common.collect.Maps; | 3 | import com.google.common.collect.Maps; |
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.context.SpringContextUtils; | 6 | import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.util.ConvertUtils; | 7 | import com.skua.core.util.ConvertUtils; |
... | @@ -29,10 +30,6 @@ import java.util.stream.Collectors; | ... | @@ -29,10 +30,6 @@ import java.util.stream.Collectors; |
29 | @Service | 30 | @Service |
30 | public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnalysisService { | 31 | public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnalysisService { |
31 | 32 | ||
32 | |||
33 | String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H | ||
34 | String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表 | ||
35 | |||
36 | private JdbcTemplate getJdbcTemplate(){ | 33 | private JdbcTemplate getJdbcTemplate(){ |
37 | JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master"); | 34 | JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master"); |
38 | return masterDB; | 35 | return masterDB; |
... | @@ -64,9 +61,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -64,9 +61,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
64 | displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh); | 61 | displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh); |
65 | 62 | ||
66 | //历史最低吨水药耗??? | 63 | //历史最低吨水药耗??? |
67 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departId, null,null); | 64 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, null,null); |
68 | //System.out.println("dataViewName2119 "+dataViewName2119); | 65 | //System.out.println("dataViewName2119 "+dataViewName2119); |
69 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, null,null); | 66 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, null,null); |
70 | //System.out.println("dataViewName3a24 "+dataViewName3a24); | 67 | //System.out.println("dataViewName3a24 "+dataViewName3a24); |
71 | StringBuffer sql = new StringBuffer(); | 68 | StringBuffer sql = new StringBuffer(); |
72 | sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round(( ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; | 69 | sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round(( ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; |
... | @@ -90,7 +87,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -90,7 +87,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
90 | String startTime=this.getMonthBytime(-25,time)+"-01"; | 87 | String startTime=this.getMonthBytime(-25,time)+"-01"; |
91 | String endTime=this.getMonthBytime(-1,time)+"-31"; | 88 | String endTime=this.getMonthBytime(-1,time)+"-31"; |
92 | 89 | ||
93 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); | 90 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); |
94 | System.out.println("dataViewName3a24 ="+dataViewName3a24); | 91 | System.out.println("dataViewName3a24 ="+dataViewName3a24); |
95 | StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', "); | 92 | StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', "); |
96 | sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from "); | 93 | sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from "); |
... | @@ -133,9 +130,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -133,9 +130,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
133 | String startTime=this.getMonthBytime(-12,time)+"-01"; | 130 | String startTime=this.getMonthBytime(-12,time)+"-01"; |
134 | String endTime=this.getMonthBytime(-1,time)+"-31"; | 131 | String endTime=this.getMonthBytime(-1,time)+"-31"; |
135 | //历史最低吨水药耗??? | 132 | //历史最低吨水药耗??? |
136 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departId, startTime,endTime); | 133 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, startTime,endTime); |
137 | //System.out.println("dataViewName2119 "+dataViewName2119); | 134 | //System.out.println("dataViewName2119 "+dataViewName2119); |
138 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); | 135 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); |
139 | //System.out.println("dataViewName3a24 "+dataViewName3a24); | 136 | //System.out.println("dataViewName3a24 "+dataViewName3a24); |
140 | StringBuffer sql = new StringBuffer(); | 137 | StringBuffer sql = new StringBuffer(); |
141 | sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round((ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; | 138 | sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round((ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; |
... | @@ -176,7 +173,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -176,7 +173,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
176 | public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){ | 173 | public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){ |
177 | DateVO dateVO = new DateVO(time);//转换后的时间参数 | 174 | DateVO dateVO = new DateVO(time);//转换后的时间参数 |
178 | //本月处理水量 | 175 | //本月处理水量 |
179 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 176 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
180 | Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class); | 177 | Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class); |
181 | List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); | 178 | List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); |
182 | if(dataMapList != null ){ | 179 | if(dataMapList != null ){ |
... | @@ -186,7 +183,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -186,7 +183,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
186 | } | 183 | } |
187 | 184 | ||
188 | //环比:上月处理水量 | 185 | //环比:上月处理水量 |
189 | dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | 186 | dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); |
190 | Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class); | 187 | Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class); |
191 | dataMapList = getJdbcTemplate().queryForList(dataViewName2119); | 188 | dataMapList = getJdbcTemplate().queryForList(dataViewName2119); |
192 | if(dataMapList != null ){ | 189 | if(dataMapList != null ){ |
... | @@ -195,7 +192,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -195,7 +192,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
195 | } | 192 | } |
196 | } | 193 | } |
197 | //同比处理水量 | 194 | //同比处理水量 |
198 | dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | 195 | dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); |
199 | Double tbqnCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class); | 196 | Double tbqnCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class); |
200 | dataMapList = getJdbcTemplate().queryForList(dataViewName2119); | 197 | dataMapList = getJdbcTemplate().queryForList(dataViewName2119); |
201 | if(dataMapList != null ){ | 198 | if(dataMapList != null ){ |
... | @@ -208,13 +205,13 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -208,13 +205,13 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
208 | String fileds = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY"; | 205 | String fileds = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY"; |
209 | 206 | ||
210 | //本月药剂 总药耗 | 207 | //本月药剂 总药耗 |
211 | String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 208 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
212 | Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24); | 209 | Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24); |
213 | //环比:上月药剂 总药耗 | 210 | //环比:上月药剂 总药耗 |
214 | dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | 211 | dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); |
215 | Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); | 212 | Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); |
216 | //同比:去年本月药剂: 总药耗 | 213 | //同比:去年本月药剂: 总药耗 |
217 | dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | 214 | dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); |
218 | Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); | 215 | Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); |
219 | 216 | ||
220 | String filedsSql = "select item_code ,item_alias from f_report_item where item_code in ('PAMZ','PAMF','PAMRJ','SCLPAMZ','SCLPAMF','NACLO','PACGT','PACYT','FESO4G','FESO4Y','H2O2','CH3COOH','SH','FECL3','HXT','PFS','CH3COONA','GXCLJ','YWL','RYXNJ','FHTY') "; | 217 | String filedsSql = "select item_code ,item_alias from f_report_item where item_code in ('PAMZ','PAMF','PAMRJ','SCLPAMZ','SCLPAMF','NACLO','PACGT','PACYT','FESO4G','FESO4Y','H2O2','CH3COOH','SH','FECL3','HXT','PFS','CH3COONA','GXCLJ','YWL','RYXNJ','FHTY') "; |
... | @@ -268,8 +265,8 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -268,8 +265,8 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
268 | String startTime=this.getMonthBytime(-12,time)+"-01"; | 265 | String startTime=this.getMonthBytime(-12,time)+"-01"; |
269 | String endTime=this.getMonthBytime(-1,time)+"-31"; | 266 | String endTime=this.getMonthBytime(-1,time)+"-31"; |
270 | //本月处理水量 | 267 | //本月处理水量 |
271 | String dataViewName2119 = ReportViewUtil.buildView(view2119,"JSSS", departId, startTime,endTime); | 268 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"JSSS", departId, startTime,endTime); |
272 | String dataViewName3a24 = ReportViewUtil.buildView(view3a24,"WNL,WNHSL,"+drugCode, departId, startTime,endTime); | 269 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,WNHSL,"+drugCode, departId, startTime,endTime); |
273 | String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time',aaa.JSSS ,aaa.depart_id from " +dataViewName2119+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m') " ; | 270 | String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time',aaa.JSSS ,aaa.depart_id from " +dataViewName2119+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m') " ; |
274 | List<Map<String, Object>> dataList = getJdbcTemplate().queryForList(sql); | 271 | List<Map<String, Object>> dataList = getJdbcTemplate().queryForList(sql); |
275 | if(dataList != null){ | 272 | if(dataList != null){ |
... | @@ -315,7 +312,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -315,7 +312,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
315 | * @return | 312 | * @return |
316 | */ | 313 | */ |
317 | private Double countDSYH(String departId ,String startTime ,String endTime ){ | 314 | private Double countDSYH(String departId ,String startTime ,String endTime ){ |
318 | String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); | 315 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); |
319 | StringBuffer sql2 = new StringBuffer("select "); | 316 | StringBuffer sql2 = new StringBuffer("select "); |
320 | sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from "); | 317 | sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from "); |
321 | sql2.append( " "+dataViewName3a24+" aaa "); | 318 | sql2.append( " "+dataViewName3a24+" aaa "); |
... | @@ -330,7 +327,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -330,7 +327,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
330 | } | 327 | } |
331 | 328 | ||
332 | private Double getCSL(String departId ,String startTime ,String endTime ){ | 329 | private Double getCSL(String departId ,String startTime ,String endTime ){ |
333 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, startTime,endTime); | 330 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime); |
334 | List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(dataViewName2119); | 331 | List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(dataViewName2119); |
335 | String csl = null; | 332 | String csl = null; |
336 | for(Map<String,Object> map : mapList ){ | 333 | for(Map<String,Object> map : mapList ){ | ... | ... |
... | @@ -143,7 +143,7 @@ public class ShiroConfig { | ... | @@ -143,7 +143,7 @@ public class ShiroConfig { |
143 | // 压测demo | 143 | // 压测demo |
144 | filterChainDefinitionMap.put("/jmeter/**", "anon"); | 144 | filterChainDefinitionMap.put("/jmeter/**", "anon"); |
145 | filterChainDefinitionMap.put("/jmReport/**", "anon"); | 145 | filterChainDefinitionMap.put("/jmReport/**", "anon"); |
146 | filterChainDefinitionMap.put("/v1/factoryCenter/**", "anon"); | 146 | filterChainDefinitionMap.put("/v1/operate/**", "anon"); |
147 | 147 | ||
148 | //哈工大报表填报数据 | 148 | //哈工大报表填报数据 |
149 | filterChainDefinitionMap.put("/harbinTechnology/fillReport/**", "anon"); //哈工大报表填报数据 | 149 | filterChainDefinitionMap.put("/harbinTechnology/fillReport/**", "anon"); //哈工大报表填报数据 | ... | ... |
-
请 注册 或 登录 后发表评论