rk
13 小时以前 19321e1348baefa2a9f5211c42f8b797c0fcccd1
登录验证
已添加2个文件
已修改15个文件
332 ■■■■ 文件已修改
server/system_service/src/main/java/com/doumee/api/cloud/SystemUserCloudController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/biz/system/SystemUserBiz.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/Constants.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/PasswordGenerator.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/service/system/SystemUserService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/service/system/impl/SystemUserServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/resources/mappers/SystemUserMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/SystemUserJobController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/api/common/PublicController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/common/PublicCloudController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/WebPublicController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/api/cloud/SystemUserCloudController.java
@@ -96,6 +96,16 @@
    }
    @Trace(withRequestParameters = false)
    @ApiOperation("修改是否禁用登录")
    @PostMapping("/updUserProhibitStatus")
    @CloudRequiredPermission("system:user:update")
    public ApiResponse updUserProhibitStatus(@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @RequestBody SystemUser systemUser) {
        systemUserBiz.updUserProhibitStatus(systemUser,this.getLoginUser(token));
        return ApiResponse.success(null);
    }
    @Trace(withRequestParameters = false)
    @ApiOperation("修改")
    @PostMapping("/updateById")
    @CloudRequiredPermission("system:user:update")
server/system_service/src/main/java/com/doumee/biz/system/SystemUserBiz.java
@@ -4,6 +4,8 @@
import com.doumee.dao.system.dto.CreateUserRoleDTO;
import com.doumee.dao.system.dto.ResetSystemUserPwdDTO;
import com.doumee.dao.system.dto.UpdatePwdDto;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.third.model.LoginUserInfo;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -57,6 +59,7 @@
     */
    void updateById(CreateSystemUserDTO systemUser);
    void updUserProhibitStatus(SystemUser user, LoginUserInfo loginUserInfo);
    /**
     * åˆ›å»ºç”¨æˆ·è§’色
     * @author Eva.Caesar Liu
server/system_service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
@@ -9,10 +9,8 @@
import com.doumee.core.annotation.excel.ExcelImporter;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.utils.*;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.PwdCheckUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.system.dto.*;
import com.doumee.dao.system.dto.UpdatePwdDto;
import com.doumee.dao.system.model.*;
@@ -31,6 +29,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -92,11 +91,17 @@
    public void updatePwd(UpdatePwdDto dto) {
        //登录密码复杂度校验:6-20个字符,至少包含字母、数字及特殊字符2种
        if(StringUtils.isBlank(dto.getNewPwd())
                ||dto.getNewPwd().length()>20
                ||dto.getNewPwd().length()<6
                ||!PwdCheckUtil.checkPassword(dto.getNewPwd())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,密码复杂度不满足要求:6-20个字符,至少包含字母、数字及特殊字符2种");
//                ||dto.getNewPwd().length()>20
//                ||dto.getNewPwd().length()<8
               // ||!PwdCheckUtil.checkPassword(dto.getNewPwd())
         ){
            //throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,密码复杂度不满足要求:6-20个字符,至少包含字母、数字及特殊字符2种");
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        PasswordGenerator.getPasswordTypeCount(dto.getNewPwd());
        SystemUser user = systemUserService.findById(dto.getUserId());
        if (user.getDeleted()) {
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "用户不存在或已被删除");
@@ -133,6 +138,7 @@
        if (systemUser == null || systemUser.getDeleted()) {
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "用户不存在或已被删除");
        }
        PasswordGenerator.getPasswordTypeCount(dto.getPassword());
        // ä¿®æ”¹å¯†ç 
        SystemUser updateUserDto = new SystemUser();
        updateUserDto.setId(dto.getId());
@@ -173,11 +179,13 @@
                throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "手机号【"+systemUser.getMobile()+"】已存在");
            }
        }
        String password = PasswordGenerator.generatePassword();
        // ç”Ÿæˆå¯†ç ç›
        String salt = RandomStringUtils.randomAlphabetic(6);
        // ç”Ÿæˆå¯†ç 
        systemUser.setPassword(Utils.Secure.encryptPassword(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INITIAL_PASSWORD).getCode(), salt));
        systemUser.setPassword(Utils.Secure.encryptPassword(password, salt));
        systemUser.setSalt(salt);
        systemUser.setFirstPassword(password);
        systemUser.setSource(Constants.ZERO);
        systemUser.setNeedChangePwd(Constants.ZERO);
@@ -282,6 +290,27 @@
        }*/
    }
    @Override
    public void updUserProhibitStatus(SystemUser user,LoginUserInfo loginUserInfo) {
       if(Objects.isNull(user)
           || Objects.isNull(user.getId())
           || Objects.isNull(user.getProhibitStatus())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
       }
       SystemUser updUser = new SystemUser();
       updUser.setId(user.getId());
       updUser.setProhibitStatus(user.getProhibitStatus());
       updUser.setProhibitRemark(Constants.equalsInteger(user.getProhibitStatus(),Constants.ZERO)?
               "于"+ DateUtil.getCurrDateTime()+"【"+loginUserInfo.getRealname()+"】操作手动解除禁止登录!":
               "于"+ DateUtil.getCurrDateTime()+"【"+loginUserInfo.getRealname()+"】操作手动开启禁止登录!");
       systemUserService.updateById(updUser);
    }
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public void createUserRole(CreateUserRoleDTO dto) {
server/system_service/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java
@@ -1,8 +1,10 @@
package com.doumee.config.jwt;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.dao.system.model.SystemDictData;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.HttpsUtil;
@@ -24,9 +26,7 @@
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
@Component
@@ -214,6 +214,34 @@
                .signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
                .compact();
        redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(userInfo),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
        String userTokenJsonStr = (String) redisTemplate.opsForValue().get(Constants.REDIS_USER_KEY+userInfo.getId());
        if(StringUtils.isEmpty(userTokenJsonStr)){
            redisTemplate.opsForValue().set(Constants.REDIS_USER_KEY+userInfo.getId(),Constants.REDIS_TOKEN_KEY+token);
        }else{
            List<String> list  = Arrays.asList(userTokenJsonStr.split(","));
            SystemDictData jointAccount = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.OPEN_JOINT_ACCOUNT);
            //关闭共用账户 éœ€è¦æ¸…空其他token信息
            if(Objects.nonNull(jointAccount)&&Constants.equalsInteger(Integer.valueOf(jointAccount.getCode()),Constants.ONE)){
                for (String s:list) {
                    redisTemplate.delete(s);
                }
                redisTemplate.delete(Constants.REDIS_USER_KEY+userInfo.getId());
                redisTemplate.opsForValue().set(Constants.REDIS_USER_KEY+userInfo.getId(),Constants.REDIS_TOKEN_KEY+token);
            }else{
                Boolean isHave = false;
                for (String s:list) {
                    if(s.equals(Constants.REDIS_TOKEN_KEY+token)){
                        isHave = true;
                        break;
                    }
                }
                if(!isHave){
                    redisTemplate.opsForValue().set(Constants.REDIS_USER_KEY+userInfo.getId(),userTokenJsonStr + "," + Constants.REDIS_TOKEN_KEY+token);
                }
            }
        }
        return token;
    }
server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -20,6 +20,7 @@
public class Constants {
    public static final String HEADER_USER_TOKEN = "dm_user_token";
    public static final String REDIS_USER_KEY = "user_token_list_";
    public static final String REDIS_TOKEN_KEY = "token_";
    public static final String REDIS_HK_TOKEN_KEY = "hk_token_";
    public static final String HK_TOKEN_VALIDITY = "HK_TOKEN_VALIDITY";
@@ -550,6 +551,7 @@
    public static final String PROHIBIT_TIME = "PROHIBIT_TIME";
    public static final String ERR_TIMES = "ERR_TIMES";
    public static final String PROHIBIT_LOGIN_OPEN = "PROHIBIT_LOGIN_OPEN";
    public static final String OPEN_JOINT_ACCOUNT = "OPEN_JOINT_ACCOUNT";
server/system_service/src/main/java/com/doumee/core/utils/PasswordGenerator.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
package com.doumee.core.utils;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import java.security.SecureRandom;
import java.util.HashSet;
import java.util.Set;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/10/27 16:23
 */
public class PasswordGenerator {
    private static final String LOWER = "abcdefghijklmnopqrstuvwxyz";
    private static final String UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    private static final String DIGITS = "0123456789";
    private static final String SYMBOLS = "!@#$%^&*()_+-=[]{};':|,.<>/?";
    private static final String PASSWORD_CHARS = LOWER + UPPER + DIGITS + SYMBOLS;
    private static final int PASSWORD_LENGTH = 8; // ä½ å¯ä»¥æ ¹æ®éœ€è¦è°ƒæ•´å¯†ç é•¿åº¦
    public static void getPasswordTypeCount(String password){
        Set<Integer> typeCount = new HashSet<>(4);
        for (int i = 0; i < password.length(); i++) {
            String key = password.substring(0,i);
            if(LOWER.indexOf(key)>=Constants.ZERO){
                typeCount.add(Constants.ZERO);
            }else if(UPPER.indexOf(key)>=Constants.ZERO){
                typeCount.add(Constants.ONE);
            }else if(DIGITS.indexOf(key)>=Constants.ZERO){
                typeCount.add(Constants.TWO);
            }else if(SYMBOLS.indexOf(key)>=Constants.ZERO){
                typeCount.add(Constants.THREE);
            }else{
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"请使用合法的密码内容");
            }
        }
        if(typeCount.size()<Constants.THREE||password.length()<8){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"密码至少包括数字、大写字母、小写字母、特殊字符中的三种字符,且至少8位数");
        }
    }
    public static String generatePassword() {
        SecureRandom random = new SecureRandom();
        StringBuilder password = new StringBuilder(PASSWORD_LENGTH);
        Set<Character> usedChars = new HashSet<>();
//        while (password.length() < PASSWORD_LENGTH) {
//            int index = random.nextInt(PASSWORD_CHARS.length());
//            char randomChar = PASSWORD_CHARS.charAt(index);
//            // ç¡®ä¿æ¯ç§ç±»åž‹çš„字符至少出现一次
//            if (usedChars.add(randomChar)) {
//                password.append(randomChar);
//            }
//        }
        // å¦‚果需要确保每种类型都至少出现一次,可以注释掉上面的循环,使用下面的代码:
        for (int i = 0; i < PASSWORD_LENGTH; i++) {
            int type = random.nextInt(4); // 0=lower, 1=upper, 2=digit, 3=symbol
            String charSet;
            switch (type) {
                case 0: charSet = LOWER; break;
                case 1: charSet = UPPER; break;
                case 2: charSet = DIGITS; break;
                default: charSet = SYMBOLS; break;
            }
            int index = random.nextInt(charSet.length());
            password.append(charSet.charAt(index));
        }
        // Shuffle the string to avoid predictable patterns (optional)
        password.toString().chars()
                .mapToObj(c -> (char) c)
                .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
                .toString(); // This line is a no-op, but it's here to show the method call for completeness.
        return password.toString();
    }
    public static void main(String[] args) {
        System.out.println("Generated Password: " + generatePassword());
    }
}
server/system_service/src/main/java/com/doumee/dao/system/model/SystemUser.java
@@ -120,6 +120,11 @@
    @ApiModelProperty(value = "密码错误次数", example = "1")
    private Integer errTimes;
    @ApiModelProperty(value = "初始化密码", example = "1")
    private String firstPassword;
    @ApiModelProperty(value = "禁止操作最后日志", example = "1")
    private String prohibitRemark;
    @ApiModelProperty(value = "0 å¯ç”¨ 1 ç¦ç”¨")
    private Integer status;
server/system_service/src/main/java/com/doumee/service/system/SystemUserService.java
@@ -1,5 +1,6 @@
package com.doumee.service.system;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.service.business.third.model.PageData;
import com.doumee.service.business.third.model.PageWrap;
import com.doumee.dao.system.dto.QuerySystemUserDTO;
@@ -96,5 +97,7 @@
     */
    long count(SystemUser systemUser);
    void jobForOpenProhibitStatus();
}
server/system_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -264,13 +264,14 @@
        if(!Constants.equalsInteger(user.getSource(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
        }
        if(StringUtils.isNotBlank( pwd)){
            String pppp = Utils.Secure.encryptPassword(new String(pwd), user.getSalt());
            // æ¯”较密码
            if( !StringUtils.equals(pppp, user.getPassword())){
                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
            }
        }
        this.checkPassword(user,pwd);
//        if(StringUtils.isNotBlank( pwd)){
//            String pppp = Utils.Secure.encryptPassword(new String(pwd), user.getSalt());
//            // æ¯”较密码
//            if( !StringUtils.equals(pppp, user.getPassword())){
//                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
//            }
//        }
        if(StringUtils.isNotBlank(openid)){
            dealOpenIdBiz(user,openid);
        }
@@ -294,45 +295,59 @@
    public void checkPassword(SystemUser user,String pwd){
        //验证是否已禁止登录
        this.prohibitLogin(user);
        String pppp = Utils.Secure.encryptPassword(new String(pwd), user.getSalt());
        // æ¯”较密码
        if( !StringUtils.equals(pppp, user.getPassword())){
            //是否开启密码错误禁止登录:0=否;1=是;
            SystemDictData prohibitLoginData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROHIBIT_LOGIN_OPEN);
            //密码错误禁止登录限制时间(分钟)
            SystemDictData prohibitTimeData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROHIBIT_TIME);
            updErrTimes(user,prohibitLoginData,prohibitTimeData);
            if(Objects.nonNull(prohibitLoginData)&&"1".equals(prohibitLoginData.getCode())){
                SystemDictData prohibitErrTimesData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ERR_TIMES);
                if(Objects.nonNull(prohibitErrTimesData)){
                    if(Integer.valueOf(prohibitErrTimesData.getCode())
                            -(Constants.formatIntegerNum(user.getErrTimes())+1) == Constants.ZERO){
                        throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(),"账号密码错误,账户已锁定,请"+prohibitTimeData.getCode()+"分钟后重试!");
                    }
                    throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(),"账号密码错误,剩余尝试次数"+(Integer.valueOf(prohibitErrTimesData.getCode())
                            -(Constants.formatIntegerNum(user.getErrTimes())+1))+"次,超出错误次数将锁定账号");
                }
                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
            }else{
                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
            }
        }else{
            systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda()
                    .set(SystemUser::getProhibitStatus,Constants.ZERO)
                    .set(SystemUser::getErrTimes,Constants.ZERO)
                    .setSql(" PROHIBIT_TIME = null ")
                    .eq(SystemUser::getId,user.getId())
            );
        }
    }
    public void updErrTimes(SystemUser systemUser){
    public void updErrTimes(SystemUser systemUser,SystemDictData prohibitLoginData,SystemDictData prohibitTimeData){
        //最大错误次数 è¿›è¡Œç™»å½•限制
        SystemDictData prohibitErrTimesData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ERR_TIMES);
        //是否开启密码错误禁止登录:0=否;1=是;
        SystemDictData prohibitLoginData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROHIBIT_LOGIN_OPEN);
        //密码错误禁止登录限制时间(分钟)
        SystemDictData prohibitTimeData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PROHIBIT_TIME);
        if(Objects.isNull(prohibitTimeData)||Objects.isNull(prohibitLoginData)||Objects.isNull(prohibitTimeData)){
            return;
        }
        systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda()
                .setSql( " PROHIBIT_STATUS = CASE WHEN "+prohibitLoginData+" = 1 and ( IFNULL(ERR_TIMES,0) + 1  ) > "+prohibitErrTimesData.getCode()+" then 1 else 0 end ")
                .setSql(" PROHIBIT_TIME = CASE WHEN  PROHIBIT_STATUS = 1  then DATE_ADD(NOW(), INTERVAL "+prohibitTimeData.getCode()+" MINUTE) else null end , ")
                .setSql( " PROHIBIT_STATUS = CASE WHEN "+prohibitLoginData.getCode()+" = 1 and ( IFNULL(ERR_TIMES,0) + 1  ) >= "+prohibitErrTimesData.getCode()+" then 1 else 0 end  ")
                .setSql(" PROHIBIT_TIME = CASE WHEN  PROHIBIT_STATUS = 1  then DATE_ADD(NOW(), INTERVAL "+prohibitTimeData.getCode()+" MINUTE) else null end  ")
                .setSql(" ERR_TIMES = (ifnull(ERR_TIMES,0) + 1) ")
                .setSql(" PROHIBIT_REMARK = '于"+DateUtil.getCurrDateTime()+"登录密码错误次数过多,禁止登录!' ")
                .eq(SystemUser::getId,systemUser.getId())
        );
    }
    public void prohibitLogin(SystemUser systemUser){
        if(Constants.equalsInteger(systemUser.getProhibitStatus(),Constants.ZERO)){
            Long betweenMin = DateUtil.getBetweenMin(systemUser.getProhibitTime(),new Date());
        if(Constants.equalsInteger(systemUser.getProhibitStatus(),Constants.ONE)){
            Long betweenMin = DateUtil.getBetweenMin(new Date(),systemUser.getProhibitTime());
            if(betweenMin <= 0L){
                betweenMin = 0L;
            }
@@ -355,11 +370,14 @@
        if(!Constants.equalsInteger(user.getSource(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
        }
        String pwd = Utils.Secure.encryptPassword(new String(dto.getPassword()), user.getSalt());
        // æ¯”较密码
        if( !StringUtils.equals(pwd, user.getPassword())){
            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
        }
//        String pwd = Utils.Secure.encryptPassword(new String(dto.getPassword()), user.getSalt());
//        // æ¯”较密码
//        if( !StringUtils.equals(pwd, user.getPassword())){
//            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
//        }
        this.checkPassword(user,dto.getPassword());
        dealOpenIdBiz(user,dto.getOpenid());
        Company company = new Company();
        if(Objects.nonNull(user.getCompanyId())){
@@ -537,11 +555,12 @@
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN.getCode(),"对不起,该账号不能登录司机端哦!");
        }
        if(StringUtils.isNotBlank(password)){
            String pwd = Utils.Secure.encryptPassword(new String(password), user.getSalt());
            // æ¯”较密码
            if( !StringUtils.equals(pwd, user.getPassword())){
                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
            }
//            String pwd = Utils.Secure.encryptPassword(new String(password), user.getSalt());
//            // æ¯”较密码
//            if( !StringUtils.equals(pwd, user.getPassword())){
//                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
//            }
            this.checkPassword(user,password);
        }
        dealOpenIdBiz(user,openid);
        Company company = new Company();
server/system_service/src/main/java/com/doumee/service/system/impl/SystemUserServiceImpl.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.model.Member;
import com.doumee.service.business.third.model.PageData;
import com.doumee.service.business.third.model.PageWrap;
@@ -93,6 +95,8 @@
    public void updateById(SystemUser systemUser) {
        systemUserMapper.updateById(systemUser);
    }
    @Override
    @Transactional
@@ -291,7 +295,6 @@
                }
            }
        }
        return result;
    }
@@ -315,4 +318,18 @@
    }
    @Override
    public void jobForOpenProhibitStatus() {
        systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda()
                .set(SystemUser::getProhibitStatus,Constants.ZERO)
                .set(SystemUser::getErrTimes,Constants.ZERO)
                .setSql(" PROHIBIT_REMARK = '于"+ DateUtil.getCurrDateTime()+"自动解除禁止登录!' ")
                .eq(SystemUser::getProhibitStatus,Constants.ONE)
                .apply("  now() > PROHIBIT_TIME " )
        );
    }
}
server/system_service/src/main/resources/mappers/SystemUserMapper.xml
@@ -27,7 +27,7 @@
      sd.ID AS DEPARTMENT_ID, sd.`NAME` AS DEPARTMENT_NAME,usr.wechat_name,usr.status,usr.OPENID,usr.type,
      create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, create_user.`REALNAME` CREATE_REAL_NAME,
      update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME, create_user.`REALNAME` UPDATE_REAL_NAME,
      sd.company_name_path as companyName
      sd.company_name_path as companyName, usr.PROHIBIT_STATUS,usr.PROHIBIT_TIME,usr.ERR_TIMES,usr.FIRST_PASSWORD,usr.PROHIBIT_REMARK,usr.NEED_CHANGE_PWD
    FROM `SYSTEM_USER` usr
    LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = usr.CREATE_USER
    LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = usr.UPDATE_USER
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -110,4 +110,9 @@
    @ApiOperation("【天气信息】定时同步天气预警")
    @PostMapping("/timer/weather/syncWeatherInfo")
    ApiResponse syncWeatherInfo();
    @ApiOperation("【用户信息】自动释放已禁用登录用户")
    @PostMapping("/timer/systemUserJob/jobForOpenProhibitStatus")
    ApiResponse jobForOpenProhibitStatus();
}
server/visits/admin_timer/src/main/java/com/doumee/api/SystemUserJobController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
package com.doumee.api;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.service.business.PlatformJobService;
import com.doumee.service.business.third.model.ApiResponse;
import com.doumee.service.system.SystemUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2023/11/30 15:33
 */
@Slf4j
@Api(tags = "月台作业定时")
@RestController
@RequestMapping("/timer/systemUserJob")
public class SystemUserJobController extends BaseController {
    @Autowired
    private SystemUserService systemUserService;
    @ApiOperation("自动释放已禁用登录用户")
    @PostMapping("/jobForOpenProhibitStatus")
    public ApiResponse jobForOpenProhibitStatus() {
        log.error("========自动释放已禁用登录用户============开始"+System.currentTimeMillis()+"");
        systemUserService.jobForOpenProhibitStatus();
        log.error("========自动释放已禁用登录用户============开始"+System.currentTimeMillis()+"");
        return ApiResponse.success("自动释放已禁用登录用户");
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/api/common/PublicController.java
@@ -131,6 +131,7 @@
                    String fileName = folder+fName;
                    boolean r = ftp.uploadInputstream(is,fileName);
                    if(r){
                        isFace = null;
                         if(Objects.nonNull(isFace) && Constants.equalsInteger(isFace,Constants.ZERO)){
                             //验证人脸评分
                            //人脸评分
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/common/PublicCloudController.java
@@ -232,6 +232,7 @@
                    String fileName = folder+"/"+fName;
                    boolean r = ftp.uploadInputstream(is,fileName);
                    if(r){
                        isFace = null;
                         if(Objects.nonNull(isFace) && Constants.equalsInteger(isFace,Constants.ZERO)){
                            //验证人脸评分
                            //人脸评分
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/WebPublicController.java
@@ -132,6 +132,7 @@
//                    boolean r = ftp.uploadInputstream(compressImg(is),fileName);
                    boolean r = ftp.uploadInputstream(is,fileName);
                    if(r){
                        isFace = null;
                         if(Objects.nonNull(isFace) && Constants.equalsInteger(isFace,Constants.ZERO)){
                            //验证人脸评分
                            //人脸评分
@@ -266,6 +267,7 @@
                    String key = folder + tempFileName;// æ–‡ä»¶å
                    ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key);
                    if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) {
                        isFace = null;
                        // ç§»åŠ¨æˆåŠŸ,返回文件名
                         if(Objects.nonNull(isFace) && Constants.equalsInteger(isFace,Constants.ZERO)){
                            //验证人脸评分
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetServiceImpl.java
@@ -481,12 +481,13 @@
                //查询车辆所有人员信息
                List<Member> memberList = memberMapper.selectJoinList(Member.class,new MPJLambdaWrapper<Member>()
                        .selectAll(Member.class)
                        .leftJoin(CarDriver.class,CarDriver::getMemberId,Member::getId)
                        .leftJoin(Cars.class,Cars::getMemberId,Member::getId)
                        .leftJoin(JkKeys.class,JkKeys::getCarId,Cars::getId)
                        .eq(Member::getIsdeleted,Constants.ZERO)
                        .eq(CarDriver::getIsdeleted,Constants.ZERO)
                        .eq(CarDriver::getStatus,Constants.ZERO)
                        .isNotNull(Member::getFaceImg)
                        .in(CarDriver::getCarId,carIdList)
                        .in(JkKeys::getId,carIdList)
                );
                if(CollectionUtils.isNotEmpty(memberList)){
                    Set<Member> memberSet = new HashSet<>(memberList);