doum
10 小时以前 05ee96b3f690ad0ce4f47ad161e14f5f0d862707
server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java
@@ -373,8 +373,11 @@
     * api 地址 https://open.dingtalk.com/document/orgapp/asynchronous-sending-of-enterprise-session-messages
     * @throws ApiException
     */
    public void workInfoOANotice(Long agentId,String userIds,OapiMessageCorpconversationAsyncsendV2Request.Msg msg){
    public Boolean workInfoOANotice(Long agentId,String userIds,OapiMessageCorpconversationAsyncsendV2Request.Msg msg){
        try{
            if(CollectionUtils.isEmpty(msg)){
                return null;
            }
            DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
            OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
            request.setAgentId(agentId);
@@ -382,15 +385,16 @@
            request.setToAllUser(false);
            request.setMsg(msg);
            OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, "60c2df248ca93d4eafb4a04a2330d3d3");//getToken());
            OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, getToken());
            if(rsp.getErrcode().equals(Constants.DD_ERR_CODE)){
                return true;
            }else{
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),rsp.getMessage());
            }
        }catch (ApiException apiException){
        }
        return false;
    }
@@ -539,6 +543,9 @@
     */
    public String toDoNotice(String title,List<String> unionIdList,List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> fieldList,String url) {
        try{
            if(CollectionUtils.isEmpty(fieldList)){
                return null;
            }
            com.aliyun.dingtalktodo_1_0.Client client = DingTalk.createV1Client();
            CreateTodoTaskHeaders createTodoTaskHeaders = new CreateTodoTaskHeaders();
            createTodoTaskHeaders.xAcsDingtalkAccessToken = getToken();
@@ -558,7 +565,7 @@
                    .setTitle("去处理")
                    .setActionType(2)
                    .setParam(actionList0Param)
                    .setUrl("https://www.baidu.com") //TODO 详情地址
                    .setUrl(url) //TODO 详情地址
                    .setActionKey("ak-1-1");
            //详情页url跳转地址
            CreateTodoTaskRequest.CreateTodoTaskRequestDetailUrl detailUrl = new CreateTodoTaskRequest.CreateTodoTaskRequestDetailUrl()
@@ -669,6 +676,11 @@
    }
    /**
     * 访客报备与访客申请 钉钉待办
     * @param visits
     * @return
     */
    public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoVisitFiledInfo(Visits visits){
        List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>();
        CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList0 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList()
@@ -697,7 +709,11 @@
    }
    /**
     * 用车申请的 钉钉待办
     * @param carUseBook
     * @return
     */
    public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoCarUseBookFiledInfo(CarUseBook carUseBook){
        List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>();
        CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList1 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList()