dengzedong
2024-09-20 8c41fe94af2f3b94a913289c8f8c3d687037a00b
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDATagController.java
@@ -9,6 +9,7 @@
import com.iailab.module.data.channel.opcda.vo.OpcDaTagRespVO;
import com.iailab.module.data.common.exception.RRException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -29,21 +30,24 @@
public class ChannelOPCDATagController {
    @Autowired
    private ChannelOPCDATagService channelOPCDATagService;
    @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')")
    @GetMapping("page")
    public CommonResult<PageResult<OpcDaTagRespVO>> list(@Valid OpcDaTagPageReqVO reqVO) {
        PageResult<ChannelOPCDATagEntity> page = channelOPCDATagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, OpcDaTagRespVO.class));
    }
    @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')")
    @GetMapping("/info/{id}")
    public CommonResult<ChannelOPCDATagEntity> info(@PathVariable("id") String id) {
        ChannelOPCDATagEntity info = channelOPCDATagService.info(id);
        return success(info);
    }
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
    @PreAuthorize("@ss.hasPermission('data:channel-opcua:create')")
    @PostMapping("/create")
    public CommonResult<Boolean> create(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCDATagEntity.setId(id);
        channelOPCDATagEntity.setCreateTime(new Date());
@@ -51,6 +55,7 @@
        return success(true);
    }
    @PreAuthorize("@ss.hasPermission('data:channel-opcua:update')")
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagEntity.setUpdateTime(new Date());
@@ -58,11 +63,13 @@
        return success(true);
    }
    @PreAuthorize("@ss.hasPermission('data:channel-opcua:delete')")
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelOPCDATagService.delete(id);
        return success(true);
    }
    @PostMapping("/import/{serverId}")
    public CommonResult<String> importTag(@PathVariable("serverId") String serverId, @RequestParam("file") MultipartFile file) {
        try {