|
1
2
3
4
5
6
7
8
|
package com.huaheng.api.wcs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
|
|
9
|
import com.huaheng.framework.web.service.ConfigService;
|
|
10
|
import com.huaheng.pc.config.container.service.ContainerService;
|
|
11
12
|
import com.huaheng.pc.config.location.domain.Location;
import com.huaheng.pc.config.location.service.LocationService;
|
|
13
14
15
16
17
|
import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
import io.swagger.annotations.ApiOperation;
|
|
18
|
import org.apache.commons.lang.StringUtils;
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("/API/WMS/v2")
public class ArrivedNoticeController extends BaseController {
@Resource
private TaskHeaderService taskHeaderService;
@Resource
private TaskDetailService taskDetailService;
@Resource
private InventoryDetailService inventoryDetailService;
|
|
35
36
37
38
|
@Resource
private LocationService locationService;
@Resource
private ConfigService configService;
|
|
39
|
|
|
40
41
42
|
@Resource
private ContainerService containerService;
|
|
43
44
|
@PostMapping("/arrivedNotice")
@ApiOperation("到达拣选台")
|
易文鹏
authored
|
45
|
@ApiLogger(apiName = "wcs到达拣选台", from = "ROBOT")
|
|
46
47
|
@Transactional(rollbackFor = Exception.class)
@ResponseBody
|
易文鹏
authored
|
48
|
public AjaxResult arrivedNotice(@RequestBody Map<String, String> map) {
|
|
49
|
//String warehouseCode = "CS0001";
|
|
50
|
String taskNo = map.get("taskNo");
|
|
51
52
53
|
//String port = map.get("port");
//String msg = map.get("msg");
//String state = map.get("state");
|
|
54
55
56
|
LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
taskHeaderLambdaQueryWrapper.eq(TaskHeader::getId, taskNo);
TaskHeader taskHeader = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
|
易文鹏
authored
|
57
58
59
60
61
|
if (taskHeader != null) {
int status = taskHeader.getStatus();
if (status == QuantityConstant.TASK_STATUS_COMPLETED) {
return AjaxResult.success("更新到达站台成功, 任务已经完成,不要重复更新");
}
|
易文鹏
authored
|
62
63
64
|
if (status == QuantityConstant.TASK_STATUS_ARRIVED_STATION) {
return AjaxResult.success("状态已经是到达站台了,不要重复更新");
}
|
|
65
66
67
68
69
|
taskHeader.setStatus(QuantityConstant.TASK_STATUS_ARRIVED_STATION);
} else {
return AjaxResult.error("没有找到任务taskNo:" + taskNo);
}
boolean result = taskHeaderService.updateById(taskHeader);
|
易文鹏
authored
|
70
|
if (!result) {
|
|
71
72
73
74
75
|
return AjaxResult.error("更新到达站台失败");
}
return AjaxResult.success("更新到达站台成功");
}
}
|