Jay
2024-11-25 ee9f604388a3e77d3f4654e326f3976552e7f532
测点启用和禁用
已修改2个文件
7 ■■■■■ 文件已修改
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
@@ -20,7 +20,6 @@
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -111,7 +110,6 @@
    @PreAuthorize("@ss.hasPermission('data:point:update')")
    @PutMapping("/enable")
    @Operation(summary = "启用")
    @Transactional
    public CommonResult<Boolean> enable(@RequestBody String[] ids) {
        daPointService.enableByIds(ids);
        return success(true);
@@ -120,7 +118,6 @@
    @PreAuthorize("@ss.hasPermission('data:point:update')")
    @PutMapping("/disable")
    @Operation(summary = "禁用")
    @Transactional
    public CommonResult<Boolean> disable(@RequestBody String[] ids) {
        daPointService.disableByIds(ids);
        return success(true);
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -402,6 +402,7 @@
    }
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void enableByIds(String[] ids) {
        if (CollectionUtils.isEmpty(Arrays.asList(ids))) {
            return;
@@ -410,11 +411,13 @@
            DaPointEntity entity = new DaPointEntity();
            entity.setId(item);
            entity.setIsEnable(IsEnableEnum.ENABLE.getCode());
            entity.setUpdateTime(new Date());
            daPointDao.updateById(entity);
        });
    }
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void disableByIds(String[] ids) {
        if (CollectionUtils.isEmpty(Arrays.asList(ids))) {
            return;
@@ -423,6 +426,7 @@
            DaPointEntity entity = new DaPointEntity();
            entity.setId(item);
            entity.setIsEnable(IsEnableEnum.DISABLE.getCode());
            entity.setUpdateTime(new Date());
            daPointDao.updateById(entity);
        });
    }