|
|
|
@ -10,6 +10,8 @@ import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgS |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
|
import com.project.ding.config.DingProperties; |
|
|
|
import com.project.ding.domain.entity.UserEntity; |
|
|
|
import com.project.ding.mapper.UserMapper; |
|
|
|
import com.project.information.application.ProductLineApplicationService; |
|
|
|
import com.project.task.domain.dto.TaskDTO; |
|
|
|
import com.project.task.domain.entity.TaskEntity; |
|
|
|
@ -19,6 +21,7 @@ import com.project.task.domain.service.NotifyTaskDomainService; |
|
|
|
import com.project.task.mapper.TaskMapper; |
|
|
|
import com.project.task.mapper.TaskUserMapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -26,6 +29,7 @@ import java.text.SimpleDateFormat; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
@Slf4j |
|
|
|
@ -43,6 +47,9 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
|
@Autowired |
|
|
|
private DingProperties dingTalkProperties; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
|
|
|
|
|
|
|
|
|
@ -63,7 +70,12 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
|
.eq(TaskUserEntity::getTaskId, task.getId())) |
|
|
|
.stream().map(TaskUserEntity::getUserId).toList(); |
|
|
|
|
|
|
|
sendBatchNewTasks(userIds , task); |
|
|
|
List<String> userIdFilter = userMapper.selectBatchIds(userIds).stream() |
|
|
|
.filter(user -> ObjectUtils.isNotEmpty(user.getDeptIdStr())) |
|
|
|
.filter(user -> user.getDeptIdStr().contains("10549213") || user.getId().equals("17456316000834265")) |
|
|
|
.map(UserEntity::getId) |
|
|
|
.toList(); |
|
|
|
sendBatchNewTasks(userIdFilter , task); |
|
|
|
} |
|
|
|
} |
|
|
|
@Override |
|
|
|
@ -81,7 +93,12 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
|
.eq(TaskUserEntity::getTaskId, task.getId())) |
|
|
|
.stream().map(TaskUserEntity::getUserId).toList(); |
|
|
|
|
|
|
|
sendBatchDeadlineTasks(userIds , task); |
|
|
|
List<String> userIdFilter = userMapper.selectBatchIds(userIds).stream() |
|
|
|
.filter(user -> ObjectUtils.isNotEmpty(user.getDeptIdStr())) |
|
|
|
.filter(user -> user.getDeptIdStr().contains("10549213") || user.getId().equals("17456316000834265")) |
|
|
|
.map(UserEntity::getId) |
|
|
|
.toList(); |
|
|
|
sendBatchDeadlineTasks(userIdFilter , task); |
|
|
|
} |
|
|
|
} |
|
|
|
private void sendBatchNewTasks(List<String> userIds , TaskDTO taskDTO) { |
|
|
|
|