MT8204Controller.java
4.0 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.tianbo.analysis.controller;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.annotation.UserPermissionCheck;
import com.tianbo.analysis.controller.bean.ResponseReason;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.MT8204Service;
import com.tianbo.util.Date.DateUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.xml.sax.SAXException;
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/mt8204/")
public class MT8204Controller {
@Autowired
MT8204Service mt8204Service;
@GetMapping("/index")
public ResultJson index(@RequestParam(value = "page",defaultValue = "1") int page,
@RequestParam(value = "limit",defaultValue = "10") int limit,
@RequestParam(value = "flightno",required = false) String flightNo,
@RequestParam(value = "flightDate",required = false) String flightDate,
@RequestParam(value = "waybillnomaster",required = false) String waybillNo){
MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
if(StringUtils.isNotEmpty(flightDate)){
Date flight_Date = DateUtil.parseDate(flightDate,"yyyyMMdd");
manifest_air_change.setFlightDate(flight_Date);
}
manifest_air_change.setFlightno(flightNo);
manifest_air_change.setWaybillnomaster(waybillNo);
PageInfo<MANIFEST_AIR_CHANGE> result = mt8204Service.selectList(manifest_air_change,page,limit);
return new ResultJson("200","success",result);
}
@ApiOperation(value = "添加直接改配申请接口")
@PostMapping("add")
public ResultJson add(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change){
return mt8204Service.add(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_ADD_ERR);
}
@ApiOperation(value = "编辑直接改配申请接口")
@PostMapping("edit")
public ResultJson edit(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change){
manifest_air_change.setChangetime(new Date());
return mt8204Service.edit(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_EDIT_ERR);
}
@ApiOperation(value = "删除直接改配申请接口")
@UserPermissionCheck
@PostMapping("del")
public ResultJson del(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
manifest_air_change.setChangetime(new Date());
return mt8204Service.del(manifest_air_change) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_DEL_ERR);
}
@ApiOperation(value = "发送直接改配申请接口")
@UserPermissionCheck
@PostMapping("send")
public ResultJson send(@RequestBody MANIFEST_AIR_CHANGE manifest_air_change,@CookieValue("username") String username,@CookieValue("userid") String userid){
return mt8204Service.send(manifest_air_change,username) ? new ResultJson(ResponseReason.MT8204_SUCCESS) : new ResultJson(ResponseReason.MT8204_SEND_ERR);
}
@PostMapping("batchSend")
public ResultJson batchSend(@RequestBody List<String> autoIDlist, @CookieValue("username") String username, @CookieValue("userid") String userid){
ResultJson resultJson = mt8204Service.batchSend(autoIDlist,username);
return resultJson;
// : new ResultJson(ResponseReason.MT8204_SEND_ERR);
}
}