c3ba1225 张雷

水厂运营大屏接口、报表编码抽取

1 个父辈 3fb833a1
package com.skua.modules.algorithm.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
......@@ -41,8 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
@Resource
private FReportItemMapper reportItemMapper;
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
/**
* 指挥中心---运行负荷率分析
* @param reportItemvParam
......@@ -135,16 +134,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
public DepartDrugResult getYhTotal(String month) {
String monthTb = DateUtils.getTbMonth(month);//同比时间
String monthHb = DateUtils.getHbMonth(month);//环比时间
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", "", month);
String dataViewName2119tb = ReportViewUtil.buildViewLike(view2119,"CSL", "", monthTb);
String dataViewName2119hb = ReportViewUtil.buildViewLike(view2119,"CSL", "", monthHb);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", month);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthTb);
String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthHb);
String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,field3a24, "", month);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(view3a24,field3a24, "", monthTb);
String dataViewName3a24hb = ReportViewUtil.buildViewLike(view3a24,field3a24, "", monthHb);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", month);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthTb);
String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthHb);
DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb,
dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb);
if(departDrugResult == null){
......@@ -186,7 +183,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
//月产水量
Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa";
sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id";
sql += " left join sys_depart d on d.id = aaa.depart_id";
......@@ -224,7 +221,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
//通用csl查询,返回Map<部门编号,CSL出水量>
public Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){
Map<String,String> cslMap = new HashMap<>();
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime);
// System.out.println("dataViewName2119 ="+dataViewName2119 );
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null){
......
package com.skua.modules.threedimensional.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.service.IFactoryInfoService;
import com.skua.core.util.DateUtils;
......@@ -30,8 +31,6 @@ public class ScreenDataServiceImpl implements IScreenDataService {
private IFactoryInfoService factoryInfoService;
@Resource
private ScreenMapper screenMapper;
private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Override
public Map<String, Object> getDifferData(String startDate, String itemTags, String departId, String type, JdbcTemplate masterDB) {
......@@ -219,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
String departIds = statisticsParams.getDepartIds();
Map<String, Object> valueMap = new HashMap<>();
List<String> monthList = getMonthsBetween(startDate,endDate);
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, "DLHJ", departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate);
List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
if(dataList.size()>0){
for (Map<String, Object> vMap : dataList) {
......@@ -264,8 +263,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
List<String> monthList = getMonthsBetween(startDate,endDate);
String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate);
List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
if(dataList.size()>0){
for (Map<String, Object> vMap : dataList) {
......
package com.skua.modules.custom.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.modules.custom.entity.FCustomReportDataset;
......@@ -25,9 +26,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDatasetMapper, FCustomReportDataset> implements IFCustomReportDatasetService {
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
private static String view4411 = "4411ed3d78634bcdcd700f6e33724025";
@Autowired
private FCustomReportDatasetMapper mapper;
/* (non-Javadoc)
......@@ -72,17 +70,17 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) {
List<Map<String, Object>> valueMapList = new ArrayList<>();
String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1);
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dataTime);
String dataViewName2119tb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, tbYear);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dataTime);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear);
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,field3a24, departId, dataTime);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(view3a24,field3a24, departId, tbYear);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy";
String dataViewName4411 = ReportViewUtil.buildViewLike(view4411,field4411, departId, dataTime);
String dataViewName4411tb = ReportViewUtil.buildViewLike(view4411,"qntqsfsl", departId, tbYear);
String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,field4411, departId, dataTime);
String dataViewName4411tb = ReportViewUtil.buildViewLike(ReportConstant.view4411,"qntqsfsl", departId, tbYear);
//主库数据源
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
String sql = "select " +
......@@ -169,9 +167,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String endDate = weekMap.get("end");
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
String dataViewName2119 = ReportViewUtil.buildView(view2119,field2119, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,field2119, "", startDate, endDate);
valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119);
if(valueMap==null){
valueMap = new HashMap<>();
......@@ -217,8 +215,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String start = month.substring(0,4)+"-01-31";
String end = month + "-31";
String departIds = mapper.getChildDepartId(departId);
String dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds);
return list;
}
......@@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
List<JnhbReportDetailsJs> jsList = new ArrayList<>();
List<JnhbReportDetailsHj> hjList = new ArrayList<>();
String year = month.substring(0,4);
String dataViewName2 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, year);
String dataViewName3 = ReportViewUtil.buildViewLike(view3a24,"", departId, year);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, year);
String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year);
dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year);
jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year);
hjList = mapper.getHjList(dataViewName2, dataViewName3, departId, year);
......@@ -246,21 +244,21 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
long startTime = System.nanoTime();
JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
//当月数据
String dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
String dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null);
//System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
// 上月数据 同比
dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null);
//System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList);
// 去年数据 环比
dataViewName2 = ReportViewUtil.buildView(view2119,"CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
dataViewName3 = ReportViewUtil.buildView(view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null);
Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList);
......@@ -399,8 +397,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String endDate = weekMap.get("end");
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", "", startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", "", startDate, endDate);
list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119);
map.put("start", startDate);//开始时间
map.put("end", endDate);//结束时间
......
package com.skua.modules.dataAnalysis.controller;
import com.skua.core.api.vo.Result;
import com.skua.modules.dataAnalysis.service.IFactoryCenterService;
import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService;
import com.skua.modules.dataAnalysis.vo.StatisticsParam;
import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Api(tags = "厂区运营考核中心")
@RestController
@RequestMapping("/v1/operate")
public class FactoryOperateCenterController {
@Autowired
private IFactoryOperateCenterService factoryOperateCenterService;
@ApiOperation(value="厂区统计数据", notes="厂区统计数据")
@GetMapping(value = "/getData")
public Result<Map<String,Object>> getData(String departId,String month) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = factoryOperateCenterService.getData(departId,month);
result.setSuccess(true);
result.setResult(map);
return result;
}
}
package com.skua.modules.dataAnalysis.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface FactoryOperateCenterMapper {
Map<String, Object> getData(@Param("month") String month, @Param("departId") String departId,
@Param("view3a24") String view3a24, @Param("view2119") String view2119);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper">
<select id="getData" resultType="java.util.HashMap">
SELECT
ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl,
ROUND(AVG( v3.DLHJ )/10000,2) AS rjdl,
ROUND(SUM( v3.WNL ),2) AS yzcnl,
ROUND(SUM( v2.CSL )/10000,2) AS yclsl,
ROUND(SUM( v3.DLHJ )/SUM( v2.CSL ),2) as dsdh,
ROUND(AVG( v2.CSL )/10000,2) AS rjclsl,
ROUND(SUM( v3.WNL )/(SUM( v2.CSL )/10000),2) as wdscnl,
LEFT ( v3.time, 7 ) AS time
FROM
${view3a24} v3
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
where LEFT ( v3.time, 7 ) = #{month}
and v3.depart_id = #{departId}
</select>
</mapper>
package com.skua.modules.dataAnalysis.service;
import java.util.Map;
public interface IFactoryOperateCenterService {
Map<String, Object> getData(String departId,String month);
}
package com.skua.modules.dataAnalysis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.service.IFactoryInfoService;
......@@ -40,9 +41,6 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
@Autowired
private ISysMonitorMetricInfoService sysMonitorMetricInfoService;
private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Override
public List<WaterQualityMonitoringDetailVO> queryMonitoringData(String departId) {
List<WaterQualityMonitoringDetailVO> list = new ArrayList<>();
......@@ -195,14 +193,14 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
Map<String, Object> map = new HashMap<>();
String monthTb = DateUtils.getTbMonth(month);
String monthHb = DateUtils.getHbMonth(month);
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, month);
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, month);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, month);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month);
Map<String, Object> valueMap = factoryCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119);
String dataViewName3a24Hb = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, monthHb);
String dataViewName2119Hb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, monthHb);
String dataViewName3a24Hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, monthHb);
String dataViewName2119Hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthHb);
Map<String, Object> hbValueMap = factoryCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb);
String dataViewName3a24Tb = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL", departId, monthTb);
String dataViewName2119Tb = ReportViewUtil.buildViewLike(view2119,"CSL", departId, monthTb);
String dataViewName3a24Tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,WNL", departId, monthTb);
String dataViewName2119Tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthTb);
Map<String, Object> tbValueMap = factoryCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb);
map.put("yclsl",new HashMap<>());
Map<String, Object> yclslMap = new HashMap<>();
......@@ -294,10 +292,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String endDate = statisticsParam.getEndDate();
String startDateTb = DateUtils.getTbDate(startDate);
String endDateTb = DateUtils.getTbDate(endDate);
String dataView3a24 = ReportViewUtil.buildView(view3a24, "WNL", statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(view3a24, "WNL", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "WNL", statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, "WNL", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getCnltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),
dataView3a24,dataView3a24tb,dataView2119,dataView2119tb);
if(list.size() == 0){
......@@ -322,10 +320,10 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String endDate = statisticsParam.getEndDate();
String startDateTb = DateUtils.getTbDate(startDate);
String endDateTb = DateUtils.getTbDate(endDate);
String dataView3a24 = ReportViewUtil.buildView(view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(view3a24, "DLHJ", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getHdltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),
dataView3a24,dataView3a24tb,dataView2119,dataView2119tb);
if(list.size() == 0){
......@@ -350,8 +348,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String endDate = statisticsParam.getEndDate();
String startDateTb = DateUtils.getTbDate(startDate);
String endDateTb = DateUtils.getTbDate(endDate);
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String dataView2119tb = ReportViewUtil.buildView(ReportConstant.view2119, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView2119,dataView2119tb);
if(list.size() == 0){
List<String> monthList = getMonthsBetween(startDate,endDate);
......@@ -374,8 +372,8 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String startDateTb = DateUtils.getTbDate(startDate);
String endDateTb = DateUtils.getTbDate(endDate);
String yjField = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataView3a24 = ReportViewUtil.buildView(view3a24, yjField, statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(view3a24, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb);
String dataView3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDate,endDate);
String dataView3a24tb = ReportViewUtil.buildView(ReportConstant.view3a24, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getYhtj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),dataView3a24,dataView3a24tb);
if(list.size() == 0){
List<String> monthList = getMonthsBetween(startDate,endDate);
......@@ -537,7 +535,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String fields = "CSL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL";
String dataView2119 = ReportViewUtil.buildView(view2119, fields, statisticsParam.getDepartId(), startDate, endDate);
String dataView2119 = ReportViewUtil.buildView(ReportConstant.view2119, fields, statisticsParam.getDepartId(), startDate, endDate);
list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119);
return list;
}
......
package com.skua.modules.dataAnalysis.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper;
import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService;
import com.skua.tool.util.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterService {
@Resource
private FactoryOperateCenterMapper factoryOperateCenterMapper;
@Override
public Map<String, Object> getData(String departId, String month) {
Map<String, Object> map = new HashMap<>();
String monthTb = DateUtils.getTbMonth(month);
String monthHb = DateUtils.getHbMonth(month);
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month);
Map<String, Object> valueMap = factoryOperateCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119);
String dataViewName3a24Hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthHb);
String dataViewName2119Hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthHb);
Map<String, Object> hbValueMap = factoryOperateCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb);
String dataViewName3a24Tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthTb);
String dataViewName2119Tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthTb);
Map<String, Object> tbValueMap = factoryOperateCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb);
map.put("yclsl",new HashMap<>());
Map<String, Object> yclslMap = new HashMap<>();
yclslMap.put("unit","万吨");
map.put("rjclsl",new HashMap<>());
Map<String, Object> rjclslMap = new HashMap<>();
rjclslMap.put("unit","万吨");
map.put("yzdl",new HashMap<>());
Map<String, Object> yzdlMap = new HashMap<>();
yzdlMap.put("unit","万Kw.h");
map.put("dsdh",new HashMap<>());
Map<String, Object> dsdhMap = new HashMap<>();
dsdhMap.put("unit","Kw.h/吨水");
map.put("yzcnl",new HashMap<>());
Map<String, Object> yzcnlMap = new HashMap<>();
yzcnlMap.put("unit","吨");
map.put("wdscnl",new HashMap<>());
Map<String, Object> wdscnlMap = new HashMap<>();
wdscnlMap.put("unit","吨/万吨");
map.put("rjdl",new HashMap<>());
Map<String, Object> rjdlMap = new HashMap<>();
rjdlMap.put("unit","万Kw.h");
if(valueMap != null){
yclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yclsl")) ? valueMap.get("yclsl").toString() : "-");//月总处理水量
rjclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjclsl")) ? valueMap.get("rjclsl").toString() : "-");//日均处理水量
yzdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzdl")) ? valueMap.get("yzdl").toString() : "-");//月总电量
dsdhMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("dsdh")) ? valueMap.get("dsdh").toString() : "-");//吨水电耗
yzcnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzcnl")) ? valueMap.get("yzcnl").toString() : "-");//月总产泥量
wdscnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("wdscnl")) ? valueMap.get("wdscnl").toString() : "-");//万吨水产泥量
rjdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjdl")) ? valueMap.get("rjdl").toString() : "-");//日均电量
}else{
yclslMap.put("value","-");//月总处理水量
rjclslMap.put("value","-");//日均处理水量
yzdlMap.put("value","-");//月总电量
dsdhMap.put("value","-");//吨水电耗
yzcnlMap.put("value","-");//月总产泥量
wdscnlMap.put("value","-");//万吨水产泥量
rjdlMap.put("value","-");//日均电量
}
if(hbValueMap != null){
yclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yclsl")) ? hbValueMap.get("yclsl").toString() : "-");//月总处理水量
rjclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjclsl")) ? hbValueMap.get("rjclsl").toString() : "-");//日均处理水量
yzdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzdl")) ? hbValueMap.get("yzdl").toString() : "-");//月总电量
dsdhMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("dsdh")) ? hbValueMap.get("dsdh").toString() : "-");//吨水电耗
yzcnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzcnl")) ? hbValueMap.get("yzcnl").toString() : "-");//月总产泥量
wdscnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("wdscnl")) ? hbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量
rjdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjdl")) ? hbValueMap.get("rjdl").toString() : "-");//日均电量
}else{
yclslMap.put("valueHb","-");//月总处理水量
rjclslMap.put("valueHb","-");//日均处理水量
yzdlMap.put("valueHb","-");//月总电量
dsdhMap.put("valueHb","-");//吨水电耗
yzcnlMap.put("valueHb","-");//月总产泥量
wdscnlMap.put("valueHb","-");//万吨水产泥量
rjdlMap.put("valueHb","-");//日均电量
}
if(tbValueMap != null){
yclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yclsl")) ? tbValueMap.get("yclsl").toString() : "-");//月总处理水量
rjclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjclsl")) ? tbValueMap.get("rjclsl").toString() : "-");//日均处理水量
yzdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzdl")) ? tbValueMap.get("yzdl").toString() : "-");//月总电量
dsdhMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("dsdh")) ? tbValueMap.get("dsdh").toString() : "-");//吨水电耗
yzcnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzcnl")) ? tbValueMap.get("yzcnl").toString() : "-");//月总产泥量
wdscnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("wdscnl")) ? tbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量
rjdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjdl")) ? tbValueMap.get("rjdl").toString() : "-");//日均电量
}else{
yclslMap.put("valueTb","-");//月总处理水量
rjclslMap.put("valueTb","-");//日均处理水量
yzdlMap.put("valueTb","-");//月总电量
dsdhMap.put("valueTb","-");//吨水电耗
yzcnlMap.put("valueTb","-");//月总产泥量
wdscnlMap.put("valueTb","-");//万吨水产泥量
rjdlMap.put("valueTb","-");//日均电量
}
//汇总
map.put("yclsl", yclslMap);
map.put("rjclsl", rjclslMap);
map.put("yzdl", yzdlMap);
map.put("dsdh", dsdhMap);
map.put("yzcnl", yzcnlMap);
map.put("wdscnl", wdscnlMap);
map.put("rjdl", rjdlMap);
return map;
}
}
package com.skua.modules.equipment.service.impl;
import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
......@@ -29,10 +30,6 @@ import java.util.stream.Collectors;
@Service
public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnalysisService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
private JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master");
return masterDB;
......@@ -64,9 +61,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh);
//历史最低吨水药耗???
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departId, null,null);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, null,null);
//System.out.println("dataViewName2119 "+dataViewName2119);
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);
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);
//System.out.println("dataViewName3a24 "+dataViewName3a24);
StringBuffer sql = new StringBuffer();
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
String startTime=this.getMonthBytime(-25,time)+"-01";
String endTime=this.getMonthBytime(-1,time)+"-31";
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);
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);
System.out.println("dataViewName3a24 ="+dataViewName3a24);
StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', ");
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
String startTime=this.getMonthBytime(-12,time)+"-01";
String endTime=this.getMonthBytime(-1,time)+"-31";
//历史最低吨水药耗???
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, startTime,endTime);
//System.out.println("dataViewName2119 "+dataViewName2119);
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);
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);
//System.out.println("dataViewName3a24 "+dataViewName3a24);
StringBuffer sql = new StringBuffer();
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
public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){
DateVO dateVO = new DateVO(time);//转换后的时间参数
//本月处理水量
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null ){
......@@ -186,7 +183,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
//环比:上月处理水量
dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null ){
......@@ -195,7 +192,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
}
//同比处理水量
dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
Double tbqnCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null ){
......@@ -208,13 +205,13 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
String fileds = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY";
//本月药剂 总药耗
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24);
//环比:上月药剂 总药耗
dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
//同比:去年本月药剂: 总药耗
dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
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
String startTime=this.getMonthBytime(-12,time)+"-01";
String endTime=this.getMonthBytime(-1,time)+"-31";
//本月处理水量
String dataViewName2119 = ReportViewUtil.buildView(view2119,"JSSS", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildView(view3a24,"WNL,WNHSL,"+drugCode, departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"JSSS", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,WNHSL,"+drugCode, departId, startTime,endTime);
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') " ;
List<Map<String, Object>> dataList = getJdbcTemplate().queryForList(sql);
if(dataList != null){
......@@ -315,7 +312,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
* @return
*/
private Double countDSYH(String departId ,String startTime ,String endTime ){
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);
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);
StringBuffer sql2 = new StringBuffer("select ");
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 ");
sql2.append( " "+dataViewName3a24+" aaa ");
......@@ -330,7 +327,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
private Double getCSL(String departId ,String startTime ,String endTime ){
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime);
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(dataViewName2119);
String csl = null;
for(Map<String,Object> map : mapList ){
......
......@@ -143,7 +143,7 @@ public class ShiroConfig {
// 压测demo
filterChainDefinitionMap.put("/jmeter/**", "anon");
filterChainDefinitionMap.put("/jmReport/**", "anon");
filterChainDefinitionMap.put("/v1/factoryCenter/**", "anon");
filterChainDefinitionMap.put("/v1/operate/**", "anon");
//哈工大报表填报数据
filterChainDefinitionMap.put("/harbinTechnology/fillReport/**", "anon"); //哈工大报表填报数据
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!