From a265e62ac86c31a7e63ead82bf5f2300ebe5108f Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期日, 13 四月 2025 16:34:31 +0800 Subject: [PATCH] 不合格复测调整 --- inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderPlanController.java | 82 ++++++++++++++++++++++------------------ 1 files changed, 45 insertions(+), 37 deletions(-) diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderPlanController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderPlanController.java index df437ad..48acce4 100644 --- a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderPlanController.java +++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsOrderPlanController.java @@ -1,22 +1,29 @@ package com.ruoyi.inspect.controller; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.Result; import com.ruoyi.inspect.dto.InsOrderPlanDTO; import com.ruoyi.inspect.dto.InsOrderPlanProductDto; import com.ruoyi.inspect.dto.InsProductBindingDto; +import com.ruoyi.inspect.dto.SaveInsContextDto; import com.ruoyi.inspect.pojo.InsOrder; import com.ruoyi.inspect.pojo.InsOrderFactoryVerify; import com.ruoyi.inspect.pojo.InsOrderFile; import com.ruoyi.inspect.pojo.InsProduct; import com.ruoyi.inspect.service.InsOrderFileService; import com.ruoyi.inspect.service.InsOrderPlanService; +import com.ruoyi.inspect.service.InsOrderRatesService; import com.ruoyi.inspect.service.InsProductService; +import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursTemporaryDto; +import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHoursTemporary; +import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursTemporaryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -34,10 +41,9 @@ public class InsOrderPlanController { private InsOrderPlanService insOrderPlanService; - private InsOrderFileService insOrderFileService; - private InsProductService insProductService; + private AuxiliaryOutputWorkingHoursTemporaryService auxiliaryOutputWorkingHoursTemporaryService; @ApiOperation(value = "鑾峰彇妫�楠屼换鍔″垪琛�") @@ -105,21 +111,11 @@ return num == 1 ? Result.success() : Result.fail("鎻愪氦澶辫触锛岄儴鍒嗛」鐩繕鏈繘琛屾楠�"); } - - /** - * - * @param param 妯℃澘鍐呭 - * @param currentTable 褰撳墠妯℃澘id - * @param sampleId 褰撳墠鏍峰搧id - * @param orderId 褰撳墠璁㈠崟id - * @param sonLaboratory 瀛愯瘯楠屽 - * @return - */ @ApiOperation(value = "淇濆瓨妫�楠屽唴瀹�") @PostMapping("/saveInsContext") - public Result<?> saveInsContext(String param, Integer currentTable, Integer sampleId, Integer orderId, String sonLaboratory) { - Map<String, Object> param2 = JSON.parseObject(param, Map.class); - insOrderPlanService.saveInsContext(param2, currentTable, sampleId, orderId, sonLaboratory); + public Result<?> saveInsContext(@RequestBody SaveInsContextDto saveInsContextDto) { + Map<String, Object> param2 = JSON.parseObject(saveInsContextDto.getParam(), Map.class); + insOrderPlanService.saveInsContext(param2, saveInsContextDto.getCurrentTable(), saveInsContextDto.getSampleId(), saveInsContextDto.getOrderId(), saveInsContextDto.getSonLaboratory()); return Result.success(); } @@ -131,6 +127,7 @@ @ApiOperation(value = "涓婁紶闄勪欢") + @PreAuthorize("@ss.hasPermi('upload:order:file')") @PostMapping("/uploadFile") public Result<?> taskUploadFile(Integer orderId, MultipartFile file) { return Result.success(insOrderPlanService.uploadFile(orderId, file)); @@ -138,6 +135,7 @@ @ApiOperation(value = "鍒犻櫎闄勪欢") + @PreAuthorize("@ss.hasPermi('del:order:file')") @DeleteMapping("/delfile") public Result<?> delfile(Integer id) { return Result.success(insOrderFileService.removeById(id)); @@ -179,40 +177,27 @@ return Result.success(insOrderPlanService.getRepetitionTag(id, laboratory, cableTag)); } - @ApiOperation("鑾峰彇涓嶅悎鏍兼暟鎹�") - @GetMapping("/getInsProductUnqualified") - public Result<?> getInsProductUnqualified(InsOrderPlanProductDto insOrderPlanProductDto) { - return Result.success(insOrderPlanService.getInsProductUnqualified(insOrderPlanProductDto)); - } - @ApiOperation("鏂板涓嶅悎鏍煎娴嬩俊鎭�") @PostMapping("/addUnqualifiedRetest") - public Result<?> addDisqualificationRetest(@RequestBody Map<String, Object> params) { - // 鑾峰彇妫�楠屽璞$殑id - List<Integer> ids = (List<Integer>) params.get("ids"); - return Result.success(insOrderPlanService.addDisqualificationRetest(ids)); + public Result<?> addDisqualificationRetest(@RequestBody List<InsProduct> insProductsList) { + return Result.success(insOrderPlanService.addDisqualificationRetest(insProductsList)); } @ApiOperation("鑾峰彇涓嶅悎鏍煎娴嬫暟鎹�") @GetMapping("/getInsProductUnqualifiedRetest") - public Result<?> getInsProductUnqualifiedRetest(Integer id, Integer type, String laboratory, String cableTag, String rawMaterialTag, String retestTag) { - return Result.success(insOrderPlanService.getInsProductUnqualifiedRetest(id, type, laboratory, cableTag, rawMaterialTag, retestTag)); + public Result<?> getInsProductUnqualifiedRetest(InsOrderPlanProductDto insOrderPlanProductDto) { + return Result.success(insOrderPlanService.getInsProductUnqualifiedRetest(insOrderPlanProductDto)); } /** * - * @param param 妯℃澘鍐呭 - * @param currentTable 褰撳墠妯℃澘id - * @param sampleId 褰撳墠鏍峰搧id - * @param orderId 褰撳墠璁㈠崟id - * @param sonLaboratory 瀛愯瘯楠屽 * @return */ - @ApiOperation(value = "淇濆瓨涓嶅悎鏍煎娴嬫楠屽唴瀹�") + @ApiOperation(value = "淇濆瓨 涓嶅悎鏍煎娴嬫楠屽唴瀹�") @PostMapping("/saveUnqualifiedContext") - public Result<?> saveUnqualifiedContext(String param, Integer currentTable, Integer sampleId, Integer orderId, String sonLaboratory) { - Map<String, Object> param2 = JSON.parseObject(param, Map.class); - insOrderPlanService.saveUnqualifiedContext(param2, currentTable, sampleId, orderId, sonLaboratory); + public Result<?> saveUnqualifiedContext(@RequestBody SaveInsContextDto saveInsContextDto) { + Map<String, Object> param2 = JSON.parseObject(saveInsContextDto.getParam(), Map.class); + insOrderPlanService.saveUnqualifiedContext(param2, saveInsContextDto.getCurrentTable(), saveInsContextDto.getSampleId(), saveInsContextDto.getOrderId(), saveInsContextDto.getSonLaboratory()); return Result.success(); } @@ -232,6 +217,7 @@ @ApiOperation(value = "淇敼妫�楠岄」鍐呭") + @PreAuthorize("@ss.hasPermi('update:product:onPlan')") @PostMapping("/updateProductOnPlan") public Result<?> updateProductOnPlan(@RequestBody InsProduct insProduct) { insProductService.updateById(insProduct); @@ -264,8 +250,30 @@ @ApiOperation(value = "鍒犻櫎鐗规畩妫�楠岄」缁戝畾淇℃伅") - @GetMapping("/delProductTreeByProductId") + @DeleteMapping("/delProductTreeByProductId") public Result<?> delProductTreeByProductId(Integer productId) { return Result.success(insProductService.removeBindingProductTree(productId)); } + + /** + * 鏍规嵁璁㈠崟鏌ヨ宸ユ椂璇︽儏 + * @return + */ + @ApiOperation(value = "鏍规嵁璁㈠崟鏌ヨ宸ユ椂璇︽儏") + @PreAuthorize("@ss.hasPermi('get:working:hours:byOrder')") + @GetMapping("/getWorkingHoursByOrderId") + public Result<IPage<AuxiliaryOutputWorkingHoursTemporaryDto>> getWorkingHoursByOrderId(Page page, AuxiliaryOutputWorkingHoursTemporaryDto workingHoursTemporary) { + return Result.success(auxiliaryOutputWorkingHoursTemporaryService.getWorkingHoursByOrderId(page, workingHoursTemporary)); + } + + /** + * 淇敼宸ユ椂璇︽儏 + * @return + */ + @ApiOperation(value = "淇敼宸ユ椂璇︽儏") + @PreAuthorize("@ss.hasPermi('update:order:workingHours')") + @PostMapping("/updateWorkingHours") + public Result updateWorkingHours(@RequestBody AuxiliaryOutputWorkingHoursTemporary workingHoursTemporary) { + return Result.success(auxiliaryOutputWorkingHoursTemporaryService.updateById(workingHoursTemporary)); + } } -- Gitblit v1.9.3