|
|
|
@ -8,6 +8,8 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.project.base.domain.exception.BusinessErrorException; |
|
|
|
import com.project.base.domain.result.Result; |
|
|
|
import com.project.ding.domain.entity.UserEntity; |
|
|
|
import com.project.ding.domain.service.UserBaseService; |
|
|
|
import com.project.information.domain.entity.ProductLineEntity; |
|
|
|
import com.project.information.domain.service.ProductLineBaseService; |
|
|
|
import com.project.task.config.ExamScoreRatioConfig; |
|
|
|
@ -23,7 +25,9 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomainService { |
|
|
|
@ -40,6 +44,9 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain |
|
|
|
@Autowired |
|
|
|
private TaskBaseService taskBaseService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserBaseService userBaseService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@ -84,10 +91,16 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain |
|
|
|
.eq(TaskUserEntity::getTaskId , saveEntity.getId())); |
|
|
|
|
|
|
|
List<TaskUserEntity> taskUserEntityList = new ArrayList<>(); |
|
|
|
Map<String, String> userMap = userBaseService.lambdaQuery().select(UserEntity::getId, UserEntity::getName) |
|
|
|
.in(UserEntity::getId, dto.getParticipantUserIdList()).list() |
|
|
|
.stream() |
|
|
|
.collect(Collectors.toMap(UserEntity::getId, UserEntity::getName)); |
|
|
|
|
|
|
|
for (String userId : dto.getParticipantUserIdList()) { |
|
|
|
TaskUserEntity taskUserEntity = new TaskUserEntity(); |
|
|
|
taskUserEntity.setTaskId(saveEntity.getId()); |
|
|
|
taskUserEntity.setUserId(userId); |
|
|
|
taskUserEntity.setUserName(userMap.get(userId)); |
|
|
|
taskUserEntityList.add(taskUserEntity); |
|
|
|
} |
|
|
|
taskUserBaseService.saveBatch(taskUserEntityList); |
|
|
|
|