NmmsImportController.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.tianbo.analysis.controller;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.NmmsImportService;
import com.tianbo.analysis.service.OriginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author shenhl
* <p>
* 2022/2/14/11:22
*/
@RestController
@RequestMapping("/nmms/imp")
public class NmmsImportController {
@Autowired
OriginService originService;
@Autowired
NmmsImportService nmmsImportService;
/**
* 批量删除
* @param awbhIds
* @return
*/
@RequestMapping(value = "/imp_removes")
@ResponseBody
public ResultJson antivirus_log_remove(String[] awbhIds){
int r = 0;
for (int i=0; i< awbhIds.length; i++){
r += originService.deleteAwbh(awbhIds[i]);
}
return r > 0 ? new ResultJson("200", "批量删除成功")
: new ResultJson("201", "批量删除失败");
}
/**
*
* @param awbhIds
* @param flightNo
* @param flightDate
* @return
*/
@RequestMapping(value = "/mountAwbh")
@ResponseBody
public ResultJson antivirus_log_remove(@RequestParam(value ="awbhIds")String[] awbhIds,
@RequestParam(value ="flightNo") String flightNo,
@RequestParam(value ="flightDate") String flightDate){
return nmmsImportService.mountAwbh(awbhIds,flightNo,flightDate) > 0 ? new ResultJson("200", "分单挂载成功")
: new ResultJson("201", "分单挂载失败");
}
}