| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.param.CancelTaskParam; |
| | | import com.zy.asrs.domain.param.CompleteTaskParam; |
| | | import com.zy.asrs.domain.param.CreateMoveTaskParam; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.dispatcher.ShuttleDispatchUtils; |
| | | import com.zy.core.enums.SlaveType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private ShuttleDispatchUtils shuttleDispatchUtils; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | |
| | | @PostMapping("/createMoveTask") |
| | | public R createMoveTask(@RequestBody CreateMoveTaskParam param) { |
| | |
| | | return R.ok(); |
| | | } |
| | | return R.error("生成失败"); |
| | | } |
| | | |
| | | //移库任务 |
| | | @PostMapping("/createLocMoveTask") |
| | | public R createLocMoveTask(@RequestBody CreateLocMoveTaskParam param) { |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createLocMoveTask(param); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | return R.error("生成移库任务失败"); |
| | | } |
| | | |
| | | //入库任务 |
| | | @PostMapping("/createInTask") |
| | | public R createInTask(@RequestBody CreateInTaskParam param) { |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createInTask(param); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | return R.error("生成入库任务失败"); |
| | | } |
| | | |
| | | //出库任务 |
| | | @PostMapping("/createOutTask") |
| | | public R createOutTask(@RequestBody CreateOutTaskParam param) { |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.createOutTask(param); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | return R.error("生成出库任务失败"); |
| | | } |
| | | |
| | | @PostMapping("/completeTask") |
| | |
| | | return R.error("任务取消失败"); |
| | | } |
| | | |
| | | @GetMapping("/test") |
| | | public R test() { |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), 1, "9999", NotifyMsgType.SHUTTLE_MOVING); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), 2, "9999", NotifyMsgType.SHUTTLE_MOVE_COMPLETE); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |