Commit 6915177d authored by 赵然's avatar 赵然

zr

parent 86a3ba5f
......@@ -102,7 +102,7 @@ public class 新活动工具测试 extends DuibaTestBase {
logger.info("校验第一次抽奖前后积分正确");
//第二次抽奖
response = activityReconService.doJoin2(uid,"18580","m8rhchc",response.jsonPath().getString("againTag"));
response = activityReconService.doJoin2(uid,"18580","m8rhchc",response.jsonPath().getString("data.againTag"));
response.prettyPrint();
Thread.sleep(2000);
//第二次抽奖后查询数据库,获取当前积分
......
......@@ -23,11 +23,12 @@ import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.Map;
public class 瓜分积分_作弊瓜分 extends DuibaTestBase {
public class 瓜分积分_作弊瓜分_AccessTest extends DuibaTestBase {
@Autowired
PkDevelopService pkDevelopService;
......@@ -48,7 +49,7 @@ public class 瓜分积分_作弊瓜分 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21827","4","1","1","30");
Response response = pkDevelopService.betEditor("21827","2","4","1","1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk活动失败");
response = pkService.getBetList(uid1);
......@@ -192,7 +193,9 @@ public class 瓜分积分_作弊瓜分 extends DuibaTestBase {
public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
//Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert.assertTrue(new BigDecimal(response.jsonPath().getString("data.prizeList[0].totalBonus")).compareTo(new BigDecimal("1"))==0,"中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
......@@ -254,6 +257,8 @@ public class 瓜分积分_作弊瓜分 extends DuibaTestBase {
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId);
Boolean result2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?",betId);
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits.operating_activity where activity_id = ?",betId);
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e){
......
......@@ -50,7 +50,7 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21771","4",null,"1","30");
Response response = pkDevelopService.betEditor("21771","2","4",null,"1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk活动失败");
response = pkService.getBetList(uid1);
......
......@@ -55,7 +55,7 @@ public class 瓜分积分_实际瓜分_主胜方 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor_right("18157163293","21832","4",null,"1","30","false","true");
Response response = pkDevelopService.betEditor_right("18157163293","21832","2","4",null,"1","30","false","true");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk活动失败");
response = pkService.getBetList(uid1);
......
......@@ -50,7 +50,7 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21829","2","0.01","0","10");
Response response = pkDevelopService.betEditor("21829","1","2","0.01","0","10");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败");
response = pkService.getBetList(uid1);
......
......@@ -50,7 +50,7 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21828","2",null,"1","30");
Response response = pkDevelopService.betEditor("21828","1","2",null,"1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败");
response = pkService.getBetList(uid1);
......
......@@ -34,6 +34,9 @@ public class BetDevelopVo {
private String shareExp; //'瓜分的经验池'
private String startTime; // '活动开始时间'
private String title; //'投注活动标题'
private String delayHours; //'结算时间'
private String isHover;
private String popoverVisible;
// private String id; //主键
// private String pluginId; //'发奖品时需要填插件id'
// private String prizeLimit; //'发奖品时的发放上限'
......@@ -125,7 +128,28 @@ public class BetDevelopVo {
public void setTitle(String title) {
this.title = title;
}
public String getDelayHours() {
return delayHours;
}
public void setDelayHours(String delayHours) {
this.delayHours = delayHours;
}
public String getIsHover() {
return isHover;
}
public void setIsHover(String isHover) {
this.isHover = isHover;
}
public String getPopoverVisible() {
return popoverVisible;
}
public void setPopoverVisible(String popoverVisible) {
this.popoverVisible = popoverVisible;
}
// public String getId() {
// return id;
// }
......
......@@ -152,6 +152,7 @@ public class ActivityReconService {
}
public Response doJoin2( int uid,String activityId,String token,String orderId) throws Exception{
logger.info("再抽一次订单号为:"+orderId);
Map<String,String> map = new HashMap<>();
map.put("activityId",activityId);
map.put("token",token);
......
......@@ -99,6 +99,7 @@ public class PkService {
}
public Response doJoin(Integer uid,String betId,String optionId) throws Exception{
String url = activityHost + "/betActivity2/doJoin";
......
......@@ -40,10 +40,11 @@ public class PkDevelopService {
@Autowired
Authorization authorization;
public Response betEditor(String appId,String bonusType,String bonusAmount,String creditsValue,String shareExp) throws Exception{
public Response betEditor(String appId,String bonusType,String questionType,String bonusAmount,String creditsValue,String shareExp) throws Exception{
String data = PublicMethod.data();
String url = "http://" + hdHost + "/visual-editor/bet/post";
//String url = "http://" + hdHost + "/visual-editor/bet/post";
String url = "http://" + hdHost + "/visual-editor/bet/save";
//创建投注项
List<BetOptionVo> betOptionVoList = new ArrayList<>();
......@@ -64,24 +65,32 @@ public class PkDevelopService {
BetDevelopVo betDevelopVo = new BetDevelopVo();
betDevelopVo.setBetOptionDtoList(betOptionVoList);
betDevelopVo.setBetType("1");
betDevelopVo.setBonusType(bonusType);
if (bonusType.equals("2")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分红包"+data);
}else if (bonusType.equals("4")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分积分"+data);
}
betDevelopVo.setBonusAmount(bonusAmount);
betDevelopVo.setBonusType(questionType);
betDevelopVo.setConfigStatus("3");
betDevelopVo.setCreditsValue(creditsValue);
betDevelopVo.setEndTime("2029-12-31 00:00");
betDevelopVo.setShareExp(shareExp);
betDevelopVo.setDelayHours("2");
betDevelopVo.setEndTime("");
betDevelopVo.setIsHover("false");
betDevelopVo.setPopoverVisible("false");
betDevelopVo.setShareExp(shareExp);
if (questionType.equals("2")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分红包"+data);
}else if (questionType.equals("4")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分积分"+data);
}
betDevelopVoList.add(betDevelopVo);
Map<String,Object> para = new HashMap<>();
para.put("list",betDevelopVoList);
para.put("bonusAccount",bonusAmount);
para.put("bonusType",bonusType); //2-瓜分积分
para.put("periodStartTime","2019-03-04T16:00:00.000Z");
para.put("periodEndTime","2029-03-22T16:00:00.000Z");
para.put("rules","自动化规则自动化规则");
para.put("timeType","create");
para.put("title","组件pk自动化");
para.put("list",betDevelopVoList);
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(para));
......@@ -98,7 +107,7 @@ public class PkDevelopService {
return betResponse;
}
public Response betEditor_right(String account,String appId,String bonusType,String bonusAmount,String creditsValue,String shareExp,String loser,String winner) throws Exception{
public Response betEditor_right(String account,String appId,String bonusType,String questionType,String bonusAmount,String creditsValue,String shareExp,String loser,String winner) throws Exception{
String data = PublicMethod.data();
String url = "http://" + hdHost + "/visual-editor/bet/post";
......@@ -122,24 +131,32 @@ public class PkDevelopService {
BetDevelopVo betDevelopVo = new BetDevelopVo();
betDevelopVo.setBetOptionDtoList(betOptionVoList);
betDevelopVo.setBetType("1");
betDevelopVo.setBonusType(bonusType);
betDevelopVo.setBonusAmount(bonusAmount);
betDevelopVo.setBonusType(questionType);
betDevelopVo.setConfigStatus("3");
betDevelopVo.setCreditsValue(creditsValue);
betDevelopVo.setDelayHours("2");
betDevelopVo.setEndTime("");
betDevelopVo.setIsHover("false");
betDevelopVo.setPopoverVisible("false");
betDevelopVo.setShareExp(shareExp);
if (bonusType.equals("2")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分红包"+data);
}else if (bonusType.equals("4")){
betDevelopVo.setTitle("【自动化】组件pk_瓜分积分"+data);
}
betDevelopVo.setBonusAmount(bonusAmount);
betDevelopVo.setConfigStatus("3");
betDevelopVo.setCreditsValue(creditsValue);
betDevelopVo.setEndTime("2029-12-31 00:00");
betDevelopVo.setShareExp(shareExp);
betDevelopVoList.add(betDevelopVo);
Map<String,Object> para = new HashMap<>();
para.put("list",betDevelopVoList);
para.put("bonusAccount",""); //账户类型1-总帐户
para.put("bonusType",bonusType); //2-瓜分积分
para.put("periodStartTime","2019-03-05T16:00:00.000Z");
para.put("periodEndTime","2029-03-22T16:00:00.000Z");
para.put("rules","自动化规则自动化规则");
para.put("timeType","create");
para.put("title","组件pk自动化_主胜方");
para.put("list",betDevelopVoList);
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(para));
......
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