浏览代码

更新删除方法
更新作品权限-跟角色

wuweihao 3 年之前
父节点
当前提交
12e5481b59

+ 1 - 8
gis_cms/src/main/java/com/gis/cms/service/impl/BarrageServiceImpl.java

@@ -74,14 +74,7 @@ public class BarrageServiceImpl extends ServiceImpl<BarrageMapper, BarrageEntity
 
     @Override
     public Result remove(Long id) {
-        BarrageEntity entity = this.getById(id);
-        if (entity == null) {
-            return Result.success();
-        }
-        // db数据软删除, 物理数据真删除
-        entity.setIsDelete(1);
-        entity.setUpdateTime(LocalDateTime.now());
-        this.updateById(entity);
+        this.removeById(id);
         return Result.success();
     }
 

+ 2 - 22
gis_cms/src/main/java/com/gis/cms/service/impl/CommentServiceImpl.java

@@ -84,14 +84,7 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, CommentEntity
 
     @Override
     public Result remove(Long id) {
-        CommentEntity entity = this.getById(id);
-        if (entity == null) {
-            return Result.success();
-        }
-        // db数据软删除, 物理数据真删除
-        entity.setIsDelete(1);
-        entity.setUpdateTime(LocalDateTime.now());
-        this.updateById(entity);
+        this.removeById(id);
         return Result.success();
     }
 
@@ -99,24 +92,11 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, CommentEntity
     public Result saveEntity(CommentDto param) {
         CommentEntity entity = new CommentEntity();
         BeanUtils.copyProperties(param, entity);
-//        entity.setUserId(getTokenUserId());
         this.save(entity);
         return Result.success();
     }
 
-//    @Override
-//    public Result<CommentVo> voListTree(PageDateDto param, Integer display) {
-//        startPage(param);
-//
-//        List<CommentVo> search = entityMapper.search(param, display);
-//
-//        Set<Object> filterKey = sensitiveService.getFilterKey();
-//        CommentTreeUtil commentTreeUtil = new CommentTreeUtil(search, filterKey);
-//        List<CommentTree> commentTrees = commentTreeUtil.buildTree();
-//
-//        PageInfo<CommentTree> page = new PageInfo<>(commentTrees);
-//        return Result.success(page);
-//    }
+
 
     @Override
     public Result<CommentEntity> detail(Long id) {

+ 4 - 3
gis_cms/src/main/java/com/gis/cms/service/impl/GoodsServiceImpl.java

@@ -111,9 +111,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
         if (entity == null) {
             return Result.success();
         }
-        entity.setIsDelete(1);
-        entity.setUpdateTime(LocalDateTime.now());
-        this.updateById(entity);
+        fileUtils.del(entity.getFilePath());
+        fileUtils.del(entity.getThumb());
+
+        this.removeById(id);
 
         return Result.success();
     }

+ 3 - 3
gis_pano/src/main/java/com/gis/cms/service/impl/WorkServiceImpl.java

@@ -73,7 +73,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
         BaseUtil.startPage(param);
         IPage<WorkEntity> page = new Page<>(param.getPageNum() , param.getPageSize());
         LambdaQueryWrapper<WorkEntity> wrapper = new LambdaQueryWrapper<> ();
-        wrapper.eq(WorkEntity::getCreatorId, iBaseService.getUserId());
+        // wrapper.eq(WorkEntity::getCreatorId, iBaseService.getUserId());
         String searchKey = param.getSearchKey();
         if (StringUtils.isNotBlank(searchKey)){
             wrapper.like(WorkEntity::getName, param.getSearchKey());
@@ -188,7 +188,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
 
         Long userId = iBaseService.getUserId();
         log.info("userId: {}", userId);
-        BaseRuntimeException.isHas(!userId.equals(entity.getCreatorId()), null, "当前无操作权限");
+//        BaseRuntimeException.isHas(!userId.equals(entity.getCreatorId()), null, "当前无操作权限");
 
         redisUtil.set(RedisConstant.WORK_ID + workId, entity, 30, TimeUnit.SECONDS);
 
@@ -218,7 +218,7 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, WorkEntity> impleme
         }
 
         //是否该用户作品
-        BaseRuntimeException.isHas(!iBaseService.getUserId().equals(entity.getCreatorId()), 3005, "当前无操作权限");
+//        BaseRuntimeException.isHas(!iBaseService.getUserId().equals(entity.getCreatorId()), 3005, "当前无操作权限");
 
         // 更新作品信息
         boolean isEdit = editEntity(param, entity);