Browse Source

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 1 year ago
parent
commit
70d14e431c

+ 39 - 0
src/main/java/com/xjrsoft/common/enums/GenderDictionaryEnum.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.common.enums;
+
+public enum GenderDictionaryEnum {
+    /**
+     * 男
+     */
+    MALE("SB10001", "男"),
+    /**
+     * 女
+     */
+    FEMALE("SB10002", "女");
+
+    final String code;
+    final String value;
+
+    public String getCode() {
+        return this.code;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+
+    public static String getValue(String code) {
+        for (GenderDictionaryEnum item : values()) {
+            if (item.getCode().equals(code)) {
+                return  item.getValue();
+            }
+        }
+        return null;
+    }
+
+    GenderDictionaryEnum(final String code, final String message) {
+        this.code = code;
+        this.value = message;
+    }
+
+
+}

+ 4 - 0
src/main/java/com/xjrsoft/module/organization/controller/RoleController.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.constant.GlobalConstant;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.page.ConventPage;
@@ -177,6 +178,9 @@ public class RoleController {
         List<Long> userIds = list.stream().map(UserRoleRelation::getUserId).collect(Collectors.toList());
         List<User> users = userService.list(Wrappers.<User>query().lambda().in(User::getId, userIds).select(User.class, x -> VoToColumnUtil.fieldsToColumns(UserRoleVo.class).contains(x.getProperty())));
         List<UserRoleVo> userRoleVos = BeanUtil.copyToList(users, UserRoleVo.class);
+        for (UserRoleVo userRoleVo : userRoleVos) {
+            userRoleVo.setGenderCn(GenderDictionaryEnum.getValue(userRoleVo.getGender()));
+        }
         return R.ok(userRoleVos);
 
     }

+ 10 - 2
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -13,6 +13,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.model.result.R;
@@ -30,6 +31,7 @@ import com.xjrsoft.module.organization.service.*;
 import com.xjrsoft.module.organization.utils.OrganizationUtil;
 import com.xjrsoft.module.organization.vo.*;
 import com.xjrsoft.module.oss.factory.OssFactory;
+import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -136,7 +138,9 @@ public class UserController {
                     .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, User::getId)
                     .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId);
             IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class, queryUser);
-
+            for (UserPageVo record : page.getRecords()) {
+                record.setGenderCn(GenderDictionaryEnum.getValue(record.getGender()));
+            }
 
             PageOutput<UserPageVo> pageOutput = ConventPage.getPageOutput(page, UserPageVo.class);
 
@@ -171,6 +175,9 @@ public class UserController {
                             .leftJoin(UserRoleRelation.class, UserRoleRelation::getUserId, User::getId)
                             .leftJoin(Role.class, Role::getId, UserRoleRelation::getRoleId);
             IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class,queryUser);
+            for (UserPageVo record : page.getRecords()) {
+                record.setGenderCn(GenderDictionaryEnum.getValue(record.getGender()));
+            }
             PageOutput<UserPageVo> pageOutput = ConventPage.getPageOutput(page, UserPageVo.class);
             return R.ok(pageOutput);
         }
@@ -184,6 +191,7 @@ public class UserController {
             R.error("找不到此用户!");
         }
         UserVo userVo = BeanUtil.toBean(user, UserVo.class);
+        userVo.setGenderCn(GenderDictionaryEnum.getValue(userVo.getGender()));
         List<Long> deptIds = userDeptRelationService.list(Wrappers.lambdaQuery(UserDeptRelation.class)
                         .eq(UserDeptRelation::getUserId, user.getId()))
                 .stream().map(UserDeptRelation::getDeptId).collect(Collectors.toList());
@@ -210,7 +218,6 @@ public class UserController {
     @GetMapping(value = "/current/info")
     @ApiOperation(value = "当前登录用户信息")
     public R info() {
-
         SaSession tokenSession = StpUtil.getTokenSession();
         User user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new User());
 
@@ -227,6 +234,7 @@ public class UserController {
                 .stream().map(UserPostRelation::getPostId).collect(Collectors.toList());
 
         UserInfoVo vo = BeanUtil.toBean(user, UserInfoVo.class);
+        vo.setGenderCn(GenderDictionaryEnum.getValue(vo.getGender()));
         if (roleIds.size() > 0) {
 
             List<Role> list = roleService.list(Wrappers.lambdaQuery(Role.class).in(Role::getId, roleIds));

+ 1 - 0
src/main/java/com/xjrsoft/module/organization/entity/User.java

@@ -47,6 +47,7 @@ public class User extends AuditEntity implements Serializable {
     @ApiModelProperty("性别")
     private String gender;
 
+
     @ApiModelProperty("手机号")
     private String mobile;
 

+ 6 - 1
src/main/java/com/xjrsoft/module/organization/vo/UserInfoVo.java

@@ -47,7 +47,12 @@ public class UserInfoVo {
     /**
      * 性别
      */
-    private Integer gender;
+    private String gender;
+
+    /**
+     * 性别中文
+     */
+    private String genderCn;
 
     /**
      * 手机号

+ 6 - 1
src/main/java/com/xjrsoft/module/organization/vo/UserPageVo.java

@@ -43,7 +43,12 @@ public class UserPageVo implements Serializable {
     /**
      * 性别
      */
-    private Integer gender;
+    private String gender;
+
+    /**
+     * 性别中文
+     */
+    private String genderCn;
 
     /**
      * 手机号

+ 6 - 1
src/main/java/com/xjrsoft/module/organization/vo/UserRoleVo.java

@@ -21,5 +21,10 @@ public class UserRoleVo {
      */
     private String code;
 
-    private Integer gender;
+    private String gender;
+
+    /**
+     * 性别中文
+     */
+    private String genderCn;
 }

+ 6 - 1
src/main/java/com/xjrsoft/module/organization/vo/UserVo.java

@@ -41,7 +41,12 @@ public class UserVo implements Serializable {
     /**
      * 性别
      */
-    private Integer gender;
+    private String gender;
+
+    /**
+     * 性别中文
+     */
+    private String genderCn;
 
     /**
      * 手机号

+ 7 - 2
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.toolkit.MPJWrappers;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
@@ -80,7 +81,9 @@ public class StudentManagerController {
                         .leftJoin("base_grade a on a.id = t2.grade_id")
                         .leftJoin("base_major_set b on b.id = t2.major_set_id")
                         .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId));
-
+        for (BaseStudentUserPageVo record : page.getRecords()) {
+            record.setGenderCn(GenderDictionaryEnum.getValue(record.getGender()));
+        }
         PageOutput<BaseStudentUserPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentUserPageVo.class);
         return R.ok(pageOutput);
     }
@@ -118,7 +121,9 @@ public class StudentManagerController {
         if (baseStudentUser == null) {
             return R.error("找不到此数据!");
         }
-        return R.ok(BeanUtil.toBean(baseStudentUser, BaseStudentUserVo.class));
+        BaseStudentUserVo userVo = BeanUtil.toBean(baseStudentUser, BaseStudentUserVo.class);
+        userVo.setGenderCn(GenderDictionaryEnum.getValue(userVo.getGender()));
+        return R.ok(userVo);
     }
 
 

+ 1 - 1
src/main/java/com/xjrsoft/module/student/entity/BaseStudentUser.java

@@ -64,7 +64,7 @@ public class BaseStudentUser implements Serializable {
      * 性别
      */
     @ApiModelProperty("性别")
-    private Integer gender;
+    private String gender;
     /**
      * 手机号
      */

+ 6 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentUserPageVo.java

@@ -47,6 +47,12 @@ public class BaseStudentUserPageVo {
      */
     @ApiModelProperty("性别")
     private String gender;
+
+    /**
+     * 性别中文
+     */
+    @ApiModelProperty("性别中文")
+    private String genderCn;
     /**
      * 证件号码
      */

+ 8 - 1
src/main/java/com/xjrsoft/module/student/vo/BaseStudentUserVo.java

@@ -36,7 +36,14 @@ public class BaseStudentUserVo {
      * 性别
      */
     @ApiModelProperty("性别")
-    private Integer gender;
+    private String gender;
+
+    /**
+     * 性别中文
+     */
+    @ApiModelProperty("性别中文")
+    private String genderCn;
+
     /**
      * 手机号
      */

+ 9 - 1
src/main/java/com/xjrsoft/module/teacher/controller/TeacherbaseManagerController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.model.result.R;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
@@ -76,8 +77,13 @@ public class TeacherbaseManagerController {
                 .selectAsClass(BaseTeacher.class, XjrUserPageVo.class);
 
         IPage<XjrUser> page = teacherbaseManagerService.page(ConventPage.getPage(dto), queryWrapper);
+
         PageOutput<XjrUserPageVo> pageOutput = ConventPage.getPageOutput(page, XjrUserPageVo.class);
 
+        for (XjrUserPageVo record : pageOutput.getList()) {
+            record.setGenderCn(GenderDictionaryEnum.getValue(record.getGender()));
+        }
+
         return R.ok(pageOutput);
     }
 
@@ -89,7 +95,9 @@ public class TeacherbaseManagerController {
         if (xjrUser == null) {
            return R.error("找不到此数据!");
         }
-        return R.ok(BeanUtil.toBean(xjrUser, XjrUserVo.class));
+        XjrUserVo userVo = BeanUtil.toBean(xjrUser, XjrUserVo.class);
+        userVo.setGenderCn(GenderDictionaryEnum.getValue(userVo.getGender()));
+        return R.ok(userVo);
     }
 
 

+ 6 - 0
src/main/java/com/xjrsoft/module/teacher/vo/XjrUserPageVo.java

@@ -42,6 +42,12 @@ public class XjrUserPageVo {
     @ApiModelProperty("性别")
     private String gender;
 
+    /**
+     * 性别
+     */
+    @ApiModelProperty("性别中文")
+    private String genderCn;
+
     /**
      * 证件类型
      */

+ 6 - 1
src/main/java/com/xjrsoft/module/teacher/vo/XjrUserVo.java

@@ -43,7 +43,12 @@ public class XjrUserVo {
     * 性别
     */
     @ApiModelProperty("性别")
-    private Integer gender;
+    private String gender;
+    /**
+     * 性别
+     */
+    @ApiModelProperty("性别中文")
+    private String genderCn;
     /**
     * 手机号
     */