|
@@ -0,0 +1,876 @@
|
|
|
+package com.ruoyi.web.service;
|
|
|
+
|
|
|
+import cn.hutool.core.util.XmlUtil;
|
|
|
+import cn.hutool.http.HttpResponse;
|
|
|
+import cn.hutool.http.webservice.SoapClient;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.ruoyi.web.bo.ResponseBo;
|
|
|
+import com.ruoyi.web.config.ConfigComponent;
|
|
|
+import com.ruoyi.web.config.RestUtil;
|
|
|
+import com.ruoyi.web.entity.GatherData;
|
|
|
+import com.ruoyi.web.entity.VerificationRes;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
+import org.w3c.dom.Document;
|
|
|
+import org.w3c.dom.Element;
|
|
|
+import org.w3c.dom.Node;
|
|
|
+import java.io.StringReader;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 集装箱生产系统接口调用-业务处理
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+public class ContainerService {
|
|
|
+
|
|
|
+ private static final HttpHeaders headers = new HttpHeaders();
|
|
|
+ @Autowired
|
|
|
+ private ConfigComponent configComponent;
|
|
|
+
|
|
|
+
|
|
|
+ /** 获取预约信息接口 */
|
|
|
+ public ResponseBo GetBookingInfo(GatherData gatherData) {
|
|
|
+ gatherData.setJsStatus(0);
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //车牌号
|
|
|
+ String I_TRKNO = gatherData.getVE_LICENSE_NO();
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/GetBookingInfo")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:GetBookingInfo","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("trkno", I_TRKNO)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("集装箱预约信息接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("集装箱预约信息接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"GetBookingInfoResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "GetBookingInfoResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("集装箱进场预约信息接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg(e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ if(MSG.contains("集卡无预约信息")) res.setMsg("没有预约");
|
|
|
+ res.setCode(500);
|
|
|
+ res.setFlag("集装箱无预约");
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<String> jinList = new ArrayList<>();
|
|
|
+ List<String> tiList = new ArrayList<>();
|
|
|
+ ResponseBo jinRes = new ResponseBo();
|
|
|
+ jinRes.setCode(200);
|
|
|
+ ResponseBo tiRes = new ResponseBo();
|
|
|
+ tiRes.setCode(200);
|
|
|
+
|
|
|
+ String[] planNoArr = MSG.split(";");
|
|
|
+ if(planNoArr.length <= 0) {
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("获取预约信息接口:预约信息为空");
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Set<String> cntrnoList = new HashSet<>();
|
|
|
+ for (String str : planNoArr) {
|
|
|
+ String[] arr = str.split(":");
|
|
|
+ if(arr.length != 4) {
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("获取预约信息接口:长度不符——>"+MSG);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if("11".equals(arr[0]) || "12".equals(arr[0])) {//进重箱 或 进空箱
|
|
|
+ if(0 == gatherData.getIsEmpty()) {
|
|
|
+ log.info("["+gatherData.getCHNL_NO()+"]"+"不需验空箱");
|
|
|
+ } else {
|
|
|
+ log.info("["+gatherData.getCHNL_NO()+"]需验空箱");
|
|
|
+ if("1".equals(arr[4])) {//已验
|
|
|
+ log.info("验箱通过:["+arr[1]+"]已验空箱");
|
|
|
+ } else {//未验
|
|
|
+ log.info("未验空箱:["+arr[1]+"],请退回!!!");
|
|
|
+ res.setMsg("未验空箱:["+arr[1]+"],请退回!!!");
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(0 == gatherData.getIsLoaded()) {
|
|
|
+ log.info("["+gatherData.getCHNL_NO()+"]"+"不需验重箱");
|
|
|
+ } else {
|
|
|
+ log.info("["+gatherData.getCHNL_NO()+"]需验重箱");
|
|
|
+ if("1".equals(arr[4])) {//已验
|
|
|
+ log.info("验箱通过:["+arr[1]+"]已验重箱");
|
|
|
+ } else {//未验
|
|
|
+ log.info("未验重箱,请退回!!!");
|
|
|
+ res.setMsg("未验重箱:["+arr[1]+"],请退回!!!");
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ jinList.add(str);
|
|
|
+ if(!StringUtils.isEmpty(arr[1])) cntrnoList.add(arr[1]);
|
|
|
+ } else {
|
|
|
+ tiList.add(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gatherData.setCntrnoList(cntrnoList);
|
|
|
+
|
|
|
+ if(jinList.size() > 0) {
|
|
|
+ jinRes = this.SAVE_TRUCK_INFOR(gatherData, "2", jinList);
|
|
|
+ }
|
|
|
+ if(tiList.size() > 0 && 200 == jinRes.getCode()) {
|
|
|
+ tiRes = this.SAVE_TRUCK_INFOR(gatherData, "1", tiList);
|
|
|
+ }
|
|
|
+ if(200 == jinRes.getCode() && 200 == tiRes.getCode()) {
|
|
|
+ res = this.TRUCK_PASS(gatherData);
|
|
|
+ } else {
|
|
|
+ res.setCode(500);
|
|
|
+ if(500 == jinRes.getCode()) res.setMsg(jinRes.getMsg());
|
|
|
+ if(500 == tiRes.getCode()) res.setMsg(tiRes.getMsg());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 保存集卡进出道口信息接口 */
|
|
|
+ public ResponseBo SAVE_TRUCK_INFOR(GatherData gatherData, String flag, List<String> planNoArr) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //提箱/进箱标志 提箱 1;进箱 2
|
|
|
+ String I_GAT_DRFG = flag;
|
|
|
+ //卡车自重
|
|
|
+ Double I_WEIGHT = gatherData.getGROSS_WT();
|
|
|
+ Integer weight = I_WEIGHT != null ? I_WEIGHT.intValue() : 0;
|
|
|
+ //IC卡ID号,填写固定值999999
|
|
|
+ String I_ICID = "999999";
|
|
|
+ //IC卡类型,填写固定值9
|
|
|
+ String I_ICTYPE = "9";
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_TRUCK_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_TRUCK_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_GAT_DRFG", I_GAT_DRFG)
|
|
|
+ .setParam("i_weight", weight)
|
|
|
+ .setParam("I_ICID", I_ICID)
|
|
|
+ .setParam("i_ictype", I_ICTYPE)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存集卡进出道口信息接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("保存集卡进出道口信息接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"SAVE_TRUCK_INFORResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "SAVE_TRUCK_INFORResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存集卡进出道口信息接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存集卡进出道口信息接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if("1".equals(flag)) {//1 提箱
|
|
|
+ ResponseBo saveWeightInfor = this.SAVE_WEIGHT_INFOR(gatherData);
|
|
|
+ ResponseBo savePlanInfor = this.SAVE_PLAN_INFOR(gatherData, planNoArr);
|
|
|
+ if(200 == saveWeightInfor.getCode() && 200 == savePlanInfor.getCode()) {
|
|
|
+ //提箱业务传入预约号
|
|
|
+ String notes = "";
|
|
|
+ String[] arr = planNoArr.get(0).split(":");
|
|
|
+ if (!StringUtils.isEmpty(arr[2])) {
|
|
|
+ notes = this.GET_CARDS(gatherData, arr[2]).getMsg();
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setNotes(notes);
|
|
|
+ } else {
|
|
|
+ res.setCode(500);
|
|
|
+ if(500 == saveWeightInfor.getCode()) res.setMsg(saveWeightInfor.getMsg());
|
|
|
+ if(500 == savePlanInfor.getCode()) res.setMsg(savePlanInfor.getMsg());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {//2 进箱
|
|
|
+ ResponseBo saveWeightInfor = this.SAVE_WEIGHT_INFOR(gatherData);
|
|
|
+ ResponseBo saveContainerInfor = this.SAVE_CONTAINER_INFOR(gatherData);
|
|
|
+ ResponseBo saveDmgcdInfor = this.SAVE_DMGCD_INFOR(gatherData);
|
|
|
+ if(200 == saveWeightInfor.getCode() && 200 == saveContainerInfor.getCode() && 200 == saveDmgcdInfor.getCode()) {
|
|
|
+ //进箱业务传入箱号
|
|
|
+ String notes = "";
|
|
|
+ String[] arr = planNoArr.get(0).split(":");
|
|
|
+ if(!StringUtils.isEmpty(arr[1])) {
|
|
|
+ notes = this.GET_CARDS(gatherData, arr[1]).getMsg();
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setNotes(notes);
|
|
|
+ } else {
|
|
|
+ res.setCode(500);
|
|
|
+ if(500 == saveWeightInfor.getCode()) res.setMsg(saveWeightInfor.getMsg());
|
|
|
+ if(500 == saveContainerInfor.getCode()) res.setMsg(saveContainerInfor.getMsg());
|
|
|
+ if(500 == saveDmgcdInfor.getCode()) res.setMsg(saveDmgcdInfor.getMsg());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 保存磅秤重量接口 */
|
|
|
+ public ResponseBo SAVE_WEIGHT_INFOR(GatherData gatherData) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //地磅重量
|
|
|
+ Double I_GAT_WEIGHT = gatherData.getGROSS_WT();
|
|
|
+ Integer weight = I_GAT_WEIGHT != null ? I_GAT_WEIGHT.intValue() : 0;
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_WEIGHT_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_WEIGHT_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_GAT_WEIGHT", weight)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存磅秤重量接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("保存磅秤重量接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"SAVE_WEIGHT_INFORResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "SAVE_WEIGHT_INFORResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存磅秤重量接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存磅秤重量接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 保存进箱信息接口 */
|
|
|
+ public ResponseBo SAVE_CONTAINER_INFOR(GatherData gatherData) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //前箱箱号
|
|
|
+ String I_GAT_CNTRNO1 = gatherData.getCntrnoF();
|
|
|
+ //前箱的 UNISO 代码
|
|
|
+ String I_GAT_CTYPE1 = gatherData.getCntrnoFType();
|
|
|
+ //后箱箱号
|
|
|
+ String I_GAT_CNTRNO2 = gatherData.getCntrnoA();
|
|
|
+ //后箱的 UNISO 代码
|
|
|
+ String I_GAT_CTYPE2 = gatherData.getCntrnoAType();
|
|
|
+ if(StringUtils.isEmpty(I_GAT_CNTRNO1) && StringUtils.isEmpty(I_GAT_CNTRNO2)) {
|
|
|
+ res.setMsg("箱号为空");
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Set<String> cntrnoList = gatherData.getCntrnoList();
|
|
|
+ for (String cntrno : cntrnoList) {
|
|
|
+ if(!cntrno.equalsIgnoreCase(I_GAT_CNTRNO1) && !cntrno.equalsIgnoreCase(I_GAT_CNTRNO2)) {
|
|
|
+ res.setMsg("箱号识别错误!系统箱号为:"+cntrnoList.toString());
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //填写固定值 0
|
|
|
+ String I_GAT_NO_GETTP1 = "0";
|
|
|
+ String I_GAT_NO_GETTP2 = "0";
|
|
|
+ //请传入空值
|
|
|
+ String i_gat_cntphoto_id = "";
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_CONTAINER_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_CONTAINER_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_GAT_CNTRNO1", I_GAT_CNTRNO1)
|
|
|
+ .setParam("I_GAT_CTYPE1", I_GAT_CTYPE1)
|
|
|
+ .setParam("I_GAT_CNTRNO2", I_GAT_CNTRNO2)
|
|
|
+ .setParam("I_GAT_CTYPE2", I_GAT_CTYPE2)
|
|
|
+ .setParam("I_GAT_NO_GETTP1", I_GAT_NO_GETTP1)
|
|
|
+ .setParam("I_GAT_NO_GETTP2", I_GAT_NO_GETTP2)
|
|
|
+ .setParam("i_gat_cntphoto_id", i_gat_cntphoto_id)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存进箱信息接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("保存进箱信息接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"SAVE_CONTAINER_INFORResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "SAVE_CONTAINER_INFORResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存进箱信息接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存进箱信息接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 保存验残结果接口 */
|
|
|
+ public ResponseBo SAVE_DMGCD_INFOR(GatherData gatherData) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //残损 ID,请传入空值
|
|
|
+ String I_GAT_DMGID = "";
|
|
|
+ //传入固定值 NN
|
|
|
+ String I_GAT_DMGCD1 = "NN";
|
|
|
+ //传入固定值 NN
|
|
|
+ String I_GAT_DMGCD2 = "NN";
|
|
|
+ //验残员工号
|
|
|
+ String I_EMPNO = "12839";
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_DMGCD_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_DMGCD_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_GAT_DMGID", I_GAT_DMGID)
|
|
|
+ .setParam("I_GAT_DMGCD1", I_GAT_DMGCD1)
|
|
|
+ .setParam("I_GAT_DMGCD2", I_GAT_DMGCD2)
|
|
|
+ .setParam("I_EMPNO", I_EMPNO)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存验残结果接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("保存验残结果接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"SAVE_DMGCD_INFORResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "SAVE_DMGCD_INFORResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存验残结果接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存验残结果接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /** 保存计划信息接口 */
|
|
|
+ public ResponseBo SAVE_PLAN_INFOR(GatherData gatherData, List<String> planNoArr) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //提箱/进箱标志 提箱 1;进箱 2
|
|
|
+ String I_GAT_DRFG = "1";
|
|
|
+ //预约号
|
|
|
+ String[] str = planNoArr.get(0).split(":");
|
|
|
+ String I_GAT_PLANNO = str[2];
|
|
|
+ if(StringUtils.isEmpty(I_GAT_PLANNO)) {
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存计划信息接口——保存前箱:预约号为空");
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ //前后标志( F 前 A 后)
|
|
|
+ String I_FBFG = "F";
|
|
|
+ //校验码 ,请传入空值
|
|
|
+ String I_GAT_CHECKCD = "";
|
|
|
+ //进场类型 ,请传入空值
|
|
|
+ String I_GAT_INTYPE = "";
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_PLAN_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_PLAN_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("i_GAT_DRFG", I_GAT_DRFG)
|
|
|
+ .setParam("I_GAT_PLANNO", I_GAT_PLANNO)
|
|
|
+ .setParam("I_GAT_CHECKCD", I_GAT_CHECKCD)
|
|
|
+ .setParam("I_FBFG", I_FBFG)
|
|
|
+ .setParam("I_GAT_INTYPE", I_GAT_INTYPE)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存计划信息接口——保存前箱:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("保存计划信息接口——保存前箱输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"SAVE_PLAN_INFORResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "SAVE_PLAN_INFORResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存计划信息接口——保存前箱报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存计划信息接口——保存前箱报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(planNoArr.size() == 2) {
|
|
|
+ str = planNoArr.get(1).split(":");
|
|
|
+ I_GAT_PLANNO = str[2];
|
|
|
+ if(StringUtils.isEmpty(I_GAT_PLANNO)) {
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存计划信息接口——保存后箱:预约号为空");
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ //前后标志( F 前 A 后)
|
|
|
+ I_FBFG = "A";
|
|
|
+ String result1 = "";
|
|
|
+ String MSG1 = "";
|
|
|
+ try {
|
|
|
+ SoapClient client1 = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/SAVE_PLAN_INFOR")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:SAVE_PLAN_INFOR","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("i_GAT_DRFG", I_GAT_DRFG)
|
|
|
+ .setParam("I_GAT_PLANNO", I_GAT_PLANNO)
|
|
|
+ .setParam("I_GAT_CHECKCD", I_GAT_CHECKCD)
|
|
|
+ .setParam("I_FBFG", I_FBFG)
|
|
|
+ .setParam("I_GAT_INTYPE", I_GAT_INTYPE)
|
|
|
+ .setParam("msg","");
|
|
|
+ log.info("保存计划信息接口——保存后箱:\n{}",client1.getMsgStr(true));
|
|
|
+ HttpResponse response1 = client1.sendForResponse();
|
|
|
+ String body1 = response1.body();
|
|
|
+ log.info("保存计划信息接口——保存后箱输出报文:\n{}",body1);
|
|
|
+ Document document1 = XmlUtil.parseXml(body1);
|
|
|
+ Element rootElement1 = XmlUtil.getRootElement(document1);
|
|
|
+ Element element11 =XmlUtil.getElement(rootElement1,"s:Body");
|
|
|
+ Element element21 =XmlUtil.getElement(element11,"SAVE_PLAN_INFORResponse");
|
|
|
+ Node node11 = XmlUtil.getElement(element21, "SAVE_PLAN_INFORResult").getFirstChild();
|
|
|
+ result1 = node11 != null ? node11.getNodeValue() : "";
|
|
|
+ Node node21 = XmlUtil.getElement(element21, "msg").getFirstChild();
|
|
|
+ MSG1 = node21 != null ? node21.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("保存计划信息接口——保存后箱报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("保存计划信息接口——保存后箱报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(MSG1);
|
|
|
+ if("false".equals(result1)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /** 获取进场小票信息接口 */
|
|
|
+ public ResponseBo GET_CARDS(GatherData gatherData, String I_CNT_VAL) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/GET_CARDS")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:GET_CARDS","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_CNT_VAL", I_CNT_VAL);
|
|
|
+ log.info("获取进场小票信息接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ body = body.replaceAll("
","\n").replaceAll("","");
|
|
|
+ log.info("获取进场小票信息接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"GET_CARDSResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "GET_CARDSResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ log.info("进场小票:\n{}",result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("获取进场小票信息接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("获取进场小票信息接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg(result);
|
|
|
+ /*if(StringUtils.isEmpty(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ return res;
|
|
|
+ }*/
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 车辆放行接口 */
|
|
|
+ public ResponseBo TRUCK_PASS(GatherData gatherData) {
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/TRUCK_PASS")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:TRUCK_PASS","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("msg", "");
|
|
|
+ log.info("车辆放行接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("车辆放行接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"TRUCK_PASSResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "TRUCK_PASSResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("车辆放行接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("车辆放行接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if("false".equals(result)) {
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg("车辆放行");
|
|
|
+ res.setJsStatus(1);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /** 车辆出场确认接口 */
|
|
|
+ public ResponseBo CONFIRM_OUTYARD(GatherData gatherData) {
|
|
|
+ gatherData.setJsStatus(0);
|
|
|
+ ResponseBo res = new ResponseBo();
|
|
|
+ res.setJsStatus(gatherData.getJsStatus());
|
|
|
+ res.setContainerStatus(gatherData.getContainerStatus());
|
|
|
+ //操作员工,请使用员工号
|
|
|
+ String I_EMPTNO = "00000";
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();//"I3";
|
|
|
+ //车牌号
|
|
|
+ String i_trkno = gatherData.getVE_LICENSE_NO();
|
|
|
+ //箱号 1 (进箱传真实箱号 提箱传 null)
|
|
|
+ String I_GAT_CNTRNO1 = gatherData.getCntrnoF();
|
|
|
+ //箱号 2 (进箱传真实箱号 提箱传 null)
|
|
|
+ String I_GAT_CNTRNO2 = gatherData.getCntrnoA();
|
|
|
+ //记录车辆出场时的重量信息
|
|
|
+ Double I_GAT_WEIGHT = gatherData.getGROSS_WT();
|
|
|
+ Integer weight = I_GAT_WEIGHT != null ? I_GAT_WEIGHT.intValue() : 0;
|
|
|
+
|
|
|
+ String result = "";
|
|
|
+ String MSG = "";
|
|
|
+ try {
|
|
|
+ SoapClient client = SoapClient.create("http://10.3.2.214:8097/TOPSService/SHB.TOPS.Contract.Gate.SmartGate.ISmartGate")
|
|
|
+ .header("SOAPAction","http://tempuri.org/ISmartGate/CONFIRM_OUTYARD")
|
|
|
+ .header("Content-Type","text/xml; charset=utf-8")
|
|
|
+ // 设置要请求的方法,此接口方法前缀为web,传入对应的命名空间
|
|
|
+ .setMethod("tem:CONFIRM_OUTYARD","http://tempuri.org/")
|
|
|
+ // 设置参数,此处自动添加方法的前缀:web
|
|
|
+ .setParam("I_EMPTNO", I_EMPTNO)
|
|
|
+ .setParam("I_GAT_GATENO", I_GAT_GATENO)
|
|
|
+ .setParam("i_trkno", i_trkno)
|
|
|
+ .setParam("I_GAT_CNTRNO1", I_GAT_CNTRNO1)
|
|
|
+ .setParam("I_GAT_CNTRNO2", I_GAT_CNTRNO2)
|
|
|
+ .setParam("I_GAT_WEIGHT", weight)
|
|
|
+ .setParam("msg", "");
|
|
|
+ log.info("车辆出场确认接口:\n{}",client.getMsgStr(true));
|
|
|
+ HttpResponse response= client.sendForResponse();
|
|
|
+ String body = response.body();
|
|
|
+ log.info("车辆出场确认接口输出报文:\n{}",body);
|
|
|
+ Document document= XmlUtil.parseXml(body);
|
|
|
+ Element rootElement = XmlUtil.getRootElement(document);
|
|
|
+ Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
+ Element element2=XmlUtil.getElement(element1,"CONFIRM_OUTYARDResponse");
|
|
|
+ Node node1 = XmlUtil.getElement(element2, "CONFIRM_OUTYARDResult").getFirstChild();
|
|
|
+ result = node1 != null ? node1.getNodeValue() : "";
|
|
|
+ Node node2 = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
+ MSG = node2 != null ? node2.getNodeValue() : "";
|
|
|
+ } catch (Exception e) {
|
|
|
+ //{"code":500,"msg":"车辆出场确认接口报错:Parse XML from stream error!","examineState":"有集装箱预约","jsStatus":0,"containerStatus":1,"notes":null,"flag":null,"registrationNo":null}
|
|
|
+ log.info("车辆出场确认接口报错:{}",e.getMessage());
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg("车辆出场确认接口报错:"+e.getMessage());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if("false".equals(result)) {
|
|
|
+ if(MSG.contains("确认集卡号是否正确")) {
|
|
|
+ res.setFlag("集装箱无预约");
|
|
|
+ }
|
|
|
+ res.setCode(500);
|
|
|
+ res.setMsg(MSG);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setCode(200);
|
|
|
+ res.setMsg("车辆放行");
|
|
|
+ res.setJsStatus(1);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /** 获取出场小票信息接口 */
|
|
|
+ public void GET_OUTCARDS(GatherData gatherData) {
|
|
|
+ //道口号,例:1、2、12
|
|
|
+ String I_GAT_GATENO = gatherData.getCrossCode();
|
|
|
+ //车牌号
|
|
|
+ String I_TRKNO = gatherData.getVE_LICENSE_NO();
|
|
|
+
|
|
|
+ //请求地址
|
|
|
+ String url = configComponent.getGETOUTCARDSUrl()+"?I_GAT_GATENO="+I_GAT_GATENO+"&I_TRKNO="+I_TRKNO;
|
|
|
+
|
|
|
+ //返回预约结果对象
|
|
|
+ JSONObject jsonObject = RestUtil.get(url, headers);
|
|
|
+ String slips = jsonObject.getString("Slips");
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 修改铅封号接口 */
|
|
|
+ public void UpdateSealNo(GatherData gatherData) {
|
|
|
+ //箱号(必填)
|
|
|
+ String cntrNo = "";
|
|
|
+ //铅封号(必填)
|
|
|
+ String sealNo = gatherData.getVE_LICENSE_NO();
|
|
|
+ //修改人
|
|
|
+ String userName = "";
|
|
|
+ //错误信息,例:修改失败
|
|
|
+ String MSG = "";
|
|
|
+
|
|
|
+ //请求地址
|
|
|
+ String url = configComponent.getUpdateSealNoUrl();
|
|
|
+ //请求体
|
|
|
+ String body = "{\"cntrNo\":\""+cntrNo+"\",\"sealNo\":\""+sealNo+"\",\"userName\":\""+userName+"\"," +
|
|
|
+ "\"MSG\":\""+MSG+"\"}";
|
|
|
+ JSONObject params = JSONObject.parseObject(body);
|
|
|
+
|
|
|
+ //返回预约结果对象
|
|
|
+ /*{"RESULT":true,"MESSAGE":""}*/
|
|
|
+ JSONObject jsonObject = RestUtil.post(url, headers, params);
|
|
|
+ VerificationRes result = JSONObject.parseObject(jsonObject.toString(), VerificationRes.class);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 获取残损代码接口 */
|
|
|
+ public void GetDamageCode(GatherData gatherData) {
|
|
|
+ //残损代码
|
|
|
+ String damageCodes = "";
|
|
|
+ //错误信息,例:获取代码失败
|
|
|
+ String MSG = "";
|
|
|
+
|
|
|
+ //请求地址
|
|
|
+ String url = configComponent.getGetDamageCodeUrl();
|
|
|
+ //请求体
|
|
|
+ String body = "{\"damageCodes\":\""+damageCodes+"\",\"MSG\":\""+MSG+"\"}";
|
|
|
+ JSONObject params = JSONObject.parseObject(body);
|
|
|
+
|
|
|
+ //返回预约结果对象
|
|
|
+ /*{"RESULT":true,"MESSAGE":""}*/
|
|
|
+ JSONObject jsonObject = RestUtil.post(url, headers, params);
|
|
|
+ VerificationRes result = JSONObject.parseObject(jsonObject.toString(), VerificationRes.class);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 残损登记接口 */
|
|
|
+ public void SavelDamageInfo(GatherData gatherData) {
|
|
|
+ //箱号(必填)
|
|
|
+ String cntrNo = "";
|
|
|
+ //原/工残 X-- 不明残损 O--原残 W--工残(必填)
|
|
|
+ String originalDamageFlag = "";
|
|
|
+ //残损代码(必填)
|
|
|
+ String damageCode = "";
|
|
|
+ //备注
|
|
|
+ String remark = "";
|
|
|
+ //登记员
|
|
|
+ String userName = "";
|
|
|
+ //错误信息,例:登记失败
|
|
|
+ String MSG = "";
|
|
|
+
|
|
|
+ //请求地址
|
|
|
+ String url = configComponent.getSavelDamageInfoUrl();
|
|
|
+ //请求体
|
|
|
+ String body = "{\"cntrNo\":\""+cntrNo+"\",\"originalDamageFlag\":\""+originalDamageFlag+"\",\"damageCode\":\""+damageCode+"\",\"remark\":\""+remark+"\"," +
|
|
|
+ "\"userName\":\""+userName+"\",\"MSG\":\""+MSG+"\"}";
|
|
|
+ JSONObject params = JSONObject.parseObject(body);
|
|
|
+
|
|
|
+ //返回预约结果对象
|
|
|
+ /*{"RESULT":true,"MESSAGE":""}*/
|
|
|
+ JSONObject jsonObject = RestUtil.post(url, headers, params);
|
|
|
+ VerificationRes result = JSONObject.parseObject(jsonObject.toString(), VerificationRes.class);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|