WmsApiController.java
2.78 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
package com.huaheng.api.general.controller;
import com.huaheng.api.general.domain.TaskDomain;
import com.huaheng.api.general.domain.TaskOffDomain;
import com.huaheng.api.general.service.TaskService;
import com.huaheng.common.exception.service.ServiceException;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/api")
@Api(tags = {"任务下发接口"}, value = "task")
public class WmsApiController {
@Resource
private TaskService taskService;
@Log(title = "任务下发至立库", action = BusinessType.INSERT)
@PostMapping("/WisJobSend")
@ApiOperation("任务下发至立库")
@ResponseBody
@ApiLogger(apiName = "任务下发至立库", from = "ERP")
public AjaxResult WisJobSend(@RequestBody TaskDomain taskDomain) {
AjaxResult ajaxResult=new AjaxResult();
switch (Integer.valueOf(taskDomain.getTaskType()))
{
case 1:
ajaxResult=taskService.taskAllreceipt(taskDomain);
break;
case 2:
ajaxResult=taskService.lssueTask(taskDomain);
break;
case 3:;
ajaxResult=taskService.lssueTask(taskDomain);
break;
case 4:
ajaxResult=taskService.airflare(taskDomain);
break;
}
return ajaxResult;
}
@Log(title = "任务取消", action = BusinessType.INSERT)
@PostMapping("/Taskcancellation")
@ApiOperation("任务取消")
@ResponseBody
@Transactional
@ApiLogger(apiName = "任务取消", from = "ERP")
public AjaxResult Taskcancellation(@RequestBody TaskOffDomain taskDomain) {
if (taskDomain == null) {
throw new ServiceException("wms下发任务为空");
}
//1、判断必填字段是否满足
if(taskDomain.getReqID() == null){
throw new ServiceException("wms任务号Id为空");
}
if(taskDomain.getContainerCode() == null){
throw new ServiceException("wms任务容器为空");
}
if(taskDomain.getTaskNo() == null){
throw new ServiceException("wms任务号为空");
}
if(taskDomain.getRequestTime() == null){
throw new ServiceException("wms任务时间为空");
}
AjaxResult ajaxResult=taskService.taskOff(taskDomain);
return ajaxResult;
}
}