From 973022f0585dbada665543db56e64e1ce3816150 Mon Sep 17 00:00:00 2001 From: 刘小明 <liuxm_a@163.com> Date: 星期四, 04 七月 2024 16:01:27 +0800 Subject: [PATCH] 添加测试品检接口 --- pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java | 66 ++++++++++++++++++++++++++++++++- 1 files changed, 64 insertions(+), 2 deletions(-) diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java index 353bbd1..1c86103 100644 --- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java +++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java @@ -1,8 +1,15 @@ package com.dy.pmsStation.assemblyStep; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems; +import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems; +import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** *璁板綍缁勮鍚勬楠� @@ -11,4 +18,59 @@ @RestController @RequestMapping(path = "assemblyStep") public class AssemblyStepCtrl { + private AssemblyStepSv sv; + @Autowired + public void setSv(AssemblyStepSv sv) { + this.sv = sv; + } + + @PostMapping(path = "save") + public BaseResponse save(@RequestBody @Valid QueryVo vo) { + log.info("AssemblyStepCtrl.save()"); + int count = sv.save(vo); + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + + @PostMapping(path = "repair") + public BaseResponse repair(@RequestBody @Valid QueryVo vo) { + log.info("AssemblyStepCtrl.repair()"); + int count = sv.repair(vo); + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + @GetMapping(path = "getQualityItems") + public BaseResponse<List<PltProductQualityInspectionItems>> getQualityItems(String proId) { + log.info("AssemblyStepCtrl.getQualityItems()"); + List<PltProductQualityInspectionItems> result = sv.getQualityItems(proId); + return BaseResponseUtils.buildSuccess(result); + } + @GetMapping(path = "getTestItems") + public BaseResponse<List<PltProductTestInspectionItems>> getTestItems(String proId) { + log.info("AssemblyStepCtrl.getTestItems()"); + List<PltProductTestInspectionItems> result = sv.getTestItems(proId); + return BaseResponseUtils.buildSuccess(result); + } + + /** + * 娴嬭瘯鎴栧搧妫�閮借皟鐢ㄨ繖涓帴鍙� + * @param vo + * @return + */ + @PostMapping(path = "testing") + public BaseResponse testing(@RequestBody @Valid QueryVo vo) { + log.info("AssemblyStepCtrl.testing()"); + int count = sv.testing(vo); + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } } -- Gitblit v1.8.0