package com.zy.api.controller;
|
|
|
import com.core.common.R;
|
import com.zy.api.entity.OrderParams;
|
import com.zy.api.entity.PubOrderParams;
|
import com.zy.api.entity.ReportOrderParam;
|
import com.zy.api.entity.SyncMatParmas;
|
import com.zy.api.service.KopenApiService;
|
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;
|
|
@RestController
|
@RequestMapping("/kopen")
|
public class KopenApiController {
|
|
@Autowired
|
private KopenApiService kopenApiService;
|
|
/**
|
* 上游下发派工单
|
*
|
* @author Ryan
|
* @date 2025/11/24 15:18
|
* @param params
|
* @return com.core.common.R
|
*/
|
@ApiOperation("上架派工单")
|
@PostMapping("/sendInDispatch")
|
public R receiveOrders(@RequestBody PubOrderParams params) {
|
if (Objects.isNull(params)) {
|
return R.error("参数不能为空!!");
|
}
|
if (Objects.isNull(params.getType())) {
|
return R.error("单据类型不能为空!");
|
}
|
return kopenApiService.receiveOrders(params);
|
}
|
|
/**
|
* 上游下发零件数据变更
|
* s
|
* @author Ryan
|
* @date 2025/11/24 15:19
|
* @param params
|
* @return com.core.common.R
|
*/
|
@ApiOperation("零件信息数据更新")
|
@PostMapping("/sendPartsMaster")
|
public R basMatUpdate(@RequestBody SyncMatParmas params) {
|
if (Objects.isNull(params)) {
|
return R.error("参数不能为空!!");
|
}
|
if (Objects.isNull(params.getPro_komcode())) {
|
return R.error("零件编码不能为空!!");
|
}
|
|
return kopenApiService.basMatupdate(params);
|
}
|
|
|
/**
|
* 上架派工单反馈
|
* @author Ryan
|
* @date 2025/11/24 15:20
|
* @param params
|
* @return com.core.common.R
|
*/
|
@ApiOperation("上架派工单反馈")
|
@PostMapping("/getInDispatchResult")
|
public R getInDispatchResult(@RequestBody ReportOrderParam params) {
|
if (Objects.isNull(params)) {
|
return R.error("参数不能为空!!");
|
}
|
if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) {
|
return R.error("取消条件不能为空!!");
|
}
|
return kopenApiService.getInDispatchResult(params);
|
}
|
|
}
|