Bladeren bron

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

dzx 1 jaar geleden
bovenliggende
commit
01d2ab5caf

+ 25 - 37
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -17,6 +17,7 @@ import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.model.result.R;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.sms.SmsCtcc;
@@ -24,17 +25,7 @@ import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.base.service.IBaseClassService;
-import com.xjrsoft.module.organization.dto.AddUserDto;
-import com.xjrsoft.module.organization.dto.BindOpenidDto;
-import com.xjrsoft.module.organization.dto.RegisterDto;
-import com.xjrsoft.module.organization.dto.ResetPasswordDto;
-import com.xjrsoft.module.organization.dto.UpdateInfoDto;
-import com.xjrsoft.module.organization.dto.UpdatePasswordDto;
-import com.xjrsoft.module.organization.dto.UpdateUserDto;
-import com.xjrsoft.module.organization.dto.UserPageDto;
-import com.xjrsoft.module.organization.dto.UserStudentAddDto;
-import com.xjrsoft.module.organization.dto.UserStudentBindDto;
-import com.xjrsoft.module.organization.dto.UserStudentDeleteDto;
+import com.xjrsoft.module.organization.dto.*;
 import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.entity.Post;
 import com.xjrsoft.module.organization.entity.Role;
@@ -203,10 +194,8 @@ public class UserController {
         return R.ok(userVo);
     }
 
-
     @PostMapping
     @ApiOperation(value = "新增用户")
-
     public R add(@Valid @RequestBody AddUserDto dto) {
         if (!OrganizationUtil.validatePassword(dto.getPassword())) {
             return R.error("密码必须包含大写字母、小写字母、数字和特殊字符,长度8~16位");
@@ -300,24 +289,32 @@ public class UserController {
 
     @PutMapping("/update/password")
     @ApiOperation(value = "当前登录用户修改本人密码")
-    public R updatePassword(@RequestBody @Valid UpdatePasswordDto dto) {
+    public RT<Boolean> updatePassword(@RequestBody @Valid UpdatePasswordDto dto) {
+        if (!OrganizationUtil.validatePassword(dto.getNewPassword())) {
+            return RT.error("密码必须包含大写字母、小写字母、数字和特殊字符,长度8~16位");
+        }
         User user = userService.getById(StpUtil.getLoginIdAsLong());
-//        if (!StrUtil.equals(SaSecureUtil.md5BySalt(dto.getOldPassword(), GlobalConstant.SECRET_KEY), user.getPassword())) {
-//            return R.error("当前密码填写错误!");
-//        }
+
         if (!BCrypt.checkpw(dto.getOldPassword(), user.getPassword())) {
-            return R.error("当前密码填写错误!");
+            return RT.error("当前密码填写错误!");
         }
         if (!StrUtil.equals(dto.getNewPassword(), dto.getConfirmPassword())) {
-            return R.error("2次密码输入不一致!");
+            return RT.error("2次密码输入不一致!");
         }
+        return RT.ok(userService.updatePassword(dto));
+    }
 
-        User updateUser = new User();
-        updateUser.setId(StpUtil.getLoginIdAsLong());
-//        updateUser.setPassword(SaSecureUtil.md5BySalt(dto.getNewPassword(), GlobalConstant.SECRET_KEY));
-        updateUser.setPassword(BCrypt.hashpw(dto.getNewPassword(), BCrypt.gensalt()));
-
-        return R.ok(userService.updateById(updateUser));
+    @PutMapping("/login/reset-password")
+    @ApiOperation(value = "登录后修改密码")
+    public RT<Boolean> loginResetPassword(@RequestBody @Valid LoginResetPasswordDto dto) {
+        if (!OrganizationUtil.validatePassword(dto.getNewPassword())) {
+            return RT.error("密码必须包含大写字母、小写字母、数字和特殊字符,长度8~16位");
+        }
+        if (!StrUtil.equals(dto.getNewPassword(), dto.getConfirmPassword())) {
+            return RT.error("2次密码输入不一致!");
+        }
+        UpdatePasswordDto pd = BeanUtil.toBean(dto, UpdatePasswordDto.class);
+        return RT.ok(userService.updatePassword(pd));
     }
 
     @PostMapping("/update/avatar")
@@ -385,17 +382,8 @@ public class UserController {
 
     @PutMapping("/reset-password")
     @ApiOperation(value = "重置密码")
-    public R resetPassword(@RequestBody ResetPasswordDto dto) {
-        User user = new User();
-        user.setId(dto.getId());
-//        user.setPassword(DigestUtil.md5Hex(propertiesConfig.getDefaultPassword()));
-//        user.setPassword(SaSecureUtil.md5BySalt(propertiesConfig.getDefaultPassword(), GlobalConstant.SECRET_KEY));
-        user.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
-        CompletableFuture.runAsync(() -> {
-            List<User> list = userService.list();
-            redisUtil.set(GlobalConstant.USER_CACHE_KEY, list);
-        });
-        return R.ok(userService.updateById(user));
+    public RT<Boolean> resetPassword(@RequestBody ResetPasswordDto dto) {
+        return RT.ok(userService.resetPassword(dto));
     }
 
     @PostMapping("/bind-openid")
@@ -444,7 +432,7 @@ public class UserController {
             return R.error("验证码不正确!");
         }
         // 赋值家长角色
-        dto.setPostId(RoleEnum.PARENT.getCode());
+        dto.setRoleId(RoleEnum.PARENT.getCode());
         return R.ok(userService.add(dto));
     }
 

+ 1 - 2
src/main/java/com/xjrsoft/module/organization/dto/AddUserDto.java

@@ -61,7 +61,7 @@ public class AddUserDto implements Serializable {
 
 //    @NotNull(message = "角色不能为空!")
     @ApiModelProperty("角色Id")
-    private Long postId;
+    private Long roleId;
 
     @ApiModelProperty("头像")
     private String avatar;
@@ -88,7 +88,6 @@ public class AddUserDto implements Serializable {
     @Length(max = 255,message = "备注字符不能超过60字符!")
     private String remark;
 
-    @NotNull(message = "部门不能为空!")
     @ApiModelProperty("部门id")
     private String departmentIds;
 

+ 18 - 0
src/main/java/com/xjrsoft/module/organization/dto/LoginResetPasswordDto.java

@@ -0,0 +1,18 @@
+package com.xjrsoft.module.organization.dto;
+
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class LoginResetPasswordDto implements Serializable {
+    @NotNull
+    @Length(min = 6,max = 32,message = "新密码长度不得小于6个字符,不得大于32个字符!")
+    private String newPassword;
+
+    @NotNull
+    @Length(min = 6,max = 32,message = "确认密码长度不得小于6个字符,不得大于32个字符!")
+    private String confirmPassword;
+}

+ 0 - 3
src/main/java/com/xjrsoft/module/organization/dto/UpdatePasswordDto.java

@@ -27,8 +27,5 @@ public class UpdatePasswordDto implements Serializable {
     @NotNull
     @Length(min = 6,max = 32,message = "确认密码长度不得小于6个字符,不得大于32个字符!")
     private String confirmPassword;
-
-
-
 }
 

+ 0 - 1
src/main/java/com/xjrsoft/module/organization/dto/UpdateUserDto.java

@@ -82,7 +82,6 @@ public class UpdateUserDto implements Serializable {
     @Length(max = 255,message = "备注字符不能超过255字符!")
     private String remark;
 
-    @NotNull(message = "部门不能为空!")
     @ApiModelProperty("部门id")
     private String departmentIds;
 

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

@@ -103,5 +103,8 @@ public class User extends AuditEntity implements Serializable {
     @ApiModelProperty("qq号码")
     private String qqNumber;
 
+    @ApiModelProperty("是否需要修改密码(1:需要 0:不需要)")
+    private Integer isChangePassword;
+
     private LocalDateTime birthDate;
 }

+ 17 - 3
src/main/java/com/xjrsoft/module/organization/service/IUserService.java

@@ -2,14 +2,14 @@ package com.xjrsoft.module.organization.service;
 
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.module.organization.dto.AddUserDto;
-import com.xjrsoft.module.organization.dto.UpdateUserDto;
-import com.xjrsoft.module.organization.dto.WeChatPageDto;
+import com.xjrsoft.module.organization.dto.*;
 import com.xjrsoft.module.organization.entity.User;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.xjrsoft.module.organization.vo.UserInfoVo;
 import com.xjrsoft.module.organization.vo.WeChatPageVO;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -28,6 +28,20 @@ public interface IUserService extends MPJBaseService<User> {
 
     boolean deleteBatch(List<Long> ids);
 
+    /**
+     * 修改密码
+     * @param dto
+     * @return
+     */
+    boolean updatePassword(UpdatePasswordDto dto);
+
+    /**
+     * 重置密码
+     * @param dto
+     * @return
+     */
+    boolean resetPassword(ResetPasswordDto dto);
+
     /**
      * 批量获取用户信息
      *

+ 58 - 20
src/main/java/com/xjrsoft/module/organization/service/impl/UserServiceImpl.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.organization.service.impl;
 
 import cn.dev33.satoken.secure.BCrypt;
 import cn.dev33.satoken.secure.SaSecureUtil;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.convert.Convert;
@@ -19,9 +20,8 @@ import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.organization.dto.AddUserDto;
-import com.xjrsoft.module.organization.dto.UpdateUserDto;
-import com.xjrsoft.module.organization.dto.WeChatPageDto;
+import com.xjrsoft.config.CommonPropertiesConfig;
+import com.xjrsoft.module.organization.dto.*;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserDeptRelation;
 import com.xjrsoft.module.organization.entity.UserPostRelation;
@@ -70,6 +70,8 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
 
     private final RedisUtil redisUtil;
 
+    private final CommonPropertiesConfig propertiesConfig;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean add(AddUserDto dto) {
@@ -77,17 +79,29 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
         if (count > 0) {
             throw new MyException("用户名称或编码已存在");
         }
+        count = count(Wrappers.<User>query().lambda().eq(User::getMobile, dto.getMobile()));
+        if (count > 0) {
+            throw new MyException("手机号码已存在");
+        }
         User user = BeanUtil.toBean(dto, User.class);
 
         //密码加密加盐存储到数据库
         user.setPassword(BCrypt.hashpw(dto.getPassword(), BCrypt.gensalt()));
         save(user);
 
+        // 添加角色
+        if (dto.getRoleId() != null) {
+            UserRoleRelation userRoleRelation = new UserRoleRelation();
+            userRoleRelation.setUserId(user.getId());
+            userRoleRelation.setRoleId(dto.getRoleId());
+            userRoleRelationMapper.insert(userRoleRelation);
+        }
+
         List<UserDeptRelation> userDeptRelationList = new ArrayList<>();
-        if (StrUtil.isNotBlank(dto.getDepartmentIds())){
+        if (StrUtil.isNotBlank(dto.getDepartmentIds())) {
             String allDeptIdStr = StrUtil.join(StringPool.COMMA, dto.getDepartmentIds());
             List<Long> departmentIds = Arrays.stream(allDeptIdStr.split(StringPool.COMMA)).map(Convert::toLong).collect(Collectors.toList());
-            if (CollectionUtil.isNotEmpty(departmentIds)){
+            if (CollectionUtil.isNotEmpty(departmentIds)) {
                 for (Long deptId : departmentIds) {
                     //将用户所选部门保存到关联表中
                     UserDeptRelation userDeptRelation = new UserDeptRelation();
@@ -96,7 +110,7 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
                     userDeptRelationList.add(userDeptRelation);
                 }
             }
-          userDeptRelationService.saveBatch(userDeptRelationList);
+            userDeptRelationService.saveBatch(userDeptRelationList);
         }
 
         CompletableFuture.runAsync(() -> {
@@ -126,12 +140,12 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
         updateById(user);
 
         //先删除再新增
-        userDeptRelationService.remove(Wrappers.<UserDeptRelation>query().lambda().eq(UserDeptRelation::getUserId,user.getId()));
+        userDeptRelationService.remove(Wrappers.<UserDeptRelation>query().lambda().eq(UserDeptRelation::getUserId, user.getId()));
         List<UserDeptRelation> userDeptRelationList = new ArrayList<>();
-        if (StrUtil.isNotBlank(dto.getDepartmentIds())){
+        if (StrUtil.isNotBlank(dto.getDepartmentIds())) {
             String allDeptIdStr = StrUtil.join(StringPool.COMMA, dto.getDepartmentIds());
             List<Long> departmentIds = Arrays.stream(allDeptIdStr.split(StringPool.COMMA)).map(Convert::toLong).collect(Collectors.toList());
-            if (CollectionUtil.isNotEmpty(departmentIds)){
+            if (CollectionUtil.isNotEmpty(departmentIds)) {
                 for (Long deptId : departmentIds) {
                     //将用户所选部门保存到关联表中
                     UserDeptRelation userDeptRelation = new UserDeptRelation();
@@ -160,24 +174,21 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
         //删除时需要同时删除用户部门关联表和用户角色关联表和用户岗位关系表数据。
         this.removeBatchByIds(ids);
         //根据用户ids去缓存中查询到对应的三个表的数据
-        List<UserDeptRelation> userDeptRelationList = redisUtil.get(GlobalConstant.USER_DEPT_RELATION_CACHE_KEY, new TypeReference<List<UserDeptRelation>>() {
-        });
-        List<UserPostRelation> userPostRelationList = redisUtil.get(GlobalConstant.USER_POST_RELATION_CACHE_KEY, new TypeReference<List<UserPostRelation>>() {
-        });
-        List<UserRoleRelation> userRoleRelationList = redisUtil.get(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, new TypeReference<List<UserRoleRelation>>() {
-        });
+        List<UserDeptRelation> userDeptRelationList = redisUtil.get(GlobalConstant.USER_DEPT_RELATION_CACHE_KEY, new TypeReference<List<UserDeptRelation>>() {});
+        List<UserPostRelation> userPostRelationList = redisUtil.get(GlobalConstant.USER_POST_RELATION_CACHE_KEY, new TypeReference<List<UserPostRelation>>() {});
+        List<UserRoleRelation> userRoleRelationList = redisUtil.get(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, new TypeReference<List<UserRoleRelation>>() {});
         //拿用户ids进行过滤,如果存在,就删除
         List<Long> deptRelationIds = userDeptRelationList.stream().filter(u -> ids.contains(u.getUserId())).map(UserDeptRelation::getId).collect(Collectors.toList());
         List<Long> postRelationIds = userPostRelationList.stream().filter(u -> ids.contains(u.getUserId())).map(UserPostRelation::getId).collect(Collectors.toList());
         List<Long> roleRelationIds = userRoleRelationList.stream().filter(u -> ids.contains(u.getUserId())).map(UserRoleRelation::getId).collect(Collectors.toList());
         //调用三个表的删除
-        if(CollectionUtil.isNotEmpty(deptRelationIds)){
+        if (CollectionUtil.isNotEmpty(deptRelationIds)) {
             userDeptRelationMapper.deleteBatchIds(deptRelationIds);
         }
-        if(CollectionUtil.isNotEmpty(postRelationIds)) {
+        if (CollectionUtil.isNotEmpty(postRelationIds)) {
             userPostRelationMapper.deleteBatchIds(postRelationIds);
         }
-        if(CollectionUtil.isNotEmpty(roleRelationIds)) {
+        if (CollectionUtil.isNotEmpty(roleRelationIds)) {
             userRoleRelationMapper.deleteBatchIds(roleRelationIds);
         }
         //更新缓存
@@ -197,6 +208,33 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
         return Boolean.TRUE;
     }
 
+    @Override
+    public boolean updatePassword(UpdatePasswordDto dto) {
+
+        User updateUser = new User();
+        updateUser.setId(StpUtil.getLoginIdAsLong());
+        updateUser.setPassword(BCrypt.hashpw(dto.getNewPassword(), BCrypt.gensalt()));
+        updateUser.setIsChangePassword(0);
+
+        return updateById(updateUser);
+
+    }
+
+    @Override
+    public boolean resetPassword(ResetPasswordDto dto) {
+        User user = new User();
+        user.setId(dto.getId());
+        user.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
+        user.setIsChangePassword(1);
+
+        CompletableFuture.runAsync(() -> {
+            List<User> list = list();
+            redisUtil.set(GlobalConstant.USER_CACHE_KEY, list);
+        });
+
+        return updateById(user);
+    }
+
     @Override
     public List<UserInfoVo> getUsersInfo(String ids) {
 
@@ -215,8 +253,8 @@ public class UserServiceImpl extends MPJBaseServiceImpl<UserMapper, User> implem
     @Override
     public PageOutput<WeChatPageVO> getPage(WeChatPageDto dto) {
         LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
-         queryWrapper.like(StrUtil.isNotBlank(dto.getKeyword()),User::getName,dto.getKeyword())
-                 .select(User.class,x -> VoToColumnUtil.fieldsToColumns(WeChatPageVO.class).contains(x.getProperty()));
+        queryWrapper.like(StrUtil.isNotBlank(dto.getKeyword()), User::getName, dto.getKeyword())
+                .select(User.class, x -> VoToColumnUtil.fieldsToColumns(WeChatPageVO.class).contains(x.getProperty()));
         IPage<User> page = userMapper.selectPage(ConventPage.getPage(dto), queryWrapper);
         List<User> records = page.getRecords();
         for (User record : records) {

+ 10 - 13
src/main/java/com/xjrsoft/module/system/service/impl/LoginServiceImpl.java

@@ -78,9 +78,6 @@ public class LoginServiceImpl implements ILoginService {
 
     private final UserRoleRelationMapper userRoleRelationMapper;
 
-    @Autowired
-    private CommonPropertiesConfig commonPropertiesConfig;
-
     @Override
     public LoginVo login(LoginDto dto) throws Exception {
         if (licenseConfig.getEnabled()) {
@@ -106,12 +103,12 @@ public class LoginServiceImpl implements ILoginService {
         String decryptData = RSAUtil.decrypt(dto.getPassword());
         dto.setPassword(decryptData);
 
-        LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(User::getUserName, dto.getUserName());
-        User loginUser = userService.getOne(queryWrapper);
-//        if (loginUser == null || !StrUtil.equals(loginUser.getPassword(), SaSecureUtil.md5BySalt(dto.getPassword(), GlobalConstant.SECRET_KEY))) {
-//            throw new MyException("账号或密码不正确");
-//        }
+        User loginUser = userService.getOne(
+                Wrappers.lambdaQuery(User.class)
+                        .eq(User::getUserName, dto.getUserName())
+                        .or()
+                        .eq(User::getMobile, dto.getUserName()));
+
         if (loginUser == null || !BCrypt.checkpw(dto.getPassword(), loginUser.getPassword())) {
             throw new MyException("账号或密码不正确");
         }
@@ -151,7 +148,7 @@ public class LoginServiceImpl implements ILoginService {
         String[] ids = weChatUtil.getMpOpenid(dto.getCode());
         if (ids == null) throw new MyException("code无效");
         if (StrUtil.isEmpty(ids[1])) {
-            throw new MyException("无法获取Uid"+ids[0]+"-"+ids[1]);
+            throw new MyException("无法获取Uid" + ids[0] + "-" + ids[1]);
         }
         List<User> userList = userService.list(Wrappers.lambdaQuery(User.class).eq(User::getUnionId, ids[1]));
         if (userList == null || userList.isEmpty()) throw new MyException("code无效");
@@ -207,6 +204,7 @@ public class LoginServiceImpl implements ILoginService {
                 .select(UserRoleRelation::getRoleId)
                 .eq(UserRoleRelation::getUserId, StpUtil.getLoginIdAsLong()));
         result.setUserType(roleMatching(relations));
+        result.setIsChangePassword(loginUser.getIsChangePassword());
 
         SaSession tokenSession = StpUtil.getTokenSession();
 
@@ -279,12 +277,11 @@ public class LoginServiceImpl implements ILoginService {
     public CreateTokenVo createToken(CreateTokenDto dto) {
         CreateTokenVo vo = new CreateTokenVo();
 
-        if(dto.getExpire() == -1){
+        if (dto.getExpire() == -1) {
             String token = SaTempUtil.createToken(IdUtil.fastSimpleUUID() + StringPool.UNDERSCORE + GlobalConstant.SECRET_KEY, Integer.MAX_VALUE);
             vo.setToken(token);
             return vo;
-        }
-        else {
+        } else {
             String token = SaTempUtil.createToken(IdUtil.fastSimpleUUID() + StringPool.UNDERSCORE + GlobalConstant.SECRET_KEY, dto.getExpire());
             vo.setToken(token);
             return vo;

+ 4 - 0
src/main/java/com/xjrsoft/module/system/vo/LoginVo.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.system.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -19,6 +20,9 @@ public class LoginVo {
      */
     private Long userType;
 
+    @ApiModelProperty("是否需要修改密码(1:需要 0:不需要)")
+    private Integer isChangePassword;
+
     /**
      * 跳转地址
      */

+ 1 - 1
src/main/resources/application-dev.yml

@@ -60,7 +60,7 @@ xjrsoft:
   common:
     druid-account: admin # druid 监控账户
     druid-password: admin # druid 监控密码
-    default-password: "000000" #默认密码(用户重置密码后为该密码)
+    default-password: "cqtlzjzx2023" #默认密码(用户重置密码后为该密码)
 #    domain-api: https://test.tl.web.yingcaibx.com/api #api域名地址
 #    domain-web: https://test.tl.web.yingcaibx.com #web域名地址
     domain-api: http://127.0.0.1:9000/api #api域名地址

+ 1 - 1
src/main/resources/application-prod.yml

@@ -60,7 +60,7 @@ xjrsoft:
   common:
     druid-account: admin # druid 监控账户
     druid-password: admin # druid 监控密码
-    default-password: "000000" #默认密码(用户重置密码后为该密码)
+    default-password: "cqtlzjzx2023" #默认密码(用户重置密码后为该密码)
     domain-api: https://zhxy.cqtlzjzx.com/api #api域名地址
     domain-web: https://zhxy.cqtlzjzx.com #web域名地址
     white-list:

+ 7 - 3
src/main/resources/sqlScript/20231120_sql.sql

@@ -15,9 +15,9 @@ CREATE TABLE base_student_scholarship_category
     `enabled_mark` INT NOT NULL COMMENT '有效标志',
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `name` VARCHAR(200) NOT NULL COMMENT '名称',
-    `scholarship_source` int NOT NULL DEFAULT 0 COMMENT '奖学金来源(xjr_dictionary_item[scholarship_source])',
+    `scholarship_source` varchar(20) NOT NULL DEFAULT 0 COMMENT '奖学金来源(xjr_dictionary_item[scholarship_source])',
     `base_semester_id` bigint NULL DEFAULT NULL COMMENT '学期ID(base_semester)',
-    `total_score` double NOT NULL DEFAULT 0 COMMENT '总金额',
+    `total_amount` double NOT NULL DEFAULT 0 COMMENT '总金额',
     `scholarship_level` int NOT NULL DEFAULT 0 COMMENT '奖学金等级 0=无等级',
     `remark` VARCHAR(1000) COMMENT '备注',
     PRIMARY KEY (`id`)
@@ -39,7 +39,7 @@ CREATE TABLE base_student_scholarship_level
     `sort_code` INT NULL DEFAULT NULL COMMENT '序号',
     `base_student_scholarship_category_id` bigint NULL DEFAULT NULL COMMENT '奖学金类别ID(base_student_scholarship_category)',
     `level` int NOT NULL DEFAULT 0 COMMENT '奖学金等级 0=无等级',
-    `score` double NOT NULL DEFAULT 0 COMMENT '金额',
+    `amount` double NOT NULL DEFAULT 0 COMMENT '金额',
     PRIMARY KEY (`id`)
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '奖学金级别';
 
@@ -77,6 +77,10 @@ CREATE TABLE base_student_scholarship_applicant
 ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT '奖学金申请';
 -- ------------------------------------------------------------------奖学金管理--------------------------------------------------------------------
 
+-- ------------------------------------------------------------------用户--------------------------------------------------------------------
+ALTER TABLE xjr_user ADD COLUMN `is_change_password` INT NOT NULL default 0 DEFAULT 1 COMMENT '是否需要修改密码(1:需要 0:不需要)' AFTER credential_type;
+-- ------------------------------------------------------------------用户--------------------------------------------------------------------
+