1、public String findJyfxDldfGcData() throws IOExceptionMap paramMap = RequestUtils.parameterConvert(params);paramMap.put(“ym“, getPreYm(paramMap);super.write(response, Contants.CONTENT_TYPE_IMAGE,consDftzInfo.queryConsRcvblPieStr(paramMap);return NONE;* 根据传入的参数,查询获取用户的电量电费构成(转换过后供fusionchart( 饼状图)使用的x
2、ml格式数据)* param params * cons_no:户号* ym: :电费年月* return String XML*/String queryConsRcvblPieStr(Map params);public String queryConsRcvblPieStr(Map params) / TODO Auto-generated method stubString show_type = (StringUtil.isNullOrEmpty(params.get(“show“) ? “sdl“ : (String) params.get(“show“);String data_
3、xml = “;if (“sdl“.equals(show_type) data_xml = this.queryConsRcvblSdlPieStr(params); else if (“sdsr“.equals(show_type) data_xml = this.queryConsRcvblAmtPieStr(params);public String queryConsRcvblAmtPieStr(Map params) / TODO Auto-generated method stubStringBuffer dataStr = new StringBuffer(WsConnectU
4、til.XML_TITLE);String ym = (String)params.get(“ym“).substring(0,4)+“年“+(String)params.get(“ym“).substring(4,6)+“月“ ;String sub_title = (String)params.get(“show_name“);List dataLst = this.queryConsRcvbl(params);return data_xml; /* public String queryConsRcvblSdlPieStr(Map params) / TODO Auto-generate
5、d method stubStringBuffer dataStr = new StringBuffer(WsConnectUtil.XML_TITLE);String ym = (String)params.get(“ym“).substring(0,4)+“年“+(String)params.get(“ym“).substring(4,6)+“月“ ;String sub_title = (String)params.get(“show_name“);List dataLst = this.queryConsRcvbl(params);public List queryConsRcvbl(
6、Map params) / TODO Auto-generated method stubString group = (“1“.equals(params.get(“group“) ? “PRC_CODE“ : “ELEC_TYPE_CODE“;StringBuffer sql = new StringBuffer();sql.append(“WITH TMP AS ( “);sql.append(“SELECT (case when (ELEC_TYPE_CODE=“+group+“ and “+group+“ IS NULL) THEN “);sql.append(“ (SELECT E
7、LEC_TYPE_CODE FROM EPMA.E_CAT_PRC WHERE PRC_CODE = AMT.PRC_CODE “);sql.append(“ AND PARA_VN = (SELECT MAX(PARA_VN) FROM EPMA.E_BILL_PARA_VER WHERE PAR_VER_TYPE=1 AND RELEASE_FLAG=1) AND ROWNUM=1) “);sql.append(“ELSE “+group+“ END ) “+group+“,“);sql.append(“T_SETTLE_PQ SDL,T_AMT SDSR ,0 SDL_TQ ,0.00
8、SDSR_TQ “);sql.append(“FROM EPMA.A_RCVBL_FLOW RCVBL,EPMA.ARC_E_CONS_PRC_AMT AMT “);sql.append(“WHERE RCVBL.CALC_ID = AMT.CALC_ID AND RCVBL.CONS_NO=? “);sql.append(“AND EXISTS(SELECT 1 FROM EPMA.E_CALC_INV WHERE RCVBL_AMT_ID = RCVBL.RCVBL_AMT_ID AND NY=? AND ZHH=“+params.get(“cons_no“)+“) “);sql.appe
9、nd(“AND AMT.PRC_CODE0 AND TO_NUMBER(PRC_CODE)0 AND TO_NUMBER(PRC_CODE)/* 交易分析-2.1.4.2 电量电费构成比重数据(平均电价)* return NONE* throws IOException ERR */public String findJyfxDldfGcPrcStr() throws IOExceptionMap paramMap = RequestUtils.parameterConvert(params);paramMap.put(“ym“, getPreYm(paramMap);super.write(
10、response, Contants.CONTENT_TYPE_IMAGE,consDftzInfo.queryConsAvgPriceStr(paramMap);return NONE;public String queryConsAvgPriceStr(Map params) / TODO Auto-generated method stubString xml_param = WsConnectUtil.convertMapForXML(params);String datas = WsConnectUtil.getXmlByClient(Contants.SERVICE_DLDF_UR
11、L, xml_param, “queryAvgPriceData“);return datas; public Map queryAvgPrice(Map params) / TODO Auto-generated method stubStringBuffer sql = new StringBuffer();sql.append(“WITH TMP_PJ AS ( “);/sql.append(“SELECT SDL,NVL(DDDF,0)+NVL(XLDF,0)+NVL(RLDF,0)+NVL(LTZ,0)+NVL(LTJ,0) SDSR “);/sql.append(“FROM EPM
12、A.E_SBFSHYHZ WHERE LENGTH(ORG_NO)=5 AND YM=? AND HC=560 “);sql.append(“SELECT SUM(T_SETTLE_PQ)/1000 SDL,SUM(T_AMT) SDSR “); sql.append(“FROM EPMA.ARC_E_CONS_PRC_AMT WHERE YM=? “);sql.append(“AND TRADE_TYPE_CODE=(SELECT TRADE_CODE FROM EPMA.C_CONS WHERE CONS_NO=“+params.get(“cons_no“)+“)“);sql.append
13、(“), “);sql.append(“TMP_CONS AS ( “);sql.append(“SELECT SUM(T_SETTLE_PQ) SDL,SUM(T_AMT)-SUM(ZBRL) SDSR FROM ( “);sql.append(“SELECT T_SETTLE_PQ,T_AMT, “);sql.append(“(SELECT NVL(SUM(BA),0) FROM EPMA.ARC_E_BASE_AMT WHERE PRC_AMT_ID = B.PRC_AMT_ID AND BA_TYPE_CODE=2) ZBRL “);sql.append(“FROM EPMA.ARC_
14、E_CONS_SNAP A,EPMA.ARC_E_CONS_PRC_AMT B,EPMA.A_RCVBL_FLOW FLOW “);sql.append(“WHERE A.CALC_ID = B.CALC_ID AND A.CALC_ID = FLOW.CALC_ID “);sql.append(“AND A.CONS_NO = ? AND FLOW.CONS_NO = A.CONS_NO “);sql.append(“AND EXISTS(SELECT 1 FROM EPMA.E_CALC_INV WHERE RCVBL_AMT_ID = FLOW.RCVBL_AMT_ID AND NY=?
15、 AND ZHH=?) “); sql.append(“) “);sql.append(“) “);sql.append(“SELECT (SELECT (CASE WHEN SDL=0 THEN 0 ELSE NVL(ROUND(SDSR/SDL,2),0) END) FROM TMP_PJPJ) PJ, “);sql.append(“(SELECT (CASE WHEN SDL=0 THEN 0 ELSE NVL(ROUND(SDSR/SDL*1000,2),0) END) FROM TMP_CONS) CONS “);sql.append(“FROM DUAL “) ;return super.jdbcTemplateEx.queryForMap(sql.toString(),new Objectparams.get(“ym“),params.get(“cons_no“),params.get(“ym“),params.get(“cons_no“),new intTypes.VARCHAR,Types.VARCHAR,Types.VARCHAR,Types.VARCHAR);