|
@@ -1,26 +1,35 @@
|
|
package com.xt.js.gkaq.web.ctl;
|
|
package com.xt.js.gkaq.web.ctl;
|
|
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
+import java.sql.Blob;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.sun.tools.corba.se.idl.constExpr.And;
|
|
import com.xt.js.gkaq.common.BaseCtl;
|
|
import com.xt.js.gkaq.common.BaseCtl;
|
|
import com.xt.js.gkaq.common.BaseUUIDModel;
|
|
import com.xt.js.gkaq.common.BaseUUIDModel;
|
|
|
|
+import com.xt.js.gkaq.common.ExportExcel;
|
|
|
|
+import com.xt.js.gkaq.dwxx.model.JyrInfoExcelModel;
|
|
import com.xt.js.gkaq.dwxx.model.JyrjcxxInfol;
|
|
import com.xt.js.gkaq.dwxx.model.JyrjcxxInfol;
|
|
import com.xt.js.gkaq.dwxx.model.JyrjcxxModel;
|
|
import com.xt.js.gkaq.dwxx.model.JyrjcxxModel;
|
|
import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
|
|
import com.xt.js.gkaq.dwxx.service.JyrjcxxService;
|
|
import com.xt.js.gkaq.frame.model.ComboBoxDto;
|
|
import com.xt.js.gkaq.frame.model.ComboBoxDto;
|
|
import com.xt.js.gkaq.frame.service.CodeService;
|
|
import com.xt.js.gkaq.frame.service.CodeService;
|
|
-import com.xt.js.gkaq.dwxx.model.*;
|
|
|
|
|
|
+import com.xt.js.gkaq.web.model.BloBModel;
|
|
import com.xt.js.gkaq.web.model.GqModel;
|
|
import com.xt.js.gkaq.web.model.GqModel;
|
|
import com.xt.js.gkaq.web.service.GqService;
|
|
import com.xt.js.gkaq.web.service.GqService;
|
|
import com.xt.js.gkaq.web.vo.JyrjcxxVo;
|
|
import com.xt.js.gkaq.web.vo.JyrjcxxVo;
|
|
@@ -42,24 +51,24 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
// @RequiresPermissions("jyr:main")
|
|
// @RequiresPermissions("jyr:main")
|
|
@RequestMapping("")
|
|
@RequestMapping("")
|
|
public String main(HttpServletRequest request) {
|
|
public String main(HttpServletRequest request) {
|
|
- //鍔犺浇鎵€鍦ㄥ湴
|
|
|
|
|
|
+ //加载所在地
|
|
List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
|
|
List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
|
|
request.setAttribute("code", list);
|
|
request.setAttribute("code", list);
|
|
return "dwxx/jyr/main";
|
|
return "dwxx/jyr/main";
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 鍔犺浇鎵€鍦ㄥ湴
|
|
|
|
|
|
+ * 加载所在地
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("getszd")
|
|
@RequestMapping("getszd")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String getszd() {
|
|
public String getszd() {
|
|
- //鍔犺浇鎵€鍦ㄥ湴
|
|
|
|
|
|
+ //加载所在地
|
|
List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
|
|
List<ComboBoxDto> list = codeService.findByPcode("DM_SZD");
|
|
return JSONArray.toJSONString(list);
|
|
return JSONArray.toJSONString(list);
|
|
}
|
|
}
|
|
/***
|
|
/***
|
|
- * 鍔ㄦ€佸叧鑱斾笅鎷夋�鏁版嵁
|
|
|
|
|
|
+ * 动态关联下拉框数据
|
|
* @param request
|
|
* @param request
|
|
* @param szd
|
|
* @param szd
|
|
* @return
|
|
* @return
|
|
@@ -70,12 +79,12 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
// model.setSzd("");
|
|
// model.setSzd("");
|
|
GqModel model = new GqModel();
|
|
GqModel model = new GqModel();
|
|
model.setSzd(szd);
|
|
model.setSzd(szd);
|
|
- //鑾峰彇娓�尯
|
|
|
|
|
|
+ //获取港区
|
|
List<ComboBoxDto> gqlist = gqService.selectByInfo(model);
|
|
List<ComboBoxDto> gqlist = gqService.selectByInfo(model);
|
|
return JSONArray.toJSONString(gqlist);
|
|
return JSONArray.toJSONString(gqlist);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 鏁版嵁琛ㄦ牸
|
|
|
|
|
|
+ * 数据表格
|
|
* @param vo
|
|
* @param vo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -97,7 +106,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 缂栬緫璇︽儏
|
|
|
|
|
|
+ * 编辑详情
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("initEdit")
|
|
@RequestMapping("initEdit")
|
|
@@ -110,7 +119,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
return JSONArray.toJSONString(jyrjcxxModel);
|
|
return JSONArray.toJSONString(jyrjcxxModel);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 鍔犺浇涓婄骇娓�彛缁忚惀浜轰俊鎭�
|
|
|
|
|
|
+ * 加载上级港口经营人信息
|
|
* @param szd
|
|
* @param szd
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -122,7 +131,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鍔犺浇鎵€灞炶�涓氬ぇ绫�
|
|
|
|
|
|
+ * 加载所属行业大类
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("gethydl")
|
|
@RequestMapping("gethydl")
|
|
@@ -132,7 +141,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
return JSONArray.toJSONString(list);
|
|
return JSONArray.toJSONString(list);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 鍔犺浇鎵€灞炶�涓氫腑绫�
|
|
|
|
|
|
+ * 加载所属行业中类
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping("gethyz")
|
|
@RequestMapping("gethyz")
|
|
@@ -142,7 +151,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
return JSONArray.toJSONString(list);
|
|
return JSONArray.toJSONString(list);
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
- * 娣诲姞鎴栦慨鏀�
|
|
|
|
|
|
+ * 添加或修改
|
|
* @param vo
|
|
* @param vo
|
|
* @return
|
|
* @return
|
|
* @throws ParseException
|
|
* @throws ParseException
|
|
@@ -151,7 +160,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public WebJsonResult save (JyrjcxxVo vo) throws ParseException {
|
|
public WebJsonResult save (JyrjcxxVo vo) throws ParseException {
|
|
if (StringUtils.isEmpty(vo.getId())) {
|
|
if (StringUtils.isEmpty(vo.getId())) {
|
|
- //娣诲姞
|
|
|
|
|
|
+ //添加
|
|
JyrjcxxModel model = new JyrjcxxModel();
|
|
JyrjcxxModel model = new JyrjcxxModel();
|
|
BeanUtils.copyProperties(vo, model);
|
|
BeanUtils.copyProperties(vo, model);
|
|
model.setRecordCode("0");
|
|
model.setRecordCode("0");
|
|
@@ -162,7 +171,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
model.setBayxq(sdf.parse(vo.getBayxq()));
|
|
model.setBayxq(sdf.parse(vo.getBayxq()));
|
|
jyrjcxxService.add(model);
|
|
jyrjcxxService.add(model);
|
|
} else {
|
|
} else {
|
|
- //淇�敼
|
|
|
|
|
|
+ //修改
|
|
JyrjcxxModel model = jyrjcxxService.findById(vo.getId());
|
|
JyrjcxxModel model = jyrjcxxService.findById(vo.getId());
|
|
BeanUtils.copyProperties(vo, model);
|
|
BeanUtils.copyProperties(vo, model);
|
|
jyrjcxxService.update(model);
|
|
jyrjcxxService.update(model);
|
|
@@ -171,7 +180,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鍒犻櫎淇℃伅锛屽彲澶氭潯鍒犻櫎
|
|
|
|
|
|
+ * 删除信息,可多条删除
|
|
* @param ids
|
|
* @param ids
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -181,7 +190,7 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
String[] idArray = ids.split(",");
|
|
String[] idArray = ids.split(",");
|
|
if (idArray != null && idArray.length > 0 ) {
|
|
if (idArray != null && idArray.length > 0 ) {
|
|
for (String id : idArray) {
|
|
for (String id : idArray) {
|
|
- //淇�敼
|
|
|
|
|
|
+ //修改
|
|
JyrjcxxModel model = jyrjcxxService.findById(id);
|
|
JyrjcxxModel model = jyrjcxxService.findById(id);
|
|
model.setState(BaseUUIDModel.STATE_DELETE);
|
|
model.setState(BaseUUIDModel.STATE_DELETE);
|
|
jyrjcxxService.update(model);
|
|
jyrjcxxService.update(model);
|
|
@@ -189,4 +198,42 @@ public class JyrjcxxCtl extends BaseCtl {
|
|
}
|
|
}
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 导出
|
|
|
|
+ * @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);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|