| 
					
				 | 
			
			
				@@ -1,5 +1,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.jtgh.yjpt.controller.map;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.HashMap;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.List;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Map;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.flex.remoting.RemotingDestination;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Controller;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -10,22 +14,112 @@ import com.jtgh.yjpt.common.Constants; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.jtgh.yjpt.common.GlobalData;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.jtgh.yjpt.controller.BaseController;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.jtgh.yjpt.entity.map.GkxxEntity;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.gkgq.MtService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.jyr.BwService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.jyr.DcService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.jyr.JyrService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.jtgh.yjpt.service.map.GkxxService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.sys.WxhwpmService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @Controller
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @RemotingDestination
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 public class GkxxController extends BaseController {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private GkxxService gkxxService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private JyrService jyrService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private BwService bwService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private MtService mtService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private CgService cgService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//	private WxhwpmService wxhwpmService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private DcService dcService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private GkwxhwzyfzService gkwxhwzyfzService;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public BusinessContext getGkxxBySzd(String szd) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		BusinessContext bc=new BusinessContext();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		GkxxEntity entity=gkxxService.findBySzd(Long.parseLong(szd));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//GkxxEntity entity=gkxxService.findBySzd(Long.parseLong(szd));
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		GkxxEntity entity = new GkxxEntity();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//4 危险货物品种
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//				List<Object[]> Total_LBHXB_BZLB = wxhwpmService.Count_Total_LBHXB_BZLB();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//				entity.setWhpz("系统中危险货物品名录中录入的危险品有"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//							(Total_LBHXB_BZLB.get(0)[0]==null?0:Total_LBHXB_BZLB.get(0)[0])+"种,按类别与项别分有"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//							(Total_LBHXB_BZLB.get(0)[1]==null?0:Total_LBHXB_BZLB.get(0)[1])+"类,按包装类别分有"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//							(Total_LBHXB_BZLB.get(0)[2]==null?0:Total_LBHXB_BZLB.get(0)[2])+"类。");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//危货品种从附证的允许作业的危货物品中去重累计得来
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> WH = gkwxhwzyfzService.GetWH_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		Map<String,String> whMap= new HashMap<String,String>();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		for(int i=0;i<WH.size();i++){
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			Object o = WH.get(i);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			if(o!=null){
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				String temp = o.toString();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(!temp.equals("")){
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					String[] arrTemp = temp.split(";");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					for(String str : arrTemp){
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						if(!str.trim().equals("")){
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							whMap.put(str.replace("\n", ""),"");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					}//end for string arr
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				}// !=""
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			}// !=null
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		}//end for List<Object[]> WH
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//System.err.println(whMap.toString());
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		int WH_Num = whMap.size();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//5 重大危险源 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> ZDWXY_CG = cgService.GetCG_ZDWXY_Num_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				entity.setZdwxy("重大危险源储罐"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					(ZDWXY_CG.get(0)[0]==null?0:ZDWXY_CG.get(0)[0])+"个,储罐总容积"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					(ZDWXY_CG.get(0)[0]==null?0:ZDWXY_CG.get(0)[0])+"万立方。");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//1 港口安全情况
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> WHQY_Num = jyrService.GetWHQY_Num_By_SZD(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> BW_Num = bwService.GetBW_Num_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//List<Object[]> Mt_Num= mtService.GetMt_Num_By_Szd(szd);//码头
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> CG_Num = cgService.GetCG_Num_By_Szd(szd); 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> DC_Num = dcService.GetDC_JZX_WH_Num_By_SZD(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		entity.setAqgk("现有港口危险货物企业"+ (WHQY_Num.get(0)==null?0:WHQY_Num.get(0)) +"家、泊位"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						(BW_Num.get(0)==null?0:BW_Num.get(0))+"个,危险货物"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						WH_Num+"种,属港航管理部门监管的储罐" + 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						(CG_Num.get(0)==null?0:CG_Num.get(0))+"个,集装箱危货堆场"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						(DC_Num.get(0)==null?0:DC_Num.get(0))+"个,其中重大危险源" + 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						(ZDWXY_CG.get(0)[0]==null?0:ZDWXY_CG.get(0)[0])+"个。");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//2 石油化工码头企业
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> SYHG_Num = jyrService.GetSYHGQY_Num_By_SZD(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> BW_SYHG_Num = bwService.GetBW_SYHG_Num_By_SZD(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> Mt_SYHG_Num = mtService.GetMt_Num_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> CG_SYHG_Num = cgService.GetCG_SYHG_Num_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		entity.setSyhg("石油化工码头企业有" + (SYHG_Num.get(0)==null?0:SYHG_Num.get(0))
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						+"家,相关泊位"+ (BW_SYHG_Num.get(0)==null?0:BW_SYHG_Num.get(0)) + 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						"个、储罐"+ (CG_SYHG_Num.get(0)==null?0:CG_SYHG_Num.get(0)) + 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						"个"+"、码头" + (Mt_SYHG_Num.get(0)==null?0:Mt_SYHG_Num.get(0)) + "个。");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		//3 危险货物储罐 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<Object[]> WH_CG = cgService.GetCG_WH_Num_By_Szd(szd);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		entity.setWhcg("属于危货企业的储罐有"+ (WH_CG.get(0)[0]==null?0:WH_CG.get(0)[0]) +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				"个,储罐总容积"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				(WH_CG.get(0)[1]==null?0:WH_CG.get(0)[1]) +
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				"万立方,其中最大储罐容积"+ (WH_CG.get(0)[2]==null?0:WH_CG.get(0)[2])+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				"万立方,最小储罐容积"+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				(WH_CG.get(0)[3]==null?0:WH_CG.get(0)[3])+"万立方");
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		bc.setAttribute("record", entity);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		bc.setAttribute("success", true);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return bc;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	}
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public BusinessContext save(GkxxEntity entity) {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		BusinessContext bc=new BusinessContext();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		entity=gkxxService.save(entity);
 
			 |