fix: 征求意见流程转办问题

This commit is contained in:
2024-10-08 11:40:25 +08:00
parent 959d938ae0
commit cfcc6584f7
3 changed files with 37 additions and 32 deletions
@@ -1,6 +1,7 @@
package com.jero.modules.system.service.impl; package com.jero.modules.system.service.impl;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.asymmetric.RSA; import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ClientException;
@@ -94,22 +95,22 @@ public class LoginServiceImpl implements ILoginService {
String rsaPublicKey = sysLoginModel.getRsaPublicKey(); String rsaPublicKey = sysLoginModel.getRsaPublicKey();
String rsaPrivateKey = redisUtil.get(rsaPublicKey) != null ? String.valueOf(redisUtil.get(rsaPublicKey)) : null; String rsaPrivateKey = redisUtil.get(rsaPublicKey) != null ? String.valueOf(redisUtil.get(rsaPublicKey)) : null;
// if(StrUtil.isEmpty(rsaPrivateKey)){ if(StrUtil.isEmpty(rsaPrivateKey)){
// return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面"); return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
// } }
//
// String captcha = sysLoginModel.getCaptcha(); String captcha = sysLoginModel.getCaptcha();
// if(StringUtils.isBlank(captcha)){ if(StringUtils.isBlank(captcha)){
// return Result.error("验证码无效"); return Result.error("验证码无效");
// } }
// String lowerCaseCaptcha = captcha.toLowerCase(); String lowerCaseCaptcha = captcha.toLowerCase();
// String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8); String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
// Object checkCode = redisUtil.get(realKey); Object checkCode = redisUtil.get(realKey);
// // 验证码前后端比较 // 验证码前后端比较
// if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) { if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
// return Result.error("验证码错误"); return Result.error("验证码错误");
// } }
// redisUtil.del(realKey); redisUtil.del(realKey);
try { try {
//解密获取密码和用户名 //解密获取密码和用户名
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey); password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
@@ -137,21 +138,21 @@ public class LoginServiceImpl implements ILoginService {
if (retryCount >= RETRY_LOGIN_MAX_COUNT){ if (retryCount >= RETRY_LOGIN_MAX_COUNT){
return Result.error("密码错误次数过多,请15分钟后重试"); return Result.error("密码错误次数过多,请15分钟后重试");
} }
// //2. 校验用户名或密码是否正确 //2. 校验用户名或密码是否正确
// String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt()); String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
// String syspassword = sysUser.getPassword(); String syspassword = sysUser.getPassword();
// if (!syspassword.equals(userpassword)) { if (!syspassword.equals(userpassword)) {
// // 重试登录次数加一 // 重试登录次数加一
// retryCount++; retryCount++;
// this.setRetryInfoToRedis(username, retryCount); this.setRetryInfoToRedis(username, retryCount);
// String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount); String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
// return Result.error(msg); return Result.error(msg);
// } }
// //登录成功,清除错误登录次数 //登录成功,清除错误登录次数
// redisUtil.del(RETRY_LOGIN_PREFIX + username); redisUtil.del(RETRY_LOGIN_PREFIX + username);
// if (checkSysPermission(username)) { if (checkSysPermission(username)) {
// return Result.error("该用户无权限,请联系管理员!"); return Result.error("该用户无权限,请联系管理员!");
// } }
//用户登录信息 //用户登录信息
userInfo(sysUser, result); userInfo(sysUser, result);
@@ -14,8 +14,10 @@ public class RevisionTaskNodeIdConstant {
public static final String ADVICE_COLLECT = "Activity_1riqzkp"; public static final String ADVICE_COLLECT = "Activity_1riqzkp";
/** 法规工程师派号 */ /** 法规工程师派号 */
public static final String SET_STANDARD_NUMBER = "Activity_11uuyg0"; public static final String SET_STANDARD_NUMBER = "Activity_11uuyg0";
/** 征求意见人员 */ /** 主起草人 */
public static final String MAIN_DRAFT_USER = "mainDraftUser"; public static final String MAIN_DRAFT_USER = "mainDraftUser";
/** 法规工程师 */
public static final String STANDARD_ENGINEER = "standardEngineer";
/** 征求意见人员 */ /** 征求意见人员 */
public static final String ADVICE_USER_LIST = "adviceUserList"; public static final String ADVICE_USER_LIST = "adviceUserList";
/** 开启征求意见 */ /** 开启征求意见 */
@@ -254,9 +254,11 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
if (adviceFlag) { if (adviceFlag) {
List<String> adviceUserList = Arrays.asList(data.getAdviceUsers().split(",")); List<String> adviceUserList = Arrays.asList(data.getAdviceUsers().split(","));
taskService.setVariable(taskId, ADVICE_USER_LIST, adviceUserList); taskService.setVariable(taskId, ADVICE_USER_LIST, adviceUserList);
taskService.setVariable(taskId, STANDARD_ENGINEER, curUserId);
taskService.setVariable(taskId, OPEN, true); taskService.setVariable(taskId, OPEN, true);
// 保存流程数据 // 保存流程数据
saveOrUpdate(data); saveOrUpdate(data);
userMap.put(STANDARD_ENGINEER, curUserId);
userMap.put(ADVICE_USER_LIST, data.getAdviceUsers()); userMap.put(ADVICE_USER_LIST, data.getAdviceUsers());
processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userMap); processNodeLinkService.saveNodeUserLink(processDefinitionId, processInstanceId, userMap);
} else { } else {