FlightController.java
1.6 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
package com.tianbo.imfClient.controller;
import com.tianbo.imfClient.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.imfClient.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;
@RestController
@RequestMapping("/flight")
public class FlightController {
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
/**
* 修改航班日期
* @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);
}
}