Commit 45285156 authored by 龚小红's avatar 龚小红

增加盘点计划回收和新平台销售的测试用例

parent 0626c9d7
......@@ -3,7 +3,7 @@ package com.oto.bean;
import lombok.Data;
@Data
public class invitationRecord {
public class InvitationRecord {
public int recordId;
public String custName;
public boolean hasAssignFlag;
......
......@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.List;
@Data
public class inviteDay {
public class InviteDay {
public long calendarTime;
public List<invitationRecord> invitationInfo;
public List<InvitationRecord> invitationInfo;
}
package com.oto.bean;
import lombok.Data;
@Data
public class Plan {
public String planActionType;
public String actionTime;
public int actionSeller;
public Integer interviewSceneConfId;
public Plan(String planActionType, String actionTime, int actionSeller, Integer interviewSceneConfId) {
this.planActionType = planActionType;
this.actionTime = actionTime;
this.actionSeller = actionSeller;
this.interviewSceneConfId = interviewSceneConfId;
}
}
......@@ -83,6 +83,7 @@ public class Manager implements Authorization {
params.put("sellerLevel", 2);
params.put("workStatus", 1);
params.put("parentId", 28);
params.put("thirdParty",new int[]{1,2});
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
boolean data = response.jsonPath().getBoolean("data");
......@@ -106,6 +107,7 @@ public class Manager implements Authorization {
params.put("sellerLevel", 1);
params.put("roles", new int[]{5,});
params.put("parentId", LEADER_ID);
params.put("thirdParty",new int[]{1});
params.put("sellerName", "勿动-自动化测试邀约");
response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
data = response.jsonPath().getBoolean("data");
......@@ -133,6 +135,7 @@ public class Manager implements Authorization {
params.put("workStatus", 1);
params.put("assignNewCustPermission", 1);
params.put("assignRecycleCustPermission", 1);
params.put("thirdParty",new int[]{1,2});
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_saveSeller);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_saveSeller,"新增同一手机号销售成功",response.body().asString()));
......@@ -938,7 +941,40 @@ public class Manager implements Authorization {
params.put("pageSize", 5);
Response response =network.getResponse(params,BasicConfig.MANAGER_listForType);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_listForType,"查看导入文件上传记录不为空",response.body().asString()));
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_listForType,"查看导入文件上传记录为空",response.body().asString()));
}
@Test(description = "查询设备列表",priority = 61)
public void 查询设备列表(){
Response response =network.getResponse(BasicConfig.MANAGER_ykAvailableList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_ykAvailableList,"查看设备列表为空",response.body().asString()));
}
@Test(description = "绑定设备",priority = 62)
public void 绑定设备(){
HashMap<String,Object> params = new HashMap<>();
params.put("accountName", "imei4");
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.MANAGER_ykBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykBind,"绑定设备失败",response.body().asString()));
}
@Test(description = "解绑设备",priority = 63)
public void 解绑设备(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.MANAGER_ykUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykUnbind,"解绑设备失败",response.body().asString()));
}
@Test(description = "刷新设备绑定情况",priority = 64)
public void 刷新设备绑定情况(){
Response response =network.postResponse(BasicConfig.MANAGER_ykSyncBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykSyncBind,"刷新设备失败",response.body().asString()));
}
public int searchCustName(String custName){
......
......@@ -14,6 +14,8 @@ import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.*;
import static com.oto.cases.otoseller.Work.getSellerPlan;
import static com.oto.cases.otoseller.Work.planIds;
import static com.oto.utils.BaseUtils.*;
import static com.oto.utils.ThreadSleepUtils.sleep;
//手机端
......@@ -246,12 +248,12 @@ public class Phone implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
Response response = network.getResponse(params, BasicConfig.PHONE_custExtDetail);
int followWeight = response.jsonPath().getInt("data.followWeight");
String followWeight = response.jsonPath().getString("data.followWeight");
String interviewAddress = response.jsonPath().getString("data.interviewAddress");
int commitPlanFlag = response.jsonPath().getInt("data.commitPlanFlag");
String giveProspectusFlag = response.jsonPath().getString("data.giveProspectusFlag");
String expertName = response.jsonPath().getString("data.expertName");
Assert.assertEquals(followWeight,1,network.message(params,BasicConfig.PHONE_custExtDetail,"客户权重回显不为1",response.body().asString()));
Assert.assertNull(followWeight,network.message(params,BasicConfig.PHONE_custExtDetail,"客户权重回显不为1",response.body().asString()));
Assert.assertNotNull(interviewAddress,network.message(params,BasicConfig.PHONE_custExtDetail,"客户地址回显为空",response.body().asString()));
Assert.assertNull(giveProspectusFlag,network.message(params,BasicConfig.PHONE_custExtDetail,"是否可送计划书回显不为空",response.body().asString()));
Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.PHONE_custExtDetail,"是否已送计划书回显不为否",response.body().asString()));
......@@ -398,11 +400,11 @@ public class Phone implements Authorization {
Response response = network.getResponse(params, BasicConfig.PHONE_custExtDetail);
String interviewAddress = response.jsonPath().getString("data.interviewAddress");
int commitPlanFlag = response.jsonPath().getInt("data.commitPlanFlag");
int followWeight = response.jsonPath().getInt("data.followWeight");
String followWeight = response.jsonPath().getString("data.followWeight");
String giveProspectusFlag = response.jsonPath().getString("data.giveProspectusFlag");
String expertName = response.jsonPath().getString("data.expertName");
Assert.assertNotNull(interviewAddress,network.message(params,BasicConfig.PHONE_custExtDetail,"客户地址回显不为空",response.body().asString()));
Assert.assertNotNull(followWeight,network.message(params,BasicConfig.PHONE_custExtDetail,"客户等级回显不为1",response.body().asString()));
Assert.assertNull(followWeight,network.message(params,BasicConfig.PHONE_custExtDetail,"客户等级回显不为1",response.body().asString()));
Assert.assertNull(giveProspectusFlag,network.message(params,BasicConfig.PHONE_custExtDetail,"是否可送计划书不为空",response.body().asString()));
Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.PHONE_custExtDetail,"是否已送计划书不为否",response.body().asString()));
Assert.assertEquals(expertName,"勿动-自动化测试专家",network.message(params,BasicConfig.PHONE_custExtDetail,"专家回显错误,非【勿动-自动化测试专家】",response.body().asString()));
......@@ -658,7 +660,7 @@ public class Phone implements Authorization {
params.put("custId", IdMakeUtil.decodingId(cust_id));
Response response = network.getResponse(params, BasicConfig.WORK_historyRecord);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,7,network.message(params,BasicConfig.WORK_historyRecord,"邀约面访列表不为空",response.body().asString()));
Assert.assertEquals(size,6,network.message(params,BasicConfig.WORK_historyRecord,"邀约面访列表不为空",response.body().asString()));
}
@Test(description = "专家能查看关联自己的面访",priority = 57)
......@@ -672,6 +674,19 @@ public class Phone implements Authorization {
Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_interviewList,"专家面访列表为空",response.body().asString()));
}
@Test(description = "上传面访后完成见面计划",priority = 58)
public void 上传面访后完成见面计划(){
otoTakerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int phoneStatus = response.jsonPath().getInt("data.meets[0].planStatus");
Assert.assertEquals(phoneStatus,2,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划状态非已完成",response.body().asString()));
params.clear();
getSellerPlan(1,1,1,1,2,0);
}
@Test(description = "删除客户",priority = 79)
public void 删除客户(){
long id= IdMakeUtil.decodingId(cust_id);
......
package com.oto.cases.otoseller;
import com.oto.bean.Customer;
import com.oto.bean.invitationRecord;
import com.oto.bean.inviteDay;
import com.oto.bean.InvitationRecord;
import com.oto.bean.InviteDay;
import com.oto.bean.Plan;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import com.oto.utils.IdMakeUtil;
......@@ -36,9 +37,13 @@ public class Work implements Authorization {
public static long now; //当前时间戳
public static long today; //当前日期0点时间戳
public double takerCoefficient;
public static invitationRecord recordItem;
public static InvitationRecord recordItem;
public static Customer customer; //当前日期0点时间戳
public String wxUserKey; //外部联系人ID
public static String planIds; //计划ids
public static String beginTime; //周一日期
public static int tomorrowWeek; //明日周几
public int callRecordId; //任务ID
@BeforeTest
public void setUp(){
......@@ -50,6 +55,7 @@ public class Work implements Authorization {
ssoLogin();
now = System.currentTimeMillis();
today = now-(now + 8*3600 * 1000) % (60*60*24*1000);
// planIds = new ArrayList();
}
@Test(description = "公域引流_创建标签",priority = 1)
......@@ -368,14 +374,14 @@ public class Work implements Authorization {
coefficient.put("totalCoefficient",totalCoefficient);
}
@Test(description = "修改客户跟进权重",priority = 24)
public void 修改客户跟进权重(){
@Test(description = "修改客户客户等级",priority = 24)
public void 修改客户客户等级(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("followWeight", 1);
Response response = network.postResponse(params,BasicConfig.WORK_weight);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_weight,"修改客户跟进权重失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_weight,"修改客户客户等级失败",response.body().asString()));
}
@Test(description = "修改客户标签",priority = 25)
......@@ -1279,53 +1285,6 @@ public class Work implements Authorization {
Assert.assertEquals(bookingStatus,0,network.message(BasicConfig.PHONE_getReservationList,"预约状态错误:非待参观",response.body().asString()));
}
@Test(description = "提交客户盘点",priority = 94)
public void 提交客户盘点(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("checkConclusion","客户盘点后的结论1");
params.put("checkNext","");
params.put("custId",custId);
Response response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveCheckRecord,"提交客户盘点失败",response.body().asString()));
params.put("checkConclusion","");
params.put("checkNext","下一步干什么2");
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
params.put("checkConclusion","客户盘点后的结论");
params.put("checkNext","下一步干什么");
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
}
@Test(description = "查看盘点列表",priority = 95)
public void 查看盘点列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custId);
Response response =network.getResponse(params,BasicConfig.WORK_checkList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3,network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
String checkConclusion = response.jsonPath().getString("data[0].checkConclusion");
String checkNext = response.jsonPath().getString("data[0].checkNext");
Assert.assertEquals(checkConclusion,"客户盘点后的结论",network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
Assert.assertEquals(checkNext,"下一步干什么",network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
}
@Test(description = "查看盘点客户列表",priority = 96)
public void 查看盘点客户列表(){
sleep(10000);
HashMap<String,Object> params = new HashMap<>();
params.put("custName","自动化");
params.put("todayCheck",1);
params.put("pageIndex",1);
params.put("pageSize",50);
Response response =network.postResponse(params,BasicConfig.WORK_checkCustList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_checkCustList,"今日盘点客户不包含刚刚已经盘点的客户",response.body().asString()));
}
@Test(description = "关闭见面场景状态",priority = 97)
public void 关闭见面场景状态(){
HashMap<String,Object> params = new HashMap<>();
......@@ -1490,12 +1449,12 @@ public class Work implements Authorization {
public void 邀约完成任务(){
otoInviterAuth();
//notDeal -未接通,dealing-已接通
callling("15136361301",0,"notDeal");
callling("15136361301",0,"notDeal");
callling("15136361302",0,"notDeal");
callling("15136361303",30,"dealing");
callling("18248405155","15136361301",0,"notDeal");
callling("18248405155","15136361301",0,"notDeal");
callling("18248405155","15136361302",0,"notDeal");
callling("18248405155","15136361303",30,"dealing");
sleep(1000);
sleep(3000);
//销售完成面访,跟进时间更新,联系新客户任务完成
HashMap<String,Object> params = new HashMap<>();
params.put("taskConfId",7); //任务配置id,4:联系未跟进的客户,5:复拨未接通的客户,6:超过N天未跟进的客户
......@@ -1514,6 +1473,7 @@ public class Work implements Authorization {
Response response = network.getResponse(params,BasicConfig.WORK_showFeedback);
boolean data = response.jsonPath().getBoolean("data.hasUndoneFeedback");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_showFeedback,"电话表单回填状态错误:为不需要回填",response.body().asString()));
callRecordId = response.jsonPath().getInt("data.recordId");
sleep(1000);
params.put("custId", custId+2);
......@@ -1522,7 +1482,28 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_showFeedback,"电话表单回填状态错误:为不需要回填",response.body().asString()));
}
@Test(description = "校验邀约的通话统计信息",priority = 107)
@Test(description = "提交通话信息",priority = 107)
public void 提交通话信息(){
sleep(1000);
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("addWxStatus", "客户最关注养老社区什么");
params.put("considerAgedForWho", "为谁考虑养老");
params.put("custAddress", "杭州市文新地铁站");
params.put("custAge", 62);
params.put("custDescription", "客户通话的备注");
params.put("custGender", 1);
params.put("custName","自动化激活用户");
params.put("followWeight", 2);
params.put("recordId", callRecordId);
params.put("viewRetireCommunity", "社区参观情况");
Response response = network.postResponse(params,BasicConfig.WORK_callSubmit);
boolean data = response.jsonPath().getBoolean("data.hasUndoneFeedback");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_callSubmit,"提交通话信息失败",response.body().asString()));
}
@Test(description = "校验邀约的通话统计信息",priority = 108)
public void 校验邀约的通话统计信息(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
......@@ -1550,7 +1531,7 @@ public class Work implements Authorization {
Assert.assertNotNull(lastCallTime,network.message(params,BasicConfig.WORK_header,"新客户总通话次数非0",response.body().asString()));
}
@Test(description = "查找企微外部联系人",priority = 108)
@Test(description = "查找企微外部联系人",priority = 109)
public void 查找企微外部联系人(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
......@@ -1561,7 +1542,7 @@ public class Work implements Authorization {
wxUserKey = response.jsonPath().getString("data[0].externalUserKey");
}
@Test(description = "绑定客户企微",priority = 109)
@Test(description = "绑定客户企微",priority = 110)
public void 绑定客户企微(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
......@@ -1608,7 +1589,7 @@ public class Work implements Authorization {
Assert.assertEquals(bindWxWorkFlag,0,network.message(params,BasicConfig.WORK_header,"客户绑定标志非未绑定",response.body().asString()));
}
@Test(description = "销售专家查看全部客户列表",priority = 111)
@Test(description = "销售专家查看全部客户列表",priority = 112)
public void 销售专家查看全部客户列表(){
otoTakerAuth();
HashMap<String,Object> params = new HashMap<>();
......@@ -1624,7 +1605,7 @@ public class Work implements Authorization {
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_SellerCustList,"全部客户列表客户数量错误",response.body().asString()));
}
@Test(description = "查询成员列表",priority = 112)
@Test(description = "查询成员列表",priority = 113)
public void 查询成员列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("name", "自动化");
......@@ -1633,7 +1614,7 @@ public class Work implements Authorization {
Assert.assertEquals(size,5,network.message(params,BasicConfig.WORK_sellerList,"当前跟进人模糊搜索数量错误",response.body().asString()));
}
@Test(description = "修改重点跟进人",priority = 113)
@Test(description = "修改重点跟进人",priority = 114)
public void 修改重点跟进人(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
......@@ -1648,6 +1629,162 @@ public class Work implements Authorization {
Assert.assertEquals(followUp,4,network.message(params,BasicConfig.WORK_header,"客户重点跟进人错误",response.body().asString()));
}
@Test(description = "提交客户盘点",priority = 115)
public void 提交客户盘点(){
otoManagerAuth();
Calendar calendar = new GregorianCalendar();
calendar.setTime(new Date());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
HashMap<String,Object> params = new HashMap<>();
params.put("checkConclusion","客户盘点后的结论1");
params.put("checkNext","");
params.put("custId",custId);
calendar.add(calendar.DATE,2);
ArrayList<Plan> plans = new ArrayList<>();
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null));
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId));
params.put("plans",plans);
Response response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveCheckRecord,"提交客户盘点失败",response.body().asString()));
plans.clear();
params.put("checkConclusion","");
params.put("checkNext","下一步干什么2");
calendar.add(calendar.DATE,-1);
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null));
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId));
params.put("plans",plans);
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
plans.clear();
params.put("checkConclusion","客户盘点后的结论");
params.put("checkNext","下一步干什么");
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
}
@Test(description = "查看历史盘点列表",priority = 116)
public void 查看历史盘点列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custId);
Response response =network.getResponse(params,BasicConfig.WORK_checkList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3,network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
String checkConclusion = response.jsonPath().getString("data[0].checkConclusion");
String checkNext = response.jsonPath().getString("data[0].checkNext");
Assert.assertEquals(checkConclusion,"客户盘点后的结论",network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
Assert.assertEquals(checkNext,"下一步干什么",network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
}
@Test(description = "查看盘点客户列表",priority = 117)
public void 查看盘点客户列表(){
sleep(10000);
HashMap<String,Object> params = new HashMap<>();
params.put("custName","自动化");
params.put("todayCheck",1);
params.put("pageIndex",1);
params.put("pageSize",50);
Response response =network.postResponse(params,BasicConfig.WORK_checkCustList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_checkCustList,"今日盘点客户不包含刚刚已经盘点的客户",response.body().asString()));
}
@Test(description = "查看盘点计划跟进数据",priority = 118)
public void 查看盘点计划跟进数据(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
Response response = network.getResponse(params,BasicConfig.WORK_getFollowInfo);
boolean hasFollowFlag = response.jsonPath().getBoolean("data.hasFollowFlag");
int size = response.jsonPath().getInt("data.roleTypes.size()");
Assert.assertTrue(hasFollowFlag,network.message(params,BasicConfig.WORK_getFollowInfo,"客户没有销售或专家跟进",response.body().asString()));
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_getFollowInfo,"客户的跟进角色错误",response.body().asString()));
}
@Test(description = "销售查看个人工作计划",priority = 119)
public void 销售查看个人工作计划(){
otoTakerAuth();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar= Calendar.getInstance();
calendar.setTime(new Date());
tomorrowWeek = calendar.get(Calendar.DAY_OF_WEEK) ;//计算明日处于周几
calendar.add(Calendar.DATE, -tomorrowWeek+2);
beginTime = simpleDateFormat.format(calendar.getTime());
tomorrowWeek= tomorrowWeek-1;
getSellerPlan(0,1,0,1,1,0);
// planIds = (ArrayList) response.jsonPath().getList("data["+weekday+"].ids");
}
@Test(description = "总监查看团队工作计划",priority = 120)
public void 总监查看团队工作计划(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("beginTime", beginTime);
Response response = network.getResponse(params,BasicConfig.WORK_getDirectorPlanCalendarList);
int size = response.jsonPath().getInt("data.size()");
int flag = 0;
for(int i =0;i<size;i++){
if(response.jsonPath().getString("data["+i+"].sellerName").equals("勿动-自动化测试带看")){
flag = 1;
int plans = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].ids.size()");
Assert.assertEquals(plans,2,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的计划数量错误",response.body().asString()));
}
}
if (flag== 0){
Assert.fail(network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"团队计划中不包含总监零下销售",response.body().asString()));
}
}
@Test(description = "查看计划详情",priority = 121)
public void 查看计划详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int meetSize = response.jsonPath().getInt("data.meets.size()");
int phoneSize = response.jsonPath().getInt("data.phones.size()");
int meetStatus = response.jsonPath().getInt("data.meets[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus");
Assert.assertEquals(meetSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面列表总数错误",response.body().asString()));
Assert.assertEquals(phoneSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话列表总数错误",response.body().asString()));
Assert.assertEquals(meetStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划状态错误",response.body().asString()));
Assert.assertEquals(phoneStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态错误",response.body().asString()));
}
@Test(description = "主动拨通客户电话计划完成",priority = 122)
public void 主动拨通客户电话计划完成(){
callling("17823123001","15136361301",10,"dealing");
otoTakerAuth();
sleep(1000);
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus");
Assert.assertEquals(phoneStatus,2,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态非已完成",response.body().asString()));
params.clear();
getSellerPlan(0,1,1,1,1,0);
}
@Test(description = "查看历史计划",priority = 123)
public void 查看历史计划(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanList);
int size = response.jsonPath().getInt("data.list.size()");
String planStatusDesc1 = response.jsonPath().getString("data.list[0].planStatusDesc");
String planStatusDes2 = response.jsonPath().getString("data.list[1].planStatusDesc");
Assert.assertEquals(planStatusDesc1,"进行中",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(planStatusDes2,"已完成",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(size,4,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString()));
}
//修改客户的约面情况
public void updateInvite(int interviewFlag,long time){
HashMap<String,Object> params = new HashMap<>();
......@@ -1756,10 +1893,10 @@ public class Work implements Authorization {
SimpleDateFormat sdt = new SimpleDateFormat("yyyy-MM-dd");
params.put("calendarTime", sdt.format(now));
Response response =network.getResponse(params,BasicConfig.WORK_calendar_list);
List<inviteDay> invitationList = JsonUtil.parseResponseToListBean(response,inviteDay.class);
for (inviteDay day: invitationList) {
List<InviteDay> invitationList = JsonUtil.parseResponseToListBean(response, InviteDay.class);
for (InviteDay day: invitationList) {
if(day.calendarTime == calendarTime){
for(invitationRecord record:day.invitationInfo) {
for(InvitationRecord record:day.invitationInfo) {
if(record.custName != null && record.custName.equals(custName)){
flag=1;
recordItem = record;
......@@ -1802,10 +1939,33 @@ public class Work implements Authorization {
}
}
public void callling(String custPhone,int length,String callState){
//销售完成面访,跟进时间更新,联系新客户任务完成
String CALL_URL = CALL_BACK_1 + custPhone + CALL_BACK_2 + length +"&State=" +callState + CALL_BACK_3;
public void callling(String sellerPhone,String custPhone,int length,String callState){
//通话回传
String CALL_URL = CALL_BACK_1 +sellerPhone + "&CalledNo="+ custPhone + CALL_BACK_2 + length +"&State=" +callState + CALL_BACK_3;
Response response = network.getResponse(CALL_URL);
}
//获取电话回填客户约面信息
public static void getSellerPlan(int meetFinish,int meetTotal,int phoneFinish,int phoneTotal,int pStatus,int unFinishTypes){
HashMap<String, Object> params = new HashMap<>();
params.put("beginTime", beginTime);
Response response = network.getResponse(params,BasicConfig.WORK_getSellerPlanCalendarList);
int meetFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].meetFinishNum");
int meetTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].meetTotalNum");
int phoneFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].phoneFinishNum");
int phoneTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].phoneTotalNum");
int planStatus = response.jsonPath().getInt("data["+ tomorrowWeek +"].planStatus");
int unFinishPlanActionTypes = response.jsonPath().getInt("data["+ tomorrowWeek +"].unFinishPlanActionTypes.size()");
Assert.assertEquals(meetFinishNum,meetFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"见面完成数量错误",response.body().asString()));
Assert.assertEquals(meetTotalNum,meetTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"见面总数量错误",response.body().asString()));
Assert.assertEquals(phoneFinishNum,phoneFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"电话完成数量错误",response.body().asString()));
Assert.assertEquals(phoneTotalNum,phoneTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"电话总数量错误",response.body().asString()));
Assert.assertEquals(planStatus,pStatus,network.message(params,BasicConfig.WORK_updateFollowUp,"今日总计划状态错误",response.body().asString()));
Assert.assertEquals(unFinishPlanActionTypes,unFinishTypes,network.message(params,BasicConfig.WORK_updateFollowUp,"今日计划未完成动作类型数量错误",response.body().asString()));
planIds = response.jsonPath().getString("data["+ tomorrowWeek +"].ids");
planIds =planIds.replaceAll(" ","");
planIds = planIds.substring(1,planIds.length()-1);
}
}
......@@ -134,6 +134,10 @@ public class BasicConfig {
public static final String MANAGER_listForType = MANAGER_HOST + "/kjy/manager/live/import/listForType";
public static final String MANAGER_importOtoCustomer = MANAGER_HOST + "/kjy/manager/pub/form/importOtoCustomer";
public static final String MANAGER_result = MANAGER_HOST + "/kjy/manager/live/import/result";
public static final String MANAGER_ykAvailableList = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/availableList";
public static final String MANAGER_ykBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/bind";
public static final String MANAGER_ykUnbind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/unbind";
public static final String MANAGER_ykSyncBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/syncBind";
//*************** OTO销售工作台 ***************
public static final String WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha";
......@@ -220,6 +224,12 @@ public class BasicConfig {
public static final String WORK_getWxCustByName = WORK_HOST + "/kjy/oto/manager/customer/getWxCustByName";
public static final String WORK_bindWxCust = WORK_HOST + "/kjy/oto/manager/customer/bindWxCust";
public static final String WORK_updateFollowUp = WORK_HOST + "/kjy/oto/manager/customer/updateFollowUp";
public static final String WORK_getFollowInfo = WORK_HOST + "/kjy/oto/manager/customer/getFollowInfo";
public static final String WORK_getSellerPlanCalendarList = WORK_HOST + "/kjy/oto/manager/customer/getSellerPlanCalendarList";
public static final String WORK_getDirectorPlanCalendarList = WORK_HOST + "/kjy/oto/manager/customer/getDirectorPlanCalendarList";
public static final String WORK_getPlanDetail = WORK_HOST + "/kjy/oto/manager/customer/getPlanDetail";
public static final String WORK_getPlanList = WORK_HOST + "/kjy/oto/manager/customer/getPlanList";
public static final String WORK_callSubmit = WORK_HOST + "/kjy/oto/manager/customer/call/cust/info/submit";
//*************************客集集营销平台******************************
public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser";
......@@ -265,7 +275,7 @@ public class BasicConfig {
public static final String WORK_verifyCode = WORK_HOST + "/kjy/oto/auto/test/verifyCode";
public static final String WORK_delCust = WORK_HOST + "/kjy/oto/auto/test/delCust";
public static final String WORK_delPubFormRecord = WORK_HOST + "/kjy/oto/auto/test/delPubFormRecord";
public static final String CALL_BACK_1 = WORK_HOST + "/kjy/oto/notify/record?CallSheetID=e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd&CallID=e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd&CallType=dialout&CallNo=18248405155&CalledNo=";
public static final String CALL_BACK_1 = WORK_HOST + "/kjy/oto/notify/record?CallSheetID=e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd&CallID=e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd&CallType=dialout&CallNo=";
public static final String CALL_BACK_2 = "&Ring=2022-11-07%2013:57:06&RingingTime=&Begin=2022-11-07%2013:57:14&End=2022-11-07%2013:57:28&CallTimeLength=";
public static final String CALL_BACK_3 = "&MonitorFilename=http://work-phone-record.oss-cn-beijing.aliyuncs.com/20221103/20221103135706_16621273912_136****3947_e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd.mp3&RecordFile=20221103/20221103135706_16621273912_136****3947_e7b4efe0-e7bc-4fc1-9ce8-d7655dccc8cd.mp3&FileServer=http://work-phone-record.oss-cn-beijing.aliyuncs.com/&ring=2022-11-07%2013:57:06";
......
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