Commit 34e91084 authored by 龚小红's avatar 龚小红

Merge branch 'Feature/seller_plan' into 'master'

增加盘点策略和计划已盘标识

See merge request !60
parents 384e8a90 6ea8ac05
...@@ -44,6 +44,7 @@ public class Work implements Authorization { ...@@ -44,6 +44,7 @@ public class Work implements Authorization {
public static String beginTime; //周一日期 public static String beginTime; //周一日期
public static int tomorrowWeek; //明日周几 public static int tomorrowWeek; //明日周几
public int callRecordId; //任务ID public int callRecordId; //任务ID
public int strategyId; //盘点策略ID
@BeforeTest @BeforeTest
public void setUp(){ public void setUp(){
...@@ -1485,7 +1486,6 @@ public class Work implements Authorization { ...@@ -1485,7 +1486,6 @@ public class Work implements Authorization {
callling("18248405155","15136361301",0,"notDeal"); callling("18248405155","15136361301",0,"notDeal");
callling("18248405155","15136361302",0,"notDeal"); callling("18248405155","15136361302",0,"notDeal");
callling("18248405155","15136361303",30,"dealing"); callling("18248405155","15136361303",30,"dealing");
sleep(3000); sleep(3000);
//销售完成面访,跟进时间更新,联系新客户任务完成 //销售完成面访,跟进时间更新,联系新客户任务完成
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
...@@ -1599,7 +1599,7 @@ public class Work implements Authorization { ...@@ -1599,7 +1599,7 @@ public class Work implements Authorization {
Assert.assertEquals(bindCustId,custId,network.message(params,BasicConfig.WORK_getWxCustByName,"名字查找外部联系人列表为空",response.body().asString())); Assert.assertEquals(bindCustId,custId,network.message(params,BasicConfig.WORK_getWxCustByName,"名字查找外部联系人列表为空",response.body().asString()));
} }
@Test(description = "换绑客户企微",priority = 110) @Test(description = "换绑客户企微",priority = 111)
public void 换绑客户企微(){ public void 换绑客户企微(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId+1); params.put("custId", custId+1);
...@@ -1662,8 +1662,103 @@ public class Work implements Authorization { ...@@ -1662,8 +1662,103 @@ public class Work implements Authorization {
Assert.assertEquals(followUp,4,network.message(params,BasicConfig.WORK_header,"客户重点跟进人错误",response.body().asString())); Assert.assertEquals(followUp,4,network.message(params,BasicConfig.WORK_header,"客户重点跟进人错误",response.body().asString()));
} }
@Test(description = "总监可看策略列表",priority = 115)
public void 总监可看策略列表(){
otoLeaderAuth();
Response response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
int size = response.jsonPath().getInt("data.size()");
String strategyName = response.jsonPath().getString("data[0].strategyName");
Assert.assertEquals(size,1,network.message(BasicConfig.WORK_strategy_searchParentSeller,"总监可看策略数量错误",response.body().asString()));
Assert.assertEquals(strategyName,"自动化盘点策略",network.message(BasicConfig.WORK_strategy_searchParentSeller,"总监可看策略名称错误",response.body().asString()));
}
@Test(description = "新增盘点策略",priority = 116)
public void 新增盘点策略(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("sellerIds", new int[]{LEADER_ID});
params.put("strategyName", "自动化盘点策略");
params.put("strategyStatus", 0);
Response response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
boolean data = response.jsonPath().getBoolean("success");
Assert.assertFalse(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"团队新增同名盘点策略成功",response.body().asString()));
}
@Test(description = "查看盘点策略列表",priority = 117)
public void 查看盘点策略列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("strategyName", "自动化盘点策略");
params.put("pageIndex", "1");
params.put("pageSize", 50);
Response response = network.getResponse(params,BasicConfig.WORK_strategy_list);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_strategy_list,"新增盘点策略失败",response.body().asString()));
strategyId= response.jsonPath().getInt("data.list[0].id");
}
@Test(description = "修改盘点策略",priority = 118)
public void 修改盘点策略(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
params.put("sellerIds", new int[]{LEADER_ID});
params.put("strategyName", "自动化盘点可用策略");
params.put("strategyStatus", 0);
Response response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"修改盘点策略失败",response.body().asString()));
otoLeaderAuth();
response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,0,network.message(BasicConfig.WORK_strategy_searchParentSeller,"总监可看策略数量错误",response.body().asString()));
otoManagerAuth();
HashMap<String,Object> params1 = new HashMap<>();
params1.put("strategyName", "自动化盘点策略");
params1.put("pageIndex", "1");
params1.put("pageSize", 50);
response = network.getResponse(params1,BasicConfig.WORK_strategy_list);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_strategy_list,"修改盘点策略失败",response.body().asString()));
params.put("strategyName", "自动化盘点策略");
params.put("strategyStatus", 1);
response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"修改盘点策略失败",response.body().asString()));
}
@Test(description = "搜索团队",priority = 119)
public void 搜索团队(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "自动化");
Response response = network.getResponse(params,BasicConfig.WORK_strategy_searchParentSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_strategy_searchParentSeller,"搜索团队结果为空",response.body().asString()));
}
@Test(description = "修改盘点策略状态",priority = 120)
public void 修改盘点策略状态(){
//关闭状态
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
params.put("strategyStatus", 0);
Response response = network.postResponse(params,BasicConfig.WORK_strategy_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_updateStatus,"团队新增同名盘点策略成功",response.body().asString()));
//开启状态
params.put("strategyStatus", 1);
response = network.postResponse(params,BasicConfig.WORK_strategy_updateStatus);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_updateStatus,"团队新增同名盘点策略成功",response.body().asString()));
}
@Test(description = "提交客户盘点",priority = 115) @Test(description = "提交客户盘点",priority = 135)
public void 提交客户盘点(){ public void 提交客户盘点(){
otoManagerAuth(); otoManagerAuth();
Calendar calendar = new GregorianCalendar(); Calendar calendar = new GregorianCalendar();
...@@ -1671,7 +1766,7 @@ public class Work implements Authorization { ...@@ -1671,7 +1766,7 @@ public class Work implements Authorization {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("checkConclusion","客户盘点后的结论1"); params.put("checkConclusion","客户盘点后的结论1");
params.put("checkNext",""); params.put("strategyId",strategyId);
params.put("custId",custId); params.put("custId",custId);
calendar.add(calendar.DATE,2); calendar.add(calendar.DATE,2);
ArrayList<Plan> plans = new ArrayList<>(); ArrayList<Plan> plans = new ArrayList<>();
...@@ -1683,8 +1778,9 @@ public class Work implements Authorization { ...@@ -1683,8 +1778,9 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveCheckRecord,"提交客户盘点失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveCheckRecord,"提交客户盘点失败",response.body().asString()));
plans.clear(); plans.clear();
params.put("checkConclusion",""); sleep(2000);
params.put("checkNext","下一步干什么2"); params.put("checkConclusion","客户盘点后的结论2");
params.put("strategyId",strategyId);
calendar.add(calendar.DATE,-1); calendar.add(calendar.DATE,-1);
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null)); plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null));
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId)); plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId));
...@@ -1692,13 +1788,15 @@ public class Work implements Authorization { ...@@ -1692,13 +1788,15 @@ public class Work implements Authorization {
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord); response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
plans.clear(); plans.clear();
sleep(2000);
params.put("checkConclusion","客户盘点后的结论"); params.put("checkConclusion","客户盘点后的结论");
params.put("checkNext","下一步干什么"); params.put("strategyId",strategyId);
params.put("plans",plans);
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord); response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
} }
@Test(description = "查看历史盘点列表",priority = 116) @Test(description = "查看历史盘点列表",priority = 136)
public void 查看历史盘点列表(){ public void 查看历史盘点列表(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId",custId); params.put("custId",custId);
...@@ -1706,12 +1804,10 @@ public class Work implements Authorization { ...@@ -1706,12 +1804,10 @@ public class Work implements Authorization {
int size = response.jsonPath().getInt("data.size()"); int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3,network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString())); Assert.assertEquals(size,3,network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
String checkConclusion = response.jsonPath().getString("data[0].checkConclusion"); 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(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) @Test(description = "查看盘点客户列表",priority = 137)
public void 查看盘点客户列表(){ public void 查看盘点客户列表(){
sleep(10000); sleep(10000);
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
...@@ -1724,7 +1820,7 @@ public class Work implements Authorization { ...@@ -1724,7 +1820,7 @@ public class Work implements Authorization {
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_checkCustList,"今日盘点客户不包含刚刚已经盘点的客户",response.body().asString())); Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_checkCustList,"今日盘点客户不包含刚刚已经盘点的客户",response.body().asString()));
} }
@Test(description = "查看盘点计划跟进数据",priority = 118) @Test(description = "查看盘点计划跟进数据",priority = 138)
public void 查看盘点计划跟进数据(){ public void 查看盘点计划跟进数据(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId); params.put("custId", custId);
...@@ -1736,7 +1832,7 @@ public class Work implements Authorization { ...@@ -1736,7 +1832,7 @@ public class Work implements Authorization {
} }
@Test(description = "销售查看个人工作计划",priority = 119) @Test(description = "销售查看个人工作计划",priority = 139)
public void 销售查看个人工作计划(){ public void 销售查看个人工作计划(){
otoTakerAuth(); otoTakerAuth();
...@@ -1749,11 +1845,10 @@ public class Work implements Authorization { ...@@ -1749,11 +1845,10 @@ public class Work implements Authorization {
tomorrowWeek= tomorrowWeek-1; tomorrowWeek= tomorrowWeek-1;
getSellerPlan(0,1,0,1,1,0); getSellerPlan(0,1,0,1,1,0);
// planIds = (ArrayList) response.jsonPath().getList("data["+weekday+"].ids");
} }
@Test(description = "总监查看团队工作计划",priority = 120) @Test(description = "总监查看团队工作计划",priority = 140)
public void 总监查看团队工作计划(){ public void 总监查看团队工作计划(){
otoLeaderAuth(); otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
...@@ -1765,15 +1860,17 @@ public class Work implements Authorization { ...@@ -1765,15 +1860,17 @@ public class Work implements Authorization {
if(response.jsonPath().getString("data["+i+"].sellerName").equals("勿动-自动化测试带看")){ if(response.jsonPath().getString("data["+i+"].sellerName").equals("勿动-自动化测试带看")){
flag = 1; flag = 1;
int plans = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].ids.size()"); int plans = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].ids.size()");
int hasAllCheck = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].hasAllCheck");
Assert.assertEquals(plans,2,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的计划数量错误",response.body().asString())); Assert.assertEquals(plans,2,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的计划数量错误",response.body().asString()));
Assert.assertEquals(hasAllCheck,1,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的盘点标记非[已盘完】",response.body().asString()));
} }
} }
if (flag== 0){ if (flag== 0){
Assert.fail(network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"团队计划中不包含总监下销售",response.body().asString())); Assert.fail(network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"团队计划中不包含总监下销售",response.body().asString()));
} }
} }
@Test(description = "查看计划详情",priority = 121) @Test(description = "查看计划详情",priority = 141)
public void 查看计划详情(){ public void 查看计划详情(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds); params.put("ids", planIds);
...@@ -1782,13 +1879,17 @@ public class Work implements Authorization { ...@@ -1782,13 +1879,17 @@ public class Work implements Authorization {
int phoneSize = response.jsonPath().getInt("data.phones.size()"); int phoneSize = response.jsonPath().getInt("data.phones.size()");
int meetStatus = response.jsonPath().getInt("data.meets[0].planStatus"); int meetStatus = response.jsonPath().getInt("data.meets[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus"); int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus");
int hasCheck_1 = response.jsonPath().getInt("data.meets[0].hasCheck");
int hasCheck_2 = response.jsonPath().getInt("data.phones[0].hasCheck");
Assert.assertEquals(meetSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面列表总数错误",response.body().asString())); 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(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(meetStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划状态错误",response.body().asString()));
Assert.assertEquals(phoneStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态错误",response.body().asString())); Assert.assertEquals(phoneStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态错误",response.body().asString()));
Assert.assertEquals(hasCheck_1,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划盘点状态错误非【已盘】",response.body().asString()));
Assert.assertEquals(hasCheck_2,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划盘点状态错误非【已盘】",response.body().asString()));
} }
@Test(description = "主动拨通客户电话计划完成",priority = 122) @Test(description = "主动拨通客户电话计划完成",priority = 142)
public void 主动拨通客户电话计划完成(){ public void 主动拨通客户电话计划完成(){
callling("17823123001","15136361301",10,"dealing"); callling("17823123001","15136361301",10,"dealing");
...@@ -1804,7 +1905,7 @@ public class Work implements Authorization { ...@@ -1804,7 +1905,7 @@ public class Work implements Authorization {
getSellerPlan(0,1,1,1,1,0); getSellerPlan(0,1,1,1,1,0);
} }
@Test(description = "查看历史计划",priority = 123) @Test(description = "查看历史计划",priority = 143)
public void 查看历史计划(){ public void 查看历史计划(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId); params.put("custId", custId);
...@@ -1819,7 +1920,7 @@ public class Work implements Authorization { ...@@ -1819,7 +1920,7 @@ public class Work implements Authorization {
Assert.assertEquals(size,4,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString())); Assert.assertEquals(size,4,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString()));
} }
@Test(description = "获取场景类型",priority = 124) @Test(description = "获取场景类型",priority = 144)
public void 获取场景类型(){ public void 获取场景类型(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("sceneType", "1,2"); params.put("sceneType", "1,2");
...@@ -1828,7 +1929,7 @@ public class Work implements Authorization { ...@@ -1828,7 +1929,7 @@ public class Work implements Authorization {
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_getSceneTypes,"场景结果为空",response.body().asString())); Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_getSceneTypes,"场景结果为空",response.body().asString()));
} }
@Test(description = "公域引流_删除标签",priority = 125) @Test(description = "公域引流_删除标签",priority = 145)
public void 公域引流_删除标签(){ public void 公域引流_删除标签(){
otoInviterAuth(); otoInviterAuth();
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
......
...@@ -233,6 +233,11 @@ public class BasicConfig { ...@@ -233,6 +233,11 @@ public class BasicConfig {
public static final String WORK_getSceneTypes= WORK_HOST + "/kjy/oto/manager/custconf/getSceneTypes"; public static final String WORK_getSceneTypes= WORK_HOST + "/kjy/oto/manager/custconf/getSceneTypes";
public static final String WORK_promotionUpdate= WORK_HOST + "/kjy/oto/manager/customer/promotion/update"; public static final String WORK_promotionUpdate= WORK_HOST + "/kjy/oto/manager/customer/promotion/update";
public static final String WORK_customerTagList= WORK_HOST + "/kjy/oto/manager/customer/tag/list"; public static final String WORK_customerTagList= WORK_HOST + "/kjy/oto/manager/customer/tag/list";
public static final String WORK_strategy_saveOrUpdate= WORK_HOST + "/kjy/oto/check/strategy/saveOrUpdate";
public static final String WORK_strategy_searchParentSeller= WORK_HOST + "/kjy/oto/check/strategy/parentSeller/search";
public static final String WORK_strategy_list= WORK_HOST + "/kjy/oto/check/strategy/list";
public static final String WORK_strategy_onAbleList= WORK_HOST + "/kjy/oto/check/strategy/onAble/list";
public static final String WORK_strategy_updateStatus= WORK_HOST + "/kjy/oto/check/strategy/status/update";
//*************************客集集营销平台****************************** //*************************客集集营销平台******************************
public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser"; public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser";
......
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