正在显示
15 个修改的文件
包含
666 行增加
和
68 行删除
| @@ -14,10 +14,10 @@ spring.mvc.view.suffix=/WEB-INF/jsp/ | @@ -14,10 +14,10 @@ spring.mvc.view.suffix=/WEB-INF/jsp/ | ||
| 14 | #\u6620\u5C04\u540E\u7F00 | 14 | #\u6620\u5C04\u540E\u7F00 |
| 15 | spring.mvc.view.prefix=.jsp | 15 | spring.mvc.view.prefix=.jsp |
| 16 | #\u8BBE\u7F6E\u672C\u5730\u6570\u636E\u6E90 | 16 | #\u8BBE\u7F6E\u672C\u5730\u6570\u636E\u6E90 |
| 17 | -spring.datasource.username=root | ||
| 18 | -spring.datasource.password=root | 17 | +spring.datasource.username=110 |
| 18 | +spring.datasource.password=QAHqCJf2kFYCLirM | ||
| 19 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver | 19 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
| 20 | -spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai | 20 | +spring.datasource.url=jdbc:mysql://118.31.66.166:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai |
| 21 | #\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90 | 21 | #\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90 |
| 22 | #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver | 22 | #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
| 23 | #spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai | 23 | #spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai |
| @@ -17,6 +17,7 @@ STYP=CARM | @@ -17,6 +17,7 @@ STYP=CARM | ||
| 17 | 17 | ||
| 18 | #\u8F7D\u91CD\u4E0E\u79F0\u91CD\u7684\u53EF\u63A7\u8303\u56F4 ?% | 18 | #\u8F7D\u91CD\u4E0E\u79F0\u91CD\u7684\u53EF\u63A7\u8303\u56F4 ?% |
| 19 | grossWt=5% | 19 | grossWt=5% |
| 20 | +station=4600329012 | ||
| 20 | 21 | ||
| 21 | #\u4E8C\u7EF4\u7801\u5B58\u653E\u8DEF\u5F84\uFF0C\u9879\u76EE\u542F\u52A8\u65F6\u8BBE\u7F6E\uFF0C\u540E\u671F\u4E0D\u80FD\u66F4\u6539\u3002 | 22 | #\u4E8C\u7EF4\u7801\u5B58\u653E\u8DEF\u5F84\uFF0C\u9879\u76EE\u542F\u52A8\u65F6\u8BBE\u7F6E\uFF0C\u540E\u671F\u4E0D\u80FD\u66F4\u6539\u3002 |
| 22 | #barCode = barcode/ | 23 | #barCode = barcode/ |
src/main/java/META-INF/MANIFEST.MF
已删除
100644 → 0
| 1 | -Manifest-Version: 1.0 | ||
| 2 | -Class-Path: spring-boot-autoconfigure-2.1.0.RELEASE.jar geronimo-stax- | ||
| 3 | - api_1.0_spec-1.0.1.jar spring-boot-starter-json-2.1.0.RELEASE.jar Xml | ||
| 4 | - Schema-1.4.7.jar snakeyaml-1.23.jar log4j-to-slf4j-2.11.1.jar stax-ap | ||
| 5 | - i-1.0.1.jar com.ibm.mq.defaultconfig.jar javax.annotation-api-1.3.2.j | ||
| 6 | - ar ProcessService.jar jul-to-slf4j-1.7.25.jar druid-1.1.9.jar pagehel | ||
| 7 | - per-spring-boot-autoconfigure-1.2.3.jar spring-boot-starter-web-2.1.0 | ||
| 8 | - .RELEASE.jar logback-core-1.2.3.jar wsdl4j-1.6.2.jar com.ibm.mq.fta.j | ||
| 9 | - ar jackson-annotations-2.9.0.jar druid-spring-boot-starter-1.1.9.jar | ||
| 10 | - commons-lang-2.4.jar jboss-logging-3.3.2.Final.jar xml-apis-1.4.01.ja | ||
| 11 | - r com.ibm.mq.jms.Nojndi.jar jackson-databind-2.9.7.jar spring-boot-2. | ||
| 12 | - 1.0.RELEASE.jar hibernate-validator-6.0.13.Final.jar mybatis-spring-b | ||
| 13 | - oot-starter-1.3.2.jar mybatis-spring-boot-autoconfigure-1.3.2.jar mys | ||
| 14 | - ql-connector-java-8.0.13.jar UploadService.jar com.ibm.mq.jmqi.jar co | ||
| 15 | - m.ibm.mqjms.jar fastjson-1.2.47.jar spring-jcl-5.1.2.RELEASE.jar xmls | ||
| 16 | - ec-1.4.4.jar jackson-datatype-jdk8-2.9.7.jar apiConfig.jar sigar.jar | ||
| 17 | - com.ibm.mq.axis2.jar spring-aop-5.1.2.RELEASE.jar spring-webmvc-5.1.2 | ||
| 18 | - .RELEASE.jar log4j-1.2.17.jar CL3Export.jar mybatis-spring-1.3.2.jar | ||
| 19 | - geronimo-javamail_1.4_spec-1.2.jar mybatis-3.4.6.jar log4j-api-2.11.1 | ||
| 20 | - .jar commons-codec-1.11.jar spring-tx-5.1.2.RELEASE.jar com.ibm.mq.so | ||
| 21 | - ap.jar com.ibm.mqetclient.jar jackson-core-2.9.7.jar com.ibm.mq.postc | ||
| 22 | - ard.jar spring-core-5.1.2.RELEASE.jar xmlpull-1.1.3.1.jar xpp3_min-1. | ||
| 23 | - 1.4c.jar geronimo-activation_1.1_spec-1.0.1.jar HikariCP-3.2.0.jar sp | ||
| 24 | - ring-boot-starter-2.1.0.RELEASE.jar xmlbeans-2.4.0.jar cxf-2.3.2.jar | ||
| 25 | - spring-boot-starter-logging-2.1.0.RELEASE.jar logback-classic-1.2.3.j | ||
| 26 | - ar jsqlparser-1.0.jar axiom-api-1.2.7.jar com.ibm.mq.pcf.jar jackson- | ||
| 27 | - module-parameter-names-2.9.7.jar cxf-xjc-bug671-2.3.2.jar validation- | ||
| 28 | - api-2.0.1.Final.jar IMFClient.1.0.0.jar httpcore-4.4.10.jar Heartbeat | ||
| 29 | - Service.jar slf4j-api-1.7.25.jar axiom-impl-1.2.7.jar xstream-1.4.10. | ||
| 30 | - jar commons-logging-1.1.1.jar neethi-2.0.4.jar pagehelper-spring-boot | ||
| 31 | - -starter-1.2.3.jar com.ibm.mq.headers.jar com.ibm.mq.jar core-3.3.0.j | ||
| 32 | - ar spring-jdbc-5.1.2.RELEASE.jar httpclient-4.5.5.jar mybatis-generat | ||
| 33 | - or-core-1.3.6.jar spring-beans-5.1.2.RELEASE.jar CL3Nonexport.jar dom | ||
| 34 | - 4j-2.1.0.jar jaxen-1.1.6.jar imfmsg.jar com.ibm.mq.tools.ras.jar clas | ||
| 35 | - smate-1.4.0.jar wstx-asl-3.2.4.jar returnXml.jar cxf-xjc-boolean-3.2. | ||
| 36 | - 3.jar spring-expression-5.1.2.RELEASE.jar cxf-xjc-dv-2.3.2.jar pagehe | ||
| 37 | - lper-5.1.2.jar cxf-manifest.jar com.ibm.mq.commonservices.jar cxf-xjc | ||
| 38 | - -ts-2.3.2.jar spring-context-5.1.2.RELEASE.jar jackson-datatype-jsr31 | ||
| 39 | - 0-2.9.7.jar spring-web-5.1.2.RELEASE.jar spring-boot-starter-jdbc-2.1 | ||
| 40 | - .0.RELEASE.jar commons-io-2.5.jar connector.jar | ||
| 41 | -Main-Class: com.sy.AnalysisImfApplication | ||
| 42 | - |
| 1 | package com.sy; | 1 | package com.sy; |
| 2 | 2 | ||
| 3 | +import com.sy.bwAnalysis.AnalysisRoute; | ||
| 3 | import org.mybatis.spring.annotation.MapperScan; | 4 | import org.mybatis.spring.annotation.MapperScan; |
| 4 | import org.springframework.boot.SpringApplication; | 5 | import org.springframework.boot.SpringApplication; |
| 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| @@ -15,5 +16,49 @@ public class AnalysisImfApplication { | @@ -15,5 +16,49 @@ public class AnalysisImfApplication { | ||
| 15 | 16 | ||
| 16 | public static void main(String[] args) { | 17 | public static void main(String[] args) { |
| 17 | SpringApplication.run(AnalysisImfApplication.class, args); | 18 | SpringApplication.run(AnalysisImfApplication.class, args); |
| 19 | + | ||
| 20 | + /*String message="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + | ||
| 21 | + "<MSG><META><SNDR>KAO</SNDR><RCVR></RCVR><SEQN>20200924082928</SEQN><DDTM>20200924082928</DDTM><TYPE>KAKO</TYPE><STYP>CARM</STYP></META><GATHER_INFO AREA_ID=\"\t\t4600329012\" CHNL_NO=\"\t\t4600010005\" I_E_TYPE=\"E\" SEQ_NO=\"20200924082701000001\">\n" + | ||
| 22 | + " <IC>\n" + | ||
| 23 | + " <DR_IC_NO/>\n" + | ||
| 24 | + " <IC_DR_CUSTOMS_NO/>\n" + | ||
| 25 | + " <IC_CO_CUSTOMS_NO/>\n" + | ||
| 26 | + " <IC_BILL_NO/>\n" + | ||
| 27 | + " <IC_FORM_TYPE/>\n" + | ||
| 28 | + " <IC_GROSS_WT/>\n" + | ||
| 29 | + " <IC_VE_CUSTOMS_NO/>\n" + | ||
| 30 | + " <IC_VE_NAME/>\n" + | ||
| 31 | + " <IC_CONTA_ID/>\n" + | ||
| 32 | + " <IC_ESEAL_ID/>\n" + | ||
| 33 | + " <IC_REG_DATETIME/>\n" + | ||
| 34 | + " <IC_PER_DAY_DUE/>\n" + | ||
| 35 | + " </IC>\n" + | ||
| 36 | + " <WEIGHT>\n" + | ||
| 37 | + " <GROSS_WT>1120.00</GROSS_WT>\n" + | ||
| 38 | + " </WEIGHT>\n" + | ||
| 39 | + " <CAR>\n" + | ||
| 40 | + " <VE_NAME>苏H630D5\t</VE_NAME>\n" + | ||
| 41 | + " <CAR_EC_NO/>\n" + | ||
| 42 | + " <CAR_EC_NO2/>\n" + | ||
| 43 | + " <VE_CUSTOMS_NO/>\n" + | ||
| 44 | + " <VE_WT/>\n" + | ||
| 45 | + " </CAR>\n" + | ||
| 46 | + " <CONTA>\n" + | ||
| 47 | + " <CONTA_NUM/>\n" + | ||
| 48 | + " <CONTA_RECO>1</CONTA_RECO>\n" + | ||
| 49 | + " <CONTA_ID_F/>\n" + | ||
| 50 | + " <CONTA_ID_B/>\n" + | ||
| 51 | + " <CONTA_MODEL_F/>\n" + | ||
| 52 | + " <CONTA_MODEL_B/>\n" + | ||
| 53 | + " </CONTA>\n" + | ||
| 54 | + " <ORDER_NUM/>\n" + | ||
| 55 | + " <BAR_CODE>20201029163743299076</BAR_CODE>\n" + | ||
| 56 | + " <SEAL>\n" + | ||
| 57 | + " <ESEAL_ID/>\n" + | ||
| 58 | + " <SEAL_KEY/>\n" + | ||
| 59 | + " </SEAL>\n" + | ||
| 60 | + "</GATHER_INFO></MSG>"; | ||
| 61 | + | ||
| 62 | + AnalysisRoute.analysis(message);*/ | ||
| 18 | } | 63 | } |
| 19 | } | 64 | } |
| @@ -40,13 +40,13 @@ public class IMF_Tesk { | @@ -40,13 +40,13 @@ public class IMF_Tesk { | ||
| 40 | /** | 40 | /** |
| 41 | * 往IMF发送报文 | 41 | * 往IMF发送报文 |
| 42 | */ | 42 | */ |
| 43 | -// if(!KAKO_Sender.isrunning){ | ||
| 44 | -// KAKO_Sender kako_sender = new KAKO_Sender(client); | ||
| 45 | -// kako_sender.start(); | ||
| 46 | -// logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>"); | ||
| 47 | -// }else { | ||
| 48 | -// logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>"); | ||
| 49 | -// } | 43 | + if(!KAKO_Sender.isrunning){ |
| 44 | + KAKO_Sender kako_sender = new KAKO_Sender(client); | ||
| 45 | + kako_sender.start(); | ||
| 46 | + logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>"); | ||
| 47 | + }else { | ||
| 48 | + logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>"); | ||
| 49 | + } | ||
| 50 | 50 | ||
| 51 | } | 51 | } |
| 52 | if (!LOGIN_OK){ | 52 | if (!LOGIN_OK){ |
| @@ -20,6 +20,7 @@ public class KAKO_Reader extends Thread{ | @@ -20,6 +20,7 @@ public class KAKO_Reader extends Thread{ | ||
| 20 | while(true) { | 20 | while(true) { |
| 21 | if (IMF_Tesk.LOGIN_OK) synchronized (this) { | 21 | if (IMF_Tesk.LOGIN_OK) synchronized (this) { |
| 22 | String message = this.client.getMSG(); | 22 | String message = this.client.getMSG(); |
| 23 | + | ||
| 23 | if (message != null) { | 24 | if (message != null) { |
| 24 | // logger.info(message); | 25 | // logger.info(message); |
| 25 | AnalysisRoute.analysis(message); | 26 | AnalysisRoute.analysis(message); |
| @@ -44,8 +44,8 @@ public class KAKO_Sender extends Thread{ | @@ -44,8 +44,8 @@ public class KAKO_Sender extends Thread{ | ||
| 44 | List<File> files = FileTool.readDirectoryFiles(new File(sendDir)); | 44 | List<File> files = FileTool.readDirectoryFiles(new File(sendDir)); |
| 45 | for (File file:files) { | 45 | for (File file:files) { |
| 46 | String fileContent = FileTool.readfile(file); | 46 | String fileContent = FileTool.readfile(file); |
| 47 | - String sendMsg = MakeImfMeta.makeImfDocument(SNDR,RCVR,TYPE,STYP,new DateTimeConverter().dateFormat(),new DateTimeConverter().dateFormat(),fileContent); | ||
| 48 | - String returnMsg = this.client.sendMSG(sendMsg); | 47 | +// String sendMsg = MakeImfMeta.makeImfDocument(SNDR,RCVR,TYPE,STYP,new DateTimeConverter().dateFormat(),new DateTimeConverter().dateFormat(),fileContent); |
| 48 | + String returnMsg = this.client.sendMSG(fileContent); | ||
| 49 | //发送成功处理,删除已发送成功的目录下的文件 | 49 | //发送成功处理,删除已发送成功的目录下的文件 |
| 50 | if(returnMsg.indexOf("<CODE>9</CODE>")>=0){ | 50 | if(returnMsg.indexOf("<CODE>9</CODE>")>=0){ |
| 51 | FileUtils.forceDelete(file); | 51 | FileUtils.forceDelete(file); |
| 1 | package com.sy.bwAnalysis; | 1 | package com.sy.bwAnalysis; |
| 2 | 2 | ||
| 3 | import com.sy.bwAssist.Message; | 3 | import com.sy.bwAssist.Message; |
| 4 | +import com.sy.logic.LiftBar; | ||
| 4 | import com.sy.logic.LogicOperation; | 5 | import com.sy.logic.LogicOperation; |
| 5 | import com.sy.model.*; | 6 | import com.sy.model.*; |
| 6 | import com.sy.service.*; | 7 | import com.sy.service.*; |
| @@ -81,9 +82,11 @@ public class AnalysisRoute { | @@ -81,9 +82,11 @@ public class AnalysisRoute { | ||
| 81 | commandInfo info = commandInfoAnalysis.toJavaBean(message); | 82 | commandInfo info = commandInfoAnalysis.toJavaBean(message); |
| 82 | route.commandService.save(info); | 83 | route.commandService.save(info); |
| 83 | }else{ | 84 | }else{ |
| 85 | + //处理车辆过磅数据,结合申请数据,判定是否抬杆 | ||
| 84 | GatherInfo info = gatherInfoAnalysis.toJavaBean(message); | 86 | GatherInfo info = gatherInfoAnalysis.toJavaBean(message); |
| 85 | if(info.getBarcode().length()>0){ | 87 | if(info.getBarcode().length()>0){ |
| 86 | - if(LogicOperation.operation(info)){ | 88 | + //LogicOperation.operation(info) |
| 89 | + if(LiftBar.liftBar(info)){ | ||
| 87 | String type = null; | 90 | String type = null; |
| 88 | if("I".equals(info.getIetype())){ | 91 | if("I".equals(info.getIetype())){ |
| 89 | type="进入"; | 92 | type="进入"; |
| @@ -101,6 +104,7 @@ public class AnalysisRoute { | @@ -101,6 +104,7 @@ public class AnalysisRoute { | ||
| 101 | LogicOperation.sendData("HK06",info.getVename(),false); | 104 | LogicOperation.sendData("HK06",info.getVename(),false); |
| 102 | } | 105 | } |
| 103 | } | 106 | } |
| 107 | + //todo:这里场站看下 | ||
| 104 | } | 108 | } |
| 105 | route.infoService.save(info); | 109 | route.infoService.save(info); |
| 106 | } | 110 | } |
src/main/java/com/sy/logic/LiftBar.java
0 → 100644
| 1 | +package com.sy.logic; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.alibaba.fastjson.JSONArray; | ||
| 5 | +import com.sy.crossDomain.buildBarCode; | ||
| 6 | +import com.sy.model.*; | ||
| 7 | +import com.sy.relation.VeManifestRelation; | ||
| 8 | +import com.sy.service.EnterCancelServer; | ||
| 9 | +import com.sy.service.LandBusListService; | ||
| 10 | +import com.sy.service.LandRoadVeService; | ||
| 11 | +import com.sy.service.ResMessageService; | ||
| 12 | +import com.sy.socket.CommandClient; | ||
| 13 | +import com.sy.utils.FileTool; | ||
| 14 | +import org.apache.http.HttpEntity; | ||
| 15 | +import org.apache.http.HttpResponse; | ||
| 16 | +import org.apache.http.client.HttpClient; | ||
| 17 | +import org.apache.http.client.methods.HttpGet; | ||
| 18 | +import org.apache.http.impl.client.DefaultHttpClient; | ||
| 19 | +import org.apache.http.util.EntityUtils; | ||
| 20 | +import org.apache.log4j.PropertyConfigurator; | ||
| 21 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 22 | +import org.springframework.stereotype.Component; | ||
| 23 | +import org.apache.log4j.Logger; | ||
| 24 | + | ||
| 25 | +import javax.annotation.PostConstruct; | ||
| 26 | +import java.io.BufferedReader; | ||
| 27 | +import java.io.IOException; | ||
| 28 | +import java.io.InputStreamReader; | ||
| 29 | +import java.net.MalformedURLException; | ||
| 30 | +import java.net.URL; | ||
| 31 | +import java.net.URLConnection; | ||
| 32 | +import java.text.DecimalFormat; | ||
| 33 | +import java.text.NumberFormat; | ||
| 34 | +import java.text.ParseException; | ||
| 35 | +import java.util.Date; | ||
| 36 | +import java.util.List; | ||
| 37 | +import java.util.Map; | ||
| 38 | + | ||
| 39 | + | ||
| 40 | +@Component | ||
| 41 | +public class LiftBar { | ||
| 42 | + private static final Logger logger = Logger.getLogger(LiftBar.class); | ||
| 43 | + @Autowired | ||
| 44 | + private LandBusListService listService;//进出场申请表 | ||
| 45 | + @Autowired | ||
| 46 | + private LandRoadVeService veService;//车辆信息备案表 | ||
| 47 | + @Autowired | ||
| 48 | + private ResMessageService resMessageService;//查询运单放行表 | ||
| 49 | + @Autowired | ||
| 50 | + private EnterCancelServer enterCancelServer;//调拨业务单独记录表 | ||
| 51 | + private static LiftBar logic = new LiftBar(); | ||
| 52 | + //从配置文件中读取货物重差可控范围 | ||
| 53 | + private static String checkWt = FileTool.readProperties("grossWt"); | ||
| 54 | + //逻辑判断后的返回信息定义 | ||
| 55 | + private static String PERMITTHOUGH = "直接放行"; | ||
| 56 | + private static String GROWSSEXCETION = "禁止通行,重量不在可控范围"; | ||
| 57 | + private static String NORECORD = "车辆未备案或者识别错误,车牌号:"; | ||
| 58 | + private static String INPUTSTATION = "此车辆未做进站申请"; | ||
| 59 | + private static String ENTERSTATION = "此车辆未做出站申请"; | ||
| 60 | + private static String ISVALID = "二维码数据异常,请使用正确的二维码数据"; | ||
| 61 | + private static String ERRORWT = "出起始场站的重量和进目的场站的重量不一致"; | ||
| 62 | + private static String IEPORSE = "无相对应进出场申请"; | ||
| 63 | + private static String FANGXING="有运单未放行"; | ||
| 64 | + | ||
| 65 | + @PostConstruct | ||
| 66 | + public void init() { | ||
| 67 | + logic = this; | ||
| 68 | + logic.listService = this.listService; | ||
| 69 | + logic.veService = this.veService; | ||
| 70 | + logic.resMessageService = this.resMessageService; | ||
| 71 | + logic.enterCancelServer = this.enterCancelServer; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * @Param info 卡口采集数据 | ||
| 76 | + * @Result 计算卡口采集数据并发送报文 | ||
| 77 | + */ | ||
| 78 | + public static boolean liftBar(GatherInfo info) { | ||
| 79 | + PropertyConfigurator.configure("config/log4j.properties"); | ||
| 80 | + //默认返回值 | ||
| 81 | + boolean result = false; | ||
| 82 | + //获取过磅重量 | ||
| 83 | + double growssWt = info.getGrosswt().doubleValue(); | ||
| 84 | + double goodsWt=0.0,inWt=0.0,diffVal=0.0; | ||
| 85 | + //取车牌号,判定卡口是否取到车牌号 | ||
| 86 | + String vaName = info.getVename(); | ||
| 87 | + //若无车牌号,返回未识别错误 | ||
| 88 | + if (vaName.length() <= 0) { | ||
| 89 | + CommandClient.Client(info, NORECORD + vaName); | ||
| 90 | + return result; | ||
| 91 | + } | ||
| 92 | + //校验车辆是否备案 | ||
| 93 | + LandRoadVe ve = logic.veService.selectByFrameNo(vaName); | ||
| 94 | + //若无备案信息,返回车辆未备案或者识别错误 | ||
| 95 | + if (ve == null) { | ||
| 96 | + CommandClient.Client(info, NORECORD + vaName); | ||
| 97 | + return result; | ||
| 98 | + } | ||
| 99 | + /** | ||
| 100 | + * 车牌号,二维码,场站ID/号,通道ID/号,进出业务类型标识I/E | ||
| 101 | + * 查询是否已有此场站通道的申请 | ||
| 102 | + */ | ||
| 103 | + //通过车牌号,二维码,场站,通道号,进出类型查询进出场站申请列表 | ||
| 104 | + LandBusinessTypeList list = logic.listService.selectForOne(info.getVename(), info.getBarcode(), info.getAreaid(), info.getChnlno(), info.getIetype()); | ||
| 105 | + //若查询结果为null,返回无相对应进出场申请 | ||
| 106 | + if (list == null) { | ||
| 107 | + CommandClient.Client(info, IEPORSE); | ||
| 108 | + return result; | ||
| 109 | + } | ||
| 110 | + //判断进出场申请二维码是否已经失效,若失效,sendError | ||
| 111 | + if ("0".equals(list.getIsvalid())) { | ||
| 112 | + //校验重量开始 | ||
| 113 | + boolean checkResult = false; | ||
| 114 | + boolean check = false; | ||
| 115 | + boolean checkMainfest =false; | ||
| 116 | + | ||
| 117 | + //判断是进场申请还是出场申请 | ||
| 118 | + if("I".equals(info.getIetype())){ | ||
| 119 | + //进场申请宽进 | ||
| 120 | + checkResult=true; | ||
| 121 | + }else{ | ||
| 122 | + //获取对应场站进场申请的货物重量,进场过磅重量 | ||
| 123 | + List<LandBusinessTypeList> listWt=logic.listService.selectwt(list.getTrailerFrameNo(),list.getBarcode(),list.getEndstation(),"I"); | ||
| 124 | + for(LandBusinessTypeList typeList:listWt){ | ||
| 125 | + if(typeList.getRemark()!=null && typeList.getRemark()!=""){ | ||
| 126 | + //货物重量 | ||
| 127 | + goodsWt=Double.parseDouble(typeList.getRemark()); | ||
| 128 | + } | ||
| 129 | + if(typeList.getAislewt()!=null){ | ||
| 130 | + //对应场站进场过磅重量 | ||
| 131 | + inWt=typeList.getAislewt(); | ||
| 132 | + } | ||
| 133 | + diffVal = inWt- growssWt; | ||
| 134 | + } | ||
| 135 | + //判断场站出场是否要重量校验 | ||
| 136 | + if(FileTool.readProperties("station").equals(list.getEndstation())){ | ||
| 137 | + checkResult=true; | ||
| 138 | + }else if(!"普通货".equals(list.getCocode())){ | ||
| 139 | + checkResult=true; | ||
| 140 | + }else { | ||
| 141 | + check = logic.checkResult(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt); | ||
| 142 | + if("出口送货".equals(list.getBusinesstype())){ | ||
| 143 | + if(check){ | ||
| 144 | + checkResult=true; | ||
| 145 | + }else{ | ||
| 146 | + CommandClient.Client(info, GROWSSEXCETION); | ||
| 147 | + } | ||
| 148 | + }else{ | ||
| 149 | + checkMainfest = logic.checkManifest(list.getMasterList()); | ||
| 150 | + if(checkMainfest){ | ||
| 151 | + checkResult=check || checkMainfest; | ||
| 152 | + }else{ | ||
| 153 | + CommandClient.Client(info, FANGXING);//有运单未放行 | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + } | ||
| 159 | + if(logic.sendBw(info, checkResult)){//发送抬杆儿报文 | ||
| 160 | + if ("I".equals(info.getIetype())) { | ||
| 161 | + list.setAislewt(info.getGrosswt().doubleValue()); | ||
| 162 | + list.setUpdateDate(new Date()); | ||
| 163 | + //list.setRemark(String.format("%.1f", goodsWt)); | ||
| 164 | + list.setRemark2(ve.getSelfWt()); | ||
| 165 | + list.setContrastflag("已进站"); | ||
| 166 | + logic.checkData(list); | ||
| 167 | + } else { | ||
| 168 | + LandRoadVe veName = logic.veService.selectByFrameNo(vaName); | ||
| 169 | + list.setAislewt(info.getGrosswt().doubleValue()); | ||
| 170 | + list.setUpdateDate(new Date()); | ||
| 171 | + list.setRemark(String.format("%.1f", goodsWt)); | ||
| 172 | + list.setRemark1(String.format("%.1f", diffVal)); | ||
| 173 | + list.setRemark2(veName.getSelfWt()); | ||
| 174 | + list.setContrastflag("已出站"); | ||
| 175 | + logic.checkData(list); | ||
| 176 | + } | ||
| 177 | + logic.listService.updateById(list);//更新进出场申请业务表 | ||
| 178 | + //进出场申请业务表对应场站的卡口失效 | ||
| 179 | + logic.listService.updateisvalid(list.getTrailerFrameNo(),list.getBarcode(),list.getEndstation(),list.getTurnoverflag()); | ||
| 180 | + //判断是否为最后一个场站,若是最后个场站申请为出,二维码失效 | ||
| 181 | + int count=logic.listService.selectlaststation(list.getTrailerFrameNo(),list.getBarcode()); | ||
| 182 | + //二维码失效 | ||
| 183 | + if(count==0){ | ||
| 184 | + buildBarCode.cancleBarCode(vaName); | ||
| 185 | + } | ||
| 186 | + //调拨货冻结 | ||
| 187 | + if (list.getBusinesstype().indexOf("业务") > 0) { | ||
| 188 | + logic.inOrUpEnterCancel(list); | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + //绑定车单关系 | ||
| 192 | + if(list.getMasterList().length()>0){ | ||
| 193 | + boolean flag = VeManifestRelation.createFile(list); | ||
| 194 | + if(flag){ | ||
| 195 | + logger.info(">>>>>>>>>>-----车单关系报文生成成功-----<<<<<<<<<<<<"); | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + } else { | ||
| 200 | + sendError(info); | ||
| 201 | + logger.error("------->>>>>>>二维码数据异常,请使用正确的二维码数据<<<<<<<-----"); | ||
| 202 | + } | ||
| 203 | + return true; | ||
| 204 | + } | ||
| 205 | + /** | ||
| 206 | + * 校验重量并发送报文 | ||
| 207 | + */ | ||
| 208 | + | ||
| 209 | + public boolean sendBw(GatherInfo info, boolean check) { | ||
| 210 | + logger.info(String.format("开始发送指令:车牌%s,场站%s,通道%s,重量%s",info.getVename(),info.getAreaid(),info.getChnlno(),info.getGrosswt())); | ||
| 211 | + boolean flag = false; | ||
| 212 | + if (check) { | ||
| 213 | + CommandClient.Client(info, PERMITTHOUGH); | ||
| 214 | + logger.info("=============>>>>>>>>放行报文发送成功<<<<<<<<<=============="); | ||
| 215 | + flag = true; | ||
| 216 | + } else { | ||
| 217 | + CommandClient.Client(info, GROWSSEXCETION); | ||
| 218 | + logger.info("=============>>>>>>>>重量异常报文发送成功<<<<<<<<<=============="); | ||
| 219 | + } | ||
| 220 | + return flag; | ||
| 221 | + } | ||
| 222 | + /** | ||
| 223 | + * 给码头发送卡口数据 | ||
| 224 | + * | ||
| 225 | + * @param stationCode | ||
| 226 | + * @param carNo | ||
| 227 | + * @param IEtype | ||
| 228 | + */ | ||
| 229 | + public static void sendData(String stationCode, String carNo, boolean IEtype) { | ||
| 230 | + String url = "http://10.50.3.73:8080/air-api/car/channelCar?stationCode=" + stationCode + "&carNo=" + carNo + "&isPickup=" + IEtype; | ||
| 231 | + try { | ||
| 232 | + HttpClient httpClient = new DefaultHttpClient(); | ||
| 233 | + HttpGet httpGet = new HttpGet(url); | ||
| 234 | + HttpResponse httpResponse = httpClient.execute(httpGet); | ||
| 235 | + HttpEntity entity = httpResponse.getEntity(); | ||
| 236 | + String entityStr = EntityUtils.toString(entity); | ||
| 237 | + logger.info("------------>>>>>>>>>>>>>>发送车辆信息:{stationCode:" + stationCode + ",carNo:" + carNo + ",isPickup:" + IEtype + "}"); | ||
| 238 | + logger.info("------------>>>>>>>>>>>>>>响应返回内容:" + entityStr + "<<<<<<<<<<<<-----------"); | ||
| 239 | + } catch (Exception e) { | ||
| 240 | + logger.info(e.toString()); | ||
| 241 | + } | ||
| 242 | + } | ||
| 243 | + /** | ||
| 244 | + * 给码头发送卡口数据 | ||
| 245 | + * | ||
| 246 | + * @param list | ||
| 247 | + */ | ||
| 248 | + public void checkData(LandBusinessTypeList list) { | ||
| 249 | + String sationCode = null; | ||
| 250 | + boolean flag = false; | ||
| 251 | + if ("出口送货".equals(list.getBusinesstype()) || "出口流转".equals(list.getBusinesstype())) { | ||
| 252 | + flag = false; | ||
| 253 | + } | ||
| 254 | + if ("进口提货".equals(list.getBusinesstype()) || "进口流转".equals(list.getBusinesstype())) { | ||
| 255 | + flag = true; | ||
| 256 | + } | ||
| 257 | + if ("4604000000".equals(list.getEndstation())) { | ||
| 258 | + if ("I".equals(list.getTurnoverflag())) { | ||
| 259 | + sationCode = "HK05"; | ||
| 260 | + } else { | ||
| 261 | + sationCode = "HK06"; | ||
| 262 | + } | ||
| 263 | + //TODO:加场站判定 | ||
| 264 | + } | ||
| 265 | + sendData(sationCode, list.getTrailerFrameNo(), flag); | ||
| 266 | + } | ||
| 267 | + /** | ||
| 268 | + * 查询运单是否全部放行 | ||
| 269 | + * | ||
| 270 | + * @param manifestList | ||
| 271 | + * @return | ||
| 272 | + */ | ||
| 273 | + public boolean checkManifest(String manifestList) { | ||
| 274 | + if (manifestList.length() < 1) return false; | ||
| 275 | + manifestList = manifestList.replace("-", ""); | ||
| 276 | + String[] maifest = manifestList.split(","); | ||
| 277 | + boolean flag = false; | ||
| 278 | + int count = 0; | ||
| 279 | + for (int i = 0; i < maifest.length; i++) { | ||
| 280 | + RESMESSAGE resmessage = logic.resMessageService.selectByManifest(maifest[i]); | ||
| 281 | + if (resmessage != null) { | ||
| 282 | + if ("11".equals(resmessage.getResponsecode())) { | ||
| 283 | + count++; | ||
| 284 | + } | ||
| 285 | + } | ||
| 286 | + } | ||
| 287 | + if (count == maifest.length) { | ||
| 288 | + flag = true; | ||
| 289 | + } | ||
| 290 | + return flag; | ||
| 291 | + } | ||
| 292 | + /** | ||
| 293 | + * 校验载重和称重是否在合理的范围 | ||
| 294 | + * | ||
| 295 | + * @Param grossWt 地磅称重 | ||
| 296 | + * @Param wt 车辆自重 | ||
| 297 | + * @Param goodsWt 货物总重 | ||
| 298 | + * @Result 获取运单重量 | ||
| 299 | + */ | ||
| 300 | + /** | ||
| 301 | + * 进场卸货误差判定 | ||
| 302 | + * 出场重量 = 进场重量 - 货物重量 | ||
| 303 | + * 首先计算 进出场差值数 ABS(进场重量-货物重量-出场重量)/出场重量, 计算出出场误差百分比 | ||
| 304 | + * (出场重量 - 车辆备案重量) /出场重量 | ||
| 305 | + * (出场重量 - (车辆备案重量+货物重量)/出场重量 | ||
| 306 | + * (出场重量 - (进场重量+货物重量)/出场重量 | ||
| 307 | + */ | ||
| 308 | + public boolean checkResult(double grossWt, double wt, double goodsWt,double inWt) { | ||
| 309 | + DecimalFormat df = new DecimalFormat("0.00"); | ||
| 310 | + boolean flag = false; | ||
| 311 | + double result= 0.0,result2= 0.0,result3= 0.0,result4= 0.0; | ||
| 312 | + if(grossWt>0){ | ||
| 313 | + result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); | ||
| 314 | + result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); | ||
| 315 | + result3 = Double.parseDouble(df.format(Math.abs((grossWt-wt-goodsWt)) / grossWt)); | ||
| 316 | + result4 = Double.parseDouble(df.format(Math.abs((inWt + goodsWt)) / grossWt)); | ||
| 317 | + } | ||
| 318 | + if (result <= valueDob() ||result2 <= valueDob() || result3 <= valueDob() || result4 <= valueDob()) { | ||
| 319 | + flag = true; | ||
| 320 | + } | ||
| 321 | + return flag; | ||
| 322 | + } | ||
| 323 | + | ||
| 324 | + | ||
| 325 | + | ||
| 326 | + /** | ||
| 327 | + * 排除当前系统问题发送错误commandInfo | ||
| 328 | + */ | ||
| 329 | + public static void sendError(GatherInfo info) { | ||
| 330 | + //二维码数据异常,请使用正确的二维码数据 | ||
| 331 | + CommandClient.Client(info, ISVALID); | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + /** | ||
| 335 | + * @Param mainifast 主单列表 | ||
| 336 | + * @Param ietype 进出标志 | ||
| 337 | + * 获取货物总重 | ||
| 338 | + */ | ||
| 339 | + public double GoodsWt(String mainifast, String ietype) { | ||
| 340 | + Double sum = 0.0; | ||
| 341 | + if (mainifast.length() > 0) { | ||
| 342 | + String[] mainifastList = mainifast.split(","); | ||
| 343 | + for (String mainBill : mainifastList) { | ||
| 344 | + sum += getGrossWt(mainBill, ietype); | ||
| 345 | + } | ||
| 346 | + } | ||
| 347 | + return sum; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + /** | ||
| 351 | + * @Param waybill 主单号 | ||
| 352 | + * @Param imp 进出港标识 | ||
| 353 | + * @Result 获取运单重量 | ||
| 354 | + */ | ||
| 355 | + public double getGrossWt(String waybill, String imp) { | ||
| 356 | + logger.info("进入获取重量action"); | ||
| 357 | + if (!(waybill.indexOf("-") != -1)) { | ||
| 358 | + waybill = waybill.substring(0, 3) + "-" + waybill.substring(3); | ||
| 359 | + } | ||
| 360 | + String url = "http://10.50.3.82:8081/orig/orig?waybill=" + waybill + "&imp=" + imp; | ||
| 361 | + // String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp; | ||
| 362 | + StringBuilder json = new StringBuilder(); | ||
| 363 | + Map map = null; | ||
| 364 | + double bg = 0; | ||
| 365 | + try { | ||
| 366 | + URL Url = new URL(url); | ||
| 367 | + URLConnection yc = Url.openConnection(); | ||
| 368 | + BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "utf-8")); | ||
| 369 | + String inputLine = null; | ||
| 370 | + while ((inputLine = in.readLine()) != null) { | ||
| 371 | + json.append(inputLine); | ||
| 372 | + } | ||
| 373 | + logger.info("返回数据:" + json); | ||
| 374 | + JSONArray array = JSONArray.parseArray(json.toString()); | ||
| 375 | + for (int i = 0; i < array.size(); i++) { | ||
| 376 | + map = JSON.parseObject(array.getString(i)); | ||
| 377 | + if (map.containsKey("receiptinformation")) { | ||
| 378 | + if (map.get("receiptinformation").toString().startsWith("41301") || map.get("receiptinformation") | ||
| 379 | + .toString().startsWith("41106") || map.get("receiptinformation") | ||
| 380 | + .toString().startsWith("31301") || map.get("receiptinformation") | ||
| 381 | + .toString().startsWith("31106") || map.get("receiptinformation") | ||
| 382 | + .toString().indexOf("提运单放行") != -1) { | ||
| 383 | + logger.info(map); | ||
| 384 | + bg = Double.parseDouble((String) map.get("totalweight")); | ||
| 385 | + logger.info("for循环取重量:" + bg); | ||
| 386 | + return bg; | ||
| 387 | + } | ||
| 388 | + } | ||
| 389 | + } | ||
| 390 | + logger.info("访问返回的数据重量:" + bg); | ||
| 391 | + in.close(); | ||
| 392 | + } catch (MalformedURLException e) { | ||
| 393 | + e.printStackTrace(); | ||
| 394 | + logger.error(e); | ||
| 395 | + } catch (IOException e) { | ||
| 396 | + e.printStackTrace(); | ||
| 397 | + logger.error(e); | ||
| 398 | + } | ||
| 399 | + return bg; | ||
| 400 | + } | ||
| 401 | + | ||
| 402 | + /** | ||
| 403 | + * 判断备案车重与运单重量和地磅称重是否在合理范围 | ||
| 404 | + * | ||
| 405 | + * @param grossWt | ||
| 406 | + * @param wt | ||
| 407 | + * @return | ||
| 408 | + */ | ||
| 409 | + public boolean checkFlag(double grossWt, double wt) { | ||
| 410 | + DecimalFormat df = new DecimalFormat("0.00"); | ||
| 411 | + boolean flag = false; | ||
| 412 | + double reult = Double.parseDouble(df.format(Math.abs((grossWt - wt)) / grossWt)); | ||
| 413 | + if (reult <= valueDob()) { | ||
| 414 | + flag = true; | ||
| 415 | + } | ||
| 416 | + return flag; | ||
| 417 | + } | ||
| 418 | + //将获取的checkWt进行小数转化 | ||
| 419 | + public static double valueDob() { | ||
| 420 | + NumberFormat nf = NumberFormat.getPercentInstance(); | ||
| 421 | + Number m = null; | ||
| 422 | + try { | ||
| 423 | + m = nf.parse(checkWt);//将百分数转换成Number类型 | ||
| 424 | + } catch (ParseException e) { | ||
| 425 | + e.printStackTrace(); | ||
| 426 | + logger.info(e.getMessage()); | ||
| 427 | + } | ||
| 428 | + return m.doubleValue(); | ||
| 429 | + } | ||
| 430 | + /** | ||
| 431 | + * 生成或者更新货物冻结标识 | ||
| 432 | + * | ||
| 433 | + * @param landBusinessTypeList | ||
| 434 | + */ | ||
| 435 | + public void inOrUpEnterCancel(LandBusinessTypeList landBusinessTypeList) { | ||
| 436 | + if (landBusinessTypeList.getMasterList().length() < 1) return; | ||
| 437 | + String[] list = landBusinessTypeList.getMasterList().split(","); | ||
| 438 | + String flag = null; | ||
| 439 | + for (int i = 0; i < list.length; i++) { | ||
| 440 | + if("调拨业务".equals(landBusinessTypeList.getBusinesstype())){ | ||
| 441 | + flag = "E"; | ||
| 442 | + }else { | ||
| 443 | + flag = "I"; | ||
| 444 | + } | ||
| 445 | + double wt = getGrossWt(list[i],flag); | ||
| 446 | + | ||
| 447 | + ENTERCANCCEL entercanccel = logic.enterCancelServer.selectByManifest(list[i]); | ||
| 448 | + if (entercanccel != null) { | ||
| 449 | + if(entercanccel.getVename().equals(landBusinessTypeList.getTrailerFrameNo())){ | ||
| 450 | + if ("0".equals(entercanccel.getIsfreeze())) { | ||
| 451 | + entercanccel.setIsfreeze("1"); | ||
| 452 | + entercanccel.setEndport(landBusinessTypeList.getEndstation()); | ||
| 453 | + entercanccel.setUpdateBy(landBusinessTypeList.getCreateBy()); | ||
| 454 | + entercanccel.setUpdateTime(new Date()); | ||
| 455 | + logic.enterCancelServer.updateByPermaryKey(entercanccel); | ||
| 456 | + } | ||
| 457 | + } | ||
| 458 | + }else { | ||
| 459 | + if("E".equals(landBusinessTypeList.getTurnoverflag())){ | ||
| 460 | + ENTERCANCCEL canccel = new ENTERCANCCEL(); | ||
| 461 | + canccel.setIsfreeze("0"); | ||
| 462 | + canccel.setVename(landBusinessTypeList.getTrailerFrameNo()); | ||
| 463 | + canccel.setId(String.valueOf(System.currentTimeMillis())); | ||
| 464 | + canccel.setVeCompanyName(landBusinessTypeList.getAgentno()); | ||
| 465 | + canccel.setBusinesstype(landBusinessTypeList.getBusinesstype()); | ||
| 466 | + canccel.setManifest(list[i]); | ||
| 467 | + canccel.setAgentname(landBusinessTypeList.getAgentname()); | ||
| 468 | + canccel.setStartport(landBusinessTypeList.getEndstation()); | ||
| 469 | + canccel.setGrosswt(landBusinessTypeList.getAislewt()); | ||
| 470 | + canccel.setCreateBy(landBusinessTypeList.getCreateBy()); | ||
| 471 | + canccel.setCreateTime(new Date()); | ||
| 472 | + canccel.setUpdateBy(landBusinessTypeList.getCreateBy()); | ||
| 473 | + canccel.setUpdateTime(new Date()); | ||
| 474 | + canccel.setWeight(wt); | ||
| 475 | + logic.enterCancelServer.insertEntry(canccel); | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + } | ||
| 479 | + } | ||
| 480 | + } | ||
| 481 | + | ||
| 482 | +} | ||
| 483 | + |
| @@ -87,18 +87,24 @@ public class LogicOperation { | @@ -87,18 +87,24 @@ public class LogicOperation { | ||
| 87 | boolean result = false; | 87 | boolean result = false; |
| 88 | //转为double类型 | 88 | //转为double类型 |
| 89 | double growssWt = info.getGrosswt().doubleValue(); | 89 | double growssWt = info.getGrosswt().doubleValue(); |
| 90 | + //取车牌号,判定卡口是否取到车牌号 | ||
| 90 | String vaName = info.getVename(); | 91 | String vaName = info.getVename(); |
| 91 | if (vaName.length() <= 0) { | 92 | if (vaName.length() <= 0) { |
| 92 | CommandClient.Client(info, NORECORD + vaName); | 93 | CommandClient.Client(info, NORECORD + vaName); |
| 93 | return result; | 94 | return result; |
| 94 | } | 95 | } |
| 96 | + //校验车辆是否备案 | ||
| 95 | LandRoadVe ve = logic.veService.selectByFrameNo(vaName); | 97 | LandRoadVe ve = logic.veService.selectByFrameNo(vaName); |
| 96 | if (ve == null) { | 98 | if (ve == null) { |
| 97 | CommandClient.Client(info, NORECORD + vaName); | 99 | CommandClient.Client(info, NORECORD + vaName); |
| 98 | return result; | 100 | return result; |
| 99 | } | 101 | } |
| 100 | - LandBusinessTypeList list = logic.listService.selectForOne(info.getVename(), info.getBarcode(), info.getAreaid | ||
| 101 | - (), info.getChnlno(), info.getIetype()); | 102 | + |
| 103 | + /** | ||
| 104 | + * 车牌号,二维码,场站ID/号,通道ID/号,进出业务类型标识I/E | ||
| 105 | + * 查询是否已有此场站通道的申请 | ||
| 106 | + */ | ||
| 107 | + LandBusinessTypeList list = logic.listService.selectForOne(info.getVename(), info.getBarcode(), info.getAreaid(), info.getChnlno(), info.getIetype()); | ||
| 102 | if (list == null) { | 108 | if (list == null) { |
| 103 | CommandClient.Client(info, IEPORSE); | 109 | CommandClient.Client(info, IEPORSE); |
| 104 | return result; | 110 | return result; |
| @@ -116,29 +122,34 @@ public class LogicOperation { | @@ -116,29 +122,34 @@ public class LogicOperation { | ||
| 116 | type = "E"; | 122 | type = "E"; |
| 117 | } | 123 | } |
| 118 | logger.info("=======================>>>>>>>>>>" + type + "<<<<<<<<<<========================"); | 124 | logger.info("=======================>>>>>>>>>>" + type + "<<<<<<<<<<========================"); |
| 125 | + //获取车辆拉货重量 | ||
| 119 | goodsWt = logic.GoodsWt(list.getMasterList(), type); | 126 | goodsWt = logic.GoodsWt(list.getMasterList(), type); |
| 120 | } | 127 | } |
| 121 | //车自重 | 128 | //车自重 |
| 122 | double selfWt = Double.parseDouble(ve.getSelfWt()); | 129 | double selfWt = Double.parseDouble(ve.getSelfWt()); |
| 123 | 130 | ||
| 124 | - | 131 | + //重量误差判定,判断过磅重量减去(车备案重量+运单重量)/过磅重量是否在可控范围内 |
| 125 | if (!logic.checkFlag(growssWt, (selfWt + goodsWt))) { | 132 | if (!logic.checkFlag(growssWt, (selfWt + goodsWt))) { |
| 133 | + //根据二维码标识ID找进出场对应申请,并进行过卡数据与申请数据对碰 | ||
| 126 | List<LandBusinessTypeList> typeLists = logic.listService.selectMessageId(list.getMassageId()); | 134 | List<LandBusinessTypeList> typeLists = logic.listService.selectMessageId(list.getMassageId()); |
| 127 | for (int i = 0; i < typeLists.size(); i++) { | 135 | for (int i = 0; i < typeLists.size(); i++) { |
| 128 | - | 136 | + //如果业务类型为进口提货,进出业务标识为出场(E),把已检验过进场过卡重量赋为空车重量,否则则取备案重量 |
| 129 | if ("进口提货".equals(list.getBusinesstype())) { | 137 | if ("进口提货".equals(list.getBusinesstype())) { |
| 138 | + //Turnoverflag()进出场标识 | ||
| 130 | if ("E".equals(list.getTurnoverflag())) { | 139 | if ("E".equals(list.getTurnoverflag())) { |
| 140 | + //Contrastflag检验标识,Aislewt过卡重量 | ||
| 131 | if ("I".equals(typeLists.get(i).getTurnoverflag()) && typeLists.get(i).getContrastflag() != null) { | 141 | if ("I".equals(typeLists.get(i).getTurnoverflag()) && typeLists.get(i).getContrastflag() != null) { |
| 132 | selfWt = typeLists.get(i).getAislewt() > 1 ? typeLists.get(i).getAislewt() : selfWt; | 142 | selfWt = typeLists.get(i).getAislewt() > 1 ? typeLists.get(i).getAislewt() : selfWt; |
| 133 | break; | 143 | break; |
| 134 | } | 144 | } |
| 135 | } | 145 | } |
| 136 | } | 146 | } |
| 137 | - | 147 | + // |
| 138 | if ("出口送货".equals(list.getBusinesstype())) { | 148 | if ("出口送货".equals(list.getBusinesstype())) { |
| 139 | if ("E".equals(list.getTurnoverflag())) { | 149 | if ("E".equals(list.getTurnoverflag())) { |
| 150 | + //判断入场是否正常 | ||
| 140 | if ("I".equals(typeLists.get(i).getTurnoverflag()) && typeLists.get(i).getContrastflag() != null) { | 151 | if ("I".equals(typeLists.get(i).getTurnoverflag()) && typeLists.get(i).getContrastflag() != null) { |
| 141 | - if ("1".equals(list.getIsfull())) { | 152 | + if ("1".equals(list.getIsfull())) {// |
| 142 | if (list.getMasterList().length() > 0) { | 153 | if (list.getMasterList().length() > 0) { |
| 143 | selfWt = typeLists.get(i).getAislewt() - Double.parseDouble(typeLists.get(i).getRemark()); | 154 | selfWt = typeLists.get(i).getAislewt() - Double.parseDouble(typeLists.get(i).getRemark()); |
| 144 | } else { | 155 | } else { |
| @@ -171,14 +182,16 @@ public class LogicOperation { | @@ -171,14 +182,16 @@ public class LogicOperation { | ||
| 171 | } | 182 | } |
| 172 | } | 183 | } |
| 173 | } | 184 | } |
| 174 | - | 185 | + //校验重量开始 |
| 175 | boolean checkResult = false; | 186 | boolean checkResult = false; |
| 176 | boolean check = false; | 187 | boolean check = false; |
| 177 | boolean checkMainfest =false; | 188 | boolean checkMainfest =false; |
| 178 | 189 | ||
| 179 | if(!"普通货".equals(list.getCocode())){ | 190 | if(!"普通货".equals(list.getCocode())){ |
| 180 | checkResult = true; | 191 | checkResult = true; |
| 181 | - }else { | 192 | + }else if(list.getEndstation().equals("4600329012") || list.getEndstation().equals("4612199001")){ |
| 193 | + checkResult = true; | ||
| 194 | + }else{ | ||
| 182 | check = logic.checkResult(growssWt, selfWt, goodsWt); | 195 | check = logic.checkResult(growssWt, selfWt, goodsWt); |
| 183 | checkMainfest = logic.checkManifest(list.getMasterList()); | 196 | checkMainfest = logic.checkManifest(list.getMasterList()); |
| 184 | 197 | ||
| @@ -236,14 +249,33 @@ public class LogicOperation { | @@ -236,14 +249,33 @@ public class LogicOperation { | ||
| 236 | count++; | 249 | count++; |
| 237 | } | 250 | } |
| 238 | } | 251 | } |
| 252 | + | ||
| 253 | + //决定所有业务走完 二维是否失效 | ||
| 239 | if (list.getBusinesstype().indexOf("业务") > 0) { | 254 | if (list.getBusinesstype().indexOf("业务") > 0) { |
| 240 | logic.inOrUpEnterCancel(list); | 255 | logic.inOrUpEnterCancel(list); |
| 241 | if (count == 4) { | 256 | if (count == 4) { |
| 242 | buildBarCode.cancleBarCode(vaName); | 257 | buildBarCode.cancleBarCode(vaName); |
| 243 | logic.listService.updateByBarcode(info.getBarcode()); | 258 | logic.listService.updateByBarcode(info.getBarcode()); |
| 259 | + }else if(count==6){ | ||
| 260 | + buildBarCode.cancleBarCode(vaName); | ||
| 261 | + logic.listService.updateByBarcode(info.getBarcode()); | ||
| 244 | } | 262 | } |
| 245 | - } else { | ||
| 246 | - if (count == 2) { | 263 | + } else if(list.getBusinesstype().equals("出口送货") && list.getEndport().equals("4620")){ |
| 264 | + if(list.getIsthree().equals("0")){ | ||
| 265 | + if(count==4){ | ||
| 266 | + buildBarCode.cancleBarCode(vaName); | ||
| 267 | + logic.listService.updateByBarcode(info.getBarcode()); | ||
| 268 | + } | ||
| 269 | + }else{ | ||
| 270 | + if(count==2){ | ||
| 271 | + buildBarCode.cancleBarCode(vaName); | ||
| 272 | + logic.listService.updateByBarcode(info.getBarcode()); | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + | ||
| 277 | + }else{ | ||
| 278 | + if (count == 2 && !list.getEndport().equals("4620")) { | ||
| 247 | buildBarCode.cancleBarCode(vaName); | 279 | buildBarCode.cancleBarCode(vaName); |
| 248 | logic.listService.updateByBarcode(info.getBarcode()); | 280 | logic.listService.updateByBarcode(info.getBarcode()); |
| 249 | } | 281 | } |
| @@ -436,6 +468,7 @@ public class LogicOperation { | @@ -436,6 +468,7 @@ public class LogicOperation { | ||
| 436 | } else { | 468 | } else { |
| 437 | sationCode = "HK06"; | 469 | sationCode = "HK06"; |
| 438 | } | 470 | } |
| 471 | + //TODO:加场站判定 | ||
| 439 | } | 472 | } |
| 440 | sendData(sationCode, list.getTrailerFrameNo(), flag); | 473 | sendData(sationCode, list.getTrailerFrameNo(), flag); |
| 441 | } | 474 | } |
| @@ -446,6 +479,7 @@ public class LogicOperation { | @@ -446,6 +479,7 @@ public class LogicOperation { | ||
| 446 | */ | 479 | */ |
| 447 | 480 | ||
| 448 | public boolean sendBw(GatherInfo info, boolean check) { | 481 | public boolean sendBw(GatherInfo info, boolean check) { |
| 482 | + logger.info(String.format("开始发送指令:车牌%s,场站%s,通道%s,重量%s",info.getVename(),info.getAreaid(),info.getChnlno(),info.getGrosswt())); | ||
| 449 | boolean flag = false; | 483 | boolean flag = false; |
| 450 | if (check) { | 484 | if (check) { |
| 451 | CommandClient.Client(info, PERMITTHOUGH); | 485 | CommandClient.Client(info, PERMITTHOUGH); |
| @@ -466,7 +500,7 @@ public class LogicOperation { | @@ -466,7 +500,7 @@ public class LogicOperation { | ||
| 466 | } | 500 | } |
| 467 | 501 | ||
| 468 | /** | 502 | /** |
| 469 | - * 判断空车车与地磅称重是否在合理范围 | 503 | + * 判断空车加运单与地磅称重是否在合理范围 |
| 470 | * | 504 | * |
| 471 | * @param grossWt | 505 | * @param grossWt |
| 472 | * @param wt | 506 | * @param wt |
| @@ -35,4 +35,14 @@ public interface LandBusinessTypeListMapper { | @@ -35,4 +35,14 @@ public interface LandBusinessTypeListMapper { | ||
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | List<LandBusinessTypeList> selectMessageId(@Param("massageId")String messageId); | 37 | List<LandBusinessTypeList> selectMessageId(@Param("massageId")String messageId); |
| 38 | + | ||
| 39 | + //查询进场过磅重量,货物重量 | ||
| 40 | + List<LandBusinessTypeList> selectwt(@Param("trailerFrameNo") String trailerFrameNo, @Param("barcode") String barcode, | ||
| 41 | + @Param("endstation") String endstation, @Param("turnoverflag") String turnoverflag); | ||
| 42 | + //失效已进场或出场的申请记录 | ||
| 43 | + int updateisvalid(@Param("trailerFrameNo") String trailerFrameNo, @Param("barcode") String barcode, | ||
| 44 | + @Param("endstation") String endstation, @Param("turnoverflag") String turnoverflag); | ||
| 45 | + //查询出场申请为最后一个 | ||
| 46 | + int selectlaststation(@Param("trailerFrameNo") String trailerFrameNo, @Param("barcode") String barcode); | ||
| 47 | + | ||
| 38 | } | 48 | } |
| @@ -65,6 +65,16 @@ public class LandBusinessTypeList { | @@ -65,6 +65,16 @@ public class LandBusinessTypeList { | ||
| 65 | 65 | ||
| 66 | private String remark2; | 66 | private String remark2; |
| 67 | 67 | ||
| 68 | + public String getIsthree() { | ||
| 69 | + return isthree; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public void setIsthree(String isthree) { | ||
| 73 | + this.isthree = isthree; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + private String isthree; | ||
| 77 | + | ||
| 68 | public String getId() { | 78 | public String getId() { |
| 69 | return id; | 79 | return id; |
| 70 | } | 80 | } |
| @@ -13,6 +13,15 @@ public interface LandBusListService { | @@ -13,6 +13,15 @@ public interface LandBusListService { | ||
| 13 | 13 | ||
| 14 | int saveList(LandBusinessTypeList list); | 14 | int saveList(LandBusinessTypeList list); |
| 15 | 15 | ||
| 16 | + /** | ||
| 17 | + * | ||
| 18 | + * @param frameNo 车牌号 | ||
| 19 | + * @param barcode 二维码 | ||
| 20 | + * @param station 场站ID/号 | ||
| 21 | + * @param aisle 通道ID/号 | ||
| 22 | + * @param flag 进出业务类型标识I/E | ||
| 23 | + * @return | ||
| 24 | + */ | ||
| 16 | LandBusinessTypeList selectForOne(String frameNo, String barcode, String station, String aisle, String flag); | 25 | LandBusinessTypeList selectForOne(String frameNo, String barcode, String station, String aisle, String flag); |
| 17 | 26 | ||
| 18 | List<LandBusinessTypeList> selectByBarcode(String barcode); | 27 | List<LandBusinessTypeList> selectByBarcode(String barcode); |
| @@ -20,4 +29,11 @@ public interface LandBusListService { | @@ -20,4 +29,11 @@ public interface LandBusListService { | ||
| 20 | int updateByBarcode(String barcode); | 29 | int updateByBarcode(String barcode); |
| 21 | 30 | ||
| 22 | List<LandBusinessTypeList> selectMessageId(String messageId); | 31 | List<LandBusinessTypeList> selectMessageId(String messageId); |
| 32 | + //查询进场过磅重量,货物重量 | ||
| 33 | + List<LandBusinessTypeList> selectwt(String frameNo, String barcode, String station, String flag); | ||
| 34 | + //失效已进场或出场的申请记录 | ||
| 35 | + int updateisvalid(String frameNo, String barcode, String station, String flag); | ||
| 36 | + //查询出场申请为最后一个 | ||
| 37 | + int selectlaststation(String frameNo, String barcode); | ||
| 38 | + | ||
| 23 | } | 39 | } |
| @@ -74,4 +74,19 @@ public class LandBusListServiceImpl implements LandBusListService { | @@ -74,4 +74,19 @@ public class LandBusListServiceImpl implements LandBusListService { | ||
| 74 | public List<LandBusinessTypeList> selectMessageId(String messageiD){ | 74 | public List<LandBusinessTypeList> selectMessageId(String messageiD){ |
| 75 | return listMapper.selectMessageId(messageiD); | 75 | return listMapper.selectMessageId(messageiD); |
| 76 | } | 76 | } |
| 77 | + | ||
| 78 | + @Override | ||
| 79 | + public List<LandBusinessTypeList> selectwt(String frameNo, String barcode, String station, String flag) { | ||
| 80 | + return listMapper.selectwt(frameNo,barcode,station,flag); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + @Override | ||
| 84 | + public int updateisvalid(String frameNo, String barcode, String station, String flag) { | ||
| 85 | + return listMapper.updateisvalid(frameNo,barcode,station,flag); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + @Override | ||
| 89 | + public int selectlaststation(String frameNo, String barcode) { | ||
| 90 | + return listMapper.selectlaststation(frameNo,barcode); | ||
| 91 | + } | ||
| 77 | } | 92 | } |
| @@ -33,13 +33,14 @@ | @@ -33,13 +33,14 @@ | ||
| 33 | <result column="REMARK" jdbcType="VARCHAR" property="remark" /> | 33 | <result column="REMARK" jdbcType="VARCHAR" property="remark" /> |
| 34 | <result column="REMARK1" jdbcType="VARCHAR" property="remark1" /> | 34 | <result column="REMARK1" jdbcType="VARCHAR" property="remark1" /> |
| 35 | <result column="REMARK2" jdbcType="VARCHAR" property="remark2" /> | 35 | <result column="REMARK2" jdbcType="VARCHAR" property="remark2" /> |
| 36 | + <result column="ISTHREE" jdbcType="VARCHAR" property="isthree" /> | ||
| 36 | </resultMap> | 37 | </resultMap> |
| 37 | <sql id="Base_Column_List"> | 38 | <sql id="Base_Column_List"> |
| 38 | id, MASSAGE_ID, TRAILER_FRAME_NO, TRAILER_LICENSE_NO, MASTER_LIST, PRODECT_TIME, | 39 | id, MASSAGE_ID, TRAILER_FRAME_NO, TRAILER_LICENSE_NO, MASTER_LIST, PRODECT_TIME, |
| 39 | IS_DELETE, AGENTNO, AGENTNAME, COCODE, DRIVERNAME, DRIVERID, STARTPORT, ENDPORT, | 40 | IS_DELETE, AGENTNO, AGENTNAME, COCODE, DRIVERNAME, DRIVERID, STARTPORT, ENDPORT, |
| 40 | STARTSATATION, ENDSTATION, AISLE, BUSINESSTYPE, TURNOVERFLAG, BARCODE, CONTRASTFLAG, | 41 | STARTSATATION, ENDSTATION, AISLE, BUSINESSTYPE, TURNOVERFLAG, BARCODE, CONTRASTFLAG, |
| 41 | CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE, ISVALID, AISLEWT, ISFULL, REMARK, | 42 | CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE, ISVALID, AISLEWT, ISFULL, REMARK, |
| 42 | - REMARK1, REMARK2 | 43 | + REMARK1, REMARK2,ISTHREE |
| 43 | </sql> | 44 | </sql> |
| 44 | <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> | 45 | <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| 45 | select | 46 | select |
| @@ -65,7 +66,27 @@ | @@ -65,7 +66,27 @@ | ||
| 65 | and AISLE = #{aisle,jdbcType=VARCHAR} | 66 | and AISLE = #{aisle,jdbcType=VARCHAR} |
| 66 | and TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR} | 67 | and TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR} |
| 67 | </select> | 68 | </select> |
| 68 | - | 69 | + <select id="selectwt" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| 70 | + select REMARK,AISLEWT from land_businesstype_list where | ||
| 71 | + TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR} | ||
| 72 | + and BARCODE = #{barcode,jdbcType=VARCHAR} | ||
| 73 | + and ENDSTATION = #{endstation,jdbcType=VARCHAR} | ||
| 74 | + and TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR} | ||
| 75 | + </select> | ||
| 76 | + <update id="updateisvalid" parameterType="java.lang.String"> | ||
| 77 | + update land_businesstype_list set ISVALID = "1" where | ||
| 78 | + TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR} | ||
| 79 | + and BARCODE = #{barcode,jdbcType=VARCHAR} | ||
| 80 | + and ENDSTATION = #{endstation,jdbcType=VARCHAR} | ||
| 81 | + and TURNOVERFLAG = #{turnoverflag,jdbcType=VARCHAR} | ||
| 82 | + </update> | ||
| 83 | + <select id="selectlaststation" resultType="java.lang.Integer"> | ||
| 84 | + select count(*) from land_businesstype_list where | ||
| 85 | + TRAILER_FRAME_NO = #{trailerFrameNo,jdbcType=VARCHAR} | ||
| 86 | + and BARCODE = #{barcode,jdbcType=VARCHAR} | ||
| 87 | + and TURNOVERFLAG = "E" | ||
| 88 | + and ISVALID = "0" | ||
| 89 | + </select> | ||
| 69 | <select id="selectByBarcode" parameterType="java.lang.String" resultMap="BaseResultMap"> | 90 | <select id="selectByBarcode" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| 70 | select | 91 | select |
| 71 | <include refid="Base_Column_List" /> | 92 | <include refid="Base_Column_List" /> |
-
请 注册 或 登录 后发表评论