Commit 92a8ce6741dfffd8c7013d3df1c0ceab41ab9b71
1 parent
c84ec7ee
增加移动端任务设置站台接口
Showing
3 changed files
with
52 additions
and
1 deletions
src/main/java/com/huaheng/mobile/shipment/MobileShipmentController.java
... | ... | @@ -42,6 +42,7 @@ import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
42 | 42 | import com.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderMapper; |
43 | 43 | import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; |
44 | 44 | import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel; |
45 | +import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | |
45 | 46 | import com.huaheng.pc.task.taskHeader.service.ShipmentTaskService; |
46 | 47 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
47 | 48 | import io.swagger.annotations.ApiOperation; |
... | ... | @@ -90,6 +91,9 @@ public class MobileShipmentController extends BaseController { |
90 | 91 | |
91 | 92 | @Resource |
92 | 93 | private LocationService locationService; |
94 | + | |
95 | + @Resource | |
96 | + private TaskHeaderService taskHeaderService; | |
93 | 97 | /** |
94 | 98 | * 自动组盘 |
95 | 99 | * @param |
... | ... | @@ -353,6 +357,30 @@ public class MobileShipmentController extends BaseController { |
353 | 357 | return AjaxResult.success(stationList); |
354 | 358 | } |
355 | 359 | |
360 | + @PostMapping("/getStationByTaskId") | |
361 | + @ApiOperation("移动端根据任务ID查询可用站台") | |
362 | + @Log(title = "移动端根据任务ID查询可用站台", action = BusinessType.OTHER) | |
363 | + public AjaxResult getStationByTaskId(Integer id){ | |
364 | + TaskHeader header = taskHeaderService.getById(id); | |
365 | + | |
366 | + int taskType = header.getTaskType().intValue(); | |
367 | + int stationType = -1; | |
368 | + if(taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT || | |
369 | + taskType == QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) { | |
370 | + stationType = QuantityConstant.STATION_OUT; | |
371 | + } else if(taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT || | |
372 | + taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT || | |
373 | + taskType == QuantityConstant.TASK_TYPE_VIEW || | |
374 | + taskType == QuantityConstant.TASK_TYPE_CYCLECOUNT) { | |
375 | + stationType = QuantityConstant.STATION_PICK; | |
376 | + } else { | |
377 | + throw new ServiceException("任务类型不需要选站台"); | |
378 | + } | |
379 | + | |
380 | + List<Station> stationList = getStationListByContainerAndType(header.getContainerCode(), stationType); | |
381 | + return AjaxResult.success(stationList); | |
382 | + } | |
383 | + | |
356 | 384 | /** |
357 | 385 | * 从StationController.getStationFromType移植过来 |
358 | 386 | * @param containerCode |
... | ... | @@ -460,7 +488,7 @@ public class MobileShipmentController extends BaseController { |
460 | 488 | return mShipmentDetailIds; |
461 | 489 | } |
462 | 490 | |
463 | - @Log(title = "移动端设置站台", operating = "设置站台", action = BusinessType.GRANT) | |
491 | + @Log(title = "移动端设置出库站台", operating = "设置站台", action = BusinessType.GRANT) | |
464 | 492 | @PostMapping("/setStation") |
465 | 493 | @ResponseBody |
466 | 494 | public AjaxResult setStation (String id, String station){ |
... | ... |
src/main/java/com/huaheng/mobile/task/MobileTaskController.java
... | ... | @@ -186,4 +186,16 @@ public class MobileTaskController { |
186 | 186 | return AjaxResult.success(todayInfo); |
187 | 187 | } |
188 | 188 | |
189 | + @Log(title = "移动端设置任务的站台", operating = "设置站台", action = BusinessType.GRANT) | |
190 | + @PostMapping("/setTaskStation") | |
191 | + @ResponseBody | |
192 | + public AjaxResult setTaskStation (String id, String port){ | |
193 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
194 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getId, id); | |
195 | + TaskHeader taskHeader1 = taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); | |
196 | + taskHeader1.setPort(port); | |
197 | + taskHeaderService.update(taskHeader1, taskHeaderLambdaQueryWrapper); | |
198 | + return AjaxResult.success(); | |
199 | + } | |
200 | + | |
189 | 201 | } |
... | ... |
src/main/java/com/huaheng/pc/config/station/controller/stationController.java
... | ... | @@ -58,6 +58,17 @@ public class stationController extends BaseController { |
58 | 58 | return prefix + "/station"; |
59 | 59 | } |
60 | 60 | |
61 | + @PostMapping("/getStationByCode") | |
62 | + @ResponseBody | |
63 | + public AjaxResult<Station> getStationByCode(String code){ | |
64 | + LambdaQueryWrapper<Station> lambdaQueryWrapper = Wrappers.lambdaQuery(); | |
65 | + lambdaQueryWrapper.eq(Station::getCode, code) | |
66 | + .orderByDesc(Station::getType) | |
67 | + .last("limit 1"); | |
68 | + Station station = stationService.getOne(lambdaQueryWrapper); | |
69 | + return AjaxResult.success(station); | |
70 | + } | |
71 | + | |
61 | 72 | /** |
62 | 73 | * 查询出库类型 |
63 | 74 | */ |
... | ... |