package com.zy.api.controller;
|
|
|
import com.core.annotations.ManagerAuth;
|
import com.core.common.R;
|
import com.zy.api.controller.params.ReceviceTaskParams;
|
import com.zy.api.service.HmesApiService;
|
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.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.Objects;
|
|
@Api(value = "HMES对接")
|
@RestController
|
@RequestMapping("/api")
|
public class HmesApiController {
|
|
@Autowired
|
private HmesApiService hmesApiService;
|
|
/**
|
* 人工穿线
|
* @author Ryan
|
* @date 2026/1/10 10:40
|
* @return com.core.common.R
|
*/
|
@ManagerAuth
|
@ApiOperation("下发生产任务")
|
@PostMapping("/work/tasks")
|
public R menauWork(ReceviceTaskParams params) {
|
if (Objects.isNull(params)) {
|
return R.error("参数不能为空!!");
|
}
|
if (Objects.isNull(params.getDeviceNo())) {
|
return R.error("机台号不能为空!!");
|
}
|
|
return hmesApiService.pubWorkTask(params);
|
}
|
|
/**
|
* 穿线完成,释放机台周边库位
|
* @author Ryan
|
* @date 2026/1/10 11:06
|
* @param params
|
* @return com.core.common.R
|
*/
|
@ManagerAuth
|
@ApiOperation("下发生产任务")
|
@PostMapping("/work/release/lock")
|
public R releaseLock(ReceviceTaskParams params) {
|
if (Objects.isNull(params)) {
|
return R.error("参数不能为空!!");
|
}
|
if (Objects.isNull(params.getDeviceNo())) {
|
return R.error("机台号不能为空!!");
|
}
|
|
return hmesApiService.releaseLock(params);
|
}
|
|
|
}
|