Ver Fonte

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

ld_zhangdong há 8 anos atrás
pai
commit
423c12e64a
22 ficheiros alterados com 1848 adições e 92 exclusões
  1. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IBwxxService.java
  2. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ICgxxService.java
  3. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ICkxxService.java
  4. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IDcxxService.java
  5. 6 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IJyrjbxxService.java
  6. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IMtxxService.java
  7. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IQytzxxService.java
  8. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IRyService.java
  9. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IRyzsService.java
  10. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ISssbxxService.java
  11. 4 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IZxjxxxService.java
  12. 249 8
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/BwxxService.java
  13. 228 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/CgxxService.java
  14. 202 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/CkxxService.java
  15. 183 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/DcxxService.java
  16. 161 36
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/JyrjbxxService.java
  17. 159 15
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/MtxxService.java
  18. 122 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/QytzxxService.java
  19. 130 9
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/RyWService.java
  20. 83 0
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/RyzsWService.java
  21. 128 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/SssbxxService.java
  22. 157 4
      gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/ZxjxxxService.java

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IBwxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.BwEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "bwWebServicePort", serviceName = "bwWebService")
 public interface IBwxxService {
 	@WebMethod(operationName = "findBw",action="http://service.web.jsjty.com/findBw")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findBw(int pages, int rows,String szdid,String szgkid,String szgqid,String ssjyr,String bwmc,String wxpbwid,String sfdwkfid,String fwlxid,String bwbwyt);
 	public String findOne(String id);
+	public String save(String path, BwEntity code, String bwszhdid, String szdid, String szgkid, String szgqid, String ssjyrid, String ssmtid, String bwsxid, String fwlxid, String wxpbwid, String zyhbwflid, String sffzid, String sfdwkfid, String bwszsxid, String sclxid, String jgxsid, String sszyqid, String zlsid, String xpid, String kbcblxid, String sfwygkghaxnid, String abid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ICgxxService.java

@@ -3,10 +3,14 @@ package com.cxfws.jyrxxgl.service;
 import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
+
+import com.xt.jygl.gkjygl.gkjyr.jyrcg.entity.CgEntity;
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "cgWebServicePort", serviceName = "cgWebService")
 public interface ICgxxService {
 	@WebMethod(operationName = "findCg",action="http://service.web.jsjty.com/findCg")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findCg(int pages, int rows,String szdid,String szgkid,String szgqid,String cgmc,String ssjyr);
 	public String findOne(String id);
+	public String save(String path, CgEntity code, String cgazxsid, String wzztid, String jlfsid, String clfsid, String szdid, String szgkid, String szgqid, String ssjyrid, String cgxsid, String cgwxid, String cgczid, String wxydjid, String ywfhdid, String sfwxpcgid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ICkxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrck.entity.CkEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "ckWebServicePort", serviceName = "ckWebService")
 public interface ICkxxService {
 	@WebMethod(operationName = "findCk",action="http://service.web.jsjty.com/findCk")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findCk(int pages, int rows,String szdid,String szgkid,String szgqid,String ssmt,String ckmc,String ssjyr,String wxpckid);
 	public String findOne(String id);
+	public String save(String path, CkEntity code, String szdid, String szgkid, String szgqid, String ssmtid, String ssjyrid, String wxpckid,String ckszzyqid,String ckssbwid,String cklxid,String kcsclxid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IDcxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrdc.entity.DcEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "dcWebServicePort", serviceName = "dcWebService")
 public interface IDcxxService {
 	@WebMethod(operationName = "findDc",action="http://service.web.jsjty.com/findDc")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findDc(int pages, int rows,String szdid,String szgkid,String szgqid,String ssjyr,String dcmc,String wxpdcid);
 	public String findOne(String id);
+	public String save(String path, DcEntity code, String szdid, String szgkid, String szgqid, String ssmtid, String ssjyrid, String wxpdcid, String dcsclxid);
+	public String delete(String id, String czid);
 }

+ 6 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IJyrjbxxService.java

@@ -4,10 +4,16 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "jyrWebServicePort", serviceName = "jyrWebService")
 public interface IJyrjbxxService {
 	@WebMethod(operationName = "findJyr",action="http://service.web.jsjty.com/findJyr")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findJyr(int pages, int rows,String szdid,String szgkid,String szgqid,String bwyt,String whfzbh,String qyxz,String sfcswhzy,String sfcyxkz, String gkjyr,String gkjyxkzh,String fddbr,String xkzstartDate,String xkzendDate,String fzstartDate,String fzendDate,String jyrxkzsfdq);
 	public String findOne(String id);
+	//新增和修改
+	public String save(String iFlag, GkjyrEntity gkjyrEntity, String szdid, String szgkid, String szgqid, String sfwhqyid, String xzqhid, String sfzdspid, String ywcqzmid, String ywjgysid, String jyrmtjgxsid, String qyxzid);
+	//逻辑删除
+	public String delete(String id);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IMtxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjcxx.mt.entity.MtEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "mtWebServicePort", serviceName = "mtWebService")
 public interface IMtxxService {
 	@WebMethod(operationName = "findMt",action="http://service.web.jsjty.com/findMt")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findMt(int pages, int rows,String szdid,String szgkid,String szgqid,String mtmc,String jyr,String sfdwkfid,String sfwhpid,String fwlxid,String mtyt);
 	public String findOne(String id);
+	public String save(String path, MtEntity code, String szdid, String szgkid, String szgqid, String ssjyrid, String sfdwkfid, String sfwhpid, String mtsfwarsid, String fwlxid, String mtytid, String mtjgxsid, String szzyqid, String szaxid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IQytzxxService.java

@@ -3,10 +3,14 @@ package com.cxfws.jyrxxgl.service;
 import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
+
+import com.xt.jygl.gkjygl.gkjyr.qytz.entity.QytzEntity;
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "qytzWebServicePort", serviceName = "qytzWebService")
 public interface IQytzxxService {
 	@WebMethod(operationName = "findQytz",action="http://service.web.jsjty.com/findQytz")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findQytz(int pages, int rows,String szdid,String szgkid,String szgqid,String jyr,String tzrmc);
 	public String findOne(String id);
+	public String save(String path, QytzEntity code, String jyrid, String sfwsid, String jjlxid, String szdid, String szgkid, String szgqid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IRyService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "ryWebServicePort", serviceName = "ryWebService")
 public interface IRyService {
 	@WebMethod(operationName = "findRy",action="http://service.web.jsjty.com/findRy")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findRy(int pages, int rows, String xm,  String szgkid,  String szgqid,  String jyr,  String szdid,  String rylxid);
 	public String findOne(String id);
+	public String save(String path, RyEntity code, String[] zsids, String szdid, String szgkid, String szgqid, String xbid, String ssjyrid, String rylxid, String zjlxid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IRyzsService.java

@@ -4,9 +4,13 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyzsEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "ryzsWebServicePort", serviceName = "ryzsWebService")
 public interface IRyzsService {
 	@WebMethod(operationName = "findRyzs",action="http://service.web.jsjty.com/findRyzs")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findRyzs(String ryid);
+	public String save(RyzsEntity code, String sfzh);
+	public String delete(String id);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/ISssbxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.sssb.entity.SssbEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "sssbWebServicePort", serviceName = "sssbWebService")
 public interface ISssbxxService {
 	@WebMethod(operationName = "findSssb",action="http://service.web.jsjty.com/findSssb")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findSssb(int pages, int rows,String szdid,String szgkid,String szgqid,String jyr,String ssmc);
 	public String findOne(String id);
+	public String save(String path, SssbEntity code, String szdid, String szgkid, String szgqid, String ssjyrid, String sldwid, String yjflid, String ejflid, String sbszzyqid);
+	public String delete(String id, String czid);
 }

+ 4 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/IZxjxxxService.java

@@ -4,10 +4,14 @@ import javax.jws.WebMethod;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import com.xt.jygl.gkjygl.gkjyr.zxjx.entity.ZxjxEntity;
+
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "zxjxWebServicePort", serviceName = "zxjxWebService")
 public interface IZxjxxxService {
 	@WebMethod(operationName = "findZxjx",action="http://service.web.jsjty.com/findZxjx")
 	@WebResult(name = "result",targetNamespace = "http://service.web.jsjty.com/")
 	public String findZxjx(int pages, int rows,String szdid,String szgkid,String szgqid,String jyr,String jxlbmcid);
 	public String findOne(String id);
+	public String save(String path, ZxjxEntity code, String jyrid, String szdid, String szgkid, String szgqid,String szzyqid,String jxlbmcid,String syqid);
+	public String delete(String id, String czid);
 }

+ 249 - 8
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/BwxxService.java

@@ -14,8 +14,6 @@ import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import javax.xml.ws.WebServiceContext;
 
-import net.sf.json.JSONArray;
-
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -25,14 +23,21 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.IBwxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
-import com.xt.jygl.gkjcxx.gk.service.GkService;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjcxx.mt.entity.MtEntity;
+import com.xt.jygl.gkjcxx.zyq.entity.ZyqEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrbw.client.BwWebService;
 import com.xt.jygl.gkjygl.gkjyr.jyrbw.service.BwService;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.BwEntity;
-import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.BwVo;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
 import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
 import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
@@ -40,6 +45,8 @@ import com.xtframe.sec.common.SimplePageRequest;
 import com.xtframe.sec.user.dao.UserDao;
 import com.xtframe.sec.user.entity.UserEntity;
 import com.xtframe.util.StringUtils;
+
+import net.sf.json.JSONArray;
 /**
  * 泊位信息
  *
@@ -52,12 +59,8 @@ public class BwxxService extends BaseWebCtl implements IBwxxService{
 	@Autowired
 	private BwService bwService;
 	@Autowired
-	private GkService gkService;
-	@Autowired
 	private GqService gqService;
 	@Autowired
-	private GkjyrService gkjyrService;
-	@Autowired
 	private XkzglbService xkzglbService;
 	@Resource
 	private WebServiceContext wscontext;
@@ -280,4 +283,242 @@ public class BwxxService extends BaseWebCtl implements IBwxxService{
 		return jsons.toString();
 	}
 
+	@Override
+	public String save(String path, BwEntity code, String bwszhdid, String szdid, String szgkid, String szgqid, String ssjyrid, String ssmtid, String bwsxid, String fwlxid, String wxpbwid, String zyhbwflid, String sffzid, String sfdwkfid, String bwszsxid, String sclxid, String jgxsid, String sszyqid, String zlsid, String xpid, String kbcblxid, String sfwygkghaxnid, String abid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssjyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssmtid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属码头");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(sffzid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择是否取得港口设施保安证书");
+		}
+		BwEntity entity = new BwEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {// 修改
+				entity = bwService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setBwcd(code.getBwcd());
+			entity.setBwmc(code.getBwmc());
+			if (code.getBwyt() != null && code.getBwyt().startsWith(",")) {
+				entity.setBwyt(code.getBwyt().substring(1));
+			} else {
+				entity.setBwyt(code.getBwyt());
+			}
+			entity.setHckpnl(code.getHckpnl());
+			entity.setJd(code.getJd());
+			entity.setJgysnf(code.getJgysnf());
+			entity.setJtjgisdyidh(code.getJtjgisdyidh());
+			entity.setNwxhwttl(code.getNwxhwttl());
+			entity.setQysjsh(code.getQysjsh());
+			entity.setQysjss(code.getQysjss());
+			entity.setSjkpnl(code.getSjkpnl());
+			entity.setSjtgnl(code.getSjtgnl());
+			entity.setTcnf(code.getTcnf());
+			entity.setWd(code.getWd());
+			entity.setZyrkfw(code.getZyrkfw());
+			entity.setJgxs(code.getJgxs());
+			entity.setDtsj(code.getDtsj());
+			entity.setBwdm(code.getBwdm());
+			entity.setJgxs(code.getJgxs());
+			entity.setHcnlxztj(code.getHcnlxztj());
+			entity.setNhwtgnl(code.getNhwtgnl());
+			entity.setHwgs(code.getHwgs());
+			entity.setHwhc(code.getHwhc());
+			entity.setNjzxtgnl(code.getNjzxtgnl());
+			entity.setJzxhc(code.getJzxhc());
+			entity.setJzxgs(code.getJzxhc());
+			entity.setGzsj(code.getGzsj());
+			entity.setGzhc(code.getGzhc());
+			entity.setGzgs(code.getGzgs());
+			entity.setLksj(code.getLksj());
+			entity.setLkhc(code.getLkhc());
+			entity.setLkgs(code.getLkgs());
+			entity.setBwgs(code.getBwgs());
+			entity.setBz(code.getBz());
+			entity.setZyid(code.getZyid());
+			entity.setBwbh(code.getBwbh());
+			entity.setBwdm(code.getBwdm());
+
+			entity.setGkaxsyzh(code.getGkaxsyzh());
+
+			if (!StringUtils.isEmpty(sfwygkghaxnid)) {
+				CodeEntity sfwygkghaxn = new CodeEntity();
+				sfwygkghaxn.setId(sfwygkghaxnid);
+				entity.setSfwygkghaxn(sfwygkghaxn);
+			}
+
+			if (!StringUtils.isEmpty(abid)) {
+				CodeEntity ab = new CodeEntity();
+				ab.setId(abid);
+				entity.setAb(ab);
+			}
+
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+			MtEntity ssmt = new MtEntity();
+			ssmt.setId(ssmtid);
+			entity.setSsmt(ssmt);
+
+			if (!StringUtils.isEmpty(sffzid)) {
+				CodeEntity sffz = new CodeEntity(sffzid);
+				entity.setSffz(sffz);
+			}
+			if (!StringUtils.isEmpty(sfdwkfid)) {
+				CodeEntity sfdwkf = new CodeEntity(sfdwkfid);
+				entity.setSfdwkf(sfdwkf);
+			}
+
+			if (!StringUtils.isEmpty(zyhbwflid)) {
+				CodeEntity zyhbwfl = new CodeEntity(zyhbwflid);
+				entity.setZyhbwfl(zyhbwfl);
+			}
+			if (!StringUtils.isEmpty(fwlxid)) {
+				CodeEntity fwlx = new CodeEntity(fwlxid);
+				entity.setFwlx(fwlx);
+			}
+			if (!StringUtils.isEmpty(wxpbwid)) {
+				CodeEntity wxpbw = new CodeEntity(wxpbwid);
+				entity.setWxpbw(wxpbw);
+			}
+			if (!StringUtils.isEmpty(bwsxid)) {
+				CodeEntity bwsx = new CodeEntity(bwsxid);
+				entity.setBwsx(bwsx);
+			}
+			if (!StringUtils.isEmpty(bwszsxid)) {
+				CodeEntity bwszsx = new CodeEntity(bwszsxid);
+				entity.setBwszsx(bwszsx);
+			}
+			if (!StringUtils.isEmpty(sclxid)) {
+				CodeEntity sclx = new CodeEntity(sclxid);
+				entity.setSclx(sclx);
+			}
+			if (!StringUtils.isEmpty(jgxsid)) {
+				CodeEntity jgxs = new CodeEntity(jgxsid);
+				entity.setJgxs(jgxs);
+			}
+
+			if (!StringUtils.isEmpty(sszyqid)) {
+				ZyqEntity zyq = new ZyqEntity();
+				zyq.setId(sszyqid);
+				entity.setSszyq(zyq);
+			}
+			if (!StringUtils.isEmpty(zlsid)) {
+				CodeEntity zls = new CodeEntity(zlsid);
+				entity.setZls(zls);
+			}
+			if (!StringUtils.isEmpty(xpid)) {
+				CodeEntity xp = new CodeEntity(xpid);
+				entity.setXp(xp);
+				;
+			}
+			if (!StringUtils.isEmpty(bwszhdid)) {
+				CodeEntity bwszhd = new CodeEntity(bwszhdid);
+				entity.setBwszhd(bwszhd);
+			}
+			if (!StringUtils.isEmpty(kbcblxid)) {
+				CodeEntity kbcblx = new CodeEntity(kbcblxid);
+				entity.setKbcblx(kbcblx);
+			}
+
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			bwService.save(entity);
+			wr.setAttr("entity", entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+
+	@Override
+	public String delete(String id, String czid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			bwService.logicDelete(id);
+			// 如果是市级删除,省级也删除
+			BwEntity bw = bwService.findOne(id);
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+					BwWebService webService = bwService.getWebService(null);
+					webService.delete(id);
+					bw.setTbzt(Constants.YES);
+					bwService.save(bw);
+				}
+			} catch (Exception e) {
+				bw.setTbzt(Constants.NO);
+				bwService.save(bw);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+
 }

+ 228 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/CgxxService.java

@@ -27,11 +27,20 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.ICgxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjygl.gkjyr.jyrcg.client.CgWebService;
 import com.xt.jygl.gkjygl.gkjyr.jyrcg.entity.CgEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrcg.service.CgService;
 import com.xt.jygl.gkjygl.gkjyr.jyrcg.vo.CgVo;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -54,6 +63,8 @@ public class CgxxService extends BaseWebCtl implements ICgxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 储罐信息列表
 	 */
@@ -108,10 +119,6 @@ public class CgxxService extends BaseWebCtl implements ICgxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -182,4 +189,221 @@ public class CgxxService extends BaseWebCtl implements ICgxxService{
 			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 			return sdf.format(d);
 		}
+		@Override
+		public String save(String path, CgEntity code, String cgazxsid, String wzztid, String jlfsid, String clfsid, String szdid, String szgkid, String szgqid, String ssjyrid, String cgxsid, String cgwxid, String cgczid, String wxydjid, String ywfhdid, String sfwxpcgid) {
+
+			WebJsonResult wr = success();
+			if (!this.checkUser()){
+				wr.setSuccess(false);
+				wr.setMessage(BaseWebCtl.NOLOGIN);
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(szdid)) {
+				wr.setSuccess(false);
+				wr.setMessage("请选择所在地!");
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(szgkid)) {
+				wr.setSuccess(false);
+				wr.setMessage("请选择所在港口!");
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(szgqid)) {
+				wr.setSuccess(false);
+				wr.setMessage("请选择所在港区!");
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(ssjyrid)) {
+				wr.setSuccess(false);
+				wr.setMessage("请选择所属经营人!");
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(code.getCgmc())) {
+				wr.setSuccess(false);
+				wr.setMessage("请输入储罐名称!");
+				return Object2JsonStr(wr);
+			}
+			CgEntity entity = new CgEntity();
+			try {
+				if (!StringUtils.isEmpty(code.getId())) {
+					entity = cgService.findOne(code.getId());
+					entity.setTbzt(Constants.NO);
+				}
+				entity.setAqgd(code.getAqgd());
+				entity.setBdzzsl(code.getBdzzsl());
+				entity.setBdzzsm(code.getBdzzsm());
+				entity.setCccscq(code.getCccscq());
+				entity.setCchxppzsl(code.getCchxppzsl());
+				entity.setCgazxs(code.getCgazxs());
+				entity.setCggs(code.getCggs());
+				entity.setCgmc(code.getCgmc());
+				entity.setCgqmc(code.getCgqmc());
+				entity.setCgqmj(code.getCgqmj());
+				entity.setCgrj(code.getCgrj());
+				entity.setCgxh(code.getCgxh());
+				entity.setCgzb(code.getCgzb());
+				entity.setClfs(code.getClfs());
+				entity.setFjdsssfnjjzs(code.getFjdsssfnjjzs());
+				entity.setGjzxjl(code.getGjzxjl());
+				entity.setGkzdwxybabh(code.getGkzdwxybabh());
+				entity.setGkzdwxybh(code.getGkzdwxybh());
+				entity.setHxpmc(code.getHxpmc());
+				entity.setHxppz(code.getHxppz());
+				entity.setHxpsl(code.getHxpsl());
+				entity.setHysl(code.getHysl());
+				entity.setHysm(code.getHysm());
+				entity.setJlfs(code.getJlfs());
+				entity.setJtwz(code.getJtwz());
+				entity.setLxdh(code.getLxdh());
+				entity.setMapid(code.getMapid());
+				entity.setQtsl(code.getQtsl());
+				entity.setQtsm(code.getQtsm());
+				entity.setQyccbh(code.getQyccbh());
+				entity.setScjyhdlx(code.getScjyhdlx());
+				entity.setSjgzwd(code.getSjgzwd());
+				entity.setSjgzyl(code.getSjgzyl());
+				entity.setSjsynx(code.getSjsynx());
+				entity.setSjwd(code.getSjwd());
+				entity.setSjyl(code.getSjyl());
+				entity.setTbr(code.getTbr());
+				entity.setTbsj(code.getTbsj());
+				entity.setTcsj(code.getTcsj());
+				entity.setWhzyfzbh(code.getWhzyfzbh());
+				entity.setWzzt(code.getWzzt());
+				entity.setZdwxycggs(code.getZdwxycggs());
+				entity.setZdwxycgrl(code.getZdwxycgrl());
+				entity.setZj(code.getZj());
+				entity.setZsbh(code.getZsbh());
+				entity.setZxgyjzysb(code.getZxgyjzysb());
+				entity.setYgrj(code.getYgrj());
+				entity.setYgrl(code.getYgrl());
+				entity.setYtcrj(code.getYtcrj());
+				entity.setYthgcgrj(code.getYthgcgrj());
+				entity.setLstcrj(code.getLstcrj());
+				entity.setSntcrj(code.getSntcrj());
+				entity.setQtscyckrj(code.getQtscyckrj());
+				
+				entity.setCglx(code.getCglx());
+				entity.setBz(code.getBz());
+
+				CodeEntity szd = new CodeEntity(szdid);
+				entity.setSzd(szd);
+
+				GkEntity szgk = new GkEntity();
+				szgk.setId(szgkid);
+				entity.setSzgk(szgk);
+
+				GqEntity szgq = new GqEntity();
+				szgq.setId(szgqid);
+				entity.setSzgq(szgq);
+
+				GkjyrEntity ssjyr = new GkjyrEntity();
+				ssjyr.setId(ssjyrid);
+				entity.setSsjyr(ssjyr);
+
+				GqEntity gq = gqService.findOne(szgqid);
+				entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+				if (!StringUtils.isEmpty(cgxsid)) {
+					CodeEntity cgxs = new CodeEntity(cgxsid);
+					entity.setCgxs(cgxs);
+				}
+
+				if (!StringUtils.isEmpty(cgwxid)) {
+					CodeEntity cgwx = new CodeEntity(cgwxid);
+					entity.setCgwx(cgwx);
+				}
+
+				if (!StringUtils.isEmpty(cgczid)) {
+					CodeEntity cgcz = new CodeEntity(cgczid);
+					entity.setCgcz(cgcz);
+				}
+
+				if (!StringUtils.isEmpty(wxydjid)) {
+					CodeEntity wxydj = new CodeEntity(wxydjid);
+					entity.setWxydj(wxydj);
+				}
+
+				if (!StringUtils.isEmpty(ywfhdid)) {
+					CodeEntity ywfhd = new CodeEntity(ywfhdid);
+					entity.setYwfhd(ywfhd);
+				}
+
+				if (!StringUtils.isEmpty(cgazxsid)) {
+					CodeEntity cgazxs = new CodeEntity(cgazxsid);
+					entity.setCgazxs(cgazxs);
+				}
+
+				if (!StringUtils.isEmpty(wzztid)) {
+					CodeEntity wzzt = new CodeEntity(wzztid);
+					entity.setWzzt(wzzt);
+				}
+
+				if (!StringUtils.isEmpty(jlfsid)) {
+					CodeEntity jlfs = new CodeEntity(jlfsid);
+					entity.setJlfs(jlfs);
+				}
+
+				if (!StringUtils.isEmpty(clfsid)) {
+					CodeEntity clfs = new CodeEntity(clfsid);
+					entity.setClfs(clfs);
+				}
+
+				if (!StringUtils.isEmpty(sfwxpcgid)) {
+					CodeEntity sfwxpcg = new CodeEntity(sfwxpcgid);
+					entity.setSfwxpcg(sfwxpcg);
+				}
+				if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+					if (path.indexOf("add") > 0) {
+						entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+					} else {
+						entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+					}
+				}
+				cgService.save(entity);
+				wr.setAttr("entity", entity);
+			} catch (Exception e) {
+				wr.setSuccess(false);
+				wr.setMessage("操作失败!");
+				e.printStackTrace();
+			}
+			return Object2JsonStr(wr);
+		
+		}
+		@Override
+		public String delete(String id, String czid) {
+			WebJsonResult wr = success();
+			if (!this.checkUser()){
+				wr.setSuccess(false);
+				wr.setMessage(BaseWebCtl.NOLOGIN);
+				return Object2JsonStr(wr);
+			}
+			try {
+				if(!StringUtils.isEmpty(czid)){
+					XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+					if(xkzglb != null){
+						xkzglbService.delete(xkzglb.getId());
+					}
+				}
+				cgService.logicDelete(id);
+				// 如果是市级删除,省级也删除
+				CgEntity cg = cgService.findOne(id);
+				try {
+					if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+						CgWebService webService = cgService.getWebService(null);
+						webService.delete(id);
+						cg.setTbzt(Constants.YES);
+						cgService.save(cg);
+					}
+				} catch (Exception e) {
+					cg.setTbzt(Constants.NO);
+					cgService.save(cg);
+				}
+			} catch (Exception e) {
+				wr.setSuccess(false);
+				wr.setMessage("操作失败!");
+				e.printStackTrace();
+			}
+			return Object2JsonStr(wr);
+		}
 }

+ 202 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/CkxxService.java

@@ -25,11 +25,23 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.ICkxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjcxx.mt.entity.MtEntity;
+import com.xt.jygl.gkjcxx.zyq.entity.ZyqEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrck.client.CkWebService;
 import com.xt.jygl.gkjygl.gkjyr.jyrck.entity.CkEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrck.service.CkService;
 import com.xt.jygl.gkjygl.gkjyr.jyrck.vo.CkVo;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.BwEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -52,6 +64,8 @@ public class CkxxService extends BaseWebCtl implements ICkxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 根据查询条件查询仓库信息列表
 	 */
@@ -112,10 +126,6 @@ public class CkxxService extends BaseWebCtl implements ICkxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -190,4 +200,192 @@ public class CkxxService extends BaseWebCtl implements ICkxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, CkEntity code, String szdid, String szgkid, String szgqid, String ssmtid, String ssjyrid, String wxpckid, String ckszzyqid, String ckssbwid, String cklxid, String kcsclxid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssjyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssmtid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择前沿码头名称!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(code.getCkmc())) {
+			wr.setSuccess(false);
+			wr.setMessage("请输入仓库名称!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(cklxid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择仓库类型!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ckssbwid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择前沿泊位名称!");
+			return Object2JsonStr(wr);
+		}
+		CkEntity entity = new CkEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {
+				entity = ckService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setCkgs(code.getCkgs());
+			entity.setCkmc(code.getCkmc());
+			entity.setCpyrj(code.getCpyrj());
+			entity.setJd(code.getJd());
+			entity.setJtjid(code.getJtjid());
+			entity.setScyckmj(code.getScyckmj());
+			entity.setScyckrj(code.getScyckrj());
+			entity.setWd(code.getWd());
+			entity.setWxpckmj(code.getWxpckmj());
+			entity.setYkrj(code.getYkrj());
+			entity.setYthgcgrj(code.getYthgcgrj());
+			entity.setCkyt(code.getCkyt());
+			/*entity.setCklx(code.getCklx());*/
+			
+			entity.setCkzmj(code.getCkzmj());
+			entity.setCkrl(code.getCkrl());
+			entity.setYgrj(code.getYgrj());
+			entity.setYgrl(code.getYgrl());
+			entity.setYtcrj(code.getYtcrj());
+			entity.setLstcrj(code.getLstcrj());
+			entity.setSntcrj(code.getSntcrj());
+			entity.setQtscyckrj(code.getQtscyckrj());
+
+
+			if (code.getCkyt() != null) {
+				String name = "";
+				String[] s = code.getCkyt().split(",");
+				for (String string : s) {
+					name += securityMgr.codeService().findOne(string).getText() + ",";
+				}
+				entity.setCkytmc(name);
+			}
+
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+			if (!StringUtils.isEmpty(wxpckid)) {
+				CodeEntity wxpck = new CodeEntity(wxpckid);
+				entity.setWxpck(wxpck);
+			}
+			
+			if (!StringUtils.isEmpty(ckszzyqid)) {
+				ZyqEntity zyq = new ZyqEntity();
+				zyq.setId(ckszzyqid);
+				entity.setSzzyq(zyq);
+			}
+			
+			
+				BwEntity bw = new BwEntity();
+				bw.setId(ckssbwid);
+				entity.setSsbw(bw);
+				
+		
+				CodeEntity cklx = new CodeEntity(cklxid);
+				entity.setCklx(cklx);
+			
+			
+			if (!StringUtils.isEmpty(kcsclxid)) {
+				CodeEntity kcsclx = new CodeEntity(kcsclxid);
+				entity.setKcsclx(kcsclx);
+			}
+
+			MtEntity ssmt = new MtEntity();
+			ssmt.setId(ssmtid);
+			entity.setSsmt(ssmt);
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			ckService.save(entity);
+			wr.setAttr("entity", entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
+
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			ckService.logicDelete(id);
+			// 如果是市级删除,省级也删除
+			CkEntity ck = ckService.findOne(id);
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+					CkWebService webService = ckService.getWebService(null);
+					webService.delete(id);
+					ck.setTbzt(Constants.YES);
+					ckService.save(ck);
+				}
+			} catch (Exception e) {
+				ck.setTbzt(Constants.NO);
+				ckService.save(ck);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
 }

+ 183 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/DcxxService.java

@@ -25,11 +25,21 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.IDcxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjcxx.mt.entity.MtEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrdc.client.DcWebService;
 import com.xt.jygl.gkjygl.gkjyr.jyrdc.entity.DcEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrdc.service.DcService;
 import com.xt.jygl.gkjygl.gkjyr.jyrdc.vo.DcVo;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -54,6 +64,8 @@ public class DcxxService extends BaseWebCtl implements IDcxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 根据查询条件查询堆场信息
 	 */
@@ -112,10 +124,6 @@ public class DcxxService extends BaseWebCtl implements IDcxxService{
 			}//
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -169,4 +177,175 @@ public class DcxxService extends BaseWebCtl implements IDcxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, DcEntity code, String szdid, String szgkid, String szgqid, String ssmtid, String ssjyrid, String wxpdcid, String dcsclxid) {
+
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssjyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(dcsclxid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择堆场生产类型!");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(code.getDcmc())) {
+			wr.setSuccess(false);
+			wr.setMessage("请输入堆场名称!");
+			return Object2JsonStr(wr);
+		}
+		DcEntity entity = new DcEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {
+				entity = dcService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setDcmc(code.getDcmc());
+			entity.setDczmj(code.getDczmj());
+			entity.setDczrl(code.getDczrl());
+			entity.setJd(code.getJd());
+			entity.setJtjgisdyidh(code.getJtjgisdyidh());
+			entity.setJzxdcdcnl(code.getJzxdcdcnl());
+			entity.setJzxmj(code.getJzxmj());
+			entity.setWd(code.getWd());
+			entity.setWxpxdcdcnl(code.getWxpxdcdcnl());
+			entity.setWxpxdcmj(code.getWxpxdcmj());
+			entity.setDczrlteu(code.getDczrlteu());
+			String scydcytId="";//堆场拥堵ID
+			if (code.getScydcyt() != null) {
+				String name = "";
+				String[] s = code.getScydcyt().split(",");
+				for (String string : s) {
+					scydcytId+=string+",";
+					name += securityMgr.codeService().findOne(string).getText() + ",";
+				}
+				entity.setZwdcyt(name);
+			}
+			if (scydcytId.endsWith(",")) {
+				scydcytId=scydcytId.substring(0,scydcytId.length()-1);
+			}
+			entity.setScydcyt(scydcytId);//堆场拥堵ID
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+			if (!StringUtils.isEmpty(wxpdcid)) {
+				CodeEntity wxpdc = new CodeEntity(wxpdcid);
+				entity.setWxpdc(wxpdc);
+			}
+
+			CodeEntity dcsclx = new CodeEntity(dcsclxid);
+			entity.setDclx(dcsclx);
+			// 你找啥 查询方法
+			if (!StringUtils.isEmpty(ssmtid)) {
+				MtEntity ssmt = new MtEntity();
+				ssmt.setId(ssmtid);
+				entity.setSsmt(ssmt);
+			}
+
+			/* entity.setDclx(code.getDclx()); */
+			entity.setMcmj(code.getMcmj());
+			entity.setMcrl(code.getMcrl());
+			entity.setKsdcmj(code.getKsdcmj());
+			entity.setKsdcrl(code.getKsdcrl());
+			entity.setLcxdcmj(code.getLcxdcmj());
+			entity.setLcxdcdcnl(code.getLcxdcdcnl());
+			entity.setCzxdcmj(code.getCzxdcmj());
+			entity.setCzxdcdcnl(code.getCzxdcdcnl());
+			entity.setXxdcdcnl(code.getXxdcdcnl());
+			entity.setXxdcmj(code.getXxdcmj());
+			entity.setQtdcmj(code.getQtdcmj());
+			entity.setQtdcdcnl1(code.getQtdcdcnl1());
+			entity.setQtdcdcnl2(code.getQtdcdcnl2());
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			dcService.save(entity);
+			wr.setAttr("entity", entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
+
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			dcService.logicDelete(id);
+			// 如果是市级删除,省级也删除
+			DcEntity dc = dcService.findOne(id);
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+					DcWebService webService = dcService.getWebService(null);
+					webService.delete(id);
+					dc.setTbzt(Constants.YES);
+					dcService.save(dc);
+				}
+			} catch (Exception e) {
+				dc.setTbzt(Constants.NO);
+				dcService.save(dc);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
 }

+ 161 - 36
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/JyrjbxxService.java

@@ -18,8 +18,6 @@ import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Subquery;
 import javax.xml.ws.WebServiceContext;
 
-import net.sf.json.JSONArray;
-
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -31,13 +29,11 @@ import com.cxfws.jyrxxgl.service.IJyrjbxxService;
 import com.xt.jygl.common.BaseWebCtl;
 import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
-import com.xt.jygl.ggfwxxgl.jdtx.service.TxService;
-import com.xt.jygl.ggfwxxgl.tzgg.ggxx.service.GgxxtxService;
 import com.xt.jygl.gkjcxx.ax.entity.AxEntity;
 import com.xt.jygl.gkjcxx.ax.service.AxService;
-import com.xt.jygl.gkjcxx.gk.service.GkService;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
-import com.xt.jygl.gkjcxx.mt.service.MtService;
 import com.xt.jygl.gkjygl.gkjyr.jyrbw.service.BwService;
 import com.xt.jygl.gkjygl.gkjyr.jyrcg.entity.CgEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrcg.service.CgService;
@@ -45,18 +41,15 @@ import com.xt.jygl.gkjygl.gkjyr.jyrck.entity.CkEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrck.service.CkService;
 import com.xt.jygl.gkjygl.gkjyr.jyrdc.entity.DcEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrdc.service.DcService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.client.GkjyrWebService;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.BwEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.GkjyrVo;
-import com.xt.jygl.gkjygl.gkjyr.qytz.service.QytzService;
-import com.xt.jygl.gkjygl.gkjyr.ry.service.RyService;
-import com.xt.jygl.gkjygl.gkjyr.sssb.service.SssbService;
-import com.xt.jygl.gkjygl.gkjyr.xkzfz.service.XkzfzService;
 import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzxxEntity;
-import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
 import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzxxService;
-import com.xt.jygl.gkjygl.gkjyr.zxjx.service.ZxjxService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -64,6 +57,8 @@ import com.xtframe.sec.user.dao.UserDao;
 import com.xtframe.sec.user.entity.UserEntity;
 import com.xtframe.util.DateTime;
 import com.xtframe.util.StringUtils;
+
+import net.sf.json.JSONArray;
 /**
  * 
  *经营人基本信息
@@ -80,12 +75,8 @@ public class JyrjbxxService extends BaseWebCtl implements IJyrjbxxService {
 	@Autowired
 	private GkjyrService gkjyrService;
 	@Autowired
-	private GkService gkService;
-	@Autowired
 	private GqService gqService;
 	@Autowired
-	private MtService mtService;
-	@Autowired
 	private BwService bwService;
 	@Autowired
 	private CgService cgService;
@@ -94,24 +85,8 @@ public class JyrjbxxService extends BaseWebCtl implements IJyrjbxxService {
 	@Autowired
 	private DcService dcService;
 	@Autowired
-	private RyService ryService;
-	@Autowired
-	private QytzService qytzService;
-	@Autowired
-	private ZxjxService zxjxService;
-	@Autowired
-	private XkzglbService xkzglbService;
-	@Autowired
 	private XkzxxService xkzxxService;
 	@Autowired
-	private GgxxtxService ggxxtxService;
-	@Autowired
-	private TxService txService;
-	@Autowired
-	private SssbService sssbService;
-	@Autowired
-	private XkzfzService xkzfzService;
-	@Autowired
 	private AxService axService;
 	/**
 	 * 查询详细
@@ -429,10 +404,6 @@ public class JyrjbxxService extends BaseWebCtl implements IJyrjbxxService {
 				
 			};
 			if (page.getPage() < 1) {
-//				Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//				if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//					xmxxpage = "1";
-//				}
 				page.setPage(1);
 			}
 			page.setSort("id");
@@ -469,4 +440,158 @@ public class JyrjbxxService extends BaseWebCtl implements IJyrjbxxService {
 			}
 			return Object2JsonStr(voList);
 		}
+		@Override
+		public String save(String iFlag, GkjyrEntity gkjyrEntity, String szdid, String szgkid, String szgqid, String sfwhqyid, String xzqhid, String sfzdspid, String ywcqzmid, String ywjgysid, String jyrmtjgxsid, String qyxzid) {
+			WebJsonResult wr = success();
+			if (!this.checkUser()){
+				wr.setSuccess(false);
+				wr.setMessage(BaseWebCtl.NOLOGIN);
+				return Object2JsonStr(wr);
+			}
+			if (StringUtils.isEmpty(iFlag)) {
+				if (StringUtils.isEmpty(szdid)) {
+					wr.setSuccess(false);
+					wr.setMessage("请选择所在地!");
+					return Object2JsonStr(wr);
+				}
+				if (StringUtils.isEmpty(szgkid)) {
+					wr.setSuccess(false);
+					wr.setMessage("请选择所在港口!");
+					return Object2JsonStr(wr);
+				}
+				if (StringUtils.isEmpty(szgqid)) {
+					wr.setSuccess(false);
+					wr.setMessage("请选择所在港区!");
+					return Object2JsonStr(wr);
+				}
+				if (StringUtils.isEmpty(gkjyrEntity.getGkjyr())) {
+					wr.setSuccess(false);
+					wr.setMessage("请填写港口经营人!");
+					return Object2JsonStr(wr);
+				}
+				if (StringUtils.isEmpty(gkjyrEntity.getFddbr())) {
+					wr.setSuccess(false);
+					wr.setMessage("请填写法定代表人!");
+					return Object2JsonStr(wr);
+				}
+			}
+			GkjyrEntity yjyr = new GkjyrEntity();
+			try {
+				if (!StringUtils.isEmpty(gkjyrEntity.getId())) {// 修改保存
+					yjyr = gkjyrService.findOne(gkjyrEntity.getId());
+				}
+				gkjyrEntity.setCreateDateTime(yjyr.getCreateDateTime());
+				gkjyrEntity.setCreateUser(yjyr.getCreateUser());
+				gkjyrEntity.setAqid(yjyr.getAqid());
+				if (StringUtils.isNotEmpty(szdid)) {
+					CodeEntity szd = new CodeEntity(szdid);
+					gkjyrEntity.setSzd(szd);
+				} else {
+					gkjyrEntity.setSzd(yjyr.getSzd());
+				}
+				if (StringUtils.isNotEmpty(szgkid)) {
+					GkEntity szgk = new GkEntity();
+					szgk.setId(szgkid);
+					gkjyrEntity.setSzgk(szgk);
+				} else {
+					gkjyrEntity.setSzgk(yjyr.getSzgk());
+				}
+				if (StringUtils.isNotEmpty(qyxzid)) {
+					CodeEntity qyxz = new CodeEntity(qyxzid);
+					gkjyrEntity.setQyxz(qyxz);
+
+				} else {
+					gkjyrEntity.setQyxz(yjyr.getQyxz());
+				}
+				if (StringUtils.isNotEmpty(szgqid)) {
+					GqEntity szgq = gqService.findOne(szgqid);
+					szgq.setId(szgqid);
+					gkjyrEntity.setSzgq(szgq);
+					gkjyrEntity.setSsgkglbm(szgq.getSsgkglbm());
+				} else {
+					gkjyrEntity.setSzgq(yjyr.getSzgq());
+					gkjyrEntity.setSsgkglbm(yjyr.getSsgkglbm());
+				}
+				if (StringUtils.isNotEmpty(sfwhqyid)) {
+					CodeEntity sfwhqy = new CodeEntity(sfwhqyid);
+					gkjyrEntity.setSfwhqy(sfwhqy);
+				} else {
+					gkjyrEntity.setSfwhqy(yjyr.getSfwhqy());
+				}
+				if (StringUtils.isNotEmpty(xzqhid)) {
+					CodeEntity xzqh = new CodeEntity(xzqhid);
+					gkjyrEntity.setXzqh(xzqh);
+				} else {
+					gkjyrEntity.setXzqh(yjyr.getXzqh());
+				}
+				if (StringUtils.isNotEmpty(sfzdspid)) {
+					CodeEntity sfzdsp = new CodeEntity(sfzdspid);
+					gkjyrEntity.setSfzdsp(sfzdsp);
+				} else {
+					gkjyrEntity.setSfzdsp(yjyr.getSfzdsp());
+				}
+				if (StringUtils.isNotEmpty(ywcqzmid)) {
+					CodeEntity ywcqzm = new CodeEntity(ywcqzmid);
+					gkjyrEntity.setYwcqzm(ywcqzm);
+				} else {
+					gkjyrEntity.setYwcqzm(yjyr.getYwcqzm());
+				}
+				if (StringUtils.isNotEmpty(ywjgysid)) {
+					CodeEntity ywjgys = new CodeEntity(ywjgysid);
+					gkjyrEntity.setYwjgys(ywjgys);
+				} else {
+					gkjyrEntity.setYwjgys(yjyr.getYwjgys());
+				}
+				if (StringUtils.isNotEmpty(jyrmtjgxsid)) {
+					CodeEntity mtjgxs = new CodeEntity(jyrmtjgxsid);
+					gkjyrEntity.setMtjgxs(mtjgxs);
+				} else {
+					gkjyrEntity.setMtjgxs(yjyr.getMtjgxs());
+				}
+				gkjyrEntity.setYjyrid(yjyr.getYjyrid());
+				gkjyrEntity.setBgjyrid(yjyr.getBgjyrid());
+				if(!StringUtils.isEmpty(gkjyrEntity.getId())){
+					gkjyrEntity.setTbzt(Constants.NO);
+				}
+				gkjyrService.save(gkjyrEntity);
+				wr.setAttr("entity", gkjyrEntity);
+			} catch (Exception e) {
+				wr.setSuccess(false);
+				wr.setMessage("操作失败!");
+				e.printStackTrace();
+			}
+			return Object2JsonStr(wr);
+		}
+		@Override
+		public String delete(String id) {
+			WebJsonResult wr = success();
+			if (!this.checkUser()){
+				wr.setSuccess(false);
+				wr.setMessage(BaseWebCtl.NOLOGIN);
+				return Object2JsonStr(wr);
+			}
+			try {
+				// 逻辑删除
+				gkjyrService.logicDelete(id);
+				// 如果是市级删除,省级也删除
+				GkjyrEntity gkjyr = gkjyrService.findOne(id);
+				try {
+					if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+						GkjyrWebService webService = gkjyrService.getWebService(null);
+						webService.delete(id);
+						gkjyr.setTbzt(Constants.YES);
+						gkjyrService.save(gkjyr);
+					}
+				} catch (Exception e) {
+					gkjyr.setTbzt(Constants.NO);
+					gkjyrService.save(gkjyr);
+
+				}
+			} catch (Exception e) {
+				wr.setSuccess(false);
+				wr.setMessage("操作失败!");
+				e.printStackTrace();
+			}
+			return Object2JsonStr(wr);
+		}
 }

+ 159 - 15
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/MtxxService.java

@@ -26,11 +26,21 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.IMtxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.ax.entity.AxEntity;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
 import com.xt.jygl.gkjcxx.mt.entity.MtEntity;
 import com.xt.jygl.gkjcxx.mt.service.MtService;
 import com.xt.jygl.gkjcxx.mt.vo.MtVo;
+import com.xt.jygl.gkjcxx.zyq.entity.ZyqEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -53,6 +63,8 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 查询列表
 	 */
@@ -127,10 +139,6 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -155,11 +163,6 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 				String mtytName = "";
 				if (entity.getMtyt() != null) {
 					String[] mtytNameArray = entity.getMtyt().split(",");
-					/*
-					 * for (String m : mtytNameArray) { mtytName +=
-					 * codeService.findOne(m).getText() + " "; mtytName +=
-					 * securityMgr.codeService().findOne(m).getText() + " "; }
-					 */
 					for (int i = 0; i < mtytNameArray.length; i++) {
 						if (i != mtytNameArray.length - 1) {
 							mtytName += securityMgr.codeService().findOne(mtytNameArray[i]).getText() + ",";
@@ -179,7 +182,6 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 				vo.setSfwhp(entity.getSfwhp() != null ? entity.getSfwhp().getId() : "");
 				vo.setMtsfwars(entity.getMtsfwars() != null ? entity.getMtsfwars().getId() : "");
 				vo.setFwlx(entity.getFwlx() != null ? entity.getFwlx().getId() : "");
-				// vo.setMtyt(entity.getMtyt()!=null?entity.getMtyt().getId():"");
 				vo.setMtxsdm(entity.getMtxsdm() != null ? entity.getMtxsdm().getId() : "");
 				vo.setXkzid(entity.getXkzid() != null ? entity.getXkzid() : "");
 
@@ -232,11 +234,6 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 		String mtytName = "";
 		if (entity.getMtyt() != null) {
 			String[] mtytNameArray = entity.getMtyt().split(",");
-			/*
-			 * for (String m : mtytNameArray) { mtytName +=
-			 * codeService.findOne(m).getText() + " "; mtytName +=
-			 * securityMgr.codeService().findOne(m).getText() + " "; }
-			 */
 			for (int i = 0; i < mtytNameArray.length; i++) {
 				if (i != mtytNameArray.length - 1) {
 					mtytName += securityMgr.codeService().findOne(mtytNameArray[i]).getText() + ",";
@@ -251,5 +248,152 @@ public class MtxxService extends BaseWebCtl implements IMtxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, MtEntity code, String szdid, String szgkid, String szgqid, String ssjyrid, String sfdwkfid, String sfwhpid, String mtsfwarsid, String fwlxid, String mtytid, String mtjgxsid, String szzyqid, String szaxid) {
+		// how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
+		// why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区");
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(ssjyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人");
+			return Object2JsonStr(wr);
+		}
+
+		MtEntity entity = new MtEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {// 修改
+				entity = mtService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setZyid(code.getZyid());
+			entity.setMtmc(code.getMtmc());
+			entity.setNhwtgnl(code.getNhwtgnl());
+			entity.setSjhwttl(code.getSjhwttl());
+			entity.setSjlkttl(code.getSjlkttl());
+			entity.setNlktgnl(code.getNlktgnl());
+			entity.setNjzxtgnl(code.getNjzxtgnl());
+			entity.setGisid(code.getGisid());
+			entity.setMtcd(code.getMtcd());
+			entity.setMtqysjclss(code.getMtqysjclss());
+			entity.setMtsjqyss(code.getMtsjqyss());
+			entity.setMtdm(code.getMtdm());
+			entity.setMtxsdm(code.getMtxsdm());
+			entity.setBwgs(code.getBwgs());
+			entity.setMtqydbg(code.getMtqydbg());
+			entity.setMtsfwars(code.getMtsfwars());
+			entity.setFwlx(code.getFwlx());
+			entity.setMtyt(code.getMtyt());
+			entity.setMtxsdm(code.getMtxsdm());
+			entity.setJcrq(code.getJcrq());
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			ZyqEntity szzyq = new ZyqEntity();
+			szzyq.setId(szzyqid);
+			entity.setSzzyq(szzyq);
+
+			AxEntity ax = new AxEntity();
+			ax.setId(szaxid);
+			entity.setSzax(ax);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+			if (!StringUtils.isEmpty(sfdwkfid)) {
+				CodeEntity sfdwkf = new CodeEntity(sfdwkfid);
+				entity.setSfdwkf(sfdwkf);
+			}
+
+			if (!StringUtils.isEmpty(sfwhpid)) {
+				CodeEntity sfwhp = new CodeEntity(sfwhpid);
+				entity.setSfwhp(sfwhp);
+			}
+			if (!StringUtils.isEmpty(mtsfwarsid)) {
+				CodeEntity mtsfwars = new CodeEntity(mtsfwarsid);
+				entity.setMtsfwars(mtsfwars);
+			}
+			if (!StringUtils.isEmpty(fwlxid)) {
+				CodeEntity fwlx = new CodeEntity(fwlxid);
+				entity.setFwlx(fwlx);
+
+			}
+			if (!StringUtils.isEmpty(mtjgxsid)) {
+				CodeEntity mtjgxs = new CodeEntity(mtjgxsid);
+				entity.setMtxsdm(mtjgxs);
+
+			}
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			mtService.save(entity);
+			wr.setAttr("entity", entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			// 子类一并删除
+			mtService.logicDelete(id);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("删除失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
 
 }

+ 122 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/QytzxxService.java

@@ -25,11 +25,19 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.IQytzxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
 import com.xt.jygl.gkjygl.gkjyr.qytz.entity.QytzEntity;
 import com.xt.jygl.gkjygl.gkjyr.qytz.service.QytzService;
 import com.xt.jygl.gkjygl.gkjyr.qytz.vo.QytzVo;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -52,6 +60,8 @@ public class QytzxxService extends BaseWebCtl implements IQytzxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 企业投资信息列表
 	 */
@@ -106,10 +116,6 @@ public class QytzxxService extends BaseWebCtl implements IQytzxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -169,4 +175,116 @@ public class QytzxxService extends BaseWebCtl implements IQytzxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, QytzEntity code, String jyrid, String sfwsid, String jjlxid, String szdid, String szgkid, String szgqid) {
+
+		// how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
+		// why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地");
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口");
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区");
+		}
+		if (StringUtils.isEmpty(jyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人");
+		}
+
+		QytzEntity qytzEntity = new QytzEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {// 修改
+				qytzEntity = qytzService.findOne(code.getId());
+				qytzEntity.setTbzt(Constants.NO);
+			}
+			qytzEntity.setTzzje(code.getTzzje());
+			qytzEntity.setTzrmc(code.getTzrmc());
+			qytzEntity.setTzje(code.getTzje());
+			qytzEntity.setSzb(code.getSzb());
+			qytzEntity.setZczb(code.getZczb());
+			qytzEntity.setZcdz(code.getZcdz());
+			qytzEntity.setZczbdw(code.getZczbdw());
+			
+			qytzEntity.setTzjedw(code.getTzjedw());
+			qytzEntity.setTzjjlx(code.getTzjjlx());
+			qytzEntity.setJe(code.getJe());
+
+			if (!StringUtils.isEmpty(sfwsid)) {
+				CodeEntity sfws = new CodeEntity(sfwsid);
+				qytzEntity.setSfws(sfws);
+			}
+			if (!StringUtils.isEmpty(jjlxid)) {
+				CodeEntity jjlx = new CodeEntity(jjlxid);
+				qytzEntity.setJjlx(jjlx);
+			}
+			CodeEntity szd = new CodeEntity(szdid);
+			qytzEntity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			qytzEntity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			qytzEntity.setSzgq(szgq);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			qytzEntity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(jyrid);
+			qytzEntity.setSsjyr(ssjyr);
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					qytzEntity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					qytzEntity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			qytzService.save(qytzEntity);
+			wr.setAttr("entity", qytzEntity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			// 子类一并删除
+			qytzService.logicDelete(id);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("删除失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
 }

+ 130 - 9
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/RyWService.java

@@ -20,15 +20,20 @@ import org.springframework.stereotype.Service;
 
 import com.cxfws.jyrxxgl.service.IRyService;
 import com.xt.jygl.common.BaseWebCtl;
-import com.xt.jygl.gkjcxx.gk.service.GkService;
+import com.xt.jygl.common.Constants;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyEntity;
-import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.service.GkjyrService;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyzsEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.RyVo;
 import com.xt.jygl.gkjygl.gkjyr.ry.service.RyService;
 import com.xt.jygl.gkjygl.gkjyr.ry.service.RyzsService;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
 import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
-import com.xtframe.core.support.SecurityMgr;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -38,21 +43,15 @@ import com.xtframe.util.StringUtils;
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "ryWebServicePort", serviceName = "ryWebService")
 public class RyWService extends BaseWebCtl implements IRyService{
 	@Autowired
-	private SecurityMgr securityMgr;
-	@Autowired
 	private QueryService query;
 	@Autowired
 	private RyService ryService;
 	@Autowired
-	private GkService gkService;
-	@Autowired
 	private GqService gqService;
 	@Autowired
 	private RyzsService ryzsService;
 	@Autowired
 	private XkzglbService xkzglbService;
-	@Autowired
-	private GkjyrService gkjyrService;
 	@Override
 	@WebMethod(operationName = "findRy", action = "http://service.web.jsjty.com/findRy")
 	@WebResult(name = "result", targetNamespace = "http://service.web.jsjty.com/")
@@ -162,4 +161,126 @@ public class RyWService extends BaseWebCtl implements IRyService{
 		return Object2JsonStr(vo);
 	}
 
+	@Override
+	public String save(String path, RyEntity code, String[] zsids, String szdid, String szgkid, String szgqid, String xbid, String ssjyrid, String rylxid, String zjlxid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地");
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口");
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区");
+		}
+		if (StringUtils.isEmpty(ssjyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人");
+		}
+		if (StringUtils.isEmpty(zjlxid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择证件类型");
+		}
+		RyEntity entity = new RyEntity();
+		try {
+			// 修改
+			if (!StringUtils.isEmpty(code.getId())) {
+				entity = ryService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setXm(code.getXm());
+			entity.setZwhzc(code.getZwhzc());
+			entity.setLxdh(code.getLxdh());
+			entity.setSjhm(code.getSjhm());
+			entity.setCsrq(code.getCsrq());
+			entity.setSfzh(code.getSfzh());
+			entity.setBz(code.getBz());
+
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			CodeEntity zjlx = new CodeEntity(zjlxid);
+			entity.setZjlx(zjlx);
+
+			if (!StringUtils.isEmpty(xbid)) {
+				CodeEntity xb = new CodeEntity(xbid);
+				entity.setXb(xb);
+			}
+			if (!StringUtils.isEmpty(rylxid)) {
+				CodeEntity rylx = new CodeEntity(rylxid);
+				entity.setRylx(rylx);
+			}
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			code.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			RyEntity ryEntity = ryService.save(entity);
+			wr.setAttr("entity", ryEntity);
+			List<RyzsEntity> ryzsList = new ArrayList<RyzsEntity>();
+			for (int i = 0; i < zsids.length; i++) {
+				RyzsEntity ryzsEntity = ryzsService.findOne(zsids[i]);
+				ryzsEntity.setRyid(ryEntity);
+				ryzsEntity.setSfzh(ryEntity.getSfzh());
+				ryzsService.save(ryzsEntity);
+				ryzsList.add(ryzsEntity);
+			}
+			wr.setAttr("ryzsList", ryzsList);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+
+	@Override
+	public String delete(String id, String czid) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			ryService.logicDelete(id);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
 }

+ 83 - 0
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/RyzsWService.java

@@ -14,11 +14,16 @@ import org.springframework.stereotype.Service;
 
 import com.cxfws.jyrxxgl.service.IRyzsService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
+import com.xt.jygl.common.GlobalData;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.RyzsEntity;
 import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.vo.RyzsVo;
+import com.xt.jygl.gkjygl.gkjyr.ry.client.RyzsWebService;
 import com.xt.jygl.gkjygl.gkjyr.ry.service.RyService;
 import com.xt.jygl.gkjygl.gkjyr.ry.service.RyzsService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.util.StringUtils;
 @Service("ryzsWebService")
 @WebService(targetNamespace = "http://service.web.jsjty.com/", portName = "ryzsWebServicePort", serviceName = "ryzsWebService")
 public class RyzsWService extends BaseWebCtl implements IRyzsService {
@@ -61,5 +66,83 @@ public class RyzsWService extends BaseWebCtl implements IRyzsService {
 		}
 		return "找不到对应的证书信息";
 	}
+	@Override
+	public String save(RyzsEntity code, String sfzh) {
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			// 修改
+			if (!StringUtils.isEmpty(code.getId())) {
+
+				RyzsEntity entity = ryzsService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+				entity.setZsmc(code.getZsmc());
+				entity.setZsbh(code.getZsbh());
+				entity.setFzbm(code.getFzbm());
+				entity.setYxq(code.getYxq());
+				entity.setZszl(code.getZszl());
+				RyzsEntity ryzsEntity = ryzsService.save(entity);
+				wr.setAttr("entity", ryzsEntity);
+
+			} else {
+				// 新增
+				RyzsEntity ryzsEntity = ryzsService.save(code);
+				wr.setAttr("entity", ryzsEntity);
+			}
+			// 如果是市级新增或者修改,保存后同步到省级
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+					RyzsWebService webService = ryzsService.getWebService(null);
+					webService.save(code);
+					code.setTbzt(Constants.YES);
+					ryzsService.save(code);
+				}
+			} catch (Exception e) {
+				code.setTbzt(Constants.NO);
+				ryzsService.save(code);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
+	@Override
+	public String delete(String id) {
+
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			ryzsService.logicDelete(id);
+			wr.setMessage(id);
+			// 如果是市级删除,省级也删除
+			RyzsEntity ryzs = ryzsService.findOne(id);
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
+					RyzsWebService webService = ryzsService.getWebService(null);
+					webService.delete(id);
+					ryzs.setTbzt(Constants.YES);
+					ryzsService.save(ryzs);
+				}
+			} catch (Exception e) {
+				ryzs.setTbzt(Constants.NO);
+				ryzsService.save(ryzs);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
 
 }

+ 128 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/SssbxxService.java

@@ -26,11 +26,21 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.ISssbxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjcxx.zyq.entity.ZyqEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.sssb.client.SssbWebService;
 import com.xt.jygl.gkjygl.gkjyr.sssb.entity.SssbEntity;
 import com.xt.jygl.gkjygl.gkjyr.sssb.service.SssbService;
 import com.xt.jygl.gkjygl.gkjyr.sssb.vo.SssbVo;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -53,6 +63,8 @@ public class SssbxxService extends BaseWebCtl implements ISssbxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 根据查询条件查询设施设备信息列表
 	 */
@@ -108,10 +120,6 @@ public class SssbxxService extends BaseWebCtl implements ISssbxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -177,5 +185,121 @@ public class SssbxxService extends BaseWebCtl implements ISssbxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, SssbEntity code, String szdid, String szgkid, String szgqid, String ssjyrid, String sldwid, String yjflid, String ejflid, String sbszzyqid) {
+
+		// how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
+		// why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		SssbEntity entity = new SssbEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {
+				entity = sssbService.findOne(code.getId());
+				entity.setTbzt(Constants.NO);
+			}
+			entity.setSsmc(code.getSsmc());
+			entity.setGgxh(code.getGgxh());
+			entity.setSl(code.getSl());
+			entity.setCfcs(code.getCfcs());
+			entity.setYxq(code.getYxq());
+			entity.setTbr(code.getTbr());
+			entity.setLxdh(code.getLxdh());
+			entity.setBz(code.getBz());
+			entity.setBh(code.getBh());
+
+			if (!StringUtils.isEmpty(sldwid)) {
+				CodeEntity sldw = new CodeEntity(sldwid);
+				entity.setSldw(sldw);
+			}
+			if (!StringUtils.isEmpty(yjflid)) {
+				CodeEntity yjfl = new CodeEntity(yjflid);
+				entity.setYjfl(yjfl);
+			}
+			if (!StringUtils.isEmpty(ejflid)) {
+				CodeEntity ejfl = new CodeEntity(ejflid);
+				entity.setEjfl(ejfl);
+			}
+			if (!StringUtils.isEmpty(sbszzyqid)) {
+				ZyqEntity zyq = new ZyqEntity();
+				zyq.setId(sbszzyqid);
+				entity.setSzzyq(zyq);
+			}
+
+			CodeEntity szd = new CodeEntity(szdid);
+			entity.setSzd(szd);
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+
+			GqEntity szgq = new GqEntity();
+			szgq.setId(szgqid);
+			entity.setSzgq(szgq);
+
+			GkjyrEntity ssjyr = new GkjyrEntity();
+			ssjyr.setId(ssjyrid);
+			entity.setSsjyr(ssjyr);
+
+			GqEntity gq = gqService.findOne(szgqid);
+			entity.setSsgkglbm(gq != null ? gq.getSsgkglbm() : null);
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			sssbService.save(entity);
+			wr.setAttr("entity", entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
 
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			// 子类一并删除
+			sssbService.logicDelete(id);
+			// 如果是市级删除,省级也删除
+			SssbEntity sssb = sssbService.findOne(id);
+			try {
+				if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY) && needWS()) {
+					SssbWebService webService = sssbService.getWebService(null);
+					webService.delete(id);
+					sssb.setTbzt(Constants.YES);
+					sssbService.save(sssb);
+				}
+			} catch (Exception e) {
+				sssb.setTbzt(Constants.NO);
+				sssbService.save(sssb);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("删除失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	}
 }

+ 157 - 4
gkjsjy/trunk/src/com/cxfws/jyrxxgl/service/impl/ZxjxxxService.java

@@ -25,11 +25,20 @@ import org.springframework.stereotype.Service;
 import com.cxfws.config.utils.CxfwsUtils;
 import com.cxfws.jyrxxgl.service.IZxjxxxService;
 import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
 import com.xt.jygl.common.GlobalData;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gq.entity.GqEntity;
 import com.xt.jygl.gkjcxx.gq.service.GqService;
+import com.xt.jygl.gkjcxx.zyq.entity.ZyqEntity;
+import com.xt.jygl.gkjygl.gkjyr.jyrjbxx.entity.GkjyrEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.entity.XkzglbEntity;
+import com.xt.jygl.gkjygl.gkjyr.xkzxx.service.XkzglbService;
 import com.xt.jygl.gkjygl.gkjyr.zxjx.entity.ZxjxEntity;
 import com.xt.jygl.gkjygl.gkjyr.zxjx.service.ZxjxService;
 import com.xt.jygl.gkjygl.gkjyr.zxjx.vo.ZxjxVo;
+import com.xtframe.core.base.ctl.WebJsonResult;
+import com.xtframe.sec.code.entity.CodeEntity;
 import com.xtframe.sec.common.BaseEntity;
 import com.xtframe.sec.common.QueryService;
 import com.xtframe.sec.common.SimplePageRequest;
@@ -53,6 +62,8 @@ public class ZxjxxxService extends BaseWebCtl implements IZxjxxxService{
 	private UserDao userdao;
 	@Autowired
 	private GqService gqService;
+	@Autowired
+	private XkzglbService xkzglbService;
 	/**
 	 * 装卸机械信息列表
 	 */
@@ -107,10 +118,6 @@ public class ZxjxxxService extends BaseWebCtl implements IZxjxxxService{
 			}
 		};
 		if (page.getPage() < 1) {
-//			Object xmxxpage = CacheSearchCondition.cacheSCmapVal(cacheSCmap, "xmxxpage");
-//			if (StringUtils.isEmpty(xmxxpage) || !org.apache.commons.lang.StringUtils.isNumeric(String.valueOf(xmxxpage))) {
-//				xmxxpage = "1";
-//			}
 			page.setPage(1);
 		}
 		page.setSort("id");
@@ -182,4 +189,150 @@ public class ZxjxxxService extends BaseWebCtl implements IZxjxxxService{
 		JSONArray jsons=JSONArray.fromObject(vo);
 		return jsons.toString();
 	}
+	@Override
+	public String save(String path, ZxjxEntity code, String jyrid, String szdid, String szgkid, String szgqid, String szzyqid, String jxlbmcid, String syqid) {
+
+		// how:如果是新增直接保存,如果更新,先取出数据库中记录,然后更新页面传过来的字段
+		// why:这样的话一些在前台无需显示的字段保证不会丢失,同时一个个字段设置有助于bug排查
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		if (StringUtils.isEmpty(szdid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在地");
+		}
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口");
+		}
+		if (StringUtils.isEmpty(szgqid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港区");
+		}
+		if (StringUtils.isEmpty(jyrid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所属经营人");
+		}
+		if (StringUtils.isEmpty(jxlbmcid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择机械类别名称");
+		}
+
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {// 修改
+				ZxjxEntity zxjxEntity = zxjxService.findOne(code.getId());
+				zxjxEntity.setTbzt(Constants.NO);
+				if (!StringUtils.isEmpty(syqid)) {
+					CodeEntity syq = new CodeEntity(syqid);
+					zxjxEntity.setSyq(syq);
+				}
+				
+				if (!StringUtils.isEmpty(szzyqid)) {
+					ZyqEntity szzyq = new ZyqEntity();
+					szzyq.setId(szzyqid);
+					zxjxEntity.setSzzyq(szzyq);
+				}
+				CodeEntity szd = new CodeEntity(szdid);
+				zxjxEntity.setSzd(szd);
+				
+				CodeEntity jxlbmc = new CodeEntity(jxlbmcid);
+				zxjxEntity.setJxlbmc(jxlbmc);
+
+				GkEntity szgk = new GkEntity();
+				szgk.setId(szgkid);
+				zxjxEntity.setSzgk(szgk);
+
+				GqEntity szgq = new GqEntity();
+				szgq.setId(szgqid);
+				zxjxEntity.setSzgq(szgq);
+
+				GkjyrEntity ssjyr = new GkjyrEntity();
+				ssjyr.setId(jyrid);
+				zxjxEntity.setSsjyr(ssjyr);
+				
+				zxjxEntity.setXhhgg(code.getXhhgg());
+				zxjxEntity.setJxsl(code.getJxsl());
+				zxjxEntity.setJxfhnlsz(code.getJxfhnlsz());
+				zxjxEntity.setJxfhnldw(code.getJxfhnldw());
+				zxjxEntity.setSyqxsta(code.getSyqxsta());
+				zxjxEntity.setSyqxend(code.getSyqxend());
+				zxjxEntity.setBz(code.getBz());
+				zxjxService.save(zxjxEntity);
+				wr.setAttr("entity", zxjxEntity);
+			} else {// 新增
+				if (!StringUtils.isEmpty(syqid)) {
+					CodeEntity syq = new CodeEntity(syqid);
+					code.setSyq(syq);
+				}
+				
+				if (!StringUtils.isEmpty(szzyqid)) {
+					ZyqEntity szzyq = new ZyqEntity();
+					szzyq.setId(szzyqid);
+					code.setSzzyq(szzyq);
+				}
+				CodeEntity szd = new CodeEntity(szdid);
+				code.setSzd(szd);
+				
+				CodeEntity jxlbmc = new CodeEntity(jxlbmcid);
+				code.setJxlbmc(jxlbmc);
+
+				GkEntity szgk = new GkEntity();
+				szgk.setId(szgkid);
+				code.setSzgk(szgk);
+
+				GqEntity szgq = new GqEntity();
+				szgq.setId(szgqid);
+				code.setSzgq(szgq);
+
+				GkjyrEntity ssjyr = new GkjyrEntity();
+				ssjyr.setId(jyrid);
+				code.setSsjyr(ssjyr);
+				
+				if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+					if (path.indexOf("add") > 0) {
+						code.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+					} else {
+						code.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+					}
+				}
+				zxjxService.save(code);
+				wr.setAttr("entity", code);
+			}
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
+	@Override
+	public String delete(String id, String czid) {
+
+		WebJsonResult wr = success();
+		if (!this.checkUser()){
+			wr.setSuccess(false);
+			wr.setMessage(BaseWebCtl.NOLOGIN);
+			return Object2JsonStr(wr);
+		}
+		try {
+			if (!StringUtils.isEmpty(czid)) {
+				XkzglbEntity xkzglb = xkzglbService.findByCzidAndYwid(czid, id);
+				if (xkzglb != null) {
+					xkzglbService.delete(xkzglb.getId());
+				}
+			}
+			// 子类一并删除
+			zxjxService.logicDelete(id);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("删除失败!");
+			e.printStackTrace();
+		}
+		return Object2JsonStr(wr);
+	
+	}
 }