|
@@ -1,32 +1,17 @@
|
|
|
package com.ruoyi.web.controller;
|
|
|
|
|
|
-import cn.hutool.core.util.XmlUtil;
|
|
|
-import cn.hutool.http.HttpRequest;
|
|
|
-import cn.hutool.http.HttpResponse;
|
|
|
-import cn.hutool.http.webservice.SoapClient;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.ruoyi.web.bo.GatherBo;
|
|
|
import com.ruoyi.web.bo.ReleaseBo;
|
|
|
import com.ruoyi.web.bo.ResponseBo;
|
|
|
-import com.ruoyi.web.bo.Steps;
|
|
|
import com.ruoyi.web.config.AesEncryptUtil;
|
|
|
-import com.ruoyi.web.config.ConfigComponent;
|
|
|
import com.ruoyi.web.entity.GatherData;
|
|
|
import com.ruoyi.web.entity.Release;
|
|
|
import com.ruoyi.web.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.w3c.dom.Document;
|
|
|
-import org.w3c.dom.Element;
|
|
|
-import org.w3c.dom.Node;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Locale;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/interaction")
|
|
@@ -39,120 +24,7 @@ public class ProcessController {
|
|
|
private CustomsService customsService;
|
|
|
@Autowired
|
|
|
private ReservationService reservationService;
|
|
|
- @Autowired
|
|
|
- private BulkloadService bulkloadService;
|
|
|
-
|
|
|
- //@GetMapping("/LogOn")
|
|
|
- public ResponseBo LogOn(String a,double b, String c) {
|
|
|
- GatherData gatherData = new GatherData();
|
|
|
- /*gatherData.setIsEmpty(bo.getIsEmpty());
|
|
|
- gatherData.setIsLoaded(bo.getIsLoaded());
|
|
|
-
|
|
|
- gatherData.setCrossCode(bo.getCrossCode());
|
|
|
- gatherData.setCntrnoF(bo.getCntrnoF());
|
|
|
- gatherData.setCntrnoA(bo.getCntrnoA());*/
|
|
|
-
|
|
|
- //进出标识,I进E出
|
|
|
- gatherData.setI_E_FLAG(c);
|
|
|
- //场站号,固定写为场所分配的场站号
|
|
|
- /*gatherData.setAREA_ID(bo.getAreaId());
|
|
|
- //通道号,已经从通道号配置文件中读取
|
|
|
- gatherData.setCHNL_NO(bo.getChnlNo());
|
|
|
- //通道业务类型,通常为A,已经读取
|
|
|
- gatherData.setGETHER_MODE(bo.getGetherMode());*/
|
|
|
- //会话编号,自动生成
|
|
|
- //gatherData.setSESSION_ID(bo.getSessionId());
|
|
|
-
|
|
|
- //IC卡配置信息
|
|
|
- //读取到的IC卡号
|
|
|
- /*gatherData.setIC_ID(bo.getIcId());
|
|
|
- gatherData.setIC_GOODS_NAME(bo.getIcGoodsName());
|
|
|
- gatherData.setIC_BILL_NO(bo.getIcBillNo());
|
|
|
- gatherData.setIC_NO(bo.getIcNo());
|
|
|
- gatherData.setIC_Type(bo.getIcType());
|
|
|
- gatherData.setIC_EXTENDED_CONTENT(bo.getIcExtendedContent());
|
|
|
-
|
|
|
- gatherData.setDR_CUSTOMS_NO(bo.getDrCustomsNo());
|
|
|
- gatherData.setVE_CUSTOMS_NO(bo.getVeCustomsNo());*/
|
|
|
- //读取到的车牌号信息
|
|
|
- gatherData.setVE_LICENSE_NO(a);
|
|
|
- //gatherData.setESEAL_ID(bo.getEsealId());
|
|
|
- //读取到的地磅重量
|
|
|
- gatherData.setGROSS_WT(b);
|
|
|
-
|
|
|
- //VE_RFID信息
|
|
|
- //RFID卡号信息
|
|
|
- //gatherData.setVE_RFID_ID(bo.getVeRfidId());
|
|
|
- //RFID绑定的光学车牌信息
|
|
|
- /*gatherData.setVE_LICENSE_NO_RFID(bo.getVeLicenseNoRfid());
|
|
|
- gatherData.setVE_CUSTOMS_NO_RFID(bo.getVeCustomsNoRfid());
|
|
|
- gatherData.setVE_WT_RFID(bo.getVeWtRfid());
|
|
|
- gatherData.setVE_COMPANY_RFID(bo.getVeCompanyRfid());
|
|
|
- gatherData.setVE_PERFORMANCE_RFID(bo.getVePerformanceRfid());
|
|
|
-
|
|
|
- //DR_RFID信息
|
|
|
- gatherData.setDR_RFID_ID(bo.getDrRfidId());
|
|
|
- gatherData.setDR_NAME(bo.getDrName());
|
|
|
- gatherData.setDR_CUSTOMS_NO_RFID(bo.getDrCustomsNoRfid());
|
|
|
- gatherData.setDR_COMPANY(bo.getDrCompany());
|
|
|
- gatherData.setDR_PERFORMANCE(bo.getDrPerformance());
|
|
|
|
|
|
- gatherData.setOPERATOR_ID(bo.getOperatorId());
|
|
|
- gatherData.setOPERATE_TIME(bo.getOperateTime());
|
|
|
-
|
|
|
-
|
|
|
- gatherData.setDOMESTIC_LICENSE_NO(bo.getDomesticLicenseNo());
|
|
|
- //车牌图片保存路径,如有箱号,有箱号图片路径
|
|
|
- gatherData.setDOMESTIC_LICENSE_COLOR(bo.getDomesticLicenseColor());
|
|
|
- gatherData.setFOREIGN_LICENSE_NO(bo.getForeignLicenseNo());
|
|
|
- gatherData.setFOREIGN_LICENSE_COLOR(bo.getForeignLicenseColor());
|
|
|
- gatherData.setCONFIDENCE_RATIO(bo.getConfidenceRatio());*/
|
|
|
- ResponseBo res = bulkloadService.LogOn(gatherData);
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- //@GetMapping("/process_test")
|
|
|
- public ResponseBo process_test() {
|
|
|
- Steps steps = new Steps();
|
|
|
- steps.setName("集装箱");
|
|
|
- steps.setApi("GetBookingInfo");
|
|
|
- steps.setRemark("");
|
|
|
- List<Steps> stepsList = new ArrayList<>();
|
|
|
- stepsList.add(steps);
|
|
|
-
|
|
|
- GatherData gatherData = new GatherData();
|
|
|
- gatherData.setSteps(stepsList);
|
|
|
-
|
|
|
- gatherData.setJsStatus(0);
|
|
|
- gatherData.setContainerStatus(0);
|
|
|
-
|
|
|
- gatherData.setIsEmpty(0);
|
|
|
- gatherData.setIsLoaded(0);
|
|
|
-
|
|
|
- //gatherData.setCrossCode(bo.getCrossCode());
|
|
|
- gatherData.setCntrnoF("TEST2024011");
|
|
|
- gatherData.setCntrnoFType("22G1");
|
|
|
- gatherData.setCntrnoA("TEST2024012");
|
|
|
- gatherData.setCntrnoAType("22G1");
|
|
|
-
|
|
|
- //进出标识,I进E出
|
|
|
- gatherData.setI_E_FLAG("I");
|
|
|
-
|
|
|
- //读取到的车牌号信息
|
|
|
- gatherData.setVE_LICENSE_NO("桂A12345");
|
|
|
- //读取到的地磅重量——>KG转换为吨
|
|
|
- BigDecimal grossWt = new BigDecimal(2600);
|
|
|
- grossWt = grossWt.divide(BigDecimal.valueOf(1000),2, RoundingMode.HALF_UP);
|
|
|
- gatherData.setGROSS_WT(grossWt.doubleValue());
|
|
|
-
|
|
|
- return processService.process(gatherData);
|
|
|
- }
|
|
|
-
|
|
|
- public static void main(String[] args) {
|
|
|
- String content = "C59EDA96487C750AEE056B41FE888FDFB228F42ECCDEE7C288E1B6A84405F9F2AF3505556F25D15BABAAD97631A0DE536CC9D5E02F94C2FFFB754BC12F0D2F75C556994960087433D3D8F358394C20D5B3E3636C423CBED72657A55500EBBF944E9DD496E294EB9555C71D29C1967C5F56411DCD5D2CE7924C54265C548B46C15E512B9A95442578CAC1C71A31DEC443229EFF20DBCAB63CF40C30E59E712DB59948BFF5AF3E8C01177AA07BF0929FF6887DF0103EFCE8CE71268E3E4E3113C71E08C9B6DD84E4AA7FDBCAD73B6C9EE0EBA004FB14286D032BB9C8D5D0D81C555C97A443F0FDF635B28AEF5BE28ECEBE6AF0DCB4770B66F4C4ED6149800E9400ED6D89A4C09025497606449659BF81C8D133DDD6B2A0FEB92617C96C1BC558C069617F200977E0B4FCAA7E25574711CB";
|
|
|
- String decrypt = AesEncryptUtil.AESDecrypt(content);
|
|
|
- System.out.println(decrypt);
|
|
|
- }
|
|
|
@PostMapping("/process")
|
|
|
public ResponseBo process(@RequestBody String content) {
|
|
|
log.info("---------------开始---------------");
|
|
@@ -260,69 +132,4 @@ public class ProcessController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- //@GetMapping("/GetBookingInfo")
|
|
|
- public String GetBookingInfo(String veLicenseNo) {
|
|
|
- /*SoapClient client = SoapClient.create("http://10.26.1.34:8531/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", veLicenseNo,false)
|
|
|
- .setParam("msg","",false);
|
|
|
- System.out.println(client.getMsgStr(true));
|
|
|
- HttpResponse response= client.sendForResponse();
|
|
|
- String body = response.body();
|
|
|
- String xml = client.send(true);
|
|
|
-
|
|
|
- Document document= XmlUtil.parseXml(body);
|
|
|
- Element rootElement = XmlUtil.getRootElement(document);
|
|
|
- Element element1=XmlUtil.getElement(rootElement,"s:Body");
|
|
|
- Element element2=XmlUtil.getElement(element1,"GetBookingInfoResponse");
|
|
|
- Node getBookingInfoResult = XmlUtil.getElement(element2, "GetBookingInfoResult").getFirstChild();
|
|
|
- String nodeValue1 = getBookingInfoResult.getNodeValue();
|
|
|
- Node msg = XmlUtil.getElement(element2, "msg").getFirstChild();
|
|
|
- String nodeValue2 = msg.getNodeValue();*/
|
|
|
- //操作员工,请使用员工号
|
|
|
- String I_EMPTNO = "00000";
|
|
|
- //道口号,例:1、2、12
|
|
|
- String I_GAT_GATENO = "I3";
|
|
|
- //车牌号
|
|
|
- String i_trkno = veLicenseNo;
|
|
|
- //提箱/进箱标志 提箱 1;进箱 2
|
|
|
- String I_GAT_DRFG = "1";
|
|
|
- //卡车自重
|
|
|
- Integer I_WEIGHT = 2600;
|
|
|
- //IC卡ID号,填写固定值999999
|
|
|
- String I_ICID = "999999";
|
|
|
- //IC卡类型,填写固定值9
|
|
|
- String I_ICTYPE = "9";
|
|
|
-
|
|
|
- SoapClient client = SoapClient.create("http://10.26.1.34:8531/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", "I3")
|
|
|
- .setParam("i_trkno", "桂AF92120")
|
|
|
- .setParam("I_CNT_VAL", "36773461");
|
|
|
- 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,"GET_CARDSResponse");
|
|
|
- Node node1 = XmlUtil.getElement(element2, "GET_CARDSResult").getFirstChild();
|
|
|
- String result = node1 != null ? node1.getNodeValue() : "";
|
|
|
- log.info("进场小票:\n{}",result);
|
|
|
- /*System.out.println("body:"+body);
|
|
|
- System.out.println("result:"+result);*/
|
|
|
- //log.info("xml:{}",xml);
|
|
|
- return body;
|
|
|
- }
|
|
|
-
|
|
|
}
|