|
@@ -10,7 +10,6 @@ import java.util.HashMap; |
|
@@ -10,7 +10,6 @@ import java.util.HashMap; |
10
|
import java.util.List;
|
10
|
import java.util.List;
|
11
|
import java.util.Map;
|
11
|
import java.util.Map;
|
12
|
import java.util.Set;
|
12
|
import java.util.Set;
|
13
|
-import java.util.jar.Manifest;
|
|
|
14
|
|
13
|
|
15
|
import javax.annotation.Resource;
|
14
|
import javax.annotation.Resource;
|
16
|
import javax.servlet.http.HttpServletRequest;
|
15
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity; |
|
@@ -36,9 +35,11 @@ import com.agent.entity.agent.PackageTypeEntity; |
36
|
import com.agent.entity.agent.PreparesecondaryEntity;
|
35
|
import com.agent.entity.agent.PreparesecondaryEntity;
|
37
|
import com.agent.entity.agent.PubDgEntity;
|
36
|
import com.agent.entity.agent.PubDgEntity;
|
38
|
import com.agent.entity.agent.TBasCarrierEntity;
|
37
|
import com.agent.entity.agent.TBasCarrierEntity;
|
|
|
38
|
+import com.agent.entity.agent.WaybillReceiptType;
|
39
|
import com.agent.entity.system.UserEntity;
|
39
|
import com.agent.entity.system.UserEntity;
|
40
|
import com.agent.imf.agent.redis.RedisSaveMessage;
|
40
|
import com.agent.imf.agent.redis.RedisSaveMessage;
|
41
|
import com.agent.service.agent.BasicAgentService;
|
41
|
import com.agent.service.agent.BasicAgentService;
|
|
|
42
|
+import com.agent.service.agent.ConsignorService;
|
42
|
import com.agent.service.agent.ManifestBillService;
|
43
|
import com.agent.service.agent.ManifestBillService;
|
43
|
import com.agent.service.agent.ManifestCommodityService;
|
44
|
import com.agent.service.agent.ManifestCommodityService;
|
44
|
import com.agent.service.agent.ManifestContainerService;
|
45
|
import com.agent.service.agent.ManifestContainerService;
|
|
@@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService; |
|
@@ -47,12 +48,14 @@ import com.agent.service.agent.PackageTypeService; |
47
|
import com.agent.service.agent.PreparesecondaryService;
|
48
|
import com.agent.service.agent.PreparesecondaryService;
|
48
|
import com.agent.service.agent.PubDgService;
|
49
|
import com.agent.service.agent.PubDgService;
|
49
|
import com.agent.service.agent.TBasCarrierService;
|
50
|
import com.agent.service.agent.TBasCarrierService;
|
|
|
51
|
+import com.agent.service.agent.WaybillReceiptService;
|
50
|
import com.agent.service.system.RoleService;
|
52
|
import com.agent.service.system.RoleService;
|
51
|
import com.agent.util.HttpJsonMsg;
|
53
|
import com.agent.util.HttpJsonMsg;
|
52
|
import com.agent.vo.ResponseModel;
|
54
|
import com.agent.vo.ResponseModel;
|
53
|
import com.agent.vo.agent.CommodityVo;
|
55
|
import com.agent.vo.agent.CommodityVo;
|
54
|
import com.agent.xml.common.XmlHead;
|
56
|
import com.agent.xml.common.XmlHead;
|
55
|
import com.agent.xml.common.XmlUtil;
|
57
|
import com.agent.xml.common.XmlUtil;
|
|
|
58
|
+import com.agent.xml.fhlsli.FSXmlKit;
|
56
|
import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody;
|
59
|
import com.agent.xml.manifestdeclare.DeclarePreparemasterXmlBody;
|
57
|
import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml;
|
60
|
import com.agent.xml.manifestdeclare.ManifestBorderTransportMeansXml;
|
58
|
import com.agent.xml.manifestdeclare.ManifestCarrierXml;
|
61
|
import com.agent.xml.manifestdeclare.ManifestCarrierXml;
|
|
@@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid; |
|
@@ -79,6 +82,7 @@ import com.plugin.easyui.DataGrid; |
79
|
import com.plugin.easyui.EasyPage;
|
82
|
import com.plugin.easyui.EasyPage;
|
80
|
|
83
|
|
81
|
import tools.DBConnection;
|
84
|
import tools.DBConnection;
|
|
|
85
|
+import tools.NumKit;
|
82
|
import tools.Tools;
|
86
|
import tools.Tools;
|
83
|
import tools.oclass.FemyList;
|
87
|
import tools.oclass.FemyList;
|
84
|
|
88
|
|
|
@@ -87,8 +91,7 @@ import tools.oclass.FemyList; |
|
@@ -87,8 +91,7 @@ import tools.oclass.FemyList; |
87
|
*/
|
91
|
*/
|
88
|
@Controller
|
92
|
@Controller
|
89
|
@RequestMapping(value = "/manifest")
|
93
|
@RequestMapping(value = "/manifest")
|
90
|
-public class ManifestController extends BasicController{
|
|
|
91
|
-
|
94
|
+public class ManifestController extends BasicController {
|
92
|
private static final Logger logger = LoggerFactory.getLogger(ManifestController.class);
|
95
|
private static final Logger logger = LoggerFactory.getLogger(ManifestController.class);
|
93
|
|
96
|
|
94
|
public static boolean isSuccess = false;
|
97
|
public static boolean isSuccess = false;
|
|
@@ -123,138 +126,145 @@ public class ManifestController extends BasicController{ |
|
@@ -123,138 +126,145 @@ public class ManifestController extends BasicController{ |
123
|
@Resource
|
126
|
@Resource
|
124
|
private TBasCarrierService tbasService;
|
127
|
private TBasCarrierService tbasService;
|
125
|
|
128
|
|
|
|
129
|
+ @Resource
|
|
|
130
|
+ private ConsignorService consignorService;
|
|
|
131
|
+
|
|
|
132
|
+ @Resource
|
|
|
133
|
+ private WaybillReceiptService receiptService;
|
|
|
134
|
+
|
126
|
/**
|
135
|
/**
|
127
|
* 列表页面
|
136
|
* 列表页面
|
|
|
137
|
+ *
|
128
|
* @return
|
138
|
* @return
|
129
|
*/
|
139
|
*/
|
130
|
@RequestMapping(value = "/list")
|
140
|
@RequestMapping(value = "/list")
|
131
|
- public String getList(Model model){
|
141
|
+ public String getList(Model model) {
|
132
|
return "manifest/list";
|
142
|
return "manifest/list";
|
133
|
}
|
143
|
}
|
134
|
- //app端接口
|
|
|
135
|
- //获取主单列表
|
144
|
+
|
|
|
145
|
+ // app端接口
|
|
|
146
|
+ // 获取主单列表
|
136
|
@RequestMapping(value = "/cross/grid.json")
|
147
|
@RequestMapping(value = "/cross/grid.json")
|
137
|
@ResponseBody
|
148
|
@ResponseBody
|
138
|
- public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response, EasyPage<ManifestEntity> pageForm){
|
|
|
139
|
-// response.setCharacterEncoding("UTF-8");
|
|
|
140
|
-// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
|
141
|
-// response.setHeader("Pragma", "no-cache");
|
149
|
+ public DataGrid<ManifestEntity> cross_grid_json(HttpServletRequest request, HttpServletResponse response,
|
|
|
150
|
+ EasyPage<ManifestEntity> pageForm) {
|
|
|
151
|
+ // response.setCharacterEncoding("UTF-8");
|
|
|
152
|
+ // response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
|
153
|
+ // response.setHeader("Pragma", "no-cache");
|
142
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
154
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
143
|
-// response.setDateHeader("Expires", 0);
|
155
|
+ // response.setDateHeader("Expires", 0);
|
144
|
|
156
|
|
145
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
157
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
146
|
searchParams.put("EQ_USER_ID", Tools.getUserId());
|
158
|
searchParams.put("EQ_USER_ID", Tools.getUserId());
|
147
|
pageForm.setSearchParams(searchParams);
|
159
|
pageForm.setSearchParams(searchParams);
|
148
|
- //添加用户id的条件
|
160
|
+ // 添加用户id的条件
|
149
|
pageForm.parseData(manifestService.getPage(pageForm));
|
161
|
pageForm.parseData(manifestService.getPage(pageForm));
|
150
|
return pageForm.getData();
|
162
|
return pageForm.getData();
|
151
|
}
|
163
|
}
|
|
|
164
|
+
|
152
|
@RequestMapping(value = "/cross/edit")
|
165
|
@RequestMapping(value = "/cross/edit")
|
153
|
@ResponseBody
|
166
|
@ResponseBody
|
154
|
- public Map cross_edit(Long id, HttpServletResponse response){
|
|
|
155
|
- System.out.println("id:"+id);
|
167
|
+ public Map cross_edit(Long id, HttpServletResponse response) {
|
|
|
168
|
+ System.out.println("id:" + id);
|
156
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
169
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
157
|
Map model = new HashMap();
|
170
|
Map model = new HashMap();
|
158
|
ManifestEntity manifest = null;
|
171
|
ManifestEntity manifest = null;
|
159
|
- //判断是否是便捷
|
|
|
160
|
- if(id!=null){
|
172
|
+ // 判断是否是便捷
|
|
|
173
|
+ if (id != null) {
|
161
|
manifest = manifestService.findOne(id);
|
174
|
manifest = manifestService.findOne(id);
|
162
|
}
|
175
|
}
|
163
|
|
176
|
|
164
|
UserEntity user = SessionUtil.getUser();
|
177
|
UserEntity user = SessionUtil.getUser();
|
165
|
- if(user!=null && user.getAgent()!=null){
|
178
|
+ if (user != null && user.getAgent() != null) {
|
166
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
179
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
167
|
- model.put("agent",agent);
|
|
|
168
|
- if(id == null) //是新增表单
|
180
|
+ model.put("agent", agent);
|
|
|
181
|
+ if (id == null) // 是新增表单
|
169
|
{
|
182
|
{
|
170
|
manifest = new ManifestEntity();
|
183
|
manifest = new ManifestEntity();
|
171
|
manifest.setAgentcompany(agent.getNameCn());
|
184
|
manifest.setAgentcompany(agent.getNameCn());
|
172
|
- manifest.setAgentman(null); //设置代理人名称为null
|
185
|
+ manifest.setAgentman(null); // 设置代理人名称为null
|
173
|
}
|
186
|
}
|
174
|
}
|
187
|
}
|
175
|
- model.put("manifest",manifest);
|
|
|
176
|
- //海关关区
|
|
|
177
|
- List<String> Customs = getCustoms();
|
|
|
178
|
- model.put("CusToms",Customs);
|
|
|
179
|
- //付款方式
|
188
|
+ model.put("manifest", manifest);
|
|
|
189
|
+ // 海关关区
|
|
|
190
|
+ List<String> Customs = getCustomsCode();
|
|
|
191
|
+ model.put("CusToms", Customs);
|
|
|
192
|
+ // 付款方式
|
180
|
List<String> payTypes = getPayTypes();
|
193
|
List<String> payTypes = getPayTypes();
|
181
|
- model.put("payTypes",payTypes);
|
|
|
182
|
- //海关状态
|
194
|
+ model.put("payTypes", payTypes);
|
|
|
195
|
+ // 海关状态
|
183
|
List<String> customsStatus = getcustomsStatus();
|
196
|
List<String> customsStatus = getcustomsStatus();
|
184
|
- model.put("customsStatus",customsStatus);
|
197
|
+ model.put("customsStatus", customsStatus);
|
185
|
|
198
|
|
186
|
- //危险品代码
|
199
|
+ // 危险品代码
|
187
|
List<PubDgEntity> dgList = dgService.findAll();
|
200
|
List<PubDgEntity> dgList = dgService.findAll();
|
188
|
- model.put("dgList",dgList);
|
201
|
+ model.put("dgList", dgList);
|
189
|
|
202
|
|
190
|
- //包装种类
|
203
|
+ // 包装种类
|
191
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
204
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
192
|
- model.put("typeList",typeList);
|
205
|
+ model.put("typeList", typeList);
|
193
|
|
206
|
|
194
|
-// model.addAttribute("customsStatus",flag);
|
207
|
+ // model.addAttribute("customsStatus",flag);
|
195
|
return model;
|
208
|
return model;
|
196
|
}
|
209
|
}
|
197
|
- //保存或新增
|
|
|
198
|
- @RequestMapping(value = "/cross/save" , method = {RequestMethod.POST })
|
210
|
+
|
|
|
211
|
+ // 保存或新增
|
|
|
212
|
+ @RequestMapping(value = "/cross/save", method = { RequestMethod.POST })
|
199
|
@ResponseBody
|
213
|
@ResponseBody
|
200
|
- public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response){
|
214
|
+ public ResponseModel cross_save(ManifestEntity manifest, HttpServletRequest reuqest, HttpServletResponse response) {
|
201
|
ResponseModel model = new ResponseModel();
|
215
|
ResponseModel model = new ResponseModel();
|
202
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
216
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
203
|
try {
|
217
|
try {
|
204
|
manifest.setUSER_ID(Tools.getUserId());
|
218
|
manifest.setUSER_ID(Tools.getUserId());
|
205
|
- if(manifestService.isExistsByWaybill(manifest))
|
|
|
206
|
- {
|
219
|
+ if (manifestService.isExistsByWaybill(manifest)) {
|
207
|
model.setMsg("该订单已存在!");
|
220
|
model.setMsg("该订单已存在!");
|
208
|
model.setStatus(500);
|
221
|
model.setStatus(500);
|
209
|
- }
|
|
|
210
|
- else
|
|
|
211
|
- {
|
222
|
+ } else {
|
212
|
String stowagedate = reuqest.getParameter("stowagedate");
|
223
|
String stowagedate = reuqest.getParameter("stowagedate");
|
213
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
224
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
214
|
- //处理预配时间
|
|
|
215
|
- manifest.setUSER_ID(SessionUtil.getUser().getId()); //设置用户id
|
225
|
+ // 处理预配时间
|
|
|
226
|
+ manifest.setUSER_ID(SessionUtil.getUser().getId()); // 设置用户id
|
216
|
manifest = manifestService.save(manifest);
|
227
|
manifest = manifestService.save(manifest);
|
217
|
model.setData(manifest);
|
228
|
model.setData(manifest);
|
218
|
model.setStatus(200);
|
229
|
model.setStatus(200);
|
219
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
230
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
220
|
}
|
231
|
}
|
221
|
- }catch (Exception e){
|
232
|
+ } catch (Exception e) {
|
222
|
model.setStatus(500);
|
233
|
model.setStatus(500);
|
223
|
model.setMsg(HttpJsonMsg.ERROR);
|
234
|
model.setMsg(HttpJsonMsg.ERROR);
|
224
|
logger.error("系统异常 >>", e);
|
235
|
logger.error("系统异常 >>", e);
|
225
|
}
|
236
|
}
|
226
|
return model;
|
237
|
return model;
|
227
|
}
|
238
|
}
|
228
|
- //保存并发送主单信息
|
|
|
229
|
- @RequestMapping(value = "/cross/savesend" , method = {RequestMethod.POST })
|
239
|
+
|
|
|
240
|
+ // 保存并发送主单信息
|
|
|
241
|
+ @RequestMapping(value = "/cross/savesend", method = { RequestMethod.POST })
|
230
|
@ResponseBody
|
242
|
@ResponseBody
|
231
|
- public ResponseModel cross_savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
243
|
+ public ResponseModel cross_savesend(ManifestEntity manifest, HttpServletRequest request,
|
|
|
244
|
+ HttpServletResponse response) {
|
232
|
ResponseModel model = new ResponseModel();
|
245
|
ResponseModel model = new ResponseModel();
|
233
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
246
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
234
|
try {
|
247
|
try {
|
235
|
manifest.setUSER_ID(Tools.getUserId());
|
248
|
manifest.setUSER_ID(Tools.getUserId());
|
236
|
- if(manifestService.isExistsByWaybill(manifest))
|
|
|
237
|
- {
|
249
|
+ if (manifestService.isExistsByWaybill(manifest)) {
|
238
|
model.setStatus(500);
|
250
|
model.setStatus(500);
|
239
|
model.setMsg("该订单号已存在!");
|
251
|
model.setMsg("该订单号已存在!");
|
240
|
- }
|
|
|
241
|
- else
|
|
|
242
|
- {
|
252
|
+ } else {
|
243
|
String stowagedate = request.getParameter("stowagedate");
|
253
|
String stowagedate = request.getParameter("stowagedate");
|
244
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
254
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
245
|
- //保存
|
255
|
+ // 保存
|
246
|
manifest.setIsdelete(1);
|
256
|
manifest.setIsdelete(1);
|
247
|
manifest.setResponse_text("主单已发送");
|
257
|
manifest.setResponse_text("主单已发送");
|
248
|
manifestService.save(manifest);
|
258
|
manifestService.save(manifest);
|
249
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
259
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
250
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
260
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
251
|
- System.out.println("-----------------id:"+manifest.getId());
|
|
|
252
|
- //生成报文并且发送
|
261
|
+ System.out.println("-----------------id:" + manifest.getId());
|
|
|
262
|
+ // 生成报文并且发送
|
253
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
263
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
254
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
255
|
- System.out.println(path); //path
|
|
|
256
|
- String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
|
|
|
257
|
- String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
|
264
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
265
|
+ System.out.println(path); // path
|
|
|
266
|
+ String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
|
|
|
267
|
+ String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
|
258
|
System.out.println(ndlrxml);
|
268
|
System.out.println(ndlrxml);
|
259
|
System.err.println(dlcfxml);
|
269
|
System.err.println(dlcfxml);
|
260
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
270
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
|
@@ -262,129 +272,132 @@ public class ManifestController extends BasicController{ |
|
@@ -262,129 +272,132 @@ public class ManifestController extends BasicController{ |
262
|
model.setStatus(200);
|
272
|
model.setStatus(200);
|
263
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
273
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
264
|
}
|
274
|
}
|
265
|
- } catch (Exception e){
|
275
|
+ } catch (Exception e) {
|
266
|
model.setStatus(500);
|
276
|
model.setStatus(500);
|
267
|
model.setMsg(HttpJsonMsg.ERROR);
|
277
|
model.setMsg(HttpJsonMsg.ERROR);
|
268
|
logger.error("系统异常 >>", e);
|
278
|
logger.error("系统异常 >>", e);
|
269
|
}
|
279
|
}
|
270
|
return model;
|
280
|
return model;
|
271
|
}
|
281
|
}
|
272
|
- //分单列表获取接口
|
|
|
273
|
- @RequestMapping(value="/cross/sub/grid.json")
|
282
|
+
|
|
|
283
|
+ // 分单列表获取接口
|
|
|
284
|
+ @RequestMapping(value = "/cross/sub/grid.json")
|
274
|
@ResponseBody
|
285
|
@ResponseBody
|
275
|
- public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId,HttpServletRequest request, HttpServletResponse response) {
|
286
|
+ public DataGrid<PreparesecondaryEntity> cross_gridSub(Long mawbId, HttpServletRequest request,
|
|
|
287
|
+ HttpServletResponse response) {
|
276
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
288
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
277
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
289
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
278
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
290
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
279
|
return dg;
|
291
|
return dg;
|
280
|
}
|
292
|
}
|
281
|
- //获取一条分单详情的接口
|
|
|
282
|
- @RequestMapping(value="/cross/subedit", method = {RequestMethod.POST })
|
293
|
+
|
|
|
294
|
+ // 获取一条分单详情的接口
|
|
|
295
|
+ @RequestMapping(value = "/cross/subedit", method = { RequestMethod.POST })
|
283
|
@ResponseBody
|
296
|
@ResponseBody
|
284
|
- private Map subedit(Long id,Long mawbId, HttpServletResponse response){
|
297
|
+ private Map subedit(Long id, Long mawbId, HttpServletResponse response) {
|
285
|
Map model = new HashMap();
|
298
|
Map model = new HashMap();
|
286
|
ManifestEntity manifest = null;
|
299
|
ManifestEntity manifest = null;
|
287
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
300
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
288
|
PreparesecondaryEntity pre = null;
|
301
|
PreparesecondaryEntity pre = null;
|
289
|
- String str = "" ;
|
302
|
+ String str = "";
|
290
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
303
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
291
|
- if(mawbId!=null){
|
304
|
+ if (mawbId != null) {
|
292
|
manifest = manifestService.findOne(mawbId);
|
305
|
manifest = manifestService.findOne(mawbId);
|
293
|
pre = preparesecondaryServer.findOne(mawbId);
|
306
|
pre = preparesecondaryServer.findOne(mawbId);
|
294
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
307
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
295
|
- if(preparesecondaryList.isEmpty()){
|
308
|
+ if (preparesecondaryList.isEmpty()) {
|
296
|
str = calculate(manifest);
|
309
|
str = calculate(manifest);
|
297
|
- }else{
|
|
|
298
|
- str = calculates(manifest,preparesecondaryList);
|
310
|
+ } else {
|
|
|
311
|
+ str = calculates(manifest, preparesecondaryList);
|
299
|
}
|
312
|
}
|
300
|
}
|
313
|
}
|
301
|
- if(id !=null){
|
314
|
+ if (id != null) {
|
302
|
pre = preparesecondaryServer.findOne(id);
|
315
|
pre = preparesecondaryServer.findOne(id);
|
303
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
316
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
304
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
317
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
305
|
- if(preparesecondaryList.isEmpty()){
|
318
|
+ if (preparesecondaryList.isEmpty()) {
|
306
|
str = calculate(manifest);
|
319
|
str = calculate(manifest);
|
307
|
- }else{
|
|
|
308
|
- str = calculates(manifest,preparesecondaryList);
|
320
|
+ } else {
|
|
|
321
|
+ str = calculates(manifest, preparesecondaryList);
|
309
|
}
|
322
|
}
|
310
|
}
|
323
|
}
|
311
|
|
324
|
|
312
|
UserEntity user = SessionUtil.getUser();
|
325
|
UserEntity user = SessionUtil.getUser();
|
313
|
- if(user!=null && user.getAgent()!=null){
|
326
|
+ if (user != null && user.getAgent() != null) {
|
314
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
327
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
315
|
- model.put("agent",agent);
|
328
|
+ model.put("agent", agent);
|
316
|
}
|
329
|
}
|
317
|
- //海关关区
|
|
|
318
|
- List<String> Customs = getCustoms();
|
|
|
319
|
- model.put("CusToms",Customs);
|
|
|
320
|
- //付款方式
|
330
|
+ // 海关关区
|
|
|
331
|
+ List<String> Customs = getCustomsCode();
|
|
|
332
|
+ model.put("CusToms", Customs);
|
|
|
333
|
+ // 付款方式
|
321
|
List<String> payTypes = getPayTypes();
|
334
|
List<String> payTypes = getPayTypes();
|
322
|
- model.put("payTypes",payTypes);
|
|
|
323
|
- //海关状态
|
335
|
+ model.put("payTypes", payTypes);
|
|
|
336
|
+ // 海关状态
|
324
|
List<String> customsStatus = getcustomsStatus();
|
337
|
List<String> customsStatus = getcustomsStatus();
|
325
|
- model.put("customsStatus",customsStatus);
|
338
|
+ model.put("customsStatus", customsStatus);
|
326
|
|
339
|
|
327
|
- //危险品代码
|
340
|
+ // 危险品代码
|
328
|
List<PubDgEntity> dgList = dgService.findAll();
|
341
|
List<PubDgEntity> dgList = dgService.findAll();
|
329
|
- model.put("dgList",dgList);
|
342
|
+ model.put("dgList", dgList);
|
330
|
|
343
|
|
331
|
- //包装种类
|
344
|
+ // 包装种类
|
332
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
345
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
333
|
- model.put("typeList",typeList);
|
346
|
+ model.put("typeList", typeList);
|
334
|
|
347
|
|
335
|
- model.put("is_strs",str);
|
|
|
336
|
- model.put("id",mawbId);
|
|
|
337
|
- model.put("manifest",manifest);
|
|
|
338
|
- model.put("pre",pre);
|
348
|
+ model.put("is_strs", str);
|
|
|
349
|
+ model.put("id", mawbId);
|
|
|
350
|
+ model.put("manifest", manifest);
|
|
|
351
|
+ model.put("pre", pre);
|
339
|
return model;
|
352
|
return model;
|
340
|
}
|
353
|
}
|
341
|
- //保存分单
|
|
|
342
|
- @RequestMapping(value = "/cross/sub_save" , method = {RequestMethod.POST })
|
354
|
+
|
|
|
355
|
+ // 保存分单
|
|
|
356
|
+ @RequestMapping(value = "/cross/sub_save", method = { RequestMethod.POST })
|
343
|
@ResponseBody
|
357
|
@ResponseBody
|
344
|
- public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response){
|
358
|
+ public ResponseModel cross_sub_save(PreparesecondaryEntity Preparesecondary, HttpServletResponse response) {
|
345
|
ResponseModel model = new ResponseModel();
|
359
|
ResponseModel model = new ResponseModel();
|
346
|
try {
|
360
|
try {
|
347
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
361
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
348
|
- //已存在,提示给用户
|
|
|
349
|
- if(preparesecondaryServer.isExists(Preparesecondary)){
|
362
|
+ // 已存在,提示给用户
|
|
|
363
|
+ if (preparesecondaryServer.isExists(Preparesecondary)) {
|
350
|
model.setStatus(500);
|
364
|
model.setStatus(500);
|
351
|
model.setMsg("该订单号已存在!");
|
365
|
model.setMsg("该订单号已存在!");
|
352
|
- }else{
|
366
|
+ } else {
|
353
|
Preparesecondary.setCreateDate(new Date());
|
367
|
Preparesecondary.setCreateDate(new Date());
|
354
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
368
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
355
|
model.setData(Preparesecondary);
|
369
|
model.setData(Preparesecondary);
|
356
|
model.setStatus(200);
|
370
|
model.setStatus(200);
|
357
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
371
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
358
|
}
|
372
|
}
|
359
|
- }catch (Exception e){
|
373
|
+ } catch (Exception e) {
|
360
|
model.setStatus(500);
|
374
|
model.setStatus(500);
|
361
|
model.setMsg(HttpJsonMsg.ERROR);
|
375
|
model.setMsg(HttpJsonMsg.ERROR);
|
362
|
logger.error("系统异常 >>", e);
|
376
|
logger.error("系统异常 >>", e);
|
363
|
}
|
377
|
}
|
364
|
return model;
|
378
|
return model;
|
365
|
}
|
379
|
}
|
366
|
- @RequestMapping(value = "/cross/presavesend" , method = {RequestMethod.POST })
|
380
|
+
|
|
|
381
|
+ @RequestMapping(value = "/cross/presavesend", method = { RequestMethod.POST })
|
367
|
@ResponseBody
|
382
|
@ResponseBody
|
368
|
- public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request,
|
|
|
369
|
- HttpServletResponse response){
|
383
|
+ public ResponseModel cross_presavesend(PreparesecondaryEntity Preparesecondary, HttpServletRequest request,
|
|
|
384
|
+ HttpServletResponse response) {
|
370
|
ResponseModel model = new ResponseModel();
|
385
|
ResponseModel model = new ResponseModel();
|
371
|
try {
|
386
|
try {
|
372
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
387
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
373
|
- if(preparesecondaryServer.isExists(Preparesecondary))
|
|
|
374
|
- {
|
388
|
+ if (preparesecondaryServer.isExists(Preparesecondary)) {
|
375
|
model.setStatus(500);
|
389
|
model.setStatus(500);
|
376
|
model.setMsg("该订单号已存在!");
|
390
|
model.setMsg("该订单号已存在!");
|
377
|
- }
|
|
|
378
|
- else{
|
391
|
+ } else {
|
379
|
String stowagedate = request.getParameter("stowagedate");
|
392
|
String stowagedate = request.getParameter("stowagedate");
|
380
|
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
|
393
|
Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
|
381
|
|
394
|
|
382
|
- //生成报文并且发送
|
395
|
+ // 生成报文并且发送
|
383
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
396
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
384
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
397
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
385
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
|
398
|
String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
|
386
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
|
399
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
|
387
|
- //发送redis储存数据
|
400
|
+ // 发送redis储存数据
|
388
|
// System.out.println(ndlrxml);
|
401
|
// System.out.println(ndlrxml);
|
389
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
402
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
390
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
403
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
@@ -396,7 +409,7 @@ public class ManifestController extends BasicController{ |
|
@@ -396,7 +409,7 @@ public class ManifestController extends BasicController{ |
396
|
Preparesecondary.setResponse_text("分单已发送");
|
409
|
Preparesecondary.setResponse_text("分单已发送");
|
397
|
preparesecondaryServer.save(Preparesecondary);
|
410
|
preparesecondaryServer.save(Preparesecondary);
|
398
|
}
|
411
|
}
|
399
|
- }catch (Exception e){
|
412
|
+ } catch (Exception e) {
|
400
|
model.setStatus(500);
|
413
|
model.setStatus(500);
|
401
|
model.setMsg(HttpJsonMsg.ERROR);
|
414
|
model.setMsg(HttpJsonMsg.ERROR);
|
402
|
logger.error("系统异常 >>", e);
|
415
|
logger.error("系统异常 >>", e);
|
|
@@ -404,28 +417,21 @@ public class ManifestController extends BasicController{ |
|
@@ -404,28 +417,21 @@ public class ManifestController extends BasicController{ |
404
|
return model;
|
417
|
return model;
|
405
|
}
|
418
|
}
|
406
|
|
419
|
|
407
|
-
|
|
|
408
|
-
|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
416
|
/**
|
420
|
/**
|
417
|
* 查询分页数据
|
421
|
* 查询分页数据
|
|
|
422
|
+ *
|
418
|
* @return
|
423
|
* @return
|
419
|
*/
|
424
|
*/
|
420
|
- @RequestMapping(value="/grid.json")
|
425
|
+ @RequestMapping(value = "/grid.json")
|
421
|
@ResponseBody
|
426
|
@ResponseBody
|
422
|
- public DataGrid<ManifestEntity> grid(HttpServletRequest request,EasyPage<ManifestEntity> pageForm) {
|
427
|
+ public DataGrid<ManifestEntity> grid(HttpServletRequest request, EasyPage<ManifestEntity> pageForm) {
|
423
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
428
|
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
|
424
|
-// searchParams.put("EQ_isdelete", 0);
|
429
|
+ // searchParams.put("EQ_isdelete", 0);
|
425
|
pageForm.setSearchParams(searchParams);
|
430
|
pageForm.setSearchParams(searchParams);
|
426
|
- //UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
427
|
- UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
428
|
- if(ue != null){
|
431
|
+ // UserEntity ue =
|
|
|
432
|
+ // (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
433
|
+ UserEntity ue = (UserEntity) SecurityUtils.getSubject().getSession().getAttribute("user");
|
|
|
434
|
+ if (ue != null) {
|
429
|
Long u = ue.getId();
|
435
|
Long u = ue.getId();
|
430
|
Set<String> sk = pageForm.getSearchParams().keySet();
|
436
|
Set<String> sk = pageForm.getSearchParams().keySet();
|
431
|
pageForm.getSearchParams().put("EQ_USER_ID", u);
|
437
|
pageForm.getSearchParams().put("EQ_USER_ID", u);
|
|
@@ -442,22 +448,20 @@ public class ManifestController extends BasicController{ |
|
@@ -442,22 +448,20 @@ public class ManifestController extends BasicController{ |
442
|
* @return
|
448
|
* @return
|
443
|
* @return
|
449
|
* @return
|
444
|
*/
|
450
|
*/
|
445
|
- @RequestMapping(value = "/infor" )
|
451
|
+ @RequestMapping(value = "/infor")
|
446
|
@ResponseBody
|
452
|
@ResponseBody
|
447
|
- public List<ManifestEntity> infor(String id,Model model) {
|
453
|
+ public List<ManifestEntity> infor(String id, Model model) {
|
448
|
List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId());
|
454
|
List<ManifestEntity> li = manifestService.queryByUserId(Tools.getUserId());
|
449
|
List<ManifestEntity> result = new FemyList();
|
455
|
List<ManifestEntity> result = new FemyList();
|
450
|
- for(ManifestEntity me : li){
|
|
|
451
|
- if(result.contains(me))
|
|
|
452
|
- {
|
|
|
453
|
- }
|
|
|
454
|
- else
|
|
|
455
|
- {
|
456
|
+ for (ManifestEntity me : li) {
|
|
|
457
|
+ if (result.contains(me)) {
|
|
|
458
|
+ } else {
|
456
|
result.add(me);
|
459
|
result.add(me);
|
457
|
}
|
460
|
}
|
458
|
}
|
461
|
}
|
459
|
return result;
|
462
|
return result;
|
460
|
}
|
463
|
}
|
|
|
464
|
+
|
461
|
/**
|
465
|
/**
|
462
|
* * 模糊查询匹配信息
|
466
|
* * 模糊查询匹配信息
|
463
|
*
|
467
|
*
|
|
@@ -465,24 +469,21 @@ public class ManifestController extends BasicController{ |
|
@@ -465,24 +469,21 @@ public class ManifestController extends BasicController{ |
465
|
* @return
|
469
|
* @return
|
466
|
* @return
|
470
|
* @return
|
467
|
*/
|
471
|
*/
|
468
|
- @RequestMapping(value = "/inforPre" )
|
472
|
+ @RequestMapping(value = "/inforPre")
|
469
|
@ResponseBody
|
473
|
@ResponseBody
|
470
|
- public List<PreparesecondaryEntity> inforPre(String id,Model model) {
|
474
|
+ public List<PreparesecondaryEntity> inforPre(String id, Model model) {
|
471
|
List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId());
|
475
|
List<PreparesecondaryEntity> li = preparesecondaryServer.queryByUserId(Tools.getUserId());
|
472
|
List<PreparesecondaryEntity> result = new FemyList();
|
476
|
List<PreparesecondaryEntity> result = new FemyList();
|
473
|
- for(PreparesecondaryEntity pe : li){
|
|
|
474
|
- if(result.contains(pe)){
|
477
|
+ for (PreparesecondaryEntity pe : li) {
|
|
|
478
|
+ if (result.contains(pe)) {
|
475
|
|
479
|
|
476
|
- }
|
|
|
477
|
- else
|
|
|
478
|
- {
|
480
|
+ } else {
|
479
|
result.add(pe);
|
481
|
result.add(pe);
|
480
|
}
|
482
|
}
|
481
|
}
|
483
|
}
|
482
|
return result;
|
484
|
return result;
|
483
|
}
|
485
|
}
|
484
|
|
486
|
|
485
|
-
|
|
|
486
|
/**
|
487
|
/**
|
487
|
* 编辑
|
488
|
* 编辑
|
488
|
*
|
489
|
*
|
|
@@ -490,86 +491,83 @@ public class ManifestController extends BasicController{ |
|
@@ -490,86 +491,83 @@ public class ManifestController extends BasicController{ |
490
|
* @return
|
491
|
* @return
|
491
|
*/
|
492
|
*/
|
492
|
@RequestMapping(value = "/edit")
|
493
|
@RequestMapping(value = "/edit")
|
493
|
- public String edit(Long id,Model model){
|
494
|
+ public String edit(Long id, Model model) {
|
494
|
ManifestEntity manifest = null;
|
495
|
ManifestEntity manifest = null;
|
495
|
- //判断是否是便捷
|
|
|
496
|
- if(id!=null){
|
496
|
+ // 判断是否是便捷
|
|
|
497
|
+ if (id != null) {
|
497
|
manifest = manifestService.findOne(id);
|
498
|
manifest = manifestService.findOne(id);
|
498
|
}
|
499
|
}
|
499
|
|
500
|
|
500
|
UserEntity user = SessionUtil.getUser();
|
501
|
UserEntity user = SessionUtil.getUser();
|
501
|
- if(user!=null && user.getAgent()!=null){
|
502
|
+ if (user != null && user.getAgent() != null) {
|
502
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
503
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
503
|
- model.addAttribute("agent",agent);
|
|
|
504
|
- if(id == null) //是新增表单
|
504
|
+ model.addAttribute("agent", agent);
|
|
|
505
|
+ if (id == null) // 是新增表单
|
505
|
{
|
506
|
{
|
506
|
manifest = new ManifestEntity();
|
507
|
manifest = new ManifestEntity();
|
507
|
manifest.setAgentcompany(agent.getNameCn());
|
508
|
manifest.setAgentcompany(agent.getNameCn());
|
508
|
- manifest.setAgentman(null); //设置代理人名称为null
|
509
|
+ manifest.setAgentman(null); // 设置代理人名称为null
|
509
|
}
|
510
|
}
|
510
|
}
|
511
|
}
|
511
|
- model.addAttribute("manifest",manifest);
|
|
|
512
|
- //海关关区
|
|
|
513
|
- List<String> Customs = getCustoms();
|
|
|
514
|
- model.addAttribute("CusToms",Customs);
|
|
|
515
|
- //付款方式
|
512
|
+ model.addAttribute("manifest", manifest);
|
|
|
513
|
+ // 海关关区
|
|
|
514
|
+ List<String> Customs = getCustomsCode();
|
|
|
515
|
+ model.addAttribute("CusToms", Customs);
|
|
|
516
|
+ // 付款方式
|
516
|
List<String> payTypes = getPayTypes();
|
517
|
List<String> payTypes = getPayTypes();
|
517
|
- model.addAttribute("payTypes",payTypes);
|
|
|
518
|
- //海关状态
|
518
|
+ model.addAttribute("payTypes", payTypes);
|
|
|
519
|
+ // 海关状态
|
519
|
List<String> customsStatus = getcustomsStatus();
|
520
|
List<String> customsStatus = getcustomsStatus();
|
520
|
- model.addAttribute("customsStatus",customsStatus);
|
521
|
+ model.addAttribute("customsStatus", customsStatus);
|
521
|
|
522
|
|
522
|
- //危险品代码
|
523
|
+ // 危险品代码
|
523
|
List<PubDgEntity> dgList = dgService.findAll();
|
524
|
List<PubDgEntity> dgList = dgService.findAll();
|
524
|
- model.addAttribute("dgList",dgList);
|
525
|
+ model.addAttribute("dgList", dgList);
|
525
|
|
526
|
|
526
|
- //包装种类
|
527
|
+ // 包装种类
|
527
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
528
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
528
|
- model.addAttribute("typeList",typeList);
|
529
|
+ model.addAttribute("typeList", typeList);
|
529
|
|
530
|
|
530
|
-// model.addAttribute("customsStatus",flag);
|
531
|
+ // model.addAttribute("customsStatus",flag);
|
531
|
return "manifest/edit";
|
532
|
return "manifest/edit";
|
532
|
}
|
533
|
}
|
533
|
|
534
|
|
534
|
-
|
|
|
535
|
-
|
|
|
536
|
/**
|
535
|
/**
|
537
|
* 查询主单号是否存在
|
536
|
* 查询主单号是否存在
|
538
|
*
|
537
|
*
|
539
|
* @param mawbNo
|
538
|
* @param mawbNo
|
540
|
* @return
|
539
|
* @return
|
541
|
*/
|
540
|
*/
|
542
|
- @RequestMapping(value = "/queryMawbNo",method = {RequestMethod.POST})
|
541
|
+ @RequestMapping(value = "/queryMawbNo", method = { RequestMethod.POST })
|
543
|
@ResponseBody
|
542
|
@ResponseBody
|
544
|
- public ResponseModel queryMawbId(Long id,String mawbNo){
|
543
|
+ public ResponseModel queryMawbId(Long id, String mawbNo) {
|
545
|
ResponseModel model = new ResponseModel();
|
544
|
ResponseModel model = new ResponseModel();
|
546
|
List<ManifestEntity> list = null;
|
545
|
List<ManifestEntity> list = null;
|
547
|
- if(StringUtils.isNotEmpty(mawbNo)){
|
546
|
+ if (StringUtils.isNotEmpty(mawbNo)) {
|
548
|
list = manifestService.findByMawbNo(mawbNo);
|
547
|
list = manifestService.findByMawbNo(mawbNo);
|
549
|
}
|
548
|
}
|
550
|
boolean exist = false;
|
549
|
boolean exist = false;
|
551
|
- if(CollectionUtils.isNotEmpty(list)){
|
|
|
552
|
- if(list.size()>0){
|
550
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
551
|
+ if (list.size() > 0) {
|
553
|
exist = true;
|
552
|
exist = true;
|
554
|
}
|
553
|
}
|
555
|
}
|
554
|
}
|
556
|
- if(exist){
|
555
|
+ if (exist) {
|
557
|
model.setStatus(500);
|
556
|
model.setStatus(500);
|
558
|
- }
|
|
|
559
|
- else {
|
557
|
+ } else {
|
560
|
model.setStatus(200);
|
558
|
model.setStatus(200);
|
561
|
}
|
559
|
}
|
562
|
return model;
|
560
|
return model;
|
563
|
}
|
561
|
}
|
564
|
|
562
|
|
565
|
-
|
|
|
566
|
/**
|
563
|
/**
|
567
|
* 查询分制单分页数据
|
564
|
* 查询分制单分页数据
|
|
|
565
|
+ *
|
568
|
* @return
|
566
|
* @return
|
569
|
*/
|
567
|
*/
|
570
|
- @RequestMapping(value="/sub/grid.json")
|
568
|
+ @RequestMapping(value = "/sub/grid.json")
|
571
|
@ResponseBody
|
569
|
@ResponseBody
|
572
|
- public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId,HttpServletRequest request) {
|
570
|
+ public DataGrid<PreparesecondaryEntity> gridSub(Long mawbId, HttpServletRequest request) {
|
573
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
571
|
DataGrid<PreparesecondaryEntity> dg = new DataGrid<>();
|
574
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
572
|
dg.setRows(preparesecondaryServer.findByMawbId(mawbId));
|
575
|
return dg;
|
573
|
return dg;
|
|
@@ -581,65 +579,64 @@ public class ManifestController extends BasicController{ |
|
@@ -581,65 +579,64 @@ public class ManifestController extends BasicController{ |
581
|
* @param id
|
579
|
* @param id
|
582
|
* @return
|
580
|
* @return
|
583
|
*/
|
581
|
*/
|
584
|
- @RequestMapping(value = "/subedit", method = {RequestMethod.GET })
|
|
|
585
|
- private String subedit(Long id,Long mawbId,String type, Model model){
|
582
|
+ @RequestMapping(value = "/subedit", method = { RequestMethod.GET })
|
|
|
583
|
+ private String subedit(Long id, Long mawbId, String type, Model model) {
|
586
|
ManifestEntity manifest = null;
|
584
|
ManifestEntity manifest = null;
|
587
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
585
|
List<PreparesecondaryEntity> preparesecondaryList = null;
|
588
|
PreparesecondaryEntity pre = null;
|
586
|
PreparesecondaryEntity pre = null;
|
589
|
- String str = "" ;
|
|
|
590
|
- if(mawbId!=null ){
|
587
|
+ String str = "";
|
|
|
588
|
+ if (mawbId != null) {
|
591
|
manifest = manifestService.findOne(mawbId);
|
589
|
manifest = manifestService.findOne(mawbId);
|
592
|
pre = preparesecondaryServer.findOne(mawbId);
|
590
|
pre = preparesecondaryServer.findOne(mawbId);
|
593
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
591
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
594
|
- if(preparesecondaryList.isEmpty()){
|
592
|
+ if (preparesecondaryList.isEmpty()) {
|
595
|
str = calculate(manifest);
|
593
|
str = calculate(manifest);
|
596
|
- }else{
|
|
|
597
|
- str = calculates(manifest,preparesecondaryList);
|
594
|
+ } else {
|
|
|
595
|
+ str = calculates(manifest, preparesecondaryList);
|
598
|
}
|
596
|
}
|
599
|
}
|
597
|
}
|
600
|
- if(id !=null){
|
598
|
+ if (id != null) {
|
601
|
pre = preparesecondaryServer.findOne(id);
|
599
|
pre = preparesecondaryServer.findOne(id);
|
602
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
600
|
manifest = manifestService.findOne(pre.getPreparemasterid());
|
603
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
601
|
preparesecondaryList = preparesecondaryServer.findAll(manifest.getId());
|
604
|
- if(preparesecondaryList.isEmpty()){
|
602
|
+ if (preparesecondaryList.isEmpty()) {
|
605
|
str = calculate(manifest);
|
603
|
str = calculate(manifest);
|
606
|
- }else{
|
|
|
607
|
- str = calculates(manifest,preparesecondaryList);
|
604
|
+ } else {
|
|
|
605
|
+ str = calculates(manifest, preparesecondaryList);
|
608
|
}
|
606
|
}
|
609
|
}
|
607
|
}
|
610
|
|
608
|
|
611
|
UserEntity user = SessionUtil.getUser();
|
609
|
UserEntity user = SessionUtil.getUser();
|
612
|
- if(user!=null && user.getAgent()!=null){
|
610
|
+ if (user != null && user.getAgent() != null) {
|
613
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
611
|
BasicAgentEntity agent = agentService.findOne(user.getAgent());
|
614
|
- model.addAttribute("agent",agent);
|
612
|
+ model.addAttribute("agent", agent);
|
615
|
}
|
613
|
}
|
616
|
- //海关关区
|
|
|
617
|
- List<String> Customs = getCustoms();
|
|
|
618
|
- model.addAttribute("CusToms",Customs);
|
|
|
619
|
- //付款方式
|
614
|
+ // 海关关区
|
|
|
615
|
+ List<String> Customs = getCustomsCode();
|
|
|
616
|
+ model.addAttribute("CusToms", Customs);
|
|
|
617
|
+ // 付款方式
|
620
|
List<String> payTypes = getPayTypes();
|
618
|
List<String> payTypes = getPayTypes();
|
621
|
- model.addAttribute("payTypes",payTypes);
|
|
|
622
|
- //海关状态
|
619
|
+ model.addAttribute("payTypes", payTypes);
|
|
|
620
|
+ // 海关状态
|
623
|
List<String> customsStatus = getcustomsStatus();
|
621
|
List<String> customsStatus = getcustomsStatus();
|
624
|
- model.addAttribute("customsStatus",customsStatus);
|
622
|
+ model.addAttribute("customsStatus", customsStatus);
|
625
|
|
623
|
|
626
|
- //危险品代码
|
624
|
+ // 危险品代码
|
627
|
List<PubDgEntity> dgList = dgService.findAll();
|
625
|
List<PubDgEntity> dgList = dgService.findAll();
|
628
|
- model.addAttribute("dgList",dgList);
|
626
|
+ model.addAttribute("dgList", dgList);
|
629
|
|
627
|
|
630
|
- //包装种类
|
628
|
+ // 包装种类
|
631
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
629
|
List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
632
|
- model.addAttribute("typeList",typeList);
|
630
|
+ model.addAttribute("typeList", typeList);
|
633
|
|
631
|
|
634
|
- model.addAttribute("is_strs",str);
|
|
|
635
|
- model.addAttribute("id",mawbId);
|
|
|
636
|
- model.addAttribute("manifest",manifest);
|
|
|
637
|
- model.addAttribute("pre",pre);
|
632
|
+ model.addAttribute("is_strs", str);
|
|
|
633
|
+ model.addAttribute("id", mawbId);
|
|
|
634
|
+ model.addAttribute("manifest", manifest);
|
|
|
635
|
+ model.addAttribute("pre", pre);
|
638
|
return "manifest/sub_edit";
|
636
|
return "manifest/sub_edit";
|
639
|
}
|
637
|
}
|
640
|
|
638
|
|
641
|
-
|
|
|
642
|
- //计算 运单件数 运单重量 预配件数 预配重量
|
639
|
+ // 计算 运单件数 运单重量 预配件数 预配重量
|
643
|
private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) {
|
640
|
private String calculates(ManifestEntity manifest, List<PreparesecondaryEntity> preparesecondaryList) {
|
644
|
int pp = 0;
|
641
|
int pp = 0;
|
645
|
int tw = 0;
|
642
|
int tw = 0;
|
|
@@ -647,54 +644,45 @@ public class ManifestController extends BasicController{ |
|
@@ -647,54 +644,45 @@ public class ManifestController extends BasicController{ |
647
|
int pw = 0;
|
644
|
int pw = 0;
|
648
|
|
645
|
|
649
|
for (PreparesecondaryEntity pre : preparesecondaryList) {
|
646
|
for (PreparesecondaryEntity pre : preparesecondaryList) {
|
650
|
- pp += Integer.parseInt(pre.getPreparepiece()) ;
|
|
|
651
|
- tw += Integer.parseInt(pre.getTotalweight()) ;
|
|
|
652
|
- tp += Integer.parseInt(pre.getTotalpiece()) ;
|
|
|
653
|
- pw += Integer.parseInt(pre.getPrepareweight()) ;
|
|
|
654
|
- }
|
|
|
655
|
-
|
|
|
656
|
- int zpp =Integer.parseInt(manifest.getPreparetotalpiece())-pp;
|
|
|
657
|
- int ztw =Integer.parseInt(manifest.getTotalweight())-tw;
|
|
|
658
|
- int ztp =Integer.parseInt(manifest.getTotalpiece())-tp;
|
|
|
659
|
- int zpw =Integer.parseInt(manifest.getPreparetotalweight())-pw;
|
|
|
660
|
-
|
|
|
661
|
- String str ="{";
|
|
|
662
|
- str +="\"id\":\""+manifest.getId()+"\",";
|
|
|
663
|
- str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
|
|
|
664
|
- str +="\"totalpiece\":\""+ztp+"\",";
|
|
|
665
|
- str +="\"totalweight\":\""+ztw+"\",";
|
|
|
666
|
- str +="\"preparetotalpiece\":\""+zpp+"\",";
|
|
|
667
|
- str +="\"preparetotalweight\":\""+zpw+"\"";
|
|
|
668
|
- str +="}";
|
647
|
+ pp += Integer.parseInt(pre.getPreparepiece());
|
|
|
648
|
+ tw += Integer.parseInt(pre.getTotalweight());
|
|
|
649
|
+ tp += Integer.parseInt(pre.getTotalpiece());
|
|
|
650
|
+ pw += Integer.parseInt(pre.getPrepareweight());
|
|
|
651
|
+ }
|
|
|
652
|
+
|
|
|
653
|
+ int zpp = Integer.parseInt(manifest.getPreparetotalpiece()) - pp;
|
|
|
654
|
+ int ztw = Integer.parseInt(manifest.getTotalweight()) - tw;
|
|
|
655
|
+ int ztp = Integer.parseInt(manifest.getTotalpiece()) - tp;
|
|
|
656
|
+ int zpw = Integer.parseInt(manifest.getPreparetotalweight()) - pw;
|
|
|
657
|
+
|
|
|
658
|
+ String str = "{";
|
|
|
659
|
+ str += "\"id\":\"" + manifest.getId() + "\",";
|
|
|
660
|
+ str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
|
|
|
661
|
+ str += "\"totalpiece\":\"" + ztp + "\",";
|
|
|
662
|
+ str += "\"totalweight\":\"" + ztw + "\",";
|
|
|
663
|
+ str += "\"preparetotalpiece\":\"" + zpp + "\",";
|
|
|
664
|
+ str += "\"preparetotalweight\":\"" + zpw + "\"";
|
|
|
665
|
+ str += "}";
|
669
|
return str;
|
666
|
return str;
|
670
|
}
|
667
|
}
|
671
|
|
668
|
|
672
|
- //计算 运单件数 运单重量 预配件数 预配重量
|
669
|
+ // 计算 运单件数 运单重量 预配件数 预配重量
|
673
|
private String calculate(ManifestEntity manifest) {
|
670
|
private String calculate(ManifestEntity manifest) {
|
674
|
- String str ="{";
|
|
|
675
|
- str +="\"id\":\""+manifest.getId()+"\",";
|
|
|
676
|
- str +="\"waybillnomaster\":\""+manifest.getWaybillnomaster()+"\",";
|
|
|
677
|
- str +="\"totalpiece\":\""+manifest.getTotalpiece()+"\",";
|
|
|
678
|
- str +="\"totalweight\":\""+manifest.getTotalweight()+"\",";
|
|
|
679
|
- str +="\"preparetotalpiece\":\""+manifest.getPreparetotalpiece()+"\",";
|
|
|
680
|
- str +="\"preparetotalweight\":\""+manifest.getPreparetotalweight()+"\"";
|
|
|
681
|
- str +="}";
|
671
|
+ String str = "{";
|
|
|
672
|
+ str += "\"id\":\"" + manifest.getId() + "\",";
|
|
|
673
|
+ str += "\"waybillnomaster\":\"" + manifest.getWaybillnomaster() + "\",";
|
|
|
674
|
+ str += "\"totalpiece\":\"" + manifest.getTotalpiece() + "\",";
|
|
|
675
|
+ str += "\"totalweight\":\"" + manifest.getTotalweight() + "\",";
|
|
|
676
|
+ str += "\"preparetotalpiece\":\"" + manifest.getPreparetotalpiece() + "\",";
|
|
|
677
|
+ str += "\"preparetotalweight\":\"" + manifest.getPreparetotalweight() + "\"";
|
|
|
678
|
+ str += "}";
|
682
|
return str;
|
679
|
return str;
|
683
|
}
|
680
|
}
|
684
|
|
681
|
|
685
|
-
|
|
|
686
|
- //海关状态
|
682
|
+ // 海关状态
|
687
|
private List<String> getcustomsStatus() {
|
683
|
private List<String> getcustomsStatus() {
|
688
|
List<String> list = new ArrayList<>();
|
684
|
List<String> list = new ArrayList<>();
|
689
|
- list.add("4604");
|
|
|
690
|
- list.add("4620");
|
|
|
691
|
- return list;
|
|
|
692
|
- }
|
|
|
693
|
-
|
|
|
694
|
- //海关关区
|
|
|
695
|
- private List<String> getCustoms() {
|
|
|
696
|
- List<String> list = new ArrayList<>();
|
|
|
697
|
- //国际转运
|
685
|
+ // 国际转运
|
698
|
list.add("001");// 进、出口货物
|
686
|
list.add("001");// 进、出口货物
|
699
|
list.add("002");// 国际转运货物
|
687
|
list.add("002");// 国际转运货物
|
700
|
list.add("003");// 国境货物
|
688
|
list.add("003");// 国境货物
|
|
@@ -702,10 +690,18 @@ public class ManifestController extends BasicController{ |
|
@@ -702,10 +690,18 @@ public class ManifestController extends BasicController{ |
702
|
return list;
|
690
|
return list;
|
703
|
}
|
691
|
}
|
704
|
|
692
|
|
705
|
- //支付方式
|
693
|
+ // 海关关区
|
|
|
694
|
+ private List<String> getCustomsCode() {
|
|
|
695
|
+ List<String> list = new ArrayList<>();
|
|
|
696
|
+ list.add("4604");
|
|
|
697
|
+ list.add("4620");
|
|
|
698
|
+ return list;
|
|
|
699
|
+ }
|
|
|
700
|
+
|
|
|
701
|
+ // 支付方式
|
706
|
private List<String> getPayTypes() {
|
702
|
private List<String> getPayTypes() {
|
707
|
List<String> list = new ArrayList<>();
|
703
|
List<String> list = new ArrayList<>();
|
708
|
- //预付
|
704
|
+ // 预付
|
709
|
list.add("001");// 预付
|
705
|
list.add("001");// 预付
|
710
|
list.add("002");// 到付
|
706
|
list.add("002");// 到付
|
711
|
return list;
|
707
|
return list;
|
|
@@ -717,64 +713,63 @@ public class ManifestController extends BasicController{ |
|
@@ -717,64 +713,63 @@ public class ManifestController extends BasicController{ |
717
|
* @param id
|
713
|
* @param id
|
718
|
* @return
|
714
|
* @return
|
719
|
*/
|
715
|
*/
|
720
|
-// @RequestMapping(value = "/bill/edit")
|
|
|
721
|
-// public String editBill(Long id,Long manifestId,Model model){
|
|
|
722
|
-// ManifestBillEntity bill = null;
|
|
|
723
|
-// if(id==null){
|
|
|
724
|
-// bill = new ManifestBillEntity();
|
|
|
725
|
-// bill.setManifestId(manifestId);
|
|
|
726
|
-// }else {
|
|
|
727
|
-// bill = billService.findOne(id);
|
|
|
728
|
-// }
|
|
|
729
|
-// //包装种类
|
|
|
730
|
-// List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
731
|
-// model.addAttribute("typeList",typeList);
|
|
|
732
|
-// model.addAttribute("bill",bill);
|
|
|
733
|
-// return "manifest/edit_bill";
|
|
|
734
|
-// }
|
|
|
735
|
-
|
|
|
736
|
- //查询主单号是否已经存在
|
716
|
+ // @RequestMapping(value = "/bill/edit")
|
|
|
717
|
+ // public String editBill(Long id,Long manifestId,Model model){
|
|
|
718
|
+ // ManifestBillEntity bill = null;
|
|
|
719
|
+ // if(id==null){
|
|
|
720
|
+ // bill = new ManifestBillEntity();
|
|
|
721
|
+ // bill.setManifestId(manifestId);
|
|
|
722
|
+ // }else {
|
|
|
723
|
+ // bill = billService.findOne(id);
|
|
|
724
|
+ // }
|
|
|
725
|
+ // //包装种类
|
|
|
726
|
+ // List<PackageTypeEntity> typeList = packageTypeService.findAll();
|
|
|
727
|
+ // model.addAttribute("typeList",typeList);
|
|
|
728
|
+ // model.addAttribute("bill",bill);
|
|
|
729
|
+ // return "manifest/edit_bill";
|
|
|
730
|
+ // }
|
|
|
731
|
+
|
|
|
732
|
+ // 查询主单号是否已经存在
|
737
|
@RequestMapping(value = "existsManifestNo")
|
733
|
@RequestMapping(value = "existsManifestNo")
|
738
|
@ResponseBody
|
734
|
@ResponseBody
|
739
|
- public ResponseModel editBill(String waybill){
|
735
|
+ public ResponseModel editBill(String waybill) {
|
740
|
ResponseModel model = new ResponseModel(200, null, null);
|
736
|
ResponseModel model = new ResponseModel(200, null, null);
|
741
|
List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill);
|
737
|
List<ManifestEntity> manifestList = manifestService.findByMawbNo(waybill);
|
742
|
- if(manifestList.size() > 0)
|
|
|
743
|
- {
|
738
|
+ if (manifestList.size() > 0) {
|
744
|
model.setData("该注单号已经存在了!");
|
739
|
model.setData("该注单号已经存在了!");
|
745
|
model.setStatus(0);
|
740
|
model.setStatus(0);
|
746
|
}
|
741
|
}
|
747
|
return model;
|
742
|
return model;
|
748
|
}
|
743
|
}
|
|
|
744
|
+
|
749
|
/**
|
745
|
/**
|
750
|
* 保存
|
746
|
* 保存
|
751
|
*
|
747
|
*
|
752
|
* @param manifest
|
748
|
* @param manifest
|
753
|
* @return
|
749
|
* @return
|
754
|
*/
|
750
|
*/
|
755
|
- @RequestMapping(value = "/save" , method = {RequestMethod.POST })
|
751
|
+ @RequestMapping(value = "/save", method = { RequestMethod.POST })
|
756
|
@ResponseBody
|
752
|
@ResponseBody
|
757
|
- public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest){
|
753
|
+ public ResponseModel save(ManifestEntity manifest, HttpServletRequest reuqest) {
|
|
|
754
|
+ consignorService.saveFromManifest(manifest);
|
|
|
755
|
+
|
758
|
ResponseModel model = new ResponseModel();
|
756
|
ResponseModel model = new ResponseModel();
|
759
|
try {
|
757
|
try {
|
760
|
manifest.setUSER_ID(Tools.getUserId());
|
758
|
manifest.setUSER_ID(Tools.getUserId());
|
761
|
- if(manifestService.isExistsByWaybill(manifest))
|
|
|
762
|
- {
|
759
|
+ if (manifestService.isExistsByWaybill(manifest)) {
|
763
|
model.setMsg("该订单已存在!");
|
760
|
model.setMsg("该订单已存在!");
|
764
|
model.setStatus(500);
|
761
|
model.setStatus(500);
|
765
|
- }
|
|
|
766
|
- else
|
|
|
767
|
- {
|
762
|
+ } else {
|
768
|
String stowagedate = reuqest.getParameter("stowagedate");
|
763
|
String stowagedate = reuqest.getParameter("stowagedate");
|
769
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
764
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
770
|
manifest.setSave_time(new Long(System.currentTimeMillis()));
|
765
|
manifest.setSave_time(new Long(System.currentTimeMillis()));
|
771
|
- //处理预配时间
|
766
|
+ // 处理预配时间
|
772
|
manifest = manifestService.save(manifest);
|
767
|
manifest = manifestService.save(manifest);
|
773
|
model.setData(manifest);
|
768
|
model.setData(manifest);
|
774
|
model.setStatus(200);
|
769
|
model.setStatus(200);
|
775
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
770
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
776
|
}
|
771
|
}
|
777
|
- }catch (Exception e){
|
772
|
+ } catch (Exception e) {
|
778
|
model.setStatus(500);
|
773
|
model.setStatus(500);
|
779
|
model.setMsg(HttpJsonMsg.ERROR);
|
774
|
model.setMsg(HttpJsonMsg.ERROR);
|
780
|
logger.error("系统异常 >>", e);
|
775
|
logger.error("系统异常 >>", e);
|
|
@@ -782,136 +777,155 @@ public class ManifestController extends BasicController{ |
|
@@ -782,136 +777,155 @@ public class ManifestController extends BasicController{ |
782
|
return model;
|
777
|
return model;
|
783
|
}
|
778
|
}
|
784
|
|
779
|
|
785
|
- //撤销主单
|
780
|
+ // 撤销主单
|
786
|
@RequestMapping(value = "/backout")
|
781
|
@RequestMapping(value = "/backout")
|
787
|
@ResponseBody
|
782
|
@ResponseBody
|
788
|
- public ResponseModel backout(HttpServletRequest request, Long id){
|
783
|
+ public ResponseModel backout(HttpServletRequest request, Long id) {
|
789
|
ResponseModel model = new ResponseModel(1, null, "");
|
784
|
ResponseModel model = new ResponseModel(1, null, "");
|
790
|
ManifestEntity manifest = null;
|
785
|
ManifestEntity manifest = null;
|
791
|
- try{
|
|
|
792
|
- if(id != null)
|
|
|
793
|
- {
|
786
|
+ try {
|
|
|
787
|
+ if (id != null) {
|
|
|
788
|
+ WaybillReceiptType type = WaybillReceiptType.DELETE;
|
|
|
789
|
+
|
794
|
manifest = manifestService.findOne((id));
|
790
|
manifest = manifestService.findOne((id));
|
795
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
791
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
796
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml"; //获取生成报文路径
|
|
|
797
|
- String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); //转换报文
|
792
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml"; // 获取生成报文路径
|
|
|
793
|
+ String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); // 转换报文
|
798
|
System.out.println(path);
|
794
|
System.out.println(path);
|
799
|
System.out.println(ndlxml);
|
795
|
System.out.println(ndlxml);
|
800
|
- new RedisSaveMessage().saveMessage(ndlxml); //发送
|
796
|
+ new RedisSaveMessage().saveMessage(ndlxml); // 发送
|
801
|
model.setStatus(200);
|
797
|
model.setStatus(200);
|
802
|
|
798
|
|
803
|
- manifest.setResponse_text("撤销请求已发送");
|
799
|
+ manifest.setResponse_text("主单——" + type.getName());
|
|
|
800
|
+ manifest.setResponse_code(String.valueOf(type.getValue()));
|
804
|
manifestService.save(manifest);
|
801
|
manifestService.save(manifest);
|
805
|
-
|
802
|
+ receiptService.saveFromManifest(manifest, type);
|
806
|
}
|
803
|
}
|
807
|
- }catch(Exception e){
|
804
|
+ } catch (Exception e) {
|
808
|
model.setStatus(10060);
|
805
|
model.setStatus(10060);
|
809
|
model.setMsg("连接超时!");
|
806
|
model.setMsg("连接超时!");
|
810
|
}
|
807
|
}
|
811
|
return model;
|
808
|
return model;
|
812
|
}
|
809
|
}
|
|
|
810
|
+
|
813
|
/*
|
811
|
/*
|
814
|
* 撤销分单
|
812
|
* 撤销分单
|
815
|
*/
|
813
|
*/
|
816
|
@RequestMapping(value = "housebillbackout")
|
814
|
@RequestMapping(value = "housebillbackout")
|
817
|
@ResponseBody
|
815
|
@ResponseBody
|
818
|
- public ResponseModel housebillbackout(HttpServletRequest request, Long id){
|
816
|
+ public ResponseModel housebillbackout(HttpServletRequest request, Long id) {
|
819
|
ResponseModel model = new ResponseModel(1, null, "");
|
817
|
ResponseModel model = new ResponseModel(1, null, "");
|
820
|
-
|
|
|
821
|
return model;
|
818
|
return model;
|
822
|
}
|
819
|
}
|
823
|
|
820
|
|
824
|
- @RequestMapping(value = "app/send", method = {RequestMethod.POST})
|
821
|
+ @RequestMapping(value = "app/send", method = { RequestMethod.POST })
|
825
|
@ResponseBody
|
822
|
@ResponseBody
|
826
|
- public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response){
|
823
|
+ public ResponseModel app_send(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
|
827
|
ResponseModel model = new ResponseModel(200, null, "主单发送成功!");
|
824
|
ResponseModel model = new ResponseModel(200, null, "主单发送成功!");
|
828
|
|
825
|
|
829
|
-
|
|
|
830
|
return model;
|
826
|
return model;
|
831
|
}
|
827
|
}
|
|
|
828
|
+
|
832
|
/**
|
829
|
/**
|
833
|
- * 保存并且发送
|
830
|
+ * 主单提交表单保存并且发送报文
|
834
|
*
|
831
|
*
|
835
|
* @param manifest
|
832
|
* @param manifest
|
836
|
* @return
|
833
|
* @return
|
837
|
*/
|
834
|
*/
|
838
|
- @RequestMapping(value = "/savesend" , method = {RequestMethod.POST })
|
835
|
+ @RequestMapping(value = "/savesend", method = { RequestMethod.POST })
|
839
|
@ResponseBody
|
836
|
@ResponseBody
|
840
|
- public ResponseModel savesend(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
837
|
+ public ResponseModel savesend(ManifestEntity manifest, HttpServletRequest request, HttpServletResponse response) {
|
|
|
838
|
+ consignorService.saveFromManifest(manifest);
|
|
|
839
|
+
|
841
|
ResponseModel model = new ResponseModel();
|
840
|
ResponseModel model = new ResponseModel();
|
842
|
try {
|
841
|
try {
|
843
|
manifest.setUSER_ID(Tools.getUserId());
|
842
|
manifest.setUSER_ID(Tools.getUserId());
|
844
|
- if(manifestService.isExistsByWaybill(manifest))
|
|
|
845
|
- {
|
843
|
+ if (manifestService.isExistsByWaybill(manifest)) {
|
846
|
model.setStatus(500);
|
844
|
model.setStatus(500);
|
847
|
model.setMsg("该订单号已存在!");
|
845
|
model.setMsg("该订单号已存在!");
|
848
|
- }
|
|
|
849
|
- else
|
|
|
850
|
- {
|
|
|
851
|
- String stowagedate = request.getParameter("stowagedate");
|
846
|
+ } else {
|
|
|
847
|
+ String responseCode = manifest.getResponse_code();
|
|
|
848
|
+ int resCode = NumKit.parseString2Int(responseCode);
|
|
|
849
|
+ WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
|
|
|
850
|
+ WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
|
852
|
|
851
|
|
|
|
852
|
+ String stowagedate = request.getParameter("stowagedate");
|
853
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
853
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
854
|
-
|
|
|
855
|
- //保存
|
854
|
+ // 保存
|
856
|
manifest.setIsdelete(1);
|
855
|
manifest.setIsdelete(1);
|
857
|
- manifest.setResponse_text("主单已发送");
|
856
|
+ manifest.setResponse_code(String.valueOf(type.getValue()));
|
|
|
857
|
+ manifest.setResponse_text("主单——" + type.getName());
|
858
|
manifest.setSave_time(System.currentTimeMillis());
|
858
|
manifest.setSave_time(System.currentTimeMillis());
|
859
|
manifestService.save(manifest);
|
859
|
manifestService.save(manifest);
|
|
|
860
|
+ receiptService.saveFromManifest(manifest, type);
|
|
|
861
|
+
|
860
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
862
|
System.out.println("收货人名称:" + manifest.getSh_name());
|
861
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
863
|
System.out.println("发货人名称:" + manifest.getCo_name());
|
862
|
- System.out.println("-----------------id:"+manifest.getId());
|
|
|
863
|
- //生成报文并且发送
|
864
|
+ System.out.println("-----------------id:" + manifest.getId());
|
|
|
865
|
+ // 生成报文并且发送
|
864
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
866
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
865
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
866
|
- System.out.println(path); //path
|
|
|
867
|
- String ndlrxml = XmlUtil.convertToXml2(manifestService.sendXml(manifest), path);
|
|
|
868
|
- String dlcfxml = XmlUtil.convertToXml2(manifestService.senddlcfXml(manifest), path);
|
867
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
868
|
+ String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), path);
|
|
|
869
|
+ String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), path);
|
|
|
870
|
+ String slifxml = XmlUtil.convertToXml(FSXmlKit.sliXml(manifest));
|
|
|
871
|
+ System.out.println("===================ndlrxml===================");
|
869
|
System.out.println(ndlrxml);
|
872
|
System.out.println(ndlrxml);
|
|
|
873
|
+ System.out.println();
|
|
|
874
|
+
|
|
|
875
|
+ System.out.println("===================dlcfxml===================");
|
870
|
System.err.println(dlcfxml);
|
876
|
System.err.println(dlcfxml);
|
|
|
877
|
+ System.out.println();
|
|
|
878
|
+
|
|
|
879
|
+ System.out.println("===================slifxml===================");
|
|
|
880
|
+ System.err.println(slifxml);
|
|
|
881
|
+ System.out.println();
|
|
|
882
|
+
|
871
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
883
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
872
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
884
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
|
|
885
|
+ new RedisSaveMessage().saveMessage(slifxml);
|
873
|
model.setStatus(200);
|
886
|
model.setStatus(200);
|
874
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
887
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
875
|
}
|
888
|
}
|
876
|
- }catch (Exception e){
|
889
|
+ } catch (Exception e) {
|
877
|
model.setStatus(500);
|
890
|
model.setStatus(500);
|
878
|
model.setMsg(HttpJsonMsg.ERROR);
|
891
|
model.setMsg(HttpJsonMsg.ERROR);
|
879
|
logger.error("系统异常 >>", e);
|
892
|
logger.error("系统异常 >>", e);
|
880
|
}
|
893
|
}
|
881
|
return model;
|
894
|
return model;
|
882
|
}
|
895
|
}
|
|
|
896
|
+
|
883
|
/**
|
897
|
/**
|
884
|
* 发送交运报并且保存
|
898
|
* 发送交运报并且保存
|
885
|
*
|
899
|
*
|
886
|
* @param manifest
|
900
|
* @param manifest
|
887
|
* @return
|
901
|
* @return
|
888
|
*/
|
902
|
*/
|
889
|
- @RequestMapping(value = "/sendDelivery" , method = {RequestMethod.POST })
|
903
|
+ @RequestMapping(value = "/sendDelivery", method = { RequestMethod.POST })
|
890
|
@ResponseBody
|
904
|
@ResponseBody
|
891
|
- public ResponseModel sendDelivery(ManifestEntity manifest,HttpServletRequest request,HttpServletResponse response){
|
905
|
+ public ResponseModel sendDelivery(ManifestEntity manifest, HttpServletRequest request,
|
|
|
906
|
+ HttpServletResponse response) {
|
892
|
ResponseModel model = new ResponseModel();
|
907
|
ResponseModel model = new ResponseModel();
|
893
|
try {
|
908
|
try {
|
894
|
manifest.setUSER_ID(Tools.getUserId());
|
909
|
manifest.setUSER_ID(Tools.getUserId());
|
895
|
- if(manifestService.isExistsByWaybill(manifest)){
|
910
|
+ if (manifestService.isExistsByWaybill(manifest)) {
|
896
|
model.setStatus(500);
|
911
|
model.setStatus(500);
|
897
|
model.setMsg("订单已存在!");
|
912
|
model.setMsg("订单已存在!");
|
898
|
- }
|
|
|
899
|
- else{
|
|
|
900
|
- //保存
|
913
|
+ } else {
|
|
|
914
|
+ // 保存
|
901
|
manifest.setDe_ids(1);
|
915
|
manifest.setDe_ids(1);
|
902
|
String stowagedate = request.getParameter("stowagedate");
|
916
|
String stowagedate = request.getParameter("stowagedate");
|
903
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
917
|
manifest.setStowagedate(manifest.getStowagedate(stowagedate));
|
904
|
manifest = manifestService.save(manifest);
|
918
|
manifest = manifestService.save(manifest);
|
905
|
- //生成报文并且发送
|
919
|
+ // 生成报文并且发送
|
906
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
920
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
907
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
921
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
908
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path);
|
922
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDeliveryXml(manifest), path);
|
909
|
// System.out.println(dlcfxml);
|
923
|
// System.out.println(dlcfxml);
|
910
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
924
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
911
|
model.setStatus(200);
|
925
|
model.setStatus(200);
|
912
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
926
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
913
|
}
|
927
|
}
|
914
|
- }catch (Exception e){
|
928
|
+ } catch (Exception e) {
|
915
|
model.setStatus(500);
|
929
|
model.setStatus(500);
|
916
|
model.setMsg(HttpJsonMsg.ERROR);
|
930
|
model.setMsg(HttpJsonMsg.ERROR);
|
917
|
logger.error("系统异常 >>", e);
|
931
|
logger.error("系统异常 >>", e);
|
|
@@ -925,9 +939,9 @@ public class ManifestController extends BasicController{ |
|
@@ -925,9 +939,9 @@ public class ManifestController extends BasicController{ |
925
|
* @param manifest
|
939
|
* @param manifest
|
926
|
* @return
|
940
|
* @return
|
927
|
*/
|
941
|
*/
|
928
|
- @RequestMapping(value = "/saveis_delete" , method = {RequestMethod.POST })
|
942
|
+ @RequestMapping(value = "/saveis_delete", method = { RequestMethod.POST })
|
929
|
@ResponseBody
|
943
|
@ResponseBody
|
930
|
- public ResponseModel saveis_delete(ManifestEntity manifest){
|
944
|
+ public ResponseModel saveis_delete(ManifestEntity manifest) {
|
931
|
ResponseModel model = new ResponseModel();
|
945
|
ResponseModel model = new ResponseModel();
|
932
|
try {
|
946
|
try {
|
933
|
manifest.setIsdelete(1);
|
947
|
manifest.setIsdelete(1);
|
|
@@ -935,7 +949,7 @@ public class ManifestController extends BasicController{ |
|
@@ -935,7 +949,7 @@ public class ManifestController extends BasicController{ |
935
|
model.setData(manifest);
|
949
|
model.setData(manifest);
|
936
|
model.setStatus(200);
|
950
|
model.setStatus(200);
|
937
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
951
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
938
|
- }catch (Exception e){
|
952
|
+ } catch (Exception e) {
|
939
|
model.setStatus(500);
|
953
|
model.setStatus(500);
|
940
|
model.setMsg(HttpJsonMsg.ERROR);
|
954
|
model.setMsg(HttpJsonMsg.ERROR);
|
941
|
logger.error("系统异常 >>", e);
|
955
|
logger.error("系统异常 >>", e);
|
|
@@ -949,23 +963,25 @@ public class ManifestController extends BasicController{ |
|
@@ -949,23 +963,25 @@ public class ManifestController extends BasicController{ |
949
|
* @param manifest
|
963
|
* @param manifest
|
950
|
* @return
|
964
|
* @return
|
951
|
*/
|
965
|
*/
|
952
|
- @RequestMapping(value = "/sub_save" , method = {RequestMethod.POST })
|
966
|
+ @RequestMapping(value = "/sub_save", method = { RequestMethod.POST })
|
953
|
@ResponseBody
|
967
|
@ResponseBody
|
954
|
- public ResponseModel sub_save(PreparesecondaryEntity Preparesecondary){
|
968
|
+ public ResponseModel sub_save(PreparesecondaryEntity preparesecondary) {
|
|
|
969
|
+ consignorService.saveFromPreparesecondary(preparesecondary);
|
|
|
970
|
+
|
955
|
ResponseModel model = new ResponseModel();
|
971
|
ResponseModel model = new ResponseModel();
|
956
|
try {
|
972
|
try {
|
957
|
- //已存在,提示给用户
|
|
|
958
|
- if(preparesecondaryServer.isExists(Preparesecondary)){
|
973
|
+ // 已存在,提示给用户
|
|
|
974
|
+ if (preparesecondaryServer.isExists(preparesecondary)) {
|
959
|
model.setStatus(500);
|
975
|
model.setStatus(500);
|
960
|
model.setMsg("该订单号已存在!");
|
976
|
model.setMsg("该订单号已存在!");
|
961
|
- }else{
|
|
|
962
|
- Preparesecondary.setCreateDate(new Date());
|
|
|
963
|
- Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
|
|
964
|
- model.setData(Preparesecondary);
|
977
|
+ } else {
|
|
|
978
|
+ preparesecondary.setCreateDate(new Date());
|
|
|
979
|
+ preparesecondary = preparesecondaryServer.save(preparesecondary);
|
|
|
980
|
+ model.setData(preparesecondary);
|
965
|
model.setStatus(200);
|
981
|
model.setStatus(200);
|
966
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
982
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
967
|
}
|
983
|
}
|
968
|
- }catch (Exception e){
|
984
|
+ } catch (Exception e) {
|
969
|
model.setStatus(500);
|
985
|
model.setStatus(500);
|
970
|
model.setMsg(HttpJsonMsg.ERROR);
|
986
|
model.setMsg(HttpJsonMsg.ERROR);
|
971
|
logger.error("系统异常 >>", e);
|
987
|
logger.error("系统异常 >>", e);
|
|
@@ -973,28 +989,34 @@ public class ManifestController extends BasicController{ |
|
@@ -973,28 +989,34 @@ public class ManifestController extends BasicController{ |
973
|
return model;
|
989
|
return model;
|
974
|
}
|
990
|
}
|
975
|
|
991
|
|
976
|
- //撤销分单
|
992
|
+ // 撤销分单
|
977
|
@RequestMapping(value = "prebackout")
|
993
|
@RequestMapping(value = "prebackout")
|
978
|
@ResponseBody
|
994
|
@ResponseBody
|
979
|
- public ResponseModel prebackout(HttpServletRequest request, Long id){
|
995
|
+ public ResponseModel prebackout(HttpServletRequest request, Long id) {
|
980
|
ResponseModel model = new ResponseModel(200, null, "");
|
996
|
ResponseModel model = new ResponseModel(200, null, "");
|
981
|
- if(id != null)
|
|
|
982
|
- {
|
|
|
983
|
- System.out.println("id:"+id);
|
997
|
+ if (id != null) {
|
|
|
998
|
+ System.out.println("id:" + id);
|
984
|
PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
|
999
|
PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
|
985
|
- if(preparesecondary != null)
|
|
|
986
|
- {
|
|
|
987
|
- try{
|
1000
|
+ if (preparesecondary != null) {
|
|
|
1001
|
+ try {
|
|
|
1002
|
+ WaybillReceiptType type = WaybillReceiptType.DELETE;
|
|
|
1003
|
+
|
988
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1004
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
989
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
990
|
- String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary), path);
|
|
|
991
|
- //String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
|
1005
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
1006
|
+ String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),
|
|
|
1007
|
+ path);
|
|
|
1008
|
+ // String dlcfxml =
|
|
|
1009
|
+ // XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary),
|
|
|
1010
|
+ // path);
|
992
|
|
1011
|
|
993
|
- //System.out.println(ndlrxml);
|
1012
|
+ // System.out.println(ndlrxml);
|
994
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
1013
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
995
|
- preparesecondary.setResponse_text("撤销请求已发送");
|
1014
|
+ preparesecondary.setResponse_text("分单——" + type.getName());
|
|
|
1015
|
+ preparesecondary.setResponse_code(String.valueOf(type.getValue()));
|
996
|
preparesecondaryServer.save(preparesecondary);
|
1016
|
preparesecondaryServer.save(preparesecondary);
|
997
|
- }catch(Exception e){
|
1017
|
+
|
|
|
1018
|
+ receiptService.saveFromPreparesecondary(preparesecondary, type);
|
|
|
1019
|
+ } catch (Exception e) {
|
998
|
model.setStatus(500);
|
1020
|
model.setStatus(500);
|
999
|
model.setMsg(HttpJsonMsg.ERROR);
|
1021
|
model.setMsg(HttpJsonMsg.ERROR);
|
1000
|
}
|
1022
|
}
|
|
@@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{ |
|
@@ -1002,46 +1024,67 @@ public class ManifestController extends BasicController{ |
1002
|
}
|
1024
|
}
|
1003
|
return model;
|
1025
|
return model;
|
1004
|
}
|
1026
|
}
|
|
|
1027
|
+
|
1005
|
/**
|
1028
|
/**
|
1006
|
- * 保存并且发送
|
1029
|
+ * 子单提交表单保存并且发送报文
|
1007
|
*
|
1030
|
*
|
1008
|
* @param manifest
|
1031
|
* @param manifest
|
1009
|
* @return
|
1032
|
* @return
|
1010
|
*/
|
1033
|
*/
|
1011
|
- @RequestMapping(value = "/presavesend" , method = {RequestMethod.POST })
|
1034
|
+ @RequestMapping(value = "/presavesend", method = { RequestMethod.POST })
|
1012
|
@ResponseBody
|
1035
|
@ResponseBody
|
1013
|
- public ResponseModel presavesend(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
|
1036
|
+ public ResponseModel presavesend(PreparesecondaryEntity preparesecondary, HttpServletRequest request) {
|
|
|
1037
|
+ consignorService.saveFromPreparesecondary(preparesecondary);
|
|
|
1038
|
+
|
1014
|
ResponseModel model = new ResponseModel();
|
1039
|
ResponseModel model = new ResponseModel();
|
1015
|
try {
|
1040
|
try {
|
1016
|
- if(preparesecondaryServer.isExists(Preparesecondary))
|
|
|
1017
|
- {
|
1041
|
+ if (preparesecondaryServer.isExists(preparesecondary)) {
|
1018
|
model.setStatus(500);
|
1042
|
model.setStatus(500);
|
1019
|
model.setMsg("该订单号已存在!");
|
1043
|
model.setMsg("该订单号已存在!");
|
1020
|
- }
|
|
|
1021
|
- else{
|
1044
|
+ } else {
|
|
|
1045
|
+ String responseCode = preparesecondary.getResponse_code();
|
|
|
1046
|
+ int resCode = NumKit.parseString2Int(responseCode);
|
|
|
1047
|
+ WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
|
|
|
1048
|
+ WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : WaybillReceiptType.APPLY;
|
1022
|
|
1049
|
|
1023
|
String stowagedate = request.getParameter("stowagedate");
|
1050
|
String stowagedate = request.getParameter("stowagedate");
|
1024
|
- Preparesecondary.setStowagedate(Preparesecondary.getStowagedate(stowagedate));
|
|
|
1025
|
- //生成报文并且发送
|
1051
|
+ preparesecondary.setStowagedate(preparesecondary.getStowagedate(stowagedate));
|
|
|
1052
|
+ // 生成报文并且发送
|
1026
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1053
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1027
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
|
|
1028
|
- String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(Preparesecondary), path);
|
|
|
1029
|
- String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(Preparesecondary), path);
|
|
|
1030
|
- //发送redis储存数据
|
1054
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
|
|
1055
|
+ String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), path);
|
|
|
1056
|
+ String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), path);
|
|
|
1057
|
+ String fhlfxml = XmlUtil.convertToXml(FSXmlKit.fhlXml(preparesecondary));
|
|
|
1058
|
+ // 发送redis储存数据
|
1031
|
// System.out.println(ndlrxml);
|
1059
|
// System.out.println(ndlrxml);
|
1032
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
1060
|
new RedisSaveMessage().saveMessage(ndlrxml);
|
1033
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
1061
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
1034
|
- model.setData(Preparesecondary);
|
1062
|
+ new RedisSaveMessage().saveMessage(fhlfxml);
|
|
|
1063
|
+
|
|
|
1064
|
+ model.setData(preparesecondary);
|
1035
|
model.setStatus(200);
|
1065
|
model.setStatus(200);
|
1036
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
1066
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
|
|
1067
|
+
|
|
|
1068
|
+ System.out.println("===================ndlrxml===================");
|
1037
|
System.out.println(ndlrxml);
|
1069
|
System.out.println(ndlrxml);
|
1038
|
- System.out.println(dlcfxml);
|
1070
|
+ System.out.println();
|
|
|
1071
|
+
|
|
|
1072
|
+ System.out.println("===================dlcfxml===================");
|
|
|
1073
|
+ System.err.println(dlcfxml);
|
|
|
1074
|
+ System.out.println();
|
|
|
1075
|
+
|
|
|
1076
|
+ System.out.println("===================fhlfxml===================");
|
|
|
1077
|
+ System.err.println(fhlfxml);
|
|
|
1078
|
+ System.out.println();
|
|
|
1079
|
+
|
|
|
1080
|
+ preparesecondary.setIsdelete(1);
|
|
|
1081
|
+ preparesecondary.setResponse_code(String.valueOf(type.getValue()));
|
|
|
1082
|
+ preparesecondary.setResponse_text("分单——" + type.getName());
|
|
|
1083
|
+ preparesecondaryServer.save(preparesecondary);
|
|
|
1084
|
+ receiptService.saveFromPreparesecondary(preparesecondary, type);
|
1039
|
|
1085
|
|
1040
|
- Preparesecondary.setIsdelete(1);
|
|
|
1041
|
- Preparesecondary.setResponse_text("分单已发送");
|
|
|
1042
|
- preparesecondaryServer.save(Preparesecondary);
|
|
|
1043
|
}
|
1086
|
}
|
1044
|
- }catch (Exception e){
|
1087
|
+ } catch (Exception e) {
|
1045
|
model.setStatus(500);
|
1088
|
model.setStatus(500);
|
1046
|
model.setMsg(HttpJsonMsg.ERROR);
|
1089
|
model.setMsg(HttpJsonMsg.ERROR);
|
1047
|
logger.error("系统异常 >>", e);
|
1090
|
logger.error("系统异常 >>", e);
|
|
@@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{ |
|
@@ -1055,31 +1098,30 @@ public class ManifestController extends BasicController{ |
1055
|
* @param manifest
|
1098
|
* @param manifest
|
1056
|
* @return
|
1099
|
* @return
|
1057
|
*/
|
1100
|
*/
|
1058
|
- @RequestMapping(value = "/presendDelivery" , method = {RequestMethod.POST })
|
1101
|
+ @RequestMapping(value = "/presendDelivery", method = { RequestMethod.POST })
|
1059
|
@ResponseBody
|
1102
|
@ResponseBody
|
1060
|
- public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary,HttpServletRequest request){
|
1103
|
+ public ResponseModel presendDelivery(PreparesecondaryEntity Preparesecondary, HttpServletRequest request) {
|
1061
|
ResponseModel model = new ResponseModel();
|
1104
|
ResponseModel model = new ResponseModel();
|
1062
|
|
1105
|
|
1063
|
try {
|
1106
|
try {
|
1064
|
- if(preparesecondaryServer.isExists(Preparesecondary)){
|
1107
|
+ if (preparesecondaryServer.isExists(Preparesecondary)) {
|
1065
|
model.setStatus(500);
|
1108
|
model.setStatus(500);
|
1066
|
model.setMsg("改订单号已经存在了!");
|
1109
|
model.setMsg("改订单号已经存在了!");
|
1067
|
- }
|
|
|
1068
|
- else{
|
1110
|
+ } else {
|
1069
|
Preparesecondary.setIsdelete(1);
|
1111
|
Preparesecondary.setIsdelete(1);
|
1070
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
1112
|
Preparesecondary = preparesecondaryServer.save(Preparesecondary);
|
1071
|
- //生成报文并且发送
|
1113
|
+ // 生成报文并且发送
|
1072
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1114
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1073
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
1115
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
1074
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path);
|
1116
|
String dlcfxml = XmlUtil.convertToXml2(manifestService.sendPreXml(Preparesecondary), path);
|
1075
|
- //发送redis储存数据
|
1117
|
+ // 发送redis储存数据
|
1076
|
// System.out.println(dlcfxml);
|
1118
|
// System.out.println(dlcfxml);
|
1077
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
1119
|
new RedisSaveMessage().saveMessage(dlcfxml);
|
1078
|
model.setData(Preparesecondary);
|
1120
|
model.setData(Preparesecondary);
|
1079
|
model.setStatus(200);
|
1121
|
model.setStatus(200);
|
1080
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
1122
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
1081
|
}
|
1123
|
}
|
1082
|
- }catch (Exception e){
|
1124
|
+ } catch (Exception e) {
|
1083
|
model.setStatus(500);
|
1125
|
model.setStatus(500);
|
1084
|
model.setMsg(HttpJsonMsg.ERROR);
|
1126
|
model.setMsg(HttpJsonMsg.ERROR);
|
1085
|
logger.error("系统异常 >>", e);
|
1127
|
logger.error("系统异常 >>", e);
|
|
@@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{ |
|
@@ -1093,53 +1135,51 @@ public class ManifestController extends BasicController{ |
1093
|
* @param manifest
|
1135
|
* @param manifest
|
1094
|
* @return
|
1136
|
* @return
|
1095
|
*/
|
1137
|
*/
|
1096
|
- @RequestMapping(value = "/daryMawbNo" , method = {RequestMethod.POST })
|
1138
|
+ @RequestMapping(value = "/daryMawbNo", method = { RequestMethod.POST })
|
1097
|
@ResponseBody
|
1139
|
@ResponseBody
|
1098
|
- public ResponseModel daryMawbNo(Long id,String mawbNo){
|
1140
|
+ public ResponseModel daryMawbNo(Long id, String mawbNo) {
|
1099
|
ResponseModel model = new ResponseModel();
|
1141
|
ResponseModel model = new ResponseModel();
|
1100
|
List<PreparesecondaryEntity> list = null;
|
1142
|
List<PreparesecondaryEntity> list = null;
|
1101
|
- if(StringUtils.isNotEmpty(mawbNo)){
|
1143
|
+ if (StringUtils.isNotEmpty(mawbNo)) {
|
1102
|
list = preparesecondaryServer.findByMawbNo(mawbNo);
|
1144
|
list = preparesecondaryServer.findByMawbNo(mawbNo);
|
1103
|
}
|
1145
|
}
|
1104
|
boolean exist = false;
|
1146
|
boolean exist = false;
|
1105
|
- if(CollectionUtils.isNotEmpty(list)){
|
|
|
1106
|
- if(list.size()>0){
|
1147
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
1148
|
+ if (list.size() > 0) {
|
1107
|
exist = true;
|
1149
|
exist = true;
|
1108
|
}
|
1150
|
}
|
1109
|
}
|
1151
|
}
|
1110
|
- if(exist){
|
1152
|
+ if (exist) {
|
1111
|
model.setStatus(500);
|
1153
|
model.setStatus(500);
|
1112
|
- }
|
|
|
1113
|
- else {
|
1154
|
+ } else {
|
1114
|
model.setStatus(200);
|
1155
|
model.setStatus(200);
|
1115
|
}
|
1156
|
}
|
1116
|
return model;
|
1157
|
return model;
|
1117
|
}
|
1158
|
}
|
1118
|
|
1159
|
|
1119
|
-
|
|
|
1120
|
- @RequestMapping(value = "/xml",method = RequestMethod.POST)
|
1160
|
+ @RequestMapping(value = "/xml", method = RequestMethod.POST)
|
1121
|
@ResponseBody
|
1161
|
@ResponseBody
|
1122
|
- public ResponseModel createXml(Long id,HttpServletRequest request,HttpServletResponse response) throws Exception {
|
1162
|
+ public ResponseModel createXml(Long id, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
1123
|
ResponseModel model = new ResponseModel();
|
1163
|
ResponseModel model = new ResponseModel();
|
1124
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1164
|
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
1125
|
- String path = rootPath+"/excel/manifest"+new Date().getTime()+".xml";
|
1165
|
+ String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
|
1126
|
String xml = "";
|
1166
|
String xml = "";
|
1127
|
- if(id!=null){
|
|
|
1128
|
- xml = beanToXml(path,id);
|
1167
|
+ if (id != null) {
|
|
|
1168
|
+ xml = beanToXml(path, id);
|
1129
|
}
|
1169
|
}
|
1130
|
model.setData(xml);
|
1170
|
model.setData(xml);
|
1131
|
return model;
|
1171
|
return model;
|
1132
|
}
|
1172
|
}
|
1133
|
|
1173
|
|
1134
|
- //生成报文
|
|
|
1135
|
- private String beanToXml(String path,Long id) throws Exception{
|
1174
|
+ // 生成报文
|
|
|
1175
|
+ private String beanToXml(String path, Long id) throws Exception {
|
1136
|
ManifestEntity maen = manifestService.findOne(id);
|
1176
|
ManifestEntity maen = manifestService.findOne(id);
|
1137
|
List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId());
|
1177
|
List<PreparesecondaryEntity> preparesecondaryList = preparesecondaryServer.findAll(maen.getId());
|
1138
|
|
1178
|
|
1139
|
DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody();
|
1179
|
DeclarePreparemasterXmlBody body = new DeclarePreparemasterXmlBody();
|
1140
|
- //设置xml开头
|
1180
|
+ // 设置xml开头
|
1141
|
XmlHead head = new XmlHead();
|
1181
|
XmlHead head = new XmlHead();
|
1142
|
- head.setMessageID("CN_MT2201_1P0_460470678920X_"+Constant.dateTimeFormatnumber.format(new Date()));
|
1182
|
+ head.setMessageID("CN_MT2201_1P0_460470678920X_" + Constant.dateTimeFormatnumber.format(new Date()));
|
1143
|
head.setFunctionCode("9");
|
1183
|
head.setFunctionCode("9");
|
1144
|
head.setMessageType("MT2201");
|
1184
|
head.setMessageType("MT2201");
|
1145
|
head.setSenderID("460470678920X_DXPENT0000460002");
|
1185
|
head.setSenderID("460470678920X_DXPENT0000460002");
|
|
@@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{ |
|
@@ -1147,37 +1187,37 @@ public class ManifestController extends BasicController{ |
1147
|
head.setSendTime(Constant.dateTimeFormatnumber.format(new Date()));
|
1187
|
head.setSendTime(Constant.dateTimeFormatnumber.format(new Date()));
|
1148
|
head.setVersion("1.0");
|
1188
|
head.setVersion("1.0");
|
1149
|
body.setHead(head);
|
1189
|
body.setHead(head);
|
1150
|
- //预配舱单
|
1190
|
+ // 预配舱单
|
1151
|
ManifestDeclarationXml dec = new ManifestDeclarationXml();
|
1191
|
ManifestDeclarationXml dec = new ManifestDeclarationXml();
|
1152
|
- //预配舱单主表信息
|
|
|
1153
|
- //承运人
|
1192
|
+ // 预配舱单主表信息
|
|
|
1193
|
+ // 承运人
|
1154
|
ManifestCarrierXml carr = new ManifestCarrierXml();
|
1194
|
ManifestCarrierXml carr = new ManifestCarrierXml();
|
1155
|
carr.setId(maen.getCarrier());
|
1195
|
carr.setId(maen.getCarrier());
|
1156
|
dec.setCarrier(carr);
|
1196
|
dec.setCarrier(carr);
|
1157
|
|
1197
|
|
1158
|
- //起始站
|
1198
|
+ // 起始站
|
1159
|
ManifestOrgXml mo = new ManifestOrgXml();
|
1199
|
ManifestOrgXml mo = new ManifestOrgXml();
|
1160
|
mo.setId(maen.getOriginatingstation());
|
1200
|
mo.setId(maen.getOriginatingstation());
|
1161
|
dec.setOrg(mo);
|
1201
|
dec.setOrg(mo);
|
1162
|
|
1202
|
|
1163
|
- //目的站
|
1203
|
+ // 目的站
|
1164
|
ManifestDesXml md = new ManifestDesXml();
|
1204
|
ManifestDesXml md = new ManifestDesXml();
|
1165
|
md.setId(maen.getDestinationstation());
|
1205
|
md.setId(maen.getDestinationstation());
|
1166
|
dec.setDes(md);
|
1206
|
dec.setDes(md);
|
1167
|
|
1207
|
|
1168
|
- //航班号-航班日期
|
1208
|
+ // 航班号-航班日期
|
1169
|
ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml();
|
1209
|
ManifestBorderTransportMeansXml mt = new ManifestBorderTransportMeansXml();
|
1170
|
- mt.setJourneyid(maen.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));
|
1210
|
+ mt.setJourneyid(maen.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
|
1171
|
dec.setBordertransportmeans(mt);
|
1211
|
dec.setBordertransportmeans(mt);
|
1172
|
|
1212
|
|
1173
|
ManifestConsignmentXml mcs = new ManifestConsignmentXml();
|
1213
|
ManifestConsignmentXml mcs = new ManifestConsignmentXml();
|
1174
|
|
1214
|
|
1175
|
- //运单号
|
1215
|
+ // 运单号
|
1176
|
ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml();
|
1216
|
ManifestTransportContractDocumentXml mac = new ManifestTransportContractDocumentXml();
|
1177
|
mac.setId(maen.getWaybillnomaster());
|
1217
|
mac.setId(maen.getWaybillnomaster());
|
1178
|
mcs.setTransportcontractdocument(mac);
|
1218
|
mcs.setTransportcontractdocument(mac);
|
1179
|
|
1219
|
|
1180
|
- //装载日期
|
1220
|
+ // 装载日期
|
1181
|
ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml();
|
1221
|
ManifestLoadingLocationXml ml = new ManifestLoadingLocationXml();
|
1182
|
ml.setId("CGO/4604");
|
1222
|
ml.setId("CGO/4604");
|
1183
|
ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate()));
|
1223
|
ml.setLoadingdate(Constant.dateTimeFormatnumber.format(maen.getStowagedate()));
|
|
@@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{ |
|
@@ -1207,29 +1247,29 @@ public class ManifestController extends BasicController{ |
1207
|
mcs.setAgentname(maen.getAgentman());
|
1247
|
mcs.setAgentname(maen.getAgentman());
|
1208
|
mcs.setAgentCompany(maen.getAgentcompany());
|
1248
|
mcs.setAgentCompany(maen.getAgentcompany());
|
1209
|
|
1249
|
|
1210
|
-// ManifestConsigneeXml mcons = new ManifestConsigneeXml();
|
|
|
1211
|
-// mcons.setName(maen.getConsigneename());
|
|
|
1212
|
-//
|
|
|
1213
|
-// ManifestAddressXml madd = new ManifestAddressXml();
|
|
|
1214
|
-// madd.setLine(maen.getConsigneeaddress());
|
|
|
1215
|
-// madd.setCityname(maen.getConsigneecity());
|
|
|
1216
|
-// madd.setCountrycode(maen.getCountrycode());
|
|
|
1217
|
-// madd.setProvincecode(maen.getProvincecode());
|
|
|
1218
|
-// madd.setProvincename(maen.getProvincename());
|
|
|
1219
|
-// madd.setZipcode(maen.getZipcode());
|
|
|
1220
|
-// mcons.setAddress(madd);
|
|
|
1221
|
-// mcs.setConsignee(mcons);
|
|
|
1222
|
-//
|
1250
|
+ // ManifestConsigneeXml mcons = new ManifestConsigneeXml();
|
|
|
1251
|
+ // mcons.setName(maen.getConsigneename());
|
|
|
1252
|
+ //
|
|
|
1253
|
+ // ManifestAddressXml madd = new ManifestAddressXml();
|
|
|
1254
|
+ // madd.setLine(maen.getConsigneeaddress());
|
|
|
1255
|
+ // madd.setCityname(maen.getConsigneecity());
|
|
|
1256
|
+ // madd.setCountrycode(maen.getCountrycode());
|
|
|
1257
|
+ // madd.setProvincecode(maen.getProvincecode());
|
|
|
1258
|
+ // madd.setProvincename(maen.getProvincename());
|
|
|
1259
|
+ // madd.setZipcode(maen.getZipcode());
|
|
|
1260
|
+ // mcons.setAddress(madd);
|
|
|
1261
|
+ // mcs.setConsignee(mcons);
|
|
|
1262
|
+ //
|
1223
|
ManifestConsignorXml maci = new ManifestConsignorXml();
|
1263
|
ManifestConsignorXml maci = new ManifestConsignorXml();
|
1224
|
-// maci.setName(maen.getShippername());
|
1264
|
+ // maci.setName(maen.getShippername());
|
1225
|
ManifestsAddressXml msadd = new ManifestsAddressXml();
|
1265
|
ManifestsAddressXml msadd = new ManifestsAddressXml();
|
1226
|
-// msadd.setLine(maen.getShipperaddress());
|
|
|
1227
|
-// msadd.setCityname(maen.getShippercity());
|
1266
|
+ // msadd.setLine(maen.getShipperaddress());
|
|
|
1267
|
+ // msadd.setCityname(maen.getShippercity());
|
1228
|
maci.setAddress(msadd);
|
1268
|
maci.setAddress(msadd);
|
1229
|
mcs.setConsignor(maci);
|
1269
|
mcs.setConsignor(maci);
|
1230
|
|
1270
|
|
1231
|
- //预配舱单子表信息
|
|
|
1232
|
- if(preparesecondaryList !=null ){
|
1271
|
+ // 预配舱单子表信息
|
|
|
1272
|
+ if (preparesecondaryList != null) {
|
1233
|
List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>();
|
1273
|
List<ManifestConsignmentItemXml> ls = new ArrayList<ManifestConsignmentItemXml>();
|
1234
|
for (PreparesecondaryEntity entity : preparesecondaryList) {
|
1274
|
for (PreparesecondaryEntity entity : preparesecondaryList) {
|
1235
|
ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml();
|
1275
|
ManifestConsignmentItemXml maconca = new ManifestConsignmentItemXml();
|
|
@@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{ |
|
@@ -1246,7 +1286,8 @@ public class ManifestController extends BasicController{ |
1246
|
maconca.setDes(dess);
|
1286
|
maconca.setDes(dess);
|
1247
|
|
1287
|
|
1248
|
ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml();
|
1288
|
ManifestBorderTransportMeansXml mtm = new ManifestBorderTransportMeansXml();
|
1249
|
- mtm.setJourneyid(entity.getFlightno()+"/"+Constant.dateFormat.format(maen.getFlightdate()));;
|
1289
|
+ mtm.setJourneyid(entity.getFlightno() + "/" + Constant.dateFormat.format(maen.getFlightdate()));
|
|
|
1290
|
+ ;
|
1250
|
maconca.setBorderTransportMeans(mtm);
|
1291
|
maconca.setBorderTransportMeans(mtm);
|
1251
|
|
1292
|
|
1252
|
ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml();
|
1293
|
ManifestTransportContractDocumentXml masc = new ManifestTransportContractDocumentXml();
|
|
@@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{ |
|
@@ -1277,23 +1318,23 @@ public class ManifestController extends BasicController{ |
1277
|
maconca.setAgentname(entity.getAgentman());
|
1318
|
maconca.setAgentname(entity.getAgentman());
|
1278
|
maconca.setCustomscode(entity.getCustomscode());
|
1319
|
maconca.setCustomscode(entity.getCustomscode());
|
1279
|
|
1320
|
|
1280
|
-// ManifestAddressXml madds = new ManifestAddressXml();
|
|
|
1281
|
-// madds.setLine(entity.getConsigneeaddress());
|
|
|
1282
|
-// madds.setCityname(entity.getConsigneecity());
|
|
|
1283
|
-// madds.setCountrycode(entity.getCountrycode());
|
|
|
1284
|
-// madds.setProvincecode(maen.getProvincecode());
|
|
|
1285
|
-// madds.setProvincename(entity.getProvincename());
|
|
|
1286
|
-// madds.setZipcode(entity.getZipcode());
|
|
|
1287
|
-// mcons.setAddress(madds);
|
|
|
1288
|
-// maconca.setConsignee(mcons);
|
|
|
1289
|
-//
|
|
|
1290
|
-// ManifestConsignorXml macis = new ManifestConsignorXml();
|
|
|
1291
|
-// macis.setName(entity.getShippername());
|
|
|
1292
|
-// ManifestsAddressXml msadds = new ManifestsAddressXml();
|
|
|
1293
|
-// msadds.setLine(entity.getShipperaddress());
|
|
|
1294
|
-// msadds.setCityname(entity.getShippercity());
|
|
|
1295
|
-// macis.setAddress(msadds);
|
|
|
1296
|
-// maconca.setConsignor(macis);
|
1321
|
+ // ManifestAddressXml madds = new ManifestAddressXml();
|
|
|
1322
|
+ // madds.setLine(entity.getConsigneeaddress());
|
|
|
1323
|
+ // madds.setCityname(entity.getConsigneecity());
|
|
|
1324
|
+ // madds.setCountrycode(entity.getCountrycode());
|
|
|
1325
|
+ // madds.setProvincecode(maen.getProvincecode());
|
|
|
1326
|
+ // madds.setProvincename(entity.getProvincename());
|
|
|
1327
|
+ // madds.setZipcode(entity.getZipcode());
|
|
|
1328
|
+ // mcons.setAddress(madds);
|
|
|
1329
|
+ // maconca.setConsignee(mcons);
|
|
|
1330
|
+ //
|
|
|
1331
|
+ // ManifestConsignorXml macis = new ManifestConsignorXml();
|
|
|
1332
|
+ // macis.setName(entity.getShippername());
|
|
|
1333
|
+ // ManifestsAddressXml msadds = new ManifestsAddressXml();
|
|
|
1334
|
+ // msadds.setLine(entity.getShipperaddress());
|
|
|
1335
|
+ // msadds.setCityname(entity.getShippercity());
|
|
|
1336
|
+ // macis.setAddress(msadds);
|
|
|
1337
|
+ // maconca.setConsignor(macis);
|
1297
|
|
1338
|
|
1298
|
ls.add(maconca);
|
1339
|
ls.add(maconca);
|
1299
|
}
|
1340
|
}
|
|
@@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{ |
|
@@ -1303,288 +1344,295 @@ public class ManifestController extends BasicController{ |
1303
|
|
1344
|
|
1304
|
body.setDeclaration(dec);
|
1345
|
body.setDeclaration(dec);
|
1305
|
|
1346
|
|
1306
|
-
|
|
|
1307
|
ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml();
|
1347
|
ManifestDeclareMsgXml dms = new ManifestDeclareMsgXml();
|
1308
|
ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml();
|
1348
|
ManifestDeclareMetaXml mdme = new ManifestDeclareMetaXml();
|
1309
|
mdme.setSndr("CDCF");
|
1349
|
mdme.setSndr("CDCF");
|
1310
|
mdme.setRcvr("");
|
1350
|
mdme.setRcvr("");
|
1311
|
- mdme.setSeqn(maen.getWaybillnomaster()+Constant.dateTimeFormatnumber.format(new Date()));
|
1351
|
+ mdme.setSeqn(maen.getWaybillnomaster() + Constant.dateTimeFormatnumber.format(new Date()));
|
1312
|
mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date()));
|
1352
|
mdme.setDdtm(Constant.dateTimeFormatnumber.format(new Date()));
|
1313
|
mdme.setType("HYXX");
|
1353
|
mdme.setType("HYXX");
|
1314
|
- mdme.setStyp("CDCF");//CDCF NDLR
|
1354
|
+ mdme.setStyp("CDCF");// CDCF NDLR
|
1315
|
dms.setMeta(mdme);
|
1355
|
dms.setMeta(mdme);
|
1316
|
dms.setDeclarepreparemasterxmlbody(body);
|
1356
|
dms.setDeclarepreparemasterxmlbody(body);
|
1317
|
|
1357
|
|
1318
|
String xml = XmlUtil.convertToXml2(dms, path);
|
1358
|
String xml = XmlUtil.convertToXml2(dms, path);
|
1319
|
|
1359
|
|
1320
|
-// System.out.println(xml);
|
|
|
1321
|
-// IMFServletManifst mis = new IMFServletManifst();
|
|
|
1322
|
-// mis.init(xml.toString());
|
1360
|
+ // System.out.println(xml);
|
|
|
1361
|
+ // IMFServletManifst mis = new IMFServletManifst();
|
|
|
1362
|
+ // mis.init(xml.toString());
|
1323
|
|
1363
|
|
1324
|
return xml;
|
1364
|
return xml;
|
1325
|
}
|
1365
|
}
|
1326
|
|
1366
|
|
1327
|
-// private String beanToXml(String path,Long id){
|
|
|
1328
|
-// ManifestEntity manifestEntity = manifestService.findOne(id);
|
|
|
1329
|
-//
|
|
|
1330
|
-// if(manifestEntity==null){
|
|
|
1331
|
-// manifestEntity = new ManifestEntity();
|
|
|
1332
|
-// }
|
|
|
1333
|
-// List<ManifestBillEntity> billList = null;
|
|
|
1334
|
-// ManifestBillEntity billEntity = new ManifestBillEntity();
|
|
|
1335
|
-// ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
|
|
|
1336
|
-// ManifestContainerEntity containerEntity = new ManifestContainerEntity();
|
|
|
1337
|
-// if(manifestEntity.getId()!=null){
|
|
|
1338
|
-// billList = billService.findByManifestId(manifestEntity.getId());
|
|
|
1339
|
-// }
|
|
|
1340
|
-// if(CollectionUtils.isNotEmpty(billList)){
|
|
|
1341
|
-// billEntity = billList.get(0);
|
|
|
1342
|
-// }
|
|
|
1343
|
-// List<ManifestCommodityEntity> commodities = null;
|
|
|
1344
|
-// if(billEntity.getId()!=null){
|
|
|
1345
|
-// commodities = commodityService.findByBillId(billEntity.getId());
|
|
|
1346
|
-// }
|
|
|
1347
|
-// if(CollectionUtils.isNotEmpty(commodities)){
|
|
|
1348
|
-// commodityEntity = commodities.get(0);
|
|
|
1349
|
-// }
|
|
|
1350
|
-//
|
|
|
1351
|
-// DeclareXmlBody body = new DeclareXmlBody();
|
|
|
1352
|
-//
|
|
|
1353
|
-// XmlHead head = new XmlHead();
|
|
|
1354
|
-// head.setMessageID(id==null?"":id.toString());
|
|
|
1355
|
-// head.setMessageType("Manifest");
|
|
|
1356
|
-// head.setSenderID(SessionUtil.getUser().getId().toString());
|
|
|
1357
|
-// head.setSendTime(Constant.dateFormat.format(new Date()));
|
|
|
1358
|
-// head.setFunctionCode("");
|
|
|
1359
|
-// head.setReceiverID(SessionUtil.getUser().getId().toString());
|
|
|
1360
|
-// head.setVersion("1.0");
|
|
|
1361
|
-// body.setHead(head);
|
|
|
1362
|
-//
|
|
|
1363
|
-// DeclareManifestXml manifestXml = new DeclareManifestXml();
|
|
|
1364
|
-//
|
|
|
1365
|
-// NameXml nameXml = new NameXml();
|
|
|
1366
|
-// nameXml.setName(manifestEntity.getTransferName());
|
|
|
1367
|
-// manifestXml.setRepresentativePerson(nameXml);
|
|
|
1368
|
-//
|
|
|
1369
|
-// IDXml idXml = new IDXml();
|
|
|
1370
|
-// idXml.setId(manifestEntity.getLeaveCode());
|
|
|
1371
|
-// manifestXml.setExitCustomsOffice(idXml);
|
|
|
1372
|
-//
|
|
|
1373
|
-// IDXml idXml1 = new IDXml();
|
|
|
1374
|
-// idXml1.setId(manifestEntity.getAgentCompanyCode());
|
|
|
1375
|
-// manifestXml.setAgent(idXml1);
|
|
|
1376
|
-//
|
|
|
1377
|
-// IDXml idXml2 = new IDXml();
|
|
|
1378
|
-// idXml2.setId(manifestEntity.getCarrierCode());
|
|
|
1379
|
-// manifestXml.setCarrier(idXml2);
|
|
|
1380
|
-//
|
|
|
1381
|
-// DeclareBorderTransportMeansXml transportMeansXml = new DeclareBorderTransportMeansXml();
|
|
|
1382
|
-// transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
|
|
|
1383
|
-// transportMeansXml.setTypeCode(manifestEntity.getModeCode());
|
|
|
1384
|
-// transportMeansXml.setId(manifestEntity.getToolCode());
|
|
|
1385
|
-// transportMeansXml.setName(manifestEntity.getToolName());
|
|
|
1386
|
-// transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
|
|
|
1387
|
-// transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
|
|
|
1388
|
-// transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
|
|
|
1389
|
-//
|
|
|
1390
|
-// DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
|
|
|
1391
|
-//
|
|
|
1392
|
-// DeclareTransportContractDocumentXml contractDocumentXml = new DeclareTransportContractDocumentXml();
|
|
|
1393
|
-//
|
|
|
1394
|
-// contractDocumentXml.setId(billEntity.getLadingNo());
|
|
|
1395
|
-// contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
|
|
|
1396
|
-// contractDocumentXml.setConditionCode(billEntity.getTransportCode());
|
|
|
1397
|
-// consignmentXml.setTransportContractDocument(contractDocumentXml);
|
|
|
1398
|
-//
|
|
|
1399
|
-// IDXml idXml3 = new IDXml();
|
|
|
1400
|
-// idXml3.setId(billEntity.getSubLadingNo());
|
|
|
1401
|
-// consignmentXml.setAssociatedTransportDocument(idXml3);
|
|
|
1402
|
-//
|
|
|
1403
|
-// consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
|
|
|
1404
|
-// consignmentXml.setValueAmount(billEntity.getCashType());
|
|
|
1405
|
-//
|
|
|
1406
|
-// DeclareLoadingLocationXml loadingLocationXml = new DeclareLoadingLocationXml();
|
|
|
1407
|
-// loadingLocationXml.setId(billEntity.getEncasementCode());
|
|
|
1408
|
-// loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
|
|
|
1409
|
-// consignmentXml.setLoadingLocation(loadingLocationXml);
|
|
|
1410
|
-//
|
|
|
1411
|
-// DeclareUnloadingLocationXml unloadingLocationXml = new DeclareUnloadingLocationXml();
|
|
|
1412
|
-// unloadingLocationXml.setId(billEntity.getUnlodingCode());
|
|
|
1413
|
-// unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
|
|
|
1414
|
-// consignmentXml.setUnloadingLocation(unloadingLocationXml);
|
|
|
1415
|
-//
|
|
|
1416
|
-// DeclareGoodsReceiptPlaceXml receiptPlaceXml = new DeclareGoodsReceiptPlaceXml();
|
|
|
1417
|
-//
|
|
|
1418
|
-// receiptPlaceXml.setId(billEntity.getReceiveCode());
|
|
|
1419
|
-// receiptPlaceXml.setName(billEntity.getReceiveName());
|
|
|
1420
|
-// consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
|
|
|
1421
|
-//
|
|
|
1422
|
-// IDXml idXml4 = new IDXml();
|
|
|
1423
|
-// idXml4.setId(billEntity.getTransitCode());
|
|
|
1424
|
-// consignmentXml.setTranshipmentLocation(idXml4);
|
|
|
1425
|
-//
|
|
|
1426
|
-// IDXml idXml5 = new IDXml();
|
|
|
1427
|
-// idXml5.setId(billEntity.getTransitDestinationCode());
|
|
|
1428
|
-// consignmentXml.setTransitDestination(idXml5);
|
|
|
1429
|
-//
|
|
|
1430
|
-// consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
|
|
|
1431
|
-//
|
|
|
1432
|
-// IDXml idXml6 = new IDXml();
|
|
|
1433
|
-// idXml6.setId(billEntity.getConsignLocation());
|
|
|
1434
|
-// consignmentXml.setGoodsConsignedPlace(idXml6);
|
|
|
1435
|
-//
|
|
|
1436
|
-// consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
|
|
|
1437
|
-// consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
|
|
|
1438
|
-//
|
|
|
1439
|
-// DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
|
|
|
1440
|
-// methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
|
|
|
1441
|
-// consignmentXml.setFreightPayment(methodCodeXml);
|
|
|
1442
|
-//
|
|
|
1443
|
-// DeclareConsignmentPackagingXml packagingXml = new DeclareConsignmentPackagingXml();
|
|
|
1444
|
-// packagingXml.setTypeCode(billEntity.getPackageType());
|
|
|
1445
|
-// packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
|
|
|
1446
|
-// consignmentXml.setConsignmentPackaging(packagingXml);
|
|
|
1447
|
-//
|
|
|
1448
|
-// consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
|
|
|
1449
|
-//
|
|
|
1450
|
-// DeclarePreviousCustomsDocumentXml documentXml = new DeclarePreviousCustomsDocumentXml();
|
|
|
1451
|
-// documentXml.setId(billEntity.getPreviousCustomsNo());
|
|
|
1452
|
-// documentXml.setTypeCode(billEntity.getPreviousCustomsType());
|
|
|
1453
|
-// consignmentXml.setPreviousCustomsDocument(documentXml);
|
|
|
1454
|
-//
|
|
|
1455
|
-// DeclareDeliveryDestinationXml deliveryDestinationXml = new DeclareDeliveryDestinationXml();
|
|
|
1456
|
-// deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
|
|
|
1457
|
-// deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
|
|
|
1458
|
-// deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
|
|
|
1459
|
-// deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
|
|
|
1460
|
-// deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
|
|
|
1461
|
-// consignmentXml.setDeliveryDestination(deliveryDestinationXml);
|
|
|
1462
|
-//
|
|
|
1463
|
-// DeclareIntermediateCarrierXml intermediateCarrierXml = new DeclareIntermediateCarrierXml();
|
|
|
1464
|
-// intermediateCarrierXml.setId(billEntity.getCarrierSign());
|
|
|
1465
|
-// DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
|
|
|
1466
|
-// communicationXml.setId(billEntity.getCarrierContactNo());
|
|
|
1467
|
-// communicationXml.setTypeID(billEntity.getCarrierContactType());
|
|
|
1468
|
-// intermediateCarrierXml.setCommunication(communicationXml);
|
|
|
1469
|
-// consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
|
|
|
1470
|
-//
|
|
|
1471
|
-// //收货人
|
|
|
1472
|
-// DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
|
|
|
1473
|
-// consigneeXml.setId(billEntity.getReceiverCode());
|
|
|
1474
|
-// consigneeXml.setName(billEntity.getReceiverName());
|
|
|
1475
|
-//
|
|
|
1476
|
-// DeclareAddressXml addressXml = new DeclareAddressXml();
|
|
|
1477
|
-// addressXml.setLine(billEntity.getReceiverAddress());
|
|
|
1478
|
-// addressXml.setCityName(billEntity.getReceiverCity());
|
|
|
1479
|
-// addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
|
|
|
1480
|
-// addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
|
|
|
1481
|
-// addressXml.setCountryCode(billEntity.getReceiverCountryCode());
|
|
|
1482
|
-// addressXml.setPostcodeID(billEntity.getReceiverPostCode());
|
|
|
1483
|
-// consigneeXml.setAddress(addressXml);
|
|
|
1484
|
-// DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
|
|
|
1485
|
-// communicationXml1.setId(billEntity.getReceiverContactNo());
|
|
|
1486
|
-// communicationXml1.setTypeID(billEntity.getReceiverContactType());
|
|
|
1487
|
-// consigneeXml.setCommunication(communicationXml1);
|
|
|
1488
|
-//
|
|
|
1489
|
-// DeclareContactXml contactXml = new DeclareContactXml();
|
|
|
1490
|
-// contactXml.setName(billEntity.getReceiverName());
|
|
|
1491
|
-// DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
|
|
|
1492
|
-// communicationXml2.setId(billEntity.getReceiverContactNo());
|
|
|
1493
|
-// communicationXml2.setTypeID(billEntity.getReceiverContactType());
|
|
|
1494
|
-// contactXml.setCommunication(communicationXml2);
|
|
|
1495
|
-// consigneeXml.setContact(contactXml);
|
|
|
1496
|
-//
|
|
|
1497
|
-// consignmentXml.setConsignee(consigneeXml);
|
|
|
1498
|
-//
|
|
|
1499
|
-// //发货人
|
|
|
1500
|
-// DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
|
|
|
1501
|
-// consigneeXml1.setId(billEntity.getSenderCode());
|
|
|
1502
|
-// consigneeXml1.setName(billEntity.getSenderName());
|
|
|
1503
|
-// DeclareAddressXml addressXml1 = new DeclareAddressXml();
|
|
|
1504
|
-// addressXml1.setLine(billEntity.getSenderAddress());
|
|
|
1505
|
-// addressXml1.setCityName(billEntity.getSenderCity());
|
|
|
1506
|
-// addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
|
|
|
1507
|
-// addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
|
|
|
1508
|
-// addressXml1.setPostcodeID(billEntity.getSenderPostCode());
|
|
|
1509
|
-// addressXml1.setCountryCode(billEntity.getSenderCountryCode());
|
|
|
1510
|
-// consigneeXml1.setAddress(addressXml1);
|
|
|
1511
|
-// DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
|
|
|
1512
|
-// communicationXml3.setId(billEntity.getSenderContactNo());
|
|
|
1513
|
-// communicationXml3.setTypeID(billEntity.getSenderContactType());
|
|
|
1514
|
-// consigneeXml1.setCommunication(communicationXml3);
|
|
|
1515
|
-// consignmentXml.setConsignor(consigneeXml1);
|
|
|
1516
|
-//
|
|
|
1517
|
-// //通知人
|
|
|
1518
|
-// DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
|
|
|
1519
|
-// consigneeXml2.setId(billEntity.getNotifierCode());
|
|
|
1520
|
-// consigneeXml2.setName(billEntity.getNotifier());
|
|
|
1521
|
-// addressXml.setLine(billEntity.getNotifierAddress());
|
|
|
1522
|
-// addressXml.setCityName(billEntity.getNotifierCity());
|
|
|
1523
|
-// addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
|
|
|
1524
|
-// addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
|
|
|
1525
|
-// addressXml.setPostcodeID(billEntity.getNotifierPostCode());
|
|
|
1526
|
-// addressXml.setCountryCode(billEntity.getNotifierCountryCode());
|
|
|
1527
|
-// consigneeXml2.setAddress(addressXml);
|
|
|
1528
|
-// DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
|
|
|
1529
|
-// communicationXml4.setId(billEntity.getNotifierContact());
|
|
|
1530
|
-// communicationXml4.setTypeID(billEntity.getNotifierContactCode());
|
|
|
1531
|
-// consigneeXml2.setCommunication(communicationXml4);
|
|
|
1532
|
-// consignmentXml.setNotifyParty(consigneeXml2);
|
|
|
1533
|
-//
|
|
|
1534
|
-// //危险品联系人
|
|
|
1535
|
-// DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
|
|
|
1536
|
-// dgXml.setName(billEntity.getDangerContact());
|
|
|
1537
|
-// DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
|
|
|
1538
|
-// communicationXml5.setId(billEntity.getDangerContactNo());
|
|
|
1539
|
-// communicationXml5.setTypeID(billEntity.getDangerContactType());
|
|
|
1540
|
-// dgXml.setCommunication(communicationXml5);
|
|
|
1541
|
-// consignmentXml.setuNDGContact(dgXml);
|
|
|
1542
|
-//
|
|
|
1543
|
-// //商品信息
|
|
|
1544
|
-// DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
|
|
|
1545
|
-// itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
|
|
|
1546
|
-// DeclareConsignmentItemPackagingXml itemPackagingXml = new DeclareConsignmentItemPackagingXml();
|
|
|
1547
|
-// itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
|
|
|
1548
|
-// itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
|
|
|
1549
|
-// itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
|
|
|
1550
|
-// itemXml.setConsignmentItemPackaging(itemPackagingXml);
|
|
|
1551
|
-//
|
|
|
1552
|
-// DeclareCommodityXml commodityXml = new DeclareCommodityXml();
|
|
|
1553
|
-// commodityXml.setCargoDescription(commodityEntity.getSummary());
|
|
|
1554
|
-// commodityXml.setuNDGCode(commodityEntity.getDangerNo());
|
|
|
1555
|
-// commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
|
|
|
1556
|
-//
|
|
|
1557
|
-// ContentXml contentXml = new ContentXml();
|
|
|
1558
|
-// contentXml.setContent(commodityEntity.getRemark());
|
|
|
1559
|
-// itemXml.setAdditionalInformation(contentXml);
|
|
|
1560
|
-//
|
|
|
1561
|
-// DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
|
|
|
1562
|
-// goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
|
|
|
1563
|
-// itemXml.setGoodsMeasure(goodsMeasureXml);
|
|
|
1564
|
-//
|
|
|
1565
|
-// DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
|
|
|
1566
|
-// procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
|
|
|
1567
|
-// itemXml.setCustomsProcedure(procedureXml);
|
|
|
1568
|
-//
|
|
|
1569
|
-// idXml.setId(commodityEntity.getConsign());
|
|
|
1570
|
-// itemXml.setuCR(idXml);
|
|
|
1571
|
-//
|
|
|
1572
|
-// DeclareOriginXml originXml = new DeclareOriginXml();
|
|
|
1573
|
-// originXml.setOriginCountryCode(commodityEntity.getOriginCode());
|
|
|
1574
|
-// itemXml.setOrigin(originXml);
|
|
|
1575
|
-// consignmentXml.setConsignmentItem(itemXml);
|
|
|
1576
|
-//
|
|
|
1577
|
-// manifestXml.setConsignment(consignmentXml);
|
|
|
1578
|
-//
|
|
|
1579
|
-// contentXml.setContent(manifestEntity.getRemark());
|
|
|
1580
|
-// manifestXml.setAdditionalInformation(contentXml);
|
|
|
1581
|
-//
|
|
|
1582
|
-// body.setDeclaration(manifestXml);
|
|
|
1583
|
-// String xml = XmlUtil.convertToXml2(body, path);
|
|
|
1584
|
-// return xml;
|
|
|
1585
|
-// }
|
|
|
1586
|
-
|
|
|
1587
|
-
|
1367
|
+ // private String beanToXml(String path,Long id){
|
|
|
1368
|
+ // ManifestEntity manifestEntity = manifestService.findOne(id);
|
|
|
1369
|
+ //
|
|
|
1370
|
+ // if(manifestEntity==null){
|
|
|
1371
|
+ // manifestEntity = new ManifestEntity();
|
|
|
1372
|
+ // }
|
|
|
1373
|
+ // List<ManifestBillEntity> billList = null;
|
|
|
1374
|
+ // ManifestBillEntity billEntity = new ManifestBillEntity();
|
|
|
1375
|
+ // ManifestCommodityEntity commodityEntity = new ManifestCommodityEntity();
|
|
|
1376
|
+ // ManifestContainerEntity containerEntity = new ManifestContainerEntity();
|
|
|
1377
|
+ // if(manifestEntity.getId()!=null){
|
|
|
1378
|
+ // billList = billService.findByManifestId(manifestEntity.getId());
|
|
|
1379
|
+ // }
|
|
|
1380
|
+ // if(CollectionUtils.isNotEmpty(billList)){
|
|
|
1381
|
+ // billEntity = billList.get(0);
|
|
|
1382
|
+ // }
|
|
|
1383
|
+ // List<ManifestCommodityEntity> commodities = null;
|
|
|
1384
|
+ // if(billEntity.getId()!=null){
|
|
|
1385
|
+ // commodities = commodityService.findByBillId(billEntity.getId());
|
|
|
1386
|
+ // }
|
|
|
1387
|
+ // if(CollectionUtils.isNotEmpty(commodities)){
|
|
|
1388
|
+ // commodityEntity = commodities.get(0);
|
|
|
1389
|
+ // }
|
|
|
1390
|
+ //
|
|
|
1391
|
+ // DeclareXmlBody body = new DeclareXmlBody();
|
|
|
1392
|
+ //
|
|
|
1393
|
+ // XmlHead head = new XmlHead();
|
|
|
1394
|
+ // head.setMessageID(id==null?"":id.toString());
|
|
|
1395
|
+ // head.setMessageType("Manifest");
|
|
|
1396
|
+ // head.setSenderID(SessionUtil.getUser().getId().toString());
|
|
|
1397
|
+ // head.setSendTime(Constant.dateFormat.format(new Date()));
|
|
|
1398
|
+ // head.setFunctionCode("");
|
|
|
1399
|
+ // head.setReceiverID(SessionUtil.getUser().getId().toString());
|
|
|
1400
|
+ // head.setVersion("1.0");
|
|
|
1401
|
+ // body.setHead(head);
|
|
|
1402
|
+ //
|
|
|
1403
|
+ // DeclareManifestXml manifestXml = new DeclareManifestXml();
|
|
|
1404
|
+ //
|
|
|
1405
|
+ // NameXml nameXml = new NameXml();
|
|
|
1406
|
+ // nameXml.setName(manifestEntity.getTransferName());
|
|
|
1407
|
+ // manifestXml.setRepresentativePerson(nameXml);
|
|
|
1408
|
+ //
|
|
|
1409
|
+ // IDXml idXml = new IDXml();
|
|
|
1410
|
+ // idXml.setId(manifestEntity.getLeaveCode());
|
|
|
1411
|
+ // manifestXml.setExitCustomsOffice(idXml);
|
|
|
1412
|
+ //
|
|
|
1413
|
+ // IDXml idXml1 = new IDXml();
|
|
|
1414
|
+ // idXml1.setId(manifestEntity.getAgentCompanyCode());
|
|
|
1415
|
+ // manifestXml.setAgent(idXml1);
|
|
|
1416
|
+ //
|
|
|
1417
|
+ // IDXml idXml2 = new IDXml();
|
|
|
1418
|
+ // idXml2.setId(manifestEntity.getCarrierCode());
|
|
|
1419
|
+ // manifestXml.setCarrier(idXml2);
|
|
|
1420
|
+ //
|
|
|
1421
|
+ // DeclareBorderTransportMeansXml transportMeansXml = new
|
|
|
1422
|
+ // DeclareBorderTransportMeansXml();
|
|
|
1423
|
+ // transportMeansXml.setJourneyID(manifestEntity.getVoyageNo());
|
|
|
1424
|
+ // transportMeansXml.setTypeCode(manifestEntity.getModeCode());
|
|
|
1425
|
+ // transportMeansXml.setId(manifestEntity.getToolCode());
|
|
|
1426
|
+ // transportMeansXml.setName(manifestEntity.getToolName());
|
|
|
1427
|
+ // transportMeansXml.setFirstArrivalLocationID(manifestEntity.getFirstPortCode());
|
|
|
1428
|
+ // transportMeansXml.setArrivalDateTime(manifestEntity.getFirstPortDate()!=null?Constant.dateFormat.format(manifestEntity.getFirstPortDate()):"");
|
|
|
1429
|
+ // transportMeansXml.setDepartureDateTime(manifestEntity.getDepartureDate()!=null?Constant.dateFormat.format(manifestEntity.getDepartureDate()):"");
|
|
|
1430
|
+ //
|
|
|
1431
|
+ // DeclareConsignmentXml consignmentXml = new DeclareConsignmentXml();
|
|
|
1432
|
+ //
|
|
|
1433
|
+ // DeclareTransportContractDocumentXml contractDocumentXml = new
|
|
|
1434
|
+ // DeclareTransportContractDocumentXml();
|
|
|
1435
|
+ //
|
|
|
1436
|
+ // contractDocumentXml.setId(billEntity.getLadingNo());
|
|
|
1437
|
+ // contractDocumentXml.setChangeReasonCode(billEntity.getModifyReasonCode());
|
|
|
1438
|
+ // contractDocumentXml.setConditionCode(billEntity.getTransportCode());
|
|
|
1439
|
+ // consignmentXml.setTransportContractDocument(contractDocumentXml);
|
|
|
1440
|
+ //
|
|
|
1441
|
+ // IDXml idXml3 = new IDXml();
|
|
|
1442
|
+ // idXml3.setId(billEntity.getSubLadingNo());
|
|
|
1443
|
+ // consignmentXml.setAssociatedTransportDocument(idXml3);
|
|
|
1444
|
+ //
|
|
|
1445
|
+ // consignmentXml.setGrossVolumeMeasure(billEntity.getVolume()!=null?billEntity.getVolume().toString():"");
|
|
|
1446
|
+ // consignmentXml.setValueAmount(billEntity.getCashType());
|
|
|
1447
|
+ //
|
|
|
1448
|
+ // DeclareLoadingLocationXml loadingLocationXml = new
|
|
|
1449
|
+ // DeclareLoadingLocationXml();
|
|
|
1450
|
+ // loadingLocationXml.setId(billEntity.getEncasementCode());
|
|
|
1451
|
+ // loadingLocationXml.setLoadingDate(billEntity.getCarryVehicleTime());
|
|
|
1452
|
+ // consignmentXml.setLoadingLocation(loadingLocationXml);
|
|
|
1453
|
+ //
|
|
|
1454
|
+ // DeclareUnloadingLocationXml unloadingLocationXml = new
|
|
|
1455
|
+ // DeclareUnloadingLocationXml();
|
|
|
1456
|
+ // unloadingLocationXml.setId(billEntity.getUnlodingCode());
|
|
|
1457
|
+ // unloadingLocationXml.setArrivalDate(billEntity.getArrivalDate()!=null?Constant.dateFormat.format(billEntity.getArrivalDate()):"");
|
|
|
1458
|
+ // consignmentXml.setUnloadingLocation(unloadingLocationXml);
|
|
|
1459
|
+ //
|
|
|
1460
|
+ // DeclareGoodsReceiptPlaceXml receiptPlaceXml = new
|
|
|
1461
|
+ // DeclareGoodsReceiptPlaceXml();
|
|
|
1462
|
+ //
|
|
|
1463
|
+ // receiptPlaceXml.setId(billEntity.getReceiveCode());
|
|
|
1464
|
+ // receiptPlaceXml.setName(billEntity.getReceiveName());
|
|
|
1465
|
+ // consignmentXml.setGoodsReceiptPlace(receiptPlaceXml);
|
|
|
1466
|
+ //
|
|
|
1467
|
+ // IDXml idXml4 = new IDXml();
|
|
|
1468
|
+ // idXml4.setId(billEntity.getTransitCode());
|
|
|
1469
|
+ // consignmentXml.setTranshipmentLocation(idXml4);
|
|
|
1470
|
+ //
|
|
|
1471
|
+ // IDXml idXml5 = new IDXml();
|
|
|
1472
|
+ // idXml5.setId(billEntity.getTransitDestinationCode());
|
|
|
1473
|
+ // consignmentXml.setTransitDestination(idXml5);
|
|
|
1474
|
+ //
|
|
|
1475
|
+ // consignmentXml.setRoutingCountryCode(billEntity.getTransitCountryCode());
|
|
|
1476
|
+ //
|
|
|
1477
|
+ // IDXml idXml6 = new IDXml();
|
|
|
1478
|
+ // idXml6.setId(billEntity.getConsignLocation());
|
|
|
1479
|
+ // consignmentXml.setGoodsConsignedPlace(idXml6);
|
|
|
1480
|
+ //
|
|
|
1481
|
+ // consignmentXml.setCustomsStatusCode(billEntity.getCustomsStatusCode());
|
|
|
1482
|
+ // consignmentXml.setTransportSplitIndicator(billEntity.getSendSign());
|
|
|
1483
|
+ //
|
|
|
1484
|
+ // DeclareMethodCodeXml methodCodeXml = new DeclareMethodCodeXml();
|
|
|
1485
|
+ // methodCodeXml.setMethodCode(billEntity.getPaymentMethod());
|
|
|
1486
|
+ // consignmentXml.setFreightPayment(methodCodeXml);
|
|
|
1487
|
+ //
|
|
|
1488
|
+ // DeclareConsignmentPackagingXml packagingXml = new
|
|
|
1489
|
+ // DeclareConsignmentPackagingXml();
|
|
|
1490
|
+ // packagingXml.setTypeCode(billEntity.getPackageType());
|
|
|
1491
|
+ // packagingXml.setQuantityQuantity(billEntity.getPieces()!=null?billEntity.getPieces().toString():"");
|
|
|
1492
|
+ // consignmentXml.setConsignmentPackaging(packagingXml);
|
|
|
1493
|
+ //
|
|
|
1494
|
+ // consignmentXml.setTotalGrossMassMeasure(billEntity.getTotalGrossWeight()!=null?billEntity.getTotalGrossWeight().toString():"");
|
|
|
1495
|
+ //
|
|
|
1496
|
+ // DeclarePreviousCustomsDocumentXml documentXml = new
|
|
|
1497
|
+ // DeclarePreviousCustomsDocumentXml();
|
|
|
1498
|
+ // documentXml.setId(billEntity.getPreviousCustomsNo());
|
|
|
1499
|
+ // documentXml.setTypeCode(billEntity.getPreviousCustomsType());
|
|
|
1500
|
+ // consignmentXml.setPreviousCustomsDocument(documentXml);
|
|
|
1501
|
+ //
|
|
|
1502
|
+ // DeclareDeliveryDestinationXml deliveryDestinationXml = new
|
|
|
1503
|
+ // DeclareDeliveryDestinationXml();
|
|
|
1504
|
+ // deliveryDestinationXml.setLine(billEntity.getDeliverDestination());
|
|
|
1505
|
+ // deliveryDestinationXml.setCityName(billEntity.getDeliverCity());
|
|
|
1506
|
+ // deliveryDestinationXml.setCountrySubEntityName(billEntity.getDeliverProvinceCode());
|
|
|
1507
|
+ // deliveryDestinationXml.setPostcodeID(billEntity.getDeliverPostCode());
|
|
|
1508
|
+ // deliveryDestinationXml.setCountryCode(billEntity.getDeliverCountryCode());
|
|
|
1509
|
+ // consignmentXml.setDeliveryDestination(deliveryDestinationXml);
|
|
|
1510
|
+ //
|
|
|
1511
|
+ // DeclareIntermediateCarrierXml intermediateCarrierXml = new
|
|
|
1512
|
+ // DeclareIntermediateCarrierXml();
|
|
|
1513
|
+ // intermediateCarrierXml.setId(billEntity.getCarrierSign());
|
|
|
1514
|
+ // DeclareCommunicationXml communicationXml = new DeclareCommunicationXml();
|
|
|
1515
|
+ // communicationXml.setId(billEntity.getCarrierContactNo());
|
|
|
1516
|
+ // communicationXml.setTypeID(billEntity.getCarrierContactType());
|
|
|
1517
|
+ // intermediateCarrierXml.setCommunication(communicationXml);
|
|
|
1518
|
+ // consignmentXml.setIntermediateCarrier(intermediateCarrierXml);
|
|
|
1519
|
+ //
|
|
|
1520
|
+ // //收货人
|
|
|
1521
|
+ // DeclareConsigneeXml consigneeXml = new DeclareConsigneeXml();
|
|
|
1522
|
+ // consigneeXml.setId(billEntity.getReceiverCode());
|
|
|
1523
|
+ // consigneeXml.setName(billEntity.getReceiverName());
|
|
|
1524
|
+ //
|
|
|
1525
|
+ // DeclareAddressXml addressXml = new DeclareAddressXml();
|
|
|
1526
|
+ // addressXml.setLine(billEntity.getReceiverAddress());
|
|
|
1527
|
+ // addressXml.setCityName(billEntity.getReceiverCity());
|
|
|
1528
|
+ // addressXml.setCountrySubEntityID(billEntity.getReceiverProvinceCode());
|
|
|
1529
|
+ // addressXml.setCountrySubEntityName(billEntity.getReceiverProvince());
|
|
|
1530
|
+ // addressXml.setCountryCode(billEntity.getReceiverCountryCode());
|
|
|
1531
|
+ // addressXml.setPostcodeID(billEntity.getReceiverPostCode());
|
|
|
1532
|
+ // consigneeXml.setAddress(addressXml);
|
|
|
1533
|
+ // DeclareCommunicationXml communicationXml1 = new DeclareCommunicationXml();
|
|
|
1534
|
+ // communicationXml1.setId(billEntity.getReceiverContactNo());
|
|
|
1535
|
+ // communicationXml1.setTypeID(billEntity.getReceiverContactType());
|
|
|
1536
|
+ // consigneeXml.setCommunication(communicationXml1);
|
|
|
1537
|
+ //
|
|
|
1538
|
+ // DeclareContactXml contactXml = new DeclareContactXml();
|
|
|
1539
|
+ // contactXml.setName(billEntity.getReceiverName());
|
|
|
1540
|
+ // DeclareCommunicationXml communicationXml2 = new DeclareCommunicationXml();
|
|
|
1541
|
+ // communicationXml2.setId(billEntity.getReceiverContactNo());
|
|
|
1542
|
+ // communicationXml2.setTypeID(billEntity.getReceiverContactType());
|
|
|
1543
|
+ // contactXml.setCommunication(communicationXml2);
|
|
|
1544
|
+ // consigneeXml.setContact(contactXml);
|
|
|
1545
|
+ //
|
|
|
1546
|
+ // consignmentXml.setConsignee(consigneeXml);
|
|
|
1547
|
+ //
|
|
|
1548
|
+ // //发货人
|
|
|
1549
|
+ // DeclareConsigneeXml consigneeXml1 = new DeclareConsigneeXml();
|
|
|
1550
|
+ // consigneeXml1.setId(billEntity.getSenderCode());
|
|
|
1551
|
+ // consigneeXml1.setName(billEntity.getSenderName());
|
|
|
1552
|
+ // DeclareAddressXml addressXml1 = new DeclareAddressXml();
|
|
|
1553
|
+ // addressXml1.setLine(billEntity.getSenderAddress());
|
|
|
1554
|
+ // addressXml1.setCityName(billEntity.getSenderCity());
|
|
|
1555
|
+ // addressXml1.setCountrySubEntityID(billEntity.getSenderProvinceCode());
|
|
|
1556
|
+ // addressXml1.setCountrySubEntityName(billEntity.getSenderProvince());
|
|
|
1557
|
+ // addressXml1.setPostcodeID(billEntity.getSenderPostCode());
|
|
|
1558
|
+ // addressXml1.setCountryCode(billEntity.getSenderCountryCode());
|
|
|
1559
|
+ // consigneeXml1.setAddress(addressXml1);
|
|
|
1560
|
+ // DeclareCommunicationXml communicationXml3 = new DeclareCommunicationXml();
|
|
|
1561
|
+ // communicationXml3.setId(billEntity.getSenderContactNo());
|
|
|
1562
|
+ // communicationXml3.setTypeID(billEntity.getSenderContactType());
|
|
|
1563
|
+ // consigneeXml1.setCommunication(communicationXml3);
|
|
|
1564
|
+ // consignmentXml.setConsignor(consigneeXml1);
|
|
|
1565
|
+ //
|
|
|
1566
|
+ // //通知人
|
|
|
1567
|
+ // DeclareConsigneeXml consigneeXml2 = new DeclareConsigneeXml();
|
|
|
1568
|
+ // consigneeXml2.setId(billEntity.getNotifierCode());
|
|
|
1569
|
+ // consigneeXml2.setName(billEntity.getNotifier());
|
|
|
1570
|
+ // addressXml.setLine(billEntity.getNotifierAddress());
|
|
|
1571
|
+ // addressXml.setCityName(billEntity.getNotifierCity());
|
|
|
1572
|
+ // addressXml.setCountrySubEntityID(billEntity.getNotifierProvinceCode());
|
|
|
1573
|
+ // addressXml.setCountrySubEntityName(billEntity.getNotifierProvince());
|
|
|
1574
|
+ // addressXml.setPostcodeID(billEntity.getNotifierPostCode());
|
|
|
1575
|
+ // addressXml.setCountryCode(billEntity.getNotifierCountryCode());
|
|
|
1576
|
+ // consigneeXml2.setAddress(addressXml);
|
|
|
1577
|
+ // DeclareCommunicationXml communicationXml4 = new DeclareCommunicationXml();
|
|
|
1578
|
+ // communicationXml4.setId(billEntity.getNotifierContact());
|
|
|
1579
|
+ // communicationXml4.setTypeID(billEntity.getNotifierContactCode());
|
|
|
1580
|
+ // consigneeXml2.setCommunication(communicationXml4);
|
|
|
1581
|
+ // consignmentXml.setNotifyParty(consigneeXml2);
|
|
|
1582
|
+ //
|
|
|
1583
|
+ // //危险品联系人
|
|
|
1584
|
+ // DeclareUNDGContactXml dgXml = new DeclareUNDGContactXml();
|
|
|
1585
|
+ // dgXml.setName(billEntity.getDangerContact());
|
|
|
1586
|
+ // DeclareCommunicationXml communicationXml5 = new DeclareCommunicationXml();
|
|
|
1587
|
+ // communicationXml5.setId(billEntity.getDangerContactNo());
|
|
|
1588
|
+ // communicationXml5.setTypeID(billEntity.getDangerContactType());
|
|
|
1589
|
+ // dgXml.setCommunication(communicationXml5);
|
|
|
1590
|
+ // consignmentXml.setuNDGContact(dgXml);
|
|
|
1591
|
+ //
|
|
|
1592
|
+ // //商品信息
|
|
|
1593
|
+ // DeclareConsignmentItemXml itemXml = new DeclareConsignmentItemXml();
|
|
|
1594
|
+ // itemXml.setSequenceNumeric(commodityEntity.getSerialNo());
|
|
|
1595
|
+ // DeclareConsignmentItemPackagingXml itemPackagingXml = new
|
|
|
1596
|
+ // DeclareConsignmentItemPackagingXml();
|
|
|
1597
|
+ // itemPackagingXml.setQuantityQuantity(commodityEntity.getPieces()!=null?commodityEntity.getPieces().toString():"");
|
|
|
1598
|
+ // itemPackagingXml.setTypeCode(commodityEntity.getPackageType());
|
|
|
1599
|
+ // itemPackagingXml.setMarksNumbers(commodityEntity.getMark());
|
|
|
1600
|
+ // itemXml.setConsignmentItemPackaging(itemPackagingXml);
|
|
|
1601
|
+ //
|
|
|
1602
|
+ // DeclareCommodityXml commodityXml = new DeclareCommodityXml();
|
|
|
1603
|
+ // commodityXml.setCargoDescription(commodityEntity.getSummary());
|
|
|
1604
|
+ // commodityXml.setuNDGCode(commodityEntity.getDangerNo());
|
|
|
1605
|
+ // commodityXml.setTariffClassificationCode(commodityEntity.getTariffNo());
|
|
|
1606
|
+ //
|
|
|
1607
|
+ // ContentXml contentXml = new ContentXml();
|
|
|
1608
|
+ // contentXml.setContent(commodityEntity.getRemark());
|
|
|
1609
|
+ // itemXml.setAdditionalInformation(contentXml);
|
|
|
1610
|
+ //
|
|
|
1611
|
+ // DeclareGoodsMeasureXml goodsMeasureXml = new DeclareGoodsMeasureXml();
|
|
|
1612
|
+ // goodsMeasureXml.setGrossMassMeasure(commodityEntity.getGrossWeight()!=null?commodityEntity.getGrossWeight().toString():"");
|
|
|
1613
|
+ // itemXml.setGoodsMeasure(goodsMeasureXml);
|
|
|
1614
|
+ //
|
|
|
1615
|
+ // DeclareCustomsProcedureXml procedureXml = new DeclareCustomsProcedureXml();
|
|
|
1616
|
+ // procedureXml.setCurrentCode(commodityEntity.getProcedureCode());
|
|
|
1617
|
+ // itemXml.setCustomsProcedure(procedureXml);
|
|
|
1618
|
+ //
|
|
|
1619
|
+ // idXml.setId(commodityEntity.getConsign());
|
|
|
1620
|
+ // itemXml.setuCR(idXml);
|
|
|
1621
|
+ //
|
|
|
1622
|
+ // DeclareOriginXml originXml = new DeclareOriginXml();
|
|
|
1623
|
+ // originXml.setOriginCountryCode(commodityEntity.getOriginCode());
|
|
|
1624
|
+ // itemXml.setOrigin(originXml);
|
|
|
1625
|
+ // consignmentXml.setConsignmentItem(itemXml);
|
|
|
1626
|
+ //
|
|
|
1627
|
+ // manifestXml.setConsignment(consignmentXml);
|
|
|
1628
|
+ //
|
|
|
1629
|
+ // contentXml.setContent(manifestEntity.getRemark());
|
|
|
1630
|
+ // manifestXml.setAdditionalInformation(contentXml);
|
|
|
1631
|
+ //
|
|
|
1632
|
+ // body.setDeclaration(manifestXml);
|
|
|
1633
|
+ // String xml = XmlUtil.convertToXml2(body, path);
|
|
|
1634
|
+ // return xml;
|
|
|
1635
|
+ // }
|
1588
|
|
1636
|
|
1589
|
/**
|
1637
|
/**
|
1590
|
* 保存
|
1638
|
* 保存
|
|
@@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{ |
|
@@ -1593,17 +1641,17 @@ public class ManifestController extends BasicController{ |
1593
|
* @return
|
1641
|
* @return
|
1594
|
*/
|
1642
|
*/
|
1595
|
@ResponseBody
|
1643
|
@ResponseBody
|
1596
|
- @RequestMapping(value = "/bill/save",method = RequestMethod.POST)
|
|
|
1597
|
- public ResponseModel saveBill(String billJson,String voJson){
|
1644
|
+ @RequestMapping(value = "/bill/save", method = RequestMethod.POST)
|
|
|
1645
|
+ public ResponseModel saveBill(String billJson, String voJson) {
|
1598
|
ResponseModel model = new ResponseModel();
|
1646
|
ResponseModel model = new ResponseModel();
|
1599
|
try {
|
1647
|
try {
|
1600
|
- ManifestBillEntity bill = JSONObject.parseObject(billJson,ManifestBillEntity.class);
|
|
|
1601
|
- List<CommodityVo> voList = JSONArray.parseArray(voJson,CommodityVo.class);
|
|
|
1602
|
- bill = billService.save(bill,voList);
|
1648
|
+ ManifestBillEntity bill = JSONObject.parseObject(billJson, ManifestBillEntity.class);
|
|
|
1649
|
+ List<CommodityVo> voList = JSONArray.parseArray(voJson, CommodityVo.class);
|
|
|
1650
|
+ bill = billService.save(bill, voList);
|
1603
|
model.setData(bill.getManifestId());
|
1651
|
model.setData(bill.getManifestId());
|
1604
|
model.setStatus(200);
|
1652
|
model.setStatus(200);
|
1605
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
1653
|
model.setMsg(HttpJsonMsg.SUCCESS);
|
1606
|
- }catch (Exception e){
|
1654
|
+ } catch (Exception e) {
|
1607
|
model.setStatus(500);
|
1655
|
model.setStatus(500);
|
1608
|
model.setMsg(HttpJsonMsg.ERROR);
|
1656
|
model.setMsg(HttpJsonMsg.ERROR);
|
1609
|
logger.error("系统异常 >>", e);
|
1657
|
logger.error("系统异常 >>", e);
|
|
@@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{ |
|
@@ -1611,32 +1659,31 @@ public class ManifestController extends BasicController{ |
1611
|
|
1659
|
|
1612
|
return model;
|
1660
|
return model;
|
1613
|
}
|
1661
|
}
|
|
|
1662
|
+
|
1614
|
/*
|
1663
|
/*
|
1615
|
* 获取3字码对应的信息,然后自动填写上
|
1664
|
* 获取3字码对应的信息,然后自动填写上
|
1616
|
*/
|
1665
|
*/
|
1617
|
@RequestMapping("/gettreecode")
|
1666
|
@RequestMapping("/gettreecode")
|
1618
|
@ResponseBody
|
1667
|
@ResponseBody
|
1619
|
- public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE){
|
1668
|
+ public ResponseModel gettreecode(HttpServletRequest request, String STOCKPRE) {
|
1620
|
ResponseModel model = new ResponseModel(1, null, "");
|
1669
|
ResponseModel model = new ResponseModel(1, null, "");
|
1621
|
|
1670
|
|
1622
|
- //这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
|
|
|
1623
|
-// List<TBasCarrierEntity> tbc = tbasService.findAll();
|
|
|
1624
|
-// for(int i = 0; i < tbc.size(); i ++)
|
|
|
1625
|
-// {
|
|
|
1626
|
-// }
|
|
|
1627
|
-// model.setData(tbc);
|
|
|
1628
|
- if(STOCKPRE != null)
|
|
|
1629
|
- {
|
1671
|
+ // 这种方法获取到了对象的数量,但是获取不到对象本省,有问题,暂时不用这种方法
|
|
|
1672
|
+ // List<TBasCarrierEntity> tbc = tbasService.findAll();
|
|
|
1673
|
+ // for(int i = 0; i < tbc.size(); i ++)
|
|
|
1674
|
+ // {
|
|
|
1675
|
+ // }
|
|
|
1676
|
+ // model.setData(tbc);
|
|
|
1677
|
+ if (STOCKPRE != null) {
|
1630
|
Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2");
|
1678
|
Connection c = DBConnection.dbConn("CGOASM", "vmvnv1v2");
|
1631
|
- //List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
|
1679
|
+ // List<TBasCarrierEntity> list = new ArrayList<TBasCarrierEntity>();
|
1632
|
Statement sql;
|
1680
|
Statement sql;
|
1633
|
try {
|
1681
|
try {
|
1634
|
sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
|
1682
|
sql = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
|
1635
|
- String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='"+STOCKPRE+"'";
|
1683
|
+ String sqlStr = "SELECT * FROM T_BAS_CARRIER WHERE STOCKPRE='" + STOCKPRE + "'";
|
1636
|
ResultSet rs = sql.executeQuery(sqlStr);
|
1684
|
ResultSet rs = sql.executeQuery(sqlStr);
|
1637
|
|
1685
|
|
1638
|
- while(rs.next())
|
|
|
1639
|
- {
|
1686
|
+ while (rs.next()) {
|
1640
|
TBasCarrierEntity tbs = new TBasCarrierEntity();
|
1687
|
TBasCarrierEntity tbs = new TBasCarrierEntity();
|
1641
|
tbs.setcARRIERID(rs.getString(1));
|
1688
|
tbs.setcARRIERID(rs.getString(1));
|
1642
|
tbs.setsTOCKPRE(rs.getString(2));
|
1689
|
tbs.setsTOCKPRE(rs.getString(2));
|
|
@@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{ |
|
@@ -1646,8 +1693,8 @@ public class ManifestController extends BasicController{ |
1646
|
tbs.setcARRYWAY(rs.getString(6));
|
1693
|
tbs.setcARRYWAY(rs.getString(6));
|
1647
|
tbs.setoPERATIONTIME(rs.getString(7));
|
1694
|
tbs.setoPERATIONTIME(rs.getString(7));
|
1648
|
tbs.setiSFOREIGN(rs.getString(8));
|
1695
|
tbs.setiSFOREIGN(rs.getString(8));
|
1649
|
- //tbs.setfREQORDERING(rs.getInt(9));
|
|
|
1650
|
- //tbs.setId(rs.getInt(9)));
|
1696
|
+ // tbs.setfREQORDERING(rs.getInt(9));
|
|
|
1697
|
+ // tbs.setId(rs.getInt(9)));
|
1651
|
model.setData(tbs);
|
1698
|
model.setData(tbs);
|
1652
|
}
|
1699
|
}
|
1653
|
} catch (SQLException e) {
|
1700
|
} catch (SQLException e) {
|
|
@@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{ |
|
@@ -1659,38 +1706,39 @@ public class ManifestController extends BasicController{ |
1659
|
|
1706
|
|
1660
|
return model;
|
1707
|
return model;
|
1661
|
}
|
1708
|
}
|
|
|
1709
|
+
|
1662
|
/**
|
1710
|
/**
|
1663
|
* 获取商品信息
|
1711
|
* 获取商品信息
|
|
|
1712
|
+ *
|
1664
|
* @param billId
|
1713
|
* @param billId
|
1665
|
* @return
|
1714
|
* @return
|
1666
|
*/
|
1715
|
*/
|
1667
|
@ResponseBody
|
1716
|
@ResponseBody
|
1668
|
- @RequestMapping(value = "/commodity/get",method = RequestMethod.POST)
|
|
|
1669
|
- public String getCommodity(Long billId){
|
|
|
1670
|
- return JSON.toJSONString(commodityService.getCommodityVos(billId),filter);
|
1717
|
+ @RequestMapping(value = "/commodity/get", method = RequestMethod.POST)
|
|
|
1718
|
+ public String getCommodity(Long billId) {
|
|
|
1719
|
+ return JSON.toJSONString(commodityService.getCommodityVos(billId), filter);
|
1671
|
}
|
1720
|
}
|
1672
|
|
1721
|
|
1673
|
-
|
|
|
1674
|
/**
|
1722
|
/**
|
1675
|
* 编辑商品信息
|
1723
|
* 编辑商品信息
|
|
|
1724
|
+ *
|
1676
|
* @param id
|
1725
|
* @param id
|
1677
|
* @return
|
1726
|
* @return
|
1678
|
*/
|
1727
|
*/
|
1679
|
@RequestMapping(value = "/commodity/edit")
|
1728
|
@RequestMapping(value = "/commodity/edit")
|
1680
|
- public String getContainer(Long id,Model model){
|
1729
|
+ public String getContainer(Long id, Model model) {
|
1681
|
CommodityVo vo = new CommodityVo();
|
1730
|
CommodityVo vo = new CommodityVo();
|
1682
|
- model.addAttribute("vo",vo);
|
1731
|
+ model.addAttribute("vo", vo);
|
1683
|
return "manifest/edit_commodity";
|
1732
|
return "manifest/edit_commodity";
|
1684
|
}
|
1733
|
}
|
1685
|
|
1734
|
|
1686
|
-
|
|
|
1687
|
-
|
|
|
1688
|
/**
|
1735
|
/**
|
1689
|
* 删除
|
1736
|
* 删除
|
|
|
1737
|
+ *
|
1690
|
* @param ids
|
1738
|
* @param ids
|
1691
|
* @return
|
1739
|
* @return
|
1692
|
*/
|
1740
|
*/
|
1693
|
- @RequestMapping(value = "/delete" , method = {RequestMethod.POST })
|
1741
|
+ @RequestMapping(value = "/delete", method = { RequestMethod.POST })
|
1694
|
@ResponseBody
|
1742
|
@ResponseBody
|
1695
|
public ResponseModel delete(String ids) {
|
1743
|
public ResponseModel delete(String ids) {
|
1696
|
ResponseModel model = new ResponseModel();
|
1744
|
ResponseModel model = new ResponseModel();
|
|
@@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{ |
|
@@ -1708,10 +1756,11 @@ public class ManifestController extends BasicController{ |
1708
|
|
1756
|
|
1709
|
/**
|
1757
|
/**
|
1710
|
* 删除
|
1758
|
* 删除
|
|
|
1759
|
+ *
|
1711
|
* @param ids
|
1760
|
* @param ids
|
1712
|
* @return
|
1761
|
* @return
|
1713
|
*/
|
1762
|
*/
|
1714
|
- @RequestMapping(value = "/subdelete" , method = {RequestMethod.POST })
|
1763
|
+ @RequestMapping(value = "/subdelete", method = { RequestMethod.POST })
|
1715
|
@ResponseBody
|
1764
|
@ResponseBody
|
1716
|
public ResponseModel subdelete(Long id) {
|
1765
|
public ResponseModel subdelete(Long id) {
|
1717
|
ResponseModel model = new ResponseModel();
|
1766
|
ResponseModel model = new ResponseModel();
|
|
@@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{ |
|
@@ -1727,14 +1776,13 @@ public class ManifestController extends BasicController{ |
1727
|
return model;
|
1776
|
return model;
|
1728
|
}
|
1777
|
}
|
1729
|
|
1778
|
|
1730
|
-
|
|
|
1731
|
-
|
|
|
1732
|
/**
|
1779
|
/**
|
1733
|
* 删除
|
1780
|
* 删除
|
|
|
1781
|
+ *
|
1734
|
* @param id
|
1782
|
* @param id
|
1735
|
* @return
|
1783
|
* @return
|
1736
|
*/
|
1784
|
*/
|
1737
|
- @RequestMapping(value = "/bill/delete" , method = {RequestMethod.POST })
|
1785
|
+ @RequestMapping(value = "/bill/delete", method = { RequestMethod.POST })
|
1738
|
@ResponseBody
|
1786
|
@ResponseBody
|
1739
|
public ResponseModel deleteBill(Long id) {
|
1787
|
public ResponseModel deleteBill(Long id) {
|
1740
|
ResponseModel model = new ResponseModel();
|
1788
|
ResponseModel model = new ResponseModel();
|
|
@@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{ |
|
@@ -1750,5 +1798,4 @@ public class ManifestController extends BasicController{ |
1750
|
return model;
|
1798
|
return model;
|
1751
|
}
|
1799
|
}
|
1752
|
|
1800
|
|
1753
|
-
|
|
|
1754
|
} |
1801
|
} |