TransArriveExportController.java
4.5 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
package com.tianbo.analysis.controller;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.model.TRANSTOARRIVEEXPORT;
import com.tianbo.analysis.service.TransArriveExportService;
import com.tianbo.analysis.tools.TransArriveTools;
import com.tianbo.util.Date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Api(description = "转关运抵申报")
@RestController
@RequestMapping("/trans/")
public class TransArriveExportController {
@Autowired
TransArriveExportService transArriveExportService;
@ApiOperation(value = "新增转关运抵申报")
@PostMapping("/addTrans")
public ResultJson addTrans(@RequestBody TRANSTOARRIVEEXPORT transtoarriveexport){
int result=transArriveExportService.addTransArriveExport(transtoarriveexport);
return result>0?new ResultJson("200","新增转关运抵申报成功!"):new ResultJson("201","新增转关运抵申报失败!");
}
@ApiOperation(value = "更新转关运抵申报")
@PostMapping("/ediTrans")
public ResultJson ediTrans(@RequestBody TRANSTOARRIVEEXPORT transtoarriveexport){
int result=0;String msg="";
if(transtoarriveexport.getAutoid()!=null){
result=transArriveExportService.ediTransArriveExport(transtoarriveexport);
}else{
result=0;msg="更新转关运抵申报失败!";
}
return result>0?new ResultJson("200","更新转关运抵申报成功!"):new ResultJson("201",msg);
}
@ApiOperation(value = "删除转关运抵申报")
@PostMapping("/delTrans")
public ResultJson delTrans(@RequestBody TRANSTOARRIVEEXPORT trans){
int result=0;String msg="";
if(trans.getAutoid()!=null){
result=transArriveExportService.delTransArriveExport(trans.getAutoid());
}else{
result=0;msg="删除转关运抵申报失败!";
}
return result>0?new ResultJson("200","更新转关运抵申报成功!"):new ResultJson("201",msg);
}
@ApiOperation(value = "查询转关运抵申报列表")
@GetMapping("/selectTrans")
public ResultJson<PageInfo<TRANSTOARRIVEEXPORT>> selectPrediction(@RequestParam(value = "customscode", required = false) String customscode,
@RequestParam(value = "username", required = false) String username,
@RequestParam(value = "trnmode", required = false) String trnmode,
@RequestParam(value = "unloadcode", required = false) String unloadcode,
@RequestParam(value = "startDate", required = false) String startDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "pageNum",required = false,defaultValue = "1") int pageNum,
@RequestParam(value = "pageSize",required = false,defaultValue = "100") int pageSize){
TRANSTOARRIVEEXPORT trans=new TRANSTOARRIVEEXPORT();
if(StringUtils.isNotEmpty(endDate) && StringUtils.isNotEmpty(startDate)){
Date start = DateUtil.parseDate(startDate,"yyyy-MM-dd");
Date end = DateUtil.parseDate(endDate,"yyyy-MM-dd");
trans.setCreattimeStart(start);
trans.setCreattimeEnd(end);
}
trans.setCustomscode(customscode);
trans.setUsername(username);
trans.setTrnmode(trnmode);
trans.setUnloadcode(unloadcode);
PageInfo<TRANSTOARRIVEEXPORT> pageInfo = transArriveExportService.selectTrans(trans,pageNum,pageSize);
return new ResultJson("200","success",pageInfo);
}
@ApiOperation(value = "转关运抵申报")
@PostMapping("/send")
public ResultJson send(@RequestBody TRANSTOARRIVEEXPORT trans){
return transArriveExportService.send(trans);
}
@ApiOperation(value = "批量转关运抵申报")
@PostMapping("batchSend")
public ResultJson batchSend(@RequestBody List<String> autoIDlist){
return transArriveExportService.batchSend(autoIDlist);
}
}