123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888 |
- package com.sinosoft.am.customer.dao;
- import java.util.ArrayList;
- import java.util.List;
- import org.apache.log4j.Logger;
- import com.persistence.service.PersistenceFactory;
- import com.persistence.service.SysPersistence;
- import com.persistence.service.exception.PersistenceException;
- import com.sinosoft.am.customer.vo.customerModel;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- import com.sysmodel.datamodel.xmlmodel.able.SysModel;
- public class customerModelDao {
- private Logger log = Logger.getLogger(this.getClass());
- SysModel sysmodel = ModelFactory.getSysmodel();
- SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
- StringBuffer json = new StringBuffer();
- private List<customerModel> numList = new ArrayList<customerModel>();
- /**
- * 获取横轴各单位名称2015-10-12
- * @param list
- * @return
- */
-
- /**
- * 根据传过来的ID进行检测,有子节点且子节点在明细表中有数据的,继续查询该节点下面的数据
- * @param id
- * @return
- * @throws PersistenceException
- */
- public String getCustomerInfoNumInit(String id,String firstPageNum,String limit,String convalue,String customername) throws PersistenceException{
- try{
- log.info("ID==="+id+",第一页===="+firstPageNum+",个数======"+limit);
- log.info(convalue);
- if(convalue.equals(" undefined")){
- convalue = "";
- }
- List<String> list1 = new ArrayList<String>();
- List<String>tempList=getCmpList(new ArrayList<String>(),firstPageNum,limit,id,convalue,customername);
- for(int i=0;i<tempList.size();i++){
- list1.add(tempList.get(i));
- }
- getPlanNum(list1, id);
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
-
- if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }
-
- String condition = " where IMPORT_LEVEL!='5' ";
- if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- condition += "";
- }else if(id.equals("1E5D688F639E48EBA0AEC8B057F2C06D")){
- condition += "and DESCRIPTION ='035200' ";
- }else if(id.equals("2BF184BAA0CB4F6D821048FDE4612999")){
- condition += "and DESCRIPTION ='030800' ";
- }else if(id.equals("304866F304E14890BDB073FEE15399EB")){
- condition += "and DESCRIPTION ='035100' ";
- }else if(id.equals("38AA15A4AB314A708EE98733A9857023")){
- condition += "and DESCRIPTION ='030700' ";
- }else if(id.equals("39419D104634467CA1A641E4CC1D8A21")){
- condition += "and DESCRIPTION ='031200' ";
- }else if(id.equals("52548B9F88DB4BE98EDAED2A5F70371B")){
- condition += "and DESCRIPTION ='031600' ";
- }else if(id.equals("52CBA051D490487DA2D1F258EB8F595D")){
- condition += "and DESCRIPTION ='031800' ";
- }else if(id.equals("5A7BA8BD9D3D4C6E8A75B75F7C85FFA5")){
- condition += "and DESCRIPTION ='035300' ";
- }else if(id.equals("6D61CEB772AC4EA7B5CD805183C14806")){
- condition += "and DESCRIPTION ='030600' ";
- }else if(id.equals("785F409051A84412A75E8E44FE3F5C6E")){
- condition += "and DESCRIPTION ='031300' ";
- }else if(id.equals("A0FF45B5DD504A718F514172BA54C44B")){
- condition += "and DESCRIPTION ='030200' ";
- }else if(id.equals("A975127FE24B4937945545301503B59E")){
- condition += "and DESCRIPTION ='032000' ";
- }else if(id.equals("BC82691B2E194E80AA3F4D16D7CF08A9")){
- condition += "and DESCRIPTION ='031500' ";
- }else if(id.equals("C697FA6F2FC645EBA181F4278F4BE733")){
- condition += "and DESCRIPTION ='030900' ";
- }else if(id.equals("D01A4DE3FB504EF095F6AF9B541042FE")){
- condition += "and DESCRIPTION ='030500' ";
- }else if(id.equals("D4CD8F9F43DD40B593FC85C74403AC65")){
- condition += "and DESCRIPTION ='030400' ";
- }else if(id.equals("EE6E74BCE5D34A928E32E71226BF31ED")){
- condition += "and DESCRIPTION ='031900' ";
- }else if(id.equals("F0ADFEDC8D3C413F865148A3E0C138B9")){
- condition += "and DESCRIPTION ='031700' ";
- }else if(id.equals("FCACDE74635E41ECB91162ED5186BA60")){
- condition += "and DESCRIPTION ='031400' ";
- }else{
- condition += "and (OWNER_STATION in(select distinct base_org_id from sys_department START WITH DEPT_ID='"+id+"' CONNECT BY PRIOR DEPT_ID=PARENT_ID ) or OWNER_STATION='"+id+"')";
- }
- if(!customername.equals("")){
- // if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- // condition += " where name like '%"+customername+"%'";
- // }else{
- condition += " and name like '%"+customername+"%'";
- // }
- }
-
- if(!convalue.equals("")){
- // if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")&&customername.equals("")){
- // condition += " where "+convalue;
- // }else{
- condition += " and "+convalue;
- // }
- condition = condition.substring(0,condition.lastIndexOf("and"));
- }
-
-
- String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION;";
- log.info("sql======"+sql);
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- log.info("getCmpList.tempList.size===="+tempList.size());
- int totalPage = tempList.size();
- String result="{\"pager.pageNo\":"+firstPageNum+",\"pager.totalRows\":"+totalPage+",\"rows\":["+json.toString()+"]}";
-
- log.info("result===="+result);
- return result;
- }
- public String getCustomerInfoNumInit2(String id,String firstPageNum,String limit,String convalue,String customername) throws PersistenceException{
- try{
- log.info(convalue);
- List<String> list1 = new ArrayList<String>();
- List<String>tempList=getCmpList2(new ArrayList<String>(),firstPageNum,limit,id,convalue,customername);
- for(int i=0;i<tempList.size();i++){
- list1.add(tempList.get(i));
- }
- getPlanNum(list1, id);
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
-
- if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }
- String[] con = convalue.split("and");
- String cond = con[con.length-2];
- String[] con1 = cond.split("=");
- String cond1 = con1[1];
- log.info(cond1.replace(" ", ""));
-
- // String condition = " where OWNER_STATION IN (SELECT DISTINCT base_org_id FROM SYS_DEPARTMENT START WITH "+cond+" CONNECT BY PRIOR DEPT_ID=PARENT_ID)";
- String condition = " where IMPORT_LEVEL!='5' ";
-
- if(cond1.replace(" ", "").equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- condition += " and (OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') or owner_station not in (select a.owner_station from nwyj_service.mdm_customer a,sys_department b where a.owner_station=b.base_org_id)) ";
- }
- else if(cond1.replace(" ", "").equals("1E5D688F639E48EBA0AEC8B057F2C06D")){
- condition += "and DESCRIPTION ='035200' ";
- }else if(cond1.replace(" ", "").equals("2BF184BAA0CB4F6D821048FDE4612999")){
- condition += "and DESCRIPTION ='030800' ";
- }else if(cond1.replace(" ", "").equals("304866F304E14890BDB073FEE15399EB")){
- condition += "and DESCRIPTION ='035100' ";
- }else if(cond1.replace(" ", "").equals("38AA15A4AB314A708EE98733A9857023")){
- condition += "and DESCRIPTION ='030700' ";
- }else if(cond1.replace(" ", "").equals("39419D104634467CA1A641E4CC1D8A21")){
- condition += "and DESCRIPTION ='031200' ";
- }else if(cond1.replace(" ", "").equals("52548B9F88DB4BE98EDAED2A5F70371B")){
- condition += "and DESCRIPTION ='031600' ";
- }else if(cond1.replace(" ", "").equals("52CBA051D490487DA2D1F258EB8F595D")){
- condition += "and DESCRIPTION ='031800' ";
- }else if(cond1.replace(" ", "").equals("5A7BA8BD9D3D4C6E8A75B75F7C85FFA5")){
- condition += "and DESCRIPTION ='035300' ";
- }else if(cond1.replace(" ", "").equals("6D61CEB772AC4EA7B5CD805183C14806")){
- condition += "and DESCRIPTION ='030600' ";
- }else if(cond1.replace(" ", "").equals("785F409051A84412A75E8E44FE3F5C6E")){
- condition += "and DESCRIPTION ='031300' ";
- }else if(cond1.replace(" ", "").equals("A0FF45B5DD504A718F514172BA54C44B")){
- condition += "and DESCRIPTION ='030200' ";
- }else if(cond1.replace(" ", "").equals("A975127FE24B4937945545301503B59E")){
- condition += "and DESCRIPTION ='032000' ";
- }else if(cond1.replace(" ", "").equals("BC82691B2E194E80AA3F4D16D7CF08A9")){
- condition += "and DESCRIPTION ='031500' ";
- }else if(cond1.replace(" ", "").equals("C697FA6F2FC645EBA181F4278F4BE733")){
- condition += "and DESCRIPTION ='030900' ";
- }else if(cond1.replace(" ", "").equals("D01A4DE3FB504EF095F6AF9B541042FE")){
- condition += "and DESCRIPTION ='030500' ";
- }else if(cond1.replace(" ", "").equals("D4CD8F9F43DD40B593FC85C74403AC65")){
- condition += "and DESCRIPTION ='030400' ";
- }else if(cond1.replace(" ", "").equals("EE6E74BCE5D34A928E32E71226BF31ED")){
- condition += "and DESCRIPTION ='031900' ";
- }else if(cond1.replace(" ", "").equals("F0ADFEDC8D3C413F865148A3E0C138B9")){
- condition += "and DESCRIPTION ='031700' ";
- }else if(cond1.replace(" ", "").equals("FCACDE74635E41ECB91162ED5186BA60")){
- condition += "and DESCRIPTION ='031400' ";
- }
- else{
- condition += " and OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') ";
- }
-
- if(con.length-3>=0){
- convalue = convalue.substring(0,convalue.lastIndexOf("and"));
- convalue = convalue.substring(0,convalue.lastIndexOf("and"));
- condition += " and"+convalue;
- }
-
- String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION;";
- log.info("sql===*********************************************************************************************************************************=="+sql);
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- log.info("getCmpList.tempList.size===="+tempList.size());
- int totalPage = tempList.size();
- String result="{\"pager.pageNo\":"+firstPageNum+",\"pager.totalRows\":"+totalPage+",\"rows\":["+json.toString()+"]}";
-
- log.info("result===="+result);
- return result;
- }
-
- //获取客户ID(所有客户的)
- public List<String> getCmpList(List<String>list,String pagenum,String limit,String id,String convalue,String customername) {
- try{
- // String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION;";
- // List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- // log.info("getCmpList.tempList.size===="+tempList.size());
- // int totalPage = tempList.size()/Integer.parseInt(limit);
- int start = 0; int end = 0;
- if((Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)>=0){
- start=(Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)+1;
- end = Integer.parseInt(pagenum)*Integer.parseInt(limit);
- }
- String condition = " where IMPORT_LEVEL!='5' ";
- if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- condition += "";
- }else if(id.equals("1E5D688F639E48EBA0AEC8B057F2C06D")){
- condition += "and DESCRIPTION ='035200' ";
- }else if(id.equals("2BF184BAA0CB4F6D821048FDE4612999")){
- condition += "and DESCRIPTION ='030800' ";
- }else if(id.equals("304866F304E14890BDB073FEE15399EB")){
- condition += "and DESCRIPTION ='035100' ";
- }else if(id.equals("38AA15A4AB314A708EE98733A9857023")){
- condition += "and DESCRIPTION ='030700' ";
- }else if(id.equals("39419D104634467CA1A641E4CC1D8A21")){
- condition += "and DESCRIPTION ='031200' ";
- }else if(id.equals("52548B9F88DB4BE98EDAED2A5F70371B")){
- condition += "and DESCRIPTION ='031600' ";
- }else if(id.equals("52CBA051D490487DA2D1F258EB8F595D")){
- condition += "and DESCRIPTION ='031800' ";
- }else if(id.equals("5A7BA8BD9D3D4C6E8A75B75F7C85FFA5")){
- condition += "and DESCRIPTION ='035300' ";
- }else if(id.equals("6D61CEB772AC4EA7B5CD805183C14806")){
- condition += "and DESCRIPTION ='030600' ";
- }else if(id.equals("785F409051A84412A75E8E44FE3F5C6E")){
- condition += "and DESCRIPTION ='031300' ";
- }else if(id.equals("A0FF45B5DD504A718F514172BA54C44B")){
- condition += "and DESCRIPTION ='030200' ";
- }else if(id.equals("A975127FE24B4937945545301503B59E")){
- condition += "and DESCRIPTION ='032000' ";
- }else if(id.equals("BC82691B2E194E80AA3F4D16D7CF08A9")){
- condition += "and DESCRIPTION ='031500' ";
- }else if(id.equals("C697FA6F2FC645EBA181F4278F4BE733")){
- condition += "and DESCRIPTION ='030900' ";
- }else if(id.equals("D01A4DE3FB504EF095F6AF9B541042FE")){
- condition += "and DESCRIPTION ='030500' ";
- }else if(id.equals("D4CD8F9F43DD40B593FC85C74403AC65")){
- condition += "and DESCRIPTION ='030400' ";
- }else if(id.equals("EE6E74BCE5D34A928E32E71226BF31ED")){
- condition += "and DESCRIPTION ='031900' ";
- }else if(id.equals("F0ADFEDC8D3C413F865148A3E0C138B9")){
- condition += "and DESCRIPTION ='031700' ";
- }else if(id.equals("FCACDE74635E41ECB91162ED5186BA60")){
- condition += "and DESCRIPTION ='031400' ";
- }else{
- condition += "and (OWNER_STATION in(select distinct base_org_id from sys_department START WITH DEPT_ID='"+id+"' CONNECT BY PRIOR DEPT_ID=PARENT_ID ) or OWNER_STATION='"+id+"')";
- }
-
- if(!customername.equals("")){
- // if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- // condition += " where name like '%"+customername+"%'";
- // }else{
- condition += " and name like '%"+customername+"%'";
- // }
- }
-
- if(!convalue.equals("")){
- // if(id.equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")&&customername.equals("")){
- // condition += " where "+convalue;
- // }else{
- condition += " and "+convalue;
- // }
- condition = condition.substring(0,condition.lastIndexOf("and"));
- }
- String sql2 ="select MRID from (select a.MRID,rownum rn from (select MRID,DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION) a) where rn>= '"+start+"' and rn <= '"+end+"' ";
- //String sql2 ="select MRID from (select a.MRID,rownum rn from (select MRID,DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION) a) where rn>= '"+start+"' and rn <= '"+end+"' ";
- List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
- for(int i=0;i<tempList2.size();i++){
- list.add(tempList2.get(i)[0]);
- }
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- return list;
- }
-
- public List<String> getCmpList2(List<String>list,String pagenum,String limit,String id,String convalue,String customername) {
- try{
- // String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION;";
- // List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- // log.info("getCmpList.tempList.size===="+tempList.size());
- // int totalPage = tempList.size()/Integer.parseInt(limit);
- int start = 0; int end = 0;
- if((Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)>=0){
- start=(Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)+1;
- end = Integer.parseInt(pagenum)*Integer.parseInt(limit);
- }
-
-
- // String cond = convalue;
- // cond = cond.substring(0,cond.lastIndexOf(" and "));
-
- String[] con = convalue.split("and");
- String cond = con[con.length-2];
- String[] con1 = cond.split("=");
- String cond1 = con1[1];
- log.info(cond1);
-
- // String condition = " where OWNER_STATION IN (SELECT DISTINCT base_org_id FROM SYS_DEPARTMENT START WITH "+cond+" CONNECT BY PRIOR DEPT_ID=PARENT_ID)";
- String condition = " where IMPORT_LEVEL!='5' ";
-
- if(cond1.replace(" ", "").equals("8F6F2D6B24494CB6B1F1E0931E7AF87D")){
- condition += " and (OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') or owner_station not in (select a.owner_station from nwyj_service.mdm_customer a,sys_department b where a.owner_station=b.base_org_id)) ";
- }
- else if(cond1.replace(" ", "").equals("1E5D688F639E48EBA0AEC8B057F2C06D")){
- condition += "and DESCRIPTION ='035200' ";
- }else if(cond1.replace(" ", "").equals("2BF184BAA0CB4F6D821048FDE4612999")){
- condition += "and DESCRIPTION ='030800' ";
- }else if(cond1.replace(" ", "").equals("304866F304E14890BDB073FEE15399EB")){
- condition += "and DESCRIPTION ='035100' ";
- }else if(cond1.replace(" ", "").equals("38AA15A4AB314A708EE98733A9857023")){
- condition += "and DESCRIPTION ='030700' ";
- }else if(cond1.replace(" ", "").equals("39419D104634467CA1A641E4CC1D8A21")){
- condition += "and DESCRIPTION ='031200' ";
- }else if(cond1.replace(" ", "").equals("52548B9F88DB4BE98EDAED2A5F70371B")){
- condition += "and DESCRIPTION ='031600' ";
- }else if(cond1.replace(" ", "").equals("52CBA051D490487DA2D1F258EB8F595D")){
- condition += "and DESCRIPTION ='031800' ";
- }else if(cond1.replace(" ", "").equals("5A7BA8BD9D3D4C6E8A75B75F7C85FFA5")){
- condition += "and DESCRIPTION ='035300' ";
- }else if(cond1.replace(" ", "").equals("6D61CEB772AC4EA7B5CD805183C14806")){
- condition += "and DESCRIPTION ='030600' ";
- }else if(cond1.replace(" ", "").equals("785F409051A84412A75E8E44FE3F5C6E")){
- condition += "and DESCRIPTION ='031300' ";
- }else if(cond1.replace(" ", "").equals("A0FF45B5DD504A718F514172BA54C44B")){
- condition += "and DESCRIPTION ='030200' ";
- }else if(cond1.replace(" ", "").equals("A975127FE24B4937945545301503B59E")){
- condition += "and DESCRIPTION ='032000' ";
- }else if(cond1.replace(" ", "").equals("BC82691B2E194E80AA3F4D16D7CF08A9")){
- condition += "and DESCRIPTION ='031500' ";
- }else if(cond1.replace(" ", "").equals("C697FA6F2FC645EBA181F4278F4BE733")){
- condition += "and DESCRIPTION ='030900' ";
- }else if(cond1.replace(" ", "").equals("D01A4DE3FB504EF095F6AF9B541042FE")){
- condition += "and DESCRIPTION ='030500' ";
- }else if(cond1.replace(" ", "").equals("D4CD8F9F43DD40B593FC85C74403AC65")){
- condition += "and DESCRIPTION ='030400' ";
- }else if(cond1.replace(" ", "").equals("EE6E74BCE5D34A928E32E71226BF31ED")){
- condition += "and DESCRIPTION ='031900' ";
- }else if(cond1.replace(" ", "").equals("F0ADFEDC8D3C413F865148A3E0C138B9")){
- condition += "and DESCRIPTION ='031700' ";
- }else if(cond1.replace(" ", "").equals("FCACDE74635E41ECB91162ED5186BA60")){
- condition += "and DESCRIPTION ='031400' ";
- }
- else{
- condition += " and OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') ";
- }
-
- if(con.length-3>=0){
- convalue = convalue.substring(0,convalue.lastIndexOf("and"));
- convalue = convalue.substring(0,convalue.lastIndexOf("and"));
- condition += " and"+convalue;
- }
-
- String sql2 ="select MRID from (select a.MRID,rownum rn from (select MRID,DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION) a) where rn>= '"+start+"' and rn <= '"+end+"' ";
- //String sql2 ="select MRID from (select a.MRID,rownum rn from (select MRID,DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION) a) where rn>= '"+start+"' and rn <= '"+end+"' ";
- List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
- for(int i=0;i<tempList2.size();i++){
- list.add(tempList2.get(i)[0]);
- }
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- return list;
- }
-
- //获取每一行数据的统计数据
- public void getPlanNum(List<String>list,String id) throws PersistenceException{
- try{
- for(int i=0;i<list.size();i++){
- customerModel cn = new customerModel();
- String sql = "select "
- + "MRID,NAME,KIND,OWNER_STATION,IMPORT_LEVEL,VOLTAGE_CODE,AGREEMENT_CAPACITY,SECUIRITY_LOAD,IS_MEET_OF_SUPPLY,OWNED_SOURCE_CAPACITY,IS_MEET_OF_SELF_PROVIDE,DESCRIPTION"
- + " from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" where MRID='"+list.get(i)+"' order by DESCRIPTION ";
- List<String[]> numList1 = persistence.getSearchResult(99, sql.toString());
-
- String sql2 = "select POWERSUPPLY_LINE,SUPERIOR_SUBSTATION from \"NWYJ_SERVICE\".\"MDM_POWERSUPPLY\" where ORGANISATION_MRID='"+list.get(i)+"' ";
- List<String[]> numList2 = persistence.getSearchResult(99, sql2.toString());
-
- if(numList1.size()>0){
-
- cn.setFD_OBJECTID(numList1.get(0)[0]);
- cn.setCUSTOMER_NAME(numList1.get(0)[1].trim());
- cn.setCUSTOMER_KIND(getMapvaluecanstShow(numList1.get(0)[2],"BM_NWYJ_SERVICE_KIND"));
- cn.setOWNER_STATION(getCompIdShow(numList1.get(0)[3]));
- cn.setIMPORT_LEVEL(getImportLevel(numList1.get(0)[4]));
- //cn.setIMPORT_LEVEL(getMapvaluecanstShow(numList1.get(0)[4],"BM_NWYJ_SERVICE_IMPORT_LEVEL")); 这里转换了重要客户等级正式部署时放开这里,关闭上面那行代码
- cn.setVOLTAGE_CODE(getMapvaluecanstShow(numList1.get(0)[5],"BM_NWYJ_SERVICE_VOLTAGE"));
- cn.setAGREEMENT_CAPACITY(numList1.get(0)[6]);
- if("".equals(numList1.get(0)[7])||"null".equals(numList1.get(0)[7])||numList1.get(0)[7]==null){
- cn.setSECUIRITY_LOAD("");
- }else{
- cn.setSECUIRITY_LOAD(numList1.get(0)[7]);
- }
- if("0".equals(numList1.get(0)[8])){
- cn.setIS_MEET_OF_SUPPLY("否");
- }else if("1".equals(numList1.get(0)[8])){
- cn.setIS_MEET_OF_SUPPLY("是");
- }else{
- cn.setIS_MEET_OF_SUPPLY("");
- }
- if("".equals(numList1.get(0)[9])||"null".equals(numList1.get(0)[9])||numList1.get(0)[9]==null){
- cn.setOWNED_SOURCE_CAPACITY("");
- }else{
- cn.setOWNED_SOURCE_CAPACITY(numList1.get(0)[9]);
- }
-
- if("0".equals(numList1.get(0)[10])){
- cn.setIS_MEET_OF_SELF_PROVIDE("否");
- }else if("1".equals(numList1.get(0)[10])){
- cn.setIS_MEET_OF_SELF_PROVIDE("是");
- }else{
- cn.setIS_MEET_OF_SELF_PROVIDE("");
- }
- if("030600".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("佛山");
- }else if("032000".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("中山");
- }else if("031800".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("清远");
- }else if("030400".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("珠海");
- }else if("031700".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("阳江");
- }else if("030700".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("江门");
- }else if("030500".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("汕头");
- }else if("031900".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("东莞");
- }else if("031200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("肇庆");
- }else if("035100".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("潮州");
- }else if("035200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("揭阳");
- }else if("031400".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("梅州");
- }else if("031600".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("河源");
- }else if("035300".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("云浮");
- }else if("030200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("韶关");
- }else if("031500".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("汕尾");
- }else if("030900".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("茂名");
- }else if("030800".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("湛江");
- }else if("031300".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("惠州");
- }
-
-
- if(numList2.size()>0){
- cn.setGDXL1(numList2.get(0)[0]);
- cn.setSJBDZ1(numList2.get(0)[1]);
- }
- if(numList2.size()>1){
- cn.setGDXL2(numList2.get(1)[0]);
- cn.setSJBDZ2(numList2.get(1)[1]);
- }
- if(numList2.size()>2){
- cn.setGDXL3(numList2.get(2)[0]);
- cn.setSJBDZ3(numList2.get(2)[1]);
- }
- if(numList2.size()>3){
- cn.setGDXL4(numList2.get(3)[0]);
- cn.setSJBDZ4(numList2.get(3)[1]);
- }
- if(numList2.size()>4){
- cn.setGDXL5(numList2.get(4)[0]);
- cn.setSJBDZ5(numList2.get(4)[1]);
- }
- if(numList2.size()>5){
- cn.setGDXL6(numList2.get(5)[0]);
- cn.setSJBDZ6(numList2.get(5)[1]);
- }
- numList.add(cn);
- json.append("{ ");
- json.append(" \"FD_OBJECTID\":\"" + cn.getFD_OBJECTID() + "\",");
- json.append(" \"CUSTOMER_NAME\":\"" + cn.getCUSTOMER_NAME() + "\",");
- json.append(" \"CUSTOMER_KIND\":\"" + cn.getCUSTOMER_KIND() + "\",");
- json.append(" \"OWNER_STATION\":\"" + cn.getOWNER_STATION() + "\",");
- json.append(" \"IMPORT_LEVEL\":\"" + cn.getIMPORT_LEVEL() + "\",");
- json.append(" \"VOLTAGE_CODE\":\"" + cn.getVOLTAGE_CODE() + "\",");
- json.append(" \"AGREEMENT_CAPACITY\":\"" + cn.getAGREEMENT_CAPACITY() + "\",");
- json.append(" \"SECUIRITY_LOAD\":\"" + cn.getSECUIRITY_LOAD() + "\",");
- json.append(" \"IS_MEET_OF_SUPPLY\":\"" + cn.getIS_MEET_OF_SUPPLY() + "\",");
- json.append(" \"OWNED_SOURCE_CAPACITY\":\"" + cn.getOWNED_SOURCE_CAPACITY() + "\",");
- json.append(" \"DESCRIPTION\":\"" + cn.getDESCRIPTION() + "\",");
-
- if(numList2.size()>1 && numList2.size()<3){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\"");
- }else if(numList2.size()>2 && numList2.size()<4){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\"");
- }else if(numList2.size()>3 && numList2.size()<5){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\"");
- }else if(numList2.size()>4 && numList2.size()<6){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
- json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
- json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\"");
- }else if(numList2.size()>5){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
- json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
- json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\",");
- json.append(" \"GDXL6\":\"" + cn.getGDXL6() + "\",");
- json.append(" \"SJBDZ6\":\"" + cn.getSJBDZ6() + "\"");
- }else if(numList2.size()>0){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\"");
- }else{
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\"");
- }
- json.append("}, ");
- }
- }
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- }
-
- //转换重要客户等级,临时用一下
- public String getImportLevel(String value){
-
- /***
- * 现在库表里的规则是:1、2、3、4的等级,将来正式的数据等级规则为:
- *
- * **/
-
- if(!"".equals(value)&&value!=null){
- if("1".equals(value)){
- value="特级重要用户";
- }else if("2".equals(value)){
- value="一级重要用户";
- }else if("3".equals(value)){
- value="二级重要用户";
- }
- }
- return value;
-
- }
-
- //获取客户供电单位名称(所有客户的)
- public String getCompIdShow(String id) {
- String list = "";
- try{
- String sql ="select * from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
- // String sql2 ="select dept_name from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
- String sql2 ="select DEPT_PATH_NAME from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
- log.info(tempList2.size());
- if(tempList==null||tempList.size()==0){
- return "";
- }else{
- list = tempList2.get(0)[0].toString();
- return list;
- }
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- return "";
- }
- }
- //常量表电压
- public String getMapvaluecanstShow(String id,String type) {
- String list = "";
- try{
- String sql ="select * from BM_MAPVALUECANST where FD_CODE ='"+id+"' and FD_TYPE ='"+type+"' ";
- String sql2 ="select FD_DESCRIPTION from BM_MAPVALUECANST where FD_CODE ='"+id+"' and FD_TYPE ='"+type+"' ";
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
- log.info(tempList2.size());
- if(tempList==null||tempList.size()==0){
- return "";
- }else{
- list = tempList2.get(0)[0].toString();
- return list;
- }
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- return "";
- }
- }
-
-
- public String getCustomerId(String id){
- try {
- customerModel cn = new customerModel();
- String sql = "select "
- + "MRID,NAME,KIND,OWNER_STATION,IMPORT_LEVEL,VOLTAGE_CODE,AGREEMENT_CAPACITY,SECUIRITY_LOAD,IS_MEET_OF_SUPPLY,OWNED_SOURCE_CAPACITY,IS_MEET_OF_SELF_PROVIDE,DESCRIPTION"
- + " from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" where MRID='"+id+"' order by DESCRIPTION ";
- List<String[]> numList1 = persistence.getSearchResult(99, sql.toString());
-
- String sql2 = "select POWERSUPPLY_LINE,SUPERIOR_SUBSTATION from \"NWYJ_SERVICE\".\"MDM_POWERSUPPLY\" where ORGANISATION_MRID='"+id+"' ";
- List<String[]> numList2 = persistence.getSearchResult(99, sql2.toString());
-
- cn.setFD_OBJECTID(numList1.get(0)[0]);
- cn.setCUSTOMER_NAME(numList1.get(0)[1].trim());
- cn.setCUSTOMER_KIND(getMapvaluecanstShow(numList1.get(0)[2],"BM_NWYJ_SERVICE_KIND"));
- cn.setOWNER_STATION(getCompIdShow(numList1.get(0)[3]));
- cn.setIMPORT_LEVEL(getImportLevel(numList1.get(0)[4]));
- //cn.setIMPORT_LEVEL(getMapvaluecanstShow(numList1.get(0)[4],"BM_NWYJ_SERVICE_IMPORT_LEVEL")); 这里转换了重要客户等级正式部署时放开这里,关闭上面那行代码
- cn.setVOLTAGE_CODE(getMapvaluecanstShow(numList1.get(0)[5],"BM_NWYJ_SERVICE_VOLTAGE"));
- cn.setAGREEMENT_CAPACITY(numList1.get(0)[6]);
- if("".equals(numList1.get(0)[7])||"null".equals(numList1.get(0)[7])||numList1.get(0)[7]==null){
- cn.setSECUIRITY_LOAD("");
- }else{
- cn.setSECUIRITY_LOAD(numList1.get(0)[7]);
- }
- if("0".equals(numList1.get(0)[8])){
- cn.setIS_MEET_OF_SUPPLY("否");
- }else if("1".equals(numList1.get(0)[8])){
- cn.setIS_MEET_OF_SUPPLY("是");
- }else{
- cn.setIS_MEET_OF_SUPPLY("");
- }
- if("".equals(numList1.get(0)[9])||"null".equals(numList1.get(0)[9])||numList1.get(0)[9]==null){
- cn.setOWNED_SOURCE_CAPACITY("");
- }else{
- cn.setOWNED_SOURCE_CAPACITY(numList1.get(0)[9]);
- }
-
- if("0".equals(numList1.get(0)[10])){
- cn.setIS_MEET_OF_SELF_PROVIDE("否");
- }else if("1".equals(numList1.get(0)[10])){
- cn.setIS_MEET_OF_SELF_PROVIDE("是");
- }else{
- cn.setIS_MEET_OF_SELF_PROVIDE("");
- }
- if("030600".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("佛山");
- }else if("032000".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("中山");
- }else if("031800".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("清远");
- }else if("030400".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("珠海");
- }else if("031700".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("阳江");
- }else if("030700".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("江门");
- }else if("030500".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("汕头");
- }else if("031900".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("东莞");
- }else if("031200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("肇庆");
- }else if("035100".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("潮州");
- }else if("035200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("揭阳");
- }else if("031400".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("梅州");
- }else if("031600".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("河源");
- }else if("035300".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("云浮");
- }else if("030200".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("韶关");
- }else if("031500".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("汕尾");
- }else if("030900".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("茂名");
- }else if("030800".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("湛江");
- }else if("031300".equals(numList1.get(0)[11])){
- cn.setDESCRIPTION("惠州");
- }
-
-
- if(numList2.size()>0){
- cn.setGDXL1(numList2.get(0)[0]);
- cn.setSJBDZ1(numList2.get(0)[1]);
- }
- if(numList2.size()>1){
- cn.setGDXL2(numList2.get(1)[0]);
- cn.setSJBDZ2(numList2.get(1)[1]);
- }
- if(numList2.size()>2){
- cn.setGDXL3(numList2.get(2)[0]);
- cn.setSJBDZ3(numList2.get(2)[1]);
- }
- if(numList2.size()>3){
- cn.setGDXL4(numList2.get(3)[0]);
- cn.setSJBDZ4(numList2.get(3)[1]);
- }
- if(numList2.size()>4){
- cn.setGDXL5(numList2.get(4)[0]);
- cn.setSJBDZ5(numList2.get(4)[1]);
- }
- if(numList2.size()>5){
- cn.setGDXL6(numList2.get(5)[0]);
- cn.setSJBDZ6(numList2.get(5)[1]);
- }
- numList.add(cn);
- json.append("{ ");
- json.append(" \"FD_OBJECTID\":\"" + cn.getFD_OBJECTID() + "\",");
- json.append(" \"CUSTOMER_NAME\":\"" + cn.getCUSTOMER_NAME() + "\",");
- json.append(" \"CUSTOMER_KIND\":\"" + cn.getCUSTOMER_KIND() + "\",");
- json.append(" \"OWNER_STATION\":\"" + cn.getOWNER_STATION() + "\",");
- json.append(" \"IMPORT_LEVEL\":\"" + cn.getIMPORT_LEVEL() + "\",");
- json.append(" \"VOLTAGE_CODE\":\"" + cn.getVOLTAGE_CODE() + "\",");
- json.append(" \"AGREEMENT_CAPACITY\":\"" + cn.getAGREEMENT_CAPACITY() + "\",");
- json.append(" \"SECUIRITY_LOAD\":\"" + cn.getSECUIRITY_LOAD() + "\",");
- json.append(" \"IS_MEET_OF_SUPPLY\":\"" + cn.getIS_MEET_OF_SUPPLY() + "\",");
- json.append(" \"OWNED_SOURCE_CAPACITY\":\"" + cn.getOWNED_SOURCE_CAPACITY() + "\",");
- json.append(" \"DESCRIPTION\":\"" + cn.getDESCRIPTION() + "\",");
-
- if(numList2.size()>1 && numList2.size()<3){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\"");
- }else if(numList2.size()>2 && numList2.size()<4){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\"");
- }else if(numList2.size()>3 && numList2.size()<5){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\"");
- }else if(numList2.size()>4 && numList2.size()<6){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
- json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
- json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\"");
- }else if(numList2.size()>5){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
- json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
- json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
- json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
- json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
- json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
- json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
- json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
- json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\",");
- json.append(" \"GDXL6\":\"" + cn.getGDXL6() + "\",");
- json.append(" \"SJBDZ6\":\"" + cn.getSJBDZ6() + "\"");
- }else if(numList2.size()>0){
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
- json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
- json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\"");
- }else{
- json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\"");
- }
- json.append("} ");
-
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- String result=json.toString();
- log.info("result===="+result);
- return result;
- }
-
- /**
- * 导出用dao
- * @return
- * @throws PersistenceException
- */
- public String getCustomerInfoDao(String id) throws PersistenceException{
-
- try {
- List<String> list1 = new ArrayList<String>();
- String sql ="";
- if(id!=null && !"".equals(id)){
- sql ="select MRID from (select a.MRID,rownum rn from (select MRID from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" where MRID in ("+id+") ) a) ";
- }else{
- sql ="select MRID from (select a.MRID,rownum rn from (select MRID from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" ) a) ";
- }
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- for(int i=0;i<tempList.size();i++){
- list1.add(tempList.get(i)[0]);
- }
- getPlanNum(list1,null);
-
- }catch (Exception e){
- this.log.error(e.getMessage(), e);
- }
-
- if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }
-
-
- String result="["+json.toString()+"]";
-
- log.info("result===="+result);
- return result;
- }
-
- }
|