Commit 554087b1 by huangZW

111

parent 9e3440cf
package com.gic.haoban.manage.api.enums;
/**
* Created by tgs on 2020/2/20.
*/
public enum AppPageType {
//工作台
INDEX(1, ""),
//门店详情
STORE_DETAIL(2, "store_detail"),
//任务详情(会话、话务、不良评价)
TASK_DETAIL(3, "hbapp_task_detail"),
//日报详情
DAILY_DETAIL(4, "hbapp_task_daily_report_detail"),
//指标管理详情
PERFORMANCE_DETAIL(5, "hbapp_task_kpi_detail"),
//顾客详情
CUSTOMER_DETAIL(6, "hbapp_customer_detail"),
//会员列表
MEMBER_LIST(7, "hbapp_customer_list"),
//分配会员
DISTRIBUTE_MEMBER(8, "hbapp_customer_distribute"),
//任务列表
TASK_LIST(9, "hbapp_task_list"),
//商品详情
GOOD_DETAIL(10, "hbapp_commodity_detail");
AppPageType(int type, String desc){
this.code = type;
this.desc = desc;
}
private int code;
private String desc;
public static String getDescByCode(int type) {
for (AppPageType c : AppPageType.values()) {
if (c.getCode() == type) {
return c.desc;
}
}
return null;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
......@@ -29,6 +29,8 @@ public interface StaffDepartmentRelatedApiService {
String getWxUserIdByClerkId(String clerkId);
String getPageUrl(int type,String data);
//发送消息,单人发送
boolean sendSingleMessage(String wxUserId,String title,String content,String pageUrl);
......
package com.gic.haoban.manage.service.service.out.impl;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,6 +20,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.MessageDTO;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.config.Config;
......@@ -142,6 +145,22 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
boolean b = qywxSuiteApiService.sendMessage(config.getCorpid(), config.getSuiteId(), messageDTO);
return b;
}
@Override
public String getPageUrl(int type, String data) {
String baseUrl = "/pages/route/index";
String addurl = AppPageType.getDescByCode(type);
String url = "";
if(type == AppPageType.INDEX.getCode()){
//工作台
url = baseUrl+"?pageType="+addurl;
}else{
url = baseUrl+"?pageType="+addurl;
}
url = url+"&data="+data;
String resultUrl = URLEncoder.encode(url);
return resultUrl;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment