package com.zy.api.controller; import com.core.annotations.ManagerAuth; import com.core.common.Cools; import com.core.common.R; import com.zy.api.controller.params.ReceviceTaskParams; import com.zy.api.service.HmesApiService; import com.zy.asrs.entity.param.OpenOrderPakoutParam; 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.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(@RequestBody OpenOrderPakoutParam params) { if (Objects.isNull(params)) { return R.error("参数不能为空!!"); } if (Cools.isEmpty(params.getOrderNo())) { return R.error("单据编号[orderNo]不能为空"); } if (Cools.isEmpty(params.getBillType())) { return R.error("单据类型[BillType]不能为空"); } if (Cools.isEmpty(params.getMatList())) { return R.error("单据明细[orderDetails]不能为空"); } 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(@RequestBody ReceviceTaskParams params) { if (Objects.isNull(params)) { return R.error("参数不能为空!!"); } if (Objects.isNull(params.getDevNo())) { return R.error("机台号不能为空!!"); } return hmesApiService.releaseLock(params); } }