¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 = "æ£æ¥pnç çæææ§") |
| | | @ApiOperation(value = "æ£æ¥pnç çæææ§", notes = "æ£æ¥pnç çæææ§") |
| | | @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); |
| | | } |
| | | } |