¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.DocRelative; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.QueryListResponseResult; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.dnc.service.IDocRelativeService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "设å¤å
³èææ¡£è¡¨") |
| | | @RestController |
| | | @RequestMapping("/doc/relative") |
| | | public class DocRelativeController extends JeecgController<DocRelative, IDocRelativeService> { |
| | | @Autowired |
| | | private IDocRelativeService relativeService; |
| | | |
| | | @AutoLog(value = "设å¤å
³èææ¡£è¡¨-å é¤è®¾å¤ä¸çææ¡£æ¥å£") |
| | | @ApiOperation(value = "设å¤å
³èææ¡£è¡¨-å é¤è®¾å¤ä¸çææ¡£æ¥å£", notes = "设å¤å
³èææ¡£è¡¨-å é¤è®¾å¤ä¸çææ¡£æ¥å£") |
| | | @DeleteMapping("/delete/device/{docId}/{deviceId}") |
| | | public ResponseResult deleteDocByDeviceId(@PathVariable("docId") String docId, @PathVariable("deviceId") String deviceId) { |
| | | boolean b = relativeService.deleteDocByAttr(docId, 7, deviceId); |
| | | if(b) |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | return new ResponseResult(CommonCode.FAIL); |
| | | } |
| | | |
| | | @AutoLog(value = "设å¤å
³èææ¡£è¡¨-æ¥è¯¢ææ¡£ä¸çææå
³è设å¤ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤å
³èææ¡£è¡¨-æ¥è¯¢ææ¡£ä¸çææå
³è设å¤ä¿¡æ¯", notes = "设å¤å
³èææ¡£è¡¨-æ¥è¯¢ææ¡£ä¸çææå
³è设å¤ä¿¡æ¯") |
| | | @GetMapping("/get/device/{docId}") |
| | | public QueryListResponseResult<MdcEquipment> findDeviceByDocId(@PathVariable("docId") String docId) { |
| | | List<MdcEquipment> list = relativeService.findDeviceByDocId(docId); |
| | | if(list == null) |
| | | list = Collections.emptyList(); |
| | | return new QueryListResponseResult<>(CommonCode.SUCCESS, list); |
| | | } |
| | | } |