package com.vincent.rsf.openApi.controller;
|
|
import com.vincent.rsf.framework.common.R;
|
import com.vincent.rsf.framework.exception.CoolException;
|
import com.vincent.rsf.openApi.entity.params.RcsPubTaskParams;
|
import com.vincent.rsf.openApi.service.WmsRcsService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
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 java.util.Map;
|
import java.util.Objects;
|
|
@RestController
|
@Api("RCS调度交互接口")
|
@RequestMapping("/rcs")
|
public class WmsRcsController {
|
|
@Autowired
|
private WmsRcsService wmsRcsService;
|
|
/**
|
* @author Ryan
|
* @date 2025/8/27
|
* @description: 任务下发
|
* @version 1.0
|
*/
|
@ApiOperation("调度任务下发")
|
@PostMapping("/pub/task")
|
public R pubTasks(@RequestBody RcsPubTaskParams params) {
|
if (Objects.isNull(params)) {
|
throw new CoolException("参数不能为空!!");
|
}
|
return wmsRcsService.pubTasks(params);
|
}
|
|
/**
|
* @author Ryan
|
* @date 2025/8/27
|
* @description: 取消任务
|
* @version 1.0
|
*/
|
@ApiOperation("取消调度任务")
|
@PostMapping("/cancel/task")
|
public R cancelTasks(@RequestBody Map<String, Object> params) {
|
return wmsRcsService.cancelTasks(params);
|
}
|
|
/**
|
* @author Ryan
|
* @date 2025/8/27
|
* @description: 任务回调,状态回写
|
* @version 1.0
|
*/
|
@ApiOperation("异常任务回调")
|
@PostMapping("/callback/event")
|
public R callBackEvent(@RequestBody Map<String, Object> params) {
|
return wmsRcsService.callBackEvent(params);
|
}
|
|
|
/**
|
* @author Ryan
|
* @date 2025/8/27
|
* @description: RCS库位信息同步
|
* @version 1.0
|
*/
|
@ApiOperation("RCS库位信息同步")
|
@PostMapping("/sync/locs")
|
public R syncLocsToWms() {
|
wmsRcsService.syncLocs();
|
return R.ok();
|
}
|
|
|
}
|