|
@@ -31,6 +31,7 @@ import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
|
+import org.springblade.core.redis.cache.BladeRedis;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
@@ -96,6 +97,7 @@ public class TaskController extends BladeController {
|
|
private final IUserClient userClient;
|
|
private final IUserClient userClient;
|
|
private final ArchiveAutoClient archiveClient;
|
|
private final ArchiveAutoClient archiveClient;
|
|
private final ArchiveExpertConclusionClient conclusionClient;
|
|
private final ArchiveExpertConclusionClient conclusionClient;
|
|
|
|
+ private final BladeRedis bladeRedis;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 记录短信验证码超时时间
|
|
* 记录短信验证码超时时间
|
|
@@ -401,6 +403,14 @@ public class TaskController extends BladeController {
|
|
throw new ServiceException("未获取到任务人信息,操作失败");
|
|
throw new ServiceException("未获取到任务人信息,操作失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*加锁*/
|
|
|
|
+ String redisValue = bladeRedis.get("archive:approve:user:" + SecureUtil.getUserId());
|
|
|
|
+ if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
|
|
+ return R.fail(400, "请勿重复提交,3秒后再尝试");
|
|
|
|
+ }
|
|
|
|
+ bladeRedis.set("archive:approve:user:" + SecureUtil.getUserId(), "1");
|
|
|
|
+ bladeRedis.expire("archive:approve:user:" + SecureUtil.getUserId(), 3);
|
|
|
|
+
|
|
//预设流程,获取对应任务人id
|
|
//预设流程,获取对应任务人id
|
|
String resultString = "";
|
|
String resultString = "";
|
|
if (ObjectUtil.isNotEmpty(archiveTaskBatchReportDTO.getFixedFlowId())) {
|
|
if (ObjectUtil.isNotEmpty(archiveTaskBatchReportDTO.getFixedFlowId())) {
|
|
@@ -435,6 +445,8 @@ public class TaskController extends BladeController {
|
|
//创建上报任务
|
|
//创建上报任务
|
|
Map<Long, String> nameMap = jdbcTemplate.query("select id,name from blade_user where is_deleted = 0", new BeanPropertyRowMapper<>(User.class)).stream().collect(Collectors.toMap(User::getId, User::getName, (key1, key2) -> key1));
|
|
Map<Long, String> nameMap = jdbcTemplate.query("select id,name from blade_user where is_deleted = 0", new BeanPropertyRowMapper<>(User.class)).stream().collect(Collectors.toMap(User::getId, User::getName, (key1, key2) -> key1));
|
|
String[] userIds = archiveTaskBatchReportDTO.getUserIds().split(",");
|
|
String[] userIds = archiveTaskBatchReportDTO.getUserIds().split(",");
|
|
|
|
+ Set<String> uniqueUserIdsSet = new LinkedHashSet<>(Arrays.asList(userIds));
|
|
|
|
+ String[] uniqueUserIdsArray = uniqueUserIdsSet.toArray(new String[0]);
|
|
String[] dataArr = archiveTaskBatchReportDTO.getDataIds().split(",");
|
|
String[] dataArr = archiveTaskBatchReportDTO.getDataIds().split(",");
|
|
if (dataArr.length > 0) {
|
|
if (dataArr.length > 0) {
|
|
for (String id : dataArr) {
|
|
for (String id : dataArr) {
|
|
@@ -497,7 +509,7 @@ public class TaskController extends BladeController {
|
|
taskService.save(task);
|
|
taskService.save(task);
|
|
|
|
|
|
//创建任务相关信息
|
|
//创建任务相关信息
|
|
- for (String userId : userIds) {
|
|
|
|
|
|
+ for (String userId : uniqueUserIdsArray) {
|
|
TaskParallel taskParallel = new TaskParallel();
|
|
TaskParallel taskParallel = new TaskParallel();
|
|
taskParallel.setId(SnowFlakeUtil.getId());
|
|
taskParallel.setId(SnowFlakeUtil.getId());
|
|
taskParallel.setProcessInstanceId(processInstanceId.toString());
|
|
taskParallel.setProcessInstanceId(processInstanceId.toString());
|
|
@@ -529,8 +541,8 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
Set<String> aopParamsSet = new HashSet<>();
|
|
Set<String> aopParamsSet = new HashSet<>();
|
|
- if (userIds.length > 0) {
|
|
|
|
- for (String userId : userIds) {
|
|
|
|
|
|
+ if (uniqueUserIdsArray.length > 0) {
|
|
|
|
+ for (String userId : uniqueUserIdsArray) {
|
|
String param = userId + "," + archiveTaskBatchReportDTO.getProjectId() + "," + archiveTaskBatchReportDTO.getContractId();
|
|
String param = userId + "," + archiveTaskBatchReportDTO.getProjectId() + "," + archiveTaskBatchReportDTO.getContractId();
|
|
aopParamsSet.add(param);
|
|
aopParamsSet.add(param);
|
|
}
|
|
}
|