Commit 63e9681a authored by xiamengchen's avatar xiamengchen

新增我的客户

parent 1f474103
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class ChatList {
private int chatContentType;
private String content;
private long id;
private boolean mine;
private int readFlag;
private Long receiverId;
private Long senderId;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class LinkList {
private Map<String, Object> session;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class RemindInfo {
private String id;
private String remindContent;
private int remindStatus;
private Long remindTime;
}
......@@ -7,8 +7,7 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
......@@ -21,6 +20,10 @@ public class ForwardAndRead implements Authorization {
private Long sellerId;
private String visitId;
private String insuranceId;
private String forwardTime;
private String activityConfId;
private String lottery_scId;
private String activityCustomPrizeId;
@BeforeClass
public void setUp() throws IOException{
......@@ -39,6 +42,8 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD, "接口请求失败", response.body().asString()));
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "转发素材失败", response.body().asString()));
forwardTime = response.jsonPath().getString("timestamp");
}
@Test(description = "代理人转发名片", priority = 2)
......@@ -55,10 +60,68 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(forwardResult, network.message(param, BasicConfig.FORWARD, "转发名片失败", response.body().asString()));
}
// @Test(description = "代理人转发抽奖", priority = 3)
// public void 转发抽奖() throws IOException{
// // 获取抽奖素材ID
// lottery_scId = getContentScId(BasicConfig.LOTTERY_CONTENTID);
//
// // 获取指定中奖客户信息
// Map<String, String> custInfos = new HashMap<>();
// custInfos.put("avatar", getUserInfo(BasicConfig.AGENT_TKU).get("avatar"));
// custInfos.put("visitorId", encodeId(decodeTku(BasicConfig.AGENT_TKU).get("userId")));
// custInfos.put("visitorNickname", getUserInfo(BasicConfig.AGENT_TKU).get("wxName"));
//
// // 指定客户中奖
// List<Object> winners = new ArrayList<>();
// winners.add(custInfos);
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("winners", winners);
// response = network.postResponse(param, BasicConfig.LOTTERRY_addWinnersEn);
// String winnerId = response.jsonPath().getString("data[0].winnerId");
// Assert.assertNotNull(winnerId, network.message(param, BasicConfig.LOTTERRY_addWinnersEn, "添加中奖客户失败", response.body().asString()));
//
// // 保存抽奖配置
// List<String> winnerIds = new ArrayList<>();
// winnerIds.add(winnerId);
// Map<String, Object> prizeDetails = new HashMap<>();
// prizeDetails.put("customPrizeRate", 100);
// prizeDetails.put("customPrizeType", 1);
// prizeDetails.put("prizeImg", "https://yun.duiba.com.cn/kjj-prize-nodeimages/redbag.png");
// prizeDetails.put("prizeName", "奖品红包");
// prizeDetails.put("totalStock", 1);
// prizeDetails.put("winnerIds", winnerIds);
//
// param = new HashMap<>();
// param.put("pageTitle", "暖心冬日好礼");
// param.put("prizeDetails", prizeDetails);
// param.put("scid", lottery_scId);
// response = network.postResponse(param, BasicConfig.LOTTERRY_saveOrUpdateConf);
// activityConfId = response.jsonPath().getString("data");
// Assert.assertNotNull(activityConfId, network.message(param, BasicConfig.LOTTERRY_saveOrUpdateConf, "抽奖配置保存失败,未生成活动ID", response.body().asString()));
//
// // 获取配置详情
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("activityConfId", activityConfId);
// response = network.getResponse(param, BasicConfig.LOTTERRY_getConf);
// activityCustomPrizeId = response.jsonPath().getString("data.prizeDetails[0].activityCustomPrizeId");
// Assert.assertEquals(response.jsonPath().getString("data.activityConfId"), activityConfId, network.message(param, BasicConfig.LOTTERRY_getConf, "获取配置与预期不对应", response.body().asString()));
// Assert.assertNotNull(activityCustomPrizeId, network.message(param, BasicConfig.LOTTERRY_getConf, "activityCustomPrizeId值为空", response.body().asString()));
//
// // 分享抽奖
// param = new HashMap<>();
// param.put("scId", lottery_scId);
// param.put("forwardType", 1);
// response = network.getResponse(param, BasicConfig.FORWARD);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD, "接口请求失败", response.body().asString()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.FORWARD, "分享抽奖活动失败", response.body().asString()));
// }
// 访客访问素材及产生线索
@Test(description = "访客阅读文章", priority = 3)
public void 访客阅读文章() throws IOException{
sellerId = (Long) getUserInfo(BasicConfig.VISITOR2_TKU).get("sellerId");
sellerId = decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
param = new HashMap<>();
param.put("scid", articleScId);
......@@ -73,8 +136,6 @@ public class ForwardAndRead implements Authorization {
@Test(description = "访客领取赠险", priority = 4)
public void 领取赠险() throws IOException{
response = network.getResponse(BasicConfig.USER_INFO);
System.out.println(response.body().asString());
// 获取赠险insuranceId
param = new HashMap<>();
param.put("scid", articleScId);
......@@ -96,11 +157,31 @@ public class ForwardAndRead implements Authorization {
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
// @Test(description = "访客阅读抽奖工具", priority = 5)
// public void 参与抽奖() throws IOException{
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("bizNo", activityConfId);
// param.put("from", 0);
// response = network.getResponse(param, BasicConfig.CONTENT_READ);
// String visitId = response.jsonPath().getString("data.visitId");
// }
//
// @Test(description = "点击抽奖", priority = 6)
// public void 点击抽奖() throws IOException{
// param = new HashMap<>();
// param.put("id", activityCustomPrizeId);
// param.put("scid", lottery_scId);
// param.put("activityConfId", activityConfId);
// response = network.postResponse(param, )
// }
// // 访客增加访问记录
// @Test(description = "增加动态访问记录", priority = 5)
// public void 增加动态访问记录() throws IOException{
// param = new HashMap<>();
// param.put("scid", articleScId);
// param.put("forwardTime", forwardTime);
// response = network.postResponse(param, BasicConfig.DYNAMIC_ADDVISIT);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "接口请求失败", response.body().asString()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "增加访问记录失败", response.body().asString()));
......@@ -159,17 +240,15 @@ public class ForwardAndRead implements Authorization {
}
// 获取用户信息
public Map<String, Object> getUserInfo(String userTku){
public Map<String, String> getUserInfo(String userTku){
network.agentCookies.put("tku", userTku);
response = network.getResponse(BasicConfig.USER_INFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.USER_INFO, "接口调用失败", response.body().asString()));
String avatar = response.jsonPath().getString("data.avatar");
String wxName = response.jsonPath().getString("data.wxName");
Long sellerId = response.jsonPath().getLong("data.sellerId");
Long userId = response.jsonPath().getLong("data.userId");
Map<String, Object> infos = new HashMap<>();
Map<String, String> infos = new HashMap<>();
infos.put("avatar", avatar);
infos.put("wxName", wxName);
infos.put("sellerId", sellerId);
infos.put("userId", userId);
network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
return infos;
}
......
......@@ -238,7 +238,7 @@ public class MyForward implements Authorization {
response = network.getResponse(param, BasicConfig.FORWARD_VISITRECORD);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD_VISITRECORD, "接口请求失败", response.body().asString()));
String encodeUserId = response.jsonPath().getString("data.list[0].userId");
Assert.assertEquals(encodeUserId, far.encodeId((Long) far.getUserInfo(VISITOR1_TKU).get("userId")), network.message(param, FORWARD_VISITRECORD, "筛选结果首条记录userId与预期不符", response.body().asString()));
Assert.assertEquals(encodeUserId, visitorEncodeUserId, network.message(param, FORWARD_VISITRECORD, "筛选结果首条记录userId与预期不符", response.body().asString()));
}
// 获取素材转发关系链
......
......@@ -263,7 +263,7 @@ public class WhoSawMe implements Authorization {
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");
int teamNumber = response.jsonPath().getInt("data.teamNumber");
Assert.assertTrue(hasSubordinate, network.message(param, BasicConfig.BOSS_ROLE, "用户查询无下级", response.body().asString()));
Assert.assertEquals(teamNumber, 2, network.message(param, BasicConfig.BOSS_ROLE, "代理人团队人数有误", response.body().asString()));
Assert.assertTrue(teamNumber >= 2, network.message(param, BasicConfig.BOSS_ROLE, "代理人团队人数有误", response.body().asString()));
}
// 代理人团队成员数
......@@ -274,7 +274,7 @@ public class WhoSawMe implements Authorization {
response = network.getResponse(param, BasicConfig.TEAMMEMBERNUM);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBERNUM, "接口请求失败", response.body().asString()));
int personalNum = response.jsonPath().getInt("data.personalNum");
Assert.assertEquals(personalNum, 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
Assert.assertTrue(personalNum >= 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
}
// // 获取今日团队数据
......@@ -294,28 +294,28 @@ public class WhoSawMe implements Authorization {
// Assert.assertEquals(gainSaleClueNum, 8, network.message(param, BasicConfig.TEAMDATA, "获得线索数量不为2", response.body().asString()));
// }
// 获取个人排行列表
@Test(description = "获取个人排行列表", priority = 22)
public void 获取个人排行列表() throws IOException{
param= new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 4);
param.put("superiorId", xxxSellerId);
param.put("listType", 4);
param.put("team", false);
response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
List<String> memberSids = Lists.newArrayList();
memberSids.add(far.encodeId(xxxSellerId));
memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
Assert.assertEquals(rankingLists.size(), 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
for (int i = 0; i < rankingLists.size(); i++){
boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
}
}
// // 获取个人排行列表
// @Test(description = "获取个人排行列表", priority = 22)
// public void 获取个人排行列表() throws IOException{
// param= new HashMap<>();
// param.put("pageIndex", 1);
// param.put("pageSize", 20);
// param.put("sortType", 4);
// param.put("superiorId", xxxSellerId);
// param.put("listType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
// List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
// List<String> memberSids = Lists.newArrayList();
// memberSids.add(far.encodeId(xxxSellerId));
// memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
// Assert.assertTrue(rankingLists.size() >= 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
// for (int i = 0; i < rankingLists.size(); i++){
// boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
// Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
// }
// }
// 团队任务
......@@ -474,7 +474,7 @@ public class WhoSawMe implements Authorization {
public void 查看转发素材访问列表() throws IOException{
// 获取首条素材列表中首条动态id
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(BasicConfig.VISITOR2_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -561,7 +561,7 @@ public class WhoSawMe implements Authorization {
public void tearDown() throws IOException{
// 登陆管理后台调用管理后台接口删除成员
param = new HashMap<>();
param.put("superiorSid", far.getUserInfo(BasicConfig.VISITOR2_TKU).get("sellerId"));
param.put("superiorSid", xxxSellerId);
param.put("childSid", childSellerId);
response = network.postResponse(param, BasicConfig.MANAGER_SELLERTEAM_REMOVEMEMBER);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.MANAGER_SELLERTEAM_REMOVEMEMBER, "删除成员失败", response.body().asString()));
......
......@@ -610,6 +610,7 @@ public class BasicConfig {
public static final String VISITHEADER = HOST + "/kjy/mp/visit/header/v2";
public static final String SELLERWEEKLY = HOST + "/kjy/mp/whoSawMe/sellerWeekly";
public static final String WEEKLY_LIST = HOST + "/kjy/mp/seller/weekly/list";
public static final String NEWFUNC_FIRSTVISIT = HOST + "/kjy/mp/newFunction/sellerFirstVisit";
// *************** 支付 ***************
......@@ -729,10 +730,27 @@ public class BasicConfig {
public static final String CUSTMATERIALS = HOST + "/kjy/mp/whoSawMe/materials";
public static final String CUSTLOTTERIES = HOST + "/kjy/mp/whoSawMe/lotteries";
public static final String CUSTFAVORITE = HOST + "/kjy/mp/whoSawMe/custFavorite";
public static final String GETTAGANDREMIND = HOST + "/kjy/mp/seller/getTagAndRemindInfo";
public static final String UPDATECUSTREMIND = HOST + "/kjy/mp/seller/saveOrUpdateCustomRemind";
public static final String GETREMINDINFOS = HOST + "/kjy/mp/seller/getRemindInfos";
public static final String DELETEREMIND = HOST + "/kjy/mp/seller/deleteCustomRemind";
public static final String UPDATEBIRTHREMIND = HOST + "/kjy/mp/seller/updateBirthdayRemindInfo";
public static final String UPDATEHOLIDAYREMIND = HOST + "/kjy/mp/seller/updateHolidayRemindInfo";
public static final String GETCUSTREMINDINFO = HOST + "/kjy/mp/seller/getCustomerRemindInfo";
public static final String CUSTOMERDETAIL = HOST + "/kjy/mp/seller/v2/customer/detail";
public static final String RELATIONINFO_HEADER = HOST + "/kjy/mp/seller/customer/getRelationInfoHeader";
public static final String RELATIONINFO_LIST = HOST + "/kjy/mp/seller/customer/getRelationInfoList";
public static final String RELATIONINFO_RANKING = HOST + "/kjy/mp/seller/customer/relation/ranking";
public static final String UPDATECUSTMATERIAL = HOST + "/kjy/mp/seller/v2/customer/material/saveOrUpdate";
// *************** 标签管理 ***************
public static final String TAG_ADDORUPDATE = HOST + "/kjy/mp/sellerTag/addOrUpdateTag";
public static final String TAG_GETLIST = HOST + "/kjy/mp/sellerTag/getTagList";
public static final String TAG_DELETE = HOST + "/kjy/mp/sellerTag/deleteTag";
// *************** 留言 ***************
public static final String CHAT_SEND = HOST + "/kjy/mp/chat/send";
public static final String CHAT_LIST = HOST + "/kjy/mp/chat/list";
public static final String CHAT_GETSUBSCRIBESTATUS = HOST + "/kjy/mp/chat/getSubscribeStatus";
public static final String CHAT_LINKMANLIST = HOST + "/kjy/mp/chat/sellerLinkmanList";
// *************** 文章 ***************
......
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