From 413ef95ca08807adb5d01de11ecc3ab8d11bb9a9 Mon Sep 17 00:00:00 2001 From: wang1 <844966816@qq.com> Date: 星期三, 14 六月 2023 14:58:56 +0800 Subject: [PATCH] 模板流程定义、模板阶段定义代码提交 --- Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java index bff3f90..7ce5654 100644 --- a/Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java @@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.vci.ubcs.system.cache.DictCache; @@ -40,7 +41,7 @@ import com.vci.ubcs.system.user.vo.UserVO; import com.vci.ubcs.system.user.wrapper.UserWrapper; import lombok.RequiredArgsConstructor; -import com.vci.ubcs.core.log.exception.ServiceException; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -67,6 +68,7 @@ @Service @RequiredArgsConstructor public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implements IUserService { + private static final String GUEST_NAME = "guest"; private final IUserDeptService userDeptService; @@ -307,6 +309,9 @@ } //鑾峰彇鐢ㄦ埛閲囩敤鐨勫瘑鐮佺瓥鐣� Strategy strategy = sysClient.getByUserId(userId).getData(); + if(ObjectUtil.isEmpty(strategy)) { + throw new ServiceException("褰撳墠鐢ㄦ埛鏈簲鐢ㄥ瘑鐮佺瓥鐣ワ紒"); + } //瀵嗙爜闀垮害鏍¢獙 if(newPassword1.length() < strategy.getMinPwdLen() || newPassword1.length() > strategy.getMaxPwdLen()){ throw new ServiceException("瀵嗙爜涓繀椤诲惈鏈夈��"+strategy.getCombinationNames()+"銆戜腑鐨勩��"+strategy.getRequiredType()+"銆戠瀵嗙爜缁勫悎鏂瑰紡锛屼笖瀵嗙爜闀垮害蹇呴』鍦ㄣ��"+strategy.getMinPwdLen()+"-"+strategy.getMaxPwdLen()+"銆戣寖鍥村唴"); @@ -331,7 +336,7 @@ regex = "^"+regex+"{"+strategy.getRequiredType()+",}$"; boolean result = RegexUtil.find(regex, newPassword1); if(!result){ - throw new ServiceException(resException); + //throw new ServiceException(resException); } //淇敼瀵嗙爜鍚屾椂锛屾敼鍙樼敤鎴蜂俊鎭腑鐨勫瘑鐮佷慨鏀圭姸鎬佸瓧娈�,瀵嗙爜淇敼鏃堕棿 return this.update(Wrappers.<User>update().lambda() @@ -481,8 +486,9 @@ if(adminUserId.equals(userId)){ return 0L; } + QueryWrapper<User> wrapper = Wrappers.<User>query().eq("ID", userId); //鑾峰彇鍒板瘑鐮佷慨鏀规椂闂� - Date pwdUpdateTime = this.getOne(Wrappers.<User>query().eq("ID", userId)).getPwdUpdateTime(); + Date pwdUpdateTime = this.getOne(wrapper).getPwdUpdateTime(); Long pwdupdateday = 0L; if(!Func.isEmpty(pwdUpdateTime)){ pwdupdateday = dateToDay(pwdUpdateTime); @@ -503,6 +509,11 @@ return 0L; } + @Override + public boolean updateByUseStrategyId(List<Long> userIds) { + return this.update(Wrappers.<User>lambdaUpdate().in(User::getId, userIds).set(User::getStrategyUpdateStatus,CommonConstant.IS_DEFAULT)); + } + /** * 鏃堕棿鏍煎紡杞ぉ * @param date -- Gitblit v1.9.3