Pārlūkot izejas kodu

git-svn-id: https://192.168.57.71/svn/jsgkj@1317 931142cf-59ea-a443-aa0e-51397b428577

ld_lixh 8 gadi atpakaļ
vecāks
revīzija
7b205454ca

+ 56 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/FjbCtl.java

@@ -0,0 +1,56 @@
+package com.xt.js.gkaq.web.ctl;
+
+import java.util.List;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
+import com.xt.js.gkaq.frame.service.CodeService;
+import com.xt.js.gkaq.web.model.BwInfoModel;
+import com.xt.js.gkaq.web.model.BwModel;
+import com.xt.js.gkaq.web.model.FjbModel;
+import com.xt.js.gkaq.web.service.BwService;
+import com.xt.js.gkaq.web.service.FjbService;
+import com.xt.js.gkaq.web.service.RyzsbService;
+import com.xt.js.gkaq.web.vo.BwVo;
+import com.xt.js.gkaq.web.vo.FjbVo;
+import com.yuanxd.tools.pagehelper.PageHelper;
+import com.yuanxd.tools.pagehelper.PageInfo;
+import com.yuanxd.tools.utils.WebJsonResult;
+
+@Controller
+@RequestMapping(value = "/fjb", produces = "application/json; charset=utf-8")
+public class FjbCtl extends BaseCtl {
+    @Autowired
+    private FjbService fjbService;
+    @Autowired
+    private RyzsbService ryzsbService;
+    /**
+     * 附件删除
+     * @param id
+     * @return
+     */
+    @RequestMapping("fileDel")
+    @ResponseBody
+    public WebJsonResult fileDel (String fjid) {
+    	//附件表信息
+    	FjbModel fjb = fjbService.findById(fjid);
+    	if(fjb != null) {
+    		fjb.setState("9");//修改附件表状态
+        	fjbService.update(fjb);//删除附件表信息
+    	} else {
+    		//设置参数返回值
+        	WebJsonResult jsonResult = new WebJsonResult();
+        	jsonResult.setMessage("您要删除的信息不存在,请刷新页面后再操作!");
+        	jsonResult.setSuccess(false);
+        	return jsonResult;
+    	}
+    	
+    	return success();
+    }
+}

+ 303 - 0
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/GksssbCtl.java

@@ -0,0 +1,303 @@
+package com.xt.js.gkaq.web.ctl;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.alibaba.fastjson.JSONArray;
+import com.xt.js.gkaq.common.BaseCtl;
+import com.xt.js.gkaq.common.BaseUUIDModel;
+import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
+import com.xt.js.gkaq.frame.model.ComboBoxDto;
+import com.xt.js.gkaq.frame.service.CodeService;
+import com.xt.js.gkaq.web.model.FjbModel;
+import com.xt.js.gkaq.web.model.GksssbListModel;
+import com.xt.js.gkaq.web.model.GksssbModel;
+import com.xt.js.gkaq.web.model.GksssbTjModel;
+import com.xt.js.gkaq.web.model.GqModel;
+import com.xt.js.gkaq.web.model.zdhqdExtendModel;
+import com.xt.js.gkaq.web.model.zdhqdModel;
+import com.xt.js.gkaq.web.service.FjbService;
+import com.xt.js.gkaq.web.service.GksssbService;
+import com.xt.js.gkaq.web.service.GqService;
+import com.xt.js.gkaq.web.service.RyzsbService;
+import com.xt.js.gkaq.web.service.ZdhqdService;
+import com.xt.js.gkaq.web.vo.FjbVo;
+import com.xt.js.gkaq.web.vo.GksssbListVo;
+import com.xt.js.gkaq.web.vo.GksssbTjVo;
+import com.xt.js.gkaq.web.vo.GksssbVo;
+import com.xt.js.gkaq.web.vo.ZdhqdExtendVo;
+import com.xt.js.gkaq.web.vo.ZdhqdVo;
+import com.yuanxd.tools.pagehelper.PageHelper;
+import com.yuanxd.tools.pagehelper.PageInfo;
+import com.yuanxd.tools.utils.WebJsonResult;
+import com.yuanxd.tools.utils.string.StringUtils;
+
+@Controller
+@RequestMapping(value = "/gksssb", produces = "application/json; charset=utf-8")
+public class GksssbCtl extends BaseCtl {
+    @Autowired
+    private GksssbService gksssbService;
+    @Autowired
+    private CodeService codeService;
+    @Autowired
+    private GqService gqService;
+    @Autowired
+    private FjbService fjbService;
+    @Autowired
+    private RyzsbService ryzsbService;
+
+    @RequestMapping("")
+    public String main(HttpServletRequest request) {
+    	//加载所在地
+    	List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
+    	request.setAttribute("code", list);
+        return "dwxx/gksssb/main";
+    }
+    /**
+     * 加载所在地
+     * @return
+     */
+    @RequestMapping("getszd")
+    @ResponseBody
+    public String getszd() {
+    	//加载所在地
+    	List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
+    	return JSONArray.toJSONString(list);
+    }
+    /**
+     * 加载分类
+     * @return
+     */
+    @RequestMapping("getyjfl")
+    @ResponseBody
+    public String getyjfl() {
+    	//加载一级分类
+    	List<ComboBoxDto> yjlist = codeService.findByPcode("AQSS");
+    	return JSONArray.toJSONString(yjlist);
+    }
+    /**
+     * 加载分类
+     * @return
+     */
+    @RequestMapping("getejfl")
+    @ResponseBody
+    public String getejfl() {
+    	//加载二级分类
+    	List<ComboBoxDto> ejlist = codeService.findByPcode("AQSS.EJFL");
+    	return JSONArray.toJSONString(ejlist);
+    }
+    /***
+     * 动态关联下拉框数据
+     * @param request
+     * @param szd
+     * @return
+     */
+    @RequestMapping("getGq")
+    @ResponseBody
+    public String getGq(HttpServletRequest request,String szd) {
+    	GqModel model = new GqModel();
+    	model.setSzd(szd);
+    	//获取港区
+    	List<ComboBoxDto> gqlist = gqService.selectByInfo(model);
+    	return JSONArray.toJSONString(gqlist);
+    }
+    /**
+     * 数据表格
+     * @param vo
+     * @return
+     */
+    @RequestMapping("list")
+    @ResponseBody
+    public PageInfo<GksssbListModel> list(GksssbListVo vo) {
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
+		GksssbListModel model = new GksssbListModel();
+		BeanUtils.copyProperties(vo, model);
+		List<GksssbListModel> list = gksssbService.selectByInfo(model);
+		PageInfo<GksssbListModel> pageResult = new PageInfo<>(list);
+		
+		return pageResult;
+    }
+    
+    /**
+     * 编辑详情
+     * @return
+     */
+    @RequestMapping("initEdit")
+    @ResponseBody
+    public String initEdit (String id) {
+    	GksssbModel model = gksssbService.findById(id);
+    	return JSONArray.toJSONString(model);
+    } 
+    /**
+     * 附件文件初始化
+     * @param ssid
+     * @return
+     */
+    @RequestMapping("gksssbZsInit")
+    @ResponseBody
+    public String gksssbZsInit (String ssid) {
+    	CodeModelDto codeModel = new CodeModelDto();
+		codeModel.setPcode("FJSSLX");//父级类别
+		codeModel.setCode("T_YJPT_GKSSSB");//所属类别
+		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    	FjbModel model = new FjbModel();
+    	model.setSsid(ssid);
+    	model.setSslx(list.get(0).getOptVal());
+    	List<FjbModel> fjbList = fjbService.selectByInfo(model);
+    	return JSONArray.toJSONString(fjbList);
+    }
+    /**
+     * 查看详情
+     * @param id
+     * @param request
+     * @return
+     */
+    @RequestMapping("getLookInfo")
+    @ResponseBody
+    public String getLookInfo (String qymc) {
+    	GksssbListModel model = new GksssbListModel();
+    	model.setGkjyr(qymc);
+    	List<GksssbListModel> list = gksssbService.selectByInfo(model);
+    	return JSONArray.toJSONString(list);
+    } 
+    
+    /**
+     * 添加或修改
+     * @param vo
+     * @return
+     * @throws ParseException 
+     */
+    @RequestMapping("save")
+    @ResponseBody
+    public WebJsonResult save (GksssbVo vo) throws ParseException {
+    	GksssbModel model = new GksssbModel();
+    	if (StringUtils.isEmpty(vo.getId())) {
+    		//添加
+    		BeanUtils.copyProperties(vo, model);
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+    		BeanUtils.copyProperties(vo, model);
+    		model.setYxq(sdf.parse(vo.getYxq()));
+    		gksssbService.add(model);
+    	} else {
+    		//修改
+    		model = gksssbService.findById(vo.getId());
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+    		BeanUtils.copyProperties(vo, model);
+    		model.setYxq(sdf.parse(vo.getYxq()));
+    		gksssbService.update(model);
+    	}
+    	//设置参数返回值
+    	WebJsonResult jsonResult = new WebJsonResult();
+    	jsonResult.setAttr("ssid", model.getId());
+    	jsonResult.setSuccess(true);
+    	return jsonResult;
+    }
+    /**
+     * 保存证书信息到附件表
+     * @param vo
+     * @return
+     */
+    @RequestMapping("saveFjInfo")
+    @ResponseBody
+    public WebJsonResult saveFjInfo (FjbVo vo) {
+    	FjbModel model = new FjbModel();
+    	if (vo.getId() != null && !"".equals(vo.getId())) {
+    		model = fjbService.findById(vo.getId());
+    		BeanUtils.copyProperties(vo,model);
+    		fjbService.update(model);
+    	} else {
+    		BeanUtils.copyProperties(vo,model);
+    		CodeModelDto codeModel = new CodeModelDto();
+    		codeModel.setPcode("FJSSLX");//父级类别
+    		codeModel.setCode("T_YJPT_GKSSSB");//所属类别
+    		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    		model.setSslx(list.get(0).getOptVal());
+    		fjbService.add(model);
+    	}
+    	
+    	return success();
+    }
+  
+    /**
+     * 删除信息,可多条删除
+     * @param ids
+     * @return
+     */
+    @RequestMapping("delglzdInfo")
+    @ResponseBody
+    public WebJsonResult delGlzdInfo (String ids) {
+    	String[] idArray = ids.split(",");
+    	if (idArray != null && idArray.length > 0 ) {
+    		for (String id : idArray) {
+        		//修改
+    			GksssbModel model = gksssbService.findById(id);
+        		model.setState(BaseUUIDModel.STATE_DELETE);
+        		gksssbService.update(model);
+    		}
+    	}
+    	return success();
+    }
+    /**
+     * 安全设施设备统计信息
+     * @param model
+     * @return
+     */
+    @RequestMapping("getTjInfo")
+    @ResponseBody
+    public PageInfo<GksssbTjModel> getTjInfo (GksssbTjVo vo) {
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
+		GksssbTjModel model = new GksssbTjModel();
+		BeanUtils.copyProperties(vo, model);
+    	List<GksssbTjModel> list = gksssbService.selectTjInfo(model);
+		PageInfo<GksssbTjModel> pageResult = new PageInfo<>(list);
+		
+		return pageResult;
+    } 
+    /**
+     * 导出
+     * @param model
+     * @param request
+     * @param response
+     */
+//    @RequestMapping("printJyrInfo")
+//    @ResponseBody
+//    public void printJyrInfo (JyrjcxxModel model,HttpServletRequest request,HttpServletResponse response) {
+//		
+//    	List<JyrInfoExcelModel> list = jyrjcxxService.selectExcelList(model);
+//    	//数据加工处理
+//    	for (int i = 0; i < list.size(); i++) {
+//    		JyrInfoExcelModel jyr = list.get(0);
+//    		if (jyr.getSfwhqy() != null && !"".equals(jyr.getSfwhqy())) {
+//    			if ("Y".equals(jyr.getSfwhqy())) {
+//    				jyr.setSfwhqy("是");
+//    			} else if ("W".equals(jyr.getSfwhqy())) {
+//    				jyr.setSfwhqy("是");
+//    			} else if ("N".equals(jyr.getSfwhqy())) {
+//    				jyr.setSfwhqy("否");
+//    			}
+//    			if ("Y".equals(jyr.getSfwhqy2())) {
+//    				jyr.setSfwhqy2("是");
+//    			} else if ("W".equals(jyr.getSfwhqy2())) {
+//    				jyr.setSfwhqy2("否");
+//    			} else if ("N".equals(jyr.getSfwhqy2())) {
+//    				jyr.setSfwhqy2("否");
+//    			}
+//    			list.remove(0);
+//    			list.add(jyr);
+//    		}	
+//		}
+//    	ExportExcel<JyrInfoExcelModel> excel = new ExportExcel<JyrInfoExcelModel>();
+//    	String[] heads = {"经营人名称","类别","是否危货企业","有无重大危险源","港口经营许可证","港口危险作业附证编号","经营范围","法定代表人","安全部门负责人","值班电话","所在地","所在港区"};
+//    	excel.exportExcel("经营人管理信息", heads , list, request, response);
+//    }
+   
+}

+ 1 - 7
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/GroupCtl.java

@@ -68,13 +68,7 @@ public class GroupCtl extends BaseCtl {
     @SysLog(description="分组列表查询")
     public PageInfo<GroupModelDto> getPageInfo(GroupVo vo) throws UnsupportedEncodingException {
         // 初始化参数
-        if (null == vo.getPage() || vo.getPage() < 1) {
-            vo.setPage(1);
-        }
-        if (null == vo.getRows() || vo.getRows() < 1) {
-            vo.setRows(1);
-        }
-        PageHelper.startPage(vo.getPage(), vo.getRows());
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
 
         GroupModel model = new GroupModel();
         BeanUtils.copyProperties(vo, model);

+ 1 - 7
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/JyrTjcxCtl.java

@@ -39,13 +39,7 @@ public class JyrTjcxCtl extends BaseCtl {
     @RequestMapping("list")
     @ResponseBody
     public PageInfo<TjcxModel> list(TjcxVo vo) {
-		if (null == vo.getPage() || vo.getPage() < 1) {
-			vo.setPage(1);
-		}
-		if (null == vo.getRows() || vo.getRows() < 1) {
-			vo.setRows(1);
-		}
-		PageHelper.startPage(vo.getPage(), vo.getRows());
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
 		TjcxModel model = new TjcxModel();
 		BeanUtils.copyProperties(vo, model);
 		

+ 195 - 56
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/JyrUserCtl.java

@@ -1,17 +1,34 @@
 package com.xt.js.gkaq.web.ctl;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.sql.Blob;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.swing.text.StyledEditorKit.BoldAction;
 
+import oracle.sql.BLOB;
+
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Lookup;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -23,19 +40,32 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
 import com.xt.js.gkaq.common.BaseUUIDModel;
+import com.xt.js.gkaq.common.Constants;
+import com.xt.js.gkaq.common.util.FileUtil;
+import com.xt.js.gkaq.dwxx.model.JyrjcxxModel;
 import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
+import com.xt.js.gkaq.frame.model.CodeModel;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
+import com.xt.js.gkaq.frame.model.UserModel;
 import com.xt.js.gkaq.frame.service.CodeService;
 import com.xt.js.gkaq.web.model.BloBModel;
+import com.xt.js.gkaq.web.model.FjbModel;
 import com.xt.js.gkaq.web.model.GqModel;
 import com.xt.js.gkaq.web.model.JyrUserListModel;
 import com.xt.js.gkaq.web.model.JyrUserModel;
+import com.xt.js.gkaq.web.model.JyrUserTJModel;
+import com.xt.js.gkaq.web.model.RyzsbInfoModel;
+import com.xt.js.gkaq.web.model.RyzsbModel;
 import com.xt.js.gkaq.web.service.BloBService;
+import com.xt.js.gkaq.web.service.FjbService;
 import com.xt.js.gkaq.web.service.GqService;
 import com.xt.js.gkaq.web.service.JyrUserService;
 import com.xt.js.gkaq.web.service.RyzsbService;
 import com.xt.js.gkaq.web.vo.BloBVo;
+import com.xt.js.gkaq.web.vo.FjbVo;
 import com.xt.js.gkaq.web.vo.JyrUserVo;
+import com.xt.js.gkaq.web.vo.RyzsbVo;
 import com.yuanxd.tools.pagehelper.PageHelper;
 import com.yuanxd.tools.pagehelper.PageInfo;
 import com.yuanxd.tools.utils.WebJsonResult;
@@ -59,13 +89,15 @@ public class JyrUserCtl extends BaseCtl {
     
     @Autowired
     private RyzsbService ryzsbService;
+    @Autowired
+    private FjbService fjbService;
 
     @RequestMapping("")
     public String main(HttpServletRequest request) {
     	//加载所在地
     	List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
     	//加载人员类型
-    	List<ComboBoxDto> rylxList = codeService.findByPcode("RYLX");
+     	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> rylxList = jyrUserService.getSelect("RYLX");
     	request.setAttribute("code", list);
     	request.setAttribute("rylx", rylxList);
         return "dwxx/jyrUser/main";
@@ -89,7 +121,7 @@ public class JyrUserCtl extends BaseCtl {
     @ResponseBody
     public String getRylx() {
     	//加载人员类型
-    	List<ComboBoxDto> rylxList = codeService.findByPcode("RYLX");
+    	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> rylxList = jyrUserService.getSelect("RYLX");
     	return JSONArray.toJSONString(rylxList);
     }
     /**
@@ -128,7 +160,9 @@ public class JyrUserCtl extends BaseCtl {
     @ResponseBody
     public String getJyr(String szd) {
     	//获取经营人
-    	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> jyrlist = jyrjcxxService.getSelect(szd);
+    	JyrjcxxModel model = new JyrjcxxModel();
+    	model .setSzd(szd);
+    	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> jyrlist = jyrjcxxService.getSelect(model);
     	return JSONArray.toJSONString(jyrlist);
     }
     /**
@@ -139,20 +173,35 @@ public class JyrUserCtl extends BaseCtl {
     @RequestMapping("list")
     @ResponseBody
     public PageInfo<JyrUserListModel> list(JyrUserVo vo) {
-		if (null == vo.getPage() || vo.getPage() < 1) {
-			vo.setPage(1);
-		}
-		if (null == vo.getRows() || vo.getRows() < 1) {
-			vo.setRows(1);
-		}
-		PageHelper.startPage(vo.getPage(), vo.getRows());
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
 		JyrUserModel model = new JyrUserModel();
 		BeanUtils.copyProperties(vo, model);
 		List<JyrUserListModel> list = jyrUserService.selectInfo(model);
 		PageInfo<JyrUserListModel> pageResult = new PageInfo<>(list);
 		return pageResult;
     }
-   
+    /**
+     * 加载统计的数据表格
+     * @param vo
+     * @return
+     */
+    @RequestMapping("selectTJByInfo")
+    @ResponseBody
+    public PageInfo<JyrUserTJModel> selectTJByInfo(JyrUserVo vo) {
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
+		JyrUserModel model = new JyrUserModel();
+		BeanUtils.copyProperties(vo, model);
+		String year = vo.getByzd1();
+		if (year != null && !"".equals(year)) {
+			String createTime = year + "-01-01";
+			String updateTime = year + "-12-31";
+				model.setByzd1(createTime);
+				model.setByzd2(updateTime);
+		}
+		List<JyrUserTJModel> list = jyrUserService.selectTJByInfo(model);
+		PageInfo<JyrUserTJModel> pageResult = new PageInfo<>(list);
+		return pageResult;
+    }
     /**
      * 编辑详情
      * @return
@@ -165,6 +214,19 @@ public class JyrUserCtl extends BaseCtl {
     } 
   
     /**
+     * 人员证书表的编辑详情
+     * @param id
+     * @return
+     */
+    @RequestMapping("initRyzsbEdit")
+    @ResponseBody
+    public String initRyzsbEdit (String id) {
+    	RyzsbModel model = new RyzsbModel();
+    	model.setRyid(id);
+    	List<RyzsbInfoModel> list = ryzsbService.selectInfo(model);
+    	return JSONArray.toJSONString(list);
+    }
+    /**
      * 添加或修改
      * @param vo
      * @return
@@ -177,8 +239,6 @@ public class JyrUserCtl extends BaseCtl {
     		//添加
     		JyrUserModel model = new JyrUserModel();
     		BeanUtils.copyProperties(vo, model);
-    		
-    	
     		jyrUserService.add(model);
     	} else {
     		//修改
@@ -188,60 +248,139 @@ public class JyrUserCtl extends BaseCtl {
     	}
     	return success();
     }
+	/**
+     * 保存人员证书
+     * @param request
+     * @param fileName
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping("saveBlob")
+    @ResponseBody
+    public WebJsonResult saveBlob (HttpServletRequest request, String fileName,BloBVo vo){
+    	String webpath = request.getSession().getServletContext().getRealPath("/uplod");//程序路径
+    	BloBModel model = new BloBModel();
+    	//保存的文件名是否为空
+    	if (fileName != null && !"".equals(fileName)) {
+	    	String filepath = webpath + "/" + fileName;
+	    	File file = new File(filepath);
+	    	
+			try {
+				InputStream inputStream = new FileInputStream(file);
+				byte[] data = FileUtil.inputStreamToByte(inputStream);
+		    	//判断是修改还是添加
+		    	if (vo.getId() != null && !"".equals(vo.getId())) {
+		    		model = bloBService.findById(vo.getId());
+		        	model.setValue(data);
+		        	model.setSzd(vo.getSzd());
+		        	bloBService.update(model);
+		    	} else {
+		    		model.setValue(data);
+		        	model.setSzd(vo.getSzd());
+		        	bloBService.add(model);
+		    	}
+		    	//释放读取的文件流的自由
+		    	inputStream.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+	    	//删除文件
+	    	FileUtil.filedelete(webpath + "/"+fileName);
+    	}
+    	//设置参数返回值
+    	WebJsonResult jsonResult = new WebJsonResult();
+    	jsonResult.setAttr("zsnr",model.getId());
+    	jsonResult.setSuccess(true);
+    	return jsonResult;
+    }
+    
     /**
-     * 添加或修改证书
+     * 保存人员证书信息
      * @param vo
      * @return
      */
-    @RequestMapping("saveBlob")
+    @RequestMapping("saveRyzsInfo")
     @ResponseBody
-    public WebJsonResult saveBlob ( HttpServletRequest request,BloBVo vo) {
-    	String path = request.getSession().getServletContext().getRealPath("");
-    	
-    	// 创建一个通用的多部分解析器
-    	CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getSession()
-    	        .getServletContext());
-    	// 判断 request 是否有文件上传,即多部分请求
-    	if (multipartResolver.isMultipart(request)) {
-    		// 转换成多部分request
-    	    MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
-    	    // 取得request中的所有文件名
+    public WebJsonResult saveRyzsInfo (RyzsbVo vo) {
+    	RyzsbModel model = new RyzsbModel();
+    	if (vo.getId() != null && !"".equals(vo.getId())) {
+    		model = ryzsbService.findById(vo.getId());
+    		BeanUtils.copyProperties(vo,model);
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+    		try {
+				model.setYxq(sdf.parse(vo.getYxq()));
+			} catch (ParseException e) {
+				e.printStackTrace();
+			}
+    		ryzsbService.update(model);
+    	} else {
+    		BeanUtils.copyProperties(vo,model);
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+    		try {
+				model.setYxq(sdf.parse(vo.getYxq()));
+			} catch (ParseException e) {
+				e.printStackTrace();
+			}
+    		ryzsbService.add(model);
     	}
-    	String sys = "C:\\Users\\Administrator\\Desktop\\";
-    	InputStream inputStream;
-    	byte[] data = new byte[] {};
-		try {
-			inputStream = new FileInputStream(new File(sys+vo.getFile()));
-			data = inputStreamToByte(inputStream);
-		} catch (FileNotFoundException e1) {
-			e1.printStackTrace();
-		}catch (IOException e) {
-			e.printStackTrace();
-		}
-		//将文件保存到字节数组中
-    	if (StringUtils.isEmpty(vo.getId())) {
-    		//添加
-    		BloBModel model = new BloBModel();
-    		BeanUtils.copyProperties(vo, model);
-    		model.setValue(data);
-    		bloBService.add(model);
+    	
+    	//设置参数返回值
+    	WebJsonResult jsonResult = new WebJsonResult();
+    	jsonResult.setAttr("ssid",model.getId());
+    	jsonResult.setSuccess(true);
+    	return jsonResult;
+    }
+    /**
+     * 保存证书信息到附件表
+     * @param vo
+     * @return
+     */
+    @RequestMapping("saveFjInfo")
+    @ResponseBody
+    public WebJsonResult saveFjInfo (FjbVo vo) {
+    	FjbModel model = new FjbModel();
+    	if (vo.getId() != null && !"".equals(vo.getId())) {
+    		model = fjbService.findById(vo.getId());
+    		BeanUtils.copyProperties(vo,model);
+    		fjbService.update(model);
     	} else {
-    		//修改
-    		BloBModel model = bloBService.findById(vo.getId());
-    		BeanUtils.copyProperties(vo, model);
-    		bloBService.update(model);
+    		BeanUtils.copyProperties(vo,model);
+    		CodeModelDto codeModel = new CodeModelDto();
+    		codeModel.setPcode("FJSSLX");//父级类别
+    		codeModel.setCode("T_YJPT_JYRDRYZS");//所属类别
+    		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    		model.setSslx(list.get(0).getOptVal());
+    		fjbService.add(model);
     	}
+    	
     	return success();
     }
-    private byte [] inputStreamToByte(InputStream is) throws IOException {
-    	ByteArrayOutputStream bAOutputStream = new ByteArrayOutputStream();
-    	int ch;
-    	while((ch = is.read() ) != -1){
-    	bAOutputStream.write(ch);
+    /**
+     * 文件删除
+     * @param id
+     * @return
+     */
+    @RequestMapping("fileDel")
+    @ResponseBody
+    public WebJsonResult fileDel (String id,String fjid) {
+    	//获取人员证书表信息
+    	RyzsbModel model = ryzsbService.findById(id);
+    	//附件表信息
+    	FjbModel fjb = fjbService.findById(fjid);
+    	if(model != null && fjb != null) {
+    		fjb.setState("9");//修改附件表状态
+        	fjbService.update(fjb);//删除附件表信息
+        	model.setState("9");//修改人员证书状态
+        	ryzsbService.update(model);//删除人员证书信息
+    	} else {
+    		//设置参数返回值
+        	WebJsonResult jsonResult = new WebJsonResult();
+        	jsonResult.setMessage("您要删除的信息不存在,请刷新页面后再操作!");
+        	jsonResult.setSuccess(false);
+        	return jsonResult;
     	}
-    	byte data [] =bAOutputStream.toByteArray();
-    	bAOutputStream.close();
-    	return data;
+    	
+    	return success();
     }
    /**
      * 删除信息,可多条删除

+ 1 - 7
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/JyrWxhwtjcxCtl.java

@@ -40,13 +40,7 @@ public class JyrWxhwtjcxCtl extends BaseCtl {
     @RequestMapping("list")
     @ResponseBody
     public PageInfo<WxhwtjcxModel> list(WxhwtjcxVo vo) {
-		if (null == vo.getPage() || vo.getPage() < 1) {
-			vo.setPage(1);
-		}
-		if (null == vo.getRows() || vo.getRows() < 1) {
-			vo.setRows(1);
-		}
-		PageHelper.startPage(vo.getPage(), vo.getRows());
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
 		WxhwtjcxModel model = new WxhwtjcxModel();
 		BeanUtils.copyProperties(vo, model);
 		

+ 71 - 12
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/JyrjcxxCtl.java

@@ -1,5 +1,6 @@
 package com.xt.js.gkaq.web.ctl;
 
+import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.sql.Blob;
 import java.text.ParseException;
@@ -23,15 +24,24 @@ import com.sun.tools.corba.se.idl.constExpr.And;
 import com.xt.js.gkaq.common.BaseCtl;
 import com.xt.js.gkaq.common.BaseUUIDModel;
 import com.xt.js.gkaq.common.ExportExcel;
+import com.xt.js.gkaq.common.util.FileUtil;
 import com.xt.js.gkaq.dwxx.model.JyrInfoExcelModel;
 import com.xt.js.gkaq.dwxx.model.JyrjcxxInfol;
 import com.xt.js.gkaq.dwxx.model.JyrjcxxModel;
 import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.service.CodeService;
 import com.xt.js.gkaq.web.model.BloBModel;
+import com.xt.js.gkaq.web.model.FjbModel;
 import com.xt.js.gkaq.web.model.GqModel;
+import com.xt.js.gkaq.web.model.RyzsbModel;
+import com.xt.js.gkaq.web.service.BloBService;
+import com.xt.js.gkaq.web.service.FjbService;
 import com.xt.js.gkaq.web.service.GqService;
+import com.xt.js.gkaq.web.service.RyzsbService;
+import com.xt.js.gkaq.web.vo.BloBVo;
+import com.xt.js.gkaq.web.vo.FjbVo;
 import com.xt.js.gkaq.web.vo.JyrjcxxVo;
 import com.yuanxd.tools.pagehelper.PageHelper;
 import com.yuanxd.tools.pagehelper.PageInfo;
@@ -47,6 +57,12 @@ public class JyrjcxxCtl extends BaseCtl {
     private CodeService codeService;
     @Autowired
     private GqService gqService;
+    @Autowired
+    private FjbService fjbService;
+    @Autowired
+    private RyzsbService ryzsbService;
+    @Autowired
+    private BloBService bloBService;
 
     //    @RequiresPermissions("jyr:main")
     @RequestMapping("")
@@ -91,13 +107,7 @@ public class JyrjcxxCtl extends BaseCtl {
     @RequestMapping("list")
     @ResponseBody
     public PageInfo<JyrjcxxInfol> list(JyrjcxxVo vo) {
-		if (null == vo.getPage() || vo.getPage() < 1) {
-			vo.setPage(1);
-		}
-		if (null == vo.getRows() || vo.getRows() < 1) {
-			vo.setRows(1);
-		}
-		PageHelper.startPage(vo.getPage(), vo.getRows());
+    	PageHelper.startPage(vo.getcPage(), vo.getpSize());
 		JyrjcxxModel model = new JyrjcxxModel();
 		BeanUtils.copyProperties(vo, model);
 		List<JyrjcxxInfol> list = jyrjcxxService.selectList(model);
@@ -115,10 +125,27 @@ public class JyrjcxxCtl extends BaseCtl {
     	JyrjcxxModel model = new JyrjcxxModel();
     	model.setId(id);
     	List<JyrjcxxInfol> jyrjcxxModel = jyrjcxxService.selectList(model);
-    	request.setAttribute("jyr", jyrjcxxModel);
     	return JSONArray.toJSONString(jyrjcxxModel);
     } 
     /**
+     * 附件文件初始化
+     * @param ssid
+     * @return
+     */
+    @RequestMapping("jyrZsInit")
+    @ResponseBody
+    public String jyrZsInit (String ssid) {
+    	CodeModelDto codeModel = new CodeModelDto();
+		codeModel.setPcode("FJSSLX");//父级类别
+		codeModel.setCode("T_YJPT_JYRJCXX");//所属类别
+		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    	FjbModel model = new FjbModel();
+    	model.setSsid(ssid);
+    	model.setSslx(list.get(0).getOptVal());
+    	List<FjbModel> fjbList = fjbService.selectByInfo(model);
+    	return JSONArray.toJSONString(fjbList);
+    }
+    /**
      * 加载上级港口经营人信息
      * @param szd
      * @return
@@ -126,8 +153,10 @@ public class JyrjcxxCtl extends BaseCtl {
     @RequestMapping("getSelect")
     @ResponseBody
     public String getSelect (String szd) {
-    	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = jyrjcxxService.getSelect(szd);
-    	return JSONArray.toJSONString(list);
+    	JyrjcxxModel model = new JyrjcxxModel();
+    	model .setSzd(szd);
+    	List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> jyrlist = jyrjcxxService.getSelect(model);
+    	return JSONArray.toJSONString(jyrlist);
     }
     
     /**
@@ -159,9 +188,9 @@ public class JyrjcxxCtl extends BaseCtl {
     @RequestMapping("save")
     @ResponseBody
     public WebJsonResult save (JyrjcxxVo vo) throws ParseException {
+    	JyrjcxxModel model = new JyrjcxxModel();
     	if (StringUtils.isEmpty(vo.getId())) {
     		//添加
-    		JyrjcxxModel model = new JyrjcxxModel();
     		BeanUtils.copyProperties(vo, model);
     		model.setRecordCode("0");
     		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -172,10 +201,40 @@ public class JyrjcxxCtl extends BaseCtl {
     		jyrjcxxService.add(model);
     	} else {
     		//修改
-    		JyrjcxxModel model = jyrjcxxService.findById(vo.getId());
+    		model = jyrjcxxService.findById(vo.getId());
     		BeanUtils.copyProperties(vo, model);
     		jyrjcxxService.update(model);
     	}
+    	//设置参数返回值
+    	WebJsonResult jsonResult = new WebJsonResult();
+    	jsonResult.setAttr("ssid", model.getId());
+    	jsonResult.setSuccess(true);
+    	return jsonResult;
+    }
+  
+    /**
+     * 保存证书信息到附件表
+     * @param vo
+     * @return
+     */
+    @RequestMapping("saveFjInfo")
+    @ResponseBody
+    public WebJsonResult saveFjInfo (FjbVo vo) {
+    	FjbModel model = new FjbModel();
+    	if (vo.getId() != null && !"".equals(vo.getId())) {
+    		model = fjbService.findById(vo.getId());
+    		BeanUtils.copyProperties(vo,model);
+    		fjbService.update(model);
+    	} else {
+    		BeanUtils.copyProperties(vo,model);
+    		CodeModelDto codeModel = new CodeModelDto();
+    		codeModel.setPcode("FJSSLX");//父级类别
+    		codeModel.setCode("T_YJPT_JYRJCXX");//所属类别
+    		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    		model.setSslx(list.get(0).getOptVal());
+    		fjbService.add(model);
+    	}
+    	
     	return success();
     }
     

+ 74 - 20
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/ZdhqdCtl.java

@@ -1,6 +1,7 @@
 package com.xt.js.gkaq.web.ctl;
 
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -13,16 +14,19 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.alibaba.fastjson.JSONArray;
 import com.xt.js.gkaq.common.BaseCtl;
 import com.xt.js.gkaq.common.BaseUUIDModel;
-import com.xt.js.gkaq.dwxx.model.JyrjcxxInfol;
-import com.xt.js.gkaq.dwxx.model.JyrjcxxModel;
 import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.service.CodeService;
+import com.xt.js.gkaq.web.model.FjbModel;
 import com.xt.js.gkaq.web.model.GqModel;
 import com.xt.js.gkaq.web.model.zdhqdExtendModel;
 import com.xt.js.gkaq.web.model.zdhqdModel;
+import com.xt.js.gkaq.web.service.FjbService;
 import com.xt.js.gkaq.web.service.GqService;
+import com.xt.js.gkaq.web.service.RyzsbService;
 import com.xt.js.gkaq.web.service.ZdhqdService;
+import com.xt.js.gkaq.web.vo.FjbVo;
 import com.xt.js.gkaq.web.vo.ZdhqdExtendVo;
 import com.xt.js.gkaq.web.vo.ZdhqdVo;
 import com.yuanxd.tools.pagehelper.PageHelper;
@@ -36,11 +40,14 @@ public class ZdhqdCtl extends BaseCtl {
     @Autowired
     private ZdhqdService zdhqdService;
     @Autowired
-    private JyrjcxxService jyrjcxxService;
-    @Autowired
     private CodeService codeService;
     @Autowired
     private GqService gqService;
+    
+    @Autowired
+    private FjbService fjbService;
+    @Autowired
+    private RyzsbService ryzsbService;
 
     @RequestMapping("")
     public String main(HttpServletRequest request) {
@@ -94,14 +101,7 @@ public class ZdhqdCtl extends BaseCtl {
     @RequestMapping("list")
     @ResponseBody
     public PageInfo<zdhqdExtendModel> list(ZdhqdExtendVo vo) {
-		if (null == vo.getPage() || vo.getPage() < 1) {
-			vo.setPage(1);
-		}
-		if (null == vo.getRows() || vo.getRows() < 1) {
-			vo.setRows(1);
-		}
-		PageHelper.startPage(vo.getPage(), vo.getRows());
-		
+		PageHelper.startPage(vo.getcPage(), vo.getpSize());
 		zdhqdExtendModel model = new zdhqdExtendModel();
 		BeanUtils.copyProperties(vo, model);
 		
@@ -121,7 +121,24 @@ public class ZdhqdCtl extends BaseCtl {
     	zdhqdModel model = zdhqdService.findById(id);
     	return JSONArray.toJSONString(model);
     } 
-    
+    /**
+     * 附件文件初始化
+     * @param ssid
+     * @return
+     */
+    @RequestMapping("glzsZsInit")
+    @ResponseBody
+    public String glzsZsInit (String ssid) {
+    	CodeModelDto codeModel = new CodeModelDto();
+		codeModel.setPcode("FJSSLX");//父级类别
+		codeModel.setCode("T_YJPT_GLZD");//所属类别
+		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    	FjbModel model = new FjbModel();
+    	model.setSsid(ssid);
+    	model.setSslx(list.get(0).getOptVal());
+    	List<FjbModel> fjbList = fjbService.selectByInfo(model);
+    	return JSONArray.toJSONString(fjbList);
+    }
     /**
      * 添加或修改
      * @param vo
@@ -131,29 +148,66 @@ public class ZdhqdCtl extends BaseCtl {
     @RequestMapping("save")
     @ResponseBody
     public WebJsonResult save (ZdhqdVo vo) throws ParseException {
+		zdhqdModel model = new zdhqdModel();
     	if (StringUtils.isEmpty(vo.getId())) {
-    		//添加
-    		zdhqdModel model = new zdhqdModel();
+        	//添加    		
     		BeanUtils.copyProperties(vo, model);
-    	
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+    		BeanUtils.copyProperties(vo, model);
+    		model.setFbrq(sdf.parse(vo.getFbrq()));
+    		model.setXdrq(sdf.parse(vo.getXdrq()));
+    		model.setTxsj(sdf.parse(vo.getTxsj()));
     		zdhqdService.add(model);
     	} else {
     		//修改
-    		zdhqdModel model = zdhqdService.findById(vo.getId());
+    		model = zdhqdService.findById(vo.getId());
+    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
     		BeanUtils.copyProperties(vo, model);
+    		model.setFbrq(sdf.parse(vo.getFbrq()));
+    		model.setXdrq(sdf.parse(vo.getXdrq()));
+    		model.setTxsj(sdf.parse(vo.getTxsj()));
     		zdhqdService.update(model);
     	}
+    	//设置参数返回值
+    	WebJsonResult jsonResult = new WebJsonResult();
+    	jsonResult.setAttr("ssid", model.getId());
+    	jsonResult.setSuccess(true);
+    	return jsonResult;
+    }
+    /**
+     * 保存证书信息到附件表
+     * @param vo
+     * @return
+     */
+    @RequestMapping("saveFjInfo")
+    @ResponseBody
+    public WebJsonResult saveFjInfo (FjbVo vo) {
+    	FjbModel model = new FjbModel();
+    	if (vo.getId() != null && !"".equals(vo.getId())) {
+    		model = fjbService.findById(vo.getId());
+    		BeanUtils.copyProperties(vo,model);
+    		fjbService.update(model);
+    	} else {
+    		BeanUtils.copyProperties(vo,model);
+    		CodeModelDto codeModel = new CodeModelDto();
+    		codeModel.setPcode("FJSSLX");//父级类别
+    		codeModel.setCode("T_YJPT_GLZD");//所属类别
+    		List<com.xt.js.gkaq.dwxx.model.ComboBoxDto> list = ryzsbService.selectCode(codeModel);
+    		model.setSslx(list.get(0).getOptVal());
+    		fjbService.add(model);
+    	}
+    	
     	return success();
     }
-    
+  
     /**
      * 删除信息,可多条删除
      * @param ids
      * @return
      */
-    @RequestMapping("delJyrInfo")
+    @RequestMapping("delglzdInfo")
     @ResponseBody
-    public WebJsonResult delJyrInfo (String ids) {
+    public WebJsonResult delGlzdInfo (String ids) {
     	String[] idArray = ids.split(",");
     	if (idArray != null && idArray.length > 0 ) {
     		for (String id : idArray) {