| | |
| | | import com.zy.api.entity.OrderParams; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.service.KopenApiService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | 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.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/kopen") |
| | | public class KopenApiController { |
| | |
| | | */ |
| | | @ApiOperation("上架派工单") |
| | | @PostMapping("/sendInDispatch") |
| | | public R receiveOrders(@RequestBody PubOrderParams params) { |
| | | public XSR receiveOrders(@RequestBody PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getType())) { |
| | | return R.error("单据类型不能为空!"); |
| | | return XSR.error("单据类型不能为空!"); |
| | | } |
| | | return kopenApiService.receiveOrders(params); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("零件信息数据更新") |
| | | @PostMapping("/sendPartsMaster") |
| | | public R basMatUpdate(@RequestBody SyncMatParmas params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | public XSR basMatUpdate(@RequestBody List<SyncMatParmas> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getPro_komcode())) { |
| | | return R.error("零件编码不能为空!!"); |
| | | } |
| | | |
| | | return kopenApiService.basMatupdate(params); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("上架派工单反馈") |
| | | @PostMapping("/getInDispatchResult") |
| | | public R getInDispatchResult(@RequestBody ReportOrderParam params) { |
| | | public XSR getInDispatchResult(@RequestBody ReportOrderParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) { |
| | | return R.error("取消条件不能为空!!"); |
| | | return XSR.error("取消条件不能为空!!"); |
| | | } |
| | | return kopenApiService.getInDispatchResult(params); |
| | | } |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("备货指示派工单下发") |
| | | @PostMapping("/sendOutDispatch") |
| | | public XSR sendStockPrepareDispatch(@RequestBody PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | return kopenApiService.sendOutDispatch(params); |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 备货指示派工单反馈 |
| | | // * @author Ryan |
| | | // * @date 2025/11/24 15:22 |
| | | // * @param params |
| | | // * @return com.core.common.R |
| | | // */ |
| | | // @ApiOperation("备货指示派工单反馈") |
| | | // @PostMapping("/getOutDispatchResult") |
| | | // public R getOutDispatchResult(@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.getOutDispatchResult(params); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 备货单下发 |
| | | * @author Ryan |
| | | * @date 2025/11/24 15:21 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ApiOperation("备货单下发") |
| | | @PostMapping("/getOutDetails") |
| | | public XSR getOutDetails(@RequestBody StockUpOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | return kopenApiService.getOutDetails(params); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |