chen.lin
16 小时以前 8f8b6a47ce277cad0b640c328ab3962419e1c024
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/WcsController.java
@@ -3,7 +3,10 @@
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto;
import com.vincent.rsf.server.api.controller.params.TaskInParam;
import com.vincent.rsf.server.api.controller.erp.params.TaskInParam;
import com.vincent.rsf.server.api.entity.params.ExMsgParams;
import com.vincent.rsf.server.api.entity.params.WcsTaskParams;
import com.vincent.rsf.server.common.annotation.OperationLog;
import com.vincent.rsf.server.manager.enums.TaskType;
import com.vincent.rsf.server.api.service.WcsService;
import com.vincent.rsf.server.system.controller.BaseController;
@@ -15,6 +18,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
@RequestMapping("/wcs")
@Api(tags = "wcs接口对接")
@@ -22,6 +27,7 @@
    @Autowired
    private WcsService wcsService;
    @ApiOperation(value = "wcs生成入库任务接口")
    @PostMapping("/create/in/task")
@@ -40,8 +46,6 @@
        }
        InTaskMsgDto msgDto = wcsService.createInTask(param);
        return R.ok(msgDto);
    }
    @ApiOperation(value = "agv取货完成接口")
@@ -67,8 +71,7 @@
    /**
     * 接收WCS调度,回传执行状态
     *  //TODO 1. 拣料出库,再入库执行,修改状态为199.任务完成  并记录入库站点(源站点),添加任务号参数
     *
     *  TODO 1. 拣料出库,再入库执行,修改状态为199.任务完成  并记录入库站点(源站点),添加任务号参数
     * @param param
     * @return
     */
@@ -78,11 +81,76 @@
        if (Cools.isEmpty(param)) {
            return R.error("参数不能为空!!");
        }
        return R.ok();
    }
    /**
     * @author Ryan
     * @date 2025/8/27
     * @description: RCS库位信息同步
     * @version 1.0
     */
    @ApiOperation("RCS库位信息同步")
    @OperationLog("RCS库位信息同步")
    @PostMapping("/sync/locs")
    public R syncLocsToWms() {
         wcsService.syncLocsToWms();
         return R.ok();
    }
    /**
     * 下发任务至WCS,API中转
     * @param
     * @return
     */
    @ApiOperation("下发任务至WCS")
    @OperationLog("下发任务至WCS")
    @PostMapping("/pub/task/wcs")
    public R pubTaskToWcs(@RequestBody WcsTaskParams params) {
        return wcsService.pubWcsTask(params);
    }
    /**
     * @author Ryan
     * @date 2025/8/28
     * @description: RCS上报异常信息
     * @version 1.0
     */
    @ApiOperation("RCS上报异常执行信息")
    @OperationLog("RCS上报异常执行信息")
    @PostMapping("/receive/ex/msg")
    public R receiveExMsg(@RequestBody ExMsgParams params) {
        return wcsService.receiveExMsg(params);
    }
    /**
     * @author Ryan
     * @date 2026/2/6
     * @description: 申请入库任务,分配库位(内部接口)
     * @version 1.0
     */
    @ApiOperation("申请入库任务,分配库位")
    @PostMapping("/allocate/location")
    public R allocateLocation(@RequestBody Map<String, Object> params) {
        if (Cools.isEmpty(params)) {
            return R.error("参数不能为空!!");
        }
        String barcode = (String) params.get("barcode");
        String staNo = (String) params.get("staNo");
        Integer type = params.get("type") != null ? Integer.valueOf(params.get("type").toString()) : null;
        if (Cools.isEmpty(barcode)) {
            return R.error("料箱码不能为空!!");
        }
        if (Cools.isEmpty(staNo)) {
            return R.error("入库站点不能为空!!");
        }
        if (type == null) {
            return R.error("入库类型不能为空!!");
        }
        return wcsService.allocateLocation(barcode, staNo, type);
    }
}