TRX 1 سال پیش
والد
کامیت
fbe4584b7d

+ 7 - 7
FullCardClient/src/main/java/com/zhongshu/card/client/type/device/WeekDayType.java

@@ -6,13 +6,13 @@ import lombok.Getter;
  *
  */
 public enum WeekDayType {
-    Mon("周"),
-    Tues("周"),
-    Web("周"),
-    Thur("周"),
-    Fri("周"),
-    Sat("周"),
-    Sun("周"),
+    Mon("周"),
+    Tues("周"),
+    Wed("周三"),
+    Thur("周"),
+    Fri("周"),
+    Sat("周"),
+    Sun("周"),
     ;
 
     @Getter

+ 3 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/projectAbout/ProjectDictController.java

@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
 import org.springframework.data.web.PageableDefault;
 import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -63,6 +64,8 @@ public class ProjectDictController {
     @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
     public ResultContent<Page<ProjectDictModel>> page(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) ProjectDictSearch param) {
         Assert.hasText(param.getProjectOid(), "projectOid不能为空");
+        Sort sort = Sort.by(Sort.Order.desc("dictType"), Sort.Order.asc("sort"));
+        param.setOrderSort(sort);
         return projectDictService.page(param, pageable);
     }
 

+ 9 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/projectAbout/impl/ProjectDictDaoImpl.java

@@ -70,6 +70,15 @@ public class ProjectDictDaoImpl extends BaseImpl implements ProjectDictDaoExtend
         if (!CollectionUtils.isEmpty(criterias)) {
             criteria.andOperator(criterias.toArray(new Criteria[]{}));
         }
+
+        if (StringUtils.isNotEmpty(param.getKeyWord())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getKeyWord() + ".*$");
+            criteria.orOperator(
+                    Criteria.where("name").regex(pattern),
+                    Criteria.where("code").regex(pattern)
+            );
+        }
+
         return criteria;
     }
 

+ 6 - 7
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/org/Role.java

@@ -3,7 +3,6 @@ package com.zhongshu.card.server.core.domain.org;
 import com.github.microservice.auth.security.type.AuthType;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.client.type.RoleType;
-import com.zhongshu.card.client.type.school.RoleDefaultType;
 import com.zhongshu.card.server.core.domain.base.SuperMain;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
@@ -31,19 +30,19 @@ public class Role extends SuperMain {
     @Schema(description = "角色编码")
     private String code;
 
-    @Schema(description = "角色类型")
+    @Schema(description = "角色类型: 系统内置、自定义")
     private RoleType roleType;
 
-    @Schema(description = "角色类型")
+    @Schema(description = "角色主体类型,如:项目、机构、学校")
     private AuthType authType;
 
-    @Schema(description = "默认角色的类型")
-    private RoleDefaultType roleDefaultType;
-
-    @Schema(description = "是否管理角色")
+    @Schema(description = "是否管理角色,主要是给项目管理员,默认绑定一个角色用 ")
     @Indexed
     private Boolean isAdmin = Boolean.FALSE;
 
+    @Schema(description = "是否是游客角色")
+    private Boolean isVisitor = Boolean.FALSE;
+
     @Schema(description = "角色权限列表")
     @Indexed
     private Set<String> auth;

+ 15 - 2
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/projectAbout/ProjectDictService.java

@@ -24,6 +24,7 @@ import org.springframework.util.Assert;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 项目的字典管理
@@ -78,14 +79,18 @@ public class ProjectDictService extends SuperService {
         List<ProjectDictList> list = projectDictListDao.findByProjectDictOrderBySortAsc(projectDict);
         List<String> ids = new ArrayList<>();
         if (ObjectUtils.isNotEmpty(list)) {
-            ids = list.stream().map(it -> it.getId()).toList();
+            ids = list.stream().map(it -> it.getId()).collect(Collectors.toList());
         }
         if (ObjectUtils.isNotEmpty(params)) {
             List<ProjectDictList> saveList = new ArrayList<>();
+            long i = 1;
             for (ProjectDictListParam param : params) {
                 ProjectDictList projectDictList = new ProjectDictList();
                 BeanUtils.copyProperties(param, projectDictList);
+                projectDictList.setProjectDict(projectDict);
+                projectDictList.setSort(i++);
                 saveList.add(projectDictList);
+
                 if (StringUtils.isNotEmpty(param.getId()) && ids.contains(param.getId())) {
                     ids.remove(param.getId());
                 }
@@ -105,7 +110,7 @@ public class ProjectDictService extends SuperService {
             return ResultContent.buildFail("projectOid不存在");
         }
         Page<ProjectDict> page = projectDictDao.page(pageable, param);
-        return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toModel));
+        return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toAboutListModel));
     }
 
     public ResultContent deleteInfo(String id) {
@@ -157,6 +162,14 @@ public class ProjectDictService extends SuperService {
         if (ObjectUtils.isNotEmpty(entity)) {
             model = new ProjectDictAboutListModel();
             BeanUtils.copyProperties(entity, model);
+
+            // 子项
+            List<ProjectDictList> list = projectDictListDao.findByProjectDictOrderBySortAsc(entity);
+            List<ProjectDictListParam> models = new ArrayList<>();
+            if (ObjectUtils.isNotEmpty(list)) {
+                models = list.stream().map(this::toListModel).toList();
+            }
+            model.setList(models);
         }
         return model;
     }

+ 1 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/RoleServiceImpl.java

@@ -196,6 +196,7 @@ public class RoleServiceImpl extends SuperService {
         // 删除权限中心角色
         roleService.removeRole(role.getRoleId());
         roleService.removeRoleGroup(role.getRoleGroupId());
+        // 角色包含的场景
         roleSceneInfoService.deleteByRoleId(role.getId());
         return ResultContent.buildSuccess();
     }