|
|
|
@ -24,6 +24,7 @@ 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.beans.factory.annotation.Value; |
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
@ -57,6 +58,8 @@ public class DingUtil { |
|
|
|
@Autowired |
|
|
|
private DingProperties dingTalkProperties; |
|
|
|
|
|
|
|
@Value("${ding.corpId}") |
|
|
|
private String corpId; |
|
|
|
|
|
|
|
private static final String TICKET_KEY = "dingtalk:jsapi_ticket"; |
|
|
|
|
|
|
|
@ -266,7 +269,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); |
|
|
|
|
|
|
|
boolean approved = appealDTO.getStatus() != null && appealDTO.getStatus() == 2; |
|
|
|
StringBuilder markdown = new StringBuilder(); |
|
|
|
@ -274,6 +276,11 @@ public class DingUtil { |
|
|
|
.append(String.format("处理结果:%s\n\n" ,approved ? "同意" : "不同意")) |
|
|
|
.append(String.format("处理理由:%s" , appealDTO.getReason())); |
|
|
|
|
|
|
|
StringBuilder url = new StringBuilder(); |
|
|
|
url.append(String.format("http://172.16.25.182:5173/examResult/?" + |
|
|
|
"dd_nav_translucent=true&dd_full_screen=true&dd_nav_bgcolor=33E0EEFF" + |
|
|
|
"&corpid=%s&id=%d&index=%d",corpId,appealDTO.getId(),appealDTO.getQuestionSort())); |
|
|
|
|
|
|
|
//发送工作通知
|
|
|
|
DtCorpConversationMessage corpConversationMessage = DtCorpConversationMessage.builder() |
|
|
|
.agentId(dtService.getDtConfigStorage().getAgentId()) |
|
|
|
@ -282,7 +289,7 @@ public class DingUtil { |
|
|
|
.title("产品知识考核") |
|
|
|
.markdown(markdown.toString()) |
|
|
|
.singleTitle("查看详情") |
|
|
|
.singleUrl("https://www.baidu.com/") |
|
|
|
.singleUrl(url.toString()) |
|
|
|
.build()) |
|
|
|
.build(); |
|
|
|
|
|
|
|
|