|  |  |  | 
|---|
|  |  |  | * 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); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param hiddenDanger | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public OapiMessageCorpconversationAsyncsendV2Request.Msg getHiddenDangerNoticeMsg(HiddenDanger hiddenDanger){ | 
|---|
|  |  |  | public OapiMessageCorpconversationAsyncsendV2Request.Msg getAlarmNoticeMsg(String areaName,String submitTime,String infoType){ | 
|---|
|  |  |  | OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); | 
|---|
|  |  |  | msg.setMsgtype("markdown"); | 
|---|
|  |  |  | OapiMessageCorpconversationAsyncsendV2Request.Markdown markdown = new OapiMessageCorpconversationAsyncsendV2Request.Markdown(); | 
|---|
|  |  |  | markdown.setTitle("园区存在安防/消防隐患"); | 
|---|
|  |  |  | markdown.setText(hiddenDanger.getAreaName()+"在"+DateUtil.formatDate(hiddenDanger.getSubmitTime(),"YYYY-MM-dd HH:mm")+"发生"+hiddenDanger.getCategoryName()+",请及时前往安防中心/消防中心进行处理"); | 
|---|
|  |  |  | markdown.setText(areaName+"在"+submitTime+"发生"+infoType+",请及时前往安防中心/消防中心进行处理"); | 
|---|
|  |  |  | msg.setMarkdown(markdown); | 
|---|
|  |  |  | return msg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | 
|---|
|  |  |  | .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() | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 访客报备与访客申请 钉钉待办 | 
|---|
|  |  |  | * @param visits | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoVisitFiledInfo(Visits visits){ | 
|---|
|  |  |  | List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>(); | 
|---|
|  |  |  | CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList0 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList() | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 用车申请的 钉钉待办 | 
|---|
|  |  |  | * @param carUseBook | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoCarUseBookFiledInfo(CarUseBook carUseBook){ | 
|---|
|  |  |  | List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>(); | 
|---|
|  |  |  | CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList1 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList() | 
|---|