作者 张天舒

The End. 2019年2月28日16:59:03

正在显示 34 个修改的文件 包含 507 行增加239 行删除
... ... @@ -54,6 +54,7 @@
<jackson.version>2.8.9</jackson.version>
<junit.version>4.12</junit.version>
<ehcache.version>2.6.8</ehcache.version>
<fastjosn.version>1.2.16</fastjosn.version>
</properties>
<dependencies>
... ... @@ -71,6 +72,12 @@
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjosn.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
... ...
... ... @@ -4,6 +4,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
... ... @@ -21,7 +22,6 @@ import com.tianbo.util.DateUtils;
import com.tianbo.util.json.AjaxJson;
import com.tianbo.util.json.JsonConversion;
import com.tianbo.util.xml.XmlGen;
import com.tianbo.xml.lost.AdditionalInformation;
import com.tianbo.xml.lost.AssociatedTransportDocument;
import com.tianbo.xml.lost.BorderTransportMeans;
import com.tianbo.xml.lost.Consignment;
... ... @@ -52,6 +52,12 @@ public class LostApplyController {
return "lost/edit";
}
@RequestMapping(value ="toGetSendLog")
public String toGetSendLog(ModelMap model,HttpServletRequest request) {
model.put("id", request.getParameter("id"));
return "lost/sendLog";
}
@ResponseBody
@RequestMapping(value = "getList")
public String getList(HttpServletRequest request,int page,int limit){
... ... @@ -98,6 +104,28 @@ public class LostApplyController {
}
/**
* 获取运抵回执
*/
@ResponseBody
@RequestMapping(value = "getSendLog")
public String getList(HttpServletRequest request){
String id = request.getParameter("id");
List<Sendlog> sendLog = sendLogService.getSendLogByMessageId(id);
Map<String,Object> map = new HashMap<>();
if(!sendLog.isEmpty()){
map.put("code", 0);
map.put("msg", "success");
map.put("data", sendLog);
}else {
map.put("code", -1);
map.put("msg", "无此单运抵回执");
map.put("data", "");
}
return JsonConversion.writeMapJSON(map);
}
/**
* 编辑或新增
* @param lost
* @param redirectAttributes
... ... @@ -221,10 +249,11 @@ public class LostApplyController {
try {
//保存至sendLog表
Sendlog sendlog = new Sendlog();
sendlog.setAutoid(id);
sendlog.setAutoid(UUID.randomUUID().toString());
sendlog.setMessageautoid(id);
sendlog.setCreatedate(new Date());
sendlog.setMessagetype("MT8202");
sendlog.setReceiption("发送分拨申请");
sendlog.setReceiption("发送落装申请");
sendLogService.save(sendlog);
//生成报文并发送至文件夹
ManifestXmlEntity manifestXml = new ManifestXmlEntity();
... ... @@ -252,28 +281,27 @@ public class LostApplyController {
* @param remark
* @param manifestXml
*/
public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,
String remark, ManifestXmlEntity manifestXml) {
public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,String remark, ManifestXmlEntity manifestXml) {
HeadXmlEntity headXml = new HeadXmlEntity();
DeclarationXmlEntity declarationXml = new DeclarationXmlEntity();
BorderTransportMeans transportMeans = new BorderTransportMeans();
transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班
AdditionalInformation information = new AdditionalInformation();
information.setContent(remark);
Consignment consignment = new Consignment();
TransportContractDocument transportContractDocument = new TransportContractDocument();
transportContractDocument.setId(waybillnomaster.replace("-", ""));//主单号
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
if(waybillnosecondary==""||waybillnosecondary==null){
associatedTransportDocument.setId("");//分单号
}else{
associatedTransportDocument.setId(waybillnomaster.replace("-", "")+"_"+waybillnosecondary);//分单号
consignment.setAssociatedTransportDocument(associatedTransportDocument );
}
consignment.setAssociatedTransportDocument(associatedTransportDocument );
consignment.setTransportContractDocument(transportContractDocument );
declarationXml.setAdditionalInformation(information);
declarationXml.setBorderTransportMeans(transportMeans);
declarationXml.setConsignment(consignment);
manifestXml.setHeadXml(headXml);
manifestXml.setDeclarationXml(declarationXml);
}
... ...
... ... @@ -3,10 +3,12 @@ package com.tianbo.controller.lost;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
... ... @@ -26,17 +28,25 @@ import com.tianbo.model.Sendlog;
import com.tianbo.service.ItemService;
import com.tianbo.service.LostChangeService;
import com.tianbo.service.SendLogService;
import com.tianbo.util.DateUtils;
import com.tianbo.util.json.AjaxJson;
import com.tianbo.util.json.JsonConversion;
import com.tianbo.util.xml.XmlGen;
import com.tianbo.xml.lost.AdditionalInformation;
import com.tianbo.xml.lost.AssociatedTransportDocument;
import com.tianbo.xml.lost.BorderTransportMeans;
import com.tianbo.xml.lost.Consignment;
import com.tianbo.xml.lost.DeclarationXmlEntity;
import com.tianbo.xml.lost.HeadXmlEntity;
import com.tianbo.xml.lost.ManifestXmlEntity;
import com.tianbo.xml.lost.TransportContractDocument;
import com.tianbo.xml.lostChange.AssociatedTransport;
import com.tianbo.xml.lostChange.ChangeBorderTransportMeans;
import com.tianbo.xml.lostChange.ChangeConsignment;
import com.tianbo.xml.lostChange.Commodity;
import com.tianbo.xml.lostChange.ConsignmentItem;
import com.tianbo.xml.lostChange.ConsignmentItemPackaging;
import com.tianbo.xml.lostChange.DeclarationXml;
import com.tianbo.xml.lostChange.GoodsMeasure;
import com.tianbo.xml.lostChange.HeadXml;
import com.tianbo.xml.lostChange.ManifestXml;
import com.tianbo.xml.lostChange.TransportContract;
@Controller
@RequestMapping("/lost/change")
... ... @@ -116,11 +126,15 @@ public class LostChangeController {
map.put("data", ltem);
}else {
map.put("code", 0);
map.put("msg", "");
map.put("msg", "success");
map.put("data", "");
}
}
}else{
map.put("code", 0);
map.put("msg", "success");
map.put("data", "");
}
} catch (Exception e) {
map.put("code", -1);
map.put("msg", "请检查网络连接或重试");
... ... @@ -339,30 +353,98 @@ public class LostChangeController {
* @param lost
* @param redirectAttributes
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@ResponseBody
@RequestMapping(value = "send")
public AjaxJson send(ModelMap model,HttpServletRequest request) {
public AjaxJson send(ModelMap model,HttpServletRequest request,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException {
String id = request.getParameter("id");
String flightno = request.getParameter("flightno");
String flightdate = request.getParameter("flightdate");
String waybillnomaster = request.getParameter("waybillnomaster");
String waybillnosecondary = request.getParameter("waybillnosecondary");
String remark = request.getParameter("remark");
String message = null;
ManifestLostChange mf = new ManifestLostChange();
DateConvert();//日期转化
BeanUtils.populate(mf, params);
List<ManifestItem> iteamList = itemService.getIteamList(mf.getWaybillnomaster());
List<ConsignmentItem> consignmentItem = new ArrayList<>();
for (ManifestItem manifestItem : iteamList) {
ConsignmentItemPackaging consignmentItemPackaging = new ConsignmentItemPackaging();
consignmentItemPackaging.setQuantityQuantity(manifestItem.getPiece()); //件数
consignmentItemPackaging.setTypeCode(manifestItem.getPackageCode()); //包装代码
GoodsMeasure goodsMeasure = new GoodsMeasure();
goodsMeasure.setGrossMassMeasure(manifestItem.getWeight()); //重量
Commodity commodity = new Commodity();
commodity.setCargoDescription(manifestItem.getDescription());//货物描述
ConsignmentItem item = new ConsignmentItem();
item.setSequenceNumeric(manifestItem.getOrderNumber());//商品序号
item.setConsignmentItemPackaging(consignmentItemPackaging);//包装项信息
item.setGoodsMeasure(goodsMeasure);//货物毛重
item.setCommodity(commodity );
consignmentItem.add(item);
}
String message = null;
AjaxJson j = new AjaxJson();
try {
//保存至sendLog表
Sendlog sendlog = new Sendlog();
sendlog.setAutoid(id);
sendlog.setAutoid(UUID.randomUUID().toString());
sendlog.setMessageautoid(id);
sendlog.setCreatedate(new Date());
sendlog.setMessagetype("MT8203");
sendlog.setReceiption("发送落装改配申请");
sendLogService.save(sendlog);
//生成报文并发送至文件夹
ManifestXmlEntity manifestXml = new ManifestXmlEntity();
setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml);
XmlGen.genLostXmlAndSend(manifestXml);
//生成报文并发送
ManifestXml manifestXml = new ManifestXml();
HeadXml headXml = new HeadXml();
DeclarationXml declaration = new DeclarationXml();
Consignment consign = new Consignment();
TransportContractDocument transportContractDocument = new TransportContractDocument();
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
TransportContract transportContract= new TransportContract();
AssociatedTransport associatedTransport = new AssociatedTransport();
transportContractDocument.setId(mf.getWaybillnomaster());//改配前主单号
associatedTransportDocument.setId(mf.getWaybillnomaster()+"_"+mf.getWaybillnosecondary()); //改配前分单号
consign.setTransportContractDocument(transportContractDocument);
consign.setAssociatedTransportDocument(associatedTransportDocument);
ChangeConsignment changeConsignment = new ChangeConsignment();
transportContract.setId(mf.getCwaybillnomaster());//改配后主单号
associatedTransport.setId(mf.getCwaybillnomaster()+"_"+mf.getCwaybillnosecondary()); //改配分单号
changeConsignment.setTransportContractDocument(transportContract);
changeConsignment.setAssociatedTransportDocument(associatedTransport);
changeConsignment.setConsignmentItem(consignmentItem);
consign.setChangeConsignment(changeConsignment);
BorderTransportMeans borderTransportMeans = new BorderTransportMeans();
borderTransportMeans.setJourneyID(mf.getFlightno()+"/"+DateUtils.DateToString(mf.getFlightdate(), "yyyy-MM-dd HH:mm:ss").substring(0,10).replace("-", ""));//航次航班
ChangeBorderTransportMeans changeBorderTransportMeans = new ChangeBorderTransportMeans();
changeBorderTransportMeans.setJourneyID(mf.getCflightno()+"/"+DateUtils.DateToString(mf.getCflightdate(), "yyyy-MM-dd HH:mm:ss").substring(0,10).replace("-", ""));//航次航班
declaration.setBorderTransportMeans(borderTransportMeans);
declaration.setChangeBorderTransportMeans(changeBorderTransportMeans );
declaration.setConsignment(consign);
manifestXml.setHeadXml(headXml);
manifestXml.setDeclarationXml(declaration);
XmlGen.genLostChangeXmlAndSend(manifestXml);
j.setSuccess(true);
message = "已发送申报报文";
ManifestLostChange lost = lostChangeService.selectByPrimaryKey(id);
... ... @@ -377,35 +459,4 @@ public class LostChangeController {
return j;
}
/**
* @param flightno
* @param flightdate
* @param waybillnomaster
* @param waybillnosecondary
* @param remark
* @param manifestXml
*/
public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary,
String remark, ManifestXmlEntity manifestXml) {
HeadXmlEntity headXml = new HeadXmlEntity();
DeclarationXmlEntity declarationXml = new DeclarationXmlEntity();
BorderTransportMeans transportMeans = new BorderTransportMeans();
transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班
AdditionalInformation information = new AdditionalInformation();
information.setContent(remark);
Consignment consignment = new Consignment();
TransportContractDocument transportContractDocument = new TransportContractDocument();
transportContractDocument.setId(waybillnomaster);//主单号
AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument();
associatedTransportDocument.setId(waybillnomaster+"_"+waybillnosecondary);//分单号
consignment.setAssociatedTransportDocument(associatedTransportDocument );
consignment.setTransportContractDocument(transportContractDocument );
declarationXml.setAdditionalInformation(information);
declarationXml.setBorderTransportMeans(transportMeans);
declarationXml.setConsignment(consignment);
manifestXml.setHeadXml(headXml);
manifestXml.setDeclarationXml(declarationXml);
}
}
... ...
... ... @@ -29,4 +29,6 @@ public interface SendlogMapper {
List<Sendlog> getSendLogSecondByMain(String billNo);
List<Sendlog> getSendLogByMessageId(String id);
}
\ No newline at end of file
... ...
... ... @@ -14,4 +14,6 @@ public interface SendLogService {
public List<Sendlog> getSendLogSecondByMain(String billNo);
public void save(Sendlog sendlog);
public List<Sendlog> getSendLogByMessageId(String id);
}
... ...
... ... @@ -38,4 +38,10 @@ public class SendLogServiceImpl implements SendLogService {
sendlogDao.insert(sendlog);
}
@Override
public List<Sendlog> getSendLogByMessageId(String id) {
// TODO Auto-generated method stub
return sendlogDao.getSendLogByMessageId(id);
}
}
... ...
package com.tianbo.util.xml;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.mapper.MapperWrapper;
public class XStreamEx extends XStream {
public XStreamEx(DomDriver domDriver) {
super();
}
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new MapperWrapper(next) {
@Override
public boolean shouldSerializeMember(@SuppressWarnings("rawtypes") Class definedIn,
String fieldName) {
if (definedIn == Object.class) {
return false;
}
return super.shouldSerializeMember(definedIn, fieldName);
}
};
}
}
... ...
... ... @@ -11,10 +11,11 @@ import java.nio.charset.Charset;
import org.springframework.stereotype.Component;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.tianbo.util.DateUtils;
import com.tianbo.util.NullConverter;
import com.tianbo.util.PropertiesUtils;
import com.tianbo.xml.lost.ManifestXmlEntity;
import com.tianbo.xml.lostChange.ManifestXml;
@Component
public class XmlGen {
... ... @@ -24,12 +25,14 @@ public class XmlGen {
* @param entity
*/
public static String genLostXmlAndSend(ManifestXmlEntity xmlVO){
String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml";
String xmlFileName = xmlVO.getHeadXml().getMessageId() + ".xml";
XStreamEx xstream = new XStreamEx(new DomDriver());
XStream xstream = new XStream();
xstream.autodetectAnnotations(true);
xstream.registerConverter(new NullConverter());
/*xstream.registerConverter(new NullConverter());*/
String xml = xstream.toXML(xmlVO);
... ... @@ -48,20 +51,20 @@ public class XmlGen {
* 生成落装改配申请报文
* @param entity
*/
public static String genLostChangeXmlAndSend(ManifestXmlEntity xmlVO){
public static String genLostChangeXmlAndSend(ManifestXml xmlVO){
String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml";
String xmlFileName = "CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml";
XStream xstream = new XStream();
xstream.autodetectAnnotations(true);
xstream.registerConverter(new NullConverter());
/* xstream.registerConverter(new NullConverter());*/
String xml = xstream.toXML(xmlVO);
xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml;
xml=xml.replace("__", "_");
String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName;
String xmlPath =PropertiesUtils.readProperty("MT8203Path")+xmlFileName;
xml2File(xmlVO, xmlFileName, xstream,xmlPath);
... ... @@ -75,7 +78,7 @@ public class XmlGen {
* @param xmlFileName
* @param xstream
*/
public static void xml2File(ManifestXmlEntity xmlVO, String xmlFileName, XStream xstream,String xmlPath) {
public static void xml2File(Object xmlVO, String xmlFileName, XStream xstream,String xmlPath) {
File file = new File(xmlPath);
if (!file.exists()) {
try {
... ...
... ... @@ -13,7 +13,7 @@ import org.junit.Test;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class xmlUtils {
public class XmlUtils {
private Object obj;
... ...
... ... @@ -2,6 +2,7 @@ package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("AssociatedTransportDocument")
public class AssociatedTransportDocument {
@XStreamAlias("ID")
... ...
package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.xml.lostChange.ChangeConsignment;
public class Consignment {
... ... @@ -9,6 +10,9 @@ public class Consignment {
@XStreamAlias("AssociatedTransportDocument")
private AssociatedTransportDocument associatedTransportDocument;
@XStreamAlias("ChangeConsignment")
private ChangeConsignment changeConsignment;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
... ... @@ -26,4 +30,12 @@ public class Consignment {
this.associatedTransportDocument = associatedTransportDocument;
}
public ChangeConsignment getChangeConsignment() {
return changeConsignment;
}
public void setChangeConsignment(ChangeConsignment changeConsignment) {
this.changeConsignment = changeConsignment;
}
}
... ...
... ... @@ -2,10 +2,19 @@ package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.tianbo.util.xml.XmlGen;
@XStreamAlias("Manifest")
public class ManifestXmlEntity {
/* @XStreamAlias("Head")
@XStreamAsAttribute
private String xmlxsd;
@XStreamAlias("Head")
@XStreamAsAttribute
private String xmlns;*/
@XStreamAlias("Head")
private HeadXmlEntity headXml;
... ...
... ... @@ -2,6 +2,7 @@ package com.tianbo.xml.lost;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("TransportContractDocument")
public class TransportContractDocument {
@XStreamAlias("ID")
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class AdditionalInformation {
@XStreamAlias("Content")
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 运输合同信息
* @author Promise
*
*/
public class TransportContractDocument {
public class AssociatedTransport {
@XStreamAlias("ID")
private String id;
... ... @@ -18,4 +15,5 @@ public class TransportContractDocument {
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class BorderTransportMeans {
@XStreamAlias("JourneyID")
private String journeyID;
public String getJourneyID() {
return journeyID;
}
public void setJourneyID(String journeyID) {
this.journeyID = journeyID;
}
}
package com.tianbo.xml.lostChange;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
/**
* 变更后提(运)单信息
... ... @@ -10,36 +13,38 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
public class ChangeConsignment {
@XStreamAlias("TransportContractDocument")
private TransportContractDocument transportContractDocument;
private TransportContract transportContractDocument;
@XStreamAlias("TransportContractDocument")
private AssociatedTransportDocument associatedTransportDocument;
@XStreamAlias("AssociatedTransportDocument")
private AssociatedTransport associatedTransportDocument;
@XStreamImplicit(itemFieldName = "ConsignmentItem")
private List<ConsignmentItem> consignmentItem;
@XStreamAlias("TransportEquipment")
private TransportEquipment transportEquipment;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
public List<ConsignmentItem> getConsignmentItem() {
return consignmentItem;
}
public void setTransportContractDocument(TransportContractDocument transportContractDocument) {
this.transportContractDocument = transportContractDocument;
public void setConsignmentItem(List<ConsignmentItem> consignmentItem) {
this.consignmentItem = consignmentItem;
}
public AssociatedTransportDocument getAssociatedTransportDocument() {
return associatedTransportDocument;
public TransportContract getTransportContractDocument() {
return transportContractDocument;
}
public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
public void setTransportContractDocument(TransportContract transportContractDocument) {
this.transportContractDocument = transportContractDocument;
}
public TransportEquipment getTransportEquipment() {
return transportEquipment;
public AssociatedTransport getAssociatedTransportDocument() {
return associatedTransportDocument;
}
public void setTransportEquipment(TransportEquipment transportEquipment) {
this.transportEquipment = transportEquipment;
public void setAssociatedTransportDocument(AssociatedTransport associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class Commodity { //商品项简要描述
@XStreamAlias("CargoDescription")
private String cargoDescription;
public String getCargoDescription() {
return cargoDescription;
}
public void setCargoDescription(String cargoDescription) {
this.cargoDescription = cargoDescription;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class Consignment {
@XStreamAlias("TransportContractDocument")
private TransportContractDocument transportContractDocument;
@XStreamAlias("AssociatedTransportDocument")
private AssociatedTransportDocument associatedTransportDocument;
@XStreamAlias("ChangeConsignment")
private ChangeConsignment changeConsignment;
public TransportContractDocument getTransportContractDocument() {
return transportContractDocument;
}
public void setTransportContractDocument(TransportContractDocument transportContractDocument) {
this.transportContractDocument = transportContractDocument;
}
public AssociatedTransportDocument getAssociatedTransportDocument() {
return associatedTransportDocument;
}
public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) {
this.associatedTransportDocument = associatedTransportDocument;
}
public ChangeConsignment getChangeConsignment() {
return changeConsignment;
}
public void setChangeConsignment(ChangeConsignment changeConsignment) {
this.changeConsignment = changeConsignment;
}
}
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class ConsignmentItem {
@XStreamAlias("SequenceNumeric")
private String SequenceNumeric;
@XStreamAlias("ConsignmentItemPackaging")
private ConsignmentItemPackaging consignmentItemPackaging;
@XStreamAlias("Commodity")
private Commodity commodity;
@XStreamAlias("GoodsMeasure")
private GoodsMeasure goodsMeasure;
public String getSequenceNumeric() {
return SequenceNumeric;
}
public void setSequenceNumeric(String sequenceNumeric) {
SequenceNumeric = sequenceNumeric;
}
public ConsignmentItemPackaging getConsignmentItemPackaging() {
return consignmentItemPackaging;
}
public void setConsignmentItemPackaging(ConsignmentItemPackaging consignmentItemPackaging) {
this.consignmentItemPackaging = consignmentItemPackaging;
}
public Commodity getCommodity() {
return commodity;
}
public void setCommodity(Commodity commodity) {
this.commodity = commodity;
}
public GoodsMeasure getGoodsMeasure() {
return goodsMeasure;
}
public void setGoodsMeasure(GoodsMeasure goodsMeasure) {
this.goodsMeasure = goodsMeasure;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class ConsignmentItemPackaging {
@XStreamAlias("QuantityQuantity")
private String quantityQuantity;
@XStreamAlias("TypeCode")
private String typeCode;
public String getQuantityQuantity() {
return quantityQuantity;
}
public void setQuantityQuantity(String quantityQuantity) {
this.quantityQuantity = quantityQuantity;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
}
... ...
... ... @@ -3,8 +3,11 @@ package com.tianbo.xml.lostChange;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.xml.lost.AdditionalInformation;
import com.tianbo.xml.lost.BorderTransportMeans;
import com.tianbo.xml.lost.Consignment;
public class DeclarationXmlEntity {
public class DeclarationXml {
@XStreamAlias("BorderTransportMeans")
private BorderTransportMeans borderTransportMeans;
... ... @@ -13,7 +16,7 @@ public class DeclarationXmlEntity {
private ChangeBorderTransportMeans changeBorderTransportMeans;
@XStreamAlias("Consignment")
private List<Consignment> consignment;
private Consignment consignment;
@XStreamAlias("AdditionalInformation")
private AdditionalInformation additionalInformation;
... ... @@ -35,11 +38,20 @@ public class DeclarationXmlEntity {
this.additionalInformation = additionalInformation;
}
public List<Consignment> getConsignment() {
public ChangeBorderTransportMeans getChangeBorderTransportMeans() {
return changeBorderTransportMeans;
}
public void setChangeBorderTransportMeans(ChangeBorderTransportMeans changeBorderTransportMeans) {
this.changeBorderTransportMeans = changeBorderTransportMeans;
}
public Consignment getConsignment() {
return consignment;
}
public void setConsignment(List<Consignment> consignment) {
public void setConsignment(Consignment consignment) {
this.consignment = consignment;
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
public class GoodsMeasure {
@XStreamAlias("GrossMassMeasure")
private String grossMassMeasure; //商品项货物毛重
public String getGrossMassMeasure() {
return grossMassMeasure;
}
public void setGrossMassMeasure(String grossMassMeasure) {
this.grossMassMeasure = grossMassMeasure;
}
}
... ...
... ... @@ -3,7 +3,7 @@ package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.tianbo.util.DateUtils;
public class HeadXmlEntity {
public class HeadXml {
@XStreamAlias("MessageID")
private String messageId="CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS");
... ... @@ -85,7 +85,7 @@ public class HeadXmlEntity {
this.sendTime = sendTime;
}
public static void main(String[] args) {
HeadXmlEntity hd = new HeadXmlEntity();
HeadXml hd = new HeadXml();
System.out.println(hd);
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("Manifest")
public class ManifestXml {
@XStreamAlias("Head")
private HeadXml headXml;
@XStreamAlias("Declaration")
private DeclarationXml declarationXml;
public DeclarationXml getDeclarationXml() {
return declarationXml;
}
public void setDeclarationXml(DeclarationXml declarationXml) {
this.declarationXml = declarationXml;
}
public HeadXml getHeadXml() {
return headXml;
}
public void setHeadXml(HeadXml headXml) {
this.headXml = headXml;
}
}
... ...
... ... @@ -2,14 +2,14 @@ package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 运输合同附加信息
* 运输合同信息
* @author Promise
*
*/
public class AssociatedTransportDocument {
public class TransportContract {
@XStreamAlias("ID")
private String id;
@XStreamAlias("ID") //总提(运)单号
private String id;
public String getId() {
return id;
... ... @@ -18,5 +18,4 @@ public class AssociatedTransportDocument {
public void setId(String id) {
this.id = id;
}
}
... ...
package com.tianbo.xml.lostChange;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 集装箱(器)信息
* @author Promise
*
*/
public class TransportEquipment {
@XStreamAlias("EquipmentIdentification") //集装箱(器)编号信息
private String equipmentIdentification;
@XStreamAlias("CharacteristicCode")
private String characteristicCode; //集装箱(器)尺寸和类型
@XStreamAlias("SupplierPartyTypeCode")
private String supplierPartyTypeCode; //集装箱(器)尺寸和类型
public String getEquipmentIdentification() {
return equipmentIdentification;
}
public void setEquipmentIdentification(String equipmentIdentification) {
this.equipmentIdentification = equipmentIdentification;
}
public String getCharacteristicCode() {
return characteristicCode;
}
public void setCharacteristicCode(String characteristicCode) {
this.characteristicCode = characteristicCode;
}
}
... ... @@ -96,7 +96,7 @@
insert into SENDLOG (AUTOID, CREATEDATE, OPAUTHOR,
SENDPEICE, SENDWEIGHT, RECEIPTION,
MESSAGETYPE, MESSAGEAUTOID)
values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=DATE}, #{opauthor,jdbcType=VARCHAR},
values (#{autoid,jdbcType=VARCHAR}, sysdate, #{opauthor,jdbcType=VARCHAR},
#{sendpeice,jdbcType=DECIMAL}, #{sendweight,jdbcType=DECIMAL}, #{receiption,jdbcType=VARCHAR},
#{messagetype,jdbcType=VARCHAR}, #{messageautoid,jdbcType=VARCHAR})
</insert>
... ... @@ -271,4 +271,18 @@
WHERE
a.AUTOID = b.MESSAGEAUTOID
</select>
<select id="getSendLogByMessageId" parameterType="Map"
resultType="com.tianbo.model.Sendlog">
SELECT
*
FROM
SENDLOG
WHERE
MESSAGEAUTOID = #{id}
ORDER BY CREATEDATE
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -6,4 +6,5 @@ targetPath=
#path3=//10.50.3.61/nms_customs_xml3
#path=D:/1test
#targetPath=//10.50.3.61/nms_customs_xml/
MT8202Path=E:/2test/
\ No newline at end of file
MT8202Path=E:/2test/
MT8203Path=E:/2test/
\ No newline at end of file
... ...
... ... @@ -83,7 +83,9 @@
<div class="layui-inline">
<label class="layui-form-label">包装种类代码</label>
<div class="layui-input-block">
<input type="text" name="packageCode" id="packageCode" autocomplete="off" class="layui-input">
<select name="packageCode" id="packageCode">
<option value="PK"></option>
</select>
</div>
</div>
</div>
... ...
... ... @@ -170,17 +170,7 @@
});
return false;
}
}else{
billNo = billNo.substring(0,3)+'-'+billNo.substring(3)
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}
$("#waybillnomaster").val(billNo);
return true;
}
}
... ...
... ... @@ -256,6 +256,7 @@
alert("请选择运单")
}
}else if(obj.event === 'shoufa'){
var id = data.id;
if (data) {
var id = data.id;
layer.open({
... ... @@ -269,12 +270,12 @@
/* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
area: ['692px', '372px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath %>/lost/edit?id="+id,
content: "<%=basePath %>/lost/toGetSendLog?id="+id,
success: function (layero, index) {
// 获取子页面的iframe
var iframe = window['layui-layer-iframe' + index];
// 向子页面的全局函数child传参
iframe.child(data);
// iframe.child(data);
}
})
} else {
... ... @@ -343,17 +344,7 @@
});
return false;
}
}else{
billNo = billNo.substring(0,3)+'-'+billNo.substring(3)
if(billNo.length!=12){
$("#waybillnomaster").focus();
layer.tips('主单号必须为11位', '#waybillnomaster', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}
$("#waybillnomaster").val(billNo);
return true;
}
}
... ...
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>运抵回执查询</title>
<link rel="stylesheet" href="<%=basePath %>static/layui/css/layui.css" media="all">
<script src="<%=basePath %>static/layui/layui.js"></script>
<script src="<%=basePath %>static/easyui/jquery.min.js"></script>
</head>
<body>
<div class="layui-inline" >
<table class="layui-hide" id="main" lay-filter="flight" style="width:99%; text-align="center"></table>
</div>
<input type="hidden" id="id" value="${id}">
</body>
<script>
$(document).ready(function(){
var id = $("#id").val()
//if(!billNo == "" || !billNo == null || !billNo == undefined){
layui.use('table', function(){
var table = layui.table;
//第一个实例
table.render({
elem: '#main'
,height: 'full-20'
,url: '/statistics/lost/getSendLog?id='+id
,page: false //开启分页
,cols: [[ //表头
{field: 'createdate', title: '发送时间', width:180}
,{field: 'receiption', title: '回执内容', width:5800 ,templet: function(d){
var text = d.receiption;
if(text.indexOf("成功")!=-1){
return '<span style="color: green;">'+ d.receiption +'</span>'
}else if(text.indexOf("发送落装申请")!=-1){
return d.receiption
}else{
return '<span style="color: red;">'+ d.receiption +'</span>'
}
}
}
]]
});
});
})
function loading(){
//var index = layer.load(0, {shade: 0.01})
var index = layer.msg('查询中', {
icon: 16
,shade: 0.01
});
}
function unloading(){
//var index = layer.load(0, {shade: 0.01})
layer.closeAll();
}
</script>
</html>
\ No newline at end of file
... ...