wei.zhou

init

Showing 32 changed files with 1739 additions and 0 deletions
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
No preview for this file type
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
<?xml version="1.0" encoding="UTF-8"?>
<DecMessage xmlns="http://www.chinaport.gov.cn/dec">
<DecHead>
<SeqNo></SeqNo>
<IEFlag>E</IEFlag> --进出口标志
<Type></Type> --单据类型
<AgentCode>Z321654987</AgentCode> ---固定取值1111980005
<AgentName>上海保险</AgentName>---固定取值联邦快递(中国)有限公司
<ApprNo></ApprNo> --不确定---
<BillNo>480506137754</BillNo> ---有总单号则取值“总单号_运单号”,没有总单号则取值“运单号
<ContrNo>SHA123456</ContrNo> ---
<CopCode></CopCode> --录入单位代码,空值---
<CopName></CopName> --录入单位名称,空值---
<CustomMaster></CustomMaster> ---固定取值0101
<CutMode>201</CutMode> ---征免性质
<DeclTrnRel>0</DeclTrnRel> --报关/转关关系标志---固定取值0
<DistinatePort>ASM000</DistinatePort> --经停港/抵运港---指运港
<EdiId>报关标志</EdiId>---
<EntryId>海关编号</EntryId>---
<EdiId>报关标志</EdiId>
<FeeCurr>运费币制</FeeCurr>---运费(币制)
<FeeMark>运费标记</FeeMark>---固定取值3
<FeeCurr>运费币制</FeeCurr>---运费(币制)
<FeeRate>运费/率</FeeRate>---运费总价
<GrossWet>111.0000000000</GrossWet> ---毛重(公斤)
<InputerName>录入员名称</InputerName>---
<InsurCurr>MOP</InsurCurr> --保险费币制---保费(币制)
<InsurMark>3</InsurMark> --保险费标记---固定取值3
<InsurCurr>121</InsurCurr> --保险费币制---保费(币制)
<InsurRate>11.00</InsurRate> --保险费/率---保费总价
<ManualNo></ManualNo> --备案号
<NetWt>111.0000000000</NetWt> --净重---净重(公斤)
<OtherCurr>杂费币制</OtherCurr>---杂费(币制)
<OtherMark>杂费标志</OtherMark>---
<OtherRate>杂费/率</OtherRate>---杂费总价
<OwnerCode>Z321654987</OwnerCode> --消费使用/生产销售单位代码---生产核销单位海关编码
<OwnerName>上海保险</OwnerName> --消费使用/生产销售单位单位名称---生产核销单位
<PackNo>11</PackNo> --件数---运单件数
<PreEntryId>预录入编号</PreEntryId>---预录入编号
<TradeCountry>BLM</TradeCountry> --启运国/运抵国---抵运国(地区)
<TradeMode>0200</TradeMode> --监管方式---监管方式
<TradeCode>Z321654987</TradeCode> --境内发货人海关编码---境内发货人海关编码
<TrafMode>运输方式代码</TrafMode>---运输方式
<TradeName>上海保险</TradeName> --境内发货人---境内发货人
<TransMode>4</TransMode> ---成交方式
<WrapType>22</WrapType> ---包装种类
<TradeCodeScc>A74125896321456987</TradeCodeScc> --境内发货人统一信用代码---生产核销单位统一信用证代码
<OwnerCodeScc>A74125896321456987</OwnerCodeScc> --生产核销单位统一信用代码---报关形式类型
<TradeAreaCode>699</TradeAreaCode> --贸易国别---贸易国(地区)
<MarkNo></MarkNo> --标记及号码---
<EntyPortCode>310302</EntyPortCode> --入境口岸代码---固定字段310302
<GoodsPlace></GoodsPlace> --存放地点---空值
<DeclareName></DeclareName> --申报人员姓名---报关员证号
<OverseasConsignorCode>Z785421</OverseasConsignorCode>--境外发货人代码---境外收货人编码
<OverseasConsigneeCode>Z785421</OverseasConsigneeCode>--境外收货人编码---境外收货人编码
<OverseasConsigneeEname>Jerry</OverseasConsigneeEname>--境外收货人名称(外文)---境外收货人名称(外文)
</DecHead>
<DecLists>
<DecList>
<ClassMark/> --归类标志---空值
<CodeTS>3003101200</CodeTS>--商品编号---商品编号
<DeclPrice>111</DeclPrice>--申报单价---
<DeclTotal>111.0000000000</DeclTotal>--申报总价---总价
<DutyMode>1</DutyMode>--征减免税方式---征免
<ExgNo></ExgNo> --货号---
<ExgVersion></ExgVersion> --版本号---
<FirstUnit>035</FirstUnit> --第一计量单位(法定单位)---第一(法定)计量单位
<FirstQty>1.00000</FirstQty> --第一法定数量---第一(法定)数量
<GUnit>035</GUnit> --申报计量单位(成交计量单位)---成交单位
<GModel>2|3|4||||||||</GModel> --商品规格、型号---规格型号(品名)
<GName>1</GName> ---商品名称
<GNo>1</GNo> --商品序号---商品明细条数从第一条开始数,第几条则为几,从1开始
<GQty>1.00</GQty> --申报数量(成交计量单位)---成交数量
<OriginCountry>CHN</OriginCountry> --原产地---最终目的国(地区)
<SecondUnit></SecondUnit> --第二计量单位---第二(法定)计量单位
<SecondQty>11.00000</SecondQty> --第二法定数量---第二(法定)数量
<TradeCurr>JPY</TradeCurr> --成交币制---币制
<UseTo></UseTo> --用途/生产厂家---空值
<WorkUsd></WorkUsd> --工缴费---
<DestinationCountry>BLM</DestinationCountry> --最终目的国(地区)---原产地
<CiqCode></CiqCode> --CIQ代码---
<DeclGoodsEname></DeclGoodsEname> --申报货物名称(外文)---
<DestCode></DestCode> --目的地代码---
<DistrictCode>4408W</DistrictCode> --境内目的地/境内货源地---境内货源地
</DecList>
</DecLists>
</DecMessage>
No preview for this file type
No preview for this file type
md5 小写 16位
iClearExportDev
iClearExportTest
iClearExportProd
1、接口数据模型调研 2
2、设计数据接口 2
3、接收运单数据
3.1、接口开发(异步处理) 5
3.1.1、数据落地
3.1.2、数据推送到iClear
3.1.3、压力测试
3.2、接口联调 3
4、推送数据
4.1、推送报关数据 4
4.2、推送回执 4
5、接口数据运维系统 10
1、查询接收、推送数据日志及接收或推送的 结果
2、补推数据功能
6、环境搭建 5
MQ+ MongoDB
7、上线准备 1
8、服务部署 3
9、域名及SSL证书申请 3
No preview for this file type
No preview for this file type
No preview for this file type
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.17.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.erry.iclear</groupId>
<artifactId>iclear-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>iClear-api</name>
<description>iClear-api</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-actuator</artifactId>-->
<!-- <version>2.1.7.RELEASE</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-actuator-autoconfigure</artifactId>-->
<!-- <version>2.1.7.RELEASE</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.60</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>dev</id>
<properties>
<activatedProperties>dev</activatedProperties>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<activatedProperties>test</activatedProperties>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<activatedProperties>prod</activatedProperties>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.erry.iclear.dateInterface;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @author Administrator
*/
@Component
public class Constant {
public static Map<String,HashMap<String,String>> appIdSecurity = new HashMap<>();
}
package com.erry.iclear.dateInterface;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author Administrator
*/
@Slf4j
@SpringBootApplication
@EnableScheduling
public class IClearApiApplication {
public static void main(String[] args) {
SpringApplication.run(IClearApiApplication.class, args);
}
}
package com.erry.iclear.dateInterface.api;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
/**
* @author Administrator
*/
@RestController
@RequestMapping("/customs")
@Slf4j
public class CustomsDataInterface {
private Gson gson = new Gson();
@ApiOperation(value = "推送主单数据", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/customs/sendMawb")
@PostMapping("/sendMawb")
@ResponseBody
public ResultRS sendMawb(@RequestBody Mawb mawb) {
log.info("接收到主单数据:" + gson.toJson(mawb));
ResultRS result = new ResultRS();
result.setSuccess(Boolean.FALSE);
//0、TODO 校验用户名密码
//1、TODO 收到主单信息后,数据先落地
//2、TODO 校验主单
//3、TODO 校验子单
//4、TODO 保存主单
return result;
}
}
package com.erry.iclear.dateInterface.api.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author Administrator
*/
@ApiModel(value = "mawb", description = "主运单")
@Data
public class Mawb implements Serializable {
@ApiModelProperty(value = "进出口标志", name = "IEFlag", example = "固定值:E")
private String IEFlag;
@ApiModelProperty(value = "报关类型", name = "Type", example = "固定值:EX")
private String Type;
@ApiModelProperty(value = "申报单位代码", name = "agentCode", example = "固定值:1111980005")
private String agentCode;
@ApiModelProperty(value = "申报单位名称", name = "agentName", example = "固定值:联邦快递(中国)有限公司")
private String agentName;
@ApiModelProperty(value = "提单号", name = "billNo", example = "固定值:有总单号则取值‘总单号_运单号‘,没有总单号则取值‘运单号‘")
private String billNo;
@ApiModelProperty(value = "合同号", name = "contrNo", example = "")
private String contrNo;
@ApiModelProperty(value = "主管海关(申报地海关)", name = "customMaster", example = "固定值:0101")
private String customMaster;
@ApiModelProperty(value = "征免性质", name = "cutMode", example = "101")
private String cutMode;
@ApiModelProperty(value = "报关/转关关系标志", name = "declTrnRel", example = "固定值:0")
private String declTrnRel;
@ApiModelProperty(value = "经停港/指运港", name = "distinatePort", example = "ASM000")
private String distinatePort;
@ApiModelProperty(value = "报关标志", name = "EdiId", example = "001")
private String ediId;
@ApiModelProperty(value = "海关编号", name = "EntryId", example = "001")
private String entryId;
@ApiModelProperty(value = "运费币制", name = "feeCurr", example = "固定值:3")
private String feeCurr;
@ApiModelProperty(value = "运费标记", name = "feeMark", example = "99.22")
private String feeMark;
@ApiModelProperty(value = "运费/率", name = "feeRate", example = "43.34358")
private BigDecimal feeRate;
@ApiModelProperty(value = "毛重", name = "grossWet", example = "")
private Integer grossWet;
@ApiModelProperty(value = "出入境关闭", name = "IEPort", example = "固定值:0101")
private String IEPort;
@ApiModelProperty(value = "录入人名称", name = "InputerName", example = "固定值:0101")
private String inputerName;
@ApiModelProperty(value = "保险费币制", name = "insurCurr", example = "MOP")
private String insurCurr;
@ApiModelProperty(value = "保险费标记", name = "insurMark", example = "固定值:3")
private String insurMark;
@ApiModelProperty(value = "保险费/率", name = "insurRate", example = "")
private BigDecimal insurRate;
@ApiModelProperty(value = "备案号", name = "manualNo", example = "")
private String manualNo;
@ApiModelProperty(value = "净重", name = "netWt", example = "")
private BigDecimal netWt;
@ApiModelProperty(value = "杂费币制", name = "otherCurr", example = "")
private String otherCurr;
@ApiModelProperty(value = "杂费/率", name = "otherRate", example = "")
private BigDecimal otherRate;
@ApiModelProperty(value = "杂费标志", name = "otherMark", example = "")
private String otherMark;
@ApiModelProperty(value = "消费使用/生产销售单位代码", name = "ownerCode", example = "Z321654987")
private String ownerCode;
@ApiModelProperty(value = "消费使用/生产销售单位名称", name = "ownerName", example = "上海保险")
private String ownerName;
@ApiModelProperty(value = "件数", name = "packNo", example = "")
private Integer packNo;
@ApiModelProperty(value = "预录入编号", name = "preEntryId", example = "")
private String preEntryId;
@ApiModelProperty(value = "启运国/运抵国", name = "tradeCountry", example = "USA")
private String tradeCountry;
@ApiModelProperty(value = "监管方式", name = "tradeMode", example = "0200")
private String tradeMode;
@ApiModelProperty(value = "境内收发货人编号", name = "tradeCode", example = "Z321654987")
private String tradeCode;
@ApiModelProperty(value = "运输方式代码", name = "trafMode", example = "1")
private String trafMode;
@ApiModelProperty(value = "境内收发货人名称", name = "tradeName", example = "上海铢怡国际货物运输代理有限公司")
private String tradeName;
@ApiModelProperty(value = "成交方式", name = "transMode", example = "2")
private String transMode;
@ApiModelProperty(value = "包装种类", name = "wrapType", example = "22")
private String wrapType;
@ApiModelProperty(value = "生产核销单位统一信用代码---报关形式类型", name = "TradeCodeScc", example = "A74125896321456987")
private String tradeCodeScc;
@ApiModelProperty(value = "消费使用/生产销售单位单位统一编码", name = "ownerCodeScc", example = "")
private String ownerCodeScc;
@ApiModelProperty(value = "贸易国别", name = "tradeAreaCode", example = "")
private String tradeAreaCode;
@ApiModelProperty(value = "标记及号码", name = "markNo", example = "N/M")
private String markNo;
@ApiModelProperty(value = "入境口岸代码", name = "entyPortCode", example = "固定值:310302")
private String entyPortCode;
@ApiModelProperty(value = "入境口岸代码", name = "goodsPlace", example = "固定值:空值")
private String goodsPlace;
@ApiModelProperty(value = "申报人员姓名---报关员证号", name = "declareName", example = "固定值:空值")
private String declareName;
@ApiModelProperty(value = "境外发货人代码", name = "overseasConsignorCode", example = "")
private String overseasConsignorCode;
@ApiModelProperty(value = "境外收货人编码", name = "overseasConsigneeCode", example = "")
private String overseasConsigneeCode;
@ApiModelProperty(value = "境外收货人名称(外文)", name = "overseasConsigneeEname", example = "")
private String overseasConsigneeEname;
@ApiModelProperty(value = "运单明细", name = "mawbDetailList", example = "")
private List<MawbDetail> mawbDetailList;
}
package com.erry.iclear.dateInterface.api.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author Administrator
*/
@ApiModel(value = "mawbDetail", description = "运单明细")
@Data
public class MawbDetail implements Serializable {
@ApiModelProperty(value = "商品编号", example = "空值")
private String classMark;
@ApiModelProperty(value = "商品编号")
private String codeTS;
@ApiModelProperty(value = "申报单价", example = "空值")
private BigDecimal declPrice;
@ApiModelProperty(value = "申报总价")
private BigDecimal declTotal;
@ApiModelProperty(value = "征免方式")
private String dutyMode;
@ApiModelProperty(value = "货号")
private String exgNo;
@ApiModelProperty(value = "货号")
private String exgVersion;
@ApiModelProperty(value = "第一计量单位(法定单位)")
private String firstUnit;
@ApiModelProperty(value = "第一法定数量")
private Integer firstQty;
@ApiModelProperty(value = "成交计量单位")
private String GUnit;
@ApiModelProperty(value = "商品规格、型号")
private String GModel;
@ApiModelProperty(value = "商品名称")
private String GName;
@ApiModelProperty(value = "商品序号")
private String GNo;
@ApiModelProperty(value = "成交数量")
private Integer GQty;
@ApiModelProperty(value = "原产国")
private String originCountry;
@ApiModelProperty(value = "第二计量单位")
private String secondUnit;
@ApiModelProperty(value = "第二法定数量")
private Integer secondQty;
@ApiModelProperty(value = "成交币制")
private String tradeCurr;
@ApiModelProperty(value = "用途/生产厂家")
private String useTo;
@ApiModelProperty(value = "工缴费")
private BigDecimal workUsd;
@ApiModelProperty(value = "检验检疫编")
private String ciqCode;
@ApiModelProperty(value = "最终目的国(地区)")
private String destinationCountry;
@ApiModelProperty(value = "申报货物英文名称")
private String declGoodsEname;
@ApiModelProperty(value = "目的地代码")
private String destCode;
@ApiModelProperty(value = "境内目的地/境内货源地")
private String districtCode;
}
package com.erry.iclear.dateInterface.api.response;
import lombok.Data;
import java.io.Serializable;
/**
* @author Administrator
*/
@Data
public class ResultRS implements Serializable {
//成功标识
private Boolean success = true;
private String code;
//错误信息
private String msg;
private Object data;
}
package com.erry.iclear.dateInterface.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.ControllerAdvice;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author Administrator
* http://localhost:8080/swagger-ui.html
*/
@Configuration
@EnableSwagger2
@ControllerAdvice(basePackages = {"com.erry.iclear.dateInterface.controller"})
@Profile({"!prod"})
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("iClearExport DateInterface")
.description("iClearExport 数据接口")
.termsOfServiceUrl("http://dateInterface.iClearExport.com")
.version("1.0")
.build();
}
}
package com.erry.iclear.dateInterface.controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Administrator
*/
@RestController
@RequestMapping("/system")
public class IClearExportInterface {
@ApiOperation(value = "IClear 健康检查" ,httpMethod ="GET" ,notes="ex: http://localhost:8080/system/healthCheck")
@GetMapping("/healthCheck")
public String healthCheck() {
return "iClearApi 当前时间:"+System.currentTimeMillis();
}
@ApiOperation(value = "IClear 刷新缓存" ,httpMethod ="GET" ,notes="ex: http://192.168.0.75:8080/system/refreshCache")
@GetMapping("/refreshCache")
public String refreshCache() {
return "Success";
}
}
package com.erry.iclear.dateInterface.init;
import com.erry.iclear.dateInterface.Constant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* @author Administrator
*/
@Service("IClearApiSystemInit")
@Slf4j
public class IClearApiSystemInit implements InitializingBean, ApplicationContextAware{
private ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext)throws BeansException {
this.applicationContext = applicationContext;
}
@Override
public void afterPropertiesSet() throws Exception {
try{
log.info("init appIdSecurity start>>>>>>>>>");
//TODO 需要从数据库中读取,然后加载到map中
String appId="CTM";
String appKey="iClearExport";
String security="b92131f03f19a348";
HashMap<String,String> appkeyMap = new HashMap<>();
appkeyMap.put(appKey,security);
Constant.appIdSecurity.put(appId,appkeyMap);
log.info("init appIdSecurity end>>>>>>>>>");
}catch (Exception e){
log.error("init appIdSecurity error:" + e.getMessage());
}
}
}
package com.erry.iclear.dateInterface.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author Administrator
*/
@Service
@Slf4j
public class IClearApiSystemService {
/**
* TODO 刷新缓存
*/
public void refreshCache(){
}
}
package com.erry.iclear.dateInterface.service;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.request.MawbDetail;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author Administrator
*/
@Service
@Slf4j
public class MawbDetailService {
public void saveMawbDetail(MawbDetail mawbDetail){
log.info("");
log.info("");
}
}
package com.erry.iclear.dateInterface.service;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* @author Administrator
*/
@Service
@Slf4j
public class MawbService {
private Gson gson = new Gson();
/**
* 保存主单
* @param mawb
*/
public void saveMawb(Mawb mawb){
try{
log.info("saveMawb start>>>>>>>>>>>");
log.info("saveMawb end>>>>>>>>>>>");
}catch (Exception e){
log.error("saveMawb() error:"+e.getMessage());
}
}
/**
* 校验主单
* @param mawb
* @return
*/
public Boolean checkMawb(Mawb mawb){
try{
log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb));
boolean checkResult = Boolean.FALSE;
//checkResult=
log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)
+" result :" +checkResult
);
return checkResult;
}catch (Exception e){
log.error("checkMawb() error:" + e.getMessage());
}
return Boolean.FALSE;
}
}
package com.erry.iclear.dateInterface.task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author Administrator
*/
@Component
@Slf4j
public class IClearApiTask {
/**
* TODO 定时任务:每分钟推送
*/
@Scheduled(cron = "${task.pushMawbToIClear}")
public void pushMawbToIClear(){
try{
log.info("pushMawbToIClear start>>>>>>>>>>>>");
log.info("pushMawbToIClear end>>>>>>>>>>>>");
}catch (Exception e){
log.error("pushMawbToIClear() error:" +e.getMessage());
}
}
}
server:
port: 8080
spring:
application:
name: iClearExport.DataInterface
task:
pushMawbToIClear: 0 0/1 * * * ?
\ No newline at end of file
server:
port: 8080
spring:
application:
name: iClearExport.DataInterface
task:
pushMawbToIClear: 0 0/1 * * * ?
\ No newline at end of file
server:
port: 8080
spring:
application:
name: iClearExport.DataInterface
task:
pushMawbToIClear: 0 0/1 * * * ?
\ No newline at end of file
package com.erry.iclear.dateInterface;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.request.MawbDetail;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.google.gson.Gson;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class ApiTest {
public static void main(String[] args) {
MawbDetail d1 = new MawbDetail();
d1.setClassMark("");
d1.setCodeTS("69125472");
d1.setDeclPrice(BigDecimal.valueOf(111.123));
d1.setDeclTotal(BigDecimal.valueOf(788));
d1.setDutyMode("1");
d1.setExgNo("");
d1.setExgVersion("");
d1.setFirstUnit("");
d1.setFirstQty(11);
d1.setGUnit("007");
d1.setGModel("商品规格、型号");
d1.setGName("餐桌");
d1.setGNo("1");
d1.setGQty(1);
d1.setOriginCountry("USA");
d1.setSecondUnit("007");
d1.setSecondQty(2);
d1.setTradeCurr("USA");
d1.setUseTo("");
d1.setWorkUsd(null);
d1.setDestinationCountry("CHN");
d1.setCiqCode("");
d1.setDeclGoodsEname("");
d1.setDestCode("");
d1.setDistrictCode("4408W");
MawbDetail d2 = new MawbDetail();
d2.setClassMark("");
d2.setCodeTS("69125472");
d2.setDeclPrice(BigDecimal.valueOf(45.72));
d2.setDeclTotal(BigDecimal.valueOf(33));
d2.setDutyMode("1");
d2.setExgNo("");
d2.setExgVersion("");
d2.setFirstUnit("");
d2.setFirstQty(11);
d2.setGUnit("007");
d2.setGModel("商品规格、型号");
d2.setGName("餐桌");
d2.setGNo("2");
d2.setGQty(22);
d2.setOriginCountry("USA");
d2.setSecondUnit("007");
d2.setSecondQty(3);
d2.setTradeCurr("USA");
d2.setUseTo("");
d2.setWorkUsd(null);
d2.setDestinationCountry("CHN");
d2.setCiqCode("");
d2.setDeclGoodsEname("");
d2.setDestCode("");
d2.setDistrictCode("4408W");
List<MawbDetail> mawbDetailList = new ArrayList<MawbDetail>();
mawbDetailList.add(d1);
mawbDetailList.add(d2);
Mawb mawb = new Mawb();
mawb.setIEFlag("E");
mawb.setType("EX");
mawb.setAgentCode("1111980005");
mawb.setAgentName("联邦快递(中国)有限公司");
mawb.setBillNo("202105210784");
mawb.setContrNo("NO.565733");
mawb.setCustomMaster("0101");
mawb.setCutMode("101");
mawb.setDeclTrnRel("0");
mawb.setDistinatePort("ASM000");
mawb.setEdiId("001");
mawb.setEntryId("25512456");
mawb.setFeeCurr("USD");
mawb.setFeeMark("3");
mawb.setFeeRate(BigDecimal.valueOf(100.58));
mawb.setGrossWet(500);
mawb.setIEPort("0101");
mawb.setInputerName("");
mawb.setInsurCurr("MOP");
mawb.setInsurMark("3");
mawb.setInsurRate(BigDecimal.valueOf(23.44));
mawb.setManualNo("备案号");
mawb.setNetWt(BigDecimal.valueOf(80));
mawb.setOtherCurr("杂费币制");
mawb.setOtherRate(BigDecimal.valueOf(10));
mawb.setOtherMark("");
mawb.setOwnerCode("Z321654987");
mawb.setOwnerName("上海保险");
mawb.setPackNo(1);
mawb.setPreEntryId("");
mawb.setTradeCountry("USA");
mawb.setTradeMode("0200");
mawb.setTradeCode("Z321654987");
mawb.setTrafMode("1");
mawb.setTradeName("上海铢怡国际货物运输代理有限公司");
mawb.setTransMode("3");
mawb.setWrapType("22");
mawb.setTradeCodeScc("A74125896321456987");
mawb.setOwnerCodeScc("A74125896321456987");
mawb.setTradeAreaCode("USA");
mawb.setMarkNo("N/M");
mawb.setEntyPortCode("310302");
mawb.setGoodsPlace("");
mawb.setDeclareName("张安");
mawb.setOverseasConsignorCode("Z785421");
mawb.setOverseasConsigneeCode("Z785421");
mawb.setOverseasConsigneeEname("出口时必填收件人公司名(原)");
mawb.setMawbDetailList(mawbDetailList);
List list=(List<MawbDetail>) mawb.getMawbDetailList();
list.forEach(d->{
System.out.println(d.toString());
});
ResultRS rs = new ResultRS();
rs.setSuccess(true);
rs.setCode("200");
rs.setMsg("操作成功");
rs.setData(mawbDetailList);
Gson gson = new Gson();
System.out.println(gson.toJson(mawb));
System.out.println(gson.toJson(rs));
}
}
package com.erry.iclear.dateInterface;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class IClearApiApplicationTests {
@Test
void contextLoads() {
}
}