xcq
authored
|
1
2
|
package com.huaheng.api.mes.controller;
|
xcq
authored
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
xcq
authored
|
4
5
|
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
xcq
authored
|
6
|
import com.huaheng.api.mes.domain.InventoryDetailQuery;
|
xcq
authored
|
7
|
import com.huaheng.api.mes.domain.MaterialQuery;
|
xcq
authored
|
8
9
10
|
import com.huaheng.api.mes.domain.MesTask;
import com.huaheng.api.mes.domain.TaskHeaderQuery;
import com.huaheng.api.mes.service.MesService;
|
xcq
authored
|
11
|
import com.huaheng.common.constant.QuantityConstant;
|
xcq
authored
|
12
|
import com.huaheng.common.utils.StringUtils;
|
xcq
authored
|
13
|
import com.huaheng.common.utils.Wrappers;
|
xcq
authored
|
14
|
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
|
xcq
authored
|
15
16
17
18
|
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.framework.web.page.TableDataInfo;
import com.huaheng.pc.config.location.service.LocationService;
|
xcq
authored
|
19
20
|
import com.huaheng.pc.config.material.domain.Material;
import com.huaheng.pc.config.material.service.MaterialService;
|
xcq
authored
|
21
|
import com.huaheng.pc.config.zone.domain.Zone;
|
xcq
authored
|
22
|
import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
|
xcq
authored
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* mes下发任务接口
* @author xcq
*/
@RestController
@RequestMapping("/api/mes")
@Api(tags = {"MES下发任务接口"}, value = "MES下发任务接口")
public class MesController extends BaseController {
@Resource
private MesService mesService;
|
xcq
authored
|
41
42
|
@Resource
private MaterialService materialService;
|
xcq
authored
|
43
44
45
46
47
|
@ApiOperation(value = "mes任务创建", httpMethod = "POST")
@PostMapping("/createTask")
@ResponseBody
|
xcq
authored
|
48
|
@ApiLogger(apiName = "mes任务创建", from="MES")
|
xcq
authored
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
public AjaxResult createTask(@RequestBody MesTask mesTask){
return mesService.createTaskService(mesTask);
}
@ApiOperation(value = "空料框处理", httpMethod = "POST")
@PostMapping("/emptyContainerHandle")
@ResponseBody
public AjaxResult emptyContainerHandle(@RequestBody MesTask mesTask){
return mesService.emptyContainerHandleService(mesTask);
}
@ApiOperation(value = "初始化货架点位", httpMethod = "POST")
@PostMapping("/initialLocation")
@ResponseBody
public AjaxResult initialLocation(@RequestBody MesTask mesTask){
return mesService.initialLocationService(mesTask);
}
|
周鸿
authored
|
69
70
71
72
73
74
75
|
@ApiOperation(value = "机加库获取物料信息", httpMethod = "POST")
@PostMapping("/getMaterialByMES")
@ResponseBody
public AjaxResult getMaterialByMES(@RequestBody MesTask mesTask) {
return mesService.getMaterialByMES(mesTask);
}
|
xcq
authored
|
76
77
78
79
80
81
82
|
@ApiOperation(value = "常规点位初始化", httpMethod = "POST")
@PostMapping("/routineInitialLocation")
@ResponseBody
public AjaxResult routineInitialLocation(@RequestBody MesTask mesTask){
return mesService.routineInitialLocationService(mesTask);
}
|
xcq
authored
|
83
84
|
@ApiOperation(value = "解绑库位", httpMethod = "POST")
|
xcq
authored
|
85
|
@PostMapping("/locationUntie")
|
xcq
authored
|
86
|
@ResponseBody
|
xcq
authored
|
87
|
public AjaxResult locationUntie(@RequestBody MesTask mesTask){
|
xcq
authored
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
return mesService.untieLocationService(mesTask);
}
@ApiOperation(value = "取消任务", httpMethod = "POST")
@PostMapping("/cancelACSTask")
@ResponseBody
public AjaxResult cancelACSTask(@RequestBody Integer id){
return mesService.cancelACSTaskService(id);
}
@ApiOperation(value = "任务查看", httpMethod = "POST")
@PostMapping("/getTaskList")
@ResponseBody
public TableDataInfo getTaskList(@RequestBody TaskHeaderQuery taskHeaderQuery){
return mesService.getTaskListService(taskHeaderQuery);
}
@ApiOperation(value = "库存查看", httpMethod = "POST")
@PostMapping("/getInventoryList")
@ResponseBody
|
xcq
authored
|
108
|
@ApiLogger(apiName = "库存查看", from="MES")
|
xcq
authored
|
109
110
111
112
113
114
115
|
public TableDataInfo getInventoryList(@RequestBody InventoryDetailQuery inventoryDetailQuery){
return mesService.getInventoryListService(inventoryDetailQuery);
}
@ApiOperation(value = "区域同步", httpMethod = "POST")
@PostMapping("/zoneSync")
@ResponseBody
|
xcq
authored
|
116
|
@ApiLogger(apiName = "区域同步", from="MES")
|
xcq
authored
|
117
118
119
120
121
122
123
124
125
126
127
|
public AjaxResult zoneSync(@RequestBody List<Zone> zones){
return mesService.zoneSyncService(zones);
}
@ApiOperation(value = "点位到点位", httpMethod = "POST")
@PostMapping("/pointToPoint")
@ResponseBody
public AjaxResult pointToPoint(@RequestBody MesTask mesTask){
return mesService.pointToPointService(mesTask);
}
|
xcq
authored
|
128
129
130
131
132
133
|
/**
* 获取光腾物料
* @return
*/
@PostMapping("/getGTMaterial")
@ResponseBody
|
xcq
authored
|
134
|
public TableDataInfo getGTMaterial(@RequestBody MaterialQuery materialQuery){
|
周鸿
authored
|
135
|
LambdaQueryWrapper<Material> queryWrapper = Wrappers.lambdaQueryNoWarehouse();
|
xcq
authored
|
136
|
queryWrapper.eq(Material::getWarehouseCode, QuantityConstant.WAREHOUSE_KS)
|
xcq
authored
|
137
|
.eq(Material::getCompanyCode, QuantityConstant.COMPANY_GT)
|
周鸿
authored
|
138
139
|
.like(StringUtils.isNotEmpty(materialQuery.getCode()),Material::getCode, materialQuery.getCode())
.like(StringUtils.isNotEmpty(materialQuery.getName()),Material::getName, materialQuery.getName())
|
xcq
authored
|
140
141
142
143
144
145
146
147
148
149
|
.select(Material::getCode, Material::getName,Material::getSpec, Material::getUnit);
if (StringUtils.isNotNull(materialQuery.getPageNum()) && StringUtils.isNotNull(materialQuery.getPageSize())){
// 分页查询
Page<Material> page = new Page<>(materialQuery.getPageNum(), materialQuery.getPageSize());
IPage<Material> iPage = materialService.page(page, queryWrapper);
return getMpDataTable(iPage.getRecords(), iPage.getTotal());
}else {
List<Material> list = materialService.list(queryWrapper);
return getDataTable(list);
}
|
xcq
authored
|
150
151
|
}
|
xcq
authored
|
152
153
154
155
156
157
158
159
160
161
162
|
/**
* 区域移动
* @return
*/
@PostMapping("/regionalMove")
@ResponseBody
@ApiLogger(apiName = "区域移动", from="MES")
public AjaxResult regionalMove(@RequestBody MesTask mesTask){
return mesService.regionalMoveService(mesTask);
}
|
xcq
authored
|
163
|
}
|