48c28401d82de344b573b6e21abf60ea51e82000.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. package com.sinosoft.am.customer.dao;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import org.apache.log4j.Logger;
  5. import com.persistence.service.PersistenceFactory;
  6. import com.persistence.service.SysPersistence;
  7. import com.persistence.service.exception.PersistenceException;
  8. import com.sinosoft.am.customer.vo.customerModel;
  9. import com.sysmodel.datamodel.xmlmodel.ModelFactory;
  10. import com.sysmodel.datamodel.xmlmodel.able.SysModel;
  11. public class customerModelDao2 {
  12. private Logger log = Logger.getLogger(this.getClass());
  13. SysModel sysmodel = ModelFactory.getSysmodel();
  14. SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
  15. StringBuffer json = new StringBuffer();
  16. private List<customerModel> numList = new ArrayList<customerModel>();
  17. /**
  18. * 获取横轴各单位名称2015-10-12
  19. * @param list
  20. * @return
  21. */
  22. /**
  23. * 根据传过来的ID进行检测,有子节点且子节点在明细表中有数据的,继续查询该节点下面的数据
  24. * @param id
  25. * @return
  26. * @throws PersistenceException
  27. */
  28. public String getCustomerInfoNumInit(String id,String firstPageNum,String limit,String convalue,String customername) throws PersistenceException{
  29. try{
  30. log.info("ID==="+id+",第一页===="+firstPageNum+",个数======"+limit);
  31. log.info(convalue);
  32. if(convalue.equals(" undefined")){
  33. convalue = "";
  34. }
  35. List<String> list1 = new ArrayList<String>();
  36. List<String>tempList=getCmpList(new ArrayList<String>(),firstPageNum,limit,id,convalue,customername);
  37. for(int i=0;i<tempList.size();i++){
  38. list1.add(tempList.get(i));
  39. }
  40. getPlanNum(list1, id);
  41. }catch(Exception e){
  42. this.log.error(e.getMessage(), e);
  43. }
  44. if (json.lastIndexOf(",") > -1) {
  45. json.deleteCharAt(json.lastIndexOf(","));
  46. }
  47. String condition = " where IMPORT_LEVEL='5' ";
  48. if(id.equals("C984DC9C294A486096C25FAA78C99AED")){
  49. condition += "";
  50. }else if(id.equals("91D3DBEBCA1F4F548CC69EC28591E8B8")){
  51. condition += "and DESCRIPTION ='060100' ";
  52. }else if(id.equals("7FB509D3758A4CAA9C122170633ECAA9")){
  53. condition += "and DESCRIPTION ='060200' ";
  54. }else if(id.equals("89D537D64A5546F5A9C309735906754B")){
  55. condition += "and DESCRIPTION ='060300' ";
  56. }else if(id.equals("E185B38AEE854266A3B1F0B2C0B66860")){
  57. condition += "and DESCRIPTION ='060400' ";
  58. }else if(id.equals("C2788228E8694EE7900D0155504C69FD")){
  59. condition += "and DESCRIPTION ='060500' ";
  60. }else if(id.equals("B3F0389D19F1454EAF5422CDF7A630E8")){
  61. condition += "and DESCRIPTION ='060600' ";
  62. }else if(id.equals("FF821AE3A15D4A9AAD597A09FE64106F")){
  63. condition += "and DESCRIPTION ='060700' ";
  64. }else if(id.equals("4193AC8E3124481487AEE37E6A828ED8")){
  65. condition += "and DESCRIPTION ='060800' ";
  66. }else if(id.equals("524EA1B0FA4C41B78A503885DFCAB278")){
  67. condition += "and DESCRIPTION ='060900' ";
  68. }else if(id.equals("97c9b774032b4fd88c331fc10c094761")){
  69. condition += "and DESCRIPTION ='061000' ";
  70. }else{
  71. 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+"')";
  72. }
  73. if(!customername.equals("")){
  74. // if(id.equals("C984DC9C294A486096C25FAA78C99AED")){
  75. // condition += " where name like '%"+customername+"%'";
  76. // }else{
  77. condition += " and name like '%"+customername+"%'";
  78. // }
  79. }
  80. if(!convalue.equals("")){
  81. // if(id.equals("C984DC9C294A486096C25FAA78C99AED")&&customername.equals("")){
  82. // condition += " where "+convalue;
  83. // }else{
  84. condition += " and "+convalue;
  85. // }
  86. condition = condition.substring(0,condition.lastIndexOf("and"));
  87. }
  88. String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION;";
  89. log.info("sql======"+sql);
  90. List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  91. log.info("getCmpList.tempList.size===="+tempList.size());
  92. int totalPage = tempList.size();
  93. String result="{\"pager.pageNo\":"+firstPageNum+",\"pager.totalRows\":"+totalPage+",\"rows\":["+json.toString()+"]}";
  94. log.info("result===="+result);
  95. return result;
  96. }
  97. public String getCustomerInfoNumInit2(String id,String firstPageNum,String limit,String convalue,String customername) throws PersistenceException{
  98. try{
  99. log.info(convalue);
  100. List<String> list1 = new ArrayList<String>();
  101. List<String>tempList=getCmpList2(new ArrayList<String>(),firstPageNum,limit,id,convalue,customername);
  102. for(int i=0;i<tempList.size();i++){
  103. list1.add(tempList.get(i));
  104. }
  105. getPlanNum(list1, id);
  106. }catch(Exception e){
  107. this.log.error(e.getMessage(), e);
  108. }
  109. if (json.lastIndexOf(",") > -1) {
  110. json.deleteCharAt(json.lastIndexOf(","));
  111. }
  112. String[] con = convalue.split("and");
  113. String cond = con[con.length-2];
  114. String[] con1 = cond.split("=");
  115. String cond1 = con1[1];
  116. log.info(cond1.replace(" ", ""));
  117. // String condition = " where OWNER_STATION IN (SELECT DISTINCT base_org_id FROM SYS_DEPARTMENT START WITH "+cond+" CONNECT BY PRIOR DEPT_ID=PARENT_ID)";
  118. String condition = " where IMPORT_LEVEL='5' ";
  119. if(cond1.replace(" ", "").equals("C984DC9C294A486096C25FAA78C99AED")){
  120. 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)) ";
  121. }
  122. else if(cond1.replace(" ", "").equals("91D3DBEBCA1F4F548CC69EC28591E8B8")){
  123. condition += "and DESCRIPTION ='060100' ";
  124. }else if(cond1.replace(" ", "").equals("7FB509D3758A4CAA9C122170633ECAA9")){
  125. condition += "and DESCRIPTION ='060200' ";
  126. }else if(cond1.replace(" ", "").equals("89D537D64A5546F5A9C309735906754B")){
  127. condition += "and DESCRIPTION ='060300' ";
  128. }else if(cond1.replace(" ", "").equals("E185B38AEE854266A3B1F0B2C0B66860")){
  129. condition += "and DESCRIPTION ='060400' ";
  130. }else if(cond1.replace(" ", "").equals("C2788228E8694EE7900D0155504C69FD")){
  131. condition += "and DESCRIPTION ='060500' ";
  132. }else if(cond1.replace(" ", "").equals("B3F0389D19F1454EAF5422CDF7A630E8")){
  133. condition += "and DESCRIPTION ='060600' ";
  134. }else if(cond1.replace(" ", "").equals("FF821AE3A15D4A9AAD597A09FE64106F")){
  135. condition += "and DESCRIPTION ='060700' ";
  136. }else if(cond1.replace(" ", "").equals("4193AC8E3124481487AEE37E6A828ED8")){
  137. condition += "and DESCRIPTION ='060800' ";
  138. }else if(cond1.replace(" ", "").equals("524EA1B0FA4C41B78A503885DFCAB278")){
  139. condition += "and DESCRIPTION ='060900' ";
  140. }else if(cond1.replace(" ", "").equals("97c9b774032b4fd88c331fc10c094761")){
  141. condition += "and DESCRIPTION ='061000' ";
  142. }
  143. else{
  144. condition += " and OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') ";
  145. }
  146. if(con.length-3>=0){
  147. convalue = convalue.substring(0,convalue.lastIndexOf("and"));
  148. convalue = convalue.substring(0,convalue.lastIndexOf("and"));
  149. condition += " and"+convalue;
  150. }
  151. String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" "+condition+" order by DESCRIPTION;";
  152. log.info("sql===*********************************************************************************************************************************=="+sql);
  153. List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  154. log.info("getCmpList.tempList.size===="+tempList.size());
  155. int totalPage = tempList.size();
  156. String result="{\"pager.pageNo\":"+firstPageNum+",\"pager.totalRows\":"+totalPage+",\"rows\":["+json.toString()+"]}";
  157. log.info("result===="+result);
  158. return result;
  159. }
  160. //获取客户ID(所有客户的)
  161. public List<String> getCmpList(List<String>list,String pagenum,String limit,String id,String convalue,String customername) {
  162. try{
  163. // String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION;";
  164. // List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  165. // log.info("getCmpList.tempList.size===="+tempList.size());
  166. // int totalPage = tempList.size()/Integer.parseInt(limit);
  167. int start = 0; int end = 0;
  168. if((Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)>=0){
  169. start=(Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)+1;
  170. end = Integer.parseInt(pagenum)*Integer.parseInt(limit);
  171. }
  172. String condition = " where IMPORT_LEVEL='5' ";
  173. if(id.equals("C984DC9C294A486096C25FAA78C99AED")){
  174. condition += "";
  175. }else if(id.equals("91D3DBEBCA1F4F548CC69EC28591E8B8")){
  176. condition += "and DESCRIPTION ='060100' ";
  177. }else if(id.equals("7FB509D3758A4CAA9C122170633ECAA9")){
  178. condition += "and DESCRIPTION ='060200' ";
  179. }else if(id.equals("89D537D64A5546F5A9C309735906754B")){
  180. condition += "and DESCRIPTION ='060300' ";
  181. }else if(id.equals("E185B38AEE854266A3B1F0B2C0B66860")){
  182. condition += "and DESCRIPTION ='060400' ";
  183. }else if(id.equals("C2788228E8694EE7900D0155504C69FD")){
  184. condition += "and DESCRIPTION ='060500' ";
  185. }else if(id.equals("B3F0389D19F1454EAF5422CDF7A630E8")){
  186. condition += "and DESCRIPTION ='060600' ";
  187. }else if(id.equals("FF821AE3A15D4A9AAD597A09FE64106F")){
  188. condition += "and DESCRIPTION ='060700' ";
  189. }else if(id.equals("4193AC8E3124481487AEE37E6A828ED8")){
  190. condition += "and DESCRIPTION ='060800' ";
  191. }else if(id.equals("524EA1B0FA4C41B78A503885DFCAB278")){
  192. condition += "and DESCRIPTION ='060900' ";
  193. }else if(id.equals("97c9b774032b4fd88c331fc10c094761")){
  194. condition += "and DESCRIPTION ='061000' ";
  195. }else{
  196. 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+"')";
  197. }
  198. if(!customername.equals("")){
  199. // if(id.equals("C984DC9C294A486096C25FAA78C99AED")){
  200. // condition += " where name like '%"+customername+"%'";
  201. // }else{
  202. condition += " and name like '%"+customername+"%'";
  203. // }
  204. }
  205. if(!convalue.equals("")){
  206. // if(id.equals("C984DC9C294A486096C25FAA78C99AED")&&customername.equals("")){
  207. // condition += " where "+convalue;
  208. // }else{
  209. condition += " and "+convalue;
  210. // }
  211. condition = condition.substring(0,condition.lastIndexOf("and"));
  212. }
  213. 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+"' ";
  214. //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+"' ";
  215. List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
  216. for(int i=0;i<tempList2.size();i++){
  217. list.add(tempList2.get(i)[0]);
  218. }
  219. }catch(Exception e){
  220. this.log.error(e.getMessage(), e);
  221. }
  222. return list;
  223. }
  224. public List<String> getCmpList2(List<String>list,String pagenum,String limit,String id,String convalue,String customername) {
  225. try{
  226. // String sql="select distinct(MRID),DESCRIPTION from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" order by DESCRIPTION;";
  227. // List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  228. // log.info("getCmpList.tempList.size===="+tempList.size());
  229. // int totalPage = tempList.size()/Integer.parseInt(limit);
  230. int start = 0; int end = 0;
  231. if((Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)>=0){
  232. start=(Integer.parseInt(pagenum)-1)*Integer.parseInt(limit)+1;
  233. end = Integer.parseInt(pagenum)*Integer.parseInt(limit);
  234. }
  235. // String cond = convalue;
  236. // cond = cond.substring(0,cond.lastIndexOf(" and "));
  237. String[] con = convalue.split("and");
  238. String cond = con[con.length-2];
  239. String[] con1 = cond.split("=");
  240. String cond1 = con1[1];
  241. log.info(cond1);
  242. // String condition = " where OWNER_STATION IN (SELECT DISTINCT base_org_id FROM SYS_DEPARTMENT START WITH "+cond+" CONNECT BY PRIOR DEPT_ID=PARENT_ID)";
  243. String condition = " where IMPORT_LEVEL='5' ";
  244. if(cond1.replace(" ", "").equals("C984DC9C294A486096C25FAA78C99AED")){
  245. 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)) ";
  246. }
  247. else if(cond1.replace(" ", "").equals("91D3DBEBCA1F4F548CC69EC28591E8B8")){
  248. condition += "and DESCRIPTION ='060100' ";
  249. }else if(cond1.replace(" ", "").equals("7FB509D3758A4CAA9C122170633ECAA9")){
  250. condition += "and DESCRIPTION ='060200' ";
  251. }else if(cond1.replace(" ", "").equals("89D537D64A5546F5A9C309735906754B")){
  252. condition += "and DESCRIPTION ='060300' ";
  253. }else if(cond1.replace(" ", "").equals("E185B38AEE854266A3B1F0B2C0B66860")){
  254. condition += "and DESCRIPTION ='060400' ";
  255. }else if(cond1.replace(" ", "").equals("C2788228E8694EE7900D0155504C69FD")){
  256. condition += "and DESCRIPTION ='060500' ";
  257. }else if(cond1.replace(" ", "").equals("B3F0389D19F1454EAF5422CDF7A630E8")){
  258. condition += "and DESCRIPTION ='060600' ";
  259. }else if(cond1.replace(" ", "").equals("FF821AE3A15D4A9AAD597A09FE64106F")){
  260. condition += "and DESCRIPTION ='060700' ";
  261. }else if(cond1.replace(" ", "").equals("4193AC8E3124481487AEE37E6A828ED8")){
  262. condition += "and DESCRIPTION ='060800' ";
  263. }else if(cond1.replace(" ", "").equals("524EA1B0FA4C41B78A503885DFCAB278")){
  264. condition += "and DESCRIPTION ='060900' ";
  265. }else if(cond1.replace(" ", "").equals("97c9b774032b4fd88c331fc10c094761")){
  266. condition += "and DESCRIPTION ='061000' ";
  267. }
  268. else{
  269. condition += " and OWNER_STATION IN (select base_org_id from sys_department where dept_path like'%"+cond1.replace(" ", "")+"%') ";
  270. }
  271. if(con.length-3>=0){
  272. convalue = convalue.substring(0,convalue.lastIndexOf("and"));
  273. convalue = convalue.substring(0,convalue.lastIndexOf("and"));
  274. condition += " and"+convalue;
  275. }
  276. 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+"' ";
  277. //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+"' ";
  278. List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
  279. for(int i=0;i<tempList2.size();i++){
  280. list.add(tempList2.get(i)[0]);
  281. }
  282. }catch(Exception e){
  283. this.log.error(e.getMessage(), e);
  284. }
  285. return list;
  286. }
  287. //获取每一行数据的统计数据
  288. public void getPlanNum(List<String>list,String id) throws PersistenceException{
  289. try{
  290. for(int i=0;i<list.size();i++){
  291. customerModel cn = new customerModel();
  292. String sql = "select "
  293. + "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"
  294. + " from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" where MRID='"+list.get(i)+"' order by DESCRIPTION ";
  295. List<String[]> numList1 = persistence.getSearchResult(99, sql.toString());
  296. String sql2 = "select POWERSUPPLY_LINE,SUPERIOR_SUBSTATION from \"NWYJ_SERVICE\".\"MDM_POWERSUPPLY\" where ORGANISATION_MRID='"+list.get(i)+"' ";
  297. List<String[]> numList2 = persistence.getSearchResult(99, sql2.toString());
  298. if(numList1.size()>0){
  299. cn.setFD_OBJECTID(numList1.get(0)[0]);
  300. cn.setCUSTOMER_NAME(numList1.get(0)[1]);
  301. cn.setCUSTOMER_KIND(getMapvaluecanstShow(numList1.get(0)[2],"BM_NWYJ_SERVICE_KIND"));
  302. cn.setOWNER_STATION(getCompIdShow(numList1.get(0)[3]));
  303. cn.setIMPORT_LEVEL(getImportLevel(numList1.get(0)[4]));
  304. //cn.setIMPORT_LEVEL(getMapvaluecanstShow(numList1.get(0)[4],"BM_NWYJ_SERVICE_IMPORT_LEVEL")); 这里转换了重要客户等级正式部署时放开这里,关闭上面那行代码
  305. cn.setVOLTAGE_CODE(getMapvaluecanstShow(numList1.get(0)[5],"BM_NWYJ_SERVICE_VOLTAGE"));
  306. cn.setAGREEMENT_CAPACITY(numList1.get(0)[6]);
  307. if("".equals(numList1.get(0)[7])||"null".equals(numList1.get(0)[7])||numList1.get(0)[7]==null){
  308. cn.setSECUIRITY_LOAD("");
  309. }else{
  310. cn.setSECUIRITY_LOAD(numList1.get(0)[7]);
  311. }
  312. if("0".equals(numList1.get(0)[8])){
  313. cn.setIS_MEET_OF_SUPPLY("否");
  314. }else if("1".equals(numList1.get(0)[8])){
  315. cn.setIS_MEET_OF_SUPPLY("是");
  316. }else{
  317. cn.setIS_MEET_OF_SUPPLY("");
  318. }
  319. if("".equals(numList1.get(0)[9])||"null".equals(numList1.get(0)[9])||numList1.get(0)[9]==null){
  320. cn.setOWNED_SOURCE_CAPACITY("");
  321. }else{
  322. cn.setOWNED_SOURCE_CAPACITY(numList1.get(0)[9]);
  323. }
  324. if("0".equals(numList1.get(0)[10])){
  325. cn.setIS_MEET_OF_SELF_PROVIDE("否");
  326. }else if("1".equals(numList1.get(0)[10])){
  327. cn.setIS_MEET_OF_SELF_PROVIDE("是");
  328. }else{
  329. cn.setIS_MEET_OF_SELF_PROVIDE("");
  330. }
  331. if("030600".equals(numList1.get(0)[11])){
  332. cn.setDESCRIPTION("佛山");
  333. }else if("032000".equals(numList1.get(0)[11])){
  334. cn.setDESCRIPTION("中山");
  335. }else if("031800".equals(numList1.get(0)[11])){
  336. cn.setDESCRIPTION("清远");
  337. }else if("030400".equals(numList1.get(0)[11])){
  338. cn.setDESCRIPTION("珠海");
  339. }else if("031700".equals(numList1.get(0)[11])){
  340. cn.setDESCRIPTION("阳江");
  341. }else if("030700".equals(numList1.get(0)[11])){
  342. cn.setDESCRIPTION("江门");
  343. }else if("030500".equals(numList1.get(0)[11])){
  344. cn.setDESCRIPTION("汕头");
  345. }else if("031900".equals(numList1.get(0)[11])){
  346. cn.setDESCRIPTION("东莞");
  347. }else if("031200".equals(numList1.get(0)[11])){
  348. cn.setDESCRIPTION("肇庆");
  349. }else if("035100".equals(numList1.get(0)[11])){
  350. cn.setDESCRIPTION("潮州");
  351. }else if("035200".equals(numList1.get(0)[11])){
  352. cn.setDESCRIPTION("揭阳");
  353. }else if("031400".equals(numList1.get(0)[11])){
  354. cn.setDESCRIPTION("梅州");
  355. }else if("031600".equals(numList1.get(0)[11])){
  356. cn.setDESCRIPTION("河源");
  357. }else if("035300".equals(numList1.get(0)[11])){
  358. cn.setDESCRIPTION("云浮");
  359. }else if("030200".equals(numList1.get(0)[11])){
  360. cn.setDESCRIPTION("韶关");
  361. }else if("031500".equals(numList1.get(0)[11])){
  362. cn.setDESCRIPTION("汕尾");
  363. }else if("030900".equals(numList1.get(0)[11])){
  364. cn.setDESCRIPTION("茂名");
  365. }else if("030800".equals(numList1.get(0)[11])){
  366. cn.setDESCRIPTION("湛江");
  367. }else if("031300".equals(numList1.get(0)[11])){
  368. cn.setDESCRIPTION("惠州");
  369. }
  370. if(numList2.size()>0){
  371. cn.setGDXL1(numList2.get(0)[0]);
  372. cn.setSJBDZ1(numList2.get(0)[1]);
  373. }
  374. if(numList2.size()>1){
  375. cn.setGDXL2(numList2.get(1)[0]);
  376. cn.setSJBDZ2(numList2.get(1)[1]);
  377. }
  378. if(numList2.size()>2){
  379. cn.setGDXL3(numList2.get(2)[0]);
  380. cn.setSJBDZ3(numList2.get(2)[1]);
  381. }
  382. if(numList2.size()>3){
  383. cn.setGDXL4(numList2.get(3)[0]);
  384. cn.setSJBDZ4(numList2.get(3)[1]);
  385. }
  386. if(numList2.size()>4){
  387. cn.setGDXL5(numList2.get(4)[0]);
  388. cn.setSJBDZ5(numList2.get(4)[1]);
  389. }
  390. if(numList2.size()>5){
  391. cn.setGDXL6(numList2.get(5)[0]);
  392. cn.setSJBDZ6(numList2.get(5)[1]);
  393. }
  394. numList.add(cn);
  395. json.append("{ ");
  396. json.append(" \"FD_OBJECTID\":\"" + cn.getFD_OBJECTID() + "\",");
  397. json.append(" \"CUSTOMER_NAME\":\"" + cn.getCUSTOMER_NAME() + "\",");
  398. json.append(" \"CUSTOMER_KIND\":\"" + cn.getCUSTOMER_KIND() + "\",");
  399. json.append(" \"OWNER_STATION\":\"" + cn.getOWNER_STATION() + "\",");
  400. json.append(" \"IMPORT_LEVEL\":\"" + cn.getIMPORT_LEVEL() + "\",");
  401. json.append(" \"VOLTAGE_CODE\":\"" + cn.getVOLTAGE_CODE() + "\",");
  402. json.append(" \"AGREEMENT_CAPACITY\":\"" + cn.getAGREEMENT_CAPACITY() + "\",");
  403. json.append(" \"SECUIRITY_LOAD\":\"" + cn.getSECUIRITY_LOAD() + "\",");
  404. json.append(" \"IS_MEET_OF_SUPPLY\":\"" + cn.getIS_MEET_OF_SUPPLY() + "\",");
  405. json.append(" \"OWNED_SOURCE_CAPACITY\":\"" + cn.getOWNED_SOURCE_CAPACITY() + "\",");
  406. // json.append(" \"DESCRIPTION\":\"" + cn.getDESCRIPTION() + "\",");
  407. if(numList2.size()>1 && numList2.size()<3){
  408. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  409. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  410. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  411. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  412. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\"");
  413. }else if(numList2.size()>2 && numList2.size()<4){
  414. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  415. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  416. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  417. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  418. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  419. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  420. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\"");
  421. }else if(numList2.size()>3 && numList2.size()<5){
  422. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  423. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  424. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  425. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  426. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  427. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  428. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  429. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  430. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\"");
  431. }else if(numList2.size()>4 && numList2.size()<6){
  432. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  433. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  434. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  435. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  436. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  437. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  438. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  439. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  440. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
  441. json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
  442. json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\"");
  443. }else if(numList2.size()>5){
  444. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  445. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  446. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  447. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  448. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  449. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  450. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  451. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  452. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
  453. json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
  454. json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\",");
  455. json.append(" \"GDXL6\":\"" + cn.getGDXL6() + "\",");
  456. json.append(" \"SJBDZ6\":\"" + cn.getSJBDZ6() + "\"");
  457. }else if(numList2.size()>0){
  458. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  459. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  460. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\"");
  461. }else{
  462. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\"");
  463. }
  464. json.append("}, ");
  465. }
  466. }
  467. }catch(Exception e){
  468. this.log.error(e.getMessage(), e);
  469. }
  470. }
  471. //转换重要客户等级,临时用一下
  472. public String getImportLevel(String value){
  473. /***
  474. * 现在库表里的规则是:1、2、3、4的等级,将来正式的数据等级规则为:
  475. *
  476. * **/
  477. if(!"".equals(value)&&value!=null){
  478. if("1".equals(value)){
  479. value="特级重要用户";
  480. }else if("2".equals(value)){
  481. value="一级重要用户";
  482. }else if("3".equals(value)){
  483. value="二级重要用户";
  484. }
  485. }
  486. return value;
  487. }
  488. //获取客户供电单位名称(所有客户的)
  489. public String getCompIdShow(String id) {
  490. String list = "";
  491. try{
  492. String sql ="select * from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
  493. // String sql2 ="select dept_name from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
  494. String sql2 ="select DEPT_PATH_NAME from SYS_DEPARTMENT where base_org_id ='"+id+"' ";
  495. List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  496. List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
  497. log.info(tempList2.size());
  498. if(tempList==null||tempList.size()==0){
  499. return "";
  500. }else{
  501. list = tempList2.get(0)[0].toString();
  502. return list;
  503. }
  504. }catch(Exception e){
  505. this.log.error(e.getMessage(), e);
  506. return "";
  507. }
  508. }
  509. //常量表电压
  510. public String getMapvaluecanstShow(String id,String type) {
  511. String list = "";
  512. try{
  513. String sql ="select * from BM_MAPVALUECANST where FD_CODE ='"+id+"' and FD_TYPE ='"+type+"' ";
  514. String sql2 ="select FD_DESCRIPTION from BM_MAPVALUECANST where FD_CODE ='"+id+"' and FD_TYPE ='"+type+"' ";
  515. List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  516. List<String[]>tempList2= persistence.getSearchResult(99, sql2.toString());
  517. log.info(tempList2.size());
  518. if(tempList==null||tempList.size()==0){
  519. return "";
  520. }else{
  521. list = tempList2.get(0)[0].toString();
  522. return list;
  523. }
  524. }catch(Exception e){
  525. this.log.error(e.getMessage(), e);
  526. return "";
  527. }
  528. }
  529. public String getCustomerId(String id){
  530. try {
  531. customerModel cn = new customerModel();
  532. String sql = "select "
  533. + "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"
  534. + " from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" where MRID='"+id+"' order by DESCRIPTION ";
  535. List<String[]> numList1 = persistence.getSearchResult(99, sql.toString());
  536. String sql2 = "select POWERSUPPLY_LINE,SUPERIOR_SUBSTATION from \"NWYJ_SERVICE\".\"MDM_POWERSUPPLY\" where ORGANISATION_MRID='"+id+"' ";
  537. List<String[]> numList2 = persistence.getSearchResult(99, sql2.toString());
  538. cn.setFD_OBJECTID(numList1.get(0)[0]);
  539. cn.setCUSTOMER_NAME(numList1.get(0)[1]);
  540. cn.setCUSTOMER_KIND(getMapvaluecanstShow(numList1.get(0)[2],"BM_NWYJ_SERVICE_KIND"));
  541. cn.setOWNER_STATION(getCompIdShow(numList1.get(0)[3]));
  542. cn.setIMPORT_LEVEL(getImportLevel(numList1.get(0)[4]));
  543. //cn.setIMPORT_LEVEL(getMapvaluecanstShow(numList1.get(0)[4],"BM_NWYJ_SERVICE_IMPORT_LEVEL")); 这里转换了重要客户等级正式部署时放开这里,关闭上面那行代码
  544. cn.setVOLTAGE_CODE(getMapvaluecanstShow(numList1.get(0)[5],"BM_NWYJ_SERVICE_VOLTAGE"));
  545. cn.setAGREEMENT_CAPACITY(numList1.get(0)[6]);
  546. if("".equals(numList1.get(0)[7])||"null".equals(numList1.get(0)[7])||numList1.get(0)[7]==null){
  547. cn.setSECUIRITY_LOAD("");
  548. }else{
  549. cn.setSECUIRITY_LOAD(numList1.get(0)[7]);
  550. }
  551. if("0".equals(numList1.get(0)[8])){
  552. cn.setIS_MEET_OF_SUPPLY("否");
  553. }else if("1".equals(numList1.get(0)[8])){
  554. cn.setIS_MEET_OF_SUPPLY("是");
  555. }else{
  556. cn.setIS_MEET_OF_SUPPLY("");
  557. }
  558. if("".equals(numList1.get(0)[9])||"null".equals(numList1.get(0)[9])||numList1.get(0)[9]==null){
  559. cn.setOWNED_SOURCE_CAPACITY("");
  560. }else{
  561. cn.setOWNED_SOURCE_CAPACITY(numList1.get(0)[9]);
  562. }
  563. if("0".equals(numList1.get(0)[10])){
  564. cn.setIS_MEET_OF_SELF_PROVIDE("否");
  565. }else if("1".equals(numList1.get(0)[10])){
  566. cn.setIS_MEET_OF_SELF_PROVIDE("是");
  567. }else{
  568. cn.setIS_MEET_OF_SELF_PROVIDE("");
  569. }
  570. if("030600".equals(numList1.get(0)[11])){
  571. cn.setDESCRIPTION("佛山");
  572. }else if("032000".equals(numList1.get(0)[11])){
  573. cn.setDESCRIPTION("中山");
  574. }else if("031800".equals(numList1.get(0)[11])){
  575. cn.setDESCRIPTION("清远");
  576. }else if("030400".equals(numList1.get(0)[11])){
  577. cn.setDESCRIPTION("珠海");
  578. }else if("031700".equals(numList1.get(0)[11])){
  579. cn.setDESCRIPTION("阳江");
  580. }else if("030700".equals(numList1.get(0)[11])){
  581. cn.setDESCRIPTION("江门");
  582. }else if("030500".equals(numList1.get(0)[11])){
  583. cn.setDESCRIPTION("汕头");
  584. }else if("031900".equals(numList1.get(0)[11])){
  585. cn.setDESCRIPTION("东莞");
  586. }else if("031200".equals(numList1.get(0)[11])){
  587. cn.setDESCRIPTION("肇庆");
  588. }else if("035100".equals(numList1.get(0)[11])){
  589. cn.setDESCRIPTION("潮州");
  590. }else if("035200".equals(numList1.get(0)[11])){
  591. cn.setDESCRIPTION("揭阳");
  592. }else if("031400".equals(numList1.get(0)[11])){
  593. cn.setDESCRIPTION("梅州");
  594. }else if("031600".equals(numList1.get(0)[11])){
  595. cn.setDESCRIPTION("河源");
  596. }else if("035300".equals(numList1.get(0)[11])){
  597. cn.setDESCRIPTION("云浮");
  598. }else if("030200".equals(numList1.get(0)[11])){
  599. cn.setDESCRIPTION("韶关");
  600. }else if("031500".equals(numList1.get(0)[11])){
  601. cn.setDESCRIPTION("汕尾");
  602. }else if("030900".equals(numList1.get(0)[11])){
  603. cn.setDESCRIPTION("茂名");
  604. }else if("030800".equals(numList1.get(0)[11])){
  605. cn.setDESCRIPTION("湛江");
  606. }else if("031300".equals(numList1.get(0)[11])){
  607. cn.setDESCRIPTION("惠州");
  608. }
  609. if(numList2.size()>0){
  610. cn.setGDXL1(numList2.get(0)[0]);
  611. cn.setSJBDZ1(numList2.get(0)[1]);
  612. }
  613. if(numList2.size()>1){
  614. cn.setGDXL2(numList2.get(1)[0]);
  615. cn.setSJBDZ2(numList2.get(1)[1]);
  616. }
  617. if(numList2.size()>2){
  618. cn.setGDXL3(numList2.get(2)[0]);
  619. cn.setSJBDZ3(numList2.get(2)[1]);
  620. }
  621. if(numList2.size()>3){
  622. cn.setGDXL4(numList2.get(3)[0]);
  623. cn.setSJBDZ4(numList2.get(3)[1]);
  624. }
  625. if(numList2.size()>4){
  626. cn.setGDXL5(numList2.get(4)[0]);
  627. cn.setSJBDZ5(numList2.get(4)[1]);
  628. }
  629. if(numList2.size()>5){
  630. cn.setGDXL6(numList2.get(5)[0]);
  631. cn.setSJBDZ6(numList2.get(5)[1]);
  632. }
  633. numList.add(cn);
  634. json.append("{ ");
  635. json.append(" \"FD_OBJECTID\":\"" + cn.getFD_OBJECTID() + "\",");
  636. json.append(" \"CUSTOMER_NAME\":\"" + cn.getCUSTOMER_NAME() + "\",");
  637. json.append(" \"CUSTOMER_KIND\":\"" + cn.getCUSTOMER_KIND() + "\",");
  638. json.append(" \"OWNER_STATION\":\"" + cn.getOWNER_STATION() + "\",");
  639. json.append(" \"IMPORT_LEVEL\":\"" + cn.getIMPORT_LEVEL() + "\",");
  640. json.append(" \"VOLTAGE_CODE\":\"" + cn.getVOLTAGE_CODE() + "\",");
  641. json.append(" \"AGREEMENT_CAPACITY\":\"" + cn.getAGREEMENT_CAPACITY() + "\",");
  642. json.append(" \"SECUIRITY_LOAD\":\"" + cn.getSECUIRITY_LOAD() + "\",");
  643. json.append(" \"IS_MEET_OF_SUPPLY\":\"" + cn.getIS_MEET_OF_SUPPLY() + "\",");
  644. json.append(" \"OWNED_SOURCE_CAPACITY\":\"" + cn.getOWNED_SOURCE_CAPACITY() + "\",");
  645. // json.append(" \"DESCRIPTION\":\"" + cn.getDESCRIPTION() + "\",");
  646. if(numList2.size()>1 && numList2.size()<3){
  647. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  648. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  649. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  650. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  651. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\"");
  652. }else if(numList2.size()>2 && numList2.size()<4){
  653. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  654. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  655. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  656. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  657. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  658. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  659. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\"");
  660. }else if(numList2.size()>3 && numList2.size()<5){
  661. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  662. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  663. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  664. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  665. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  666. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  667. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  668. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  669. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\"");
  670. }else if(numList2.size()>4 && numList2.size()<6){
  671. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  672. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  673. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  674. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  675. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  676. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  677. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  678. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  679. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
  680. json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
  681. json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\"");
  682. }else if(numList2.size()>5){
  683. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  684. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  685. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\",");
  686. json.append(" \"GDXL2\":\"" + cn.getGDXL2() + "\",");
  687. json.append(" \"SJBDZ2\":\"" + cn.getSJBDZ2() + "\",");
  688. json.append(" \"GDXL3\":\"" + cn.getGDXL3() + "\",");
  689. json.append(" \"SJBDZ3\":\"" + cn.getSJBDZ3() + "\",");
  690. json.append(" \"GDXL4\":\"" + cn.getGDXL4() + "\",");
  691. json.append(" \"SJBDZ4\":\"" + cn.getSJBDZ4() + "\",");
  692. json.append(" \"GDXL5\":\"" + cn.getGDXL5() + "\",");
  693. json.append(" \"SJBDZ5\":\"" + cn.getSJBDZ5() + "\",");
  694. json.append(" \"GDXL6\":\"" + cn.getGDXL6() + "\",");
  695. json.append(" \"SJBDZ6\":\"" + cn.getSJBDZ6() + "\"");
  696. }else if(numList2.size()>0){
  697. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\",");
  698. json.append(" \"GDXL1\":\"" + cn.getGDXL1() + "\",");
  699. json.append(" \"SJBDZ1\":\"" + cn.getSJBDZ1() + "\"");
  700. }else{
  701. json.append(" \"IS_MEET_OF_SELF_PROVIDE\":\"" + cn.getIS_MEET_OF_SELF_PROVIDE() + "\"");
  702. }
  703. json.append("} ");
  704. } catch (PersistenceException e) {
  705. // TODO Auto-generated catch block
  706. e.printStackTrace();
  707. }
  708. String result=json.toString();
  709. log.info("result===="+result);
  710. return result;
  711. }
  712. /**
  713. * 导出用dao
  714. * @return
  715. * @throws PersistenceException
  716. */
  717. public String getCustomerInfoDao() throws PersistenceException{
  718. try {
  719. List<String> list1 = new ArrayList<String>();
  720. String sql ="select MRID from (select a.MRID,rownum rn from (select MRID from \"NWYJ_SERVICE\".\"MDM_CUSTOMER\" ) a) ";
  721. List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
  722. for(int i=0;i<tempList.size();i++){
  723. list1.add(tempList.get(i)[0]);
  724. }
  725. getPlanNum(list1,null);
  726. }catch (Exception e){
  727. this.log.error(e.getMessage(), e);
  728. }
  729. if (json.lastIndexOf(",") > -1) {
  730. json.deleteCharAt(json.lastIndexOf(","));
  731. }
  732. String result="["+json.toString()+"]";
  733. log.info("result===="+result);
  734. return result;
  735. }
  736. }