作者 zhangFan

add repertory

Manifest-Version: 1.0
Class-Path: jackson-datatype-jdk8-2.9.7.jar jackson-databind-2.9.7.jar
jsqlparser-1.0.jar druid-spring-boot-starter-1.1.9.jar com.ibm.mq.to
ols.ras.jar pagehelper-spring-boot-starter-1.2.3.jar spring-context-5
.1.2.RELEASE.jar spring-aop-5.1.2.RELEASE.jar ProcessService.jar drui
d-1.1.9.jar com.ibm.mq.postcard.jar com.ibm.mq.soap.jar commons-loggi
ng-1.1.1.jar wstx-asl-3.2.4.jar commons-lang-2.4.jar returnXml.jar my
batis-spring-1.3.2.jar imfmsg.jar spring-tx-5.1.2.RELEASE.jar jackson
-core-2.9.7.jar cxf-xjc-ts-2.3.2.jar cxf-xjc-dv-2.3.2.jar log4j-to-sl
f4j-2.11.1.jar HeartbeatService.jar javax.annotation-api-1.3.2.jar my
batis-spring-boot-starter-1.3.2.jar xml-apis-1.4.01.jar neethi-2.0.4.
jar commons-io-2.5.jar hibernate-validator-6.0.13.Final.jar com.ibm.m
q.jmqi.jar jackson-datatype-jsr310-2.9.7.jar snakeyaml-1.23.jar slf4j
-api-1.7.25.jar spring-jcl-5.1.2.RELEASE.jar spring-jdbc-5.1.2.RELEAS
E.jar UploadService.jar cxf-2.3.2.jar axiom-impl-1.2.7.jar spring-boo
t-starter-web-2.1.0.RELEASE.jar com.ibm.mqjms.jar com.ibm.mq.headers.
jar jul-to-slf4j-1.7.25.jar com.ibm.mq.commonservices.jar com.ibm.mqe
tclient.jar apiConfig.jar mybatis-3.4.6.jar spring-expression-5.1.2.R
ELEASE.jar wsdl4j-1.6.2.jar xstream-1.4.10.jar com.ibm.mq.fta.jar ger
onimo-javamail_1.4_spec-1.2.jar xmlbeans-2.4.0.jar spring-boot-autoco
nfigure-2.1.0.RELEASE.jar cxf-xjc-boolean-3.2.3.jar dom4j-2.1.0.jar g
eronimo-stax-api_1.0_spec-1.0.1.jar classmate-1.4.0.jar xpp3_min-1.1.
4c.jar HikariCP-3.2.0.jar CL3Nonexport.jar jboss-logging-3.3.2.Final.
jar spring-beans-5.1.2.RELEASE.jar spring-boot-starter-json-2.1.0.REL
EASE.jar jackson-annotations-2.9.0.jar sigar.jar mybatis-spring-boot-
autoconfigure-1.3.2.jar axiom-api-1.2.7.jar IMFClient.1.0.0.jar com.i
bm.mq.axis2.jar XmlSchema-1.4.7.jar com.ibm.mq.defaultconfig.jar com.
ibm.mq.pcf.jar pagehelper-spring-boot-autoconfigure-1.2.3.jar validat
ion-api-2.0.1.Final.jar mybatis-generator-core-1.3.6.jar com.ibm.mq.j
ms.Nojndi.jar spring-boot-starter-logging-2.1.0.RELEASE.jar spring-we
b-5.1.2.RELEASE.jar mysql-connector-java-8.0.13.jar spring-boot-start
er-jdbc-2.1.0.RELEASE.jar cxf-manifest.jar xmlsec-1.4.4.jar jaxen-1.1
.6.jar spring-core-5.1.2.RELEASE.jar pagehelper-5.1.2.jar CL3Export.j
ar spring-boot-2.1.0.RELEASE.jar cxf-xjc-bug671-2.3.2.jar geronimo-ac
tivation_1.1_spec-1.0.1.jar log4j-api-2.11.1.jar spring-webmvc-5.1.2.
RELEASE.jar logback-classic-1.2.3.jar com.ibm.mq.jar connector.jar lo
g4j-1.2.17.jar jackson-module-parameter-names-2.9.7.jar spring-boot-s
tarter-2.1.0.RELEASE.jar stax-api-1.0.1.jar xmlpull-1.1.3.1.jar logba
ck-core-1.2.3.jar
Main-Class: com.sy.AnalysisImfApplication
... ... @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.List;
... ... @@ -40,6 +41,9 @@ public class AnalysisRoute {
@Autowired
private ResMessageService resMessageService;
@Autowired
private RepertoryService repertoryService;
protected static final Logger logger = Logger.getLogger(AnalysisRoute.class);
private static AnalysisRoute route;
... ... @@ -64,6 +68,7 @@ public class AnalysisRoute {
route.commandService = this.commandService;
route.listService = this.listService;
route.resMessageService = this.resMessageService;
route.repertoryService = this.repertoryService;
}
public static void analysis(String string) {
... ... @@ -101,12 +106,62 @@ public class AnalysisRoute {
}
} else if (stype.equals("ES1")) {
airone_ex_stock exStock = exStockAnalysis.toExStock(message);
T_AIR_REPERTORY repertory = route.repertoryService.selectByPermaryKey(exStock.getMawbNo());
if(repertory!=null){
if(repertory.getCnt()>exStock.getCnt().longValue() && repertory.getWt().longValue()>exStock.getWt().longValue()){
repertory.setCnt(repertory.getCnt()-exStock.getCnt().longValue());
repertory.setWt(repertory.getWt().subtract(exStock.getWt()));
repertory.setUpdateTime(new Date());
route.repertoryService.updateEntry(repertory);
}
}else{
T_AIR_REPERTORY airRepertoryrepertory = new T_AIR_REPERTORY();
airRepertoryrepertory.setAreaCode(exStock.getAreaCode());
airRepertoryrepertory.setSupCode(exStock.getSupCode());
airRepertoryrepertory.setSupName(exStock.getSupName());
airRepertoryrepertory.setVoyageNo(exStock.getVoyageNo());
airRepertoryrepertory.setIeDate(exStock.getIeDate());
airRepertoryrepertory.setMawbNo(exStock.getMawbNo());
airRepertoryrepertory.setIeFlag(exStock.getIeFlag());
airRepertoryrepertory.setCnt(exStock.getCnt().longValue());
airRepertoryrepertory.setWt(exStock.getWt());
airRepertoryrepertory.setGoodName(exStock.getgName());
airRepertoryrepertory.setCopCode(exStock.getCopCode());
airRepertoryrepertory.setCopName(exStock.getCopName());
airRepertoryrepertory.setOpCode(exStock.getInputCode());
airRepertoryrepertory.setCreateDate(new Date());
route.repertoryService.insertEntry(airRepertoryrepertory);
}
route.exStockService.save(exStock);
} else if (stype.equals("CLR")) {
v_express_billno billno = clrAnalysis.toBill(message);
route.clrService.save(billno);
} else if (stype.equals("IS1")) {
airone_im_stock imStock = imStockAnalysis.toImStock(message);
T_AIR_REPERTORY repertory = route.repertoryService.selectByPermaryKey(imStock.getMawbNo());
if(repertory!=null){
repertory.setCnt(repertory.getCnt()+imStock.getCnt());
repertory.setWt(repertory.getWt().add(imStock.getWt()));
repertory.setUpdateTime(new Date());
route.repertoryService.updateEntry(repertory);
}else{
T_AIR_REPERTORY airRepertoryrepertory = new T_AIR_REPERTORY();
airRepertoryrepertory.setAreaCode(imStock.getAreaCode());
airRepertoryrepertory.setSupCode(imStock.getSupCode());
airRepertoryrepertory.setSupName(imStock.getSupName());
airRepertoryrepertory.setVoyageNo(imStock.getVoyageNo());
airRepertoryrepertory.setIeDate(imStock.getIeDate());
airRepertoryrepertory.setMawbNo(imStock.getMawbNo());
airRepertoryrepertory.setCnt(imStock.getCnt());
airRepertoryrepertory.setWt(imStock.getWt());
airRepertoryrepertory.setIeFlag(imStock.getIeFlag());
airRepertoryrepertory.setGoodName(imStock.getgName());
airRepertoryrepertory.setCopCode(imStock.getCopCode());
airRepertoryrepertory.setCopName(imStock.getCopName());
airRepertoryrepertory.setOpCode(imStock.getInputCode());
airRepertoryrepertory.setCreateDate(new Date());
route.repertoryService.insertEntry(airRepertoryrepertory);
}
route.imStockService.save(imStock);
} else if (stype.equals("GAT")) {
port_manifest_head portHead = gatAnaluysis.toPortHead(message);
... ... @@ -128,6 +183,7 @@ public class AnalysisRoute {
}
}
}
... ...
... ... @@ -485,6 +485,7 @@ public class LogicOperation {
ENTERCANCCEL entercanccel = logic.enterCancelServer.selectByManifest(list[i]);
if (entercanccel != null) {
if(entercanccel.getVename().equals(landBusinessTypeList.getTrailerFrameNo())){
if ("0".equals(entercanccel.getIsfreeze())) {
entercanccel.setIsfreeze("1");
entercanccel.setEndport(landBusinessTypeList.getEndstation());
... ... @@ -492,6 +493,7 @@ public class LogicOperation {
entercanccel.setUpdateTime(new Date());
logic.enterCancelServer.updateByPermaryKey(entercanccel);
}
}
}else {
if("E".equals(landBusinessTypeList.getTurnoverflag())){
ENTERCANCCEL canccel = new ENTERCANCCEL();
... ...
package com.sy.mapper;
import com.sy.model.T_AIR_REPERTORY;
import org.springframework.stereotype.Component;
@Component
public interface T_AIR_REPERTORYMapper {
int deleteByPrimaryKey(String mawbNo);
int insert(T_AIR_REPERTORY record);
int insertSelective(T_AIR_REPERTORY record);
T_AIR_REPERTORY selectByPrimaryKey(String mawbNo);
int updateByPrimaryKeySelective(T_AIR_REPERTORY record);
int updateByPrimaryKey(T_AIR_REPERTORY record);
}
\ No newline at end of file
... ...
package com.sy.model;
import java.math.BigDecimal;
import java.util.Date;
public class T_AIR_REPERTORY {
private String mawbNo;
private String areaCode;
private String supName;
private String supCode;
private String voyageNo;
private Date ieDate;
private String ieFlag;
private Long cnt;
private BigDecimal wt;
private String goodName;
private Date createDate;
private Date updateTime;
private String copCode;
private String copName;
private String opCode;
public String getMawbNo() {
return mawbNo;
}
public void setMawbNo(String mawbNo) {
this.mawbNo = mawbNo == null ? null : mawbNo.trim();
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode == null ? null : areaCode.trim();
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName == null ? null : supName.trim();
}
public String getSupCode() {
return supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode == null ? null : supCode.trim();
}
public String getVoyageNo() {
return voyageNo;
}
public void setVoyageNo(String voyageNo) {
this.voyageNo = voyageNo == null ? null : voyageNo.trim();
}
public Date getIeDate() {
return ieDate;
}
public void setIeDate(Date ieDate) {
this.ieDate = ieDate;
}
public String getIeFlag() {
return ieFlag;
}
public void setIeFlag(String ieFlag) {
this.ieFlag = ieFlag == null ? null : ieFlag.trim();
}
public Long getCnt() {
return cnt;
}
public void setCnt(Long cnt) {
this.cnt = cnt;
}
public BigDecimal getWt() {
return wt;
}
public void setWt(BigDecimal wt) {
this.wt = wt;
}
public String getGoodName() {
return goodName;
}
public void setGoodName(String goodName) {
this.goodName = goodName == null ? null : goodName.trim();
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getCopCode() {
return copCode;
}
public void setCopCode(String copCode) {
this.copCode = copCode == null ? null : copCode.trim();
}
public String getCopName() {
return copName;
}
public void setCopName(String copName) {
this.copName = copName == null ? null : copName.trim();
}
public String getOpCode() {
return opCode;
}
public void setOpCode(String opCode) {
this.opCode = opCode == null ? null : opCode.trim();
}
}
\ No newline at end of file
... ...
package com.sy.service;
import com.sy.model.T_AIR_REPERTORY;
/**
* @author
* @time 2019-05-28 10:15
*/
public interface RepertoryService {
int updateEntry(T_AIR_REPERTORY repertory);
T_AIR_REPERTORY selectByPermaryKey(String mawb);
int insertEntry(T_AIR_REPERTORY repertory);
}
... ...
package com.sy.service.impl;
import com.sy.mapper.T_AIR_REPERTORYMapper;
import com.sy.model.T_AIR_REPERTORY;
import com.sy.service.RepertoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author
* @time 2019-05-28 10:16
*/
@Service
public class RepertoryServiceImpl implements RepertoryService {
@Autowired
private T_AIR_REPERTORYMapper mapper;
@Override
public int updateEntry(T_AIR_REPERTORY repertory) {
return mapper.updateByPrimaryKeySelective(repertory);
}
@Override
public T_AIR_REPERTORY selectByPermaryKey(String mawb) {
return mapper.selectByPrimaryKey(mawb);
}
@Override
public int insertEntry(T_AIR_REPERTORY repertory) {
return mapper.insertSelective(repertory);
}
}
... ...
package com.sy;
/**
* @author
* @time 2019-${MOUTH}-06 17:59
*/
public class test {
// private static LogicOperation logicOperation =new LogicOperation();
/* public static void main(String[] args) {
double a = logicOperation.GoodsWt("172-26481560,172-26481593,172-26481604,172-26481545,172-26481582,172-26481556,172-26481571","I");
System.out.printf("%.1f",a);
}*/
}
... ...
... ... @@ -20,7 +20,7 @@ spring.mvc.view.prefix=.jsp
#spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
#\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://10.50.7.70:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
spring.datasource.username=station
spring.datasource.password=station@10.50.7.70
#\u8FDE\u63A5\u6C60\u7C7B
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sy.mapper.T_AIR_REPERTORYMapper">
<resultMap id="BaseResultMap" type="com.sy.model.T_AIR_REPERTORY">
<id column="MAWB_NO" jdbcType="VARCHAR" property="mawbNo" />
<result column="AREA_CODE" jdbcType="VARCHAR" property="areaCode" />
<result column="SUP_NAME" jdbcType="VARCHAR" property="supName" />
<result column="SUP_CODE" jdbcType="VARCHAR" property="supCode" />
<result column="VOYAGE_NO" jdbcType="VARCHAR" property="voyageNo" />
<result column="IE_DATE" jdbcType="DATE" property="ieDate" />
<result column="IE_FLAG" jdbcType="VARCHAR" property="ieFlag" />
<result column="CNT" jdbcType="DECIMAL" property="cnt" />
<result column="WT" jdbcType="DECIMAL" property="wt" />
<result column="GOOD_NAME" jdbcType="VARCHAR" property="goodName" />
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
<result column="COP_CODE" jdbcType="VARCHAR" property="copCode" />
<result column="COP_NAME" jdbcType="VARCHAR" property="copName" />
<result column="OP_CODE" jdbcType="VARCHAR" property="opCode" />
</resultMap>
<sql id="Base_Column_List">
MAWB_NO, AREA_CODE, SUP_NAME, SUP_CODE, VOYAGE_NO, IE_DATE, IE_FLAG, CNT, WT, GOOD_NAME,
CREATE_DATE, UPDATE_TIME, COP_CODE, COP_NAME, OP_CODE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_air_repertory
where MAWB_NO = #{mawbNo,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from t_air_repertory
where MAWB_NO = #{mawbNo,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sy.model.T_AIR_REPERTORY">
insert into t_air_repertory (MAWB_NO, AREA_CODE, SUP_NAME,
SUP_CODE, VOYAGE_NO, IE_DATE,
IE_FLAG, CNT, WT, GOOD_NAME,
CREATE_DATE, UPDATE_TIME, COP_CODE,
COP_NAME, OP_CODE)
values (#{mawbNo,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{supName,jdbcType=VARCHAR},
#{supCode,jdbcType=VARCHAR}, #{voyageNo,jdbcType=VARCHAR}, #{ieDate,jdbcType=DATE},
#{ieFlag,jdbcType=VARCHAR}, #{cnt,jdbcType=DECIMAL}, #{wt,jdbcType=DECIMAL}, #{goodName,jdbcType=VARCHAR},
#{createDate,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{copCode,jdbcType=VARCHAR},
#{copName,jdbcType=VARCHAR}, #{opCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sy.model.T_AIR_REPERTORY">
insert into t_air_repertory
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mawbNo != null">
MAWB_NO,
</if>
<if test="areaCode != null">
AREA_CODE,
</if>
<if test="supName != null">
SUP_NAME,
</if>
<if test="supCode != null">
SUP_CODE,
</if>
<if test="voyageNo != null">
VOYAGE_NO,
</if>
<if test="ieDate != null">
IE_DATE,
</if>
<if test="ieFlag != null">
IE_FLAG,
</if>
<if test="cnt != null">
CNT,
</if>
<if test="wt != null">
WT,
</if>
<if test="goodName != null">
GOOD_NAME,
</if>
<if test="createDate != null">
CREATE_DATE,
</if>
<if test="updateTime != null">
UPDATE_TIME,
</if>
<if test="copCode != null">
COP_CODE,
</if>
<if test="copName != null">
COP_NAME,
</if>
<if test="opCode != null">
OP_CODE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mawbNo != null">
#{mawbNo,jdbcType=VARCHAR},
</if>
<if test="areaCode != null">
#{areaCode,jdbcType=VARCHAR},
</if>
<if test="supName != null">
#{supName,jdbcType=VARCHAR},
</if>
<if test="supCode != null">
#{supCode,jdbcType=VARCHAR},
</if>
<if test="voyageNo != null">
#{voyageNo,jdbcType=VARCHAR},
</if>
<if test="ieDate != null">
#{ieDate,jdbcType=DATE},
</if>
<if test="ieFlag != null">
#{ieFlag,jdbcType=VARCHAR},
</if>
<if test="cnt != null">
#{cnt,jdbcType=DECIMAL},
</if>
<if test="wt != null">
#{wt,jdbcType=DECIMAL},
</if>
<if test="goodName != null">
#{goodName,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="copCode != null">
#{copCode,jdbcType=VARCHAR},
</if>
<if test="copName != null">
#{copName,jdbcType=VARCHAR},
</if>
<if test="opCode != null">
#{opCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sy.model.T_AIR_REPERTORY">
update t_air_repertory
<set>
<if test="areaCode != null">
AREA_CODE = #{areaCode,jdbcType=VARCHAR},
</if>
<if test="supName != null">
SUP_NAME = #{supName,jdbcType=VARCHAR},
</if>
<if test="supCode != null">
SUP_CODE = #{supCode,jdbcType=VARCHAR},
</if>
<if test="voyageNo != null">
VOYAGE_NO = #{voyageNo,jdbcType=VARCHAR},
</if>
<if test="ieDate != null">
IE_DATE = #{ieDate,jdbcType=DATE},
</if>
<if test="ieFlag != null">
IE_FLAG = #{ieFlag,jdbcType=VARCHAR},
</if>
<if test="cnt != null">
CNT = #{cnt,jdbcType=DECIMAL},
</if>
<if test="wt != null">
WT = #{wt,jdbcType=DECIMAL},
</if>
<if test="goodName != null">
GOOD_NAME = #{goodName,jdbcType=VARCHAR},
</if>
<if test="createDate != null">
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="copCode != null">
COP_CODE = #{copCode,jdbcType=VARCHAR},
</if>
<if test="copName != null">
COP_NAME = #{copName,jdbcType=VARCHAR},
</if>
<if test="opCode != null">
OP_CODE = #{opCode,jdbcType=VARCHAR},
</if>
</set>
where MAWB_NO = #{mawbNo,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sy.model.T_AIR_REPERTORY">
update t_air_repertory
set AREA_CODE = #{areaCode,jdbcType=VARCHAR},
SUP_NAME = #{supName,jdbcType=VARCHAR},
SUP_CODE = #{supCode,jdbcType=VARCHAR},
VOYAGE_NO = #{voyageNo,jdbcType=VARCHAR},
IE_DATE = #{ieDate,jdbcType=DATE},
IE_FLAG = #{ieFlag,jdbcType=VARCHAR},
CNT = #{cnt,jdbcType=DECIMAL},
WT = #{wt,jdbcType=DECIMAL},
GOOD_NAME = #{goodName,jdbcType=VARCHAR},
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
COP_CODE = #{copCode,jdbcType=VARCHAR},
COP_NAME = #{copName,jdbcType=VARCHAR},
OP_CODE = #{opCode,jdbcType=VARCHAR}
where MAWB_NO = #{mawbNo,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
... ...