From 23855599412c4d61b38d78f0f3abd3430a48b5b1 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期三, 25 六月 2025 11:51:38 +0800 Subject: [PATCH] Merge branch 'mdc_hyjs_master' --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ComponentInfoController.java | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ComponentInfoController.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ComponentInfoController.java new file mode 100644 index 0000000..4b10371 --- /dev/null +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ComponentInfoController.java @@ -0,0 +1,85 @@ +package org.jeecg.modules.dnc.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.modules.dnc.entity.ComponentInfo; +import org.jeecg.modules.dnc.entity.PermissionStream; +import org.jeecg.modules.dnc.response.CommonCode; +import org.jeecg.modules.dnc.response.ResponseResult; +import org.jeecg.modules.dnc.service.IComponentInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@Api(tags = "閮ㄤ欢绠$悊") +@RestController +@RequestMapping("/nc/component") +public class ComponentInfoController { + @Autowired + private IComponentInfoService componentInfoService; + + + @AutoLog(value = "閮ㄤ欢绠$悊-鏂板") + @ApiOperation(value = "閮ㄤ欢绠$悊-鏂板", notes = "閮ㄤ欢绠$悊-鏂板") + @PostMapping("/add") + public ResponseResult addComponentInfo(@RequestBody ComponentInfo componentInfo) { + boolean b = componentInfoService.addComponentInfo(componentInfo); + if(b) { + return new ResponseResult(CommonCode.SUCCESS); + } + return new ResponseResult(CommonCode.FAIL); + } + + @AutoLog(value = "閮ㄤ欢绠$悊-淇敼") + @ApiOperation(value = "閮ㄤ欢绠$悊-淇敼", notes = "閮ㄤ欢绠$悊-淇敼") + @PutMapping("/edit/{id}") + public ResponseResult editComponentInfo(@PathVariable("id") String id,@RequestBody ComponentInfo componentInfo) { + boolean b = componentInfoService.editComponentInfo(id,componentInfo); + if(b) { + return new ResponseResult(CommonCode.SUCCESS); + } + return new ResponseResult(CommonCode.FAIL); + } + + @AutoLog(value = "閮ㄤ欢绠$悊-鍒犻櫎") + @ApiOperation(value = "閮ㄤ欢绠$悊-淇敼", notes = "閮ㄤ欢绠$悊-鍒犻櫎") + @DeleteMapping("/delete") + public ResponseResult deleteComponentInfo(@RequestParam("id") String id) { + boolean b = componentInfoService.deleteComponentInfo(id); + if(b) { + return new ResponseResult(CommonCode.SUCCESS); + } + return new ResponseResult(CommonCode.FAIL); + } + + @AutoLog(value = "妫�鏌n鐮佺殑鏈夋晥鎬�") + @ApiOperation(value = "妫�鏌n鐮佺殑鏈夋晥鎬�", notes = "妫�鏌n鐮佺殑鏈夋晥鎬�") + @GetMapping("/valid/pnCode") + public ResponseResult validateComponentOrPartsPnCode(String pnCode) { + PermissionStream b = componentInfoService.validateComponentOrPartsPnCode(pnCode); + if(b != null) { + return new ResponseResult(CommonCode.SUCCESS); + } + return new ResponseResult(CommonCode.FAIL); + } + + @AutoLog(value = "鏌ヨ鍙互琚紩鐢ㄧ殑閮ㄤ欢") + @ApiOperation(value = "鏌ヨ鍙互琚紩鐢ㄧ殑閮ㄤ欢", notes = "鏌ヨ鍙互琚紩鐢ㄧ殑閮ㄤ欢") + @GetMapping("/getByComponentId") + public Result<?> getByComponentId(ComponentInfo componentInfo, Integer pageNo, Integer pageSize) { + IPage<ComponentInfo> iPage = componentInfoService.getByComponentId(componentInfo, pageNo, pageSize); + return Result.OK(iPage); + } + + + @AutoLog(value = "鍊熺敤閮ㄤ欢(鍙壒閲�)") + @ApiOperation(value = "鍊熺敤閮ㄤ欢(鍙壒閲�)", notes = "鍊熺敤閮ㄤ欢(鍙壒閲�)") + @GetMapping("/borrow") + public Result<?> borrowComponent(String oldId, String newIds) { + return componentInfoService.borrowComponent(oldId,newIds); + } +} -- Gitblit v1.9.3