|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.hnac.hzinfo.inspect.task.service.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
@ -38,6 +39,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.mp.support.BladePage; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
@ -100,7 +102,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
|
|
|
|
|
private IObjectDangerService objectDangerService; |
|
|
|
|
@Autowired |
|
|
|
|
private PlanMapper planMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BladeLogger logger; |
|
|
|
|
@Autowired |
|
|
|
|
private TaskNoUserDataScopeMapper taskNoUserDataScopeMapper; |
|
|
|
|
|
|
|
|
@ -242,10 +245,17 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
|
|
|
|
|
} |
|
|
|
|
//检查任务
|
|
|
|
|
checkOpenMutipleTask(AuthUtil.getUserId()); |
|
|
|
|
TaskUserEntity userEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getClaimStatus, ClaimStatusEnum.COLLECT.getStatus()).eq(TaskUserEntity::getTaskId, task.getId())); |
|
|
|
|
LambdaQueryWrapper<TaskUserEntity> wrapper = Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getClaimStatus, ClaimStatusEnum.COLLECT.getStatus()).eq(TaskUserEntity::getTaskId, task.getId()); |
|
|
|
|
List<TaskUserEntity> claimUsers = taskUserService.list(wrapper); |
|
|
|
|
TaskUserEntity userEntity = CollectionUtil.isNotEmpty(claimUsers) ? claimUsers.get(0) : null; |
|
|
|
|
if (Func.isNotEmpty(userEntity)) { |
|
|
|
|
removeStartTaskId(id); |
|
|
|
|
throw new ServiceException("该任务已被领用,请刷新页面"); |
|
|
|
|
if(AuthUtil.getUserId().equals(userEntity.getUserId())) { |
|
|
|
|
logger.error("hzims:inspect:startTask:taskUser","任务id[" +id+ "]领用人员为:" + JSON.toJSONString(claimUsers)); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
removeStartTaskId(id); |
|
|
|
|
throw new ServiceException("该任务已被领用,请刷新页面"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//给当前人领取任务
|
|
|
|
|