Quellcode durchsuchen

fix: 业务组件、分组、仪表盘排序优化,分组新增查重接口

业务组件、分组、仪表盘排序优化,分组新增查重接口
hong.yang vor 1 Jahr
Ursprung
Commit
3dc5b16ae8

+ 2 - 0
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/biz/component/service/impl/BizComponentServiceImpl.java

@@ -39,6 +39,8 @@ public class BizComponentServiceImpl extends ServiceImpl<DataRoomBizComponentDao
         LambdaQueryWrapper<BizComponentEntity> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.like(StringUtils.isNotBlank(searchDTO.getName()), BizComponentEntity::getName, searchDTO.getName());
         queryWrapper.eq(StringUtils.isNotBlank(searchDTO.getType()), BizComponentEntity::getType, searchDTO.getType());
+        queryWrapper.orderByAsc(BizComponentEntity::getOrderNum);
+        queryWrapper.orderByDesc(BizComponentEntity::getCreateDate);
         PageVO<BizComponentEntity> page = this.page(searchDTO, queryWrapper);
         List<BizComponentEntity> list = page.getList();
         String urlPrefix = bigScreenConfig.getFile().getUrlPrefix();

+ 2 - 0
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/manage/service/impl/DataRoomPageServiceImpl.java

@@ -173,6 +173,8 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
         }
         queryWrapper.eq(PageEntity::getType, searchDTO.getType());
         queryWrapper.select(PageEntity::getId, PageEntity::getAppCode, PageEntity::getCode, PageEntity::getName, PageEntity::getParentCode, PageEntity::getOrderNum, PageEntity::getCoverPicture, PageEntity::getUpdateDate);
+        // 优先序号升序,其次更新时间降序
+        queryWrapper.orderByAsc(PageEntity::getOrderNum);
         queryWrapper.orderByDesc(PageEntity::getUpdateDate);
         PageVO<PageEntity> page = page(searchDTO, queryWrapper);
         List<PageEntity> list = page.getList();

+ 8 - 0
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/type/controller/TypeController.java

@@ -68,5 +68,13 @@ public class TypeController {
         return R.success();
     }
 
+    @PostMapping("/nameRepeat")
+    @ApiOperation(value = "分类名称重复校验", position = 40, produces = MediaType.APPLICATION_JSON_VALUE)
+    public R<Boolean> nameRepeat(@RequestBody TypeDTO typeDTO) {
+        ValidatorUtils.validateEntity(typeDTO, Update.class);
+        Boolean flag = typeService.checkNameRepeat(typeDTO.getId(), typeDTO.getType(), typeDTO.getName());
+        return R.success(flag);
+    }
+
 
 }

+ 3 - 2
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/type/service/impl/TypeServiceImpl.java

@@ -40,7 +40,7 @@ public class TypeServiceImpl extends ServiceImpl<DataRoomTypeDao, TypeEntity> im
             }
         }
         if (this.checkNameRepeat(null, typeDTO.getType(), entity.getName())) {
-            throw new GlobalException("分类名称重复");
+            throw new GlobalException("分组名称已存在");
         }
         this.save(entity);
         return entity.getId();
@@ -50,7 +50,7 @@ public class TypeServiceImpl extends ServiceImpl<DataRoomTypeDao, TypeEntity> im
     public void update(TypeDTO typeDTO) {
         TypeEntity entity = BeanConvertUtils.convert(typeDTO, TypeEntity.class);
         if (this.checkNameRepeat(typeDTO.getId(), typeDTO.getType(), entity.getName())) {
-            throw new GlobalException("分类名称重复");
+            throw new GlobalException("分组名称已存在");
         }
         this.updateById(entity);
     }
@@ -71,6 +71,7 @@ public class TypeServiceImpl extends ServiceImpl<DataRoomTypeDao, TypeEntity> im
         LambdaQueryWrapper<TypeEntity> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(TypeEntity::getType, type);
         queryWrapper.orderByAsc(TypeEntity::getOrderNum);
+        queryWrapper.orderByDesc(TypeEntity::getCreateDate);
         return this.list(queryWrapper);
     }