123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- package com.sinosoft.am.plan.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.plan.vo.ContingencyPlanHuiZongBean;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- import com.sysmodel.datamodel.xmlmodel.able.SysModel;
- public class ContingencyPlanHuiZongDao2 {
- private Logger log = Logger.getLogger(this.getClass());
- SysModel sysmodel = ModelFactory.getSysmodel();
- SysPersistence persistence = PersistenceFactory.getInstance(sysmodel);
- StringBuffer json = new StringBuffer();
- private List<ContingencyPlanHuiZongBean> numList = new ArrayList<ContingencyPlanHuiZongBean>();
- // List<String> nameList =new ArrayList<String>();
- // String series = "";
- /**
- * 获取横轴各单位名称2015-10-10
- * @param list
- * @return
- */
-
- /**
- * 根据传过来的ID进行检测,有子节点且子节点在明细表中有数据的,继续查询该节点下面的数据
- * @param id
- * @return
- */
- public String PlanNumInit(String id,String time1,String time2){
- /***********************2015-12-09重新整理统计方式************************************/
- String sql="select DEPT_ID from sys_department where (parent_id='"+id+"' or DEPT_ID='"+id+"')";
-
- try{
-
-
- if(checkId(id)){
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- log.info("carNum.tempList.size===="+tempList.size());
- List<String>list=new ArrayList<String>();
- for(int i=0;i<tempList.size();i++){
- list.add(tempList.get(i)[0]);
- }
- getPlanNum(list, list.get(0),time1,time2);
- }else{
- List<String>list=new ArrayList<String>();
- list.add(id);
- getPlanNum(list, id,time1,time2);
- }
-
- }catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- /*****没有数据的情况下多了这个逗号导致表格出不来 2016-01-21*****************/
- /*if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }*/
-
-
- ContingencyPlanHuiZongBean drillBean=new ContingencyPlanHuiZongBean();
- for(int i=0;i<numList.size();i++){
- //总体预案
- drillBean.setZtPlan(drillBean.getZtPlan()+numList.get(i).getZtPlan());
-
- //专项预案
- drillBean.setZxPlan(drillBean.getZxPlan()+numList.get(i).getZxPlan());
- //自然灾害
- drillBean.setZrzh(drillBean.getZrzh()+numList.get(i).getZrzh());
- //事故灾难
- drillBean.setSgzh(drillBean.getSgzh()+numList.get(i).getSgzh());
- //公共卫生
- drillBean.setGgws(drillBean.getGgws()+numList.get(i).getGgws());
- //社会安全
- drillBean.setShaq(drillBean.getShaq()+numList.get(i).getShaq());
-
- //现场处置
- drillBean.setXcczPlan(drillBean.getXcczPlan()+numList.get(i).getXcczPlan());
- //自然灾害
- drillBean.setZrzhxc(drillBean.getZrzhxc()+numList.get(i).getZrzhxc());
- //事故灾难
- drillBean.setSgzhxc(drillBean.getSgzhxc()+numList.get(i).getSgzhxc());
- //公共卫生
- drillBean.setGgwsxc(drillBean.getGgwsxc()+numList.get(i).getGgwsxc());
- //社会安全
- drillBean.setShaqxc(drillBean.getShaqxc()+numList.get(i).getShaqxc());
-
- //部门预案
- drillBean.setBmhj(drillBean.getBmhj()+numList.get(i).getBmhj());
- //安全监察部
- drillBean.setAqjcb(drillBean.getAqjcb()+numList.get(i).getAqjcb());
- //系统运行部
- drillBean.setXtyxb(drillBean.getXtyxb()+numList.get(i).getXtyxb());
- //国际部
- drillBean.setGjb(drillBean.getGjb()+numList.get(i).getGjb());
- //生产设备管理部
- drillBean.setScsbglb(drillBean.getScsbglb()+numList.get(i).getScsbglb());
- //信息部
- drillBean.setXxb(drillBean.getXxb()+numList.get(i).getXxb());
- //市场营销部
- drillBean.setScyxb(drillBean.getScyxb()+numList.get(i).getScyxb());
-
- //部门合计
- drillBean.setBmhj(drillBean.getBmhj()+numList.get(i).getBmhj());
-
- //政府预案
- drillBean.setZhengfu(drillBean.getZhengfu()+numList.get(i).getZhengfu());
-
- //总计
- drillBean.setzTotal(drillBean.getzTotal()+numList.get(i).getzTotal());
- }
- //显示表格所用
-
- json.append(" { ");
- json.append(" \"ztplan\":\"" + drillBean.getZtPlan() + "\",");
- json.append(" \"zxplan\":\"" + drillBean.getZxPlan() + "\",");
- json.append(" \"zrzh\":\"" + drillBean.getZrzh() + "\",");
- json.append(" \"sgzh\":\"" + drillBean.getSgzh() + "\",");
- json.append(" \"ggws\":\"" + drillBean.getGgws() + "\",");
- json.append(" \"shaq\":\"" + drillBean.getShaq() + "\",");
- json.append(" \"xcczplan\":\"" + drillBean.getXcczPlan() + "\",");
- json.append(" \"zrzhxc\":\"" + drillBean.getZrzhxc() + "\",");
- json.append(" \"sgzhxc\":\"" + drillBean.getSgzhxc() + "\",");
- json.append(" \"ggwsxc\":\"" + drillBean.getGgwsxc() + "\",");
- json.append(" \"shaqxc\":\"" + drillBean.getShaqxc() + "\",");
- json.append(" \"ztotal\":\"" + drillBean.getzTotal() + "\",");
-
- json.append(" \"aqjcb\":\"" + drillBean.getAqjcb() + "\",");
- json.append(" \"xtyxb\":\"" + drillBean.getXtyxb() + "\",");
- json.append(" \"gjb\":\"" + drillBean.getGjb() + "\",");
- json.append(" \"scsbglb\":\"" + drillBean.getScsbglb() + "\",");
- json.append(" \"xxb\":\"" + drillBean.getXxb() + "\",");
- json.append(" \"scyxb\":\"" + drillBean.getScyxb() + "\",");
-
- json.append(" \"bmhj\":\"" + drillBean.getBmhj() + "\",");
- json.append(" \"zhengfu\":\"" + drillBean.getZhengfu() + "\",");
- json.append(" \"name\":\"" +"总计" + "\",");
- json.append(" \"dept_id\":\"" + "11111" + "\",");
- json.append(" \"isParent\":false,");
- json.append(" \"open\":false");
- json.append("} ");
-
-
- String result="{\"rows\":["+json.toString()+"]}";
- log.info("result===="+result);
- return result;
- }
-
- //树形的加载
- public String PlanNum(String id,String deptIds,String strPushTume,String endPushTime){
- try{
- if(checkId(id)){
- // String sql="select UNITS from ECM_AM_YJYASERVER WHERE UNITS IN(SELECT ID FROM SYS_DEPARTMENT_0827 WHERE PARENT_ID='"+id+"')";
- String sql="SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID='"+id+"'";
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- for(int i=0;i<tempList.size();i++){
- List<String>list=getCmpList(tempList.get(i)[0], new ArrayList<String>(),deptIds);
- getPlanNum(list, tempList.get(i)[0],"","");
- }
- }else{
- List<String>list=new ArrayList<String>();
- list.add(id);
- getNoChildPlanNum(list, id,strPushTume,endPushTime);
- }}catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }
- String result="{\"rows\":["+json.toString()+"]}";
- log.info("result===="+result);
- return result;
- }
-
- //获取公司ID(包括自己,以及下属子单位ID)
- public List<String> getCmpList(String id,List<String>list,String deptIds) {
- try{
- if(checkId(id)){//存在子节点且子节点在明细表中有记录
- list.add(id);
- String sql="select distinct(UNITS) from ECM_AM_YJYASERVER WHERE UNITS IN (SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID='"+id+"')";
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- log.info("getCmpList.tempList.size===="+tempList.size());
- for(int i=0;i<tempList.size();i++){
- getCmpList(tempList.get(i)[0],list,deptIds);
- }
- }
- else{//如果不存在自己点或者子节点在明细表中无记录,则返回该ID
- list.add(id);
- }}catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- return list;
- }
-
- //判断有没有子单位
- public boolean checkId(String id) {
- try{
- String sql="select * from ECM_AM_YJYASERVER WHERE units IN(SELECT DEPT_ID FROM SYS_DEPARTMENT WHERE PARENT_ID='"+id+"')";
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- if(tempList==null||tempList.size()==0){
- return false;
- }else{
- return true;
- }}catch(Exception e){
- this.log.error(e.getMessage(), e);
- return false;
- }
- }
-
- //获取每一行数据的统计数据
- public void getPlanNum(List<String>list,String id,String time1,String time2) throws PersistenceException{
- try{
- for(int i=0;i<list.size();i++){
- ContingencyPlanHuiZongBean cn=new ContingencyPlanHuiZongBean();
- //2015-10-10qsl可以跑通
- String sql="select UNITS,sum(case plan_type when '102' then 1 else 0 end ) 总体预案,"
- + "sum(case when BYSUNESS_TYPE='105' and plan_type='103' then 1 else 0 end)专项自然灾害,"
- + "sum(case when BYSUNESS_TYPE='106' and plan_type='103' then 1 else 0 end)专项事故灾难,"
- + "sum(case when BYSUNESS_TYPE='107' and plan_type='103' then 1 else 0 end)专项公共卫生事件,"
- + "sum(case when BYSUNESS_TYPE= '108' and plan_type='103' then 1 else 0 end)专项社会安全事件,"
- + "sum(case plan_type when '103' then 1 else 0 end )专项合计,"
- + "sum(case when BYSUNESS_TYPE='105' and plan_type='104' then 1 else 0 end)现场自然灾害,"
- + "sum(case when BYSUNESS_TYPE='106' and plan_type='104' then 1 else 0 end)现场事故灾难,"
- + "sum(case when BYSUNESS_TYPE='107' and plan_type='104' then 1 else 0 end)现场公共卫生事件,"
- + "sum(case when BYSUNESS_TYPE= '108' and plan_type='104' then 1 else 0 end)现场社会安全事件,"
- + "sum(case plan_type when '104' then 1 else 0 end )现场合计,"
- + "sum(case when plan_type= '105' and INS_UNITS='112' then 1 else 0 end )安全监察部,"
- + "sum(case when plan_type= '105' and INS_UNITS='113' then 1 else 0 end )系统运行部,"
- + "sum(case when plan_type='105' and INS_UNITS='114' then 1 else 0 end )国际部,"
- + "sum(case when plan_type='105' and INS_UNITS='115' then 1 else 0 end )设备管理部,"
- + "sum(case when plan_type='105' and INS_UNITS='116' then 1 else 0 end )信息部,"
- + "sum(case when plan_type='105' and INS_UNITS='117' then 1 else 0 end )市场营销部,"
- + "sum(case plan_type when '105' then 1 else 0 end )部门合计,"
- + "sum(case plan_type when '106' then 1 else 0 end )政府预案, "
- + "(sum(case plan_type when '105' then 1 else 0 end )+sum(case plan_type when '103' then 1 else 0 end )+sum(case plan_type when '104' then 1 else 0 end )+sum(case plan_type when '106' then 1 else 0 end )+sum(case plan_type when '102' then 1 else 0 end ))总合计 from ECM_AM_YJYASERVER where is_del='0' and plan_biaozhi!='0' and PLAN_STAT='1' and PLAN_STAT1='1' and units='"+list.get(i)+"'";
-
- if(time1!=null){
- sql+=" and ISSUE_DATE between '"+time1+"' and '"+time2+"'";
- }
-
-
- sql+=" group by units ";
-
- List<String[]> tempList = persistence.getSearchResult(99, sql.toString());
-
- if(tempList.size()>0){
- cn.setComp_id(tempList.get(0)[0]);//单位ID
- cn.setZtPlan(cn.getZtPlan()+Integer.parseInt(tempList.get(0)[1]));//总体预案
- cn.setZrzh(cn.getZrzh()+Integer.parseInt(tempList.get(0)[2]));//自然灾害
- cn.setSgzh(cn.getSgzh()+Integer.parseInt(tempList.get(0)[3]));//事故灾难
- cn.setGgws(cn.getGgws()+Integer.parseInt(tempList.get(0)[4]));//公共卫生
- cn.setShaq(cn.getShaq()+Integer.parseInt(tempList.get(0)[5]));//社会安全
- cn.setZxPlan(cn.getZxPlan()+Integer.parseInt(tempList.get(0)[6]));//专项合计
-
- cn.setZrzhxc(cn.getZrzhxc()+Integer.parseInt(tempList.get(0)[7]));//自然灾害
- cn.setSgzhxc(cn.getSgzhxc()+Integer.parseInt(tempList.get(0)[8]));//事故灾难
- cn.setGgwsxc(cn.getGgwsxc()+Integer.parseInt(tempList.get(0)[9]));//公共卫生
- cn.setShaqxc(cn.getShaqxc()+Integer.parseInt(tempList.get(0)[10]));//社会安全
- cn.setXcczPlan(cn.getXcczPlan()+Integer.parseInt(tempList.get(0)[11]));//现场合计
-
- /***********************************废弃************************************/
- cn.setAqjcb(cn.getAqjcb()+Integer.parseInt(tempList.get(0)[12]));//安全监察部
- cn.setXtyxb(cn.getXtyxb()+Integer.parseInt(tempList.get(0)[13]));//系统运行部
- cn.setGjb(cn.getGjb()+Integer.parseInt(tempList.get(0)[14]));//国际部
- cn.setScsbglb(cn.getScsbglb()+Integer.parseInt(tempList.get(0)[15]));//生产设备管理部
- cn.setXxb(cn.getXxb()+Integer.parseInt(tempList.get(0)[16]));//信息部
- cn.setScyxb(cn.getScyxb()+Integer.parseInt(tempList.get(0)[17]));//市场营销部
- /***********************************************************************/
-
- cn.setBmhj(cn.getBmhj()+Integer.parseInt(tempList.get(0)[18]));//部门合计
- cn.setZhengfu(cn.getZhengfu()+Integer.parseInt(tempList.get(0)[19]));//政府预案
-
- cn.setzTotal(cn.getzTotal()+Integer.parseInt(tempList.get(0)[20]));//总合计
- numList.add(cn);
- if(cn.getzTotal()>0){
- if(checkId(id)){
- json.append("{ ");
- json.append(" \"ztplan\":\"" + cn.getZtPlan() + "\",");
- json.append(" \"zxplan\":\"" + cn.getZxPlan() + "\",");
- json.append(" \"zrzh\":\"" + cn.getZrzh() + "\",");
- json.append(" \"sgzh\":\"" + cn.getSgzh() + "\",");
- json.append(" \"ggws\":\"" + cn.getGgws() + "\",");
- json.append(" \"shaq\":\"" + cn.getShaq() + "\",");
- json.append(" \"xcczplan\":\"" + cn.getXcczPlan() + "\",");
- json.append(" \"zrzhxc\":\"" + cn.getZrzhxc() + "\",");
- json.append(" \"sgzhxc\":\"" + cn.getSgzhxc() + "\",");
- json.append(" \"ggwsxc\":\"" + cn.getGgwsxc() + "\",");
- json.append(" \"shaqxc\":\"" + cn.getShaqxc() + "\",");
- json.append(" \"ztotal\":\"" + cn.getzTotal() + "\",");
-
- json.append(" \"aqjcb\":\"" + cn.getAqjcb() + "\",");
- json.append(" \"xtyxb\":\"" + cn.getXtyxb() + "\",");
- json.append(" \"gjb\":\"" + cn.getGjb() + "\",");
- json.append(" \"scsbglb\":\"" + cn.getScsbglb() + "\",");
- json.append(" \"xxb\":\"" + cn.getXxb() + "\",");
- json.append(" \"scyxb\":\"" + cn.getScyxb() + "\",");
-
- json.append(" \"bmhj\":\"" + cn.getBmhj() + "\",");
- json.append(" \"zhengfu\":\"" + cn.getZhengfu() + "\",");
- json.append(" \"name\":\"" + getNameById(list.get(i)) + "\",");
- json.append(" \"dept_id\":\"" + list.get(i) + "\",");
- json.append(" \"isParent\":true,");
- json.append(" \"open\":false");
- json.append("}, ");
- }else{
- json.append("{ ");
- json.append(" \"ztplan\":\"" + cn.getZtPlan() + "\",");
- json.append(" \"zxplan\":\"" + cn.getZxPlan() + "\",");
- json.append(" \"zrzh\":\"" + cn.getZrzh() + "\",");
- json.append(" \"sgzh\":\"" + cn.getSgzh() + "\",");
- json.append(" \"ggws\":\"" + cn.getGgws() + "\",");
- json.append(" \"shaq\":\"" + cn.getShaq() + "\",");
- json.append(" \"xcczplan\":\"" + cn.getXcczPlan() + "\",");
- json.append(" \"zrzhxc\":\"" + cn.getZrzhxc() + "\",");
- json.append(" \"sgzhxc\":\"" + cn.getSgzhxc() + "\",");
- json.append(" \"ggwsxc\":\"" + cn.getGgwsxc() + "\",");
- json.append(" \"shaqxc\":\"" + cn.getShaqxc() + "\",");
- json.append(" \"ztotal\":\"" + cn.getzTotal() + "\",");
-
- json.append(" \"aqjcb\":\"" + cn.getAqjcb() + "\",");
- json.append(" \"xtyxb\":\"" + cn.getXtyxb() + "\",");
- json.append(" \"gjb\":\"" + cn.getGjb() + "\",");
- json.append(" \"scsbglb\":\"" + cn.getScsbglb() + "\",");
- json.append(" \"xxb\":\"" + cn.getXxb() + "\",");
- json.append(" \"scyxb\":\"" + cn.getScyxb() + "\",");
-
- json.append(" \"bmhj\":\"" + cn.getBmhj() + "\",");
- json.append(" \"zhengfu\":\"" + cn.getZhengfu() + "\",");
- json.append(" \"name\":\"" + getNameById(list.get(i)) + "\",");
- json.append(" \"dept_id\":\"" + list.get(i) + "\",");
- json.append(" \"isParent\":false,");
- json.append(" \"open\":false");
- json.append("}, ");
- }
- }
-
- }
- }}catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- }
-
-
- //该单位没有子节点,只获取一行的统计信息
- public void getNoChildPlanNum(List<String>list,String id,String time1,String time2) throws PersistenceException{
- ContingencyPlanHuiZongBean cn=new ContingencyPlanHuiZongBean();
- try{
- for(int i=0;i<list.size();i++){
- String sql="select UNITS,sum(case plan_type when '102' then 1 else 0 end ) 总体预案,"
- + "sum(case when BYSUNESS_TYPE='105' and plan_type='103' then 1 else 0 end)专项自然灾害,"
- + "sum(case when BYSUNESS_TYPE='106' and plan_type='103' then 1 else 0 end)专项事故灾难,"
- + "sum(case when BYSUNESS_TYPE='107' and plan_type='103' then 1 else 0 end)专项公共卫生事件,"
- + "sum(case when BYSUNESS_TYPE= '108' and plan_type='103' then 1 else 0 end)专项社会安全事件,"
- + "sum(case plan_type when '103' then 1 else 0 end )专项合计,"
- + "sum(case when BYSUNESS_TYPE='105' and plan_type='104' then 1 else 0 end)现场自然灾害,"
- + "sum(case when BYSUNESS_TYPE='106' and plan_type='104' then 1 else 0 end)现场事故灾难,"
- + "sum(case when BYSUNESS_TYPE='107' and plan_type='104' then 1 else 0 end)现场公共卫生事件,"
- + "sum(case when BYSUNESS_TYPE= '108' and plan_type='104' then 1 else 0 end)现场社会安全事件,"
- + "sum(case plan_type when '104' then 1 else 0 end )现场合计,"
- + "sum(case when plan_type= '105' and INS_UNITS='112' then 1 else 0 end )安全监察部,"
- + "sum(case when plan_type= '105' and INS_UNITS='113' then 1 else 0 end )系统运行部,"
- + "sum(case when plan_type='105' and INS_UNITS='114' then 1 else 0 end )国际部,"
- + "sum(case when plan_type='105' and INS_UNITS='115' then 1 else 0 end )设备管理部,"
- + "sum(case when plan_type='105' and INS_UNITS='116' then 1 else 0 end )信息部,"
- + "sum(case when plan_type='105' and INS_UNITS='117' then 1 else 0 end )市场营销部,"
- + "sum(case plan_type when '105' then 1 else 0 end )部门合计,"
- + "sum(case plan_type when '106' then 1 else 0 end )政府预案, "
- + "(sum(case plan_type when '105' then 1 else 0 end )+sum(case plan_type when '103' then 1 else 0 end )+sum(case plan_type when '104' then 1 else 0 end )+sum(case plan_type when '106' then 1 else 0 end )+sum(case plan_type when '102' then 1 else 0 end ))总合计 from ECM_AM_YJYASERVER where is_del='0' and plan_biaozhi!='0' and PLAN_STAT1='1' and PLAN_STAT='1' and units='"+list.get(i)+"'";
-
- if(time1!=null){
- sql+=" and DZ_FILE between '"+time1+"' and '"+time2+"'";
- }
-
- log.info("getCarNum.sql===="+sql);
- List<String[]> numList = persistence.getSearchResult(99, sql.toString());
- if(numList.size()>0){
- cn.setComp_id(numList.get(0)[0]);//单位ID
- cn.setZtPlan(cn.getZtPlan()+Integer.parseInt(numList.get(0)[1]));//总体预案
- cn.setZxPlan(cn.getZxPlan()+Integer.parseInt(numList.get(0)[6]));//专项预案
- cn.setZrzh(cn.getZrzh()+Integer.parseInt(numList.get(0)[2]));//自然灾害
- cn.setSgzh(cn.getSgzh()+Integer.parseInt(numList.get(0)[3]));//事故灾难
- cn.setGgws(cn.getGgws()+Integer.parseInt(numList.get(0)[4]));//公共卫生
- cn.setShaq(cn.getShaq()+Integer.parseInt(numList.get(0)[5]));//社会安全
- cn.setXcczPlan(cn.getXcczPlan()+Integer.parseInt(numList.get(0)[11]));//现场处置
- cn.setZrzhxc(cn.getZrzhxc()+Integer.parseInt(numList.get(0)[7]));//自然灾害
- cn.setSgzhxc(cn.getSgzhxc()+Integer.parseInt(numList.get(0)[8]));//事故灾难
- cn.setGgwsxc(cn.getGgwsxc()+Integer.parseInt(numList.get(0)[9]));//公共卫生
- cn.setShaqxc(cn.getShaqxc()+Integer.parseInt(numList.get(0)[10]));//社会安全
- cn.setzTotal(cn.getzTotal()+Integer.parseInt(numList.get(0)[19]));//总合计
-
- cn.setAqjcb(cn.getAqjcb()+Integer.parseInt(numList.get(0)[12]));//安全监察部
- cn.setXtyxb(cn.getXtyxb()+Integer.parseInt(numList.get(0)[13]));//系统运行部
- cn.setGjb(cn.getGjb()+Integer.parseInt(numList.get(0)[14]));//国际部
- cn.setScsbglb(cn.getScsbglb()+Integer.parseInt(numList.get(0)[15]));//生产设备管理部
- cn.setXxb(cn.getXxb()+Integer.parseInt(numList.get(0)[16]));//信息部
- cn.setScyxb(cn.getScyxb()+Integer.parseInt(numList.get(0)[17]));//市场营销部
-
- cn.setBmhj(cn.getBmhj()+Integer.parseInt(numList.get(0)[18]));//部门合计
- cn.setZhengfu(cn.getZhengfu()+Integer.parseInt(numList.get(0)[19]));//政府预案
- // this.numList.add(cn);
- //nameList.add(cn.getComp_id());
- }
- }}catch(Exception e){
- this.log.error(e.getMessage(), e);
- }
- if(cn.getzTotal()>0){
- json.append("{ ");
- json.append(" \"ztplan\":\"" + cn.getZtPlan() + "\",");
- json.append(" \"zxplan\":\"" + cn.getZxPlan() + "\",");
- json.append(" \"zrzh\":\"" + cn.getZrzh() + "\",");
- json.append(" \"sgzh\":\"" + cn.getSgzh() + "\",");
- json.append(" \"ggws\":\"" + cn.getGgws() + "\",");
- json.append(" \"shaq\":\"" + cn.getShaq() + "\",");
- json.append(" \"xcczplan\":\"" + cn.getXcczPlan() + "\",");
- json.append(" \"zrzhxc\":\"" + cn.getZrzhxc() + "\",");
- json.append(" \"sgzhxc\":\"" + cn.getSgzhxc() + "\",");
- json.append(" \"ggwsxc\":\"" + cn.getGgwsxc() + "\",");
- json.append(" \"shaqxc\":\"" + cn.getShaqxc() + "\",");
- json.append(" \"ztotal\":\"" + cn.getzTotal() + "\",");
-
- json.append(" \"aqjcb\":\"" + cn.getAqjcb() + "\",");
- json.append(" \"xtyxb\":\"" + cn.getXtyxb() + "\",");
- json.append(" \"gjb\":\"" + cn.getGjb() + "\",");
- json.append(" \"scsbglb\":\"" + cn.getScsbglb() + "\",");
- json.append(" \"xxb\":\"" + cn.getXxb() + "\",");
- json.append(" \"scyxb\":\"" + cn.getScyxb() + "\",");
-
- json.append(" \"bmhj\":\"" + cn.getBmhj() + "\",");
- json.append(" \"zhengfu\":\"" + cn.getZhengfu() + "\",");
- json.append(" \"name\":\"" + getNameById(id) + "\",");
- json.append(" \"dept_id\":\"" + id + "\",");
- json.append(" \"isParent\":false,");
- json.append(" \"open\":false");
- json.append("}, ");
- numList.add(cn);
- }
- }
-
- //通过单位ID显示出该单位名称
- public String getNameById(String id){
- String sql="select DEPT_NAME from sys_department where DEPT_ID='"+id+"'";
- try {
- List<String[]>tempList= persistence.getSearchResult(99, sql.toString());
- if(tempList==null||tempList.size()==0){
- return "";
- }else{
- String name=tempList.get(0)[0].replace("供电局", "").replace("广东电网有限责任公司", "广东");
- log.info("name===="+name);
- return name;
- }
- } catch (PersistenceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return "";
- }
- }
- }
|