|
|
@@ -70,10 +70,11 @@ public class QywxSubsTask {
|
|
|
QywxAgent agent = agentService.findByCode("UasMobile");
|
|
|
//获取待推送的订阅信息
|
|
|
List<Map<String,Object>> remindList =uasSubsService.getSubs_instance(em.getEm_id());
|
|
|
- String process= dataCenter.getOuterUrl().substring(dataCenter.getOuterUrl().lastIndexOf("/")+1);
|
|
|
+ String agentUrl = agent.getOuterUrl();
|
|
|
+ String process = agentUrl.substring(agentUrl.indexOf("/",10)+1,agentUrl.indexOf("/",agentUrl.indexOf("/",10)+1));
|
|
|
if(remindList.size() > 0){
|
|
|
StringBuffer content = new StringBuffer();
|
|
|
- content.append("**您有<font color=blue>"+remindList.get(0).get("COUNTS")+"</font>个订阅信息**\n" );
|
|
|
+ content.append("**您有新的订阅信息**\n" );
|
|
|
for (Map<String,Object> remind: remindList) {
|
|
|
/* String paramsStr = "{\"numId\":\"" + remind.get("NUM_ID_") + "\",\"mainId\":" + remind.get("INSTANCE_ID_") +"\",\"insId\":" + remind.get("ID_") +"\",\"title\":" + remind.get("TITLE_") + ",\"baseUrl\":\"" + URLEncoder.encode(agent.getOuterUrl(), "utf-8") + "\"}";
|
|
|
String msgUrl = UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), dataCenter.getUsername(), "Uas", agent.getOuterUrl(),
|
|
|
@@ -85,15 +86,15 @@ public class QywxSubsTask {
|
|
|
}
|
|
|
for(int i=0; i<remindList.size(); i++){
|
|
|
if(i<2){
|
|
|
- msgUrl=UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), dataCenter.getUsername(), "UasMobile", agent.getOuterUrl(),
|
|
|
- dataCenter.getOuterUrl() + "api/authorize","uasMobile/#/"+process+"/uasMobile/subscribeChart/"+remindList.get(i).get("ID_")+"/"+remindList.get(i).get("NUM_ID_")
|
|
|
+ msgUrl=UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), dataCenter.getUsername(), "UasMobile", agentUrl.substring(0,agentUrl.indexOf("#")+2),
|
|
|
+ dataCenter.getOuterUrl() + "api/authorize",process+"/uasMobile/subscribeChart/"+remindList.get(i).get("ID_")+"/"+remindList.get(i).get("NUM_ID_")
|
|
|
+"/"+remindList.get(i).get("INSTANCE_ID_") );
|
|
|
content.append("> [").append(remindList.get(i).get("TITLE_")).append("]("+msgUrl+")\n");
|
|
|
}
|
|
|
}
|
|
|
if(remindList.size()>2){
|
|
|
- String moreUrl = UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), dataCenter.getUsername(), "UasMobile", agent.getOuterUrl(),
|
|
|
- dataCenter.getOuterUrl() + "api/authorize", "uasMobile/#/"+process+"/uasMobile/subscribeList");
|
|
|
+ String moreUrl = UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), dataCenter.getUsername(), "UasMobile", agentUrl.substring(0,agentUrl.indexOf("#")+2),
|
|
|
+ dataCenter.getOuterUrl() + "api/authorize", process+"/uasMobile/subscribeList");
|
|
|
content.append("[更多...](").append(moreUrl).append(")");
|
|
|
}
|
|
|
messageSdk.send("UasMobile", new SendMessageReq().markdown(content.toString()).toUser(em.getEm_qywx()));
|