Browse Source

更新!

TRX 1 năm trước cách đây
mục cha
commit
fa3ba04ff9

+ 2 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/devices/permiss/DevicePermissModel.java

@@ -7,6 +7,7 @@ import com.zhongshu.card.client.model.org.DepartmentModel;
 import com.zhongshu.card.client.model.org.OrganizationUserModel;
 import com.zhongshu.card.client.model.org.UserCountSimpleModel;
 import com.zhongshu.card.client.model.org.role.RoleModel;
+import com.zhongshu.card.client.model.org.role.RoleSimpleModel;
 import com.zhongshu.card.client.model.school.AreaSimpleModel;
 import com.zhongshu.card.client.model.school.DictInfoSimpleModel;
 import com.zhongshu.card.client.type.DataState;
@@ -108,7 +109,7 @@ public class DevicePermissModel extends SuperModel {
     private DictInfoSimpleModel position;
 
     @Schema(description = "角色信息")
-    private List<RoleModel> roles = new ArrayList<>();
+    private List<RoleSimpleModel> roles = new ArrayList<>();
 
     @Schema(description = "部门信息")
     private DepartmentModel department;

+ 0 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/org/OrganizationUserModel.java

@@ -2,7 +2,6 @@ package com.zhongshu.card.client.model.org;
 
 import com.github.microservice.auth.security.type.AuthType;
 import com.zhongshu.card.client.model.base.SuperModel;
-import com.zhongshu.card.client.model.org.role.RoleModel;
 import com.zhongshu.card.client.model.org.role.RoleSimpleModel;
 import com.zhongshu.card.client.model.school.DictInfoSimpleModel;
 import com.zhongshu.card.client.type.CertificateType;

+ 3 - 4
FullCardClient/src/main/java/com/zhongshu/card/client/model/org/register/UserCountRegisterParam.java

@@ -29,6 +29,9 @@ public class UserCountRegisterParam extends ProjectOidParam {
     @Schema(description = "验证密码")
     private String rePassWord;
 
+    @Schema(description = "所属机构oid")
+    private String oid;
+
     @Schema(description = "编码")
     private String code;
 
@@ -53,16 +56,12 @@ public class UserCountRegisterParam extends ProjectOidParam {
     @Schema(description = "职位")
     private String positionId;
 
-    @Schema(description = "用户在机构的类型")
-    private OrganizationUserType userType = OrganizationUserType.Teacher;
-
     @Schema(description = "用户状态")
     private UserState state = UserState.Normal;
 
     @Schema(description = "部门信息")
     private String departmentId;
 
-
     @Schema(description = "是否是管理员")
     private Boolean isAdmin = Boolean.FALSE;
 

+ 4 - 2
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/org/OrganizationUserServiceImpl.java

@@ -270,7 +270,6 @@ public class OrganizationUserServiceImpl extends SuperService {
 
         String loginName = phone;
         UserAccount userAccount = userCountDao.findTopByLoginName(loginName);
-
         if (ObjectUtils.isEmpty(userAccount)) {
             String password = param.getPassWord();
             String name = param.getName();
@@ -280,7 +279,6 @@ public class OrganizationUserServiceImpl extends SuperService {
                     name = "游客" + loginName.substring(8, 11);
                 }
             }
-            // 密码验证
 
             // 用户基本信息维护 电话号码为登录名
             RegisterUserAccountParam userAccountParam = new RegisterUserAccountParam();
@@ -288,6 +286,7 @@ public class OrganizationUserServiceImpl extends SuperService {
             userAccountParam.setPassword(password);
             userAccountParam.setPhone(param.getPhone());
             userAccountParam.setName(name);
+            userAccountParam.setRealName(name);
             userAccountParam.setCardNumber(param.getCardNumber());
             userAccountParam.setSex(param.getSex());
             userAccountParam.setProfilePic(param.getProfilePic());
@@ -298,6 +297,9 @@ public class OrganizationUserServiceImpl extends SuperService {
             String userId = userAccountContent.getContent();
             userAccount = userCountDao.findTopByUserId(userId);
         }
+        if (ObjectUtils.isEmpty(userAccount)) {
+            return ResultContent.buildFail("用户不存在");
+        }
 
 
         return ResultContent.buildSuccess();

+ 11 - 6
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/UserAccountServiceImpl.java

@@ -117,12 +117,14 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
         if (ObjectUtils.isEmpty(userAccount)) {
             String cardNumber = param.getCardNumber();
             String passWord = param.getPassword();
+
             if (StringUtils.isEmpty(passWord)) {
-                passWord = CardSystemDefault.DEFAULT_PASSWORD;
-            }
-            if (ValidateUtils.isIDCard(cardNumber)) {
-                passWord = cardNumber.substring(12, 18);
-                passWord = passWord.toLowerCase().replace("x", "0");
+                if (ValidateUtils.isIDCard(cardNumber)) {
+                    passWord = cardNumber.substring(12, 18);
+                    passWord = passWord.toLowerCase().replace("x", "0");
+                } else {
+                    passWord = CardSystemDefault.DEFAULT_PASSWORD;
+                }
             }
 
             String userId = "";
@@ -699,6 +701,8 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
             BeanUtils.copyProperties(entity, model);
             model.setLoginName("***");
             model.setPhone(DesenUtil.turnPhoneDesen(model.getPhone()));
+            model.setName(DesenUtil.turnNameDesen(model.getName()));
+            model.setRealName(DesenUtil.turnNameDesen(model.getRealName()));
         }
         return model;
     }
@@ -755,7 +759,8 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
             BeanUtils.copyProperties(entity, model);
             model.setPhone(DesenUtil.turnPhoneDesen(model.getPhone()));
             model.setCardNumber(DesenUtil.turnIDCardDesen(model.getCardNumber()));
-
+            model.setName(DesenUtil.turnNameDesen(model.getName()));
+            model.setRealName(DesenUtil.turnNameDesen(model.getRealName()));
             // 机构信息
             OrganizationMiniModel miniModel = organizationManagerService.toMiniModel(entity.getOrganization());
             model.setOrganization(miniModel);