|
|
|
@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.api.DtService; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.department.DtDepart; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMessage; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgSendResult; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; |
|
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
@ -21,6 +22,7 @@ import com.project.ding.domain.dto.DepartmentDTO; |
|
|
|
import com.project.ding.domain.dto.DingUserDTO; |
|
|
|
import com.project.ding.domain.dto.UserDTO; |
|
|
|
import io.vavr.control.Try; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
@ -40,6 +42,7 @@ import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@Component |
|
|
|
@Slf4j |
|
|
|
public class DingUtil { |
|
|
|
@Autowired |
|
|
|
private DtService dtService; |
|
|
|
@ -260,7 +263,6 @@ public class DingUtil { |
|
|
|
/** |
|
|
|
* 发送工作通知 |
|
|
|
*/ |
|
|
|
@Async("asycExecutor") |
|
|
|
public void sendWorkNotice(AppealDTO appealDTO) throws DtErrorException { |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
String nowTime = LocalDateTime.now().format(formatter); |
|
|
|
@ -298,7 +300,10 @@ public class DingUtil { |
|
|
|
.build()) |
|
|
|
.build(); |
|
|
|
|
|
|
|
// dtService.getCorpConversationMsgService().send(corpConversationMessage);
|
|
|
|
DtCorpConversationMsgSendResult send = dtService.getCorpConversationMsgService().send(corpConversationMessage); |
|
|
|
log.info("发送工作通知结果:{}", send); |
|
|
|
log.info("获取工作通知结果:{}", getSendResult(send.getTaskId())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|