作者 Kevin

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

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

要显示太多修改。

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

不能预览此文件类型
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
... ...
/target/
... ...
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>agent</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
... ...
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
... ...
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
... ...
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
... ...
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="ROOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="ROOT"/>
<property name="java-output-path" value="/agent/target/classes"/>
</wb-module>
</project-modules>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
... ...
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
... ...
Window
\ No newline at end of file
... ...
disabled=06target
eclipse.preferences.version=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">
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.airport</groupId>
<artifactId>agent</artifactId>
... ... @@ -6,14 +7,14 @@
<url>http://maven.apache.org</url>
<packaging>war</packaging>
<!-- 设定除中央仓库 (repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查询,如有Nexus私服, 取消注释并指向正确的服务器地址 -->
<repositories>
<!-- <repositories>
<repository>
<id>public</id>
<name>Public Repositories</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
</repositories> -->
<!-- 主要依赖库版本定义 -->
<properties>
... ... @@ -93,11 +94,12 @@
<version>1.2.16</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache</groupId>-->
<!--<artifactId>ant-zip</artifactId>-->
<!--<version>4.0</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/org.jdom/jdom -->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1.3</version>
</dependency>
<!-- junit -->
<dependency>
... ... @@ -145,7 +147,11 @@
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<!-- spring framework -->
... ... @@ -375,11 +381,11 @@
</dependency>
<!-- velocity 模板 -->
<dependency>
<!-- <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>${velocity.version}</version>
</dependency>
</dependency> -->
<dependency>
<groupId>org.apache.velocity</groupId>
... ... @@ -392,12 +398,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.7.11</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
... ... @@ -405,6 +405,12 @@
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.7</version>
</dependency>
</dependencies>
<!-- 配置文件 -->
... ... @@ -465,28 +471,13 @@
</configuration>
</plugin>
<!-- Maven 打包插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<webResources>
<resource>
<directory>src/main/resoreces/conf/${package.environment}</directory>
<targetPath>WEB-INF/classes</targetPath>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>-->
<!-- Maven 打包插件 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor>
</archive> <webResources> <resource> <directory>src/main/resoreces/conf/${package.environment}</directory>
<targetPath>WEB-INF/classes</targetPath> <filtering>true</filtering> </resource>
</webResources> </configuration> </plugin> -->
</plugins>
</build>
<modules>
<module>?</module>
</modules>
<!-- <modules> <module>?</module> </modules> -->
</project>
\ No newline at end of file
... ...
不能预览此文件类型
不能预览此文件类型
... ... @@ -8,15 +8,25 @@ import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.agent.entity.agent.BasicAgentEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.agent.controller.BasicController;
import com.agent.entity.agent.BillCheckEntity;
import com.agent.entity.agent.MakeHawbEntity;
import com.agent.entity.agent.MakeMawbEntity;
import com.agent.service.agent.*;
import com.agent.entity.agent.PubStationEntity;
import com.agent.service.agent.BasicAgentService;
import com.agent.service.agent.BillCheckService;
import com.agent.service.agent.MakeHawbService;
import com.agent.service.agent.MakeMawbService;
import com.agent.service.agent.PubStationService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.alibaba.fastjson.JSONObject;
import com.framework.shiro.SessionUtil;
import com.framework.util.DateFormat;
import billcheckservice.BillCheckServiceProxy;
... ... @@ -26,19 +36,6 @@ import billcheckservice.ReturnRecode;
import tools.BillCheckReturnData;
import tools.DataSerieal;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.struts.util.RequestUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.agent.controller.BasicController;
import com.agent.entity.agent.PubStationEntity;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* 账单核审
* @author 61004
... ...
package com.agent.controller.agent;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.agent.controller.BasicController;
import com.agent.entity.Constant;
import com.agent.entity.agent.*;
import com.agent.entity.system.UserEntity;
import com.agent.service.agent.*;
import com.agent.entity.agent.BasicAgentEntity;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.DeliveryInfoEntity;
import com.agent.entity.agent.HawbOtherFeeEntity;
import com.agent.entity.agent.MakeHawbEntity;
import com.agent.entity.agent.MakeMawbEntity;
import com.agent.entity.agent.MawbOtherFeeEntity;
import com.agent.entity.agent.PackageTypeEntity;
import com.agent.entity.agent.PubStationEntity;
import com.agent.service.agent.BasicAgentService;
import com.agent.service.agent.ConsigneeService;
import com.agent.service.agent.DeliveryInfoService;
import com.agent.service.agent.HawbOtherFeeService;
import com.agent.service.agent.MakeHawbService;
import com.agent.service.agent.MakeMawbService;
import com.agent.service.agent.MawbOtherFeeService;
import com.agent.service.agent.PackageSizeService;
import com.agent.service.agent.PackageTypeService;
import com.agent.service.agent.PubStationService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.agent.xml.bill.*;
import com.agent.xml.bill.ApplicableFreightRateServiceChargeXml;
import com.agent.xml.bill.ApplicableLogisticsAllowanceChargeXml;
import com.agent.xml.bill.ApplicableTradeCurrencyExchangeXml;
import com.agent.xml.bill.AssociatedPartyXml;
import com.agent.xml.bill.AssociatedUnitLoadTransportEquipmentXml;
import com.agent.xml.bill.BillHeadXml;
import com.agent.xml.bill.BillXmlBody;
import com.agent.xml.bill.ConsignorPartyXml;
import com.agent.xml.bill.DepartureEventXml;
import com.agent.xml.bill.DirectTelephoneCommunicationXml;
import com.agent.xml.bill.EventTimeXml;
import com.agent.xml.bill.HandlingInstructionsXml;
import com.agent.xml.bill.IncludedMasterConsignmentItemXml;
import com.agent.xml.bill.LinearSpatialDimensionXml;
import com.agent.xml.bill.MasterConsignmentXml;
import com.agent.xml.bill.NatureIdentificationTransportCargoXml;
import com.agent.xml.bill.OccurrenceArrivalLocationXml;
import com.agent.xml.bill.OperatingPartyXml;
import com.agent.xml.bill.PostalStructuredAddressXml;
import com.agent.xml.bill.ReportedStatusXml;
import com.agent.xml.bill.SignatoryCarrierAuthenticationXml;
import com.agent.xml.bill.SpecifiedLogisticsTransportMovementXml;
import com.agent.xml.bill.TransportLogisticsPackageXml;
import com.agent.xml.common.IDXml;
import com.agent.xml.common.NameXml;
import com.agent.xml.common.XmlUtil;
... ... @@ -20,29 +80,6 @@ import com.plugin.easyui.EasyPage;
import tools.Tools;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by cohesion on 2017/3/29.
*/
... ... @@ -52,7 +89,6 @@ public class BillController extends BasicController{
private static final Logger logger = LoggerFactory.getLogger(BillController.class);
@Resource
private MakeMawbService makeMawbService;
... ...
package com.agent.controller.agent;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
... ... @@ -14,9 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.agent.controller.BasicController;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsigneeInfo;
import com.agent.service.agent.ConsigneeService;
import com.agent.service.agent.PubStationService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.framework.core.Servlets;
... ...
package com.agent.controller.agent;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.agent.controller.BasicController;
import com.agent.entity.agent.ConsignorEntity;
import com.agent.service.agent.ConsignorService;
import com.agent.vo.ResponseModel;
import tools.Tools;
/**
*
* Depiction: 发货人控制器
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:24:33
*
*/
@Controller
@RequestMapping(value = "/consignor")
public class ConsignorController extends BasicController {
@Resource
private ConsignorService service;
@RequestMapping(value = "/getall")
@ResponseBody
public ResponseModel getAll(HttpServletRequest request) {
ResponseModel model = new ResponseModel(200, "", null);
List<ConsignorEntity> dataList = service.findAllByUserId(Tools.getUserId());
if (dataList == null || dataList.size() == 0) {
model = new ResponseModel(404, "", null);
} else {
model = new ResponseModel(200, "", null);
}
model.setData(dataList);
return model;
}
}
... ...
... ... @@ -660,7 +660,6 @@ public class DeliveryInfoController extends BasicController{
mas.setReportedstatus(reop);
String xml = XmlUtil.convertToXml2(mas, path);
// System.out.println(xml);
... ...
... ... @@ -10,7 +10,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.Manifest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
... ... @@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity;
import com.agent.entity.agent.PreparesecondaryEntity;
import com.agent.entity.agent.PubDgEntity;
import com.agent.entity.agent.TBasCarrierEntity;
import com.agent.entity.agent.WaybillReceiptType;
import com.agent.entity.system.UserEntity;
import com.agent.imf.agent.redis.RedisSaveMessage;
import com.agent.service.agent.BasicAgentService;
import com.agent.service.agent.ConsignorService;
import com.agent.service.agent.ManifestBillService;
import com.agent.service.agent.ManifestCommodityService;
import com.agent.service.agent.ManifestContainerService;
... ... @@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService;
import com.agent.service.agent.PreparesecondaryService;
import com.agent.service.agent.PubDgService;
import com.agent.service.agent.TBasCarrierService;
import com.agent.service.agent.WaybillReceiptService;
import com.agent.service.system.RoleService;
import com.agent.util.HttpJsonMsg;
import com.agent.vo.ResponseModel;
import com.agent.vo.agent.CommodityVo;
import com.agent.xml.common.XmlHead;
import com.agent.xml.common.XmlUtil;
import com.agent.xml.fhlsli.FSXmlKit;
import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody;
import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml;
import com.agent.xml.manifestdeclare.ManifestCarrierXml;
... ... @@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid;
import com.plugin.easyui.EasyPage;
import tools.DBConnection;
import tools.NumKit;
import tools.Tools;
import tools.oclass.FemyList;
... ... @@ -87,8 +91,7 @@ import tools.oclass.FemyList;
*/
@Controller
@RequestMapping(value = "/manifest")
public class ManifestController extends BasicController{
public class ManifestController extends BasicController {
private static final Logger logger = LoggerFactory.getLogger(ManifestController.class);
public static boolean isSuccess = false;
... ... @@ -123,138 +126,145 @@ public class ManifestController extends BasicController{
@Resource
private TBasCarrierService tbasService;
@Resource
private ConsignorService consignorService;
@Resource
private WaybillReceiptService receiptService;
/**
* 列表页面
*
* @return
*/
@RequestMapping(value = "/list")
public String getList(Model model){
public String getList(Model model) {
return "manifest/list";
}
//app端接口
//获取主单列表
// app端接口
// 获取主单列表
@RequestMapping(value = "/cross/grid.json")
@ResponseBody
public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response, EasyPage<ManifestEntity> pageForm){
// response.setCharacterEncoding("UTF-8");
// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
// response.setHeader("Pragma", "no-cache");
public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response,
EasyPage<ManifestEntity> pageForm) {
// response.setCharacterEncoding("UTF-8");
// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
// response.setHeader("Pragma", "no-cache");
response.setHeader("Access-Control-Allow-Origin", "*");
// response.setDateHeader("Expires", 0);
// response.setDateHeader("Expires", 0);
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
searchParams.put("EQ_USER_ID", Tools.getUserId());
pageForm.setSearchParams(searchParams);
//添加用户id的条件
// 添加用户id的条件
pageForm.parseData(manifestService.getPage(pageForm));
return pageForm.getData();
}
@RequestMapping(value = "/cross/edit")
@ResponseBody
public Map cross_edit(Long id, HttpServletResponse response){
System.out.println("id:"+id);
public Map cross_edit(Long id, HttpServletResponse response) {
System.out.println("id:" + id);
response.setHeader("Access-Control-Allow-Origin", "*");
Map model = new HashMap();
ManifestEntity manifest = null;
//判断是否是便捷
if(id!=null){
// 判断是否是便捷
if (id != null) {
manifest = manifestService.findOne(id);
}
UserEntity user = SessionUtil.getUser();
if(user!=null && user.getAgent()!=null){
if (user != null && user.getAgent() != null) {
BasicAgentEntity agent = agentService.findOne(user.getAgent());
model.put("agent",agent);
if(id == null) //是新增表单
model.put("agent", agent);
if (id == null) // 是新增表单
{
manifest = new ManifestEntity();
manifest.setAgentcompany(agent.getNameCn());
manifest.setAgentman(null); //设置代理人名称为null
manifest.setAgentman(null); // 设置代理人名称为null
}
}
model.put("manifest",manifest);
//海关关区
List<String> Customs = getCustoms();
model.put("CusToms",Customs);
//付款方式
model.put("manifest", manifest);
// 海关关区
List<String> Customs = getCustomsCode();
model.put("CusToms", Customs);
// 付款方式
List<String> payTypes = getPayTypes();
model.put("payTypes",payTypes);
//海关状态
model.put("payTypes", payTypes);
// 海关状态
List<String> customsStatus = getcustomsStatus();
model.put("customsStatus",customsStatus);
model.put("customsStatus", customsStatus);
//危险品代码
// 危险品代码
List<PubDgEntity> dgList = dgService.findAll();
model.put("dgList",dgList);
model.put("dgList", dgList);
//包装种类
// 包装种类
List<PackageTypeEntity> typeList = packageTypeService.findAll();
model.put("typeList",typeList);
model.put("typeList", typeList);
// model.addAttribute("customsStatus",flag);
// model.addAttribute("customsStatus",flag);
return model;
}
//保存或新增
@RequestMapping(value = "/cross/save" , method = {RequestMethod.POST })
// 保存或新增
@RequestMapping(value = "/cross/save", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response){
public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response) {
ResponseModel model = new ResponseModel();
response.setHeader("Access-Control-Allow-Origin", "*");
try {
manifest.setUSER_ID(Tools.getUserId());
if(manifestService.isExistsByWaybill(manifest))
{
if (manifestService.isExistsByWaybill(manifest)) {
model.setMsg("该订单已存在!");
model.setStatus(500);
}
else
{
} else {
String stowagedate = reuqest.getParameter("stowagedate");
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
//处理预配时间
manifest.setUSER_ID(SessionUtil.getUser().getId()); //设置用户id
// 处理预配时间
manifest.setUSER_ID(SessionUtil.getUser().getId()); // 设置用户id
manifest = manifestService.save(manifest);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}
return model;
}
//保存并发送主单信息
@RequestMapping(value = "/cross/savesend" , method = {RequestMethod.POST })
// 保存并发送主单信息
@RequestMapping(value = "/cross/savesend", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel cross_savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
public ResponseModel cross_savesend(ManifestEntity manifest, HttpServletRequest request,
HttpServletResponse response) {
ResponseModel model = new ResponseModel();
response.setHeader("Access-Control-Allow-Origin", "*");
try {
manifest.setUSER_ID(Tools.getUserId());
if(manifestService.isExistsByWaybill(manifest))
{
if (manifestService.isExistsByWaybill(manifest)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}
else
{
} else {
String stowagedate = request.getParameter("stowagedate");
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
//保存
// 保存
manifest.setIsdelete(1);
manifest.setResponse_text("主单已发送");
manifestService.save(manifest);
System.out.println("收货人名称:" + manifest.getSh_name());
System.out.println("发货人名称:" + manifest.getCo_name());
System.out.println("-----------------id:"+manifest.getId());
//生成报文并且发送
System.out.println("-----------------id:" + manifest.getId());
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
System.out.println(path); //path
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
System.out.println(path); // path
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
System.out.println(ndlrxml);
System.err.println(dlcfxml);
new RedisSaveMessage().saveMessage(ndlrxml);
... ... @@ -262,129 +272,132 @@ public class ManifestController extends BasicController{
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
} catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}
return model;
}
//分单列表获取接口
@RequestMapping(value="/cross/sub/grid.json")
// 分单列表获取接口
@RequestMapping(value = "/cross/sub/grid.json")
@ResponseBody
public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId,HttpServletRequest request, HttpServletResponse response) {
public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId, HttpServletRequest request,
HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
return dg;
}
//获取一条分单详情的接口
@RequestMapping(value="/cross/subedit", method = {RequestMethod.POST })
// 获取一条分单详情的接口
@RequestMapping(value = "/cross/subedit", method = { RequestMethod.POST })
@ResponseBody
private Map subedit(Long id,Long mawbId, HttpServletResponse response){
private Map subedit(Long id, Long mawbId, HttpServletResponse response) {
Map model = new HashMap();
ManifestEntity manifest = null;
List<PreparesecondaryEntity> preparesecondaryList = null;
PreparesecondaryEntity pre = null;
String str = "" ;
String str = "";
response.setHeader("Access-Control-Allow-Origin", "*");
if(mawbId!=null){
if (mawbId != null) {
manifest = manifestService.findOne(mawbId);
pre = preparesecondaryServer.findOne(mawbId);
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
if(preparesecondaryList.isEmpty()){
if (preparesecondaryList.isEmpty()) {
str = calculate(manifest);
}else{
str = calculates(manifest,preparesecondaryList);
} else {
str = calculates(manifest, preparesecondaryList);
}
}
if(id !=null){
if (id != null) {
pre = preparesecondaryServer.findOne(id);
manifest = manifestService.findOne(pre.getPreparemasterid());
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
if(preparesecondaryList.isEmpty()){
if (preparesecondaryList.isEmpty()) {
str = calculate(manifest);
}else{
str = calculates(manifest,preparesecondaryList);
} else {
str = calculates(manifest, preparesecondaryList);
}
}
UserEntity user = SessionUtil.getUser();
if(user!=null && user.getAgent()!=null){
if (user != null && user.getAgent() != null) {
BasicAgentEntity agent = agentService.findOne(user.getAgent());
model.put("agent",agent);
model.put("agent", agent);
}
//海关关区
List<String> Customs = getCustoms();
model.put("CusToms",Customs);
//付款方式
// 海关关区
List<String> Customs = getCustomsCode();
model.put("CusToms", Customs);
// 付款方式
List<String> payTypes = getPayTypes();
model.put("payTypes",payTypes);
//海关状态
model.put("payTypes", payTypes);
// 海关状态
List<String> customsStatus = getcustomsStatus();
model.put("customsStatus",customsStatus);
model.put("customsStatus", customsStatus);
//危险品代码
// 危险品代码
List<PubDgEntity> dgList = dgService.findAll();
model.put("dgList",dgList);
model.put("dgList", dgList);
//包装种类
// 包装种类
List<PackageTypeEntity> typeList = packageTypeService.findAll();
model.put("typeList",typeList);
model.put("typeList", typeList);
model.put("is_strs",str);
model.put("id",mawbId);
model.put("manifest",manifest);
model.put("pre",pre);
model.put("is_strs", str);
model.put("id", mawbId);
model.put("manifest", manifest);
model.put("pre", pre);
return model;
}
//保存分单
@RequestMapping(value = "/cross/sub_save" , method = {RequestMethod.POST })
// 保存分单
@RequestMapping(value = "/cross/sub_save", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response){
public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response) {
ResponseModel model = new ResponseModel();
try {
response.setHeader("Access-Control-Allow-Origin", "*");
//已存在,提示给用户
if(preparesecondaryServer.isExists(Preparesecondary)){
// 已存在,提示给用户
if (preparesecondaryServer.isExists(Preparesecondary)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}else{
} else {
Preparesecondary.setCreateDate(new Date());
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
model.setData(Preparesecondary);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}
return model;
}
@RequestMapping(value = "/cross/presavesend" , method = {RequestMethod.POST })
@RequestMapping(value = "/cross/presavesend", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request,
HttpServletResponse response){
public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary, HttpServletRequest request,
HttpServletResponse response) {
ResponseModel model = new ResponseModel();
try {
response.setHeader("Access-Control-Allow-Origin", "*");
if(preparesecondaryServer.isExists(Preparesecondary))
{
if (preparesecondaryServer.isExists(Preparesecondary)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}
else{
} else {
String stowagedate = request.getParameter("stowagedate");
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
//生成报文并且发送
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
//发送redis储存数据
// 发送redis储存数据
// System.out.println(ndlrxml);
new RedisSaveMessage().saveMessage(ndlrxml);
new RedisSaveMessage().saveMessage(dlcfxml);
... ... @@ -396,7 +409,7 @@ public class ManifestController extends BasicController{
Preparesecondary.setResponse_text("分单已发送");
preparesecondaryServer.save(Preparesecondary);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -404,28 +417,21 @@ public class ManifestController extends BasicController{
return model;
}
/**
* 查询分页数据
*
* @return
*/
@RequestMapping(value="/grid.json")
@RequestMapping(value = "/grid.json")
@ResponseBody
public DataGrid<ManifestEntity> grid(HttpServletRequest request,EasyPage<ManifestEntity> pageForm) {
public DataGrid<ManifestEntity> grid(HttpServletRequest request, EasyPage<ManifestEntity> pageForm) {
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
// searchParams.put("EQ_isdelete", 0);
// searchParams.put("EQ_isdelete", 0);
pageForm.setSearchParams(searchParams);
//UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
if(ue != null){
// UserEntity ue =
// (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
UserEntity ue = (UserEntity) SecurityUtils.getSubject().getSession().getAttribute("user");
if (ue != null) {
Long u = ue.getId();
Set<String> sk = pageForm.getSearchParams().keySet();
pageForm.getSearchParams().put("EQ_USER_ID", u);
... ... @@ -442,22 +448,20 @@ public class ManifestController extends BasicController{
* @return
* @return
*/
@RequestMapping(value = "/infor" )
@RequestMapping(value = "/infor")
@ResponseBody
public List<ManifestEntity> infor(String id,Model model) {
public List<ManifestEntity> infor(String id, Model model) {
List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId());
List<ManifestEntity> result = new FemyList();
for(ManifestEntity me : li){
if(result.contains(me))
{
}
else
{
for (ManifestEntity me : li) {
if (result.contains(me)) {
} else {
result.add(me);
}
}
return result;
}
/**
* * 模糊查询匹配信息
*
... ... @@ -465,24 +469,21 @@ public class ManifestController extends BasicController{
* @return
* @return
*/
@RequestMapping(value = "/inforPre" )
@RequestMapping(value = "/inforPre")
@ResponseBody
public List<PreparesecondaryEntity> inforPre(String id,Model model) {
public List<PreparesecondaryEntity> inforPre(String id, Model model) {
List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId());
List<PreparesecondaryEntity> result = new FemyList();
for(PreparesecondaryEntity pe : li){
if(result.contains(pe)){
for (PreparesecondaryEntity pe : li) {
if (result.contains(pe)) {
}
else
{
} else {
result.add(pe);
}
}
return result;
}
/**
* 编辑
*
... ... @@ -490,86 +491,83 @@ public class ManifestController extends BasicController{
* @return
*/
@RequestMapping(value = "/edit")
public String edit(Long id,Model model){
public String edit(Long id, Model model) {
ManifestEntity manifest = null;
//判断是否是便捷
if(id!=null){
// 判断是否是便捷
if (id != null) {
manifest = manifestService.findOne(id);
}
UserEntity user = SessionUtil.getUser();
if(user!=null && user.getAgent()!=null){
if (user != null && user.getAgent() != null) {
BasicAgentEntity agent = agentService.findOne(user.getAgent());
model.addAttribute("agent",agent);
if(id == null) //是新增表单
model.addAttribute("agent", agent);
if (id == null) // 是新增表单
{
manifest = new ManifestEntity();
manifest.setAgentcompany(agent.getNameCn());
manifest.setAgentman(null); //设置代理人名称为null
manifest.setAgentman(null); // 设置代理人名称为null
}
}
model.addAttribute("manifest",manifest);
//海关关区
List<String> Customs = getCustoms();
model.addAttribute("CusToms",Customs);
//付款方式
model.addAttribute("manifest", manifest);
// 海关关区
List<String> Customs = getCustomsCode();
model.addAttribute("CusToms", Customs);
// 付款方式
List<String> payTypes = getPayTypes();
model.addAttribute("payTypes",payTypes);
//海关状态
model.addAttribute("payTypes", payTypes);
// 海关状态
List<String> customsStatus = getcustomsStatus();
model.addAttribute("customsStatus",customsStatus);
model.addAttribute("customsStatus", customsStatus);
//危险品代码
// 危险品代码
List<PubDgEntity> dgList = dgService.findAll();
model.addAttribute("dgList",dgList);
model.addAttribute("dgList", dgList);
//包装种类
// 包装种类
List<PackageTypeEntity> typeList = packageTypeService.findAll();
model.addAttribute("typeList",typeList);
model.addAttribute("typeList", typeList);
// model.addAttribute("customsStatus",flag);
// model.addAttribute("customsStatus",flag);
return "manifest/edit";
}
/**
* 查询主单号是否存在
*
* @param mawbNo
* @return
*/
@RequestMapping(value = "/queryMawbNo",method = {RequestMethod.POST})
@RequestMapping(value = "/queryMawbNo", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel queryMawbId(Long id,String mawbNo){
public ResponseModel queryMawbId(Long id, String mawbNo) {
ResponseModel model = new ResponseModel();
List<ManifestEntity> list = null;
if(StringUtils.isNotEmpty(mawbNo)){
if (StringUtils.isNotEmpty(mawbNo)) {
list = manifestService.findByMawbNo(mawbNo);
}
boolean exist = false;
if(CollectionUtils.isNotEmpty(list)){
if(list.size()>0){
if (CollectionUtils.isNotEmpty(list)) {
if (list.size() > 0) {
exist = true;
}
}
if(exist){
if (exist) {
model.setStatus(500);
}
else {
} else {
model.setStatus(200);
}
return model;
}
/**
* 查询分制单分页数据
*
* @return
*/
@RequestMapping(value="/sub/grid.json")
@RequestMapping(value = "/sub/grid.json")
@ResponseBody
public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId,HttpServletRequest request) {
public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId, HttpServletRequest request) {
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
return dg;
... ... @@ -581,65 +579,64 @@ public class ManifestController extends BasicController{
* @param id
* @return
*/
@RequestMapping(value = "/subedit", method = {RequestMethod.GET })
private String subedit(Long id,Long mawbId,String type, Model model){
@RequestMapping(value = "/subedit", method = { RequestMethod.GET })
private String subedit(Long id, Long mawbId, String type, Model model) {
ManifestEntity manifest = null;
List<PreparesecondaryEntity> preparesecondaryList = null;
PreparesecondaryEntity pre = null;
String str = "" ;
if(mawbId!=null ){
String str = "";
if (mawbId != null) {
manifest = manifestService.findOne(mawbId);
pre = preparesecondaryServer.findOne(mawbId);
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
if(preparesecondaryList.isEmpty()){
if (preparesecondaryList.isEmpty()) {
str = calculate(manifest);
}else{
str = calculates(manifest,preparesecondaryList);
} else {
str = calculates(manifest, preparesecondaryList);
}
}
if(id !=null){
if (id != null) {
pre = preparesecondaryServer.findOne(id);
manifest = manifestService.findOne(pre.getPreparemasterid());
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
if(preparesecondaryList.isEmpty()){
if (preparesecondaryList.isEmpty()) {
str = calculate(manifest);
}else{
str = calculates(manifest,preparesecondaryList);
} else {
str = calculates(manifest, preparesecondaryList);
}
}
UserEntity user = SessionUtil.getUser();
if(user!=null && user.getAgent()!=null){
if (user != null && user.getAgent() != null) {
BasicAgentEntity agent = agentService.findOne(user.getAgent());
model.addAttribute("agent",agent);
model.addAttribute("agent", agent);
}
//海关关区
List<String> Customs = getCustoms();
model.addAttribute("CusToms",Customs);
//付款方式
// 海关关区
List<String> Customs = getCustomsCode();
model.addAttribute("CusToms", Customs);
// 付款方式
List<String> payTypes = getPayTypes();
model.addAttribute("payTypes",payTypes);
//海关状态
model.addAttribute("payTypes", payTypes);
// 海关状态
List<String> customsStatus = getcustomsStatus();
model.addAttribute("customsStatus",customsStatus);
model.addAttribute("customsStatus", customsStatus);
//危险品代码
// 危险品代码
List<PubDgEntity> dgList = dgService.findAll();
model.addAttribute("dgList",dgList);
model.addAttribute("dgList", dgList);
//包装种类
// 包装种类
List<PackageTypeEntity> typeList = packageTypeService.findAll();
model.addAttribute("typeList",typeList);
model.addAttribute("typeList", typeList);
model.addAttribute("is_strs",str);
model.addAttribute("id",mawbId);
model.addAttribute("manifest",manifest);
model.addAttribute("pre",pre);
model.addAttribute("is_strs", str);
model.addAttribute("id", mawbId);
model.addAttribute("manifest", manifest);
model.addAttribute("pre", pre);
return "manifest/sub_edit";
}
//计算 运单件数 运单重量 预配件数 预配重量
// 计算 运单件数 运单重量 预配件数 预配重量
private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) {
int pp = 0;
int tw = 0;
... ... @@ -647,54 +644,45 @@ public class ManifestController extends BasicController{
int pw = 0;
for (PreparesecondaryEntity pre : preparesecondaryList) {
pp += Integer.parseInt(pre.getPreparepiece()) ;
tw += Integer.parseInt(pre.getTotalweight()) ;
tp += Integer.parseInt(pre.getTotalpiece()) ;
pw += Integer.parseInt(pre.getPrepareweight()) ;
}
int zpp =Integer.parseInt(manifest.getPreparetotalpiece())-pp;
int ztw =Integer.parseInt(manifest.getTotalweight())-tw;
int ztp =Integer.parseInt(manifest.getTotalpiece())-tp;
int zpw =Integer.parseInt(manifest.getPreparetotalweight())-pw;
String str ="{";
str +="\"id\":\""+manifest.getId()+"\",";
str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
str +="\"totalpiece\":\""+ztp+"\",";
str +="\"totalweight\":\""+ztw+"\",";
str +="\"preparetotalpiece\":\""+zpp+"\",";
str +="\"preparetotalweight\":\""+zpw+"\"";
str +="}";
pp += Integer.parseInt(pre.getPreparepiece());
tw += Integer.parseInt(pre.getTotalweight());
tp += Integer.parseInt(pre.getTotalpiece());
pw += Integer.parseInt(pre.getPrepareweight());
}
int zpp = Integer.parseInt(manifest.getPreparetotalpiece()) - pp;
int ztw = Integer.parseInt(manifest.getTotalweight()) - tw;
int ztp = Integer.parseInt(manifest.getTotalpiece()) - tp;
int zpw = Integer.parseInt(manifest.getPreparetotalweight()) - pw;
String str = "{";
str += "\"id\":\"" + manifest.getId() + "\",";
str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
str += "\"totalpiece\":\"" + ztp + "\",";
str += "\"totalweight\":\"" + ztw + "\",";
str += "\"preparetotalpiece\":\"" + zpp + "\",";
str += "\"preparetotalweight\":\"" + zpw + "\"";
str += "}";
return str;
}
//计算 运单件数 运单重量 预配件数 预配重量
// 计算 运单件数 运单重量 预配件数 预配重量
private String calculate(ManifestEntity manifest) {
String str ="{";
str +="\"id\":\""+manifest.getId()+"\",";
str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
str +="\"totalpiece\":\""+manifest.getTotalpiece()+"\",";
str +="\"totalweight\":\""+manifest.getTotalweight()+"\",";
str +="\"preparetotalpiece\":\""+manifest.getPreparetotalpiece()+"\",";
str +="\"preparetotalweight\":\""+manifest.getPreparetotalweight()+"\"";
str +="}";
String str = "{";
str += "\"id\":\"" + manifest.getId() + "\",";
str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
str += "\"totalpiece\":\"" + manifest.getTotalpiece() + "\",";
str += "\"totalweight\":\"" + manifest.getTotalweight() + "\",";
str += "\"preparetotalpiece\":\"" + manifest.getPreparetotalpiece() + "\",";
str += "\"preparetotalweight\":\"" + manifest.getPreparetotalweight() + "\"";
str += "}";
return str;
}
//海关状态
// 海关状态
private List<String> getcustomsStatus() {
List<String> list = new ArrayList<>();
list.add("4604");
list.add("4620");
return list;
}
//海关关区
private List<String> getCustoms() {
List<String> list = new ArrayList<>();
//国际转运
// 国际转运
list.add("001");// 进、出口货物
list.add("002");// 国际转运货物
list.add("003");// 国境货物
... ... @@ -702,10 +690,18 @@ public class ManifestController extends BasicController{
return list;
}
//支付方式
// 海关关区
private List<String> getCustomsCode() {
List<String> list = new ArrayList<>();
list.add("4604");
list.add("4620");
return list;
}
// 支付方式
private List<String> getPayTypes() {
List<String> list = new ArrayList<>();
//预付
// 预付
list.add("001");// 预付
list.add("002");// 到付
return list;
... ... @@ -717,64 +713,63 @@ public class ManifestController extends BasicController{
* @param id
* @return
*/
// @RequestMapping(value = "/bill/edit")
// public String editBill(Long id,Long manifestId,Model model){
// ManifestBillEntity bill = null;
// if(id==null){
// bill = new ManifestBillEntity();
// bill.setManifestId(manifestId);
// }else {
// bill = billService.findOne(id);
// }
// //包装种类
// List<PackageTypeEntity> typeList = packageTypeService.findAll();
// model.addAttribute("typeList",typeList);
// model.addAttribute("bill",bill);
// return "manifest/edit_bill";
// }
//查询主单号是否已经存在
// @RequestMapping(value = "/bill/edit")
// public String editBill(Long id,Long manifestId,Model model){
// ManifestBillEntity bill = null;
// if(id==null){
// bill = new ManifestBillEntity();
// bill.setManifestId(manifestId);
// }else {
// bill = billService.findOne(id);
// }
// //包装种类
// List<PackageTypeEntity> typeList = packageTypeService.findAll();
// model.addAttribute("typeList",typeList);
// model.addAttribute("bill",bill);
// return "manifest/edit_bill";
// }
// 查询主单号是否已经存在
@RequestMapping(value = "existsManifestNo")
@ResponseBody
public ResponseModel editBill(String waybill){
public ResponseModel editBill(String waybill) {
ResponseModel model = new ResponseModel(200, null, null);
List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill);
if(manifestList.size() > 0)
{
if (manifestList.size() > 0) {
model.setData("该注单号已经存在了!");
model.setStatus(0);
}
return model;
}
/**
* 保存
*
* @param manifest
* @return
*/
@RequestMapping(value = "/save" , method = {RequestMethod.POST })
@RequestMapping(value = "/save", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest){
public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest) {
consignorService.saveFromManifest(manifest);
ResponseModel model = new ResponseModel();
try {
manifest.setUSER_ID(Tools.getUserId());
if(manifestService.isExistsByWaybill(manifest))
{
if (manifestService.isExistsByWaybill(manifest)) {
model.setMsg("该订单已存在!");
model.setStatus(500);
}
else
{
} else {
String stowagedate = reuqest.getParameter("stowagedate");
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
manifest.setSave_time(new Long(System.currentTimeMillis()));
//处理预配时间
// 处理预配时间
manifest = manifestService.save(manifest);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -782,136 +777,155 @@ public class ManifestController extends BasicController{
return model;
}
//撤销主单
// 撤销主单
@RequestMapping(value = "/backout")
@ResponseBody
public ResponseModel backout(HttpServletRequest request, Long id){
public ResponseModel backout(HttpServletRequest request, Long id) {
ResponseModel model = new ResponseModel(1, null, "");
ManifestEntity manifest = null;
try{
if(id != null)
{
try {
if (id != null) {
WaybillReceiptType type = WaybillReceiptType.DELETE;
manifest = manifestService.findOne((id));
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; //获取生成报文路径
String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); //转换报文
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml"; // 获取生成报文路径
String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); // 转换报文
System.out.println(path);
System.out.println(ndlxml);
new RedisSaveMessage().saveMessage(ndlxml); //发送
new RedisSaveMessage().saveMessage(ndlxml); // 发送
model.setStatus(200);
manifest.setResponse_text("撤销请求已发送");
manifest.setResponse_text("主单——" + type.getName());
manifest.setResponse_code(String.valueOf(type.getValue()));
manifestService.save(manifest);
receiptService.saveFromManifest(manifest, type);
}
}catch(Exception e){
} catch (Exception e) {
model.setStatus(10060);
model.setMsg("连接超时!");
}
return model;
}
/*
* 撤销分单
*/
@RequestMapping(value = "housebillbackout")
@ResponseBody
public ResponseModel housebillbackout(HttpServletRequest request, Long id){
public ResponseModel housebillbackout(HttpServletRequest request, Long id) {
ResponseModel model = new ResponseModel(1, null, "");
return model;
}
@RequestMapping(value = "app/send", method = {RequestMethod.POST})
@RequestMapping(value = "app/send", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response){
public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
ResponseModel model = new ResponseModel(200, null, "主单发送成功!");
return model;
}
/**
* 保存并且发送
* 主单提交表单保存并且发送报文
*
* @param manifest
* @return
*/
@RequestMapping(value = "/savesend" , method = {RequestMethod.POST })
@RequestMapping(value = "/savesend", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
public ResponseModel savesend(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
consignorService.saveFromManifest(manifest);
ResponseModel model = new ResponseModel();
try {
manifest.setUSER_ID(Tools.getUserId());
if(manifestService.isExistsByWaybill(manifest))
{
if (manifestService.isExistsByWaybill(manifest)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}
else
{
String stowagedate = request.getParameter("stowagedate");
} else {
String responseCode = manifest.getResponse_code();
int resCode = NumKit.parseString2Int(responseCode);
WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
String stowagedate = request.getParameter("stowagedate");
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
//保存
// 保存
manifest.setIsdelete(1);
manifest.setResponse_text("主单已发送");
manifest.setResponse_code(String.valueOf(type.getValue()));
manifest.setResponse_text("主单——" + type.getName());
manifest.setSave_time(System.currentTimeMillis());
manifestService.save(manifest);
receiptService.saveFromManifest(manifest, type);
System.out.println("收货人名称:" + manifest.getSh_name());
System.out.println("发货人名称:" + manifest.getCo_name());
System.out.println("-----------------id:"+manifest.getId());
//生成报文并且发送
System.out.println("-----------------id:" + manifest.getId());
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
System.out.println(path); //path
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
String slifxml = XmlUtil.convertToXml(FSXmlKit.sliXml(manifest));
System.out.println("===================ndlrxml===================");
System.out.println(ndlrxml);
System.out.println();
System.out.println("===================dlcfxml===================");
System.err.println(dlcfxml);
System.out.println();
System.out.println("===================slifxml===================");
System.err.println(slifxml);
System.out.println();
new RedisSaveMessage().saveMessage(ndlrxml);
new RedisSaveMessage().saveMessage(dlcfxml);
new RedisSaveMessage().saveMessage(slifxml);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
}
return model;
}
/**
* 发送交运报并且保存
*
* @param manifest
* @return
*/
@RequestMapping(value = "/sendDelivery" , method = {RequestMethod.POST })
@RequestMapping(value = "/sendDelivery", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel sendDelivery(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
public ResponseModel sendDelivery(ManifestEntity manifest, HttpServletRequest request,
HttpServletResponse response) {
ResponseModel model = new ResponseModel();
try {
manifest.setUSER_ID(Tools.getUserId());
if(manifestService.isExistsByWaybill(manifest)){
if (manifestService.isExistsByWaybill(manifest)) {
model.setStatus(500);
model.setMsg("订单已存在!");
}
else{
//保存
} else {
// 保存
manifest.setDe_ids(1);
String stowagedate = request.getParameter("stowagedate");
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
manifest = manifestService.save(manifest);
//生成报文并且发送
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path);
// System.out.println(dlcfxml);
new RedisSaveMessage().saveMessage(dlcfxml);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -925,9 +939,9 @@ public class ManifestController extends BasicController{
* @param manifest
* @return
*/
@RequestMapping(value = "/saveis_delete" , method = {RequestMethod.POST })
@RequestMapping(value = "/saveis_delete", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel saveis_delete(ManifestEntity manifest){
public ResponseModel saveis_delete(ManifestEntity manifest) {
ResponseModel model = new ResponseModel();
try {
manifest.setIsdelete(1);
... ... @@ -935,7 +949,7 @@ public class ManifestController extends BasicController{
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -949,23 +963,25 @@ public class ManifestController extends BasicController{
* @param manifest
* @return
*/
@RequestMapping(value = "/sub_save" , method = {RequestMethod.POST })
@RequestMapping(value = "/sub_save", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel sub_save(PreparesecondaryEntity Preparesecondary){
public ResponseModel sub_save(PreparesecondaryEntity preparesecondary) {
consignorService.saveFromPreparesecondary(preparesecondary);
ResponseModel model = new ResponseModel();
try {
//已存在,提示给用户
if(preparesecondaryServer.isExists(Preparesecondary)){
// 已存在,提示给用户
if (preparesecondaryServer.isExists(preparesecondary)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}else{
Preparesecondary.setCreateDate(new Date());
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
model.setData(Preparesecondary);
} else {
preparesecondary.setCreateDate(new Date());
preparesecondary = preparesecondaryServer.save(preparesecondary);
model.setData(preparesecondary);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -973,28 +989,34 @@ public class ManifestController extends BasicController{
return model;
}
//撤销分单
// 撤销分单
@RequestMapping(value = "prebackout")
@ResponseBody
public ResponseModel prebackout(HttpServletRequest request, Long id){
public ResponseModel prebackout(HttpServletRequest request, Long id) {
ResponseModel model = new ResponseModel(200, null, "");
if(id != null)
{
System.out.println("id:"+id);
if (id != null) {
System.out.println("id:" + id);
PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
if(preparesecondary != null)
{
try{
if (preparesecondary != null) {
try {
WaybillReceiptType type = WaybillReceiptType.DELETE;
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary), path);
//String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),
path);
// String dlcfxml =
// XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary),
// path);
//System.out.println(ndlrxml);
// System.out.println(ndlrxml);
new RedisSaveMessage().saveMessage(ndlrxml);
preparesecondary.setResponse_text("撤销请求已发送");
preparesecondary.setResponse_text("分单——" + type.getName());
preparesecondary.setResponse_code(String.valueOf(type.getValue()));
preparesecondaryServer.save(preparesecondary);
}catch(Exception e){
receiptService.saveFromPreparesecondary(preparesecondary, type);
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
}
... ... @@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{
}
return model;
}
/**
* 保存并且发送
* 子单提交表单保存并且发送报文
*
* @param manifest
* @return
*/
@RequestMapping(value = "/presavesend" , method = {RequestMethod.POST })
@RequestMapping(value = "/presavesend", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
public ResponseModel presavesend(PreparesecondaryEntity preparesecondary, HttpServletRequest request) {
consignorService.saveFromPreparesecondary(preparesecondary);
ResponseModel model = new ResponseModel();
try {
if(preparesecondaryServer.isExists(Preparesecondary))
{
if (preparesecondaryServer.isExists(preparesecondary)) {
model.setStatus(500);
model.setMsg("该订单号已存在!");
}
else{
} else {
String responseCode = preparesecondary.getResponse_code();
int resCode = NumKit.parseString2Int(responseCode);
WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
String stowagedate = request.getParameter("stowagedate");
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
//生成报文并且发送
preparesecondary.setStowagedate(preparesecondary.getStowagedate(stowagedate));
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
//发送redis储存数据
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), path);
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
String fhlfxml = XmlUtil.convertToXml(FSXmlKit.fhlXml(preparesecondary));
// 发送redis储存数据
// System.out.println(ndlrxml);
new RedisSaveMessage().saveMessage(ndlrxml);
new RedisSaveMessage().saveMessage(dlcfxml);
model.setData(Preparesecondary);
new RedisSaveMessage().saveMessage(fhlfxml);
model.setData(preparesecondary);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
System.out.println("===================ndlrxml===================");
System.out.println(ndlrxml);
System.out.println(dlcfxml);
System.out.println();
System.out.println("===================dlcfxml===================");
System.err.println(dlcfxml);
System.out.println();
System.out.println("===================fhlfxml===================");
System.err.println(fhlfxml);
System.out.println();
preparesecondary.setIsdelete(1);
preparesecondary.setResponse_code(String.valueOf(type.getValue()));
preparesecondary.setResponse_text("分单——" + type.getName());
preparesecondaryServer.save(preparesecondary);
receiptService.saveFromPreparesecondary(preparesecondary, type);
Preparesecondary.setIsdelete(1);
Preparesecondary.setResponse_text("分单已发送");
preparesecondaryServer.save(Preparesecondary);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{
* @param manifest
* @return
*/
@RequestMapping(value = "/presendDelivery" , method = {RequestMethod.POST })
@RequestMapping(value = "/presendDelivery", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary, HttpServletRequest request) {
ResponseModel model = new ResponseModel();
try {
if(preparesecondaryServer.isExists(Preparesecondary)){
if (preparesecondaryServer.isExists(Preparesecondary)) {
model.setStatus(500);
model.setMsg("改订单号已经存在了!");
}
else{
} else {
Preparesecondary.setIsdelete(1);
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
//生成报文并且发送
// 生成报文并且发送
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path);
//发送redis储存数据
// 发送redis储存数据
// System.out.println(dlcfxml);
new RedisSaveMessage().saveMessage(dlcfxml);
model.setData(Preparesecondary);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{
* @param manifest
* @return
*/
@RequestMapping(value = "/daryMawbNo" , method = {RequestMethod.POST })
@RequestMapping(value = "/daryMawbNo", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel daryMawbNo(Long id,String mawbNo){
public ResponseModel daryMawbNo(Long id, String mawbNo) {
ResponseModel model = new ResponseModel();
List<PreparesecondaryEntity> list = null;
if(StringUtils.isNotEmpty(mawbNo)){
if (StringUtils.isNotEmpty(mawbNo)) {
list = preparesecondaryServer.findByMawbNo(mawbNo);
}
boolean exist = false;
if(CollectionUtils.isNotEmpty(list)){
if(list.size()>0){
if (CollectionUtils.isNotEmpty(list)) {
if (list.size() > 0) {
exist = true;
}
}
if(exist){
if (exist) {
model.setStatus(500);
}
else {
} else {
model.setStatus(200);
}
return model;
}
@RequestMapping(value = "/xml",method = RequestMethod.POST)
@RequestMapping(value = "/xml", method = RequestMethod.POST)
@ResponseBody
public ResponseModel createXml(Long id,HttpServletRequest request,HttpServletResponse response) throws Exception {
public ResponseModel createXml(Long id, HttpServletRequest request, HttpServletResponse response) throws Exception {
ResponseModel model = new ResponseModel();
String rootPath = request.getSession().getServletContext().getRealPath("/");
String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
String xml = "";
if(id!=null){
xml = beanToXml(path,id);
if (id != null) {
xml = beanToXml(path, id);
}
model.setData(xml);
return model;
}
//生成报文
private String beanToXml(String path,Long id) throws Exception{
// 生成报文
private String beanToXml(String path, Long id) throws Exception {
ManifestEntity maen = manifestService.findOne(id);
List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId());
DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody();
//设置xml开头
// 设置xml开头
XmlHead head = new XmlHead();
head.setMessageID("CN_MT2201_1P0_460470678920X_"+Constant.dateTimeFormatnumber.format(new Date()));
head.setMessageID("CN_MT2201_1P0_460470678920X_" + Constant.dateTimeFormatnumber.format(new Date()));
head.setFunctionCode("9");
head.setMessageType("MT2201");
head.setSenderID("460470678920X_DXPENT0000460002");
... ... @@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{
head.setSendTime(Constant.dateTimeFormatnumber.format(new Date()));
head.setVersion("1.0");
body.setHead(head);
//预配舱单
// 预配舱单
ManifestDeclarationXml dec = new ManifestDeclarationXml();
//预配舱单主表信息
//承运人
// 预配舱单主表信息
// 承运人
ManifestCarrierXml carr = new ManifestCarrierXml();
carr.setId(maen.getCarrier());
dec.setCarrier(carr);
//起始站
// 起始站
ManifestOrgXml mo = new ManifestOrgXml();
mo.setId(maen.getOriginatingstation());
dec.setOrg(mo);
//目的站
// 目的站
ManifestDesXml md = new ManifestDesXml();
md.setId(maen.getDestinationstation());
dec.setDes(md);
//航班号-航班日期
// 航班号-航班日期
ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml();
mt.setJourneyid(maen.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));
mt.setJourneyid(maen.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
dec.setBordertransportmeans(mt);
ManifestConsignmentXml mcs = new ManifestConsignmentXml();
//运单号
// 运单号
ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml();
mac.setId(maen.getWaybillnomaster());
mcs.setTransportcontractdocument(mac);
//装载日期
// 装载日期
ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml();
ml.setId("CGO/4604");
ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate()));
... ... @@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{
mcs.setAgentname(maen.getAgentman());
mcs.setAgentCompany(maen.getAgentcompany());
// ManifestConsigneeXml mcons = new ManifestConsigneeXml();
// mcons.setName(maen.getConsigneename());
//
// ManifestAddressXml madd = new ManifestAddressXml();
// madd.setLine(maen.getConsigneeaddress());
// madd.setCityname(maen.getConsigneecity());
// madd.setCountrycode(maen.getCountrycode());
// madd.setProvincecode(maen.getProvincecode());
// madd.setProvincename(maen.getProvincename());
// madd.setZipcode(maen.getZipcode());
// mcons.setAddress(madd);
// mcs.setConsignee(mcons);
//
// ManifestConsigneeXml mcons = new ManifestConsigneeXml();
// mcons.setName(maen.getConsigneename());
//
// ManifestAddressXml madd = new ManifestAddressXml();
// madd.setLine(maen.getConsigneeaddress());
// madd.setCityname(maen.getConsigneecity());
// madd.setCountrycode(maen.getCountrycode());
// madd.setProvincecode(maen.getProvincecode());
// madd.setProvincename(maen.getProvincename());
// madd.setZipcode(maen.getZipcode());
// mcons.setAddress(madd);
// mcs.setConsignee(mcons);
//
ManifestConsignorXml maci = new ManifestConsignorXml();
// maci.setName(maen.getShippername());
// maci.setName(maen.getShippername());
ManifestsAddressXml msadd = new ManifestsAddressXml();
// msadd.setLine(maen.getShipperaddress());
// msadd.setCityname(maen.getShippercity());
// msadd.setLine(maen.getShipperaddress());
// msadd.setCityname(maen.getShippercity());
maci.setAddress(msadd);
mcs.setConsignor(maci);
//预配舱单子表信息
if(preparesecondaryList !=null ){
// 预配舱单子表信息
if (preparesecondaryList != null) {
List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>();
for (PreparesecondaryEntity entity : preparesecondaryList) {
ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml();
... ... @@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{
maconca.setDes(dess);
ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml();
mtm.setJourneyid(entity.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));;
mtm.setJourneyid(entity.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
;
maconca.setBorderTransportMeans(mtm);
ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml();
... ... @@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{
maconca.setAgentname(entity.getAgentman());
maconca.setCustomscode(entity.getCustomscode());
// ManifestAddressXml madds = new ManifestAddressXml();
// madds.setLine(entity.getConsigneeaddress());
// madds.setCityname(entity.getConsigneecity());
// madds.setCountrycode(entity.getCountrycode());
// madds.setProvincecode(maen.getProvincecode());
// madds.setProvincename(entity.getProvincename());
// madds.setZipcode(entity.getZipcode());
// mcons.setAddress(madds);
// maconca.setConsignee(mcons);
//
// ManifestConsignorXml macis = new ManifestConsignorXml();
// macis.setName(entity.getShippername());
// ManifestsAddressXml msadds = new ManifestsAddressXml();
// msadds.setLine(entity.getShipperaddress());
// msadds.setCityname(entity.getShippercity());
// macis.setAddress(msadds);
// maconca.setConsignor(macis);
// ManifestAddressXml madds = new ManifestAddressXml();
// madds.setLine(entity.getConsigneeaddress());
// madds.setCityname(entity.getConsigneecity());
// madds.setCountrycode(entity.getCountrycode());
// madds.setProvincecode(maen.getProvincecode());
// madds.setProvincename(entity.getProvincename());
// madds.setZipcode(entity.getZipcode());
// mcons.setAddress(madds);
// maconca.setConsignee(mcons);
//
// ManifestConsignorXml macis = new ManifestConsignorXml();
// macis.setName(entity.getShippername());
// ManifestsAddressXml msadds = new ManifestsAddressXml();
// msadds.setLine(entity.getShipperaddress());
// msadds.setCityname(entity.getShippercity());
// macis.setAddress(msadds);
// maconca.setConsignor(macis);
ls.add(maconca);
}
... ... @@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{
body.setDeclaration(dec);
ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml();
ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml();
mdme.setSndr("CDCF");
mdme.setRcvr("");
mdme.setSeqn(maen.getWaybillnomaster()+Constant.dateTimeFormatnumber.format(new Date()));
mdme.setSeqn(maen.getWaybillnomaster() + Constant.dateTimeFormatnumber.format(new Date()));
mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date()));
mdme.setType("HYXX");
mdme.setStyp("CDCF");//CDCF NDLR
mdme.setStyp("CDCF");// CDCF NDLR
dms.setMeta(mdme);
dms.setDeclarepreparemasterxmlbody(body);
String xml = XmlUtil.convertToXml2(dms, path);
// System.out.println(xml);
// IMFServletManifst mis = new IMFServletManifst();
// mis.init(xml.toString());
// System.out.println(xml);
// IMFServletManifst mis = new IMFServletManifst();
// mis.init(xml.toString());
return xml;
}
// private String beanToXml(String path,Long id){
// ManifestEntity manifestEntity = manifestService.findOne(id);
//
// if(manifestEntity==null){
// manifestEntity = new ManifestEntity();
// }
// List<ManifestBillEntity> billList = null;
// ManifestBillEntity billEntity = new ManifestBillEntity();
// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
// ManifestContainerEntity containerEntity = new ManifestContainerEntity();
// if(manifestEntity.getId()!=null){
// billList = billService.findByManifestId(manifestEntity.getId());
// }
// if(CollectionUtils.isNotEmpty(billList)){
// billEntity = billList.get(0);
// }
// List<ManifestCommodityEntity> commodities = null;
// if(billEntity.getId()!=null){
// commodities = commodityService.findByBillId(billEntity.getId());
// }
// if(CollectionUtils.isNotEmpty(commodities)){
// commodityEntity = commodities.get(0);
// }
//
// DeclareXmlBody body = new DeclareXmlBody();
//
// XmlHead head = new XmlHead();
// head.setMessageID(id==null?"":id.toString());
// head.setMessageType("Manifest");
// head.setSenderID(SessionUtil.getUser().getId().toString());
// head.setSendTime(Constant.dateFormat.format(new Date()));
// head.setFunctionCode("");
// head.setReceiverID(SessionUtil.getUser().getId().toString());
// head.setVersion("1.0");
// body.setHead(head);
//
// DeclareManifestXml manifestXml = new DeclareManifestXml();
//
// NameXml nameXml = new NameXml();
// nameXml.setName(manifestEntity.getTransferName());
// manifestXml.setRepresentativePerson(nameXml);
//
// IDXml idXml = new IDXml();
// idXml.setId(manifestEntity.getLeaveCode());
// manifestXml.setExitCustomsOffice(idXml);
//
// IDXml idXml1 = new IDXml();
// idXml1.setId(manifestEntity.getAgentCompanyCode());
// manifestXml.setAgent(idXml1);
//
// IDXml idXml2 = new IDXml();
// idXml2.setId(manifestEntity.getCarrierCode());
// manifestXml.setCarrier(idXml2);
//
// DeclareBorderTransportMeansXml transportMeansXml = new DeclareBorderTransportMeansXml();
// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
// transportMeansXml.setTypeCode(manifestEntity.getModeCode());
// transportMeansXml.setId(manifestEntity.getToolCode());
// transportMeansXml.setName(manifestEntity.getToolName());
// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
//
// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
//
// DeclareTransportContractDocumentXml contractDocumentXml = new DeclareTransportContractDocumentXml();
//
// contractDocumentXml.setId(billEntity.getLadingNo());
// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
// contractDocumentXml.setConditionCode(billEntity.getTransportCode());
// consignmentXml.setTransportContractDocument(contractDocumentXml);
//
// IDXml idXml3 = new IDXml();
// idXml3.setId(billEntity.getSubLadingNo());
// consignmentXml.setAssociatedTransportDocument(idXml3);
//
// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
// consignmentXml.setValueAmount(billEntity.getCashType());
//
// DeclareLoadingLocationXml loadingLocationXml = new DeclareLoadingLocationXml();
// loadingLocationXml.setId(billEntity.getEncasementCode());
// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
// consignmentXml.setLoadingLocation(loadingLocationXml);
//
// DeclareUnloadingLocationXml unloadingLocationXml = new DeclareUnloadingLocationXml();
// unloadingLocationXml.setId(billEntity.getUnlodingCode());
// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
// consignmentXml.setUnloadingLocation(unloadingLocationXml);
//
// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new DeclareGoodsReceiptPlaceXml();
//
// receiptPlaceXml.setId(billEntity.getReceiveCode());
// receiptPlaceXml.setName(billEntity.getReceiveName());
// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
//
// IDXml idXml4 = new IDXml();
// idXml4.setId(billEntity.getTransitCode());
// consignmentXml.setTranshipmentLocation(idXml4);
//
// IDXml idXml5 = new IDXml();
// idXml5.setId(billEntity.getTransitDestinationCode());
// consignmentXml.setTransitDestination(idXml5);
//
// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
//
// IDXml idXml6 = new IDXml();
// idXml6.setId(billEntity.getConsignLocation());
// consignmentXml.setGoodsConsignedPlace(idXml6);
//
// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
//
// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
// consignmentXml.setFreightPayment(methodCodeXml);
//
// DeclareConsignmentPackagingXml packagingXml = new DeclareConsignmentPackagingXml();
// packagingXml.setTypeCode(billEntity.getPackageType());
// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
// consignmentXml.setConsignmentPackaging(packagingXml);
//
// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
//
// DeclarePreviousCustomsDocumentXml documentXml = new DeclarePreviousCustomsDocumentXml();
// documentXml.setId(billEntity.getPreviousCustomsNo());
// documentXml.setTypeCode(billEntity.getPreviousCustomsType());
// consignmentXml.setPreviousCustomsDocument(documentXml);
//
// DeclareDeliveryDestinationXml deliveryDestinationXml = new DeclareDeliveryDestinationXml();
// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
// consignmentXml.setDeliveryDestination(deliveryDestinationXml);
//
// DeclareIntermediateCarrierXml intermediateCarrierXml = new DeclareIntermediateCarrierXml();
// intermediateCarrierXml.setId(billEntity.getCarrierSign());
// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
// communicationXml.setId(billEntity.getCarrierContactNo());
// communicationXml.setTypeID(billEntity.getCarrierContactType());
// intermediateCarrierXml.setCommunication(communicationXml);
// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
//
// //收货人
// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
// consigneeXml.setId(billEntity.getReceiverCode());
// consigneeXml.setName(billEntity.getReceiverName());
//
// DeclareAddressXml addressXml = new DeclareAddressXml();
// addressXml.setLine(billEntity.getReceiverAddress());
// addressXml.setCityName(billEntity.getReceiverCity());
// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
// addressXml.setCountryCode(billEntity.getReceiverCountryCode());
// addressXml.setPostcodeID(billEntity.getReceiverPostCode());
// consigneeXml.setAddress(addressXml);
// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
// communicationXml1.setId(billEntity.getReceiverContactNo());
// communicationXml1.setTypeID(billEntity.getReceiverContactType());
// consigneeXml.setCommunication(communicationXml1);
//
// DeclareContactXml contactXml = new DeclareContactXml();
// contactXml.setName(billEntity.getReceiverName());
// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
// communicationXml2.setId(billEntity.getReceiverContactNo());
// communicationXml2.setTypeID(billEntity.getReceiverContactType());
// contactXml.setCommunication(communicationXml2);
// consigneeXml.setContact(contactXml);
//
// consignmentXml.setConsignee(consigneeXml);
//
// //发货人
// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
// consigneeXml1.setId(billEntity.getSenderCode());
// consigneeXml1.setName(billEntity.getSenderName());
// DeclareAddressXml addressXml1 = new DeclareAddressXml();
// addressXml1.setLine(billEntity.getSenderAddress());
// addressXml1.setCityName(billEntity.getSenderCity());
// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
// addressXml1.setPostcodeID(billEntity.getSenderPostCode());
// addressXml1.setCountryCode(billEntity.getSenderCountryCode());
// consigneeXml1.setAddress(addressXml1);
// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
// communicationXml3.setId(billEntity.getSenderContactNo());
// communicationXml3.setTypeID(billEntity.getSenderContactType());
// consigneeXml1.setCommunication(communicationXml3);
// consignmentXml.setConsignor(consigneeXml1);
//
// //通知人
// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
// consigneeXml2.setId(billEntity.getNotifierCode());
// consigneeXml2.setName(billEntity.getNotifier());
// addressXml.setLine(billEntity.getNotifierAddress());
// addressXml.setCityName(billEntity.getNotifierCity());
// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
// addressXml.setPostcodeID(billEntity.getNotifierPostCode());
// addressXml.setCountryCode(billEntity.getNotifierCountryCode());
// consigneeXml2.setAddress(addressXml);
// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
// communicationXml4.setId(billEntity.getNotifierContact());
// communicationXml4.setTypeID(billEntity.getNotifierContactCode());
// consigneeXml2.setCommunication(communicationXml4);
// consignmentXml.setNotifyParty(consigneeXml2);
//
// //危险品联系人
// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
// dgXml.setName(billEntity.getDangerContact());
// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
// communicationXml5.setId(billEntity.getDangerContactNo());
// communicationXml5.setTypeID(billEntity.getDangerContactType());
// dgXml.setCommunication(communicationXml5);
// consignmentXml.setuNDGContact(dgXml);
//
// //商品信息
// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
// DeclareConsignmentItemPackagingXml itemPackagingXml = new DeclareConsignmentItemPackagingXml();
// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
// itemXml.setConsignmentItemPackaging(itemPackagingXml);
//
// DeclareCommodityXml commodityXml = new DeclareCommodityXml();
// commodityXml.setCargoDescription(commodityEntity.getSummary());
// commodityXml.setuNDGCode(commodityEntity.getDangerNo());
// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
//
// ContentXml contentXml = new ContentXml();
// contentXml.setContent(commodityEntity.getRemark());
// itemXml.setAdditionalInformation(contentXml);
//
// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
// itemXml.setGoodsMeasure(goodsMeasureXml);
//
// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
// itemXml.setCustomsProcedure(procedureXml);
//
// idXml.setId(commodityEntity.getConsign());
// itemXml.setuCR(idXml);
//
// DeclareOriginXml originXml = new DeclareOriginXml();
// originXml.setOriginCountryCode(commodityEntity.getOriginCode());
// itemXml.setOrigin(originXml);
// consignmentXml.setConsignmentItem(itemXml);
//
// manifestXml.setConsignment(consignmentXml);
//
// contentXml.setContent(manifestEntity.getRemark());
// manifestXml.setAdditionalInformation(contentXml);
//
// body.setDeclaration(manifestXml);
// String xml = XmlUtil.convertToXml2(body, path);
// return xml;
// }
// private String beanToXml(String path,Long id){
// ManifestEntity manifestEntity = manifestService.findOne(id);
//
// if(manifestEntity==null){
// manifestEntity = new ManifestEntity();
// }
// List<ManifestBillEntity> billList = null;
// ManifestBillEntity billEntity = new ManifestBillEntity();
// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
// ManifestContainerEntity containerEntity = new ManifestContainerEntity();
// if(manifestEntity.getId()!=null){
// billList = billService.findByManifestId(manifestEntity.getId());
// }
// if(CollectionUtils.isNotEmpty(billList)){
// billEntity = billList.get(0);
// }
// List<ManifestCommodityEntity> commodities = null;
// if(billEntity.getId()!=null){
// commodities = commodityService.findByBillId(billEntity.getId());
// }
// if(CollectionUtils.isNotEmpty(commodities)){
// commodityEntity = commodities.get(0);
// }
//
// DeclareXmlBody body = new DeclareXmlBody();
//
// XmlHead head = new XmlHead();
// head.setMessageID(id==null?"":id.toString());
// head.setMessageType("Manifest");
// head.setSenderID(SessionUtil.getUser().getId().toString());
// head.setSendTime(Constant.dateFormat.format(new Date()));
// head.setFunctionCode("");
// head.setReceiverID(SessionUtil.getUser().getId().toString());
// head.setVersion("1.0");
// body.setHead(head);
//
// DeclareManifestXml manifestXml = new DeclareManifestXml();
//
// NameXml nameXml = new NameXml();
// nameXml.setName(manifestEntity.getTransferName());
// manifestXml.setRepresentativePerson(nameXml);
//
// IDXml idXml = new IDXml();
// idXml.setId(manifestEntity.getLeaveCode());
// manifestXml.setExitCustomsOffice(idXml);
//
// IDXml idXml1 = new IDXml();
// idXml1.setId(manifestEntity.getAgentCompanyCode());
// manifestXml.setAgent(idXml1);
//
// IDXml idXml2 = new IDXml();
// idXml2.setId(manifestEntity.getCarrierCode());
// manifestXml.setCarrier(idXml2);
//
// DeclareBorderTransportMeansXml transportMeansXml = new
// DeclareBorderTransportMeansXml();
// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
// transportMeansXml.setTypeCode(manifestEntity.getModeCode());
// transportMeansXml.setId(manifestEntity.getToolCode());
// transportMeansXml.setName(manifestEntity.getToolName());
// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
//
// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
//
// DeclareTransportContractDocumentXml contractDocumentXml = new
// DeclareTransportContractDocumentXml();
//
// contractDocumentXml.setId(billEntity.getLadingNo());
// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
// contractDocumentXml.setConditionCode(billEntity.getTransportCode());
// consignmentXml.setTransportContractDocument(contractDocumentXml);
//
// IDXml idXml3 = new IDXml();
// idXml3.setId(billEntity.getSubLadingNo());
// consignmentXml.setAssociatedTransportDocument(idXml3);
//
// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
// consignmentXml.setValueAmount(billEntity.getCashType());
//
// DeclareLoadingLocationXml loadingLocationXml = new
// DeclareLoadingLocationXml();
// loadingLocationXml.setId(billEntity.getEncasementCode());
// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
// consignmentXml.setLoadingLocation(loadingLocationXml);
//
// DeclareUnloadingLocationXml unloadingLocationXml = new
// DeclareUnloadingLocationXml();
// unloadingLocationXml.setId(billEntity.getUnlodingCode());
// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
// consignmentXml.setUnloadingLocation(unloadingLocationXml);
//
// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new
// DeclareGoodsReceiptPlaceXml();
//
// receiptPlaceXml.setId(billEntity.getReceiveCode());
// receiptPlaceXml.setName(billEntity.getReceiveName());
// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
//
// IDXml idXml4 = new IDXml();
// idXml4.setId(billEntity.getTransitCode());
// consignmentXml.setTranshipmentLocation(idXml4);
//
// IDXml idXml5 = new IDXml();
// idXml5.setId(billEntity.getTransitDestinationCode());
// consignmentXml.setTransitDestination(idXml5);
//
// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
//
// IDXml idXml6 = new IDXml();
// idXml6.setId(billEntity.getConsignLocation());
// consignmentXml.setGoodsConsignedPlace(idXml6);
//
// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
//
// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
// consignmentXml.setFreightPayment(methodCodeXml);
//
// DeclareConsignmentPackagingXml packagingXml = new
// DeclareConsignmentPackagingXml();
// packagingXml.setTypeCode(billEntity.getPackageType());
// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
// consignmentXml.setConsignmentPackaging(packagingXml);
//
// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
//
// DeclarePreviousCustomsDocumentXml documentXml = new
// DeclarePreviousCustomsDocumentXml();
// documentXml.setId(billEntity.getPreviousCustomsNo());
// documentXml.setTypeCode(billEntity.getPreviousCustomsType());
// consignmentXml.setPreviousCustomsDocument(documentXml);
//
// DeclareDeliveryDestinationXml deliveryDestinationXml = new
// DeclareDeliveryDestinationXml();
// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
// consignmentXml.setDeliveryDestination(deliveryDestinationXml);
//
// DeclareIntermediateCarrierXml intermediateCarrierXml = new
// DeclareIntermediateCarrierXml();
// intermediateCarrierXml.setId(billEntity.getCarrierSign());
// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
// communicationXml.setId(billEntity.getCarrierContactNo());
// communicationXml.setTypeID(billEntity.getCarrierContactType());
// intermediateCarrierXml.setCommunication(communicationXml);
// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
//
// //收货人
// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
// consigneeXml.setId(billEntity.getReceiverCode());
// consigneeXml.setName(billEntity.getReceiverName());
//
// DeclareAddressXml addressXml = new DeclareAddressXml();
// addressXml.setLine(billEntity.getReceiverAddress());
// addressXml.setCityName(billEntity.getReceiverCity());
// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
// addressXml.setCountryCode(billEntity.getReceiverCountryCode());
// addressXml.setPostcodeID(billEntity.getReceiverPostCode());
// consigneeXml.setAddress(addressXml);
// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
// communicationXml1.setId(billEntity.getReceiverContactNo());
// communicationXml1.setTypeID(billEntity.getReceiverContactType());
// consigneeXml.setCommunication(communicationXml1);
//
// DeclareContactXml contactXml = new DeclareContactXml();
// contactXml.setName(billEntity.getReceiverName());
// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
// communicationXml2.setId(billEntity.getReceiverContactNo());
// communicationXml2.setTypeID(billEntity.getReceiverContactType());
// contactXml.setCommunication(communicationXml2);
// consigneeXml.setContact(contactXml);
//
// consignmentXml.setConsignee(consigneeXml);
//
// //发货人
// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
// consigneeXml1.setId(billEntity.getSenderCode());
// consigneeXml1.setName(billEntity.getSenderName());
// DeclareAddressXml addressXml1 = new DeclareAddressXml();
// addressXml1.setLine(billEntity.getSenderAddress());
// addressXml1.setCityName(billEntity.getSenderCity());
// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
// addressXml1.setPostcodeID(billEntity.getSenderPostCode());
// addressXml1.setCountryCode(billEntity.getSenderCountryCode());
// consigneeXml1.setAddress(addressXml1);
// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
// communicationXml3.setId(billEntity.getSenderContactNo());
// communicationXml3.setTypeID(billEntity.getSenderContactType());
// consigneeXml1.setCommunication(communicationXml3);
// consignmentXml.setConsignor(consigneeXml1);
//
// //通知人
// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
// consigneeXml2.setId(billEntity.getNotifierCode());
// consigneeXml2.setName(billEntity.getNotifier());
// addressXml.setLine(billEntity.getNotifierAddress());
// addressXml.setCityName(billEntity.getNotifierCity());
// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
// addressXml.setPostcodeID(billEntity.getNotifierPostCode());
// addressXml.setCountryCode(billEntity.getNotifierCountryCode());
// consigneeXml2.setAddress(addressXml);
// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
// communicationXml4.setId(billEntity.getNotifierContact());
// communicationXml4.setTypeID(billEntity.getNotifierContactCode());
// consigneeXml2.setCommunication(communicationXml4);
// consignmentXml.setNotifyParty(consigneeXml2);
//
// //危险品联系人
// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
// dgXml.setName(billEntity.getDangerContact());
// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
// communicationXml5.setId(billEntity.getDangerContactNo());
// communicationXml5.setTypeID(billEntity.getDangerContactType());
// dgXml.setCommunication(communicationXml5);
// consignmentXml.setuNDGContact(dgXml);
//
// //商品信息
// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
// DeclareConsignmentItemPackagingXml itemPackagingXml = new
// DeclareConsignmentItemPackagingXml();
// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
// itemXml.setConsignmentItemPackaging(itemPackagingXml);
//
// DeclareCommodityXml commodityXml = new DeclareCommodityXml();
// commodityXml.setCargoDescription(commodityEntity.getSummary());
// commodityXml.setuNDGCode(commodityEntity.getDangerNo());
// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
//
// ContentXml contentXml = new ContentXml();
// contentXml.setContent(commodityEntity.getRemark());
// itemXml.setAdditionalInformation(contentXml);
//
// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
// itemXml.setGoodsMeasure(goodsMeasureXml);
//
// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
// itemXml.setCustomsProcedure(procedureXml);
//
// idXml.setId(commodityEntity.getConsign());
// itemXml.setuCR(idXml);
//
// DeclareOriginXml originXml = new DeclareOriginXml();
// originXml.setOriginCountryCode(commodityEntity.getOriginCode());
// itemXml.setOrigin(originXml);
// consignmentXml.setConsignmentItem(itemXml);
//
// manifestXml.setConsignment(consignmentXml);
//
// contentXml.setContent(manifestEntity.getRemark());
// manifestXml.setAdditionalInformation(contentXml);
//
// body.setDeclaration(manifestXml);
// String xml = XmlUtil.convertToXml2(body, path);
// return xml;
// }
/**
* 保存
... ... @@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{
* @return
*/
@ResponseBody
@RequestMapping(value = "/bill/save",method = RequestMethod.POST)
public ResponseModel saveBill(String billJson,String voJson){
@RequestMapping(value = "/bill/save", method = RequestMethod.POST)
public ResponseModel saveBill(String billJson, String voJson) {
ResponseModel model = new ResponseModel();
try {
ManifestBillEntity bill = JSONObject.parseObject(billJson,ManifestBillEntity.class);
List<CommodityVo> voList = JSONArray.parseArray(voJson,CommodityVo.class);
bill = billService.save(bill,voList);
ManifestBillEntity bill = JSONObject.parseObject(billJson, ManifestBillEntity.class);
List<CommodityVo> voList = JSONArray.parseArray(voJson, CommodityVo.class);
bill = billService.save(bill, voList);
model.setData(bill.getManifestId());
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}catch (Exception e){
} catch (Exception e) {
model.setStatus(500);
model.setMsg(HttpJsonMsg.ERROR);
logger.error("系统异常 >>", e);
... ... @@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{
return model;
}
/*
* 获取3字码对应的信息,然后自动填写上
*/
@RequestMapping("/gettreecode")
@ResponseBody
public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE){
public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE) {
ResponseModel model = new ResponseModel(1, null, "");
//这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
// List<TBasCarrierEntity> tbc = tbasService.findAll();
// for(int i = 0; i < tbc.size(); i ++)
// {
// }
// model.setData(tbc);
if(STOCKPRE != null)
{
// 这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
// List<TBasCarrierEntity> tbc = tbasService.findAll();
// for(int i = 0; i < tbc.size(); i ++)
// {
// }
// model.setData(tbc);
if (STOCKPRE != null) {
Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2");
//List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
// List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
Statement sql;
try {
sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='"+STOCKPRE+"'";
String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='" + STOCKPRE + "'";
ResultSet rs = sql.executeQuery(sqlStr);
while(rs.next())
{
while (rs.next()) {
TBasCarrierEntity tbs = new TBasCarrierEntity();
tbs.setcARRIERID(rs.getString(1));
tbs.setsTOCKPRE(rs.getString(2));
... ... @@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{
tbs.setcARRYWAY(rs.getString(6));
tbs.setoPERATIONTIME(rs.getString(7));
tbs.setiSFOREIGN(rs.getString(8));
//tbs.setfREQORDERING(rs.getInt(9));
//tbs.setId(rs.getInt(9)));
// tbs.setfREQORDERING(rs.getInt(9));
// tbs.setId(rs.getInt(9)));
model.setData(tbs);
}
} catch (SQLException e) {
... ... @@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{
return model;
}
/**
* 获取商品信息
*
* @param billId
* @return
*/
@ResponseBody
@RequestMapping(value = "/commodity/get",method = RequestMethod.POST)
public String getCommodity(Long billId){
return JSON.toJSONString(commodityService.getCommodityVos(billId),filter);
@RequestMapping(value = "/commodity/get", method = RequestMethod.POST)
public String getCommodity(Long billId) {
return JSON.toJSONString(commodityService.getCommodityVos(billId), filter);
}
/**
* 编辑商品信息
*
* @param id
* @return
*/
@RequestMapping(value = "/commodity/edit")
public String getContainer(Long id,Model model){
public String getContainer(Long id, Model model) {
CommodityVo vo = new CommodityVo();
model.addAttribute("vo",vo);
model.addAttribute("vo", vo);
return "manifest/edit_commodity";
}
/**
* 删除
*
* @param ids
* @return
*/
@RequestMapping(value = "/delete" , method = {RequestMethod.POST })
@RequestMapping(value = "/delete", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel delete(String ids) {
ResponseModel model = new ResponseModel();
... ... @@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{
/**
* 删除
*
* @param ids
* @return
*/
@RequestMapping(value = "/subdelete" , method = {RequestMethod.POST })
@RequestMapping(value = "/subdelete", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel subdelete(Long id) {
ResponseModel model = new ResponseModel();
... ... @@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{
return model;
}
/**
* 删除
*
* @param id
* @return
*/
@RequestMapping(value = "/bill/delete" , method = {RequestMethod.POST })
@RequestMapping(value = "/bill/delete", method = { RequestMethod.POST })
@ResponseBody
public ResponseModel deleteBill(Long id) {
ResponseModel model = new ResponseModel();
... ... @@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{
return model;
}
}
... ...
... ... @@ -4,8 +4,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.agent.imf.agent.IMFServletManifst;
@Controller
public class LayoutController {
... ...
... ... @@ -20,7 +20,7 @@ public class Constant {
public final static SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//日期格式化
public final static SimpleDateFormat dateTimeFormatnumber = new SimpleDateFormat("yyyyMMddHHmmss");
public final static SimpleDateFormat dateTimeFormatnumber = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//包装尺寸类型 - 交运
public final static String packageSizeDelivery = "DELIVERY";
... ...
... ... @@ -13,7 +13,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name = "PUB_CONSIGNEE")
public class ConsigneeEntity extends BasicEntity{
public class ConsigneeEntity extends BasicEntity {
/**
* 简称
... ... @@ -35,7 +35,6 @@ public class ConsigneeEntity extends BasicEntity{
*/
private String tel;
@Column(name = "CODE")
public String getCode() {
return code;
... ... @@ -44,6 +43,7 @@ public class ConsigneeEntity extends BasicEntity{
public void setCode(String code) {
this.code = code;
}
@Column(name = "NAME")
public String getName() {
return name;
... ... @@ -52,6 +52,7 @@ public class ConsigneeEntity extends BasicEntity{
public void setName(String name) {
this.name = name;
}
@Column(name = "ADDRESS")
public String getAddress() {
return address;
... ... @@ -60,6 +61,7 @@ public class ConsigneeEntity extends BasicEntity{
public void setAddress(String address) {
this.address = address;
}
@Column(name = "TEL")
public String getTel() {
return tel;
... ...
... ... @@ -2,91 +2,111 @@ package com.agent.entity.agent;
public class ConsigneeInfo {
private String id;
private String sh_company; //公司
private String sh_address; //地址
private String sh_zipcode; //邮编
private String city; //城市
private String deltaname; //州名
private String country; //国家代码
private String telephone; //电话
private String sh_fax; //传真
private String sh_name; //收货人姓名
private String sh_provincename; //身份名称
private String sh_provincecode; //身份代码
private String sh_company; // 公司
private String sh_address; // 地址
private String sh_zipcode; // 邮编
private String city; // 城市
private String deltaname; // 州名
private String country; // 国家代码
private String telephone; // 电话
private String sh_fax; // 传真
private String sh_name; // 收货人姓名
private String sh_provincename; // 省份名称
private String sh_provincecode; // 省份代码
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSh_company() {
return sh_company;
}
public void setSh_company(String sh_company) {
this.sh_company = sh_company;
}
public String getSh_address() {
return sh_address;
}
public void setSh_address(String sh_address) {
this.sh_address = sh_address;
}
public String getSh_zipcode() {
return sh_zipcode;
}
public void setSh_zipcode(String sh_zipcode) {
this.sh_zipcode = sh_zipcode;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDeltaname() {
return deltaname;
}
public void setDeltaname(String deltaname) {
this.deltaname = deltaname;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getSh_fax() {
return sh_fax;
}
public void setSh_fax(String sh_fax) {
this.sh_fax = sh_fax;
}
public String getSh_name() {
return sh_name;
}
public void setSh_name(String sh_name) {
this.sh_name = sh_name;
}
public String getSh_provincename() {
return sh_provincename;
}
public void setSh_provincename(String sh_provincename) {
this.sh_provincename = sh_provincename;
}
public String getSh_provincecode() {
return sh_provincecode;
}
public void setSh_provincecode(String sh_provincecode) {
this.sh_provincecode = sh_provincecode;
}
... ...
package com.agent.entity.agent;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.agent.entity.BasicEntity;
/**
*
* Depiction: 发货人表
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:05:28
*
*/
@Entity
@Table(name = "CONSIGNOR")
public class ConsignorEntity extends BasicEntity {
private String shpcusid;// 发货人代码
/**
* 发货人aeo
*/
private String shpaeo;
/**
* 发货人公司
*/
private String co_company;
/**
* 发货人地址
*/
private String co_address;
/**
* 发货人邮编
*/
private String co_zipcode;
/**
* 发货人城市
*/
private String co_city;
/**
* 发货人洲名
*/
private String co_deltaname;
/**
* 发货人国家名字
*/
private String co_country;
/**
* 发货人电话
*/
private String co_telephone;
/**
* 发货人传真
*/
private String co_fax;
/**
* 发货人名字
*/
private String co_name;
private String co_provincecode;
public String getCo_company() {
return co_company;
}
public void setCo_company(String co_company) {
this.co_company = co_company;
}
public String getCo_address() {
return co_address;
}
public void setCo_address(String co_address) {
this.co_address = co_address;
}
public String getCo_zipcode() {
return co_zipcode;
}
public void setCo_zipcode(String co_zipcode) {
this.co_zipcode = co_zipcode;
}
public String getCo_city() {
return co_city;
}
public void setCo_city(String co_city) {
this.co_city = co_city;
}
public String getCo_deltaname() {
return co_deltaname;
}
public void setCo_deltaname(String co_deltaname) {
this.co_deltaname = co_deltaname;
}
public String getCo_country() {
return co_country;
}
public void setCo_country(String co_country) {
this.co_country = co_country;
}
public String getCo_telephone() {
return co_telephone;
}
public void setCo_telephone(String co_telephone) {
this.co_telephone = co_telephone;
}
public String getCo_fax() {
return co_fax;
}
public void setCo_fax(String co_fax) {
this.co_fax = co_fax;
}
public String getCo_name() {
return co_name;
}
public void setCo_name(String co_name) {
this.co_name = co_name;
}
public String getShpcusid() {
return shpcusid;
}
public void setShpcusid(String shpcusid) {
this.shpcusid = shpcusid;
}
public String getShpaeo() {
return shpaeo;
}
public void setShpaeo(String shpaeo) {
this.shpaeo = shpaeo;
}
public String getCo_provincecode() {
return co_provincecode;
}
public void setCo_provincecode(String co_provincecode) {
this.co_provincecode = co_provincecode;
}
// 该函数主要用于List的contains
public boolean equals(Object mme) {
if (mme != null) {
ConsignorEntity me = (ConsignorEntity) mme;
if (me.getCo_company().equalsIgnoreCase(this.getCo_company())) {
return true;
}
}
return false;
}
}
... ...
... ... @@ -228,10 +228,8 @@
// }
//}
package com.agent.entity.agent;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
... ... @@ -249,7 +247,18 @@ import com.agent.entity.BasicEntity;
*/
@Entity
@Table(name = "MANIFEST")
public class ManifestEntity extends BasicEntity{
public class ManifestEntity extends BasicEntity {
private String unlodingcode;// 卸货地代码
private String cnecusid;// 收货人代码
private String shpcusid;// 发货人代码
/**
* 发货人aeo
*/
private String shpaeo;
/**
* 收货人aeo
*/
private String cneaeo;
/**
* 航班号
*/
... ... @@ -503,49 +512,97 @@ public class ManifestEntity extends BasicEntity{
*/
private String response_text;
private Long save_time;
private Long USER_ID; //报文所属的用户id
private Long USER_ID; // 报文所属的用户id
public String getUnlodingcode() {
return unlodingcode;
}
public void setUnlodingcode(String unlodingcode) {
this.unlodingcode = unlodingcode;
}
public String getCnecusid() {
return cnecusid;
}
public void setCnecusid(String cnecusid) {
this.cnecusid = cnecusid;
}
public String getShpcusid() {
return shpcusid;
}
public void setShpcusid(String shpcusid) {
this.shpcusid = shpcusid;
}
public String getShpaeo() {
return shpaeo;
}
public void setShpaeo(String shpaeo) {
this.shpaeo = shpaeo;
}
public String getCneaeo() {
return cneaeo;
}
public void setCneaeo(String cneaeo) {
this.cneaeo = cneaeo;
}
public Long getUSER_ID() {
return USER_ID;
}
public void setUSER_ID(Long uSER_ID) {
USER_ID = uSER_ID;
}
@Column(name = "SAVE_TIME")
public Long getSave_time() {
return save_time;
}
public void setSave_time(Long save_time) {
this.save_time = save_time;
}
@Column(name = "RESPONSE_CODE")
public String getResponse_code() {
return response_code;
}
public void setResponse_code(String response_code) {
this.response_code = response_code;
}
@Column(name = "RESPONSE_TEXT")
public String getResponse_text() {
return response_text;
}
public void setResponse_text(String response_text) {
this.response_text = response_text;
}
@Column(name = "DE_IDS")
public Integer getDe_ids() {
return de_ids;
}
public void setDe_ids(Integer de_ids) {
this.de_ids = de_ids;
}
@Column(name = "DE_NUMBER")
public String getDe_number() {
return de_number;
}
public void setDe_number(String de_number) {
this.de_number = de_number;
}
... ... @@ -554,6 +611,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_weight() {
return de_weight;
}
public void setDe_weight(String de_weight) {
this.de_weight = de_weight;
}
... ... @@ -562,6 +620,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_chweight() {
return de_chweight;
}
public void setDe_chweight(String de_chweight) {
this.de_chweight = de_chweight;
}
... ... @@ -570,6 +629,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_size() {
return de_size;
}
public void setDe_size(String de_size) {
this.de_size = de_size;
}
... ... @@ -578,6 +638,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_volume() {
return de_volume;
}
public void setDe_volume(String de_volume) {
this.de_volume = de_volume;
}
... ... @@ -586,6 +647,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_type() {
return de_type;
}
public void setDe_type(String de_type) {
this.de_type = de_type;
}
... ... @@ -594,6 +656,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_trstation() {
return de_trstation;
}
public void setDe_trstation(String de_trstation) {
this.de_trstation = de_trstation;
}
... ... @@ -602,6 +665,7 @@ public class ManifestEntity extends BasicEntity{
public String getDe_packing() {
return de_packing;
}
public void setDe_packing(String de_packing) {
this.de_packing = de_packing;
}
... ... @@ -610,27 +674,34 @@ public class ManifestEntity extends BasicEntity{
public String getDe_remarks() {
return de_remarks;
}
public void setDe_remarks(String de_remarks) {
this.de_remarks = de_remarks;
}
@Column(name = "SH_PROVINCECODE")
public String getSh_provincecode() {
return sh_provincecode;
}
public void setSh_provincecode(String sh_provincecode) {
this.sh_provincecode = sh_provincecode;
}
@Column(name = "SH_PROVINCENAME")
public String getSh_provincename() {
return sh_provincename;
}
public void setSh_provincename(String sh_provincename) {
this.sh_provincename = sh_provincename;
}
@Column(name = "FLIGHTNO")
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno;
}
... ... @@ -639,6 +710,7 @@ public class ManifestEntity extends BasicEntity{
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
... ... @@ -647,6 +719,7 @@ public class ManifestEntity extends BasicEntity{
public String getOriginatingstation() {
return originatingstation;
}
public void setOriginatingstation(String originatingstation) {
this.originatingstation = originatingstation;
}
... ... @@ -655,6 +728,7 @@ public class ManifestEntity extends BasicEntity{
public String getDestinationstation() {
return destinationstation;
}
public void setDestinationstation(String destinationstation) {
this.destinationstation = destinationstation;
}
... ... @@ -663,6 +737,7 @@ public class ManifestEntity extends BasicEntity{
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster;
}
... ... @@ -671,6 +746,7 @@ public class ManifestEntity extends BasicEntity{
public String getTotalweight() {
return totalweight;
}
public void setTotalweight(String totalweight) {
this.totalweight = totalweight;
}
... ... @@ -679,6 +755,7 @@ public class ManifestEntity extends BasicEntity{
public String getTotalpiece() {
return totalpiece;
}
public void setTotalpiece(String totalpiece) {
this.totalpiece = totalpiece;
}
... ... @@ -687,6 +764,7 @@ public class ManifestEntity extends BasicEntity{
public String getPreparetotalpiece() {
return preparetotalpiece;
}
public void setPreparetotalpiece(String preparetotalpiece) {
this.preparetotalpiece = preparetotalpiece;
}
... ... @@ -695,6 +773,7 @@ public class ManifestEntity extends BasicEntity{
public String getPreparetotalweight() {
return preparetotalweight;
}
public void setPreparetotalweight(String preparetotalweight) {
this.preparetotalweight = preparetotalweight;
}
... ... @@ -703,6 +782,7 @@ public class ManifestEntity extends BasicEntity{
public String getAgentcompanycode() {
return agentcompanycode;
}
public void setAgentcompanycode(String agentcompanycode) {
this.agentcompanycode = agentcompanycode;
}
... ... @@ -711,17 +791,19 @@ public class ManifestEntity extends BasicEntity{
public Date getStowagedate() {
return stowagedate;
}
public void setStowagedate(Date stowagedate) {
//System.out.println(stowagedate);
// System.out.println(stowagedate);
this.stowagedate = stowagedate;
//this.stowagedate = new Date();
// this.stowagedate = new Date();
}
public static Date getStowagedate(String datestr){
if(datestr == null)
public static Date getStowagedate(String datestr) {
if (datestr == null)
return null;
String strFormat = "yyyyMMddHHmmss";
if(datestr.indexOf(":") < 0){
if (datestr.indexOf(":") < 0) {
strFormat = "yyyy-MM-dd";
}
SimpleDateFormat sdf = new SimpleDateFormat(strFormat);
... ... @@ -738,6 +820,7 @@ public class ManifestEntity extends BasicEntity{
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
... ... @@ -746,6 +829,7 @@ public class ManifestEntity extends BasicEntity{
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
... ... @@ -754,6 +838,7 @@ public class ManifestEntity extends BasicEntity{
public String getCustomsstatus() {
return customsstatus;
}
public void setCustomsstatus(String customsstatus) {
this.customsstatus = customsstatus;
}
... ... @@ -762,6 +847,7 @@ public class ManifestEntity extends BasicEntity{
public String getPaymode() {
return paymode;
}
public void setPaymode(String paymode) {
this.paymode = paymode;
}
... ... @@ -770,6 +856,7 @@ public class ManifestEntity extends BasicEntity{
public String getSpecialgoodscode() {
return specialgoodscode;
}
public void setSpecialgoodscode(String specialgoodscode) {
this.specialgoodscode = specialgoodscode;
}
... ... @@ -778,6 +865,7 @@ public class ManifestEntity extends BasicEntity{
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode;
}
... ... @@ -786,6 +874,7 @@ public class ManifestEntity extends BasicEntity{
public String getAgentman() {
return agentman;
}
public void setAgentman(String agentman) {
this.agentman = agentman;
}
... ... @@ -794,6 +883,7 @@ public class ManifestEntity extends BasicEntity{
public String getAgentcompany() {
return agentcompany;
}
public void setAgentcompany(String agentcompany) {
this.agentcompany = agentcompany;
}
... ... @@ -802,6 +892,7 @@ public class ManifestEntity extends BasicEntity{
public String getReceiptinformation() {
return receiptinformation;
}
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation;
}
... ... @@ -810,6 +901,7 @@ public class ManifestEntity extends BasicEntity{
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
... ... @@ -818,13 +910,16 @@ public class ManifestEntity extends BasicEntity{
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname;
}
@Column(name = "UNNUMBER")
public String getUnnumber() {
return unnumber;
}
public void setUnnumber(String unnumber) {
this.unnumber = unnumber;
}
... ... @@ -833,6 +928,7 @@ public class ManifestEntity extends BasicEntity{
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
... ... @@ -841,6 +937,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_company() {
return sh_company;
}
public void setSh_company(String sh_company) {
this.sh_company = sh_company;
}
... ... @@ -849,6 +946,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_address() {
return sh_address;
}
public void setSh_address(String sh_address) {
this.sh_address = sh_address;
}
... ... @@ -857,6 +955,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_zipcode() {
return sh_zipcode;
}
public void setSh_zipcode(String sh_zipcode) {
this.sh_zipcode = sh_zipcode;
}
... ... @@ -865,6 +964,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_city() {
return sh_city;
}
public void setSh_city(String sh_city) {
this.sh_city = sh_city;
}
... ... @@ -873,6 +973,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_deltaname() {
return sh_deltaname;
}
public void setSh_deltaname(String sh_deltaname) {
this.sh_deltaname = sh_deltaname;
}
... ... @@ -881,6 +982,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_country() {
return sh_country;
}
public void setSh_country(String sh_country) {
this.sh_country = sh_country;
}
... ... @@ -889,6 +991,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_telephone() {
return sh_telephone;
}
public void setSh_telephone(String sh_telephone) {
this.sh_telephone = sh_telephone;
}
... ... @@ -897,6 +1000,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_fax() {
return sh_fax;
}
public void setSh_fax(String sh_fax) {
this.sh_fax = sh_fax;
}
... ... @@ -905,6 +1009,7 @@ public class ManifestEntity extends BasicEntity{
public String getSh_name() {
return sh_name;
}
public void setSh_name(String sh_name) {
this.sh_name = sh_name;
}
... ... @@ -913,6 +1018,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_company() {
return co_company;
}
public void setCo_company(String co_company) {
this.co_company = co_company;
}
... ... @@ -921,6 +1027,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_address() {
return co_address;
}
public void setCo_address(String co_address) {
this.co_address = co_address;
}
... ... @@ -929,6 +1036,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_zipcode() {
return co_zipcode;
}
public void setCo_zipcode(String co_zipcode) {
this.co_zipcode = co_zipcode;
}
... ... @@ -937,6 +1045,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_city() {
return co_city;
}
public void setCo_city(String co_city) {
this.co_city = co_city;
}
... ... @@ -945,6 +1054,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_deltaname() {
return co_deltaname;
}
public void setCo_deltaname(String co_deltaname) {
this.co_deltaname = co_deltaname;
}
... ... @@ -953,6 +1063,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_country() {
return co_country;
}
public void setCo_country(String co_country) {
this.co_country = co_country;
}
... ... @@ -961,6 +1072,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_telephone() {
return co_telephone;
}
public void setCo_telephone(String co_telephone) {
this.co_telephone = co_telephone;
}
... ... @@ -969,6 +1081,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_fax() {
return co_fax;
}
public void setCo_fax(String co_fax) {
this.co_fax = co_fax;
}
... ... @@ -977,6 +1090,7 @@ public class ManifestEntity extends BasicEntity{
public String getCo_name() {
return co_name;
}
public void setCo_name(String co_name) {
this.co_name = co_name;
}
... ... @@ -985,6 +1099,7 @@ public class ManifestEntity extends BasicEntity{
public String getReach_station() {
return reach_station;
}
public void setReach_station(String reach_station) {
this.reach_station = reach_station;
}
... ... @@ -993,6 +1108,7 @@ public class ManifestEntity extends BasicEntity{
public String getCarrier1() {
return carrier1;
}
public void setCarrier1(String carrier1) {
this.carrier1 = carrier1;
}
... ... @@ -1001,6 +1117,7 @@ public class ManifestEntity extends BasicEntity{
public String getReach_station1() {
return reach_station1;
}
public void setReach_station1(String reach_station1) {
this.reach_station1 = reach_station1;
}
... ... @@ -1009,6 +1126,7 @@ public class ManifestEntity extends BasicEntity{
public String getCarrier2() {
return carrier2;
}
public void setCarrier2(String carrier2) {
this.carrier2 = carrier2;
}
... ... @@ -1017,6 +1135,7 @@ public class ManifestEntity extends BasicEntity{
public String getReach_station2() {
return reach_station2;
}
public void setReach_station2(String reach_station2) {
this.reach_station2 = reach_station2;
}
... ... @@ -1025,6 +1144,7 @@ public class ManifestEntity extends BasicEntity{
public String getName_ofgoods() {
return name_ofgoods;
}
public void setName_ofgoods(String name_ofgoods) {
this.name_ofgoods = name_ofgoods;
}
... ... @@ -1033,26 +1153,26 @@ public class ManifestEntity extends BasicEntity{
public String getDelivery_station() {
return delivery_station;
}
public void setDelivery_station(String delivery_station) {
this.delivery_station = delivery_station;
}
//该函数主要用于List的contains
public boolean equals(Object mme){
if(mme == null)
// 该函数主要用于List的contains
public boolean equals(Object mme) {
if (mme == null)
return false;
ManifestEntity me = (ManifestEntity)mme;
if(me.getCo_company() == null && this.getCo_company() == null)
ManifestEntity me = (ManifestEntity) mme;
if (me.getCo_company() == null && this.getCo_company() == null)
return true;
else if(this.getCo_company() != null)
{
//在值相等的情况下,判断时间的大小
if(this.getCo_company().equals(me.getCo_company()))
{
//当前时间为null,直接返回true
if(this.getSave_time() == null)
else if (this.getCo_company() != null) {
// 在值相等的情况下,判断时间的大小
if (this.getCo_company().equals(me.getCo_company())) {
// 当前时间为null,直接返回true
if (this.getSave_time() == null)
return true;
//要比较的那个对象为null,直接返回false
else if(me.getSave_time() == null)
// 要比较的那个对象为null,直接返回false
else if (me.getSave_time() == null)
return false;
else
return this.getSave_time() > me.getSave_time();
... ... @@ -1061,4 +1181,3 @@ public class ManifestEntity extends BasicEntity{
return false;
}
}
... ...
... ... @@ -8,7 +8,6 @@ import javax.persistence.Entity;
import javax.persistence.Table;
import com.agent.entity.BasicEntity;
import com.ibm.disthub2.impl.matching.selector.ParseException;
/**
* Created by cohesion on 2017/8/9.
* <p/>
... ... @@ -17,6 +16,18 @@ import com.ibm.disthub2.impl.matching.selector.ParseException;
@Entity
@Table(name = "preparesecondary")
public class PreparesecondaryEntity extends BasicEntity{
private String unlodingcode;// 卸货地代码
private String cnecusid;// 收货人代码
private String shpcusid;// 发货人代码
/**
* 发货人aeo
*/
private String shpaeo;
/**
* 收货人aeo
*/
private String cneaeo;
/**
*
*/
... ... @@ -284,6 +295,36 @@ public class PreparesecondaryEntity extends BasicEntity{
private Long USER_ID;
public String getUnlodingcode() {
return unlodingcode;
}
public void setUnlodingcode(String unlodingcode) {
this.unlodingcode = unlodingcode;
}
public String getCnecusid() {
return cnecusid;
}
public void setCnecusid(String cnecusid) {
this.cnecusid = cnecusid;
}
public String getShpcusid() {
return shpcusid;
}
public void setShpcusid(String shpcusid) {
this.shpcusid = shpcusid;
}
public String getShpaeo() {
return shpaeo;
}
public void setShpaeo(String shpaeo) {
this.shpaeo = shpaeo;
}
public String getCneaeo() {
return cneaeo;
}
public void setCneaeo(String cneaeo) {
this.cneaeo = cneaeo;
}
@Column(name = "USER_ID")
public Long getUSER_ID() {
return USER_ID;
... ...
package com.agent.entity.agent;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.agent.entity.BasicEntity;
/**
*
* Depiction: 运单回执表
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:05:28
*
*/
@Entity
@Table(name = "WAYBILL_RECEIPT")
public class WaybillReceiprtEntity extends BasicEntity {
private String flightno;
private Date flightdate;
private String response_code;
private String response_text;
private String waybill_no;
private String sub_waybill_no;
private String carrier;
private String message_type;
private String sendtime;
private String piece;
private String weight;
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno;
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getResponse_code() {
return response_code;
}
public void setResponse_code(String response_code) {
this.response_code = response_code;
}
public String getResponse_text() {
return response_text;
}
public void setResponse_text(String response_text) {
this.response_text = response_text;
}
public String getWaybill_no() {
return waybill_no;
}
public void setWaybill_no(String waybill_no) {
this.waybill_no = waybill_no;
}
public String getSub_waybill_no() {
return sub_waybill_no;
}
public void setSub_waybill_no(String sub_waybill_no) {
this.sub_waybill_no = sub_waybill_no;
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier;
}
public String getMessage_type() {
return message_type;
}
public void setMessage_type(String message_type) {
this.message_type = message_type;
}
public String getSendtime() {
return sendtime;
}
public void setSendtime(String sendtime) {
this.sendtime = sendtime;
}
public String getPiece() {
return piece;
}
public void setPiece(String piece) {
this.piece = piece;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight;
}
// 该函数主要用于List的contains
public boolean equals(Object mme) {
if (mme != null) {
WaybillReceiprtEntity me = (WaybillReceiprtEntity) mme;
if (me.getWaybill_no().equalsIgnoreCase(this.getWaybill_no())) {
return true;
}
}
return false;
}
}
... ...
package com.agent.entity.agent;
/**
* Depiction:回执报文类型
* <p>
* Modify:
* <p>
* Author: Kevin Lynn
* <p>
* Create Date:2018年2月13日 上午11:53:15
*
*/
public enum WaybillReceiptType {
APPLY("已发送预配舱单申请报文", 2), UPDATE("已发送预配舱单修改报文", 4), DELETE("已发送预配舱单删除报文", 3);
private String name;
private int value;
private WaybillReceiptType(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (WaybillReceiptType role : WaybillReceiptType.values()) {
if (role.getValue() == value) {
return role.name;
}
}
return null;
}
public static WaybillReceiptType valueOf(int value) {
for (WaybillReceiptType role : WaybillReceiptType.values()) {
if (role.getValue() == value) {
return role;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
@Override
public String toString() {
return "(" + this.value + "," + this.name + ")";
}
}
... ...
... ... @@ -49,16 +49,16 @@ public class Utils {
public static boolean createDir(String destDirName) {
File dir = new File(destDirName);
if (dir.exists()) {// �ж�Ŀ¼�Ƿ����
if (dir.exists()) {
return true;
}else{
if (!destDirName.endsWith(File.separator)) {// ��β�Ƿ���"/"����
if (!destDirName.endsWith(File.separator)) {
destDirName = destDirName + File.separator;
}
if (dir.mkdirs()) {// ����Ŀ��Ŀ¼
if (dir.mkdirs()) {
return true;
} else {
logger.info("����Ŀ¼ʧ�ܣ� Ŀ¼��ƣ�"+destDirName);
logger.info("创建目录失败-->"+destDirName);
return false;
}
}
... ...
... ... @@ -10,19 +10,21 @@ import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.xml.sax.InputSource;
import org.xml.sax.SAXParseException;
public class XMPParse {
/*
* 把XML节点值转成日期类型
*
* @param xmlFile XML文件路径名
*
* @param xmlNodePath 节点路径(从根节点算起)
* @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回null
* * */
public static final Date nodeValue2Date(String xmlFile,String xmlNodePath){
String str = getNodeValue(xmlFile,xmlNodePath);
if (!"".equals(str)){
*
* @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回null *
*/
public static final Date nodeValue2Date(String xmlFile, String xmlNodePath) {
String str = getNodeValue(xmlFile, xmlNodePath);
if (!"".equals(str)) {
return Utils.iso8601DateStrToDate(str);
}
return null;
... ... @@ -30,29 +32,34 @@ public class XMPParse {
/*
* 把XML节点值转成日期类型,如果节点值不存在,使用默认值
*
* @param xmlFile XML文件路径名
*
* @param xmlNodePath 节点路径(从根节点算起)
*
* @return 如果节点有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值
* */
public static final Date nodeValue2Date(String xmlFile,String xmlNodePath,Date date){
String str = getNodeValue(xmlFile,xmlNodePath);
if (!"".equals(str)){
*/
public static final Date nodeValue2Date(String xmlFile, String xmlNodePath, Date date) {
String str = getNodeValue(xmlFile, xmlNodePath);
if (!"".equals(str)) {
return Utils.iso8601DateStrToDate(str);
}
return date;
}
/*
* 把XML节点属性值转成日期类型,如果节点值不存在,使用默认值
*
* @param xmlFile XML文件路径名
*
* @param xmlNodePath 节点路径(从根节点算起)
*
* @return 如果节点属性有值,需要把ISO8601的时间字符串转成日期,否则返回给定的默认值
* */
*/
public static final Date nodeAttribute2Date(String xmlFile,String xmlNodePath,String attributeName,Date date){
String str = getNodeAttribute(xmlFile,xmlNodePath,attributeName,"");
if (!"".equals(str)){
public static final Date nodeAttribute2Date(String xmlFile, String xmlNodePath, String attributeName, Date date) {
String str = getNodeAttribute(xmlFile, xmlNodePath, attributeName, "");
if (!"".equals(str)) {
return Utils.iso8601DateStrToDate(str);
}
return date;
... ... @@ -60,136 +67,120 @@ public class XMPParse {
/*
* 根据指定的节点路径从XML节点取得节点的值
* @param xmlNodePath 节点的路径,从根节点开始
* 如果某个节点不存在那么返回空字符串""
* */
public static final String getNodeValue(String xmlFile,String xmlNodePath){
String[] nodes= xmlNodePath.split("/");
*
* @param xmlNodePath 节点的路径,从根节点开始 如果某个节点不存在那么返回空字符串""
*/
public static final String getNodeValue(String xmlFile, String xmlNodePath) {
String[] nodes = xmlNodePath.split("/");
Document document = new Document();
SAXBuilder builder = new SAXBuilder();
Element root = null;
LinkedList<SubNode> listNode = new LinkedList<SubNode>();
String value="";
String value = "";
try {
// 将解析器与文档关联
document = builder.build(xmlFile);
//builder.build(systemId);
for(int i=1; i< nodes.length; i++){
if(i > 1){
SubNode s = (SubNode)listNode.getLast();
// builder.build(systemId);
for (int i = 1; i < nodes.length; i++) {
if (i > 1) {
SubNode s = (SubNode) listNode.getLast();
List<Element> eList = s.getElement().getChildren(nodes[i]);
//�ж��Ƿ����ӽڵ�
if (null != eList && eList.size()>0){
if (null != eList && eList.size() > 0) {
SubNode s1 = new SubNode(eList.get(0));
listNode.add(s1);
}
}else if (1 == i){
} else if (1 == i) {
root = document.getRootElement();
SubNode snode= new SubNode(root);
SubNode snode = new SubNode(root);
listNode.add(snode);
}
}
SubNode n = listNode.getLast();;
SubNode n = listNode.getLast();
;
value = n.getElement().getText();
n = null;
} catch (Exception e1) {
e1.printStackTrace();
} finally{
} finally {
listNode.clear();
document = null;
root = null;
builder = null;
nodes = null;
}
System.out.println("key="+xmlNodePath + " value="+value);
System.out.println("key=" + xmlNodePath + " value=" + value);
return value;
}
/*
* ���ָ���Ľڵ�·����XML�ڵ�ȡ�ýڵ��ֵ
* @param xmlNodePath �ڵ��·�����Ӹ�ڵ㿪ʼ
* ���ij���ڵ㲻������ô���ؿ��ַ�""
* */
public static final String getNodeValueFromXmlString(String xmlString,String xmlNodePath) throws Exception{
String[] nodes= xmlNodePath.split("/");
public static final String getNodeValueFromXmlString(String xmlString, String xmlNodePath) throws Exception {
String[] nodes = xmlNodePath.split("/");
Document document = new Document();
SAXBuilder builder = new SAXBuilder();
Element root = null;
LinkedList<SubNode> listNode = new LinkedList<SubNode>();
String value="";
String value = "";
try {
// �����������ĵ�����
StringReader xmlReader = new StringReader(xmlString);
InputSource xmlSource = new InputSource(xmlReader);
document = builder.build(xmlSource);
for(int i=1; i< nodes.length; i++){
if(i > 1){
SubNode s = (SubNode)listNode.getLast();
for (int i = 1; i < nodes.length; i++) {
if (i > 1) {
SubNode s = (SubNode) listNode.getLast();
List<Element> eList = s.getElement().getChildren(nodes[i]);
//�ж��Ƿ����ӽڵ�
if (null != eList && eList.size()>0){
if (null != eList && eList.size() > 0) {
SubNode s1 = new SubNode(eList.get(0));
listNode.add(s1);
}
}else if (1 == i){
} else if (1 == i) {
root = document.getRootElement();
SubNode snode= new SubNode(root);
SubNode snode = new SubNode(root);
listNode.add(snode);
}
}
SubNode n = listNode.getLast();;
SubNode n = listNode.getLast();
;
value = n.getElement().getText();
n = null;
} catch (Exception e1) {
e1.printStackTrace();
throw e1;
} finally{
} finally {
listNode.clear();
document = null;
root = null;
builder = null;
nodes = null;
}
//System.out.println("key="+xmlNodePath + " value="+value);
// System.out.println("key="+xmlNodePath + " value="+value);
return value;
}
/*
* ���ָ���Ľڵ�·����XML�ڵ�ȡ�ýڵ������ֵ
* @param xmlNodePath �ڵ��·�����Ӹ�ڵ㿪ʼ
* @param attributeName �ڵ���������
* @defaultValue Ĭ��ֵ
* ���ij���ڵ㲻���ڣ����߽ڵ㲻����ָ�������ԣ���ô����Ĭ��ֵ
* */
public static final String getNodeAttribute(String xmlFile,String xmlNodePath,String attributeName,String defaultValue){
String[] nodes= xmlNodePath.split("/");
public static final String getNodeAttribute(String xmlFile, String xmlNodePath, String attributeName,
String defaultValue) {
String[] nodes = xmlNodePath.split("/");
Document document = new Document();
SAXBuilder builder = new SAXBuilder();
Element root = null;
LinkedList<SubNode> listNode = new LinkedList<SubNode>();
String value="";
String value = "";
try {
document = builder.build(xmlFile);
for(int i=1; i< nodes.length; i++){
if(i > 1){
SubNode s = (SubNode)listNode.getLast();
for (int i = 1; i < nodes.length; i++) {
if (i > 1) {
SubNode s = (SubNode) listNode.getLast();
List<Element> eList = s.getElement().getChildren(nodes[i]);
//�ж��Ƿ����ӽڵ�
if (null != eList && eList.size()>0){
if (null != eList && eList.size() > 0) {
SubNode s1 = new SubNode(eList.get(0));
listNode.add(s1);
}
}else if (1 == i){
} else if (1 == i) {
root = document.getRootElement();
SubNode snode= new SubNode(root);
SubNode snode = new SubNode(root);
listNode.add(snode);
}
}
... ... @@ -200,16 +191,15 @@ public class XMPParse {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}finally{
} finally {
listNode.clear();
document = null;
root = null;
builder = null;
nodes = null;
}
System.out.println("key="+xmlNodePath + " node attrivte value="+value);
System.out.println("key=" + xmlNodePath + " node attrivte value=" + value);
return value;
}
}
... ...
package com.agent.listener;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
/**
* Depiction:服务启动之后初始化一些操作
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年6月8日 下午2:49:54
*
*/
public class StartupListener implements ApplicationListener<ContextRefreshedEvent> {
// private final static String DISPLAY_NAME = "Root WebApplicationContext";
private final static String DISPLAY_NAME = "WebApplicationContext for namespace 'webMvc-servlet'";
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
String displayName = event.getApplicationContext().getDisplayName();
System.err.println("");
System.err.println(getClass().getSimpleName() + ":displayName is " + displayName);
if (DISPLAY_NAME.equalsIgnoreCase(displayName)) {
System.err.println(getClass().getSimpleName() + ": you can init some");
}
// if (event.getApplicationContext().getParent() == null) {
// System.err.println(getClass().getSimpleName() + ": you can init some");
// IMFCustomReceiptMessageTask task = new IMFCustomReceiptMessageTask();
// task.start();
// }
}
}
... ...
package com.agent.repository.agent;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsignorEntity;
public interface ConsignorRepository
extends PagingAndSortingRepository<ConsignorEntity, Long>, JpaSpecificationExecutor<ConsignorEntity> {
@Query(value = "SELECT * FROM CONSIGNOR WHERE SHPCUSID = ?1 AND CO_COMPANY = ?2 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> findByCodeAndCompany(String shpcusid, String co_company);
@Query(value = "SELECT * FROM CONSIGNOR WHERE SHPCUSID = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> findByCode(String code);
@Query(value = "SELECT * FROM CONSIGNOR WHERE CO_COMPANY = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> findByCompany(String company);
@Query(value = "SELECT * FROM CONSIGNOR WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> findById(String id);
@Query(value = "SELECT * FROM CONSIGNOR ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> getAll();
@Query(value = "SELECT * FROM CONSIGNOR WHERE CREATOR = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<ConsignorEntity> getAllByUserId(long user_id);
@Modifying
@Query(value = "DELETE FROM CONSIGNOR WHERE ID = ?1", nativeQuery = true)
void deleteById(Long id);
// 关于,,,,,,,,,,,
@Transactional
@Modifying(clearAutomatically = true)
@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)
public int save(String co_name, String co_telephone, String co_company, String co_country,
String co_deltaname, String co_city, String co_address, String co_zipcode, String co_fax, String shpaeo,
String shpcusid);
@Query(value = "SELECT * FROM CONSIGNOR WHERE ID=?1", nativeQuery = true)
public List<ConsignorEntity> queryById(Long id);
}
... ...
... ... @@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.agent.entity.agent.ManifestEntity;
import com.agent.entity.agent.PreparesecondaryEntity;
public interface PreparesecondaryRepository extends PagingAndSortingRepository<PreparesecondaryEntity, Long>,
... ... @@ -30,6 +29,6 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
@Modifying
@Query(value = "SELECT * FROM PREPARESECONDARY ", nativeQuery = true)
List<PreparesecondaryEntity> queryAll();
@Query(value = "SELECT * FROM PREPARESECONDARY=?1", nativeQuery = true)
@Query(value = "SELECT * FROM PREPARESECONDARY WHERE USER_ID=?1", nativeQuery = true)
List<PreparesecondaryEntity> queryByUserId(Long user_id);
}
... ...
package com.agent.repository.agent;
import com.agent.entity.agent.SupervisionEntity;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import com.agent.entity.agent.SupervisionEntity;
public interface SupervisionRepository extends PagingAndSortingRepository<SupervisionEntity, Long>,
JpaSpecificationExecutor<SupervisionEntity> {
... ...
package com.agent.repository.agent;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.WaybillReceiprtEntity;
public interface WaybillReceiptRepository
extends PagingAndSortingRepository<WaybillReceiprtEntity, Long>, JpaSpecificationExecutor<WaybillReceiprtEntity> {
@Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE WAYBILL_NO = ?1 AND SUB_WAYBILL_NO = ?2 ORDER BY ID DESC", nativeQuery = true)
public List<WaybillReceiprtEntity> findByWaybillNoAndSub(String waybill_no, String sub_waybill_no);
@Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE WAYBILL_NO = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<WaybillReceiprtEntity> findByWaybillNo(String waybill_no);
@Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE ID = ?1 ORDER BY ID DESC", nativeQuery = true)
public List<WaybillReceiprtEntity> findById(String id);
@Query(value = "SELECT * FROM WAYBILL_RECEIPT ORDER BY ID DESC", nativeQuery = true)
public List<WaybillReceiprtEntity> getAll();
@Modifying
@Query(value = "DELETE FROM WAYBILL_RECEIPT WHERE ID = ?1", nativeQuery = true)
void deleteById(Long id);
// 关于,,,,,,,,,,,
@Transactional
@Modifying(clearAutomatically = true)
@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)
public int save(String flightno, String flightdate, String response_code, String response_text,
String waybill_no, String sub_waybill_no, String carrier, String message_type,String sendtime);
@Query(value = "SELECT * FROM WAYBILL_RECEIPT WHERE ID=?1", nativeQuery = true)
public List<WaybillReceiprtEntity> queryById(Long id);
}
... ...
package com.agent.service.agent;
import com.agent.entity.agent.BasicAgentEntity;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.ConsigneeInfo;
import com.agent.entity.agent.ManifestEntity;
import com.agent.repository.agent.ConsigneeRepository;
import com.agent.service.BasicService;
import com.alibaba.fastjson.JSONObject;
import com.framework.util.MD5Tools;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.repository.agent.ConsigneeRepository;
import com.agent.service.BasicService;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
@Service
... ...
package com.agent.service.agent;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.agent.entity.agent.ConsignorEntity;
import com.agent.entity.agent.ManifestEntity;
import com.agent.entity.agent.PreparesecondaryEntity;
import com.agent.repository.agent.ConsignorRepository;
import com.agent.service.BasicService;
import com.google.common.base.Splitter;
import tools.Tools;
/**
*
* Depiction:发货人数据库操作
* <p>
* Modify:
* <p>
* Author: William Lynn
* <p>
* Create Date:2018年5月28日 下午2:25:53
*
*/
@Service
public class ConsignorService extends BasicService<ConsignorEntity> {
@Resource
private ConsignorRepository service;
@Transactional
public void deleteAll(String ids) {
List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(ids);
for (String id : list) {
service.delete(Long.valueOf(id));
}
}
public ConsignorEntity findByCodeAndName(String code, String company) {
List<ConsignorEntity> consigns = service.findByCodeAndCompany(code, company);
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public ConsignorEntity findByCode(String code) {
List<ConsignorEntity> consigns = service.findByCode(code);
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public ConsignorEntity findByCompany(String company) {
List<ConsignorEntity> consigns = service.findByCompany(company);
if (CollectionUtils.isNotEmpty(consigns)) {
return consigns.get(0);
}
return null;
}
public void save(ConsignorEntity c) {
if (c != null) {
if (c.getCreateDate() == null) {
c.setCreateDate(new Date());
}
if (c.getModifyDate() == null) {
c.setModifyDate(new Date());
}
service.save(c);
}
}
public List<ConsignorEntity> findAll() {
return service.getAll();
}
public List<ConsignorEntity> findAllByUserId(long user_id) {
return service.getAllByUserId(user_id);
}
public void update(ConsignorEntity c) {
service.save(c);
}
public List<ConsignorEntity> findById(String id) {
return service.findById(id);
}
public void saveFromManifest(ManifestEntity manifest) {
if (manifest != null && StringUtils.isNotBlank(manifest.getCo_company())) {
ConsignorEntity bean = new ConsignorEntity();
bean.setCo_address(manifest.getCo_address());
bean.setCo_city(manifest.getCo_city());
bean.setCo_company(manifest.getCo_company());
bean.setCo_country(manifest.getCo_country());
bean.setCo_deltaname(manifest.getCo_deltaname());
bean.setCo_fax(manifest.getCo_fax());
bean.setCo_name(manifest.getCo_name());
bean.setCo_telephone(manifest.getCo_telephone());
bean.setCo_zipcode(manifest.getCo_zipcode());
bean.setShpaeo(manifest.getShpaeo());
bean.setShpcusid(manifest.getShpcusid());
bean.setModifyDate(new Date());
bean.setCreateDate(new Date());
bean.setCreator(Tools.getUserEntity());
bean.setModifier(Tools.getUserEntity());
ConsignorEntity old = findByCompany(manifest.getCo_company());
if (old != null) {
service.delete(old.getId());
}
save(bean);
}
}
public void saveFromPreparesecondary(PreparesecondaryEntity prepare) {
if (prepare != null && StringUtils.isNotBlank(prepare.getCo_company())) {
ConsignorEntity bean = new ConsignorEntity();
bean.setCo_address(prepare.getCo_address());
bean.setCo_city(prepare.getCo_city());
bean.setCo_company(prepare.getCo_company());
bean.setCo_country(prepare.getCo_country());
bean.setCo_deltaname(prepare.getCo_deltaname());
bean.setCo_fax(prepare.getCo_fax());
bean.setCo_name(prepare.getCo_name());
bean.setCo_telephone(prepare.getCo_telephone());
bean.setCo_zipcode(prepare.getCo_zipcode());
bean.setShpaeo(prepare.getShpaeo());
bean.setShpcusid(prepare.getShpcusid());
bean.setModifyDate(new Date());
bean.setCreateDate(new Date());
bean.setCreator(Tools.getUserEntity());
bean.setModifier(Tools.getUserEntity());
ConsignorEntity old = findByCompany(prepare.getCo_company());
if (old != null) {
service.delete(old.getId());
}
save(bean);
}
}
// public Page<ConsignorEntity> getPage(EasyPage<ConsigneeEntity> pageForm) {
// PageRequest pageRequest = buildPageRequest(pageForm);
// Specification<ConsignorEntity> spec = buildSpecification(pageForm);
// Page<ConsignorEntity> page = service.findAll(spec, pageRequest);
// return page;
// }
}
... ...
package com.agent.service.agent;
import com.agent.entity.Constant;
import com.agent.entity.agent.*;
import com.agent.repository.agent.*;
import com.agent.service.BasicService;
import com.framework.shiro.SessionUtil;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.data.domain.Page;
... ... @@ -16,10 +14,21 @@ import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import com.agent.entity.Constant;
import com.agent.entity.agent.ConsigneeEntity;
import com.agent.entity.agent.HawbOtherFeeEntity;
import com.agent.entity.agent.MakeHawbEntity;
import com.agent.entity.agent.PackageSizeEntity;
import com.agent.entity.agent.PubFhrEntity;
import com.agent.repository.agent.ConsigneeRepository;
import com.agent.repository.agent.HawbOtherFeeRepository;
import com.agent.repository.agent.MakeHawbRepository;
import com.agent.repository.agent.PackageSizeRepository;
import com.agent.repository.agent.PubFhrRepository;
import com.agent.service.BasicService;
import com.framework.shiro.SessionUtil;
import com.google.common.base.Splitter;
import com.plugin.easyui.EasyPage;
@Service
... ...