FlightController.java
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.tianbo.analysis.controller;
import com.tianbo.analysis.dao.CUSTOMSMESSAGEMapper;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.model.CUSTOMSMESSAGE;
import com.tianbo.analysis.model.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/flight")
public class FlightController {
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
CUSTOMSMESSAGEMapper customsmessageMapper;
/**
* 修改航班日期
* @param currDate 修改前日期
* @param flightNo 航班号
* @param setDate 修改后日期
*/
@PostMapping("/changeDate")
public ResultJson changeFlightDate(@RequestParam(value = "currDate",required = true) String currDate,
@RequestParam(value = "flightNo",required = true) String flightNo,
@RequestParam(value = "setDate", required = true) String setDate
){
HashMap<String ,String> map = new HashMap();
map.put("currDate",currDate);
map.put("flightNo",flightNo);
map.put("setDate",setDate);
int i = originmanifestmasterMapper.changeFlightDate(map);
if (i>0)
{
return new ResultJson("200","更新成功",i);
// return "航班日期更新成功"+i;
}
return new ResultJson("500","更新失败或航班信息不正确",i);
}
/**
* 查询运单的回执状态,目前能查到出港运单的所有回执状态,进港不行
* @param waybillno
* @return 返回 业务类型、主单号、分单号、回执内容
*/
@PostMapping("/customres")
public ResultJson getCustomResponse(@RequestParam(value = "waybillno",required = true) String waybillno){
waybillno = waybillno.replace("-","");
List<CUSTOMSMESSAGE> customsmessageList = customsmessageMapper.selectCustomResponse(waybillno);
return new ResultJson(customsmessageList);
}
/**
* 查询运单的回执状态,目前能查到出港运单 发送海关生成报文的messageId
* @param waybillno
* @return 返回 messageId,业务类型、主单号、分单号、回执内容
*/
@PostMapping("/getmessageid")
public ResultJson getCustomMessageId(@RequestParam(value = "waybillno",required = true) String waybillno){
List<CUSTOMSMESSAGE> customsmessageList = customsmessageMapper.selectCustomId(waybillno);
return new ResultJson(customsmessageList);
}
}