|
@@ -2,10 +2,7 @@ package com.sunyo.wlpt.message.builder.service.imp; |
|
@@ -2,10 +2,7 @@ package com.sunyo.wlpt.message.builder.service.imp; |
2
|
|
2
|
|
3
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
3
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
4
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
4
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
5
|
-import com.sunyo.wlpt.base.model.AWB_AWBINFO;
|
|
|
6
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT2201;
|
|
|
7
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_MT4201;
|
|
|
8
|
-import com.sunyo.wlpt.base.model.NMMS_CUSTOM_RESPONSE;
|
5
|
+import com.sunyo.wlpt.base.model.*;
|
9
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlFactory;
|
6
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlFactory;
|
10
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlHeader;
|
7
|
import com.sunyo.wlpt.message.builder.factory.CustomsXmlHeader;
|
11
|
import com.sunyo.wlpt.message.builder.service.MT2201Service;
|
8
|
import com.sunyo.wlpt.message.builder.service.MT2201Service;
|
|
@@ -20,6 +17,7 @@ import org.springframework.stereotype.Service; |
|
@@ -20,6 +17,7 @@ import org.springframework.stereotype.Service; |
20
|
import java.io.IOException;
|
17
|
import java.io.IOException;
|
21
|
import java.math.BigDecimal;
|
18
|
import java.math.BigDecimal;
|
22
|
import java.text.ParseException;
|
19
|
import java.text.ParseException;
|
|
|
20
|
+import java.text.SimpleDateFormat;
|
23
|
import java.util.Date;
|
21
|
import java.util.Date;
|
24
|
import java.util.HashMap;
|
22
|
import java.util.HashMap;
|
25
|
import java.util.Map;
|
23
|
import java.util.Map;
|
|
@@ -115,6 +113,20 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
|
@@ -115,6 +113,20 @@ public class MT2201ServiceImp extends CustomXmlMaker implements MT2201Service { |
115
|
}
|
113
|
}
|
116
|
}
|
114
|
}
|
117
|
|
115
|
|
|
|
116
|
+ @Override
|
|
|
117
|
+ public int securityBuilder(Map<String, Object> map) throws IOException, ParseException {
|
|
|
118
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
119
|
+ SecurityDeclaration security = objectMapper.convertValue(map.get("security"), SecurityDeclaration.class);
|
|
|
120
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
121
|
+ String format = simpleDateFormat.format(new Date());
|
|
|
122
|
+ map.put("format", format);
|
|
|
123
|
+ map.put("security", security);
|
|
|
124
|
+ if (makeXmlToFile("/manifest/SecurityDeclaration.ftlx",security.getSdWaybill()+".xml",map,"./send")>0){
|
|
|
125
|
+ return 1;
|
|
|
126
|
+ }
|
|
|
127
|
+ return 0;
|
|
|
128
|
+ }
|
|
|
129
|
+
|
118
|
|
130
|
|
119
|
public Map<String, Object> mt2201(Map<String, Object> map) throws IOException, ParseException {
|
131
|
public Map<String, Object> mt2201(Map<String, Object> map) throws IOException, ParseException {
|
120
|
ObjectMapper objectMapper = new ObjectMapper();
|
132
|
ObjectMapper objectMapper = new ObjectMapper();
|