|
@@ -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);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|