作者 Kevin

修改预配界面的相关bug,添加sli和fhl的报文生成和发送功能。

正在显示 41 个修改的文件 包含 2049 行增加976 行删除

要显示太多修改。

为保证性能只显示 41 of 41+ 个文件。

不能预览此文件类型
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="module" value="true"/>
  28 + <attribute name="maven.pomderived" value="true"/>
  29 + </attributes>
  30 + </classpathentry>
  31 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  32 + <attributes>
  33 + <attribute name="maven.pomderived" value="true"/>
  34 + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
  35 + </attributes>
  36 + </classpathentry>
  37 + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
  38 + <classpathentry kind="output" path="target/classes"/>
  39 +</classpath>
  1 +/target/
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>agent</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.jdt.core.javabuilder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + <buildCommand>
  14 + <name>org.eclipse.wst.common.project.facet.core.builder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
  18 + <buildCommand>
  19 + <name>org.eclipse.wst.validation.validationbuilder</name>
  20 + <arguments>
  21 + </arguments>
  22 + </buildCommand>
  23 + <buildCommand>
  24 + <name>org.eclipse.m2e.core.maven2Builder</name>
  25 + <arguments>
  26 + </arguments>
  27 + </buildCommand>
  28 + </buildSpec>
  29 + <natures>
  30 + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  31 + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  32 + <nature>org.eclipse.jdt.core.javanature</nature>
  33 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  34 + <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  35 + <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  36 + </natures>
  37 +</projectDescription>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
  4 + <classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
  5 + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
  6 + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
  7 + <attributes>
  8 + <attribute name="hide" value="true"/>
  9 + </attributes>
  10 + </classpathentry>
  11 + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
  12 + <classpathentry kind="output" path=""/>
  13 +</classpath>
  1 +eclipse.preferences.version=1
  2 +encoding//src/main/java=UTF-8
  3 +encoding//src/main/resources=UTF-8
  4 +encoding//src/test/java=UTF-8
  5 +encoding//src/test/resources=UTF-8
  6 +encoding/<project>=UTF-8
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.compliance=1.7
  5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.source=1.7
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="ROOT">
  3 + <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
  4 + <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
  5 + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
  6 + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
  7 + <property name="context-root" value="ROOT"/>
  8 + <property name="java-output-path" value="/agent/target/classes"/>
  9 + </wb-module>
  10 +</project-modules>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<faceted-project>
  3 + <fixed facet="wst.jsdt.web"/>
  4 + <installed facet="java" version="1.7"/>
  5 + <installed facet="jst.web" version="3.0"/>
  6 + <installed facet="wst.jsdt.web" version="1.0"/>
  7 +</faceted-project>
  1 +org.eclipse.wst.jsdt.launching.baseBrowserLibrary
  1 +disabled=06target
  2 +eclipse.preferences.version=1
1 -<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
3 <groupId>com.airport</groupId> 4 <groupId>com.airport</groupId>
4 <artifactId>agent</artifactId> 5 <artifactId>agent</artifactId>
@@ -6,14 +7,14 @@ @@ -6,14 +7,14 @@
6 <url>http://maven.apache.org</url> 7 <url>http://maven.apache.org</url>
7 <packaging>war</packaging> 8 <packaging>war</packaging>
8 <!-- 设定除中央仓库 (repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查询,如有Nexus私服, 取消注释并指向正确的服务器地址 --> 9 <!-- 设定除中央仓库 (repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查询,如有Nexus私服, 取消注释并指向正确的服务器地址 -->
9 - <repositories> 10 + <!-- <repositories>
10 <repository> 11 <repository>
11 <id>public</id> 12 <id>public</id>
12 <name>Public Repositories</name> 13 <name>Public Repositories</name>
13 <url>http://maven.aliyun.com/nexus/content/groups/public</url> 14 <url>http://maven.aliyun.com/nexus/content/groups/public</url>
14 15
15 </repository> 16 </repository>
16 - </repositories> 17 + </repositories> -->
17 18
18 <!-- 主要依赖库版本定义 --> 19 <!-- 主要依赖库版本定义 -->
19 <properties> 20 <properties>
@@ -93,11 +94,12 @@ @@ -93,11 +94,12 @@
93 <version>1.2.16</version> 94 <version>1.2.16</version>
94 </dependency> 95 </dependency>
95 96
96 - <!--<dependency>-->  
97 - <!--<groupId>org.apache</groupId>-->  
98 - <!--<artifactId>ant-zip</artifactId>-->  
99 - <!--<version>4.0</version>-->  
100 - <!--</dependency>--> 97 + <!-- https://mvnrepository.com/artifact/org.jdom/jdom -->
  98 + <dependency>
  99 + <groupId>org.jdom</groupId>
  100 + <artifactId>jdom</artifactId>
  101 + <version>1.1.3</version>
  102 + </dependency>
101 103
102 <!-- junit --> 104 <!-- junit -->
103 <dependency> 105 <dependency>
@@ -145,7 +147,11 @@ @@ -145,7 +147,11 @@
145 <version>${log4j.version}</version> 147 <version>${log4j.version}</version>
146 </dependency> 148 </dependency>
147 149
148 - 150 + <dependency>
  151 + <groupId>javax.annotation</groupId>
  152 + <artifactId>jsr250-api</artifactId>
  153 + <version>1.0</version>
  154 + </dependency>
149 155
150 156
151 <!-- spring framework --> 157 <!-- spring framework -->
@@ -375,11 +381,11 @@ @@ -375,11 +381,11 @@
375 </dependency> 381 </dependency>
376 382
377 <!-- velocity 模板 --> 383 <!-- velocity 模板 -->
378 - <dependency> 384 + <!-- <dependency>
379 <groupId>org.apache.velocity</groupId> 385 <groupId>org.apache.velocity</groupId>
380 <artifactId>velocity</artifactId> 386 <artifactId>velocity</artifactId>
381 <version>${velocity.version}</version> 387 <version>${velocity.version}</version>
382 - </dependency> 388 + </dependency> -->
383 389
384 <dependency> 390 <dependency>
385 <groupId>org.apache.velocity</groupId> 391 <groupId>org.apache.velocity</groupId>
@@ -392,12 +398,6 @@ @@ -392,12 +398,6 @@
392 </exclusion> 398 </exclusion>
393 </exclusions> 399 </exclusions>
394 </dependency> 400 </dependency>
395 - <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->  
396 - <dependency>  
397 - <groupId>org.apache.cxf</groupId>  
398 - <artifactId>cxf-rt-frontend-jaxws</artifactId>  
399 - <version>2.7.11</version>  
400 - </dependency>  
401 401
402 <dependency> 402 <dependency>
403 <groupId>redis.clients</groupId> 403 <groupId>redis.clients</groupId>
@@ -405,6 +405,12 @@ @@ -405,6 +405,12 @@
405 <version>2.1.0</version> 405 <version>2.1.0</version>
406 </dependency> 406 </dependency>
407 407
  408 + <dependency>
  409 + <groupId>org.apache.ant</groupId>
  410 + <artifactId>ant</artifactId>
  411 + <version>1.9.7</version>
  412 + </dependency>
  413 +
408 </dependencies> 414 </dependencies>
409 415
410 <!-- 配置文件 --> 416 <!-- 配置文件 -->
@@ -465,28 +471,13 @@ @@ -465,28 +471,13 @@
465 </configuration> 471 </configuration>
466 </plugin> 472 </plugin>
467 473
468 - <!-- Maven 打包插件  
469 - <plugin>  
470 - <groupId>org.apache.maven.plugins</groupId>  
471 - <artifactId>maven-war-plugin</artifactId>  
472 - <version>3.1.0</version>  
473 - <configuration>  
474 - <archive>  
475 - <addMavenDescriptor>false</addMavenDescriptor>  
476 - </archive>  
477 - <webResources>  
478 - <resource>  
479 - <directory>src/main/resoreces/conf/${package.environment}</directory>  
480 - <targetPath>WEB-INF/classes</targetPath>  
481 - <filtering>true</filtering>  
482 - </resource>  
483 - </webResources>  
484 - </configuration>  
485 - </plugin>--> 474 + <!-- Maven 打包插件 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId>
  475 + <version>3.1.0</version> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor>
  476 + </archive> <webResources> <resource> <directory>src/main/resoreces/conf/${package.environment}</directory>
  477 + <targetPath>WEB-INF/classes</targetPath> <filtering>true</filtering> </resource>
  478 + </webResources> </configuration> </plugin> -->
486 479
487 </plugins> 480 </plugins>
488 </build> 481 </build>
489 - <modules>  
490 - <module>?</module>  
491 - </modules> 482 + <!-- <modules> <module>?</module> </modules> -->
492 </project> 483 </project>
不能预览此文件类型
不能预览此文件类型
@@ -8,15 +8,25 @@ import java.util.List; @@ -8,15 +8,25 @@ import java.util.List;
8 import javax.annotation.Resource; 8 import javax.annotation.Resource;
9 import javax.servlet.http.HttpServletRequest; 9 import javax.servlet.http.HttpServletRequest;
10 10
11 -import com.agent.entity.agent.BasicAgentEntity; 11 +import org.springframework.stereotype.Controller;
  12 +import org.springframework.ui.Model;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestMethod;
  15 +import org.springframework.web.bind.annotation.ResponseBody;
  16 +
  17 +import com.agent.controller.BasicController;
12 import com.agent.entity.agent.BillCheckEntity; 18 import com.agent.entity.agent.BillCheckEntity;
13 import com.agent.entity.agent.MakeHawbEntity; 19 import com.agent.entity.agent.MakeHawbEntity;
14 import com.agent.entity.agent.MakeMawbEntity; 20 import com.agent.entity.agent.MakeMawbEntity;
15 -import com.agent.service.agent.*; 21 +import com.agent.entity.agent.PubStationEntity;
  22 +import com.agent.service.agent.BasicAgentService;
  23 +import com.agent.service.agent.BillCheckService;
  24 +import com.agent.service.agent.MakeHawbService;
  25 +import com.agent.service.agent.MakeMawbService;
  26 +import com.agent.service.agent.PubStationService;
16 import com.agent.util.HttpJsonMsg; 27 import com.agent.util.HttpJsonMsg;
17 import com.agent.vo.ResponseModel; 28 import com.agent.vo.ResponseModel;
18 import com.alibaba.fastjson.JSONObject; 29 import com.alibaba.fastjson.JSONObject;
19 -import com.framework.shiro.SessionUtil;  
20 import com.framework.util.DateFormat; 30 import com.framework.util.DateFormat;
21 31
22 import billcheckservice.BillCheckServiceProxy; 32 import billcheckservice.BillCheckServiceProxy;
@@ -26,19 +36,6 @@ import billcheckservice.ReturnRecode; @@ -26,19 +36,6 @@ import billcheckservice.ReturnRecode;
26 import tools.BillCheckReturnData; 36 import tools.BillCheckReturnData;
27 import tools.DataSerieal; 37 import tools.DataSerieal;
28 38
29 -import org.apache.commons.lang.StringUtils;  
30 -import org.apache.shiro.authz.annotation.RequiresPermissions;  
31 -import org.apache.shiro.authz.annotation.RequiresRoles;  
32 -import org.apache.struts.util.RequestUtils;  
33 -import org.springframework.stereotype.Controller;  
34 -import org.springframework.ui.Model;  
35 -import org.springframework.web.bind.annotation.RequestMapping;  
36 -  
37 -import com.agent.controller.BasicController;  
38 -import com.agent.entity.agent.PubStationEntity;  
39 -import org.springframework.web.bind.annotation.RequestMethod;  
40 -import org.springframework.web.bind.annotation.ResponseBody;  
41 -  
42 /** 39 /**
43 * 账单核审 40 * 账单核审
44 * @author 61004 41 * @author 61004
1 package com.agent.controller.agent; 1 package com.agent.controller.agent;
2 2
  3 +import java.io.IOException;
  4 +import java.text.ParseException;
  5 +import java.util.ArrayList;
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import javax.annotation.Resource;
  11 +import javax.servlet.http.HttpServletRequest;
  12 +import javax.servlet.http.HttpServletResponse;
  13 +
  14 +import org.apache.commons.collections.CollectionUtils;
  15 +import org.apache.commons.lang.StringUtils;
  16 +import org.slf4j.Logger;
  17 +import org.slf4j.LoggerFactory;
  18 +import org.springframework.stereotype.Controller;
  19 +import org.springframework.ui.Model;
  20 +import org.springframework.web.bind.annotation.RequestMapping;
  21 +import org.springframework.web.bind.annotation.RequestMethod;
  22 +import org.springframework.web.bind.annotation.ResponseBody;
  23 +import org.springframework.web.servlet.ModelAndView;
  24 +
3 import com.agent.controller.BasicController; 25 import com.agent.controller.BasicController;
4 import com.agent.entity.Constant; 26 import com.agent.entity.Constant;
5 -import com.agent.entity.agent.*;  
6 -import com.agent.entity.system.UserEntity;  
7 -import com.agent.service.agent.*; 27 +import com.agent.entity.agent.BasicAgentEntity;
  28 +import com.agent.entity.agent.ConsigneeEntity;
  29 +import com.agent.entity.agent.DeliveryInfoEntity;
  30 +import com.agent.entity.agent.HawbOtherFeeEntity;
  31 +import com.agent.entity.agent.MakeHawbEntity;
  32 +import com.agent.entity.agent.MakeMawbEntity;
  33 +import com.agent.entity.agent.MawbOtherFeeEntity;
  34 +import com.agent.entity.agent.PackageTypeEntity;
  35 +import com.agent.entity.agent.PubStationEntity;
  36 +import com.agent.service.agent.BasicAgentService;
  37 +import com.agent.service.agent.ConsigneeService;
  38 +import com.agent.service.agent.DeliveryInfoService;
  39 +import com.agent.service.agent.HawbOtherFeeService;
  40 +import com.agent.service.agent.MakeHawbService;
  41 +import com.agent.service.agent.MakeMawbService;
  42 +import com.agent.service.agent.MawbOtherFeeService;
  43 +import com.agent.service.agent.PackageSizeService;
  44 +import com.agent.service.agent.PackageTypeService;
  45 +import com.agent.service.agent.PubStationService;
8 import com.agent.util.HttpJsonMsg; 46 import com.agent.util.HttpJsonMsg;
9 import com.agent.vo.ResponseModel; 47 import com.agent.vo.ResponseModel;
10 -import com.agent.xml.bill.*; 48 +import com.agent.xml.bill.ApplicableFreightRateServiceChargeXml;
  49 +import com.agent.xml.bill.ApplicableLogisticsAllowanceChargeXml;
  50 +import com.agent.xml.bill.ApplicableTradeCurrencyExchangeXml;
  51 +import com.agent.xml.bill.AssociatedPartyXml;
  52 +import com.agent.xml.bill.AssociatedUnitLoadTransportEquipmentXml;
  53 +import com.agent.xml.bill.BillHeadXml;
  54 +import com.agent.xml.bill.BillXmlBody;
  55 +import com.agent.xml.bill.ConsignorPartyXml;
  56 +import com.agent.xml.bill.DepartureEventXml;
  57 +import com.agent.xml.bill.DirectTelephoneCommunicationXml;
  58 +import com.agent.xml.bill.EventTimeXml;
  59 +import com.agent.xml.bill.HandlingInstructionsXml;
  60 +import com.agent.xml.bill.IncludedMasterConsignmentItemXml;
  61 +import com.agent.xml.bill.LinearSpatialDimensionXml;
  62 +import com.agent.xml.bill.MasterConsignmentXml;
  63 +import com.agent.xml.bill.NatureIdentificationTransportCargoXml;
  64 +import com.agent.xml.bill.OccurrenceArrivalLocationXml;
  65 +import com.agent.xml.bill.OperatingPartyXml;
  66 +import com.agent.xml.bill.PostalStructuredAddressXml;
  67 +import com.agent.xml.bill.ReportedStatusXml;
  68 +import com.agent.xml.bill.SignatoryCarrierAuthenticationXml;
  69 +import com.agent.xml.bill.SpecifiedLogisticsTransportMovementXml;
  70 +import com.agent.xml.bill.TransportLogisticsPackageXml;
11 import com.agent.xml.common.IDXml; 71 import com.agent.xml.common.IDXml;
12 import com.agent.xml.common.NameXml; 72 import com.agent.xml.common.NameXml;
13 import com.agent.xml.common.XmlUtil; 73 import com.agent.xml.common.XmlUtil;
@@ -20,29 +80,6 @@ import com.plugin.easyui.EasyPage; @@ -20,29 +80,6 @@ import com.plugin.easyui.EasyPage;
20 80
21 import tools.Tools; 81 import tools.Tools;
22 82
23 -import org.apache.commons.collections.CollectionUtils;  
24 -import org.apache.commons.lang.StringUtils;  
25 -import org.apache.shiro.authz.annotation.RequiresPermissions;  
26 -import org.apache.shiro.authz.annotation.RequiresRoles;  
27 -import org.slf4j.Logger;  
28 -import org.slf4j.LoggerFactory;  
29 -import org.springframework.stereotype.Controller;  
30 -import org.springframework.ui.Model;  
31 -import org.springframework.web.bind.annotation.RequestMapping;  
32 -import org.springframework.web.bind.annotation.RequestMethod;  
33 -import org.springframework.web.bind.annotation.ResponseBody;  
34 -import org.springframework.web.servlet.ModelAndView;  
35 -  
36 -import javax.annotation.Resource;  
37 -import javax.servlet.http.HttpServletRequest;  
38 -import javax.servlet.http.HttpServletResponse;  
39 -import java.io.IOException;  
40 -import java.text.ParseException;  
41 -import java.util.ArrayList;  
42 -import java.util.Date;  
43 -import java.util.List;  
44 -import java.util.Map;  
45 -  
46 /** 83 /**
47 * Created by cohesion on 2017/3/29. 84 * Created by cohesion on 2017/3/29.
48 */ 85 */
@@ -52,7 +89,6 @@ public class BillController extends BasicController{ @@ -52,7 +89,6 @@ public class BillController extends BasicController{
52 89
53 private static final Logger logger = LoggerFactory.getLogger(BillController.class); 90 private static final Logger logger = LoggerFactory.getLogger(BillController.class);
54 91
55 -  
56 @Resource 92 @Resource
57 private MakeMawbService makeMawbService; 93 private MakeMawbService makeMawbService;
58 94
1 package com.agent.controller.agent; 1 package com.agent.controller.agent;
2 2
3 -import java.util.ArrayList;  
4 import java.util.List; 3 import java.util.List;
5 import java.util.Map; 4 import java.util.Map;
6 5
@@ -14,9 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; @@ -14,9 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
14 13
15 import com.agent.controller.BasicController; 14 import com.agent.controller.BasicController;
16 import com.agent.entity.agent.ConsigneeEntity; 15 import com.agent.entity.agent.ConsigneeEntity;
17 -import com.agent.entity.agent.ConsigneeInfo;  
18 import com.agent.service.agent.ConsigneeService; 16 import com.agent.service.agent.ConsigneeService;
19 -import com.agent.service.agent.PubStationService;  
20 import com.agent.util.HttpJsonMsg; 17 import com.agent.util.HttpJsonMsg;
21 import com.agent.vo.ResponseModel; 18 import com.agent.vo.ResponseModel;
22 import com.framework.core.Servlets; 19 import com.framework.core.Servlets;
  1 +package com.agent.controller.agent;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.annotation.Resource;
  6 +import javax.servlet.http.HttpServletRequest;
  7 +
  8 +import org.springframework.stereotype.Controller;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.ResponseBody;
  11 +
  12 +import com.agent.controller.BasicController;
  13 +import com.agent.entity.agent.ConsignorEntity;
  14 +import com.agent.service.agent.ConsignorService;
  15 +import com.agent.vo.ResponseModel;
  16 +
  17 +import tools.Tools;
  18 +
  19 +/**
  20 + *
  21 + * Depiction: 发货人控制器
  22 + * <p>
  23 + * Modify:
  24 + * <p>
  25 + * Author: William Lynn
  26 + * <p>
  27 + * Create Date:2018年5月28日 下午2:24:33
  28 + *
  29 + */
  30 +@Controller
  31 +@RequestMapping(value = "/consignor")
  32 +public class ConsignorController extends BasicController {
  33 +
  34 + @Resource
  35 + private ConsignorService service;
  36 +
  37 + @RequestMapping(value = "/getall")
  38 + @ResponseBody
  39 + public ResponseModel getAll(HttpServletRequest request) {
  40 + ResponseModel model = new ResponseModel(200, "", null);
  41 + List<ConsignorEntity> dataList = service.findAllByUserId(Tools.getUserId());
  42 + if (dataList == null || dataList.size() == 0) {
  43 + model = new ResponseModel(404, "", null);
  44 + } else {
  45 + model = new ResponseModel(200, "", null);
  46 + }
  47 + model.setData(dataList);
  48 + return model;
  49 + }
  50 +}
@@ -660,7 +660,6 @@ public class DeliveryInfoController extends BasicController{ @@ -660,7 +660,6 @@ public class DeliveryInfoController extends BasicController{
660 660
661 mas.setReportedstatus(reop); 661 mas.setReportedstatus(reop);
662 662
663 -  
664 String xml = XmlUtil.convertToXml2(mas, path); 663 String xml = XmlUtil.convertToXml2(mas, path);
665 664
666 // System.out.println(xml); 665 // System.out.println(xml);
@@ -10,7 +10,6 @@ import java.util.HashMap; @@ -10,7 +10,6 @@ import java.util.HashMap;
10 import java.util.List; 10 import java.util.List;
11 import java.util.Map; 11 import java.util.Map;
12 import java.util.Set; 12 import java.util.Set;
13 -import java.util.jar.Manifest;  
14 13
15 import javax.annotation.Resource; 14 import javax.annotation.Resource;
16 import javax.servlet.http.HttpServletRequest; 15 import javax.servlet.http.HttpServletRequest;
@@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity; @@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity;
36 import com.agent.entity.agent.PreparesecondaryEntity; 35 import com.agent.entity.agent.PreparesecondaryEntity;
37 import com.agent.entity.agent.PubDgEntity; 36 import com.agent.entity.agent.PubDgEntity;
38 import com.agent.entity.agent.TBasCarrierEntity; 37 import com.agent.entity.agent.TBasCarrierEntity;
  38 +import com.agent.entity.agent.WaybillReceiptType;
39 import com.agent.entity.system.UserEntity; 39 import com.agent.entity.system.UserEntity;
40 import com.agent.imf.agent.redis.RedisSaveMessage; 40 import com.agent.imf.agent.redis.RedisSaveMessage;
41 import com.agent.service.agent.BasicAgentService; 41 import com.agent.service.agent.BasicAgentService;
  42 +import com.agent.service.agent.ConsignorService;
42 import com.agent.service.agent.ManifestBillService; 43 import com.agent.service.agent.ManifestBillService;
43 import com.agent.service.agent.ManifestCommodityService; 44 import com.agent.service.agent.ManifestCommodityService;
44 import com.agent.service.agent.ManifestContainerService; 45 import com.agent.service.agent.ManifestContainerService;
@@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService; @@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService;
47 import com.agent.service.agent.PreparesecondaryService; 48 import com.agent.service.agent.PreparesecondaryService;
48 import com.agent.service.agent.PubDgService; 49 import com.agent.service.agent.PubDgService;
49 import com.agent.service.agent.TBasCarrierService; 50 import com.agent.service.agent.TBasCarrierService;
  51 +import com.agent.service.agent.WaybillReceiptService;
50 import com.agent.service.system.RoleService; 52 import com.agent.service.system.RoleService;
51 import com.agent.util.HttpJsonMsg; 53 import com.agent.util.HttpJsonMsg;
52 import com.agent.vo.ResponseModel; 54 import com.agent.vo.ResponseModel;
53 import com.agent.vo.agent.CommodityVo; 55 import com.agent.vo.agent.CommodityVo;
54 import com.agent.xml.common.XmlHead; 56 import com.agent.xml.common.XmlHead;
55 import com.agent.xml.common.XmlUtil; 57 import com.agent.xml.common.XmlUtil;
  58 +import com.agent.xml.fhlsli.FSXmlKit;
56 import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody; 59 import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody;
57 import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml; 60 import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml;
58 import com.agent.xml.manifestdeclare.ManifestCarrierXml; 61 import com.agent.xml.manifestdeclare.ManifestCarrierXml;
@@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid; @@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid;
79 import com.plugin.easyui.EasyPage; 82 import com.plugin.easyui.EasyPage;
80 83
81 import tools.DBConnection; 84 import tools.DBConnection;
  85 +import tools.NumKit;
82 import tools.Tools; 86 import tools.Tools;
83 import tools.oclass.FemyList; 87 import tools.oclass.FemyList;
84 88
@@ -87,8 +91,7 @@ import tools.oclass.FemyList; @@ -87,8 +91,7 @@ import tools.oclass.FemyList;
87 */ 91 */
88 @Controller 92 @Controller
89 @RequestMapping(value = "/manifest") 93 @RequestMapping(value = "/manifest")
90 -public class ManifestController extends BasicController{  
91 - 94 +public class ManifestController extends BasicController {
92 private static final Logger logger = LoggerFactory.getLogger(ManifestController.class); 95 private static final Logger logger = LoggerFactory.getLogger(ManifestController.class);
93 96
94 public static boolean isSuccess = false; 97 public static boolean isSuccess = false;
@@ -123,138 +126,145 @@ public class ManifestController extends BasicController{ @@ -123,138 +126,145 @@ public class ManifestController extends BasicController{
123 @Resource 126 @Resource
124 private TBasCarrierService tbasService; 127 private TBasCarrierService tbasService;
125 128
  129 + @Resource
  130 + private ConsignorService consignorService;
  131 +
  132 + @Resource
  133 + private WaybillReceiptService receiptService;
  134 +
126 /** 135 /**
127 * 列表页面 136 * 列表页面
  137 + *
128 * @return 138 * @return
129 */ 139 */
130 @RequestMapping(value = "/list") 140 @RequestMapping(value = "/list")
131 - public String getList(Model model){ 141 + public String getList(Model model) {
132 return "manifest/list"; 142 return "manifest/list";
133 } 143 }
134 - //app端接口  
135 - //获取主单列表 144 +
  145 + // app端接口
  146 + // 获取主单列表
136 @RequestMapping(value = "/cross/grid.json") 147 @RequestMapping(value = "/cross/grid.json")
137 @ResponseBody 148 @ResponseBody
138 - public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response, EasyPage<ManifestEntity> pageForm){  
139 -// response.setCharacterEncoding("UTF-8");  
140 -// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");  
141 -// response.setHeader("Pragma", "no-cache"); 149 + public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response,
  150 + EasyPage<ManifestEntity> pageForm) {
  151 + // response.setCharacterEncoding("UTF-8");
  152 + // response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
  153 + // response.setHeader("Pragma", "no-cache");
142 response.setHeader("Access-Control-Allow-Origin", "*"); 154 response.setHeader("Access-Control-Allow-Origin", "*");
143 -// response.setDateHeader("Expires", 0); 155 + // response.setDateHeader("Expires", 0);
144 156
145 Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_"); 157 Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
146 searchParams.put("EQ_USER_ID", Tools.getUserId()); 158 searchParams.put("EQ_USER_ID", Tools.getUserId());
147 pageForm.setSearchParams(searchParams); 159 pageForm.setSearchParams(searchParams);
148 - //添加用户id的条件 160 + // 添加用户id的条件
149 pageForm.parseData(manifestService.getPage(pageForm)); 161 pageForm.parseData(manifestService.getPage(pageForm));
150 return pageForm.getData(); 162 return pageForm.getData();
151 } 163 }
  164 +
152 @RequestMapping(value = "/cross/edit") 165 @RequestMapping(value = "/cross/edit")
153 @ResponseBody 166 @ResponseBody
154 - public Map cross_edit(Long id, HttpServletResponse response){  
155 - System.out.println("id:"+id); 167 + public Map cross_edit(Long id, HttpServletResponse response) {
  168 + System.out.println("id:" + id);
156 response.setHeader("Access-Control-Allow-Origin", "*"); 169 response.setHeader("Access-Control-Allow-Origin", "*");
157 Map model = new HashMap(); 170 Map model = new HashMap();
158 ManifestEntity manifest = null; 171 ManifestEntity manifest = null;
159 - //判断是否是便捷  
160 - if(id!=null){ 172 + // 判断是否是便捷
  173 + if (id != null) {
161 manifest = manifestService.findOne(id); 174 manifest = manifestService.findOne(id);
162 } 175 }
163 176
164 UserEntity user = SessionUtil.getUser(); 177 UserEntity user = SessionUtil.getUser();
165 - if(user!=null && user.getAgent()!=null){ 178 + if (user != null && user.getAgent() != null) {
166 BasicAgentEntity agent = agentService.findOne(user.getAgent()); 179 BasicAgentEntity agent = agentService.findOne(user.getAgent());
167 - model.put("agent",agent);  
168 - if(id == null) //是新增表单 180 + model.put("agent", agent);
  181 + if (id == null) // 是新增表单
169 { 182 {
170 manifest = new ManifestEntity(); 183 manifest = new ManifestEntity();
171 manifest.setAgentcompany(agent.getNameCn()); 184 manifest.setAgentcompany(agent.getNameCn());
172 - manifest.setAgentman(null); //设置代理人名称为null 185 + manifest.setAgentman(null); // 设置代理人名称为null
173 } 186 }
174 } 187 }
175 - model.put("manifest",manifest);  
176 - //海关关区  
177 - List<String> Customs = getCustoms();  
178 - model.put("CusToms",Customs);  
179 - //付款方式 188 + model.put("manifest", manifest);
  189 + // 海关关区
  190 + List<String> Customs = getCustomsCode();
  191 + model.put("CusToms", Customs);
  192 + // 付款方式
180 List<String> payTypes = getPayTypes(); 193 List<String> payTypes = getPayTypes();
181 - model.put("payTypes",payTypes);  
182 - //海关状态 194 + model.put("payTypes", payTypes);
  195 + // 海关状态
183 List<String> customsStatus = getcustomsStatus(); 196 List<String> customsStatus = getcustomsStatus();
184 - model.put("customsStatus",customsStatus); 197 + model.put("customsStatus", customsStatus);
185 198
186 - //危险品代码 199 + // 危险品代码
187 List<PubDgEntity> dgList = dgService.findAll(); 200 List<PubDgEntity> dgList = dgService.findAll();
188 - model.put("dgList",dgList); 201 + model.put("dgList", dgList);
189 202
190 - //包装种类 203 + // 包装种类
191 List<PackageTypeEntity> typeList = packageTypeService.findAll(); 204 List<PackageTypeEntity> typeList = packageTypeService.findAll();
192 - model.put("typeList",typeList); 205 + model.put("typeList", typeList);
193 206
194 -// model.addAttribute("customsStatus",flag); 207 + // model.addAttribute("customsStatus",flag);
195 return model; 208 return model;
196 } 209 }
197 - //保存或新增  
198 - @RequestMapping(value = "/cross/save" , method = {RequestMethod.POST }) 210 +
  211 + // 保存或新增
  212 + @RequestMapping(value = "/cross/save", method = { RequestMethod.POST })
199 @ResponseBody 213 @ResponseBody
200 - public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response){ 214 + public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response) {
201 ResponseModel model = new ResponseModel(); 215 ResponseModel model = new ResponseModel();
202 response.setHeader("Access-Control-Allow-Origin", "*"); 216 response.setHeader("Access-Control-Allow-Origin", "*");
203 try { 217 try {
204 manifest.setUSER_ID(Tools.getUserId()); 218 manifest.setUSER_ID(Tools.getUserId());
205 - if(manifestService.isExistsByWaybill(manifest))  
206 - { 219 + if (manifestService.isExistsByWaybill(manifest)) {
207 model.setMsg("该订单已存在!"); 220 model.setMsg("该订单已存在!");
208 model.setStatus(500); 221 model.setStatus(500);
209 - }  
210 - else  
211 - { 222 + } else {
212 String stowagedate = reuqest.getParameter("stowagedate"); 223 String stowagedate = reuqest.getParameter("stowagedate");
213 manifest.setStowagedate(manifest.getStowagedate(stowagedate)); 224 manifest.setStowagedate(manifest.getStowagedate(stowagedate));
214 - //处理预配时间  
215 - manifest.setUSER_ID(SessionUtil.getUser().getId()); //设置用户id 225 + // 处理预配时间
  226 + manifest.setUSER_ID(SessionUtil.getUser().getId()); // 设置用户id
216 manifest = manifestService.save(manifest); 227 manifest = manifestService.save(manifest);
217 model.setData(manifest); 228 model.setData(manifest);
218 model.setStatus(200); 229 model.setStatus(200);
219 model.setMsg(HttpJsonMsg.SUCCESS); 230 model.setMsg(HttpJsonMsg.SUCCESS);
220 } 231 }
221 - }catch (Exception e){ 232 + } catch (Exception e) {
222 model.setStatus(500); 233 model.setStatus(500);
223 model.setMsg(HttpJsonMsg.ERROR); 234 model.setMsg(HttpJsonMsg.ERROR);
224 logger.error("系统异常 >>", e); 235 logger.error("系统异常 >>", e);
225 } 236 }
226 return model; 237 return model;
227 } 238 }
228 - //保存并发送主单信息  
229 - @RequestMapping(value = "/cross/savesend" , method = {RequestMethod.POST }) 239 +
  240 + // 保存并发送主单信息
  241 + @RequestMapping(value = "/cross/savesend", method = { RequestMethod.POST })
230 @ResponseBody 242 @ResponseBody
231 - public ResponseModel cross_savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){ 243 + public ResponseModel cross_savesend(ManifestEntity manifest, HttpServletRequest request,
  244 + HttpServletResponse response) {
232 ResponseModel model = new ResponseModel(); 245 ResponseModel model = new ResponseModel();
233 response.setHeader("Access-Control-Allow-Origin", "*"); 246 response.setHeader("Access-Control-Allow-Origin", "*");
234 try { 247 try {
235 manifest.setUSER_ID(Tools.getUserId()); 248 manifest.setUSER_ID(Tools.getUserId());
236 - if(manifestService.isExistsByWaybill(manifest))  
237 - { 249 + if (manifestService.isExistsByWaybill(manifest)) {
238 model.setStatus(500); 250 model.setStatus(500);
239 model.setMsg("该订单号已存在!"); 251 model.setMsg("该订单号已存在!");
240 - }  
241 - else  
242 - { 252 + } else {
243 String stowagedate = request.getParameter("stowagedate"); 253 String stowagedate = request.getParameter("stowagedate");
244 manifest.setStowagedate(manifest.getStowagedate(stowagedate)); 254 manifest.setStowagedate(manifest.getStowagedate(stowagedate));
245 - //保存 255 + // 保存
246 manifest.setIsdelete(1); 256 manifest.setIsdelete(1);
247 manifest.setResponse_text("主单已发送"); 257 manifest.setResponse_text("主单已发送");
248 manifestService.save(manifest); 258 manifestService.save(manifest);
249 System.out.println("收货人名称:" + manifest.getSh_name()); 259 System.out.println("收货人名称:" + manifest.getSh_name());
250 System.out.println("发货人名称:" + manifest.getCo_name()); 260 System.out.println("发货人名称:" + manifest.getCo_name());
251 - System.out.println("-----------------id:"+manifest.getId());  
252 - //生成报文并且发送 261 + System.out.println("-----------------id:" + manifest.getId());
  262 + // 生成报文并且发送
253 String rootPath = request.getSession().getServletContext().getRealPath("/"); 263 String rootPath = request.getSession().getServletContext().getRealPath("/");
254 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";  
255 - System.out.println(path); //path  
256 - String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);  
257 - String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path); 264 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
  265 + System.out.println(path); // path
  266 + String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
  267 + String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
258 System.out.println(ndlrxml); 268 System.out.println(ndlrxml);
259 System.err.println(dlcfxml); 269 System.err.println(dlcfxml);
260 new RedisSaveMessage().saveMessage(ndlrxml); 270 new RedisSaveMessage().saveMessage(ndlrxml);
@@ -262,129 +272,132 @@ public class ManifestController extends BasicController{ @@ -262,129 +272,132 @@ public class ManifestController extends BasicController{
262 model.setStatus(200); 272 model.setStatus(200);
263 model.setMsg(HttpJsonMsg.SUCCESS); 273 model.setMsg(HttpJsonMsg.SUCCESS);
264 } 274 }
265 - } catch (Exception e){ 275 + } catch (Exception e) {
266 model.setStatus(500); 276 model.setStatus(500);
267 model.setMsg(HttpJsonMsg.ERROR); 277 model.setMsg(HttpJsonMsg.ERROR);
268 logger.error("系统异常 >>", e); 278 logger.error("系统异常 >>", e);
269 } 279 }
270 return model; 280 return model;
271 } 281 }
272 - //分单列表获取接口  
273 - @RequestMapping(value="/cross/sub/grid.json") 282 +
  283 + // 分单列表获取接口
  284 + @RequestMapping(value = "/cross/sub/grid.json")
274 @ResponseBody 285 @ResponseBody
275 - public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId,HttpServletRequest request, HttpServletResponse response) { 286 + public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId, HttpServletRequest request,
  287 + HttpServletResponse response) {
276 response.setHeader("Access-Control-Allow-Origin", "*"); 288 response.setHeader("Access-Control-Allow-Origin", "*");
277 DataGrid<PreparesecondaryEntity> dg = new DataGrid<>(); 289 DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
278 dg.setRows(preparesecondaryServer.findByMawbId(mawbId)); 290 dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
279 return dg; 291 return dg;
280 } 292 }
281 - //获取一条分单详情的接口  
282 - @RequestMapping(value="/cross/subedit", method = {RequestMethod.POST }) 293 +
  294 + // 获取一条分单详情的接口
  295 + @RequestMapping(value = "/cross/subedit", method = { RequestMethod.POST })
283 @ResponseBody 296 @ResponseBody
284 - private Map subedit(Long id,Long mawbId, HttpServletResponse response){ 297 + private Map subedit(Long id, Long mawbId, HttpServletResponse response) {
285 Map model = new HashMap(); 298 Map model = new HashMap();
286 ManifestEntity manifest = null; 299 ManifestEntity manifest = null;
287 List<PreparesecondaryEntity> preparesecondaryList = null; 300 List<PreparesecondaryEntity> preparesecondaryList = null;
288 PreparesecondaryEntity pre = null; 301 PreparesecondaryEntity pre = null;
289 - String str = "" ; 302 + String str = "";
290 response.setHeader("Access-Control-Allow-Origin", "*"); 303 response.setHeader("Access-Control-Allow-Origin", "*");
291 - if(mawbId!=null){ 304 + if (mawbId != null) {
292 manifest = manifestService.findOne(mawbId); 305 manifest = manifestService.findOne(mawbId);
293 pre = preparesecondaryServer.findOne(mawbId); 306 pre = preparesecondaryServer.findOne(mawbId);
294 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId()); 307 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
295 - if(preparesecondaryList.isEmpty()){ 308 + if (preparesecondaryList.isEmpty()) {
296 str = calculate(manifest); 309 str = calculate(manifest);
297 - }else{  
298 - str = calculates(manifest,preparesecondaryList); 310 + } else {
  311 + str = calculates(manifest, preparesecondaryList);
299 } 312 }
300 } 313 }
301 - if(id !=null){ 314 + if (id != null) {
302 pre = preparesecondaryServer.findOne(id); 315 pre = preparesecondaryServer.findOne(id);
303 manifest = manifestService.findOne(pre.getPreparemasterid()); 316 manifest = manifestService.findOne(pre.getPreparemasterid());
304 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId()); 317 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
305 - if(preparesecondaryList.isEmpty()){ 318 + if (preparesecondaryList.isEmpty()) {
306 str = calculate(manifest); 319 str = calculate(manifest);
307 - }else{  
308 - str = calculates(manifest,preparesecondaryList); 320 + } else {
  321 + str = calculates(manifest, preparesecondaryList);
309 } 322 }
310 } 323 }
311 324
312 UserEntity user = SessionUtil.getUser(); 325 UserEntity user = SessionUtil.getUser();
313 - if(user!=null && user.getAgent()!=null){ 326 + if (user != null && user.getAgent() != null) {
314 BasicAgentEntity agent = agentService.findOne(user.getAgent()); 327 BasicAgentEntity agent = agentService.findOne(user.getAgent());
315 - model.put("agent",agent); 328 + model.put("agent", agent);
316 } 329 }
317 - //海关关区  
318 - List<String> Customs = getCustoms();  
319 - model.put("CusToms",Customs);  
320 - //付款方式 330 + // 海关关区
  331 + List<String> Customs = getCustomsCode();
  332 + model.put("CusToms", Customs);
  333 + // 付款方式
321 List<String> payTypes = getPayTypes(); 334 List<String> payTypes = getPayTypes();
322 - model.put("payTypes",payTypes);  
323 - //海关状态 335 + model.put("payTypes", payTypes);
  336 + // 海关状态
324 List<String> customsStatus = getcustomsStatus(); 337 List<String> customsStatus = getcustomsStatus();
325 - model.put("customsStatus",customsStatus); 338 + model.put("customsStatus", customsStatus);
326 339
327 - //危险品代码 340 + // 危险品代码
328 List<PubDgEntity> dgList = dgService.findAll(); 341 List<PubDgEntity> dgList = dgService.findAll();
329 - model.put("dgList",dgList); 342 + model.put("dgList", dgList);
330 343
331 - //包装种类 344 + // 包装种类
332 List<PackageTypeEntity> typeList = packageTypeService.findAll(); 345 List<PackageTypeEntity> typeList = packageTypeService.findAll();
333 - model.put("typeList",typeList); 346 + model.put("typeList", typeList);
334 347
335 - model.put("is_strs",str);  
336 - model.put("id",mawbId);  
337 - model.put("manifest",manifest);  
338 - model.put("pre",pre); 348 + model.put("is_strs", str);
  349 + model.put("id", mawbId);
  350 + model.put("manifest", manifest);
  351 + model.put("pre", pre);
339 return model; 352 return model;
340 } 353 }
341 - //保存分单  
342 - @RequestMapping(value = "/cross/sub_save" , method = {RequestMethod.POST }) 354 +
  355 + // 保存分单
  356 + @RequestMapping(value = "/cross/sub_save", method = { RequestMethod.POST })
343 @ResponseBody 357 @ResponseBody
344 - public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response){ 358 + public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response) {
345 ResponseModel model = new ResponseModel(); 359 ResponseModel model = new ResponseModel();
346 try { 360 try {
347 response.setHeader("Access-Control-Allow-Origin", "*"); 361 response.setHeader("Access-Control-Allow-Origin", "*");
348 - //已存在,提示给用户  
349 - if(preparesecondaryServer.isExists(Preparesecondary)){ 362 + // 已存在,提示给用户
  363 + if (preparesecondaryServer.isExists(Preparesecondary)) {
350 model.setStatus(500); 364 model.setStatus(500);
351 model.setMsg("该订单号已存在!"); 365 model.setMsg("该订单号已存在!");
352 - }else{ 366 + } else {
353 Preparesecondary.setCreateDate(new Date()); 367 Preparesecondary.setCreateDate(new Date());
354 Preparesecondary = preparesecondaryServer.save(Preparesecondary); 368 Preparesecondary = preparesecondaryServer.save(Preparesecondary);
355 model.setData(Preparesecondary); 369 model.setData(Preparesecondary);
356 model.setStatus(200); 370 model.setStatus(200);
357 model.setMsg(HttpJsonMsg.SUCCESS); 371 model.setMsg(HttpJsonMsg.SUCCESS);
358 } 372 }
359 - }catch (Exception e){ 373 + } catch (Exception e) {
360 model.setStatus(500); 374 model.setStatus(500);
361 model.setMsg(HttpJsonMsg.ERROR); 375 model.setMsg(HttpJsonMsg.ERROR);
362 logger.error("系统异常 >>", e); 376 logger.error("系统异常 >>", e);
363 } 377 }
364 return model; 378 return model;
365 } 379 }
366 - @RequestMapping(value = "/cross/presavesend" , method = {RequestMethod.POST }) 380 +
  381 + @RequestMapping(value = "/cross/presavesend", method = { RequestMethod.POST })
367 @ResponseBody 382 @ResponseBody
368 - public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request,  
369 - HttpServletResponse response){ 383 + public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary, HttpServletRequest request,
  384 + HttpServletResponse response) {
370 ResponseModel model = new ResponseModel(); 385 ResponseModel model = new ResponseModel();
371 try { 386 try {
372 response.setHeader("Access-Control-Allow-Origin", "*"); 387 response.setHeader("Access-Control-Allow-Origin", "*");
373 - if(preparesecondaryServer.isExists(Preparesecondary))  
374 - { 388 + if (preparesecondaryServer.isExists(Preparesecondary)) {
375 model.setStatus(500); 389 model.setStatus(500);
376 model.setMsg("该订单号已存在!"); 390 model.setMsg("该订单号已存在!");
377 - }  
378 - else{ 391 + } else {
379 String stowagedate = request.getParameter("stowagedate"); 392 String stowagedate = request.getParameter("stowagedate");
380 Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate)); 393 Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
381 394
382 - //生成报文并且发送 395 + // 生成报文并且发送
383 String rootPath = request.getSession().getServletContext().getRealPath("/"); 396 String rootPath = request.getSession().getServletContext().getRealPath("/");
384 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; 397 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
385 String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path); 398 String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
386 String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path); 399 String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
387 - //发送redis储存数据 400 + // 发送redis储存数据
388 // System.out.println(ndlrxml); 401 // System.out.println(ndlrxml);
389 new RedisSaveMessage().saveMessage(ndlrxml); 402 new RedisSaveMessage().saveMessage(ndlrxml);
390 new RedisSaveMessage().saveMessage(dlcfxml); 403 new RedisSaveMessage().saveMessage(dlcfxml);
@@ -396,7 +409,7 @@ public class ManifestController extends BasicController{ @@ -396,7 +409,7 @@ public class ManifestController extends BasicController{
396 Preparesecondary.setResponse_text("分单已发送"); 409 Preparesecondary.setResponse_text("分单已发送");
397 preparesecondaryServer.save(Preparesecondary); 410 preparesecondaryServer.save(Preparesecondary);
398 } 411 }
399 - }catch (Exception e){ 412 + } catch (Exception e) {
400 model.setStatus(500); 413 model.setStatus(500);
401 model.setMsg(HttpJsonMsg.ERROR); 414 model.setMsg(HttpJsonMsg.ERROR);
402 logger.error("系统异常 >>", e); 415 logger.error("系统异常 >>", e);
@@ -404,28 +417,21 @@ public class ManifestController extends BasicController{ @@ -404,28 +417,21 @@ public class ManifestController extends BasicController{
404 return model; 417 return model;
405 } 418 }
406 419
407 -  
408 -  
409 -  
410 -  
411 -  
412 -  
413 -  
414 -  
415 -  
416 /** 420 /**
417 * 查询分页数据 421 * 查询分页数据
  422 + *
418 * @return 423 * @return
419 */ 424 */
420 - @RequestMapping(value="/grid.json") 425 + @RequestMapping(value = "/grid.json")
421 @ResponseBody 426 @ResponseBody
422 - public DataGrid<ManifestEntity> grid(HttpServletRequest request,EasyPage<ManifestEntity> pageForm) { 427 + public DataGrid<ManifestEntity> grid(HttpServletRequest request, EasyPage<ManifestEntity> pageForm) {
423 Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_"); 428 Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
424 -// searchParams.put("EQ_isdelete", 0); 429 + // searchParams.put("EQ_isdelete", 0);
425 pageForm.setSearchParams(searchParams); 430 pageForm.setSearchParams(searchParams);
426 - //UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");  
427 - UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");  
428 - if(ue != null){ 431 + // UserEntity ue =
  432 + // (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
  433 + UserEntity ue = (UserEntity) SecurityUtils.getSubject().getSession().getAttribute("user");
  434 + if (ue != null) {
429 Long u = ue.getId(); 435 Long u = ue.getId();
430 Set<String> sk = pageForm.getSearchParams().keySet(); 436 Set<String> sk = pageForm.getSearchParams().keySet();
431 pageForm.getSearchParams().put("EQ_USER_ID", u); 437 pageForm.getSearchParams().put("EQ_USER_ID", u);
@@ -442,22 +448,20 @@ public class ManifestController extends BasicController{ @@ -442,22 +448,20 @@ public class ManifestController extends BasicController{
442 * @return 448 * @return
443 * @return 449 * @return
444 */ 450 */
445 - @RequestMapping(value = "/infor" ) 451 + @RequestMapping(value = "/infor")
446 @ResponseBody 452 @ResponseBody
447 - public List<ManifestEntity> infor(String id,Model model) { 453 + public List<ManifestEntity> infor(String id, Model model) {
448 List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId()); 454 List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId());
449 List<ManifestEntity> result = new FemyList(); 455 List<ManifestEntity> result = new FemyList();
450 - for(ManifestEntity me : li){  
451 - if(result.contains(me))  
452 - {  
453 - }  
454 - else  
455 - { 456 + for (ManifestEntity me : li) {
  457 + if (result.contains(me)) {
  458 + } else {
456 result.add(me); 459 result.add(me);
457 } 460 }
458 } 461 }
459 return result; 462 return result;
460 } 463 }
  464 +
461 /** 465 /**
462 * * 模糊查询匹配信息 466 * * 模糊查询匹配信息
463 * 467 *
@@ -465,24 +469,21 @@ public class ManifestController extends BasicController{ @@ -465,24 +469,21 @@ public class ManifestController extends BasicController{
465 * @return 469 * @return
466 * @return 470 * @return
467 */ 471 */
468 - @RequestMapping(value = "/inforPre" ) 472 + @RequestMapping(value = "/inforPre")
469 @ResponseBody 473 @ResponseBody
470 - public List<PreparesecondaryEntity> inforPre(String id,Model model) { 474 + public List<PreparesecondaryEntity> inforPre(String id, Model model) {
471 List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId()); 475 List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId());
472 List<PreparesecondaryEntity> result = new FemyList(); 476 List<PreparesecondaryEntity> result = new FemyList();
473 - for(PreparesecondaryEntity pe : li){  
474 - if(result.contains(pe)){ 477 + for (PreparesecondaryEntity pe : li) {
  478 + if (result.contains(pe)) {
475 479
476 - }  
477 - else  
478 - { 480 + } else {
479 result.add(pe); 481 result.add(pe);
480 } 482 }
481 } 483 }
482 return result; 484 return result;
483 } 485 }
484 486
485 -  
486 /** 487 /**
487 * 编辑 488 * 编辑
488 * 489 *
@@ -490,86 +491,83 @@ public class ManifestController extends BasicController{ @@ -490,86 +491,83 @@ public class ManifestController extends BasicController{
490 * @return 491 * @return
491 */ 492 */
492 @RequestMapping(value = "/edit") 493 @RequestMapping(value = "/edit")
493 - public String edit(Long id,Model model){ 494 + public String edit(Long id, Model model) {
494 ManifestEntity manifest = null; 495 ManifestEntity manifest = null;
495 - //判断是否是便捷  
496 - if(id!=null){ 496 + // 判断是否是便捷
  497 + if (id != null) {
497 manifest = manifestService.findOne(id); 498 manifest = manifestService.findOne(id);
498 } 499 }
499 500
500 UserEntity user = SessionUtil.getUser(); 501 UserEntity user = SessionUtil.getUser();
501 - if(user!=null && user.getAgent()!=null){ 502 + if (user != null && user.getAgent() != null) {
502 BasicAgentEntity agent = agentService.findOne(user.getAgent()); 503 BasicAgentEntity agent = agentService.findOne(user.getAgent());
503 - model.addAttribute("agent",agent);  
504 - if(id == null) //是新增表单 504 + model.addAttribute("agent", agent);
  505 + if (id == null) // 是新增表单
505 { 506 {
506 manifest = new ManifestEntity(); 507 manifest = new ManifestEntity();
507 manifest.setAgentcompany(agent.getNameCn()); 508 manifest.setAgentcompany(agent.getNameCn());
508 - manifest.setAgentman(null); //设置代理人名称为null 509 + manifest.setAgentman(null); // 设置代理人名称为null
509 } 510 }
510 } 511 }
511 - model.addAttribute("manifest",manifest);  
512 - //海关关区  
513 - List<String> Customs = getCustoms();  
514 - model.addAttribute("CusToms",Customs);  
515 - //付款方式 512 + model.addAttribute("manifest", manifest);
  513 + // 海关关区
  514 + List<String> Customs = getCustomsCode();
  515 + model.addAttribute("CusToms", Customs);
  516 + // 付款方式
516 List<String> payTypes = getPayTypes(); 517 List<String> payTypes = getPayTypes();
517 - model.addAttribute("payTypes",payTypes);  
518 - //海关状态 518 + model.addAttribute("payTypes", payTypes);
  519 + // 海关状态
519 List<String> customsStatus = getcustomsStatus(); 520 List<String> customsStatus = getcustomsStatus();
520 - model.addAttribute("customsStatus",customsStatus); 521 + model.addAttribute("customsStatus", customsStatus);
521 522
522 - //危险品代码 523 + // 危险品代码
523 List<PubDgEntity> dgList = dgService.findAll(); 524 List<PubDgEntity> dgList = dgService.findAll();
524 - model.addAttribute("dgList",dgList); 525 + model.addAttribute("dgList", dgList);
525 526
526 - //包装种类 527 + // 包装种类
527 List<PackageTypeEntity> typeList = packageTypeService.findAll(); 528 List<PackageTypeEntity> typeList = packageTypeService.findAll();
528 - model.addAttribute("typeList",typeList); 529 + model.addAttribute("typeList", typeList);
529 530
530 -// model.addAttribute("customsStatus",flag); 531 + // model.addAttribute("customsStatus",flag);
531 return "manifest/edit"; 532 return "manifest/edit";
532 } 533 }
533 534
534 -  
535 -  
536 /** 535 /**
537 * 查询主单号是否存在 536 * 查询主单号是否存在
538 * 537 *
539 * @param mawbNo 538 * @param mawbNo
540 * @return 539 * @return
541 */ 540 */
542 - @RequestMapping(value = "/queryMawbNo",method = {RequestMethod.POST}) 541 + @RequestMapping(value = "/queryMawbNo", method = { RequestMethod.POST })
543 @ResponseBody 542 @ResponseBody
544 - public ResponseModel queryMawbId(Long id,String mawbNo){ 543 + public ResponseModel queryMawbId(Long id, String mawbNo) {
545 ResponseModel model = new ResponseModel(); 544 ResponseModel model = new ResponseModel();
546 List<ManifestEntity> list = null; 545 List<ManifestEntity> list = null;
547 - if(StringUtils.isNotEmpty(mawbNo)){ 546 + if (StringUtils.isNotEmpty(mawbNo)) {
548 list = manifestService.findByMawbNo(mawbNo); 547 list = manifestService.findByMawbNo(mawbNo);
549 } 548 }
550 boolean exist = false; 549 boolean exist = false;
551 - if(CollectionUtils.isNotEmpty(list)){  
552 - if(list.size()>0){ 550 + if (CollectionUtils.isNotEmpty(list)) {
  551 + if (list.size() > 0) {
553 exist = true; 552 exist = true;
554 } 553 }
555 } 554 }
556 - if(exist){ 555 + if (exist) {
557 model.setStatus(500); 556 model.setStatus(500);
558 - }  
559 - else { 557 + } else {
560 model.setStatus(200); 558 model.setStatus(200);
561 } 559 }
562 return model; 560 return model;
563 } 561 }
564 562
565 -  
566 /** 563 /**
567 * 查询分制单分页数据 564 * 查询分制单分页数据
  565 + *
568 * @return 566 * @return
569 */ 567 */
570 - @RequestMapping(value="/sub/grid.json") 568 + @RequestMapping(value = "/sub/grid.json")
571 @ResponseBody 569 @ResponseBody
572 - public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId,HttpServletRequest request) { 570 + public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId, HttpServletRequest request) {
573 DataGrid<PreparesecondaryEntity> dg = new DataGrid<>(); 571 DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
574 dg.setRows(preparesecondaryServer.findByMawbId(mawbId)); 572 dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
575 return dg; 573 return dg;
@@ -581,65 +579,64 @@ public class ManifestController extends BasicController{ @@ -581,65 +579,64 @@ public class ManifestController extends BasicController{
581 * @param id 579 * @param id
582 * @return 580 * @return
583 */ 581 */
584 - @RequestMapping(value = "/subedit", method = {RequestMethod.GET })  
585 - private String subedit(Long id,Long mawbId,String type, Model model){ 582 + @RequestMapping(value = "/subedit", method = { RequestMethod.GET })
  583 + private String subedit(Long id, Long mawbId, String type, Model model) {
586 ManifestEntity manifest = null; 584 ManifestEntity manifest = null;
587 List<PreparesecondaryEntity> preparesecondaryList = null; 585 List<PreparesecondaryEntity> preparesecondaryList = null;
588 PreparesecondaryEntity pre = null; 586 PreparesecondaryEntity pre = null;
589 - String str = "" ;  
590 - if(mawbId!=null ){ 587 + String str = "";
  588 + if (mawbId != null) {
591 manifest = manifestService.findOne(mawbId); 589 manifest = manifestService.findOne(mawbId);
592 pre = preparesecondaryServer.findOne(mawbId); 590 pre = preparesecondaryServer.findOne(mawbId);
593 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId()); 591 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
594 - if(preparesecondaryList.isEmpty()){ 592 + if (preparesecondaryList.isEmpty()) {
595 str = calculate(manifest); 593 str = calculate(manifest);
596 - }else{  
597 - str = calculates(manifest,preparesecondaryList); 594 + } else {
  595 + str = calculates(manifest, preparesecondaryList);
598 } 596 }
599 } 597 }
600 - if(id !=null){ 598 + if (id != null) {
601 pre = preparesecondaryServer.findOne(id); 599 pre = preparesecondaryServer.findOne(id);
602 manifest = manifestService.findOne(pre.getPreparemasterid()); 600 manifest = manifestService.findOne(pre.getPreparemasterid());
603 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId()); 601 preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
604 - if(preparesecondaryList.isEmpty()){ 602 + if (preparesecondaryList.isEmpty()) {
605 str = calculate(manifest); 603 str = calculate(manifest);
606 - }else{  
607 - str = calculates(manifest,preparesecondaryList); 604 + } else {
  605 + str = calculates(manifest, preparesecondaryList);
608 } 606 }
609 } 607 }
610 608
611 UserEntity user = SessionUtil.getUser(); 609 UserEntity user = SessionUtil.getUser();
612 - if(user!=null && user.getAgent()!=null){ 610 + if (user != null && user.getAgent() != null) {
613 BasicAgentEntity agent = agentService.findOne(user.getAgent()); 611 BasicAgentEntity agent = agentService.findOne(user.getAgent());
614 - model.addAttribute("agent",agent); 612 + model.addAttribute("agent", agent);
615 } 613 }
616 - //海关关区  
617 - List<String> Customs = getCustoms();  
618 - model.addAttribute("CusToms",Customs);  
619 - //付款方式 614 + // 海关关区
  615 + List<String> Customs = getCustomsCode();
  616 + model.addAttribute("CusToms", Customs);
  617 + // 付款方式
620 List<String> payTypes = getPayTypes(); 618 List<String> payTypes = getPayTypes();
621 - model.addAttribute("payTypes",payTypes);  
622 - //海关状态 619 + model.addAttribute("payTypes", payTypes);
  620 + // 海关状态
623 List<String> customsStatus = getcustomsStatus(); 621 List<String> customsStatus = getcustomsStatus();
624 - model.addAttribute("customsStatus",customsStatus); 622 + model.addAttribute("customsStatus", customsStatus);
625 623
626 - //危险品代码 624 + // 危险品代码
627 List<PubDgEntity> dgList = dgService.findAll(); 625 List<PubDgEntity> dgList = dgService.findAll();
628 - model.addAttribute("dgList",dgList); 626 + model.addAttribute("dgList", dgList);
629 627
630 - //包装种类 628 + // 包装种类
631 List<PackageTypeEntity> typeList = packageTypeService.findAll(); 629 List<PackageTypeEntity> typeList = packageTypeService.findAll();
632 - model.addAttribute("typeList",typeList); 630 + model.addAttribute("typeList", typeList);
633 631
634 - model.addAttribute("is_strs",str);  
635 - model.addAttribute("id",mawbId);  
636 - model.addAttribute("manifest",manifest);  
637 - model.addAttribute("pre",pre); 632 + model.addAttribute("is_strs", str);
  633 + model.addAttribute("id", mawbId);
  634 + model.addAttribute("manifest", manifest);
  635 + model.addAttribute("pre", pre);
638 return "manifest/sub_edit"; 636 return "manifest/sub_edit";
639 } 637 }
640 638
641 -  
642 - //计算 运单件数 运单重量 预配件数 预配重量 639 + // 计算 运单件数 运单重量 预配件数 预配重量
643 private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) { 640 private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) {
644 int pp = 0; 641 int pp = 0;
645 int tw = 0; 642 int tw = 0;
@@ -647,54 +644,45 @@ public class ManifestController extends BasicController{ @@ -647,54 +644,45 @@ public class ManifestController extends BasicController{
647 int pw = 0; 644 int pw = 0;
648 645
649 for (PreparesecondaryEntity pre : preparesecondaryList) { 646 for (PreparesecondaryEntity pre : preparesecondaryList) {
650 - pp += Integer.parseInt(pre.getPreparepiece()) ;  
651 - tw += Integer.parseInt(pre.getTotalweight()) ;  
652 - tp += Integer.parseInt(pre.getTotalpiece()) ;  
653 - pw += Integer.parseInt(pre.getPrepareweight()) ;  
654 - }  
655 -  
656 - int zpp =Integer.parseInt(manifest.getPreparetotalpiece())-pp;  
657 - int ztw =Integer.parseInt(manifest.getTotalweight())-tw;  
658 - int ztp =Integer.parseInt(manifest.getTotalpiece())-tp;  
659 - int zpw =Integer.parseInt(manifest.getPreparetotalweight())-pw;  
660 -  
661 - String str ="{";  
662 - str +="\"id\":\""+manifest.getId()+"\",";  
663 - str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";  
664 - str +="\"totalpiece\":\""+ztp+"\",";  
665 - str +="\"totalweight\":\""+ztw+"\",";  
666 - str +="\"preparetotalpiece\":\""+zpp+"\",";  
667 - str +="\"preparetotalweight\":\""+zpw+"\"";  
668 - str +="}"; 647 + pp += Integer.parseInt(pre.getPreparepiece());
  648 + tw += Integer.parseInt(pre.getTotalweight());
  649 + tp += Integer.parseInt(pre.getTotalpiece());
  650 + pw += Integer.parseInt(pre.getPrepareweight());
  651 + }
  652 +
  653 + int zpp = Integer.parseInt(manifest.getPreparetotalpiece()) - pp;
  654 + int ztw = Integer.parseInt(manifest.getTotalweight()) - tw;
  655 + int ztp = Integer.parseInt(manifest.getTotalpiece()) - tp;
  656 + int zpw = Integer.parseInt(manifest.getPreparetotalweight()) - pw;
  657 +
  658 + String str = "{";
  659 + str += "\"id\":\"" + manifest.getId() + "\",";
  660 + str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
  661 + str += "\"totalpiece\":\"" + ztp + "\",";
  662 + str += "\"totalweight\":\"" + ztw + "\",";
  663 + str += "\"preparetotalpiece\":\"" + zpp + "\",";
  664 + str += "\"preparetotalweight\":\"" + zpw + "\"";
  665 + str += "}";
669 return str; 666 return str;
670 } 667 }
671 668
672 - //计算 运单件数 运单重量 预配件数 预配重量 669 + // 计算 运单件数 运单重量 预配件数 预配重量
673 private String calculate(ManifestEntity manifest) { 670 private String calculate(ManifestEntity manifest) {
674 - String str ="{";  
675 - str +="\"id\":\""+manifest.getId()+"\",";  
676 - str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";  
677 - str +="\"totalpiece\":\""+manifest.getTotalpiece()+"\",";  
678 - str +="\"totalweight\":\""+manifest.getTotalweight()+"\",";  
679 - str +="\"preparetotalpiece\":\""+manifest.getPreparetotalpiece()+"\",";  
680 - str +="\"preparetotalweight\":\""+manifest.getPreparetotalweight()+"\"";  
681 - str +="}"; 671 + String str = "{";
  672 + str += "\"id\":\"" + manifest.getId() + "\",";
  673 + str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
  674 + str += "\"totalpiece\":\"" + manifest.getTotalpiece() + "\",";
  675 + str += "\"totalweight\":\"" + manifest.getTotalweight() + "\",";
  676 + str += "\"preparetotalpiece\":\"" + manifest.getPreparetotalpiece() + "\",";
  677 + str += "\"preparetotalweight\":\"" + manifest.getPreparetotalweight() + "\"";
  678 + str += "}";
682 return str; 679 return str;
683 } 680 }
684 681
685 -  
686 - //海关状态 682 + // 海关状态
687 private List<String> getcustomsStatus() { 683 private List<String> getcustomsStatus() {
688 List<String> list = new ArrayList<>(); 684 List<String> list = new ArrayList<>();
689 - list.add("4604");  
690 - list.add("4620");  
691 - return list;  
692 - }  
693 -  
694 - //海关关区  
695 - private List<String> getCustoms() {  
696 - List<String> list = new ArrayList<>();  
697 - //国际转运 685 + // 国际转运
698 list.add("001");// 进、出口货物 686 list.add("001");// 进、出口货物
699 list.add("002");// 国际转运货物 687 list.add("002");// 国际转运货物
700 list.add("003");// 国境货物 688 list.add("003");// 国境货物
@@ -702,10 +690,18 @@ public class ManifestController extends BasicController{ @@ -702,10 +690,18 @@ public class ManifestController extends BasicController{
702 return list; 690 return list;
703 } 691 }
704 692
705 - //支付方式 693 + // 海关关区
  694 + private List<String> getCustomsCode() {
  695 + List<String> list = new ArrayList<>();
  696 + list.add("4604");
  697 + list.add("4620");
  698 + return list;
  699 + }
  700 +
  701 + // 支付方式
706 private List<String> getPayTypes() { 702 private List<String> getPayTypes() {
707 List<String> list = new ArrayList<>(); 703 List<String> list = new ArrayList<>();
708 - //预付 704 + // 预付
709 list.add("001");// 预付 705 list.add("001");// 预付
710 list.add("002");// 到付 706 list.add("002");// 到付
711 return list; 707 return list;
@@ -717,64 +713,63 @@ public class ManifestController extends BasicController{ @@ -717,64 +713,63 @@ public class ManifestController extends BasicController{
717 * @param id 713 * @param id
718 * @return 714 * @return
719 */ 715 */
720 -// @RequestMapping(value = "/bill/edit")  
721 -// public String editBill(Long id,Long manifestId,Model model){  
722 -// ManifestBillEntity bill = null;  
723 -// if(id==null){  
724 -// bill = new ManifestBillEntity();  
725 -// bill.setManifestId(manifestId);  
726 -// }else {  
727 -// bill = billService.findOne(id);  
728 -// }  
729 -// //包装种类  
730 -// List<PackageTypeEntity> typeList = packageTypeService.findAll();  
731 -// model.addAttribute("typeList",typeList);  
732 -// model.addAttribute("bill",bill);  
733 -// return "manifest/edit_bill";  
734 -// }  
735 -  
736 - //查询主单号是否已经存在 716 + // @RequestMapping(value = "/bill/edit")
  717 + // public String editBill(Long id,Long manifestId,Model model){
  718 + // ManifestBillEntity bill = null;
  719 + // if(id==null){
  720 + // bill = new ManifestBillEntity();
  721 + // bill.setManifestId(manifestId);
  722 + // }else {
  723 + // bill = billService.findOne(id);
  724 + // }
  725 + // //包装种类
  726 + // List<PackageTypeEntity> typeList = packageTypeService.findAll();
  727 + // model.addAttribute("typeList",typeList);
  728 + // model.addAttribute("bill",bill);
  729 + // return "manifest/edit_bill";
  730 + // }
  731 +
  732 + // 查询主单号是否已经存在
737 @RequestMapping(value = "existsManifestNo") 733 @RequestMapping(value = "existsManifestNo")
738 @ResponseBody 734 @ResponseBody
739 - public ResponseModel editBill(String waybill){ 735 + public ResponseModel editBill(String waybill) {
740 ResponseModel model = new ResponseModel(200, null, null); 736 ResponseModel model = new ResponseModel(200, null, null);
741 List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill); 737 List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill);
742 - if(manifestList.size() > 0)  
743 - { 738 + if (manifestList.size() > 0) {
744 model.setData("该注单号已经存在了!"); 739 model.setData("该注单号已经存在了!");
745 model.setStatus(0); 740 model.setStatus(0);
746 } 741 }
747 return model; 742 return model;
748 } 743 }
  744 +
749 /** 745 /**
750 * 保存 746 * 保存
751 * 747 *
752 * @param manifest 748 * @param manifest
753 * @return 749 * @return
754 */ 750 */
755 - @RequestMapping(value = "/save" , method = {RequestMethod.POST }) 751 + @RequestMapping(value = "/save", method = { RequestMethod.POST })
756 @ResponseBody 752 @ResponseBody
757 - public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest){ 753 + public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest) {
  754 + consignorService.saveFromManifest(manifest);
  755 +
758 ResponseModel model = new ResponseModel(); 756 ResponseModel model = new ResponseModel();
759 try { 757 try {
760 manifest.setUSER_ID(Tools.getUserId()); 758 manifest.setUSER_ID(Tools.getUserId());
761 - if(manifestService.isExistsByWaybill(manifest))  
762 - { 759 + if (manifestService.isExistsByWaybill(manifest)) {
763 model.setMsg("该订单已存在!"); 760 model.setMsg("该订单已存在!");
764 model.setStatus(500); 761 model.setStatus(500);
765 - }  
766 - else  
767 - { 762 + } else {
768 String stowagedate = reuqest.getParameter("stowagedate"); 763 String stowagedate = reuqest.getParameter("stowagedate");
769 manifest.setStowagedate(manifest.getStowagedate(stowagedate)); 764 manifest.setStowagedate(manifest.getStowagedate(stowagedate));
770 manifest.setSave_time(new Long(System.currentTimeMillis())); 765 manifest.setSave_time(new Long(System.currentTimeMillis()));
771 - //处理预配时间 766 + // 处理预配时间
772 manifest = manifestService.save(manifest); 767 manifest = manifestService.save(manifest);
773 model.setData(manifest); 768 model.setData(manifest);
774 model.setStatus(200); 769 model.setStatus(200);
775 model.setMsg(HttpJsonMsg.SUCCESS); 770 model.setMsg(HttpJsonMsg.SUCCESS);
776 } 771 }
777 - }catch (Exception e){ 772 + } catch (Exception e) {
778 model.setStatus(500); 773 model.setStatus(500);
779 model.setMsg(HttpJsonMsg.ERROR); 774 model.setMsg(HttpJsonMsg.ERROR);
780 logger.error("系统异常 >>", e); 775 logger.error("系统异常 >>", e);
@@ -782,136 +777,155 @@ public class ManifestController extends BasicController{ @@ -782,136 +777,155 @@ public class ManifestController extends BasicController{
782 return model; 777 return model;
783 } 778 }
784 779
785 - //撤销主单 780 + // 撤销主单
786 @RequestMapping(value = "/backout") 781 @RequestMapping(value = "/backout")
787 @ResponseBody 782 @ResponseBody
788 - public ResponseModel backout(HttpServletRequest request, Long id){ 783 + public ResponseModel backout(HttpServletRequest request, Long id) {
789 ResponseModel model = new ResponseModel(1, null, ""); 784 ResponseModel model = new ResponseModel(1, null, "");
790 ManifestEntity manifest = null; 785 ManifestEntity manifest = null;
791 - try{  
792 - if(id != null)  
793 - { 786 + try {
  787 + if (id != null) {
  788 + WaybillReceiptType type = WaybillReceiptType.DELETE;
  789 +
794 manifest = manifestService.findOne((id)); 790 manifest = manifestService.findOne((id));
795 String rootPath = request.getSession().getServletContext().getRealPath("/"); 791 String rootPath = request.getSession().getServletContext().getRealPath("/");
796 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; //获取生成报文路径  
797 - String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); //转换报文 792 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml"; // 获取生成报文路径
  793 + String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); // 转换报文
798 System.out.println(path); 794 System.out.println(path);
799 System.out.println(ndlxml); 795 System.out.println(ndlxml);
800 - new RedisSaveMessage().saveMessage(ndlxml); //发送 796 + new RedisSaveMessage().saveMessage(ndlxml); // 发送
801 model.setStatus(200); 797 model.setStatus(200);
802 798
803 - manifest.setResponse_text("撤销请求已发送"); 799 + manifest.setResponse_text("主单——" + type.getName());
  800 + manifest.setResponse_code(String.valueOf(type.getValue()));
804 manifestService.save(manifest); 801 manifestService.save(manifest);
805 - 802 + receiptService.saveFromManifest(manifest, type);
806 } 803 }
807 - }catch(Exception e){ 804 + } catch (Exception e) {
808 model.setStatus(10060); 805 model.setStatus(10060);
809 model.setMsg("连接超时!"); 806 model.setMsg("连接超时!");
810 } 807 }
811 return model; 808 return model;
812 } 809 }
  810 +
813 /* 811 /*
814 * 撤销分单 812 * 撤销分单
815 */ 813 */
816 @RequestMapping(value = "housebillbackout") 814 @RequestMapping(value = "housebillbackout")
817 @ResponseBody 815 @ResponseBody
818 - public ResponseModel housebillbackout(HttpServletRequest request, Long id){ 816 + public ResponseModel housebillbackout(HttpServletRequest request, Long id) {
819 ResponseModel model = new ResponseModel(1, null, ""); 817 ResponseModel model = new ResponseModel(1, null, "");
820 -  
821 return model; 818 return model;
822 } 819 }
823 820
824 - @RequestMapping(value = "app/send", method = {RequestMethod.POST}) 821 + @RequestMapping(value = "app/send", method = { RequestMethod.POST })
825 @ResponseBody 822 @ResponseBody
826 - public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response){ 823 + public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
827 ResponseModel model = new ResponseModel(200, null, "主单发送成功!"); 824 ResponseModel model = new ResponseModel(200, null, "主单发送成功!");
828 825
829 -  
830 return model; 826 return model;
831 } 827 }
  828 +
832 /** 829 /**
833 - * 保存并且发送 830 + * 主单提交表单保存并且发送报文
834 * 831 *
835 * @param manifest 832 * @param manifest
836 * @return 833 * @return
837 */ 834 */
838 - @RequestMapping(value = "/savesend" , method = {RequestMethod.POST }) 835 + @RequestMapping(value = "/savesend", method = { RequestMethod.POST })
839 @ResponseBody 836 @ResponseBody
840 - public ResponseModel savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){ 837 + public ResponseModel savesend(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
  838 + consignorService.saveFromManifest(manifest);
  839 +
841 ResponseModel model = new ResponseModel(); 840 ResponseModel model = new ResponseModel();
842 try { 841 try {
843 manifest.setUSER_ID(Tools.getUserId()); 842 manifest.setUSER_ID(Tools.getUserId());
844 - if(manifestService.isExistsByWaybill(manifest))  
845 - { 843 + if (manifestService.isExistsByWaybill(manifest)) {
846 model.setStatus(500); 844 model.setStatus(500);
847 model.setMsg("该订单号已存在!"); 845 model.setMsg("该订单号已存在!");
848 - }  
849 - else  
850 - {  
851 - String stowagedate = request.getParameter("stowagedate"); 846 + } else {
  847 + String responseCode = manifest.getResponse_code();
  848 + int resCode = NumKit.parseString2Int(responseCode);
  849 + WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
  850 + WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
852 851
  852 + String stowagedate = request.getParameter("stowagedate");
853 manifest.setStowagedate(manifest.getStowagedate(stowagedate)); 853 manifest.setStowagedate(manifest.getStowagedate(stowagedate));
854 -  
855 - //保存 854 + // 保存
856 manifest.setIsdelete(1); 855 manifest.setIsdelete(1);
857 - manifest.setResponse_text("主单已发送"); 856 + manifest.setResponse_code(String.valueOf(type.getValue()));
  857 + manifest.setResponse_text("主单——" + type.getName());
858 manifest.setSave_time(System.currentTimeMillis()); 858 manifest.setSave_time(System.currentTimeMillis());
859 manifestService.save(manifest); 859 manifestService.save(manifest);
  860 + receiptService.saveFromManifest(manifest, type);
  861 +
860 System.out.println("收货人名称:" + manifest.getSh_name()); 862 System.out.println("收货人名称:" + manifest.getSh_name());
861 System.out.println("发货人名称:" + manifest.getCo_name()); 863 System.out.println("发货人名称:" + manifest.getCo_name());
862 - System.out.println("-----------------id:"+manifest.getId());  
863 - //生成报文并且发送 864 + System.out.println("-----------------id:" + manifest.getId());
  865 + // 生成报文并且发送
864 String rootPath = request.getSession().getServletContext().getRealPath("/"); 866 String rootPath = request.getSession().getServletContext().getRealPath("/");
865 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";  
866 - System.out.println(path); //path  
867 - String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);  
868 - String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path); 867 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
  868 + String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
  869 + String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
  870 + String slifxml = XmlUtil.convertToXml(FSXmlKit.sliXml(manifest));
  871 + System.out.println("===================ndlrxml===================");
869 System.out.println(ndlrxml); 872 System.out.println(ndlrxml);
  873 + System.out.println();
  874 +
  875 + System.out.println("===================dlcfxml===================");
870 System.err.println(dlcfxml); 876 System.err.println(dlcfxml);
  877 + System.out.println();
  878 +
  879 + System.out.println("===================slifxml===================");
  880 + System.err.println(slifxml);
  881 + System.out.println();
  882 +
871 new RedisSaveMessage().saveMessage(ndlrxml); 883 new RedisSaveMessage().saveMessage(ndlrxml);
872 new RedisSaveMessage().saveMessage(dlcfxml); 884 new RedisSaveMessage().saveMessage(dlcfxml);
  885 + new RedisSaveMessage().saveMessage(slifxml);
873 model.setStatus(200); 886 model.setStatus(200);
874 model.setMsg(HttpJsonMsg.SUCCESS); 887 model.setMsg(HttpJsonMsg.SUCCESS);
875 } 888 }
876 - }catch (Exception e){ 889 + } catch (Exception e) {
877 model.setStatus(500); 890 model.setStatus(500);
878 model.setMsg(HttpJsonMsg.ERROR); 891 model.setMsg(HttpJsonMsg.ERROR);
879 logger.error("系统异常 >>", e); 892 logger.error("系统异常 >>", e);
880 } 893 }
881 return model; 894 return model;
882 } 895 }
  896 +
883 /** 897 /**
884 * 发送交运报并且保存 898 * 发送交运报并且保存
885 * 899 *
886 * @param manifest 900 * @param manifest
887 * @return 901 * @return
888 */ 902 */
889 - @RequestMapping(value = "/sendDelivery" , method = {RequestMethod.POST }) 903 + @RequestMapping(value = "/sendDelivery", method = { RequestMethod.POST })
890 @ResponseBody 904 @ResponseBody
891 - public ResponseModel sendDelivery(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){ 905 + public ResponseModel sendDelivery(ManifestEntity manifest, HttpServletRequest request,
  906 + HttpServletResponse response) {
892 ResponseModel model = new ResponseModel(); 907 ResponseModel model = new ResponseModel();
893 try { 908 try {
894 manifest.setUSER_ID(Tools.getUserId()); 909 manifest.setUSER_ID(Tools.getUserId());
895 - if(manifestService.isExistsByWaybill(manifest)){ 910 + if (manifestService.isExistsByWaybill(manifest)) {
896 model.setStatus(500); 911 model.setStatus(500);
897 model.setMsg("订单已存在!"); 912 model.setMsg("订单已存在!");
898 - }  
899 - else{  
900 - //保存 913 + } else {
  914 + // 保存
901 manifest.setDe_ids(1); 915 manifest.setDe_ids(1);
902 String stowagedate = request.getParameter("stowagedate"); 916 String stowagedate = request.getParameter("stowagedate");
903 manifest.setStowagedate(manifest.getStowagedate(stowagedate)); 917 manifest.setStowagedate(manifest.getStowagedate(stowagedate));
904 manifest = manifestService.save(manifest); 918 manifest = manifestService.save(manifest);
905 - //生成报文并且发送 919 + // 生成报文并且发送
906 String rootPath = request.getSession().getServletContext().getRealPath("/"); 920 String rootPath = request.getSession().getServletContext().getRealPath("/");
907 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; 921 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
908 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path); 922 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path);
909 // System.out.println(dlcfxml); 923 // System.out.println(dlcfxml);
910 new RedisSaveMessage().saveMessage(dlcfxml); 924 new RedisSaveMessage().saveMessage(dlcfxml);
911 model.setStatus(200); 925 model.setStatus(200);
912 model.setMsg(HttpJsonMsg.SUCCESS); 926 model.setMsg(HttpJsonMsg.SUCCESS);
913 } 927 }
914 - }catch (Exception e){ 928 + } catch (Exception e) {
915 model.setStatus(500); 929 model.setStatus(500);
916 model.setMsg(HttpJsonMsg.ERROR); 930 model.setMsg(HttpJsonMsg.ERROR);
917 logger.error("系统异常 >>", e); 931 logger.error("系统异常 >>", e);
@@ -925,9 +939,9 @@ public class ManifestController extends BasicController{ @@ -925,9 +939,9 @@ public class ManifestController extends BasicController{
925 * @param manifest 939 * @param manifest
926 * @return 940 * @return
927 */ 941 */
928 - @RequestMapping(value = "/saveis_delete" , method = {RequestMethod.POST }) 942 + @RequestMapping(value = "/saveis_delete", method = { RequestMethod.POST })
929 @ResponseBody 943 @ResponseBody
930 - public ResponseModel saveis_delete(ManifestEntity manifest){ 944 + public ResponseModel saveis_delete(ManifestEntity manifest) {
931 ResponseModel model = new ResponseModel(); 945 ResponseModel model = new ResponseModel();
932 try { 946 try {
933 manifest.setIsdelete(1); 947 manifest.setIsdelete(1);
@@ -935,7 +949,7 @@ public class ManifestController extends BasicController{ @@ -935,7 +949,7 @@ public class ManifestController extends BasicController{
935 model.setData(manifest); 949 model.setData(manifest);
936 model.setStatus(200); 950 model.setStatus(200);
937 model.setMsg(HttpJsonMsg.SUCCESS); 951 model.setMsg(HttpJsonMsg.SUCCESS);
938 - }catch (Exception e){ 952 + } catch (Exception e) {
939 model.setStatus(500); 953 model.setStatus(500);
940 model.setMsg(HttpJsonMsg.ERROR); 954 model.setMsg(HttpJsonMsg.ERROR);
941 logger.error("系统异常 >>", e); 955 logger.error("系统异常 >>", e);
@@ -949,23 +963,25 @@ public class ManifestController extends BasicController{ @@ -949,23 +963,25 @@ public class ManifestController extends BasicController{
949 * @param manifest 963 * @param manifest
950 * @return 964 * @return
951 */ 965 */
952 - @RequestMapping(value = "/sub_save" , method = {RequestMethod.POST }) 966 + @RequestMapping(value = "/sub_save", method = { RequestMethod.POST })
953 @ResponseBody 967 @ResponseBody
954 - public ResponseModel sub_save(PreparesecondaryEntity Preparesecondary){ 968 + public ResponseModel sub_save(PreparesecondaryEntity preparesecondary) {
  969 + consignorService.saveFromPreparesecondary(preparesecondary);
  970 +
955 ResponseModel model = new ResponseModel(); 971 ResponseModel model = new ResponseModel();
956 try { 972 try {
957 - //已存在,提示给用户  
958 - if(preparesecondaryServer.isExists(Preparesecondary)){ 973 + // 已存在,提示给用户
  974 + if (preparesecondaryServer.isExists(preparesecondary)) {
959 model.setStatus(500); 975 model.setStatus(500);
960 model.setMsg("该订单号已存在!"); 976 model.setMsg("该订单号已存在!");
961 - }else{  
962 - Preparesecondary.setCreateDate(new Date());  
963 - Preparesecondary = preparesecondaryServer.save(Preparesecondary);  
964 - model.setData(Preparesecondary); 977 + } else {
  978 + preparesecondary.setCreateDate(new Date());
  979 + preparesecondary = preparesecondaryServer.save(preparesecondary);
  980 + model.setData(preparesecondary);
965 model.setStatus(200); 981 model.setStatus(200);
966 model.setMsg(HttpJsonMsg.SUCCESS); 982 model.setMsg(HttpJsonMsg.SUCCESS);
967 } 983 }
968 - }catch (Exception e){ 984 + } catch (Exception e) {
969 model.setStatus(500); 985 model.setStatus(500);
970 model.setMsg(HttpJsonMsg.ERROR); 986 model.setMsg(HttpJsonMsg.ERROR);
971 logger.error("系统异常 >>", e); 987 logger.error("系统异常 >>", e);
@@ -973,28 +989,34 @@ public class ManifestController extends BasicController{ @@ -973,28 +989,34 @@ public class ManifestController extends BasicController{
973 return model; 989 return model;
974 } 990 }
975 991
976 - //撤销分单 992 + // 撤销分单
977 @RequestMapping(value = "prebackout") 993 @RequestMapping(value = "prebackout")
978 @ResponseBody 994 @ResponseBody
979 - public ResponseModel prebackout(HttpServletRequest request, Long id){ 995 + public ResponseModel prebackout(HttpServletRequest request, Long id) {
980 ResponseModel model = new ResponseModel(200, null, ""); 996 ResponseModel model = new ResponseModel(200, null, "");
981 - if(id != null)  
982 - {  
983 - System.out.println("id:"+id); 997 + if (id != null) {
  998 + System.out.println("id:" + id);
984 PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id); 999 PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
985 - if(preparesecondary != null)  
986 - {  
987 - try{ 1000 + if (preparesecondary != null) {
  1001 + try {
  1002 + WaybillReceiptType type = WaybillReceiptType.DELETE;
  1003 +
988 String rootPath = request.getSession().getServletContext().getRealPath("/"); 1004 String rootPath = request.getSession().getServletContext().getRealPath("/");
989 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";  
990 - String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary), path);  
991 - //String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path); 1005 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
  1006 + String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),
  1007 + path);
  1008 + // String dlcfxml =
  1009 + // XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary),
  1010 + // path);
992 1011
993 - //System.out.println(ndlrxml); 1012 + // System.out.println(ndlrxml);
994 new RedisSaveMessage().saveMessage(ndlrxml); 1013 new RedisSaveMessage().saveMessage(ndlrxml);
995 - preparesecondary.setResponse_text("撤销请求已发送"); 1014 + preparesecondary.setResponse_text("分单——" + type.getName());
  1015 + preparesecondary.setResponse_code(String.valueOf(type.getValue()));
996 preparesecondaryServer.save(preparesecondary); 1016 preparesecondaryServer.save(preparesecondary);
997 - }catch(Exception e){ 1017 +
  1018 + receiptService.saveFromPreparesecondary(preparesecondary, type);
  1019 + } catch (Exception e) {
998 model.setStatus(500); 1020 model.setStatus(500);
999 model.setMsg(HttpJsonMsg.ERROR); 1021 model.setMsg(HttpJsonMsg.ERROR);
1000 } 1022 }
@@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{ @@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{
1002 } 1024 }
1003 return model; 1025 return model;
1004 } 1026 }
  1027 +
1005 /** 1028 /**
1006 - * 保存并且发送 1029 + * 子单提交表单保存并且发送报文
1007 * 1030 *
1008 * @param manifest 1031 * @param manifest
1009 * @return 1032 * @return
1010 */ 1033 */
1011 - @RequestMapping(value = "/presavesend" , method = {RequestMethod.POST }) 1034 + @RequestMapping(value = "/presavesend", method = { RequestMethod.POST })
1012 @ResponseBody 1035 @ResponseBody
1013 - public ResponseModel presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){ 1036 + public ResponseModel presavesend(PreparesecondaryEntity preparesecondary, HttpServletRequest request) {
  1037 + consignorService.saveFromPreparesecondary(preparesecondary);
  1038 +
1014 ResponseModel model = new ResponseModel(); 1039 ResponseModel model = new ResponseModel();
1015 try { 1040 try {
1016 - if(preparesecondaryServer.isExists(Preparesecondary))  
1017 - { 1041 + if (preparesecondaryServer.isExists(preparesecondary)) {
1018 model.setStatus(500); 1042 model.setStatus(500);
1019 model.setMsg("该订单号已存在!"); 1043 model.setMsg("该订单号已存在!");
1020 - }  
1021 - else{ 1044 + } else {
  1045 + String responseCode = preparesecondary.getResponse_code();
  1046 + int resCode = NumKit.parseString2Int(responseCode);
  1047 + WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
  1048 + WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
1022 1049
1023 String stowagedate = request.getParameter("stowagedate"); 1050 String stowagedate = request.getParameter("stowagedate");
1024 - Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));  
1025 - //生成报文并且发送 1051 + preparesecondary.setStowagedate(preparesecondary.getStowagedate(stowagedate));
  1052 + // 生成报文并且发送
1026 String rootPath = request.getSession().getServletContext().getRealPath("/"); 1053 String rootPath = request.getSession().getServletContext().getRealPath("/");
1027 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";  
1028 - String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);  
1029 - String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);  
1030 - //发送redis储存数据 1054 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
  1055 + String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), path);
  1056 + String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
  1057 + String fhlfxml = XmlUtil.convertToXml(FSXmlKit.fhlXml(preparesecondary));
  1058 + // 发送redis储存数据
1031 // System.out.println(ndlrxml); 1059 // System.out.println(ndlrxml);
1032 new RedisSaveMessage().saveMessage(ndlrxml); 1060 new RedisSaveMessage().saveMessage(ndlrxml);
1033 new RedisSaveMessage().saveMessage(dlcfxml); 1061 new RedisSaveMessage().saveMessage(dlcfxml);
1034 - model.setData(Preparesecondary); 1062 + new RedisSaveMessage().saveMessage(fhlfxml);
  1063 +
  1064 + model.setData(preparesecondary);
1035 model.setStatus(200); 1065 model.setStatus(200);
1036 model.setMsg(HttpJsonMsg.SUCCESS); 1066 model.setMsg(HttpJsonMsg.SUCCESS);
  1067 +
  1068 + System.out.println("===================ndlrxml===================");
1037 System.out.println(ndlrxml); 1069 System.out.println(ndlrxml);
1038 - System.out.println(dlcfxml); 1070 + System.out.println();
  1071 +
  1072 + System.out.println("===================dlcfxml===================");
  1073 + System.err.println(dlcfxml);
  1074 + System.out.println();
  1075 +
  1076 + System.out.println("===================fhlfxml===================");
  1077 + System.err.println(fhlfxml);
  1078 + System.out.println();
  1079 +
  1080 + preparesecondary.setIsdelete(1);
  1081 + preparesecondary.setResponse_code(String.valueOf(type.getValue()));
  1082 + preparesecondary.setResponse_text("分单——" + type.getName());
  1083 + preparesecondaryServer.save(preparesecondary);
  1084 + receiptService.saveFromPreparesecondary(preparesecondary, type);
1039 1085
1040 - Preparesecondary.setIsdelete(1);  
1041 - Preparesecondary.setResponse_text("分单已发送");  
1042 - preparesecondaryServer.save(Preparesecondary);  
1043 } 1086 }
1044 - }catch (Exception e){ 1087 + } catch (Exception e) {
1045 model.setStatus(500); 1088 model.setStatus(500);
1046 model.setMsg(HttpJsonMsg.ERROR); 1089 model.setMsg(HttpJsonMsg.ERROR);
1047 logger.error("系统异常 >>", e); 1090 logger.error("系统异常 >>", e);
@@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{ @@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{
1055 * @param manifest 1098 * @param manifest
1056 * @return 1099 * @return
1057 */ 1100 */
1058 - @RequestMapping(value = "/presendDelivery" , method = {RequestMethod.POST }) 1101 + @RequestMapping(value = "/presendDelivery", method = { RequestMethod.POST })
1059 @ResponseBody 1102 @ResponseBody
1060 - public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){ 1103 + public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary, HttpServletRequest request) {
1061 ResponseModel model = new ResponseModel(); 1104 ResponseModel model = new ResponseModel();
1062 1105
1063 try { 1106 try {
1064 - if(preparesecondaryServer.isExists(Preparesecondary)){ 1107 + if (preparesecondaryServer.isExists(Preparesecondary)) {
1065 model.setStatus(500); 1108 model.setStatus(500);
1066 model.setMsg("改订单号已经存在了!"); 1109 model.setMsg("改订单号已经存在了!");
1067 - }  
1068 - else{ 1110 + } else {
1069 Preparesecondary.setIsdelete(1); 1111 Preparesecondary.setIsdelete(1);
1070 Preparesecondary = preparesecondaryServer.save(Preparesecondary); 1112 Preparesecondary = preparesecondaryServer.save(Preparesecondary);
1071 - //生成报文并且发送 1113 + // 生成报文并且发送
1072 String rootPath = request.getSession().getServletContext().getRealPath("/"); 1114 String rootPath = request.getSession().getServletContext().getRealPath("/");
1073 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; 1115 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
1074 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path); 1116 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path);
1075 - //发送redis储存数据 1117 + // 发送redis储存数据
1076 // System.out.println(dlcfxml); 1118 // System.out.println(dlcfxml);
1077 new RedisSaveMessage().saveMessage(dlcfxml); 1119 new RedisSaveMessage().saveMessage(dlcfxml);
1078 model.setData(Preparesecondary); 1120 model.setData(Preparesecondary);
1079 model.setStatus(200); 1121 model.setStatus(200);
1080 model.setMsg(HttpJsonMsg.SUCCESS); 1122 model.setMsg(HttpJsonMsg.SUCCESS);
1081 } 1123 }
1082 - }catch (Exception e){ 1124 + } catch (Exception e) {
1083 model.setStatus(500); 1125 model.setStatus(500);
1084 model.setMsg(HttpJsonMsg.ERROR); 1126 model.setMsg(HttpJsonMsg.ERROR);
1085 logger.error("系统异常 >>", e); 1127 logger.error("系统异常 >>", e);
@@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{ @@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{
1093 * @param manifest 1135 * @param manifest
1094 * @return 1136 * @return
1095 */ 1137 */
1096 - @RequestMapping(value = "/daryMawbNo" , method = {RequestMethod.POST }) 1138 + @RequestMapping(value = "/daryMawbNo", method = { RequestMethod.POST })
1097 @ResponseBody 1139 @ResponseBody
1098 - public ResponseModel daryMawbNo(Long id,String mawbNo){ 1140 + public ResponseModel daryMawbNo(Long id, String mawbNo) {
1099 ResponseModel model = new ResponseModel(); 1141 ResponseModel model = new ResponseModel();
1100 List<PreparesecondaryEntity> list = null; 1142 List<PreparesecondaryEntity> list = null;
1101 - if(StringUtils.isNotEmpty(mawbNo)){ 1143 + if (StringUtils.isNotEmpty(mawbNo)) {
1102 list = preparesecondaryServer.findByMawbNo(mawbNo); 1144 list = preparesecondaryServer.findByMawbNo(mawbNo);
1103 } 1145 }
1104 boolean exist = false; 1146 boolean exist = false;
1105 - if(CollectionUtils.isNotEmpty(list)){  
1106 - if(list.size()>0){ 1147 + if (CollectionUtils.isNotEmpty(list)) {
  1148 + if (list.size() > 0) {
1107 exist = true; 1149 exist = true;
1108 } 1150 }
1109 } 1151 }
1110 - if(exist){ 1152 + if (exist) {
1111 model.setStatus(500); 1153 model.setStatus(500);
1112 - }  
1113 - else { 1154 + } else {
1114 model.setStatus(200); 1155 model.setStatus(200);
1115 } 1156 }
1116 return model; 1157 return model;
1117 } 1158 }
1118 1159
1119 -  
1120 - @RequestMapping(value = "/xml",method = RequestMethod.POST) 1160 + @RequestMapping(value = "/xml", method = RequestMethod.POST)
1121 @ResponseBody 1161 @ResponseBody
1122 - public ResponseModel createXml(Long id,HttpServletRequest request,HttpServletResponse response) throws Exception { 1162 + public ResponseModel createXml(Long id, HttpServletRequest request, HttpServletResponse response) throws Exception {
1123 ResponseModel model = new ResponseModel(); 1163 ResponseModel model = new ResponseModel();
1124 String rootPath = request.getSession().getServletContext().getRealPath("/"); 1164 String rootPath = request.getSession().getServletContext().getRealPath("/");
1125 - String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; 1165 + String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
1126 String xml = ""; 1166 String xml = "";
1127 - if(id!=null){  
1128 - xml = beanToXml(path,id); 1167 + if (id != null) {
  1168 + xml = beanToXml(path, id);
1129 } 1169 }
1130 model.setData(xml); 1170 model.setData(xml);
1131 return model; 1171 return model;
1132 } 1172 }
1133 1173
1134 - //生成报文  
1135 - private String beanToXml(String path,Long id) throws Exception{ 1174 + // 生成报文
  1175 + private String beanToXml(String path, Long id) throws Exception {
1136 ManifestEntity maen = manifestService.findOne(id); 1176 ManifestEntity maen = manifestService.findOne(id);
1137 List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId()); 1177 List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId());
1138 1178
1139 DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody(); 1179 DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody();
1140 - //设置xml开头 1180 + // 设置xml开头
1141 XmlHead head = new XmlHead(); 1181 XmlHead head = new XmlHead();
1142 - head.setMessageID("CN_MT2201_1P0_460470678920X_"+Constant.dateTimeFormatnumber.format(new Date())); 1182 + head.setMessageID("CN_MT2201_1P0_460470678920X_" + Constant.dateTimeFormatnumber.format(new Date()));
1143 head.setFunctionCode("9"); 1183 head.setFunctionCode("9");
1144 head.setMessageType("MT2201"); 1184 head.setMessageType("MT2201");
1145 head.setSenderID("460470678920X_DXPENT0000460002"); 1185 head.setSenderID("460470678920X_DXPENT0000460002");
@@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{ @@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{
1147 head.setSendTime(Constant.dateTimeFormatnumber.format(new Date())); 1187 head.setSendTime(Constant.dateTimeFormatnumber.format(new Date()));
1148 head.setVersion("1.0"); 1188 head.setVersion("1.0");
1149 body.setHead(head); 1189 body.setHead(head);
1150 - //预配舱单 1190 + // 预配舱单
1151 ManifestDeclarationXml dec = new ManifestDeclarationXml(); 1191 ManifestDeclarationXml dec = new ManifestDeclarationXml();
1152 - //预配舱单主表信息  
1153 - //承运人 1192 + // 预配舱单主表信息
  1193 + // 承运人
1154 ManifestCarrierXml carr = new ManifestCarrierXml(); 1194 ManifestCarrierXml carr = new ManifestCarrierXml();
1155 carr.setId(maen.getCarrier()); 1195 carr.setId(maen.getCarrier());
1156 dec.setCarrier(carr); 1196 dec.setCarrier(carr);
1157 1197
1158 - //起始站 1198 + // 起始站
1159 ManifestOrgXml mo = new ManifestOrgXml(); 1199 ManifestOrgXml mo = new ManifestOrgXml();
1160 mo.setId(maen.getOriginatingstation()); 1200 mo.setId(maen.getOriginatingstation());
1161 dec.setOrg(mo); 1201 dec.setOrg(mo);
1162 1202
1163 - //目的站 1203 + // 目的站
1164 ManifestDesXml md = new ManifestDesXml(); 1204 ManifestDesXml md = new ManifestDesXml();
1165 md.setId(maen.getDestinationstation()); 1205 md.setId(maen.getDestinationstation());
1166 dec.setDes(md); 1206 dec.setDes(md);
1167 1207
1168 - //航班号-航班日期 1208 + // 航班号-航班日期
1169 ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml(); 1209 ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml();
1170 - mt.setJourneyid(maen.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate())); 1210 + mt.setJourneyid(maen.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
1171 dec.setBordertransportmeans(mt); 1211 dec.setBordertransportmeans(mt);
1172 1212
1173 ManifestConsignmentXml mcs = new ManifestConsignmentXml(); 1213 ManifestConsignmentXml mcs = new ManifestConsignmentXml();
1174 1214
1175 - //运单号 1215 + // 运单号
1176 ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml(); 1216 ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml();
1177 mac.setId(maen.getWaybillnomaster()); 1217 mac.setId(maen.getWaybillnomaster());
1178 mcs.setTransportcontractdocument(mac); 1218 mcs.setTransportcontractdocument(mac);
1179 1219
1180 - //装载日期 1220 + // 装载日期
1181 ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml(); 1221 ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml();
1182 ml.setId("CGO/4604"); 1222 ml.setId("CGO/4604");
1183 ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate())); 1223 ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate()));
@@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{ @@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{
1207 mcs.setAgentname(maen.getAgentman()); 1247 mcs.setAgentname(maen.getAgentman());
1208 mcs.setAgentCompany(maen.getAgentcompany()); 1248 mcs.setAgentCompany(maen.getAgentcompany());
1209 1249
1210 -// ManifestConsigneeXml mcons = new ManifestConsigneeXml();  
1211 -// mcons.setName(maen.getConsigneename());  
1212 -//  
1213 -// ManifestAddressXml madd = new ManifestAddressXml();  
1214 -// madd.setLine(maen.getConsigneeaddress());  
1215 -// madd.setCityname(maen.getConsigneecity());  
1216 -// madd.setCountrycode(maen.getCountrycode());  
1217 -// madd.setProvincecode(maen.getProvincecode());  
1218 -// madd.setProvincename(maen.getProvincename());  
1219 -// madd.setZipcode(maen.getZipcode());  
1220 -// mcons.setAddress(madd);  
1221 -// mcs.setConsignee(mcons);  
1222 -// 1250 + // ManifestConsigneeXml mcons = new ManifestConsigneeXml();
  1251 + // mcons.setName(maen.getConsigneename());
  1252 + //
  1253 + // ManifestAddressXml madd = new ManifestAddressXml();
  1254 + // madd.setLine(maen.getConsigneeaddress());
  1255 + // madd.setCityname(maen.getConsigneecity());
  1256 + // madd.setCountrycode(maen.getCountrycode());
  1257 + // madd.setProvincecode(maen.getProvincecode());
  1258 + // madd.setProvincename(maen.getProvincename());
  1259 + // madd.setZipcode(maen.getZipcode());
  1260 + // mcons.setAddress(madd);
  1261 + // mcs.setConsignee(mcons);
  1262 + //
1223 ManifestConsignorXml maci = new ManifestConsignorXml(); 1263 ManifestConsignorXml maci = new ManifestConsignorXml();
1224 -// maci.setName(maen.getShippername()); 1264 + // maci.setName(maen.getShippername());
1225 ManifestsAddressXml msadd = new ManifestsAddressXml(); 1265 ManifestsAddressXml msadd = new ManifestsAddressXml();
1226 -// msadd.setLine(maen.getShipperaddress());  
1227 -// msadd.setCityname(maen.getShippercity()); 1266 + // msadd.setLine(maen.getShipperaddress());
  1267 + // msadd.setCityname(maen.getShippercity());
1228 maci.setAddress(msadd); 1268 maci.setAddress(msadd);
1229 mcs.setConsignor(maci); 1269 mcs.setConsignor(maci);
1230 1270
1231 - //预配舱单子表信息  
1232 - if(preparesecondaryList !=null ){ 1271 + // 预配舱单子表信息
  1272 + if (preparesecondaryList != null) {
1233 List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>(); 1273 List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>();
1234 for (PreparesecondaryEntity entity : preparesecondaryList) { 1274 for (PreparesecondaryEntity entity : preparesecondaryList) {
1235 ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml(); 1275 ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml();
@@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{ @@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{
1246 maconca.setDes(dess); 1286 maconca.setDes(dess);
1247 1287
1248 ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml(); 1288 ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml();
1249 - mtm.setJourneyid(entity.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));; 1289 + mtm.setJourneyid(entity.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
  1290 + ;
1250 maconca.setBorderTransportMeans(mtm); 1291 maconca.setBorderTransportMeans(mtm);
1251 1292
1252 ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml(); 1293 ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml();
@@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{ @@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{
1277 maconca.setAgentname(entity.getAgentman()); 1318 maconca.setAgentname(entity.getAgentman());
1278 maconca.setCustomscode(entity.getCustomscode()); 1319 maconca.setCustomscode(entity.getCustomscode());
1279 1320
1280 -// ManifestAddressXml madds = new ManifestAddressXml();  
1281 -// madds.setLine(entity.getConsigneeaddress());  
1282 -// madds.setCityname(entity.getConsigneecity());  
1283 -// madds.setCountrycode(entity.getCountrycode());  
1284 -// madds.setProvincecode(maen.getProvincecode());  
1285 -// madds.setProvincename(entity.getProvincename());  
1286 -// madds.setZipcode(entity.getZipcode());  
1287 -// mcons.setAddress(madds);  
1288 -// maconca.setConsignee(mcons);  
1289 -//  
1290 -// ManifestConsignorXml macis = new ManifestConsignorXml();  
1291 -// macis.setName(entity.getShippername());  
1292 -// ManifestsAddressXml msadds = new ManifestsAddressXml();  
1293 -// msadds.setLine(entity.getShipperaddress());  
1294 -// msadds.setCityname(entity.getShippercity());  
1295 -// macis.setAddress(msadds);  
1296 -// maconca.setConsignor(macis); 1321 + // ManifestAddressXml madds = new ManifestAddressXml();
  1322 + // madds.setLine(entity.getConsigneeaddress());
  1323 + // madds.setCityname(entity.getConsigneecity());
  1324 + // madds.setCountrycode(entity.getCountrycode());
  1325 + // madds.setProvincecode(maen.getProvincecode());
  1326 + // madds.setProvincename(entity.getProvincename());
  1327 + // madds.setZipcode(entity.getZipcode());
  1328 + // mcons.setAddress(madds);
  1329 + // maconca.setConsignee(mcons);
  1330 + //
  1331 + // ManifestConsignorXml macis = new ManifestConsignorXml();
  1332 + // macis.setName(entity.getShippername());
  1333 + // ManifestsAddressXml msadds = new ManifestsAddressXml();
  1334 + // msadds.setLine(entity.getShipperaddress());
  1335 + // msadds.setCityname(entity.getShippercity());
  1336 + // macis.setAddress(msadds);
  1337 + // maconca.setConsignor(macis);
1297 1338
1298 ls.add(maconca); 1339 ls.add(maconca);
1299 } 1340 }
@@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{ @@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{
1303 1344
1304 body.setDeclaration(dec); 1345 body.setDeclaration(dec);
1305 1346
1306 -  
1307 ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml(); 1347 ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml();
1308 ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml(); 1348 ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml();
1309 mdme.setSndr("CDCF"); 1349 mdme.setSndr("CDCF");
1310 mdme.setRcvr(""); 1350 mdme.setRcvr("");
1311 - mdme.setSeqn(maen.getWaybillnomaster()+Constant.dateTimeFormatnumber.format(new Date())); 1351 + mdme.setSeqn(maen.getWaybillnomaster() + Constant.dateTimeFormatnumber.format(new Date()));
1312 mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date())); 1352 mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date()));
1313 mdme.setType("HYXX"); 1353 mdme.setType("HYXX");
1314 - mdme.setStyp("CDCF");//CDCF NDLR 1354 + mdme.setStyp("CDCF");// CDCF NDLR
1315 dms.setMeta(mdme); 1355 dms.setMeta(mdme);
1316 dms.setDeclarepreparemasterxmlbody(body); 1356 dms.setDeclarepreparemasterxmlbody(body);
1317 1357
1318 String xml = XmlUtil.convertToXml2(dms, path); 1358 String xml = XmlUtil.convertToXml2(dms, path);
1319 1359
1320 -// System.out.println(xml);  
1321 -// IMFServletManifst mis = new IMFServletManifst();  
1322 -// mis.init(xml.toString()); 1360 + // System.out.println(xml);
  1361 + // IMFServletManifst mis = new IMFServletManifst();
  1362 + // mis.init(xml.toString());
1323 1363
1324 return xml; 1364 return xml;
1325 } 1365 }
1326 1366
1327 -// private String beanToXml(String path,Long id){  
1328 -// ManifestEntity manifestEntity = manifestService.findOne(id);  
1329 -//  
1330 -// if(manifestEntity==null){  
1331 -// manifestEntity = new ManifestEntity();  
1332 -// }  
1333 -// List<ManifestBillEntity> billList = null;  
1334 -// ManifestBillEntity billEntity = new ManifestBillEntity();  
1335 -// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();  
1336 -// ManifestContainerEntity containerEntity = new ManifestContainerEntity();  
1337 -// if(manifestEntity.getId()!=null){  
1338 -// billList = billService.findByManifestId(manifestEntity.getId());  
1339 -// }  
1340 -// if(CollectionUtils.isNotEmpty(billList)){  
1341 -// billEntity = billList.get(0);  
1342 -// }  
1343 -// List<ManifestCommodityEntity> commodities = null;  
1344 -// if(billEntity.getId()!=null){  
1345 -// commodities = commodityService.findByBillId(billEntity.getId());  
1346 -// }  
1347 -// if(CollectionUtils.isNotEmpty(commodities)){  
1348 -// commodityEntity = commodities.get(0);  
1349 -// }  
1350 -//  
1351 -// DeclareXmlBody body = new DeclareXmlBody();  
1352 -//  
1353 -// XmlHead head = new XmlHead();  
1354 -// head.setMessageID(id==null?"":id.toString());  
1355 -// head.setMessageType("Manifest");  
1356 -// head.setSenderID(SessionUtil.getUser().getId().toString());  
1357 -// head.setSendTime(Constant.dateFormat.format(new Date()));  
1358 -// head.setFunctionCode("");  
1359 -// head.setReceiverID(SessionUtil.getUser().getId().toString());  
1360 -// head.setVersion("1.0");  
1361 -// body.setHead(head);  
1362 -//  
1363 -// DeclareManifestXml manifestXml = new DeclareManifestXml();  
1364 -//  
1365 -// NameXml nameXml = new NameXml();  
1366 -// nameXml.setName(manifestEntity.getTransferName());  
1367 -// manifestXml.setRepresentativePerson(nameXml);  
1368 -//  
1369 -// IDXml idXml = new IDXml();  
1370 -// idXml.setId(manifestEntity.getLeaveCode());  
1371 -// manifestXml.setExitCustomsOffice(idXml);  
1372 -//  
1373 -// IDXml idXml1 = new IDXml();  
1374 -// idXml1.setId(manifestEntity.getAgentCompanyCode());  
1375 -// manifestXml.setAgent(idXml1);  
1376 -//  
1377 -// IDXml idXml2 = new IDXml();  
1378 -// idXml2.setId(manifestEntity.getCarrierCode());  
1379 -// manifestXml.setCarrier(idXml2);  
1380 -//  
1381 -// DeclareBorderTransportMeansXml transportMeansXml = new DeclareBorderTransportMeansXml();  
1382 -// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());  
1383 -// transportMeansXml.setTypeCode(manifestEntity.getModeCode());  
1384 -// transportMeansXml.setId(manifestEntity.getToolCode());  
1385 -// transportMeansXml.setName(manifestEntity.getToolName());  
1386 -// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());  
1387 -// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");  
1388 -// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");  
1389 -//  
1390 -// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();  
1391 -//  
1392 -// DeclareTransportContractDocumentXml contractDocumentXml = new DeclareTransportContractDocumentXml();  
1393 -//  
1394 -// contractDocumentXml.setId(billEntity.getLadingNo());  
1395 -// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());  
1396 -// contractDocumentXml.setConditionCode(billEntity.getTransportCode());  
1397 -// consignmentXml.setTransportContractDocument(contractDocumentXml);  
1398 -//  
1399 -// IDXml idXml3 = new IDXml();  
1400 -// idXml3.setId(billEntity.getSubLadingNo());  
1401 -// consignmentXml.setAssociatedTransportDocument(idXml3);  
1402 -//  
1403 -// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");  
1404 -// consignmentXml.setValueAmount(billEntity.getCashType());  
1405 -//  
1406 -// DeclareLoadingLocationXml loadingLocationXml = new DeclareLoadingLocationXml();  
1407 -// loadingLocationXml.setId(billEntity.getEncasementCode());  
1408 -// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());  
1409 -// consignmentXml.setLoadingLocation(loadingLocationXml);  
1410 -//  
1411 -// DeclareUnloadingLocationXml unloadingLocationXml = new DeclareUnloadingLocationXml();  
1412 -// unloadingLocationXml.setId(billEntity.getUnlodingCode());  
1413 -// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");  
1414 -// consignmentXml.setUnloadingLocation(unloadingLocationXml);  
1415 -//  
1416 -// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new DeclareGoodsReceiptPlaceXml();  
1417 -//  
1418 -// receiptPlaceXml.setId(billEntity.getReceiveCode());  
1419 -// receiptPlaceXml.setName(billEntity.getReceiveName());  
1420 -// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);  
1421 -//  
1422 -// IDXml idXml4 = new IDXml();  
1423 -// idXml4.setId(billEntity.getTransitCode());  
1424 -// consignmentXml.setTranshipmentLocation(idXml4);  
1425 -//  
1426 -// IDXml idXml5 = new IDXml();  
1427 -// idXml5.setId(billEntity.getTransitDestinationCode());  
1428 -// consignmentXml.setTransitDestination(idXml5);  
1429 -//  
1430 -// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());  
1431 -//  
1432 -// IDXml idXml6 = new IDXml();  
1433 -// idXml6.setId(billEntity.getConsignLocation());  
1434 -// consignmentXml.setGoodsConsignedPlace(idXml6);  
1435 -//  
1436 -// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());  
1437 -// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());  
1438 -//  
1439 -// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();  
1440 -// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());  
1441 -// consignmentXml.setFreightPayment(methodCodeXml);  
1442 -//  
1443 -// DeclareConsignmentPackagingXml packagingXml = new DeclareConsignmentPackagingXml();  
1444 -// packagingXml.setTypeCode(billEntity.getPackageType());  
1445 -// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");  
1446 -// consignmentXml.setConsignmentPackaging(packagingXml);  
1447 -//  
1448 -// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");  
1449 -//  
1450 -// DeclarePreviousCustomsDocumentXml documentXml = new DeclarePreviousCustomsDocumentXml();  
1451 -// documentXml.setId(billEntity.getPreviousCustomsNo());  
1452 -// documentXml.setTypeCode(billEntity.getPreviousCustomsType());  
1453 -// consignmentXml.setPreviousCustomsDocument(documentXml);  
1454 -//  
1455 -// DeclareDeliveryDestinationXml deliveryDestinationXml = new DeclareDeliveryDestinationXml();  
1456 -// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());  
1457 -// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());  
1458 -// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());  
1459 -// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());  
1460 -// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());  
1461 -// consignmentXml.setDeliveryDestination(deliveryDestinationXml);  
1462 -//  
1463 -// DeclareIntermediateCarrierXml intermediateCarrierXml = new DeclareIntermediateCarrierXml();  
1464 -// intermediateCarrierXml.setId(billEntity.getCarrierSign());  
1465 -// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();  
1466 -// communicationXml.setId(billEntity.getCarrierContactNo());  
1467 -// communicationXml.setTypeID(billEntity.getCarrierContactType());  
1468 -// intermediateCarrierXml.setCommunication(communicationXml);  
1469 -// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);  
1470 -//  
1471 -// //收货人  
1472 -// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();  
1473 -// consigneeXml.setId(billEntity.getReceiverCode());  
1474 -// consigneeXml.setName(billEntity.getReceiverName());  
1475 -//  
1476 -// DeclareAddressXml addressXml = new DeclareAddressXml();  
1477 -// addressXml.setLine(billEntity.getReceiverAddress());  
1478 -// addressXml.setCityName(billEntity.getReceiverCity());  
1479 -// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());  
1480 -// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());  
1481 -// addressXml.setCountryCode(billEntity.getReceiverCountryCode());  
1482 -// addressXml.setPostcodeID(billEntity.getReceiverPostCode());  
1483 -// consigneeXml.setAddress(addressXml);  
1484 -// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();  
1485 -// communicationXml1.setId(billEntity.getReceiverContactNo());  
1486 -// communicationXml1.setTypeID(billEntity.getReceiverContactType());  
1487 -// consigneeXml.setCommunication(communicationXml1);  
1488 -//  
1489 -// DeclareContactXml contactXml = new DeclareContactXml();  
1490 -// contactXml.setName(billEntity.getReceiverName());  
1491 -// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();  
1492 -// communicationXml2.setId(billEntity.getReceiverContactNo());  
1493 -// communicationXml2.setTypeID(billEntity.getReceiverContactType());  
1494 -// contactXml.setCommunication(communicationXml2);  
1495 -// consigneeXml.setContact(contactXml);  
1496 -//  
1497 -// consignmentXml.setConsignee(consigneeXml);  
1498 -//  
1499 -// //发货人  
1500 -// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();  
1501 -// consigneeXml1.setId(billEntity.getSenderCode());  
1502 -// consigneeXml1.setName(billEntity.getSenderName());  
1503 -// DeclareAddressXml addressXml1 = new DeclareAddressXml();  
1504 -// addressXml1.setLine(billEntity.getSenderAddress());  
1505 -// addressXml1.setCityName(billEntity.getSenderCity());  
1506 -// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());  
1507 -// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());  
1508 -// addressXml1.setPostcodeID(billEntity.getSenderPostCode());  
1509 -// addressXml1.setCountryCode(billEntity.getSenderCountryCode());  
1510 -// consigneeXml1.setAddress(addressXml1);  
1511 -// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();  
1512 -// communicationXml3.setId(billEntity.getSenderContactNo());  
1513 -// communicationXml3.setTypeID(billEntity.getSenderContactType());  
1514 -// consigneeXml1.setCommunication(communicationXml3);  
1515 -// consignmentXml.setConsignor(consigneeXml1);  
1516 -//  
1517 -// //通知人  
1518 -// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();  
1519 -// consigneeXml2.setId(billEntity.getNotifierCode());  
1520 -// consigneeXml2.setName(billEntity.getNotifier());  
1521 -// addressXml.setLine(billEntity.getNotifierAddress());  
1522 -// addressXml.setCityName(billEntity.getNotifierCity());  
1523 -// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());  
1524 -// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());  
1525 -// addressXml.setPostcodeID(billEntity.getNotifierPostCode());  
1526 -// addressXml.setCountryCode(billEntity.getNotifierCountryCode());  
1527 -// consigneeXml2.setAddress(addressXml);  
1528 -// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();  
1529 -// communicationXml4.setId(billEntity.getNotifierContact());  
1530 -// communicationXml4.setTypeID(billEntity.getNotifierContactCode());  
1531 -// consigneeXml2.setCommunication(communicationXml4);  
1532 -// consignmentXml.setNotifyParty(consigneeXml2);  
1533 -//  
1534 -// //危险品联系人  
1535 -// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();  
1536 -// dgXml.setName(billEntity.getDangerContact());  
1537 -// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();  
1538 -// communicationXml5.setId(billEntity.getDangerContactNo());  
1539 -// communicationXml5.setTypeID(billEntity.getDangerContactType());  
1540 -// dgXml.setCommunication(communicationXml5);  
1541 -// consignmentXml.setuNDGContact(dgXml);  
1542 -//  
1543 -// //商品信息  
1544 -// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();  
1545 -// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());  
1546 -// DeclareConsignmentItemPackagingXml itemPackagingXml = new DeclareConsignmentItemPackagingXml();  
1547 -// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");  
1548 -// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());  
1549 -// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());  
1550 -// itemXml.setConsignmentItemPackaging(itemPackagingXml);  
1551 -//  
1552 -// DeclareCommodityXml commodityXml = new DeclareCommodityXml();  
1553 -// commodityXml.setCargoDescription(commodityEntity.getSummary());  
1554 -// commodityXml.setuNDGCode(commodityEntity.getDangerNo());  
1555 -// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());  
1556 -//  
1557 -// ContentXml contentXml = new ContentXml();  
1558 -// contentXml.setContent(commodityEntity.getRemark());  
1559 -// itemXml.setAdditionalInformation(contentXml);  
1560 -//  
1561 -// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();  
1562 -// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");  
1563 -// itemXml.setGoodsMeasure(goodsMeasureXml);  
1564 -//  
1565 -// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();  
1566 -// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());  
1567 -// itemXml.setCustomsProcedure(procedureXml);  
1568 -//  
1569 -// idXml.setId(commodityEntity.getConsign());  
1570 -// itemXml.setuCR(idXml);  
1571 -//  
1572 -// DeclareOriginXml originXml = new DeclareOriginXml();  
1573 -// originXml.setOriginCountryCode(commodityEntity.getOriginCode());  
1574 -// itemXml.setOrigin(originXml);  
1575 -// consignmentXml.setConsignmentItem(itemXml);  
1576 -//  
1577 -// manifestXml.setConsignment(consignmentXml);  
1578 -//  
1579 -// contentXml.setContent(manifestEntity.getRemark());  
1580 -// manifestXml.setAdditionalInformation(contentXml);  
1581 -//  
1582 -// body.setDeclaration(manifestXml);  
1583 -// String xml = XmlUtil.convertToXml2(body, path);  
1584 -// return xml;  
1585 -// }  
1586 -  
1587 - 1367 + // private String beanToXml(String path,Long id){
  1368 + // ManifestEntity manifestEntity = manifestService.findOne(id);
  1369 + //
  1370 + // if(manifestEntity==null){
  1371 + // manifestEntity = new ManifestEntity();
  1372 + // }
  1373 + // List<ManifestBillEntity> billList = null;
  1374 + // ManifestBillEntity billEntity = new ManifestBillEntity();
  1375 + // ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
  1376 + // ManifestContainerEntity containerEntity = new ManifestContainerEntity();
  1377 + // if(manifestEntity.getId()!=null){
  1378 + // billList = billService.findByManifestId(manifestEntity.getId());
  1379 + // }
  1380 + // if(CollectionUtils.isNotEmpty(billList)){
  1381 + // billEntity = billList.get(0);
  1382 + // }
  1383 + // List<ManifestCommodityEntity> commodities = null;
  1384 + // if(billEntity.getId()!=null){
  1385 + // commodities = commodityService.findByBillId(billEntity.getId());
  1386 + // }
  1387 + // if(CollectionUtils.isNotEmpty(commodities)){
  1388 + // commodityEntity = commodities.get(0);
  1389 + // }
  1390 + //
  1391 + // DeclareXmlBody body = new DeclareXmlBody();
  1392 + //
  1393 + // XmlHead head = new XmlHead();
  1394 + // head.setMessageID(id==null?"":id.toString());
  1395 + // head.setMessageType("Manifest");
  1396 + // head.setSenderID(SessionUtil.getUser().getId().toString());
  1397 + // head.setSendTime(Constant.dateFormat.format(new Date()));
  1398 + // head.setFunctionCode("");
  1399 + // head.setReceiverID(SessionUtil.getUser().getId().toString());
  1400 + // head.setVersion("1.0");
  1401 + // body.setHead(head);
  1402 + //
  1403 + // DeclareManifestXml manifestXml = new DeclareManifestXml();
  1404 + //
  1405 + // NameXml nameXml = new NameXml();
  1406 + // nameXml.setName(manifestEntity.getTransferName());
  1407 + // manifestXml.setRepresentativePerson(nameXml);
  1408 + //
  1409 + // IDXml idXml = new IDXml();
  1410 + // idXml.setId(manifestEntity.getLeaveCode());
  1411 + // manifestXml.setExitCustomsOffice(idXml);
  1412 + //
  1413 + // IDXml idXml1 = new IDXml();
  1414 + // idXml1.setId(manifestEntity.getAgentCompanyCode());
  1415 + // manifestXml.setAgent(idXml1);
  1416 + //
  1417 + // IDXml idXml2 = new IDXml();
  1418 + // idXml2.setId(manifestEntity.getCarrierCode());
  1419 + // manifestXml.setCarrier(idXml2);
  1420 + //
  1421 + // DeclareBorderTransportMeansXml transportMeansXml = new
  1422 + // DeclareBorderTransportMeansXml();
  1423 + // transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
  1424 + // transportMeansXml.setTypeCode(manifestEntity.getModeCode());
  1425 + // transportMeansXml.setId(manifestEntity.getToolCode());
  1426 + // transportMeansXml.setName(manifestEntity.getToolName());
  1427 + // transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
  1428 + // transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
  1429 + // transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
  1430 + //
  1431 + // DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
  1432 + //
  1433 + // DeclareTransportContractDocumentXml contractDocumentXml = new
  1434 + // DeclareTransportContractDocumentXml();
  1435 + //
  1436 + // contractDocumentXml.setId(billEntity.getLadingNo());
  1437 + // contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
  1438 + // contractDocumentXml.setConditionCode(billEntity.getTransportCode());
  1439 + // consignmentXml.setTransportContractDocument(contractDocumentXml);
  1440 + //
  1441 + // IDXml idXml3 = new IDXml();
  1442 + // idXml3.setId(billEntity.getSubLadingNo());
  1443 + // consignmentXml.setAssociatedTransportDocument(idXml3);
  1444 + //
  1445 + // consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
  1446 + // consignmentXml.setValueAmount(billEntity.getCashType());
  1447 + //
  1448 + // DeclareLoadingLocationXml loadingLocationXml = new
  1449 + // DeclareLoadingLocationXml();
  1450 + // loadingLocationXml.setId(billEntity.getEncasementCode());
  1451 + // loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
  1452 + // consignmentXml.setLoadingLocation(loadingLocationXml);
  1453 + //
  1454 + // DeclareUnloadingLocationXml unloadingLocationXml = new
  1455 + // DeclareUnloadingLocationXml();
  1456 + // unloadingLocationXml.setId(billEntity.getUnlodingCode());
  1457 + // unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
  1458 + // consignmentXml.setUnloadingLocation(unloadingLocationXml);
  1459 + //
  1460 + // DeclareGoodsReceiptPlaceXml receiptPlaceXml = new
  1461 + // DeclareGoodsReceiptPlaceXml();
  1462 + //
  1463 + // receiptPlaceXml.setId(billEntity.getReceiveCode());
  1464 + // receiptPlaceXml.setName(billEntity.getReceiveName());
  1465 + // consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
  1466 + //
  1467 + // IDXml idXml4 = new IDXml();
  1468 + // idXml4.setId(billEntity.getTransitCode());
  1469 + // consignmentXml.setTranshipmentLocation(idXml4);
  1470 + //
  1471 + // IDXml idXml5 = new IDXml();
  1472 + // idXml5.setId(billEntity.getTransitDestinationCode());
  1473 + // consignmentXml.setTransitDestination(idXml5);
  1474 + //
  1475 + // consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
  1476 + //
  1477 + // IDXml idXml6 = new IDXml();
  1478 + // idXml6.setId(billEntity.getConsignLocation());
  1479 + // consignmentXml.setGoodsConsignedPlace(idXml6);
  1480 + //
  1481 + // consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
  1482 + // consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
  1483 + //
  1484 + // DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
  1485 + // methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
  1486 + // consignmentXml.setFreightPayment(methodCodeXml);
  1487 + //
  1488 + // DeclareConsignmentPackagingXml packagingXml = new
  1489 + // DeclareConsignmentPackagingXml();
  1490 + // packagingXml.setTypeCode(billEntity.getPackageType());
  1491 + // packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
  1492 + // consignmentXml.setConsignmentPackaging(packagingXml);
  1493 + //
  1494 + // consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
  1495 + //
  1496 + // DeclarePreviousCustomsDocumentXml documentXml = new
  1497 + // DeclarePreviousCustomsDocumentXml();
  1498 + // documentXml.setId(billEntity.getPreviousCustomsNo());
  1499 + // documentXml.setTypeCode(billEntity.getPreviousCustomsType());
  1500 + // consignmentXml.setPreviousCustomsDocument(documentXml);
  1501 + //
  1502 + // DeclareDeliveryDestinationXml deliveryDestinationXml = new
  1503 + // DeclareDeliveryDestinationXml();
  1504 + // deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
  1505 + // deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
  1506 + // deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
  1507 + // deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
  1508 + // deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
  1509 + // consignmentXml.setDeliveryDestination(deliveryDestinationXml);
  1510 + //
  1511 + // DeclareIntermediateCarrierXml intermediateCarrierXml = new
  1512 + // DeclareIntermediateCarrierXml();
  1513 + // intermediateCarrierXml.setId(billEntity.getCarrierSign());
  1514 + // DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
  1515 + // communicationXml.setId(billEntity.getCarrierContactNo());
  1516 + // communicationXml.setTypeID(billEntity.getCarrierContactType());
  1517 + // intermediateCarrierXml.setCommunication(communicationXml);
  1518 + // consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
  1519 + //
  1520 + // //收货人
  1521 + // DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
  1522 + // consigneeXml.setId(billEntity.getReceiverCode());
  1523 + // consigneeXml.setName(billEntity.getReceiverName());
  1524 + //
  1525 + // DeclareAddressXml addressXml = new DeclareAddressXml();
  1526 + // addressXml.setLine(billEntity.getReceiverAddress());
  1527 + // addressXml.setCityName(billEntity.getReceiverCity());
  1528 + // addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
  1529 + // addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
  1530 + // addressXml.setCountryCode(billEntity.getReceiverCountryCode());
  1531 + // addressXml.setPostcodeID(billEntity.getReceiverPostCode());
  1532 + // consigneeXml.setAddress(addressXml);
  1533 + // DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
  1534 + // communicationXml1.setId(billEntity.getReceiverContactNo());
  1535 + // communicationXml1.setTypeID(billEntity.getReceiverContactType());
  1536 + // consigneeXml.setCommunication(communicationXml1);
  1537 + //
  1538 + // DeclareContactXml contactXml = new DeclareContactXml();
  1539 + // contactXml.setName(billEntity.getReceiverName());
  1540 + // DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
  1541 + // communicationXml2.setId(billEntity.getReceiverContactNo());
  1542 + // communicationXml2.setTypeID(billEntity.getReceiverContactType());
  1543 + // contactXml.setCommunication(communicationXml2);
  1544 + // consigneeXml.setContact(contactXml);
  1545 + //
  1546 + // consignmentXml.setConsignee(consigneeXml);
  1547 + //
  1548 + // //发货人
  1549 + // DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
  1550 + // consigneeXml1.setId(billEntity.getSenderCode());
  1551 + // consigneeXml1.setName(billEntity.getSenderName());
  1552 + // DeclareAddressXml addressXml1 = new DeclareAddressXml();
  1553 + // addressXml1.setLine(billEntity.getSenderAddress());
  1554 + // addressXml1.setCityName(billEntity.getSenderCity());
  1555 + // addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
  1556 + // addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
  1557 + // addressXml1.setPostcodeID(billEntity.getSenderPostCode());
  1558 + // addressXml1.setCountryCode(billEntity.getSenderCountryCode());
  1559 + // consigneeXml1.setAddress(addressXml1);
  1560 + // DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
  1561 + // communicationXml3.setId(billEntity.getSenderContactNo());
  1562 + // communicationXml3.setTypeID(billEntity.getSenderContactType());
  1563 + // consigneeXml1.setCommunication(communicationXml3);
  1564 + // consignmentXml.setConsignor(consigneeXml1);
  1565 + //
  1566 + // //通知人
  1567 + // DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
  1568 + // consigneeXml2.setId(billEntity.getNotifierCode());
  1569 + // consigneeXml2.setName(billEntity.getNotifier());
  1570 + // addressXml.setLine(billEntity.getNotifierAddress());
  1571 + // addressXml.setCityName(billEntity.getNotifierCity());
  1572 + // addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
  1573 + // addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
  1574 + // addressXml.setPostcodeID(billEntity.getNotifierPostCode());
  1575 + // addressXml.setCountryCode(billEntity.getNotifierCountryCode());
  1576 + // consigneeXml2.setAddress(addressXml);
  1577 + // DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
  1578 + // communicationXml4.setId(billEntity.getNotifierContact());
  1579 + // communicationXml4.setTypeID(billEntity.getNotifierContactCode());
  1580 + // consigneeXml2.setCommunication(communicationXml4);
  1581 + // consignmentXml.setNotifyParty(consigneeXml2);
  1582 + //
  1583 + // //危险品联系人
  1584 + // DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
  1585 + // dgXml.setName(billEntity.getDangerContact());
  1586 + // DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
  1587 + // communicationXml5.setId(billEntity.getDangerContactNo());
  1588 + // communicationXml5.setTypeID(billEntity.getDangerContactType());
  1589 + // dgXml.setCommunication(communicationXml5);
  1590 + // consignmentXml.setuNDGContact(dgXml);
  1591 + //
  1592 + // //商品信息
  1593 + // DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
  1594 + // itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
  1595 + // DeclareConsignmentItemPackagingXml itemPackagingXml = new
  1596 + // DeclareConsignmentItemPackagingXml();
  1597 + // itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
  1598 + // itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
  1599 + // itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
  1600 + // itemXml.setConsignmentItemPackaging(itemPackagingXml);
  1601 + //
  1602 + // DeclareCommodityXml commodityXml = new DeclareCommodityXml();
  1603 + // commodityXml.setCargoDescription(commodityEntity.getSummary());
  1604 + // commodityXml.setuNDGCode(commodityEntity.getDangerNo());
  1605 + // commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
  1606 + //
  1607 + // ContentXml contentXml = new ContentXml();
  1608 + // contentXml.setContent(commodityEntity.getRemark());
  1609 + // itemXml.setAdditionalInformation(contentXml);
  1610 + //
  1611 + // DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
  1612 + // goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
  1613 + // itemXml.setGoodsMeasure(goodsMeasureXml);
  1614 + //
  1615 + // DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
  1616 + // procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
  1617 + // itemXml.setCustomsProcedure(procedureXml);
  1618 + //
  1619 + // idXml.setId(commodityEntity.getConsign());
  1620 + // itemXml.setuCR(idXml);
  1621 + //
  1622 + // DeclareOriginXml originXml = new DeclareOriginXml();
  1623 + // originXml.setOriginCountryCode(commodityEntity.getOriginCode());
  1624 + // itemXml.setOrigin(originXml);
  1625 + // consignmentXml.setConsignmentItem(itemXml);
  1626 + //
  1627 + // manifestXml.setConsignment(consignmentXml);
  1628 + //
  1629 + // contentXml.setContent(manifestEntity.getRemark());
  1630 + // manifestXml.setAdditionalInformation(contentXml);
  1631 + //
  1632 + // body.setDeclaration(manifestXml);
  1633 + // String xml = XmlUtil.convertToXml2(body, path);
  1634 + // return xml;
  1635 + // }
1588 1636
1589 /** 1637 /**
1590 * 保存 1638 * 保存
@@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{ @@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{
1593 * @return 1641 * @return
1594 */ 1642 */
1595 @ResponseBody 1643 @ResponseBody
1596 - @RequestMapping(value = "/bill/save",method = RequestMethod.POST)  
1597 - public ResponseModel saveBill(String billJson,String voJson){ 1644 + @RequestMapping(value = "/bill/save", method = RequestMethod.POST)
  1645 + public ResponseModel saveBill(String billJson, String voJson) {
1598 ResponseModel model = new ResponseModel(); 1646 ResponseModel model = new ResponseModel();
1599 try { 1647 try {
1600 - ManifestBillEntity bill = JSONObject.parseObject(billJson,ManifestBillEntity.class);  
1601 - List<CommodityVo> voList = JSONArray.parseArray(voJson,CommodityVo.class);  
1602 - bill = billService.save(bill,voList); 1648 + ManifestBillEntity bill = JSONObject.parseObject(billJson, ManifestBillEntity.class);
  1649 + List<CommodityVo> voList = JSONArray.parseArray(voJson, CommodityVo.class);
  1650 + bill = billService.save(bill, voList);
1603 model.setData(bill.getManifestId()); 1651 model.setData(bill.getManifestId());
1604 model.setStatus(200); 1652 model.setStatus(200);
1605 model.setMsg(HttpJsonMsg.SUCCESS); 1653 model.setMsg(HttpJsonMsg.SUCCESS);
1606 - }catch (Exception e){ 1654 + } catch (Exception e) {
1607 model.setStatus(500); 1655 model.setStatus(500);
1608 model.setMsg(HttpJsonMsg.ERROR); 1656 model.setMsg(HttpJsonMsg.ERROR);
1609 logger.error("系统异常 >>", e); 1657 logger.error("系统异常 >>", e);
@@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{ @@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{
1611 1659
1612 return model; 1660 return model;
1613 } 1661 }
  1662 +
1614 /* 1663 /*
1615 * 获取3字码对应的信息,然后自动填写上 1664 * 获取3字码对应的信息,然后自动填写上
1616 */ 1665 */
1617 @RequestMapping("/gettreecode") 1666 @RequestMapping("/gettreecode")
1618 @ResponseBody 1667 @ResponseBody
1619 - public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE){ 1668 + public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE) {
1620 ResponseModel model = new ResponseModel(1, null, ""); 1669 ResponseModel model = new ResponseModel(1, null, "");
1621 1670
1622 - //这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法  
1623 -// List<TBasCarrierEntity> tbc = tbasService.findAll();  
1624 -// for(int i = 0; i < tbc.size(); i ++)  
1625 -// {  
1626 -// }  
1627 -// model.setData(tbc);  
1628 - if(STOCKPRE != null)  
1629 - { 1671 + // 这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
  1672 + // List<TBasCarrierEntity> tbc = tbasService.findAll();
  1673 + // for(int i = 0; i < tbc.size(); i ++)
  1674 + // {
  1675 + // }
  1676 + // model.setData(tbc);
  1677 + if (STOCKPRE != null) {
1630 Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2"); 1678 Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2");
1631 - //List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>(); 1679 + // List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
1632 Statement sql; 1680 Statement sql;
1633 try { 1681 try {
1634 sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); 1682 sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
1635 - String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='"+STOCKPRE+"'"; 1683 + String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='" + STOCKPRE + "'";
1636 ResultSet rs = sql.executeQuery(sqlStr); 1684 ResultSet rs = sql.executeQuery(sqlStr);
1637 1685
1638 - while(rs.next())  
1639 - { 1686 + while (rs.next()) {
1640 TBasCarrierEntity tbs = new TBasCarrierEntity(); 1687 TBasCarrierEntity tbs = new TBasCarrierEntity();
1641 tbs.setcARRIERID(rs.getString(1)); 1688 tbs.setcARRIERID(rs.getString(1));
1642 tbs.setsTOCKPRE(rs.getString(2)); 1689 tbs.setsTOCKPRE(rs.getString(2));
@@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{ @@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{
1646 tbs.setcARRYWAY(rs.getString(6)); 1693 tbs.setcARRYWAY(rs.getString(6));
1647 tbs.setoPERATIONTIME(rs.getString(7)); 1694 tbs.setoPERATIONTIME(rs.getString(7));
1648 tbs.setiSFOREIGN(rs.getString(8)); 1695 tbs.setiSFOREIGN(rs.getString(8));
1649 - //tbs.setfREQORDERING(rs.getInt(9));  
1650 - //tbs.setId(rs.getInt(9))); 1696 + // tbs.setfREQORDERING(rs.getInt(9));
  1697 + // tbs.setId(rs.getInt(9)));
1651 model.setData(tbs); 1698 model.setData(tbs);
1652 } 1699 }
1653 } catch (SQLException e) { 1700 } catch (SQLException e) {
@@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{ @@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{
1659 1706
1660 return model; 1707 return model;
1661 } 1708 }
  1709 +
1662 /** 1710 /**
1663 * 获取商品信息 1711 * 获取商品信息
  1712 + *
1664 * @param billId 1713 * @param billId
1665 * @return 1714 * @return
1666 */ 1715 */
1667 @ResponseBody 1716 @ResponseBody
1668 - @RequestMapping(value = "/commodity/get",method = RequestMethod.POST)  
1669 - public String getCommodity(Long billId){  
1670 - return JSON.toJSONString(commodityService.getCommodityVos(billId),filter); 1717 + @RequestMapping(value = "/commodity/get", method = RequestMethod.POST)
  1718 + public String getCommodity(Long billId) {
  1719 + return JSON.toJSONString(commodityService.getCommodityVos(billId), filter);
1671 } 1720 }
1672 1721
1673 -  
1674 /** 1722 /**
1675 * 编辑商品信息 1723 * 编辑商品信息
  1724 + *
1676 * @param id 1725 * @param id
1677 * @return 1726 * @return
1678 */ 1727 */
1679 @RequestMapping(value = "/commodity/edit") 1728 @RequestMapping(value = "/commodity/edit")
1680 - public String getContainer(Long id,Model model){ 1729 + public String getContainer(Long id, Model model) {
1681 CommodityVo vo = new CommodityVo(); 1730 CommodityVo vo = new CommodityVo();
1682 - model.addAttribute("vo",vo); 1731 + model.addAttribute("vo", vo);
1683 return "manifest/edit_commodity"; 1732 return "manifest/edit_commodity";
1684 } 1733 }
1685 1734
1686 -  
1687 -  
1688 /** 1735 /**
1689 * 删除 1736 * 删除
  1737 + *
1690 * @param ids 1738 * @param ids
1691 * @return 1739 * @return
1692 */ 1740 */
1693 - @RequestMapping(value = "/delete" , method = {RequestMethod.POST }) 1741 + @RequestMapping(value = "/delete", method = { RequestMethod.POST })
1694 @ResponseBody 1742 @ResponseBody
1695 public ResponseModel delete(String ids) { 1743 public ResponseModel delete(String ids) {
1696 ResponseModel model = new ResponseModel(); 1744 ResponseModel model = new ResponseModel();
@@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{ @@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{
1708 1756
1709 /** 1757 /**
1710 * 删除 1758 * 删除
  1759 + *
1711 * @param ids 1760 * @param ids
1712 * @return 1761 * @return
1713 */ 1762 */
1714 - @RequestMapping(value = "/subdelete" , method = {RequestMethod.POST }) 1763 + @RequestMapping(value = "/subdelete", method = { RequestMethod.POST })
1715 @ResponseBody 1764 @ResponseBody
1716 public ResponseModel subdelete(Long id) { 1765 public ResponseModel subdelete(Long id) {
1717 ResponseModel model = new ResponseModel(); 1766 ResponseModel model = new ResponseModel();
@@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{ @@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{
1727 return model; 1776 return model;
1728 } 1777 }
1729 1778
1730 -  
1731 -  
1732 /** 1779 /**
1733 * 删除 1780 * 删除
  1781 + *
1734 * @param id 1782 * @param id
1735 * @return 1783 * @return
1736 */ 1784 */
1737 - @RequestMapping(value = "/bill/delete" , method = {RequestMethod.POST }) 1785 + @RequestMapping(value = "/bill/delete", method = { RequestMethod.POST })
1738 @ResponseBody 1786 @ResponseBody
1739 public ResponseModel deleteBill(Long id) { 1787 public ResponseModel deleteBill(Long id) {
1740 ResponseModel model = new ResponseModel(); 1788 ResponseModel model = new ResponseModel();
@@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{ @@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{
1750 return model; 1798 return model;
1751 } 1799 }
1752 1800
1753 -  
1754 } 1801 }
@@ -4,8 +4,6 @@ import org.springframework.stereotype.Controller; @@ -4,8 +4,6 @@ import org.springframework.stereotype.Controller;
4 import org.springframework.web.bind.annotation.RequestMapping; 4 import org.springframework.web.bind.annotation.RequestMapping;
5 import org.springframework.web.bind.annotation.RequestMethod; 5 import org.springframework.web.bind.annotation.RequestMethod;
6 6
7 -import com.agent.imf.agent.IMFServletManifst;  
8 -  
9 @Controller 7 @Controller
10 public class LayoutController { 8 public class LayoutController {
11 9
@@ -20,7 +20,7 @@ public class Constant { @@ -20,7 +20,7 @@ public class Constant {
20 public final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 20 public final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
21 21
22 //日期格式化 22 //日期格式化
23 - public final static SimpleDateFormat dateTimeFormatnumber = new SimpleDateFormat("yyyyMMddHHmmss"); 23 + public final static SimpleDateFormat dateTimeFormatnumber = new SimpleDateFormat("yyyyMMddHHmmssSSS");
24 24
25 //包装尺寸类型 - 交运 25 //包装尺寸类型 - 交运
26 public final static String packageSizeDelivery = "DELIVERY"; 26 public final static String packageSizeDelivery = "DELIVERY";
@@ -13,7 +13,7 @@ import javax.persistence.Table; @@ -13,7 +13,7 @@ import javax.persistence.Table;
13 */ 13 */
14 @Entity 14 @Entity
15 @Table(name = "PUB_CONSIGNEE") 15 @Table(name = "PUB_CONSIGNEE")
16 -public class ConsigneeEntity extends BasicEntity{ 16 +public class ConsigneeEntity extends BasicEntity {
17 17
18 /** 18 /**
19 * 简称 19 * 简称
@@ -35,7 +35,6 @@ public class ConsigneeEntity extends BasicEntity{ @@ -35,7 +35,6 @@ public class ConsigneeEntity extends BasicEntity{
35 */ 35 */
36 private String tel; 36 private String tel;
37 37
38 -  
39 @Column(name = "CODE") 38 @Column(name = "CODE")
40 public String getCode() { 39 public String getCode() {
41 return code; 40 return code;
@@ -44,6 +43,7 @@ public class ConsigneeEntity extends BasicEntity{ @@ -44,6 +43,7 @@ public class ConsigneeEntity extends BasicEntity{
44 public void setCode(String code) { 43 public void setCode(String code) {
45 this.code = code; 44 this.code = code;
46 } 45 }
  46 +
47 @Column(name = "NAME") 47 @Column(name = "NAME")
48 public String getName() { 48 public String getName() {
49 return name; 49 return name;
@@ -52,6 +52,7 @@ public class ConsigneeEntity extends BasicEntity{ @@ -52,6 +52,7 @@ public class ConsigneeEntity extends BasicEntity{
52 public void setName(String name) { 52 public void setName(String name) {
53 this.name = name; 53 this.name = name;
54 } 54 }
  55 +
55 @Column(name = "ADDRESS") 56 @Column(name = "ADDRESS")
56 public String getAddress() { 57 public String getAddress() {
57 return address; 58 return address;
@@ -60,6 +61,7 @@ public class ConsigneeEntity extends BasicEntity{ @@ -60,6 +61,7 @@ public class ConsigneeEntity extends BasicEntity{
60 public void setAddress(String address) { 61 public void setAddress(String address) {
61 this.address = address; 62 this.address = address;
62 } 63 }
  64 +
63 @Column(name = "TEL") 65 @Column(name = "TEL")
64 public String getTel() { 66 public String getTel() {
65 return tel; 67 return tel;
@@ -2,91 +2,111 @@ package com.agent.entity.agent; @@ -2,91 +2,111 @@ package com.agent.entity.agent;
2 2
3 public class ConsigneeInfo { 3 public class ConsigneeInfo {
4 private String id; 4 private String id;
5 - private String sh_company; //公司  
6 - private String sh_address; //地址  
7 - private String sh_zipcode; //邮编  
8 - private String city; //城市  
9 - private String deltaname; //州名  
10 - private String country; //国家代码  
11 - private String telephone; //电话  
12 - private String sh_fax; //传真  
13 - private String sh_name; //收货人姓名  
14 -  
15 - private String sh_provincename; //身份名称  
16 - private String sh_provincecode; //身份代码  
17 -  
18 - 5 + private String sh_company; // 公司
  6 + private String sh_address; // 地址
  7 + private String sh_zipcode; // 邮编
  8 + private String city; // 城市
  9 + private String deltaname; // 州名
  10 + private String country; // 国家代码
  11 + private String telephone; // 电话
  12 + private String sh_fax; // 传真
  13 + private String sh_name; // 收货人姓名
19 14
  15 + private String sh_provincename; // 省份名称
  16 + private String sh_provincecode; // 省份代码
20 17
21 public String getId() { 18 public String getId() {
22 return id; 19 return id;
23 } 20 }
  21 +
24 public void setId(String id) { 22 public void setId(String id) {
25 this.id = id; 23 this.id = id;
26 } 24 }
  25 +
27 public String getSh_company() { 26 public String getSh_company() {
28 return sh_company; 27 return sh_company;
29 } 28 }
  29 +
30 public void setSh_company(String sh_company) { 30 public void setSh_company(String sh_company) {
31 this.sh_company = sh_company; 31 this.sh_company = sh_company;
32 } 32 }
  33 +
33 public String getSh_address() { 34 public String getSh_address() {
34 return sh_address; 35 return sh_address;
35 } 36 }
  37 +
36 public void setSh_address(String sh_address) { 38 public void setSh_address(String sh_address) {
37 this.sh_address = sh_address; 39 this.sh_address = sh_address;
38 } 40 }
  41 +
39 public String getSh_zipcode() { 42 public String getSh_zipcode() {
40 return sh_zipcode; 43 return sh_zipcode;
41 } 44 }
  45 +
42 public void setSh_zipcode(String sh_zipcode) { 46 public void setSh_zipcode(String sh_zipcode) {
43 this.sh_zipcode = sh_zipcode; 47 this.sh_zipcode = sh_zipcode;
44 } 48 }
  49 +
45 public String getCity() { 50 public String getCity() {
46 return city; 51 return city;
47 } 52 }
  53 +
48 public void setCity(String city) { 54 public void setCity(String city) {
49 this.city = city; 55 this.city = city;
50 } 56 }
  57 +
51 public String getDeltaname() { 58 public String getDeltaname() {
52 return deltaname; 59 return deltaname;
53 } 60 }
  61 +
54 public void setDeltaname(String deltaname) { 62 public void setDeltaname(String deltaname) {
55 this.deltaname = deltaname; 63 this.deltaname = deltaname;
56 } 64 }
  65 +
57 public String getCountry() { 66 public String getCountry() {
58 return country; 67 return country;
59 } 68 }
  69 +
60 public void setCountry(String country) { 70 public void setCountry(String country) {
61 this.country = country; 71 this.country = country;
62 } 72 }
  73 +
63 public String getTelephone() { 74 public String getTelephone() {
64 return telephone; 75 return telephone;
65 } 76 }
  77 +
66 public void setTelephone(String telephone) { 78 public void setTelephone(String telephone) {
67 this.telephone = telephone; 79 this.telephone = telephone;
68 } 80 }
  81 +
69 public String getSh_fax() { 82 public String getSh_fax() {
70 return sh_fax; 83 return sh_fax;
71 } 84 }
  85 +
72 public void setSh_fax(String sh_fax) { 86 public void setSh_fax(String sh_fax) {
73 this.sh_fax = sh_fax; 87 this.sh_fax = sh_fax;
74 } 88 }
  89 +
75 public String getSh_name() { 90 public String getSh_name() {
76 return sh_name; 91 return sh_name;
77 } 92 }
  93 +
78 public void setSh_name(String sh_name) { 94 public void setSh_name(String sh_name) {
79 this.sh_name = sh_name; 95 this.sh_name = sh_name;
80 } 96 }
  97 +
81 public String getSh_provincename() { 98 public String getSh_provincename() {
82 return sh_provincename; 99 return sh_provincename;
83 } 100 }
  101 +
84 public void setSh_provincename(String sh_provincename) { 102 public void setSh_provincename(String sh_provincename) {
85 this.sh_provincename = sh_provincename; 103 this.sh_provincename = sh_provincename;
86 } 104 }
  105 +
87 public String getSh_provincecode() { 106 public String getSh_provincecode() {
88 return sh_provincecode; 107 return sh_provincecode;
89 } 108 }
  109 +
90 public void setSh_provincecode(String sh_provincecode) { 110 public void setSh_provincecode(String sh_provincecode) {
91 this.sh_provincecode = sh_provincecode; 111 this.sh_provincecode = sh_provincecode;
92 } 112 }
  1 +package com.agent.entity.agent;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.Table;
  5 +
  6 +import com.agent.entity.BasicEntity;
  7 +
  8 +/**
  9 + *
  10 + * Depiction: 发货人表
  11 + * <p>
  12 + * Modify:
  13 + * <p>
  14 + * Author: William Lynn
  15 + * <p>
  16 + * Create Date:2018年5月28日 下午2:05:28
  17 + *
  18 + */
  19 +@Entity
  20 +@Table(name = "CONSIGNOR")
  21 +public class ConsignorEntity extends BasicEntity {
  22 + private String shpcusid;// 发货人代码
  23 + /**
  24 + * 发货人aeo
  25 + */
  26 + private String shpaeo;
  27 + /**
  28 + * 发货人公司
  29 + */
  30 + private String co_company;
  31 + /**
  32 + * 发货人地址
  33 + */
  34 + private String co_address;
  35 + /**
  36 + * 发货人邮编
  37 + */
  38 + private String co_zipcode;
  39 + /**
  40 + * 发货人城市
  41 + */
  42 + private String co_city;
  43 + /**
  44 + * 发货人洲名
  45 + */
  46 + private String co_deltaname;
  47 + /**
  48 + * 发货人国家名字
  49 + */
  50 + private String co_country;
  51 + /**
  52 + * 发货人电话
  53 + */
  54 + private String co_telephone;
  55 + /**
  56 + * 发货人传真
  57 + */
  58 + private String co_fax;
  59 + /**
  60 + * 发货人名字
  61 + */
  62 + private String co_name;
  63 +
  64 + private String co_provincecode;
  65 +
  66 + public String getCo_company() {
  67 + return co_company;
  68 + }
  69 +
  70 + public void setCo_company(String co_company) {
  71 + this.co_company = co_company;
  72 + }
  73 +
  74 + public String getCo_address() {
  75 + return co_address;
  76 + }
  77 +
  78 + public void setCo_address(String co_address) {
  79 + this.co_address = co_address;
  80 + }
  81 +
  82 + public String getCo_zipcode() {
  83 + return co_zipcode;
  84 + }
  85 +
  86 + public void setCo_zipcode(String co_zipcode) {
  87 + this.co_zipcode = co_zipcode;
  88 + }
  89 +
  90 + public String getCo_city() {
  91 + return co_city;
  92 + }
  93 +
  94 + public void setCo_city(String co_city) {
  95 + this.co_city = co_city;
  96 + }
  97 +
  98 + public String getCo_deltaname() {
  99 + return co_deltaname;
  100 + }
  101 +
  102 + public void setCo_deltaname(String co_deltaname) {
  103 + this.co_deltaname = co_deltaname;
  104 + }
  105 +
  106 + public String getCo_country() {
  107 + return co_country;
  108 + }
  109 +
  110 + public void setCo_country(String co_country) {
  111 + this.co_country = co_country;
  112 + }
  113 +
  114 + public String getCo_telephone() {
  115 + return co_telephone;
  116 + }
  117 +
  118 + public void setCo_telephone(String co_telephone) {
  119 + this.co_telephone = co_telephone;
  120 + }
  121 +
  122 + public String getCo_fax() {
  123 + return co_fax;
  124 + }
  125 +
  126 + public void setCo_fax(String co_fax) {
  127 + this.co_fax = co_fax;
  128 + }
  129 +
  130 + public String getCo_name() {
  131 + return co_name;
  132 + }
  133 +
  134 + public void setCo_name(String co_name) {
  135 + this.co_name = co_name;
  136 + }
  137 +
  138 + public String getShpcusid() {
  139 + return shpcusid;
  140 + }
  141 +
  142 + public void setShpcusid(String shpcusid) {
  143 + this.shpcusid = shpcusid;
  144 + }
  145 +
  146 + public String getShpaeo() {
  147 + return shpaeo;
  148 + }
  149 +
  150 + public void setShpaeo(String shpaeo) {
  151 + this.shpaeo = shpaeo;
  152 + }
  153 +
  154 + public String getCo_provincecode() {
  155 + return co_provincecode;
  156 + }
  157 +
  158 + public void setCo_provincecode(String co_provincecode) {
  159 + this.co_provincecode = co_provincecode;
  160 + }
  161 +
  162 + // 该函数主要用于List的contains
  163 + public boolean equals(Object mme) {
  164 + if (mme != null) {
  165 + ConsignorEntity me = (ConsignorEntity) mme;
  166 + if (me.getCo_company().equalsIgnoreCase(this.getCo_company())) {
  167 + return true;
  168 + }
  169 + }
  170 +
  171 + return false;
  172 + }
  173 +}
@@ -228,10 +228,8 @@ @@ -228,10 +228,8 @@
228 // } 228 // }
229 //} 229 //}
230 230
231 -  
232 package com.agent.entity.agent; 231 package com.agent.entity.agent;
233 232
234 -  
235 import java.text.ParseException; 233 import java.text.ParseException;
236 import java.text.SimpleDateFormat; 234 import java.text.SimpleDateFormat;
237 import java.util.Date; 235 import java.util.Date;
@@ -249,7 +247,18 @@ import com.agent.entity.BasicEntity; @@ -249,7 +247,18 @@ import com.agent.entity.BasicEntity;
249 */ 247 */
250 @Entity 248 @Entity
251 @Table(name = "MANIFEST") 249 @Table(name = "MANIFEST")
252 -public class ManifestEntity extends BasicEntity{ 250 +public class ManifestEntity extends BasicEntity {
  251 + private String unlodingcode;// 卸货地代码
  252 + private String cnecusid;// 收货人代码
  253 + private String shpcusid;// 发货人代码
  254 + /**
  255 + * 发货人aeo
  256 + */
  257 + private String shpaeo;
  258 + /**
  259 + * 收货人aeo
  260 + */
  261 + private String cneaeo;
253 /** 262 /**
254 * 航班号 263 * 航班号
255 */ 264 */
@@ -503,49 +512,97 @@ public class ManifestEntity extends BasicEntity{ @@ -503,49 +512,97 @@ public class ManifestEntity extends BasicEntity{
503 */ 512 */
504 private String response_text; 513 private String response_text;
505 private Long save_time; 514 private Long save_time;
506 - private Long USER_ID; //报文所属的用户id 515 + private Long USER_ID; // 报文所属的用户id
507 516
  517 + public String getUnlodingcode() {
  518 + return unlodingcode;
  519 + }
508 520
  521 + public void setUnlodingcode(String unlodingcode) {
  522 + this.unlodingcode = unlodingcode;
  523 + }
  524 +
  525 + public String getCnecusid() {
  526 + return cnecusid;
  527 + }
509 528
  529 + public void setCnecusid(String cnecusid) {
  530 + this.cnecusid = cnecusid;
  531 + }
  532 +
  533 + public String getShpcusid() {
  534 + return shpcusid;
  535 + }
  536 +
  537 + public void setShpcusid(String shpcusid) {
  538 + this.shpcusid = shpcusid;
  539 + }
  540 +
  541 + public String getShpaeo() {
  542 + return shpaeo;
  543 + }
  544 +
  545 + public void setShpaeo(String shpaeo) {
  546 + this.shpaeo = shpaeo;
  547 + }
  548 +
  549 + public String getCneaeo() {
  550 + return cneaeo;
  551 + }
  552 +
  553 + public void setCneaeo(String cneaeo) {
  554 + this.cneaeo = cneaeo;
  555 + }
510 556
511 public Long getUSER_ID() { 557 public Long getUSER_ID() {
512 return USER_ID; 558 return USER_ID;
513 } 559 }
  560 +
514 public void setUSER_ID(Long uSER_ID) { 561 public void setUSER_ID(Long uSER_ID) {
515 USER_ID = uSER_ID; 562 USER_ID = uSER_ID;
516 } 563 }
  564 +
517 @Column(name = "SAVE_TIME") 565 @Column(name = "SAVE_TIME")
518 public Long getSave_time() { 566 public Long getSave_time() {
519 return save_time; 567 return save_time;
520 } 568 }
  569 +
521 public void setSave_time(Long save_time) { 570 public void setSave_time(Long save_time) {
522 this.save_time = save_time; 571 this.save_time = save_time;
523 } 572 }
  573 +
524 @Column(name = "RESPONSE_CODE") 574 @Column(name = "RESPONSE_CODE")
525 public String getResponse_code() { 575 public String getResponse_code() {
526 return response_code; 576 return response_code;
527 } 577 }
  578 +
528 public void setResponse_code(String response_code) { 579 public void setResponse_code(String response_code) {
529 this.response_code = response_code; 580 this.response_code = response_code;
530 } 581 }
  582 +
531 @Column(name = "RESPONSE_TEXT") 583 @Column(name = "RESPONSE_TEXT")
532 public String getResponse_text() { 584 public String getResponse_text() {
533 return response_text; 585 return response_text;
534 } 586 }
  587 +
535 public void setResponse_text(String response_text) { 588 public void setResponse_text(String response_text) {
536 this.response_text = response_text; 589 this.response_text = response_text;
537 } 590 }
  591 +
538 @Column(name = "DE_IDS") 592 @Column(name = "DE_IDS")
539 public Integer getDe_ids() { 593 public Integer getDe_ids() {
540 return de_ids; 594 return de_ids;
541 } 595 }
  596 +
542 public void setDe_ids(Integer de_ids) { 597 public void setDe_ids(Integer de_ids) {
543 this.de_ids = de_ids; 598 this.de_ids = de_ids;
544 } 599 }
  600 +
545 @Column(name = "DE_NUMBER") 601 @Column(name = "DE_NUMBER")
546 public String getDe_number() { 602 public String getDe_number() {
547 return de_number; 603 return de_number;
548 } 604 }
  605 +
549 public void setDe_number(String de_number) { 606 public void setDe_number(String de_number) {
550 this.de_number = de_number; 607 this.de_number = de_number;
551 } 608 }
@@ -554,6 +611,7 @@ public class ManifestEntity extends BasicEntity{ @@ -554,6 +611,7 @@ public class ManifestEntity extends BasicEntity{
554 public String getDe_weight() { 611 public String getDe_weight() {
555 return de_weight; 612 return de_weight;
556 } 613 }
  614 +
557 public void setDe_weight(String de_weight) { 615 public void setDe_weight(String de_weight) {
558 this.de_weight = de_weight; 616 this.de_weight = de_weight;
559 } 617 }
@@ -562,6 +620,7 @@ public class ManifestEntity extends BasicEntity{ @@ -562,6 +620,7 @@ public class ManifestEntity extends BasicEntity{
562 public String getDe_chweight() { 620 public String getDe_chweight() {
563 return de_chweight; 621 return de_chweight;
564 } 622 }
  623 +
565 public void setDe_chweight(String de_chweight) { 624 public void setDe_chweight(String de_chweight) {
566 this.de_chweight = de_chweight; 625 this.de_chweight = de_chweight;
567 } 626 }
@@ -570,6 +629,7 @@ public class ManifestEntity extends BasicEntity{ @@ -570,6 +629,7 @@ public class ManifestEntity extends BasicEntity{
570 public String getDe_size() { 629 public String getDe_size() {
571 return de_size; 630 return de_size;
572 } 631 }
  632 +
573 public void setDe_size(String de_size) { 633 public void setDe_size(String de_size) {
574 this.de_size = de_size; 634 this.de_size = de_size;
575 } 635 }
@@ -578,6 +638,7 @@ public class ManifestEntity extends BasicEntity{ @@ -578,6 +638,7 @@ public class ManifestEntity extends BasicEntity{
578 public String getDe_volume() { 638 public String getDe_volume() {
579 return de_volume; 639 return de_volume;
580 } 640 }
  641 +
581 public void setDe_volume(String de_volume) { 642 public void setDe_volume(String de_volume) {
582 this.de_volume = de_volume; 643 this.de_volume = de_volume;
583 } 644 }
@@ -586,6 +647,7 @@ public class ManifestEntity extends BasicEntity{ @@ -586,6 +647,7 @@ public class ManifestEntity extends BasicEntity{
586 public String getDe_type() { 647 public String getDe_type() {
587 return de_type; 648 return de_type;
588 } 649 }
  650 +
589 public void setDe_type(String de_type) { 651 public void setDe_type(String de_type) {
590 this.de_type = de_type; 652 this.de_type = de_type;
591 } 653 }
@@ -594,6 +656,7 @@ public class ManifestEntity extends BasicEntity{ @@ -594,6 +656,7 @@ public class ManifestEntity extends BasicEntity{
594 public String getDe_trstation() { 656 public String getDe_trstation() {
595 return de_trstation; 657 return de_trstation;
596 } 658 }
  659 +
597 public void setDe_trstation(String de_trstation) { 660 public void setDe_trstation(String de_trstation) {
598 this.de_trstation = de_trstation; 661 this.de_trstation = de_trstation;
599 } 662 }
@@ -602,6 +665,7 @@ public class ManifestEntity extends BasicEntity{ @@ -602,6 +665,7 @@ public class ManifestEntity extends BasicEntity{
602 public String getDe_packing() { 665 public String getDe_packing() {
603 return de_packing; 666 return de_packing;
604 } 667 }
  668 +
605 public void setDe_packing(String de_packing) { 669 public void setDe_packing(String de_packing) {
606 this.de_packing = de_packing; 670 this.de_packing = de_packing;
607 } 671 }
@@ -610,27 +674,34 @@ public class ManifestEntity extends BasicEntity{ @@ -610,27 +674,34 @@ public class ManifestEntity extends BasicEntity{
610 public String getDe_remarks() { 674 public String getDe_remarks() {
611 return de_remarks; 675 return de_remarks;
612 } 676 }
  677 +
613 public void setDe_remarks(String de_remarks) { 678 public void setDe_remarks(String de_remarks) {
614 this.de_remarks = de_remarks; 679 this.de_remarks = de_remarks;
615 } 680 }
  681 +
616 @Column(name = "SH_PROVINCECODE") 682 @Column(name = "SH_PROVINCECODE")
617 public String getSh_provincecode() { 683 public String getSh_provincecode() {
618 return sh_provincecode; 684 return sh_provincecode;
619 } 685 }
  686 +
620 public void setSh_provincecode(String sh_provincecode) { 687 public void setSh_provincecode(String sh_provincecode) {
621 this.sh_provincecode = sh_provincecode; 688 this.sh_provincecode = sh_provincecode;
622 } 689 }
  690 +
623 @Column(name = "SH_PROVINCENAME") 691 @Column(name = "SH_PROVINCENAME")
624 public String getSh_provincename() { 692 public String getSh_provincename() {
625 return sh_provincename; 693 return sh_provincename;
626 } 694 }
  695 +
627 public void setSh_provincename(String sh_provincename) { 696 public void setSh_provincename(String sh_provincename) {
628 this.sh_provincename = sh_provincename; 697 this.sh_provincename = sh_provincename;
629 } 698 }
  699 +
630 @Column(name = "FLIGHTNO") 700 @Column(name = "FLIGHTNO")
631 public String getFlightno() { 701 public String getFlightno() {
632 return flightno; 702 return flightno;
633 } 703 }
  704 +
634 public void setFlightno(String flightno) { 705 public void setFlightno(String flightno) {
635 this.flightno = flightno; 706 this.flightno = flightno;
636 } 707 }
@@ -639,6 +710,7 @@ public class ManifestEntity extends BasicEntity{ @@ -639,6 +710,7 @@ public class ManifestEntity extends BasicEntity{
639 public Date getFlightdate() { 710 public Date getFlightdate() {
640 return flightdate; 711 return flightdate;
641 } 712 }
  713 +
642 public void setFlightdate(Date flightdate) { 714 public void setFlightdate(Date flightdate) {
643 this.flightdate = flightdate; 715 this.flightdate = flightdate;
644 } 716 }
@@ -647,6 +719,7 @@ public class ManifestEntity extends BasicEntity{ @@ -647,6 +719,7 @@ public class ManifestEntity extends BasicEntity{
647 public String getOriginatingstation() { 719 public String getOriginatingstation() {
648 return originatingstation; 720 return originatingstation;
649 } 721 }
  722 +
650 public void setOriginatingstation(String originatingstation) { 723 public void setOriginatingstation(String originatingstation) {
651 this.originatingstation = originatingstation; 724 this.originatingstation = originatingstation;
652 } 725 }
@@ -655,6 +728,7 @@ public class ManifestEntity extends BasicEntity{ @@ -655,6 +728,7 @@ public class ManifestEntity extends BasicEntity{
655 public String getDestinationstation() { 728 public String getDestinationstation() {
656 return destinationstation; 729 return destinationstation;
657 } 730 }
  731 +
658 public void setDestinationstation(String destinationstation) { 732 public void setDestinationstation(String destinationstation) {
659 this.destinationstation = destinationstation; 733 this.destinationstation = destinationstation;
660 } 734 }
@@ -663,6 +737,7 @@ public class ManifestEntity extends BasicEntity{ @@ -663,6 +737,7 @@ public class ManifestEntity extends BasicEntity{
663 public String getWaybillnomaster() { 737 public String getWaybillnomaster() {
664 return waybillnomaster; 738 return waybillnomaster;
665 } 739 }
  740 +
666 public void setWaybillnomaster(String waybillnomaster) { 741 public void setWaybillnomaster(String waybillnomaster) {
667 this.waybillnomaster = waybillnomaster; 742 this.waybillnomaster = waybillnomaster;
668 } 743 }
@@ -671,6 +746,7 @@ public class ManifestEntity extends BasicEntity{ @@ -671,6 +746,7 @@ public class ManifestEntity extends BasicEntity{
671 public String getTotalweight() { 746 public String getTotalweight() {
672 return totalweight; 747 return totalweight;
673 } 748 }
  749 +
674 public void setTotalweight(String totalweight) { 750 public void setTotalweight(String totalweight) {
675 this.totalweight = totalweight; 751 this.totalweight = totalweight;
676 } 752 }
@@ -679,6 +755,7 @@ public class ManifestEntity extends BasicEntity{ @@ -679,6 +755,7 @@ public class ManifestEntity extends BasicEntity{
679 public String getTotalpiece() { 755 public String getTotalpiece() {
680 return totalpiece; 756 return totalpiece;
681 } 757 }
  758 +
682 public void setTotalpiece(String totalpiece) { 759 public void setTotalpiece(String totalpiece) {
683 this.totalpiece = totalpiece; 760 this.totalpiece = totalpiece;
684 } 761 }
@@ -687,6 +764,7 @@ public class ManifestEntity extends BasicEntity{ @@ -687,6 +764,7 @@ public class ManifestEntity extends BasicEntity{
687 public String getPreparetotalpiece() { 764 public String getPreparetotalpiece() {
688 return preparetotalpiece; 765 return preparetotalpiece;
689 } 766 }
  767 +
690 public void setPreparetotalpiece(String preparetotalpiece) { 768 public void setPreparetotalpiece(String preparetotalpiece) {
691 this.preparetotalpiece = preparetotalpiece; 769 this.preparetotalpiece = preparetotalpiece;
692 } 770 }
@@ -695,6 +773,7 @@ public class ManifestEntity extends BasicEntity{ @@ -695,6 +773,7 @@ public class ManifestEntity extends BasicEntity{
695 public String getPreparetotalweight() { 773 public String getPreparetotalweight() {
696 return preparetotalweight; 774 return preparetotalweight;
697 } 775 }
  776 +
698 public void setPreparetotalweight(String preparetotalweight) { 777 public void setPreparetotalweight(String preparetotalweight) {
699 this.preparetotalweight = preparetotalweight; 778 this.preparetotalweight = preparetotalweight;
700 } 779 }
@@ -703,6 +782,7 @@ public class ManifestEntity extends BasicEntity{ @@ -703,6 +782,7 @@ public class ManifestEntity extends BasicEntity{
703 public String getAgentcompanycode() { 782 public String getAgentcompanycode() {
704 return agentcompanycode; 783 return agentcompanycode;
705 } 784 }
  785 +
706 public void setAgentcompanycode(String agentcompanycode) { 786 public void setAgentcompanycode(String agentcompanycode) {
707 this.agentcompanycode = agentcompanycode; 787 this.agentcompanycode = agentcompanycode;
708 } 788 }
@@ -711,17 +791,19 @@ public class ManifestEntity extends BasicEntity{ @@ -711,17 +791,19 @@ public class ManifestEntity extends BasicEntity{
711 public Date getStowagedate() { 791 public Date getStowagedate() {
712 return stowagedate; 792 return stowagedate;
713 } 793 }
  794 +
714 public void setStowagedate(Date stowagedate) { 795 public void setStowagedate(Date stowagedate) {
715 - //System.out.println(stowagedate); 796 + // System.out.println(stowagedate);
716 797
717 this.stowagedate = stowagedate; 798 this.stowagedate = stowagedate;
718 - //this.stowagedate = new Date(); 799 + // this.stowagedate = new Date();
719 } 800 }
720 - public static Date getStowagedate(String datestr){  
721 - if(datestr == null) 801 +
  802 + public static Date getStowagedate(String datestr) {
  803 + if (datestr == null)
722 return null; 804 return null;
723 String strFormat = "yyyyMMddHHmmss"; 805 String strFormat = "yyyyMMddHHmmss";
724 - if(datestr.indexOf(":") < 0){ 806 + if (datestr.indexOf(":") < 0) {
725 strFormat = "yyyy-MM-dd"; 807 strFormat = "yyyy-MM-dd";
726 } 808 }
727 SimpleDateFormat sdf = new SimpleDateFormat(strFormat); 809 SimpleDateFormat sdf = new SimpleDateFormat(strFormat);
@@ -738,6 +820,7 @@ public class ManifestEntity extends BasicEntity{ @@ -738,6 +820,7 @@ public class ManifestEntity extends BasicEntity{
738 public Integer getStatus() { 820 public Integer getStatus() {
739 return status; 821 return status;
740 } 822 }
  823 +
741 public void setStatus(Integer status) { 824 public void setStatus(Integer status) {
742 this.status = status; 825 this.status = status;
743 } 826 }
@@ -746,6 +829,7 @@ public class ManifestEntity extends BasicEntity{ @@ -746,6 +829,7 @@ public class ManifestEntity extends BasicEntity{
746 public String getCarrier() { 829 public String getCarrier() {
747 return carrier; 830 return carrier;
748 } 831 }
  832 +
749 public void setCarrier(String carrier) { 833 public void setCarrier(String carrier) {
750 this.carrier = carrier; 834 this.carrier = carrier;
751 } 835 }
@@ -754,6 +838,7 @@ public class ManifestEntity extends BasicEntity{ @@ -754,6 +838,7 @@ public class ManifestEntity extends BasicEntity{
754 public String getCustomsstatus() { 838 public String getCustomsstatus() {
755 return customsstatus; 839 return customsstatus;
756 } 840 }
  841 +
757 public void setCustomsstatus(String customsstatus) { 842 public void setCustomsstatus(String customsstatus) {
758 this.customsstatus = customsstatus; 843 this.customsstatus = customsstatus;
759 } 844 }
@@ -762,6 +847,7 @@ public class ManifestEntity extends BasicEntity{ @@ -762,6 +847,7 @@ public class ManifestEntity extends BasicEntity{
762 public String getPaymode() { 847 public String getPaymode() {
763 return paymode; 848 return paymode;
764 } 849 }
  850 +
765 public void setPaymode(String paymode) { 851 public void setPaymode(String paymode) {
766 this.paymode = paymode; 852 this.paymode = paymode;
767 } 853 }
@@ -770,6 +856,7 @@ public class ManifestEntity extends BasicEntity{ @@ -770,6 +856,7 @@ public class ManifestEntity extends BasicEntity{
770 public String getSpecialgoodscode() { 856 public String getSpecialgoodscode() {
771 return specialgoodscode; 857 return specialgoodscode;
772 } 858 }
  859 +
773 public void setSpecialgoodscode(String specialgoodscode) { 860 public void setSpecialgoodscode(String specialgoodscode) {
774 this.specialgoodscode = specialgoodscode; 861 this.specialgoodscode = specialgoodscode;
775 } 862 }
@@ -778,6 +865,7 @@ public class ManifestEntity extends BasicEntity{ @@ -778,6 +865,7 @@ public class ManifestEntity extends BasicEntity{
778 public String getCustomscode() { 865 public String getCustomscode() {
779 return customscode; 866 return customscode;
780 } 867 }
  868 +
781 public void setCustomscode(String customscode) { 869 public void setCustomscode(String customscode) {
782 this.customscode = customscode; 870 this.customscode = customscode;
783 } 871 }
@@ -786,6 +874,7 @@ public class ManifestEntity extends BasicEntity{ @@ -786,6 +874,7 @@ public class ManifestEntity extends BasicEntity{
786 public String getAgentman() { 874 public String getAgentman() {
787 return agentman; 875 return agentman;
788 } 876 }
  877 +
789 public void setAgentman(String agentman) { 878 public void setAgentman(String agentman) {
790 this.agentman = agentman; 879 this.agentman = agentman;
791 } 880 }
@@ -794,6 +883,7 @@ public class ManifestEntity extends BasicEntity{ @@ -794,6 +883,7 @@ public class ManifestEntity extends BasicEntity{
794 public String getAgentcompany() { 883 public String getAgentcompany() {
795 return agentcompany; 884 return agentcompany;
796 } 885 }
  886 +
797 public void setAgentcompany(String agentcompany) { 887 public void setAgentcompany(String agentcompany) {
798 this.agentcompany = agentcompany; 888 this.agentcompany = agentcompany;
799 } 889 }
@@ -802,6 +892,7 @@ public class ManifestEntity extends BasicEntity{ @@ -802,6 +892,7 @@ public class ManifestEntity extends BasicEntity{
802 public String getReceiptinformation() { 892 public String getReceiptinformation() {
803 return receiptinformation; 893 return receiptinformation;
804 } 894 }
  895 +
805 public void setReceiptinformation(String receiptinformation) { 896 public void setReceiptinformation(String receiptinformation) {
806 this.receiptinformation = receiptinformation; 897 this.receiptinformation = receiptinformation;
807 } 898 }
@@ -810,6 +901,7 @@ public class ManifestEntity extends BasicEntity{ @@ -810,6 +901,7 @@ public class ManifestEntity extends BasicEntity{
810 public Date getCreatedate() { 901 public Date getCreatedate() {
811 return createdate; 902 return createdate;
812 } 903 }
  904 +
813 public void setCreatedate(Date createdate) { 905 public void setCreatedate(Date createdate) {
814 this.createdate = createdate; 906 this.createdate = createdate;
815 } 907 }
@@ -818,13 +910,16 @@ public class ManifestEntity extends BasicEntity{ @@ -818,13 +910,16 @@ public class ManifestEntity extends BasicEntity{
818 public String getProductname() { 910 public String getProductname() {
819 return productname; 911 return productname;
820 } 912 }
  913 +
821 public void setProductname(String productname) { 914 public void setProductname(String productname) {
822 this.productname = productname; 915 this.productname = productname;
823 } 916 }
  917 +
824 @Column(name = "UNNUMBER") 918 @Column(name = "UNNUMBER")
825 public String getUnnumber() { 919 public String getUnnumber() {
826 return unnumber; 920 return unnumber;
827 } 921 }
  922 +
828 public void setUnnumber(String unnumber) { 923 public void setUnnumber(String unnumber) {
829 this.unnumber = unnumber; 924 this.unnumber = unnumber;
830 } 925 }
@@ -833,6 +928,7 @@ public class ManifestEntity extends BasicEntity{ @@ -833,6 +928,7 @@ public class ManifestEntity extends BasicEntity{
833 public String getCategory() { 928 public String getCategory() {
834 return category; 929 return category;
835 } 930 }
  931 +
836 public void setCategory(String category) { 932 public void setCategory(String category) {
837 this.category = category; 933 this.category = category;
838 } 934 }
@@ -841,6 +937,7 @@ public class ManifestEntity extends BasicEntity{ @@ -841,6 +937,7 @@ public class ManifestEntity extends BasicEntity{
841 public String getSh_company() { 937 public String getSh_company() {
842 return sh_company; 938 return sh_company;
843 } 939 }
  940 +
844 public void setSh_company(String sh_company) { 941 public void setSh_company(String sh_company) {
845 this.sh_company = sh_company; 942 this.sh_company = sh_company;
846 } 943 }
@@ -849,6 +946,7 @@ public class ManifestEntity extends BasicEntity{ @@ -849,6 +946,7 @@ public class ManifestEntity extends BasicEntity{
849 public String getSh_address() { 946 public String getSh_address() {
850 return sh_address; 947 return sh_address;
851 } 948 }
  949 +
852 public void setSh_address(String sh_address) { 950 public void setSh_address(String sh_address) {
853 this.sh_address = sh_address; 951 this.sh_address = sh_address;
854 } 952 }
@@ -857,6 +955,7 @@ public class ManifestEntity extends BasicEntity{ @@ -857,6 +955,7 @@ public class ManifestEntity extends BasicEntity{
857 public String getSh_zipcode() { 955 public String getSh_zipcode() {
858 return sh_zipcode; 956 return sh_zipcode;
859 } 957 }
  958 +
860 public void setSh_zipcode(String sh_zipcode) { 959 public void setSh_zipcode(String sh_zipcode) {
861 this.sh_zipcode = sh_zipcode; 960 this.sh_zipcode = sh_zipcode;
862 } 961 }
@@ -865,6 +964,7 @@ public class ManifestEntity extends BasicEntity{ @@ -865,6 +964,7 @@ public class ManifestEntity extends BasicEntity{
865 public String getSh_city() { 964 public String getSh_city() {
866 return sh_city; 965 return sh_city;
867 } 966 }
  967 +
868 public void setSh_city(String sh_city) { 968 public void setSh_city(String sh_city) {
869 this.sh_city = sh_city; 969 this.sh_city = sh_city;
870 } 970 }
@@ -873,6 +973,7 @@ public class ManifestEntity extends BasicEntity{ @@ -873,6 +973,7 @@ public class ManifestEntity extends BasicEntity{
873 public String getSh_deltaname() { 973 public String getSh_deltaname() {
874 return sh_deltaname; 974 return sh_deltaname;
875 } 975 }
  976 +
876 public void setSh_deltaname(String sh_deltaname) { 977 public void setSh_deltaname(String sh_deltaname) {
877 this.sh_deltaname = sh_deltaname; 978 this.sh_deltaname = sh_deltaname;
878 } 979 }
@@ -881,6 +982,7 @@ public class ManifestEntity extends BasicEntity{ @@ -881,6 +982,7 @@ public class ManifestEntity extends BasicEntity{
881 public String getSh_country() { 982 public String getSh_country() {
882 return sh_country; 983 return sh_country;
883 } 984 }
  985 +
884 public void setSh_country(String sh_country) { 986 public void setSh_country(String sh_country) {
885 this.sh_country = sh_country; 987 this.sh_country = sh_country;
886 } 988 }
@@ -889,6 +991,7 @@ public class ManifestEntity extends BasicEntity{ @@ -889,6 +991,7 @@ public class ManifestEntity extends BasicEntity{
889 public String getSh_telephone() { 991 public String getSh_telephone() {
890 return sh_telephone; 992 return sh_telephone;
891 } 993 }
  994 +
892 public void setSh_telephone(String sh_telephone) { 995 public void setSh_telephone(String sh_telephone) {
893 this.sh_telephone = sh_telephone; 996 this.sh_telephone = sh_telephone;
894 } 997 }
@@ -897,6 +1000,7 @@ public class ManifestEntity extends BasicEntity{ @@ -897,6 +1000,7 @@ public class ManifestEntity extends BasicEntity{
897 public String getSh_fax() { 1000 public String getSh_fax() {
898 return sh_fax; 1001 return sh_fax;
899 } 1002 }
  1003 +
900 public void setSh_fax(String sh_fax) { 1004 public void setSh_fax(String sh_fax) {
901 this.sh_fax = sh_fax; 1005 this.sh_fax = sh_fax;
902 } 1006 }
@@ -905,6 +1009,7 @@ public class ManifestEntity extends BasicEntity{ @@ -905,6 +1009,7 @@ public class ManifestEntity extends BasicEntity{
905 public String getSh_name() { 1009 public String getSh_name() {
906 return sh_name; 1010 return sh_name;
907 } 1011 }
  1012 +
908 public void setSh_name(String sh_name) { 1013 public void setSh_name(String sh_name) {
909 this.sh_name = sh_name; 1014 this.sh_name = sh_name;
910 } 1015 }
@@ -913,6 +1018,7 @@ public class ManifestEntity extends BasicEntity{ @@ -913,6 +1018,7 @@ public class ManifestEntity extends BasicEntity{
913 public String getCo_company() { 1018 public String getCo_company() {
914 return co_company; 1019 return co_company;
915 } 1020 }
  1021 +
916 public void setCo_company(String co_company) { 1022 public void setCo_company(String co_company) {
917 this.co_company = co_company; 1023 this.co_company = co_company;
918 } 1024 }
@@ -921,6 +1027,7 @@ public class ManifestEntity extends BasicEntity{ @@ -921,6 +1027,7 @@ public class ManifestEntity extends BasicEntity{
921 public String getCo_address() { 1027 public String getCo_address() {
922 return co_address; 1028 return co_address;
923 } 1029 }
  1030 +
924 public void setCo_address(String co_address) { 1031 public void setCo_address(String co_address) {
925 this.co_address = co_address; 1032 this.co_address = co_address;
926 } 1033 }
@@ -929,6 +1036,7 @@ public class ManifestEntity extends BasicEntity{ @@ -929,6 +1036,7 @@ public class ManifestEntity extends BasicEntity{
929 public String getCo_zipcode() { 1036 public String getCo_zipcode() {
930 return co_zipcode; 1037 return co_zipcode;
931 } 1038 }
  1039 +
932 public void setCo_zipcode(String co_zipcode) { 1040 public void setCo_zipcode(String co_zipcode) {
933 this.co_zipcode = co_zipcode; 1041 this.co_zipcode = co_zipcode;
934 } 1042 }
@@ -937,6 +1045,7 @@ public class ManifestEntity extends BasicEntity{ @@ -937,6 +1045,7 @@ public class ManifestEntity extends BasicEntity{
937 public String getCo_city() { 1045 public String getCo_city() {
938 return co_city; 1046 return co_city;
939 } 1047 }
  1048 +
940 public void setCo_city(String co_city) { 1049 public void setCo_city(String co_city) {
941 this.co_city = co_city; 1050 this.co_city = co_city;
942 } 1051 }
@@ -945,6 +1054,7 @@ public class ManifestEntity extends BasicEntity{ @@ -945,6 +1054,7 @@ public class ManifestEntity extends BasicEntity{
945 public String getCo_deltaname() { 1054 public String getCo_deltaname() {
946 return co_deltaname; 1055 return co_deltaname;
947 } 1056 }
  1057 +
948 public void setCo_deltaname(String co_deltaname) { 1058 public void setCo_deltaname(String co_deltaname) {
949 this.co_deltaname = co_deltaname; 1059 this.co_deltaname = co_deltaname;
950 } 1060 }
@@ -953,6 +1063,7 @@ public class ManifestEntity extends BasicEntity{ @@ -953,6 +1063,7 @@ public class ManifestEntity extends BasicEntity{
953 public String getCo_country() { 1063 public String getCo_country() {
954 return co_country; 1064 return co_country;
955 } 1065 }
  1066 +
956 public void setCo_country(String co_country) { 1067 public void setCo_country(String co_country) {
957 this.co_country = co_country; 1068 this.co_country = co_country;
958 } 1069 }
@@ -961,6 +1072,7 @@ public class ManifestEntity extends BasicEntity{ @@ -961,6 +1072,7 @@ public class ManifestEntity extends BasicEntity{
961 public String getCo_telephone() { 1072 public String getCo_telephone() {
962 return co_telephone; 1073 return co_telephone;
963 } 1074 }
  1075 +
964 public void setCo_telephone(String co_telephone) { 1076 public void setCo_telephone(String co_telephone) {
965 this.co_telephone = co_telephone; 1077 this.co_telephone = co_telephone;
966 } 1078 }
@@ -969,6 +1081,7 @@ public class ManifestEntity extends BasicEntity{ @@ -969,6 +1081,7 @@ public class ManifestEntity extends BasicEntity{
969 public String getCo_fax() { 1081 public String getCo_fax() {
970 return co_fax; 1082 return co_fax;
971 } 1083 }
  1084 +
972 public void setCo_fax(String co_fax) { 1085 public void setCo_fax(String co_fax) {
973 this.co_fax = co_fax; 1086 this.co_fax = co_fax;
974 } 1087 }
@@ -977,6 +1090,7 @@ public class ManifestEntity extends BasicEntity{ @@ -977,6 +1090,7 @@ public class ManifestEntity extends BasicEntity{
977 public String getCo_name() { 1090 public String getCo_name() {
978 return co_name; 1091 return co_name;
979 } 1092 }
  1093 +
980 public void setCo_name(String co_name) { 1094 public void setCo_name(String co_name) {
981 this.co_name = co_name; 1095 this.co_name = co_name;
982 } 1096 }
@@ -985,6 +1099,7 @@ public class ManifestEntity extends BasicEntity{ @@ -985,6 +1099,7 @@ public class ManifestEntity extends BasicEntity{
985 public String getReach_station() { 1099 public String getReach_station() {
986 return reach_station; 1100 return reach_station;
987 } 1101 }
  1102 +
988 public void setReach_station(String reach_station) { 1103 public void setReach_station(String reach_station) {
989 this.reach_station = reach_station; 1104 this.reach_station = reach_station;
990 } 1105 }
@@ -993,6 +1108,7 @@ public class ManifestEntity extends BasicEntity{ @@ -993,6 +1108,7 @@ public class ManifestEntity extends BasicEntity{
993 public String getCarrier1() { 1108 public String getCarrier1() {
994 return carrier1; 1109 return carrier1;
995 } 1110 }
  1111 +
996 public void setCarrier1(String carrier1) { 1112 public void setCarrier1(String carrier1) {
997 this.carrier1 = carrier1; 1113 this.carrier1 = carrier1;
998 } 1114 }
@@ -1001,6 +1117,7 @@ public class ManifestEntity extends BasicEntity{ @@ -1001,6 +1117,7 @@ public class ManifestEntity extends BasicEntity{
1001 public String getReach_station1() { 1117 public String getReach_station1() {
1002 return reach_station1; 1118 return reach_station1;
1003 } 1119 }
  1120 +
1004 public void setReach_station1(String reach_station1) { 1121 public void setReach_station1(String reach_station1) {
1005 this.reach_station1 = reach_station1; 1122 this.reach_station1 = reach_station1;
1006 } 1123 }
@@ -1009,6 +1126,7 @@ public class ManifestEntity extends BasicEntity{ @@ -1009,6 +1126,7 @@ public class ManifestEntity extends BasicEntity{
1009 public String getCarrier2() { 1126 public String getCarrier2() {
1010 return carrier2; 1127 return carrier2;
1011 } 1128 }
  1129 +
1012 public void setCarrier2(String carrier2) { 1130 public void setCarrier2(String carrier2) {
1013 this.carrier2 = carrier2; 1131 this.carrier2 = carrier2;
1014 } 1132 }
@@ -1017,6 +1135,7 @@ public class ManifestEntity extends BasicEntity{ @@ -1017,6 +1135,7 @@ public class ManifestEntity extends BasicEntity{
1017 public String getReach_station2() { 1135 public String getReach_station2() {
1018 return reach_station2; 1136 return reach_station2;
1019 } 1137 }
  1138 +
1020 public void setReach_station2(String reach_station2) { 1139 public void setReach_station2(String reach_station2) {
1021 this.reach_station2 = reach_station2; 1140 this.reach_station2 = reach_station2;
1022 } 1141 }
@@ -1025,6 +1144,7 @@ public class ManifestEntity extends BasicEntity{ @@ -1025,6 +1144,7 @@ public class ManifestEntity extends BasicEntity{
1025 public String getName_ofgoods() { 1144 public String getName_ofgoods() {
1026 return name_ofgoods; 1145 return name_ofgoods;
1027 } 1146 }
  1147 +
1028 public void setName_ofgoods(String name_ofgoods) { 1148 public void setName_ofgoods(String name_ofgoods) {
1029 this.name_ofgoods = name_ofgoods; 1149 this.name_ofgoods = name_ofgoods;
1030 } 1150 }
@@ -1033,26 +1153,26 @@ public class ManifestEntity extends BasicEntity{ @@ -1033,26 +1153,26 @@ public class ManifestEntity extends BasicEntity{
1033 public String getDelivery_station() { 1153 public String getDelivery_station() {
1034 return delivery_station; 1154 return delivery_station;
1035 } 1155 }
  1156 +
1036 public void setDelivery_station(String delivery_station) { 1157 public void setDelivery_station(String delivery_station) {
1037 this.delivery_station = delivery_station; 1158 this.delivery_station = delivery_station;
1038 } 1159 }
1039 - //该函数主要用于List的contains  
1040 - public boolean equals(Object mme){  
1041 - if(mme == null) 1160 +
  1161 + // 该函数主要用于List的contains
  1162 + public boolean equals(Object mme) {
  1163 + if (mme == null)
1042 return false; 1164 return false;
1043 - ManifestEntity me = (ManifestEntity)mme;  
1044 - if(me.getCo_company() == null && this.getCo_company() == null) 1165 + ManifestEntity me = (ManifestEntity) mme;
  1166 + if (me.getCo_company() == null && this.getCo_company() == null)
1045 return true; 1167 return true;
1046 - else if(this.getCo_company() != null)  
1047 - {  
1048 - //在值相等的情况下,判断时间的大小  
1049 - if(this.getCo_company().equals(me.getCo_company()))  
1050 - {  
1051 - //当前时间为null,直接返回true  
1052 - if(this.getSave_time() == null) 1168 + else if (this.getCo_company() != null) {
  1169 + // 在值相等的情况下,判断时间的大小
  1170 + if (this.getCo_company().equals(me.getCo_company())) {
  1171 + // 当前时间为null,直接返回true
  1172 + if (this.getSave_time() == null)
1053 return true; 1173 return true;
1054 - //要比较的那个对象为null,直接返回false  
1055 - else if(me.getSave_time() == null) 1174 + // 要比较的那个对象为null,直接返回false
  1175 + else if (me.getSave_time() == null)
1056 return false; 1176 return false;
1057 else 1177 else
1058 return this.getSave_time() > me.getSave_time(); 1178 return this.getSave_time() > me.getSave_time();
@@ -1061,4 +1181,3 @@ public class ManifestEntity extends BasicEntity{ @@ -1061,4 +1181,3 @@ public class ManifestEntity extends BasicEntity{
1061 return false; 1181 return false;
1062 } 1182 }
1063 } 1183 }
1064 -  
@@ -8,7 +8,6 @@ import javax.persistence.Entity; @@ -8,7 +8,6 @@ import javax.persistence.Entity;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
9 9
10 import com.agent.entity.BasicEntity; 10 import com.agent.entity.BasicEntity;
11 -import com.ibm.disthub2.impl.matching.selector.ParseException;  
12 /** 11 /**
13 * Created by cohesion on 2017/8/9. 12 * Created by cohesion on 2017/8/9.
14 * <p/> 13 * <p/>
@@ -17,6 +16,18 @@ import com.ibm.disthub2.impl.matching.selector.ParseException; @@ -17,6 +16,18 @@ import com.ibm.disthub2.impl.matching.selector.ParseException;
17 @Entity 16 @Entity
18 @Table(name = "preparesecondary") 17 @Table(name = "preparesecondary")
19 public class PreparesecondaryEntity extends BasicEntity{ 18 public class PreparesecondaryEntity extends BasicEntity{
  19 + private String unlodingcode;// 卸货地代码
  20 + private String cnecusid;// 收货人代码
  21 + private String shpcusid;// 发货人代码
  22 + /**
  23 + * 发货人aeo
  24 + */
  25 + private String shpaeo;
  26 + /**
  27 + * 收货人aeo
  28 + */
  29 + private String cneaeo;
  30 +
20 /** 31 /**
21 * 32 *
22 */ 33 */
@@ -284,6 +295,36 @@ public class PreparesecondaryEntity extends BasicEntity{ @@ -284,6 +295,36 @@ public class PreparesecondaryEntity extends BasicEntity{
284 295
285 private Long USER_ID; 296 private Long USER_ID;
286 297
  298 + public String getUnlodingcode() {
  299 + return unlodingcode;
  300 + }
  301 + public void setUnlodingcode(String unlodingcode) {
  302 + this.unlodingcode = unlodingcode;
  303 + }
  304 + public String getCnecusid() {
  305 + return cnecusid;
  306 + }
  307 + public void setCnecusid(String cnecusid) {
  308 + this.cnecusid = cnecusid;
  309 + }
  310 + public String getShpcusid() {
  311 + return shpcusid;
  312 + }
  313 + public void setShpcusid(String shpcusid) {
  314 + this.shpcusid = shpcusid;
  315 + }
  316 + public String getShpaeo() {
  317 + return shpaeo;
  318 + }
  319 + public void setShpaeo(String shpaeo) {
  320 + this.shpaeo = shpaeo;
  321 + }
  322 + public String getCneaeo() {
  323 + return cneaeo;
  324 + }
  325 + public void setCneaeo(String cneaeo) {
  326 + this.cneaeo = cneaeo;
  327 + }
287 @Column(name = "USER_ID") 328 @Column(name = "USER_ID")
288 public Long getUSER_ID() { 329 public Long getUSER_ID() {
289 return USER_ID; 330 return USER_ID;
  1 +package com.agent.entity.agent;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.Table;
  7 +
  8 +import com.agent.entity.BasicEntity;
  9 +
  10 +/**
  11 + *
  12 + * Depiction: 运单回执表
  13 + * <p>
  14 + * Modify:
  15 + * <p>
  16 + * Author: William Lynn
  17 + * <p>
  18 + * Create Date:2018年5月28日 下午2:05:28
  19 + *
  20 + */
  21 +@Entity
  22 +@Table(name = "WAYBILL_RECEIPT")
  23 +public class WaybillReceiprtEntity extends BasicEntity {
  24 + private String flightno;
  25 + private Date flightdate;
  26 + private String response_code;
  27 + private String response_text;
  28 + private String waybill_no;
  29 + private String sub_waybill_no;
  30 + private String carrier;
  31 + private String message_type;
  32 + private String sendtime;
  33 + private String piece;
  34 + private String weight;
  35 +
  36 + public String getFlightno() {
  37 + return flightno;
  38 + }
  39 +
  40 + public void setFlightno(String flightno) {
  41 + this.flightno = flightno;
  42 + }
  43 +
  44 + public Date getFlightdate() {
  45 + return flightdate;
  46 + }
  47 +
  48 + public void setFlightdate(Date flightdate) {
  49 + this.flightdate = flightdate;
  50 + }
  51 +
  52 + public String getResponse_code() {
  53 + return response_code;
  54 + }
  55 +
  56 + public void setResponse_code(String response_code) {
  57 + this.response_code = response_code;
  58 + }
  59 +
  60 + public String getResponse_text() {
  61 + return response_text;
  62 + }
  63 +
  64 + public void setResponse_text(String response_text) {
  65 + this.response_text = response_text;
  66 + }
  67 +
  68 + public String getWaybill_no() {
  69 + return waybill_no;
  70 + }
  71 +
  72 + public void setWaybill_no(String waybill_no) {
  73 + this.waybill_no = waybill_no;
  74 + }
  75 +
  76 + public String getSub_waybill_no() {
  77 + return sub_waybill_no;
  78 + }
  79 +
  80 + public void setSub_waybill_no(String sub_waybill_no) {
  81 + this.sub_waybill_no = sub_waybill_no;
  82 + }
  83 +
  84 + public String getCarrier() {
  85 + return carrier;
  86 + }
  87 +
  88 + public void setCarrier(String carrier) {
  89 + this.carrier = carrier;
  90 + }
  91 +
  92 + public String getMessage_type() {
  93 + return message_type;
  94 + }
  95 +
  96 + public void setMessage_type(String message_type) {
  97 + this.message_type = message_type;
  98 + }
  99 +
  100 + public String getSendtime() {
  101 + return sendtime;
  102 + }
  103 +
  104 + public void setSendtime(String sendtime) {
  105 + this.sendtime = sendtime;
  106 + }
  107 +
  108 + public String getPiece() {
  109 + return piece;
  110 + }
  111 +
  112 + public void setPiece(String piece) {
  113 + this.piece = piece;
  114 + }
  115 +
  116 + public String getWeight() {
  117 + return weight;
  118 + }
  119 +
  120 + public void setWeight(String weight) {
  121 + this.weight = weight;
  122 + }
  123 +
  124 + // 该函数主要用于List的contains
  125 + public boolean equals(Object mme) {
  126 + if (mme != null) {
  127 + WaybillReceiprtEntity me = (WaybillReceiprtEntity) mme;
  128 + if (me.getWaybill_no().equalsIgnoreCase(this.getWaybill_no())) {
  129 + return true;
  130 + }
  131 + }
  132 +
  133 + return false;
  134 + }
  135 +}
  1 +package com.agent.entity.agent;
  2 +
  3 +/**
  4 + * Depiction:回执报文类型
  5 + * <p>
  6 + * Modify:
  7 + * <p>
  8 + * Author: Kevin Lynn
  9 + * <p>
  10 + * Create Date:2018年2月13日 上午11:53:15
  11 + *
  12 + */
  13 +public enum WaybillReceiptType {
  14 + APPLY("已发送预配舱单申请报文", 2), UPDATE("已发送预配舱单修改报文", 4), DELETE("已发送预配舱单删除报文", 3);
  15 +
  16 + private String name;
  17 + private int value;
  18 +
  19 + private WaybillReceiptType(String name, int value) {
  20 + this.name = name;
  21 + this.value = value;
  22 + }
  23 +
  24 + public static String getName(int value) {
  25 + for (WaybillReceiptType role : WaybillReceiptType.values()) {
  26 + if (role.getValue() == value) {
  27 + return role.name;
  28 + }
  29 + }
  30 + return null;
  31 + }
  32 +
  33 + public static WaybillReceiptType valueOf(int value) {
  34 + for (WaybillReceiptType role : WaybillReceiptType.values()) {
  35 + if (role.getValue() == value) {
  36 + return role;
  37 + }
  38 + }
  39 + return null;
  40 + }
  41 +
  42 + public String getName() {
  43 + return name;
  44 + }
  45 +
  46 + public void setName(String name) {
  47 + this.name = name;
  48 + }
  49 +
  50 + public int getValue() {
  51 + return value;
  52 + }
  53 +
  54 + public void setValue(int value) {
  55 + this.value = value;
  56 + }
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return "(" + this.value + "," + this.name + ")";
  61 + }
  62 +}
@@ -49,16 +49,16 @@ public class Utils { @@ -49,16 +49,16 @@ public class Utils {
49 49
50 public static boolean createDir(String destDirName) { 50 public static boolean createDir(String destDirName) {
51 File dir = new File(destDirName); 51 File dir = new File(destDirName);
52 - if (dir.exists()) {// �ж�Ŀ¼�Ƿ���� 52 + if (dir.exists()) {
53 return true; 53 return true;
54 }else{ 54 }else{
55 - if (!destDirName.endsWith(File.separator)) {// ��β�Ƿ���"/"���� 55 + if (!destDirName.endsWith(File.separator)) {
56 destDirName = destDirName + File.separator; 56 destDirName = destDirName + File.separator;
57 } 57 }
58 - if (dir.mkdirs()) {// ����Ŀ��Ŀ¼ 58 + if (dir.mkdirs()) {
59 return true; 59 return true;
60 } else { 60 } else {
61 - logger.info("����Ŀ¼ʧ�ܣ� Ŀ¼��ƣ�"+destDirName); 61 + logger.info("创建目录失败-->"+destDirName);
62 return false; 62 return false;
63 } 63 }
64 } 64 }
@@ -10,19 +10,21 @@ import org.jdom.Element; @@ -10,19 +10,21 @@ import org.jdom.Element;
10 import org.jdom.JDOMException; 10 import org.jdom.JDOMException;
11 import org.jdom.input.SAXBuilder; 11 import org.jdom.input.SAXBuilder;
12 import org.xml.sax.InputSource; 12 import org.xml.sax.InputSource;
13 -import org.xml.sax.SAXParseException;  
14 13
15 public class XMPParse { 14 public class XMPParse {
16 15
17 /* 16 /*
18 * 把XML节点值转成日期类型 17 * 把XML节点值转成日期类型
  18 + *
19 * @param xmlFile XML文件路径名 19 * @param xmlFile XML文件路径名
  20 + *
20 * @param xmlNodePath 节点路径(从根节点算起) 21 * @param xmlNodePath 节点路径(从根节点算起)
21 - * @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回null  
22 - * * */  
23 - public static final Date nodeValue2Date(String xmlFile,String xmlNodePath){  
24 - String str = getNodeValue(xmlFile,xmlNodePath);  
25 - if (!"".equals(str)){ 22 + *
  23 + * @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回null *
  24 + */
  25 + public static final Date nodeValue2Date(String xmlFile, String xmlNodePath) {
  26 + String str = getNodeValue(xmlFile, xmlNodePath);
  27 + if (!"".equals(str)) {
26 return Utils.iso8601DateStrToDate(str); 28 return Utils.iso8601DateStrToDate(str);
27 } 29 }
28 return null; 30 return null;
@@ -30,29 +32,34 @@ public class XMPParse { @@ -30,29 +32,34 @@ public class XMPParse {
30 32
31 /* 33 /*
32 * 把XML节点值转成日期类型,如果节点值不存在,使用默认值 34 * 把XML节点值转成日期类型,如果节点值不存在,使用默认值
  35 + *
33 * @param xmlFile XML文件路径名 36 * @param xmlFile XML文件路径名
  37 + *
34 * @param xmlNodePath 节点路径(从根节点算起) 38 * @param xmlNodePath 节点路径(从根节点算起)
  39 + *
35 * @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值 40 * @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值
36 - * */  
37 - public static final Date nodeValue2Date(String xmlFile,String xmlNodePath,Date date){  
38 - String str = getNodeValue(xmlFile,xmlNodePath);  
39 - if (!"".equals(str)){ 41 + */
  42 + public static final Date nodeValue2Date(String xmlFile, String xmlNodePath, Date date) {
  43 + String str = getNodeValue(xmlFile, xmlNodePath);
  44 + if (!"".equals(str)) {
40 return Utils.iso8601DateStrToDate(str); 45 return Utils.iso8601DateStrToDate(str);
41 } 46 }
42 return date; 47 return date;
43 } 48 }
44 49
45 -  
46 /* 50 /*
47 * 把XML节点属性值转成日期类型,如果节点值不存在,使用默认值 51 * 把XML节点属性值转成日期类型,如果节点值不存在,使用默认值
  52 + *
48 * @param xmlFile XML文件路径名 53 * @param xmlFile XML文件路径名
  54 + *
49 * @param xmlNodePath 节点路径(从根节点算起) 55 * @param xmlNodePath 节点路径(从根节点算起)
  56 + *
50 * @return 如果节点属性有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值 57 * @return 如果节点属性有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值
51 - * */ 58 + */
52 59
53 - public static final Date nodeAttribute2Date(String xmlFile,String xmlNodePath,String attributeName,Date date){  
54 - String str = getNodeAttribute(xmlFile,xmlNodePath,attributeName,"");  
55 - if (!"".equals(str)){ 60 + public static final Date nodeAttribute2Date(String xmlFile, String xmlNodePath, String attributeName, Date date) {
  61 + String str = getNodeAttribute(xmlFile, xmlNodePath, attributeName, "");
  62 + if (!"".equals(str)) {
56 return Utils.iso8601DateStrToDate(str); 63 return Utils.iso8601DateStrToDate(str);
57 } 64 }
58 return date; 65 return date;
@@ -60,136 +67,120 @@ public class XMPParse { @@ -60,136 +67,120 @@ public class XMPParse {
60 67
61 /* 68 /*
62 * 根据指定的节点路径从XML节点取得节点的值 69 * 根据指定的节点路径从XML节点取得节点的值
63 - * @param xmlNodePath 节点的路径,从根节点开始  
64 - * 如果某个节点不存在那么返回空字符串""  
65 - * */  
66 - public static final String getNodeValue(String xmlFile,String xmlNodePath){  
67 - String[] nodes= xmlNodePath.split("/"); 70 + *
  71 + * @param xmlNodePath 节点的路径,从根节点开始 如果某个节点不存在那么返回空字符串""
  72 + */
  73 + public static final String getNodeValue(String xmlFile, String xmlNodePath) {
  74 + String[] nodes = xmlNodePath.split("/");
68 Document document = new Document(); 75 Document document = new Document();
69 SAXBuilder builder = new SAXBuilder(); 76 SAXBuilder builder = new SAXBuilder();
70 Element root = null; 77 Element root = null;
71 78
72 LinkedList<SubNode> listNode = new LinkedList<SubNode>(); 79 LinkedList<SubNode> listNode = new LinkedList<SubNode>();
73 80
74 - String value=""; 81 + String value = "";
75 try { 82 try {
76 // 将解析器与文档关联 83 // 将解析器与文档关联
77 -  
78 document = builder.build(xmlFile); 84 document = builder.build(xmlFile);
79 - //builder.build(systemId);  
80 - for(int i=1; i< nodes.length; i++){  
81 - if(i > 1){  
82 - SubNode s = (SubNode)listNode.getLast(); 85 + // builder.build(systemId);
  86 + for (int i = 1; i < nodes.length; i++) {
  87 + if (i > 1) {
  88 + SubNode s = (SubNode) listNode.getLast();
83 List<Element> eList = s.getElement().getChildren(nodes[i]); 89 List<Element> eList = s.getElement().getChildren(nodes[i]);
84 - //�ж��Ƿ����ӽڵ�  
85 - if (null != eList && eList.size()>0){ 90 + if (null != eList && eList.size() > 0) {
86 SubNode s1 = new SubNode(eList.get(0)); 91 SubNode s1 = new SubNode(eList.get(0));
87 listNode.add(s1); 92 listNode.add(s1);
88 } 93 }
89 - }else if (1 == i){ 94 + } else if (1 == i) {
90 root = document.getRootElement(); 95 root = document.getRootElement();
91 - SubNode snode= new SubNode(root); 96 + SubNode snode = new SubNode(root);
92 listNode.add(snode); 97 listNode.add(snode);
93 } 98 }
94 } 99 }
95 - SubNode n = listNode.getLast();; 100 + SubNode n = listNode.getLast();
  101 + ;
96 value = n.getElement().getText(); 102 value = n.getElement().getText();
97 n = null; 103 n = null;
98 } catch (Exception e1) { 104 } catch (Exception e1) {
99 e1.printStackTrace(); 105 e1.printStackTrace();
100 - } finally{ 106 + } finally {
101 listNode.clear(); 107 listNode.clear();
102 document = null; 108 document = null;
103 root = null; 109 root = null;
104 builder = null; 110 builder = null;
105 nodes = null; 111 nodes = null;
106 } 112 }
107 - System.out.println("key="+xmlNodePath + " value="+value); 113 + System.out.println("key=" + xmlNodePath + " value=" + value);
108 return value; 114 return value;
109 } 115 }
110 116
111 - /*  
112 - * ���ָ���Ľڵ�·����XML�ڵ�ȡ�ýڵ��ֵ  
113 - * @param xmlNodePath �ڵ��·�����Ӹ�ڵ㿪ʼ  
114 - * ���ij���ڵ㲻������ô���ؿ��ַ�""  
115 - * */  
116 - public static final String getNodeValueFromXmlString(String xmlString,String xmlNodePath) throws Exception{  
117 - String[] nodes= xmlNodePath.split("/"); 117 + public static final String getNodeValueFromXmlString(String xmlString, String xmlNodePath) throws Exception {
  118 + String[] nodes = xmlNodePath.split("/");
118 Document document = new Document(); 119 Document document = new Document();
119 SAXBuilder builder = new SAXBuilder(); 120 SAXBuilder builder = new SAXBuilder();
120 Element root = null; 121 Element root = null;
121 122
122 LinkedList<SubNode> listNode = new LinkedList<SubNode>(); 123 LinkedList<SubNode> listNode = new LinkedList<SubNode>();
123 124
124 - String value=""; 125 + String value = "";
125 try { 126 try {
126 - // �����������ĵ�����  
127 -  
128 StringReader xmlReader = new StringReader(xmlString); 127 StringReader xmlReader = new StringReader(xmlString);
129 InputSource xmlSource = new InputSource(xmlReader); 128 InputSource xmlSource = new InputSource(xmlReader);
130 document = builder.build(xmlSource); 129 document = builder.build(xmlSource);
131 - for(int i=1; i< nodes.length; i++){  
132 - if(i > 1){  
133 - SubNode s = (SubNode)listNode.getLast(); 130 + for (int i = 1; i < nodes.length; i++) {
  131 + if (i > 1) {
  132 + SubNode s = (SubNode) listNode.getLast();
134 List<Element> eList = s.getElement().getChildren(nodes[i]); 133 List<Element> eList = s.getElement().getChildren(nodes[i]);
135 - //�ж��Ƿ����ӽڵ�  
136 - if (null != eList && eList.size()>0){ 134 + if (null != eList && eList.size() > 0) {
137 SubNode s1 = new SubNode(eList.get(0)); 135 SubNode s1 = new SubNode(eList.get(0));
138 listNode.add(s1); 136 listNode.add(s1);
139 } 137 }
140 - }else if (1 == i){ 138 + } else if (1 == i) {
141 root = document.getRootElement(); 139 root = document.getRootElement();
142 - SubNode snode= new SubNode(root); 140 + SubNode snode = new SubNode(root);
143 listNode.add(snode); 141 listNode.add(snode);
144 } 142 }
145 } 143 }
146 - SubNode n = listNode.getLast();; 144 + SubNode n = listNode.getLast();
  145 + ;
147 value = n.getElement().getText(); 146 value = n.getElement().getText();
148 n = null; 147 n = null;
149 } catch (Exception e1) { 148 } catch (Exception e1) {
150 e1.printStackTrace(); 149 e1.printStackTrace();
151 throw e1; 150 throw e1;
152 - } finally{ 151 + } finally {
153 listNode.clear(); 152 listNode.clear();
154 document = null; 153 document = null;
155 root = null; 154 root = null;
156 builder = null; 155 builder = null;
157 nodes = null; 156 nodes = null;
158 } 157 }
159 - //System.out.println("key="+xmlNodePath + " value="+value); 158 + // System.out.println("key="+xmlNodePath + " value="+value);
160 return value; 159 return value;
161 } 160 }
162 161
163 -  
164 - /*  
165 - * ���ָ���Ľڵ�·����XML�ڵ�ȡ�ýڵ������ֵ  
166 - * @param xmlNodePath �ڵ��·�����Ӹ�ڵ㿪ʼ  
167 - * @param attributeName �ڵ���������  
168 - * @defaultValue Ĭ��ֵ  
169 - * ���ij���ڵ㲻���ڣ����߽ڵ㲻����ָ�������ԣ���ô����Ĭ��ֵ  
170 - * */  
171 - public static final String getNodeAttribute(String xmlFile,String xmlNodePath,String attributeName,String defaultValue){  
172 - String[] nodes= xmlNodePath.split("/"); 162 + public static final String getNodeAttribute(String xmlFile, String xmlNodePath, String attributeName,
  163 + String defaultValue) {
  164 + String[] nodes = xmlNodePath.split("/");
173 Document document = new Document(); 165 Document document = new Document();
174 SAXBuilder builder = new SAXBuilder(); 166 SAXBuilder builder = new SAXBuilder();
175 Element root = null; 167 Element root = null;
176 168
177 LinkedList<SubNode> listNode = new LinkedList<SubNode>(); 169 LinkedList<SubNode> listNode = new LinkedList<SubNode>();
178 - String value=""; 170 + String value = "";
179 try { 171 try {
180 document = builder.build(xmlFile); 172 document = builder.build(xmlFile);
181 - for(int i=1; i< nodes.length; i++){  
182 - if(i > 1){  
183 - SubNode s = (SubNode)listNode.getLast(); 173 + for (int i = 1; i < nodes.length; i++) {
  174 + if (i > 1) {
  175 + SubNode s = (SubNode) listNode.getLast();
184 List<Element> eList = s.getElement().getChildren(nodes[i]); 176 List<Element> eList = s.getElement().getChildren(nodes[i]);
185 - //�ж��Ƿ����ӽڵ�  
186 - if (null != eList && eList.size()>0){ 177 + if (null != eList && eList.size() > 0) {
187 SubNode s1 = new SubNode(eList.get(0)); 178 SubNode s1 = new SubNode(eList.get(0));
188 listNode.add(s1); 179 listNode.add(s1);
189 } 180 }
190 - }else if (1 == i){ 181 + } else if (1 == i) {
191 root = document.getRootElement(); 182 root = document.getRootElement();
192 - SubNode snode= new SubNode(root); 183 + SubNode snode = new SubNode(root);
193 listNode.add(snode); 184 listNode.add(snode);
194 } 185 }
195 } 186 }
@@ -200,16 +191,15 @@ public class XMPParse { @@ -200,16 +191,15 @@ public class XMPParse {
200 e1.printStackTrace(); 191 e1.printStackTrace();
201 } catch (IOException e1) { 192 } catch (IOException e1) {
202 e1.printStackTrace(); 193 e1.printStackTrace();
203 - }finally{ 194 + } finally {
204 listNode.clear(); 195 listNode.clear();
205 document = null; 196 document = null;
206 root = null; 197 root = null;
207 builder = null; 198 builder = null;
208 nodes = null; 199 nodes = null;
209 } 200 }
210 - System.out.println("key="+xmlNodePath + " node attrivte value="+value); 201 + System.out.println("key=" + xmlNodePath + " node attrivte value=" + value);
211 return value; 202 return value;
212 } 203 }
213 204
214 -  
215 } 205 }
  1 +package com.agent.listener;
  2 +
  3 +import org.springframework.context.ApplicationListener;
  4 +import org.springframework.context.event.ContextRefreshedEvent;
  5 +
  6 +/**
  7 + * Depiction:服务启动之后初始化一些操作
  8 + * <p>
  9 + * Modify:
  10 + * <p>
  11 + * Author: William Lynn
  12 + * <p>
  13 + * Create Date:2018年6月8日 下午2:49:54
  14 + *
  15 + */
  16 +public class StartupListener implements ApplicationListener<ContextRefreshedEvent> {
  17 + // private final static String DISPLAY_NAME = "Root WebApplicationContext";
  18 + private final static String DISPLAY_NAME = "WebApplicationContext for namespace 'webMvc-servlet'";
  19 +
  20 + @Override
  21 + public void onApplicationEvent(ContextRefreshedEvent event) {
  22 + String displayName = event.getApplicationContext().getDisplayName();
  23 + System.err.println("");
  24 + System.err.println(getClass().getSimpleName() + ":displayName is " + displayName);
  25 + if (DISPLAY_NAME.equalsIgnoreCase(displayName)) {
  26 + System.err.println(getClass().getSimpleName() + ": you can init some");
  27 + }
  28 +
  29 + // if (event.getApplicationContext().getParent() == null) {
  30 + // System.err.println(getClass().getSimpleName() + ": you can init some");
  31 + // IMFCustomReceiptMessageTask task = new IMFCustomReceiptMessageTask();
  32 + // task.start();
  33 + // }
  34 + }
  35 +
  36 +}
  1 +package com.agent.repository.agent;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
  8 +import org.springframework.data.repository.PagingAndSortingRepository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import com.agent.entity.agent.ConsignorEntity;
  12 +
  13 +public interface ConsignorRepository
  14 + extends PagingAndSortingRepository<ConsignorEntity, Long>, JpaSpecificationExecutor<ConsignorEntity> {
  15 +
  16 + @Query(value = "SELECT * FROM CONSIGNOR WHERE SHPCUSID = ?1 AND CO_COMPANY = ?2 ORDER BY ID DESC", nativeQuery = true)
  17 + public List<ConsignorEntity> findByCodeAndCompany(String shpcusid, String co_company);
  18 +
  19 + @Query(value = "SELECT * FROM CONSIGNOR WHERE SHPCUSID = ?1 ORDER BY ID DESC", nativeQuery = true)
  20 + public List<ConsignorEntity> findByCode(String code);
  21 +
  22 + @Query(value = "SELECT * FROM CONSIGNOR WHERE CO_COMPANY = ?1 ORDER BY ID DESC", nativeQuery = true)
  23 + public List<ConsignorEntity> findByCompany(String company);
  24 +
  25 + @Query(value = "SELECT * FROM CONSIGNOR WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
  26 + public List<ConsignorEntity> findById(String id);
  27 +
  28 + @Query(value = "SELECT * FROM CONSIGNOR ORDER BY ID DESC", nativeQuery = true)
  29 + public List<ConsignorEntity> getAll();
  30 +
  31 + @Query(value = "SELECT * FROM CONSIGNOR WHERE CREATOR = ?1 ORDER BY ID DESC", nativeQuery = true)
  32 + public List<ConsignorEntity> getAllByUserId(long user_id);
  33 +
  34 + @Modifying
  35 + @Query(value = "DELETE FROM CONSIGNOR WHERE ID = ?1", nativeQuery = true)
  36 + void deleteById(Long id);
  37 +
  38 + // 关于,,,,,,,,,,,
  39 + @Transactional
  40 + @Modifying(clearAutomatically = true)
  41 + @Query(value = "INSERT INTO CONSIGNOR(CO_NAME, CO_TELEPHONE, CO_COMPANY, CO_COUNTRY, CO_DELTANAME, CO_CITY, CO_ADDRESS, CO_ZIPCODE, CO_FAX, SHPAEO,SHPCUSID) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11)", nativeQuery = true)
  42 + public int save(String co_name, String co_telephone, String co_company, String co_country,
  43 + String co_deltaname, String co_city, String co_address, String co_zipcode, String co_fax, String shpaeo,
  44 + String shpcusid);
  45 +
  46 + @Query(value = "SELECT * FROM CONSIGNOR WHERE ID=?1", nativeQuery = true)
  47 + public List<ConsignorEntity> queryById(Long id);
  48 +}
@@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Modifying; @@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Modifying;
7 import org.springframework.data.jpa.repository.Query; 7 import org.springframework.data.jpa.repository.Query;
8 import org.springframework.data.repository.PagingAndSortingRepository; 8 import org.springframework.data.repository.PagingAndSortingRepository;
9 9
10 -import com.agent.entity.agent.ManifestEntity;  
11 import com.agent.entity.agent.PreparesecondaryEntity; 10 import com.agent.entity.agent.PreparesecondaryEntity;
12 11
13 public interface PreparesecondaryRepository extends PagingAndSortingRepository<PreparesecondaryEntity, Long>, 12 public interface PreparesecondaryRepository extends PagingAndSortingRepository<PreparesecondaryEntity, Long>,
@@ -30,6 +29,6 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{ @@ -30,6 +29,6 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
30 @Modifying 29 @Modifying
31 @Query(value = "SELECT * FROM PREPARESECONDARY ", nativeQuery = true) 30 @Query(value = "SELECT * FROM PREPARESECONDARY ", nativeQuery = true)
32 List<PreparesecondaryEntity> queryAll(); 31 List<PreparesecondaryEntity> queryAll();
33 - @Query(value = "SELECT * FROM PREPARESECONDARY=?1", nativeQuery = true) 32 + @Query(value = "SELECT * FROM PREPARESECONDARY WHERE USER_ID=?1", nativeQuery = true)
34 List<PreparesecondaryEntity> queryByUserId(Long user_id); 33 List<PreparesecondaryEntity> queryByUserId(Long user_id);
35 } 34 }
1 package com.agent.repository.agent; 1 package com.agent.repository.agent;
2 2
3 3
4 -import com.agent.entity.agent.SupervisionEntity; 4 +import java.util.List;
  5 +
5 import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 6 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 -import org.springframework.data.jpa.repository.Modifying;  
7 import org.springframework.data.jpa.repository.Query; 7 import org.springframework.data.jpa.repository.Query;
8 import org.springframework.data.repository.PagingAndSortingRepository; 8 import org.springframework.data.repository.PagingAndSortingRepository;
9 9
10 -import java.util.List; 10 +import com.agent.entity.agent.SupervisionEntity;
11 11
12 public interface SupervisionRepository extends PagingAndSortingRepository<SupervisionEntity, Long>, 12 public interface SupervisionRepository extends PagingAndSortingRepository<SupervisionEntity, Long>,
13 JpaSpecificationExecutor<SupervisionEntity> { 13 JpaSpecificationExecutor<SupervisionEntity> {
  1 +package com.agent.repository.agent;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
  8 +import org.springframework.data.repository.PagingAndSortingRepository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import com.agent.entity.agent.WaybillReceiprtEntity;
  12 +
  13 +public interface WaybillReceiptRepository
  14 + extends PagingAndSortingRepository<WaybillReceiprtEntity, Long>, JpaSpecificationExecutor<WaybillReceiprtEntity> {
  15 +
  16 + @Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE WAYBILL_NO = ?1 AND SUB_WAYBILL_NO = ?2 ORDER BY ID DESC", nativeQuery = true)
  17 + public List<WaybillReceiprtEntity> findByWaybillNoAndSub(String waybill_no, String sub_waybill_no);
  18 +
  19 + @Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE WAYBILL_NO = ?1 ORDER BY ID DESC", nativeQuery = true)
  20 + public List<WaybillReceiprtEntity> findByWaybillNo(String waybill_no);
  21 +
  22 + @Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
  23 + public List<WaybillReceiprtEntity> findById(String id);
  24 +
  25 + @Query(value = "SELECT * FROM WAYBILL_RECEIPT ORDER BY ID DESC", nativeQuery = true)
  26 + public List<WaybillReceiprtEntity> getAll();
  27 +
  28 + @Modifying
  29 + @Query(value = "DELETE FROM WAYBILL_RECEIPT WHERE ID = ?1", nativeQuery = true)
  30 + void deleteById(Long id);
  31 +
  32 + // 关于,,,,,,,,,,,
  33 + @Transactional
  34 + @Modifying(clearAutomatically = true)
  35 + @Query(value = "INSERT INTO WAYBILL_RECEIPT(FLIGHTNO, FLIGHTDATE, RESPONSE_CODE, RESPONSE_TEXT, WAYBILL_NO, SUB_WAYBILL_NO, CARRIER, MESSAGE_TYPE, SENDTIME) VALUES(?1,?2,?3,?4,?5,?6,?7,?8,?9)", nativeQuery = true)
  36 + public int save(String flightno, String flightdate, String response_code, String response_text,
  37 + String waybill_no, String sub_waybill_no, String carrier, String message_type,String sendtime);
  38 +
  39 + @Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE ID=?1", nativeQuery = true)
  40 + public List<WaybillReceiprtEntity> queryById(Long id);
  41 +}
1 package com.agent.service.agent; 1 package com.agent.service.agent;
2 2
3 3
4 -import com.agent.entity.agent.BasicAgentEntity;  
5 -import com.agent.entity.agent.ConsigneeEntity;  
6 -import com.agent.entity.agent.ConsigneeInfo;  
7 -import com.agent.entity.agent.ManifestEntity;  
8 -import com.agent.repository.agent.ConsigneeRepository;  
9 -import com.agent.service.BasicService;  
10 -import com.alibaba.fastjson.JSONObject;  
11 -import com.framework.util.MD5Tools;  
12 -import com.google.common.base.Splitter;  
13 -import com.plugin.easyui.EasyPage; 4 +import java.util.List;
  5 +
  6 +import javax.annotation.Resource;
14 7
15 import org.apache.commons.collections.CollectionUtils; 8 import org.apache.commons.collections.CollectionUtils;
16 -import org.apache.commons.lang.StringUtils;  
17 import org.springframework.data.domain.Page; 9 import org.springframework.data.domain.Page;
18 import org.springframework.data.domain.PageRequest; 10 import org.springframework.data.domain.PageRequest;
19 -import org.springframework.data.domain.Sort;  
20 -import org.springframework.data.domain.Sort.Direction;  
21 import org.springframework.data.jpa.domain.Specification; 11 import org.springframework.data.jpa.domain.Specification;
22 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
23 import org.springframework.transaction.annotation.Transactional; 13 import org.springframework.transaction.annotation.Transactional;
24 14
25 -import javax.annotation.Resource;  
26 -import java.util.List; 15 +import com.agent.entity.agent.ConsigneeEntity;
  16 +import com.agent.repository.agent.ConsigneeRepository;
  17 +import com.agent.service.BasicService;
  18 +import com.google.common.base.Splitter;
  19 +import com.plugin.easyui.EasyPage;
27 20
28 21
29 @Service 22 @Service
  1 +package com.agent.service.agent;
  2 +
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +
  6 +import javax.annotation.Resource;
  7 +
  8 +import org.apache.commons.collections.CollectionUtils;
  9 +import org.apache.commons.lang.StringUtils;
  10 +import org.springframework.stereotype.Service;
  11 +import org.springframework.transaction.annotation.Transactional;
  12 +
  13 +import com.agent.entity.agent.ConsignorEntity;
  14 +import com.agent.entity.agent.ManifestEntity;
  15 +import com.agent.entity.agent.PreparesecondaryEntity;
  16 +import com.agent.repository.agent.ConsignorRepository;
  17 +import com.agent.service.BasicService;
  18 +import com.google.common.base.Splitter;
  19 +
  20 +import tools.Tools;
  21 +
  22 +/**
  23 + *
  24 + * Depiction:发货人数据库操作
  25 + * <p>
  26 + * Modify:
  27 + * <p>
  28 + * Author: William Lynn
  29 + * <p>
  30 + * Create Date:2018年5月28日 下午2:25:53
  31 + *
  32 + */
  33 +@Service
  34 +public class ConsignorService extends BasicService<ConsignorEntity> {
  35 +
  36 + @Resource
  37 + private ConsignorRepository service;
  38 +
  39 + @Transactional
  40 + public void deleteAll(String ids) {
  41 + List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(ids);
  42 + for (String id : list) {
  43 + service.delete(Long.valueOf(id));
  44 + }
  45 + }
  46 +
  47 + public ConsignorEntity findByCodeAndName(String code, String company) {
  48 + List<ConsignorEntity> consigns = service.findByCodeAndCompany(code, company);
  49 + if (CollectionUtils.isNotEmpty(consigns)) {
  50 + return consigns.get(0);
  51 + }
  52 + return null;
  53 + }
  54 +
  55 + public ConsignorEntity findByCode(String code) {
  56 + List<ConsignorEntity> consigns = service.findByCode(code);
  57 + if (CollectionUtils.isNotEmpty(consigns)) {
  58 + return consigns.get(0);
  59 + }
  60 + return null;
  61 + }
  62 +
  63 + public ConsignorEntity findByCompany(String company) {
  64 + List<ConsignorEntity> consigns = service.findByCompany(company);
  65 + if (CollectionUtils.isNotEmpty(consigns)) {
  66 + return consigns.get(0);
  67 + }
  68 + return null;
  69 + }
  70 +
  71 + public void save(ConsignorEntity c) {
  72 + if (c != null) {
  73 + if (c.getCreateDate() == null) {
  74 + c.setCreateDate(new Date());
  75 + }
  76 +
  77 + if (c.getModifyDate() == null) {
  78 + c.setModifyDate(new Date());
  79 + }
  80 + service.save(c);
  81 + }
  82 + }
  83 +
  84 + public List<ConsignorEntity> findAll() {
  85 + return service.getAll();
  86 + }
  87 +
  88 + public List<ConsignorEntity> findAllByUserId(long user_id) {
  89 + return service.getAllByUserId(user_id);
  90 + }
  91 +
  92 + public void update(ConsignorEntity c) {
  93 + service.save(c);
  94 + }
  95 +
  96 + public List<ConsignorEntity> findById(String id) {
  97 + return service.findById(id);
  98 + }
  99 +
  100 + public void saveFromManifest(ManifestEntity manifest) {
  101 + if (manifest != null && StringUtils.isNotBlank(manifest.getCo_company())) {
  102 + ConsignorEntity bean = new ConsignorEntity();
  103 + bean.setCo_address(manifest.getCo_address());
  104 + bean.setCo_city(manifest.getCo_city());
  105 + bean.setCo_company(manifest.getCo_company());
  106 + bean.setCo_country(manifest.getCo_country());
  107 + bean.setCo_deltaname(manifest.getCo_deltaname());
  108 + bean.setCo_fax(manifest.getCo_fax());
  109 + bean.setCo_name(manifest.getCo_name());
  110 + bean.setCo_telephone(manifest.getCo_telephone());
  111 + bean.setCo_zipcode(manifest.getCo_zipcode());
  112 + bean.setShpaeo(manifest.getShpaeo());
  113 + bean.setShpcusid(manifest.getShpcusid());
  114 + bean.setModifyDate(new Date());
  115 + bean.setCreateDate(new Date());
  116 + bean.setCreator(Tools.getUserEntity());
  117 + bean.setModifier(Tools.getUserEntity());
  118 +
  119 + ConsignorEntity old = findByCompany(manifest.getCo_company());
  120 + if (old != null) {
  121 + service.delete(old.getId());
  122 + }
  123 + save(bean);
  124 + }
  125 + }
  126 +
  127 + public void saveFromPreparesecondary(PreparesecondaryEntity prepare) {
  128 + if (prepare != null && StringUtils.isNotBlank(prepare.getCo_company())) {
  129 + ConsignorEntity bean = new ConsignorEntity();
  130 + bean.setCo_address(prepare.getCo_address());
  131 + bean.setCo_city(prepare.getCo_city());
  132 + bean.setCo_company(prepare.getCo_company());
  133 + bean.setCo_country(prepare.getCo_country());
  134 + bean.setCo_deltaname(prepare.getCo_deltaname());
  135 + bean.setCo_fax(prepare.getCo_fax());
  136 + bean.setCo_name(prepare.getCo_name());
  137 + bean.setCo_telephone(prepare.getCo_telephone());
  138 + bean.setCo_zipcode(prepare.getCo_zipcode());
  139 + bean.setShpaeo(prepare.getShpaeo());
  140 + bean.setShpcusid(prepare.getShpcusid());
  141 + bean.setModifyDate(new Date());
  142 + bean.setCreateDate(new Date());
  143 + bean.setCreator(Tools.getUserEntity());
  144 + bean.setModifier(Tools.getUserEntity());
  145 +
  146 + ConsignorEntity old = findByCompany(prepare.getCo_company());
  147 + if (old != null) {
  148 + service.delete(old.getId());
  149 + }
  150 + save(bean);
  151 +
  152 + }
  153 + }
  154 +
  155 + // public Page<ConsignorEntity> getPage(EasyPage<ConsigneeEntity> pageForm) {
  156 + // PageRequest pageRequest = buildPageRequest(pageForm);
  157 + // Specification<ConsignorEntity> spec = buildSpecification(pageForm);
  158 + // Page<ConsignorEntity> page = service.findAll(spec, pageRequest);
  159 + // return page;
  160 + // }
  161 +}
1 package com.agent.service.agent; 1 package com.agent.service.agent;
2 2
3 3
4 -import com.agent.entity.Constant;  
5 -import com.agent.entity.agent.*;  
6 -import com.agent.repository.agent.*;  
7 -import com.agent.service.BasicService;  
8 -import com.framework.shiro.SessionUtil;  
9 -import com.google.common.base.Splitter;  
10 -import com.plugin.easyui.EasyPage; 4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +import javax.annotation.Resource;
  8 +
11 import org.apache.commons.collections.CollectionUtils; 9 import org.apache.commons.collections.CollectionUtils;
12 import org.apache.commons.lang.StringUtils; 10 import org.apache.commons.lang.StringUtils;
13 import org.springframework.data.domain.Page; 11 import org.springframework.data.domain.Page;
@@ -16,10 +14,21 @@ import org.springframework.data.jpa.domain.Specification; @@ -16,10 +14,21 @@ import org.springframework.data.jpa.domain.Specification;
16 import org.springframework.stereotype.Service; 14 import org.springframework.stereotype.Service;
17 import org.springframework.transaction.annotation.Transactional; 15 import org.springframework.transaction.annotation.Transactional;
18 16
19 -  
20 -import javax.annotation.Resource;  
21 -import java.util.Date;  
22 -import java.util.List; 17 +import com.agent.entity.Constant;
  18 +import com.agent.entity.agent.ConsigneeEntity;
  19 +import com.agent.entity.agent.HawbOtherFeeEntity;
  20 +import com.agent.entity.agent.MakeHawbEntity;
  21 +import com.agent.entity.agent.PackageSizeEntity;
  22 +import com.agent.entity.agent.PubFhrEntity;
  23 +import com.agent.repository.agent.ConsigneeRepository;
  24 +import com.agent.repository.agent.HawbOtherFeeRepository;
  25 +import com.agent.repository.agent.MakeHawbRepository;
  26 +import com.agent.repository.agent.PackageSizeRepository;
  27 +import com.agent.repository.agent.PubFhrRepository;
  28 +import com.agent.service.BasicService;
  29 +import com.framework.shiro.SessionUtil;
  30 +import com.google.common.base.Splitter;
  31 +import com.plugin.easyui.EasyPage;
23 32
24 33
25 @Service 34 @Service