diff --git a/src/main/java/com/biutag/supervision/service/TaskManagementService.java b/src/main/java/com/biutag/supervision/service/TaskManagementService.java index e9b363d..4894f70 100644 --- a/src/main/java/com/biutag/supervision/service/TaskManagementService.java +++ b/src/main/java/com/biutag/supervision/service/TaskManagementService.java @@ -16,6 +16,7 @@ import com.biutag.supervision.pojo.vo.TaskVo; import com.biutag.supervision.pojo.vo.TemperancePoliceVo; import com.biutag.supervision.util.CommonUtil; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -28,7 +29,7 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; - +@Slf4j @RequiredArgsConstructor @Service public class TaskManagementService { @@ -78,8 +79,13 @@ public class TaskManagementService { task.setTaskType("testing_alcohol"); if (CollectionUtil.isNotEmpty(dto.getUserList())) { Set departIds = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartId).collect(Collectors.toSet()); + log.info("departIds:" + String.join(",", departIds)); List departs = departService.listByIds(departIds); - task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、"))); + if(CollectionUtil.isNotEmpty(departs)){ + log.info("departs的长度:" + departs.size()); + task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、"))); + } + } if(CollectionUtil.isNotEmpty(dto.getUserList())){ Set departList = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartName).collect(Collectors.toSet());