Commit c09742b9 authored by 赵然's avatar 赵然

zr

parent e30d4d17
...@@ -257,7 +257,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase { ...@@ -257,7 +257,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId); 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 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 result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits.operating_activity where type = 53 and app_id = 21827"); Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21827");
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -263,7 +263,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas ...@@ -263,7 +263,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId); 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 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 result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits.operating_activity where type = 53 and app_id = 21832"); Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21832");
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -29,7 +29,7 @@ import java.text.DecimalFormat; ...@@ -29,7 +29,7 @@ import java.text.DecimalFormat;
import java.util.Map; import java.util.Map;
public class 瓜分红包_作弊瓜分 extends DuibaTestBase { public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
@Autowired @Autowired
PkDevelopService pkDevelopService; PkDevelopService pkDevelopService;
...@@ -50,7 +50,17 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase { ...@@ -50,7 +50,17 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
@Test @Test
public void 创建PK活动() throws Exception{ public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21829","1","2","0.01","0","10");
logger.info("开始生成预算token");
Response response = pkDevelopService.temporaryCard("21829","2","5","10","2019-03-04T16:00:00.000Z","2029-03-22T16:00:00.000Z");
String token = response.jsonPath().getString("data.checkUuid");
logger.info("生成预算token为:"+token);
pkDevelopService.preSaveCheck("21829",token);
logger.info("预算确认成功!");
response = pkDevelopService.betEditor_red("21829",token,"1","2","0.01","0","10");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败"); Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败");
response = pkService.getBetList(uid1); response = pkService.getBetList(uid1);
...@@ -188,7 +198,9 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase { ...@@ -188,7 +198,9 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
public void 出奖弹层校验() throws Exception { public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1); Response response = pkService.popup(uid1);
response.prettyPrint(); 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"),"2","中奖弹窗类型校验失败"); Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"2","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"0.01","中奖弹窗积分校验失败"); Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"0.01","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败"); Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
...@@ -251,6 +263,8 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase { ...@@ -251,6 +263,8 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId); 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 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 result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21829");
Boolean result7 = jdbc.update("delete from act_com_conf.tb_red_account_period where app_id = 21829");
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} catch (Exception e){ } catch (Exception e){
......
...@@ -40,6 +40,7 @@ public class PkDevelopService { ...@@ -40,6 +40,7 @@ public class PkDevelopService {
@Autowired @Autowired
Authorization authorization; Authorization authorization;
public Response betEditor(String appId,String bonusType,String questionType,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 data = PublicMethod.data();
...@@ -83,8 +84,8 @@ public class PkDevelopService { ...@@ -83,8 +84,8 @@ public class PkDevelopService {
betDevelopVoList.add(betDevelopVo); betDevelopVoList.add(betDevelopVo);
Map<String,Object> para = new HashMap<>(); Map<String,Object> para = new HashMap<>();
para.put("bonusAccount",bonusAmount); para.put("bonusAccount","1");
para.put("bonusType",bonusType); //2-瓜分积分 para.put("bonusType",bonusType); //1-瓜分红包,2-瓜分积分,
para.put("periodStartTime","2019-03-04T16:00:00.000Z"); para.put("periodStartTime","2019-03-04T16:00:00.000Z");
para.put("periodEndTime","2029-03-22T16:00:00.000Z"); para.put("periodEndTime","2029-03-22T16:00:00.000Z");
para.put("rules","自动化规则自动化规则"); para.put("rules","自动化规则自动化规则");
...@@ -174,6 +175,133 @@ public class PkDevelopService { ...@@ -174,6 +175,133 @@ public class PkDevelopService {
return betResponse; return betResponse;
} }
public Response betEditor_red(String appId,String checkUuid,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/save";
//创建投注项
List<BetOptionVo> betOptionVoList = new ArrayList<>();
BetOptionVo betOptionVo1 = new BetOptionVo();
BetOptionVo betOptionVo2 = new BetOptionVo();
betOptionVo1.setOptionImg("//yun.dui88.com/images/201812/75j84chnkg.jpg");
betOptionVo1.setOptionName("1");
betOptionVo1.setRightAnswer(null);
betOptionVo2.setOptionImg("//yun.dui88.com/images/201812/4f51vmzfpu.png");
betOptionVo2.setOptionName("2");
betOptionVo2.setRightAnswer(null);
betOptionVoList.add(betOptionVo1);
betOptionVoList.add(betOptionVo2);
//创建活动配置
List<BetDevelopVo> betDevelopVoList = new ArrayList<>();
BetDevelopVo betDevelopVo = new BetDevelopVo();
betDevelopVo.setBetOptionDtoList(betOptionVoList);
betDevelopVo.setBetType("1");
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 (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("bonusAccount","1");
para.put("bonusAmount","5");
para.put("bonusSizeLimit","10");
para.put("bonusType",bonusType); //1-瓜分红包,2-瓜分积分,
para.put("checkUuid",checkUuid);
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));
Response betResponse = given().contentType("application/json;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).body(jsonParam).post(url);
betResponse.prettyPrint();
try{
Assert.assertEquals(betResponse.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("创建pk活动接口失败,返回信息:"+betResponse.asString());
}catch(Error er){
throw new Exception("创建pk活动接口失败,返回信息:"+betResponse.asString());
}
return betResponse;
}
/**
*
* @param appId
* @param bizType 活动类型 2-pk
* @param bonusAmount 活动单用户金额上限
* @param bonusSizeLimit 中奖人数
* @param periodStartTime 周期开始时间
* @param periodEndTime 周期结束时间
* @return
* @throws Exception
*/
public Response temporaryCard(String appId,String bizType,String bonusAmount,String bonusSizeLimit,String periodStartTime,String periodEndTime) throws Exception {
String url = "http://" + hdHost + "/visual-editor/bet/temporaryCard";
Map<String, Object> para = new HashMap<>();
para.put("beforePeriodId", "");
para.put("bizType", bizType);
para.put("bonusAmount", bonusAmount);
para.put("bonusSizeLimit", bonusSizeLimit);
para.put("periodStartTime", periodStartTime);
para.put("periodEndTime", periodEndTime);
para.put("relId", "");
Response Response = given().contentType("application/json;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).body(para).post(url);
Response.prettyPrint();
try{
Assert.assertEquals(Response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("预算生成token接口失败,返回信息:"+Response.asString());
}catch(Error er){
throw new Exception("预算生成token接口失败,返回信息:"+Response.asString());
}
return Response;
}
public Response preSaveCheck( String appId,String preCheckCode)throws Exception{
String url = "http://" + hdHost + "/visual-editor/bet/preSaveCheck";
Map<String, Object> para = new HashMap<>();
para.put("preCheckCode", preCheckCode);
Response Response = given().contentType("application/json;charset=UTF-8").cookies(authorization.hdLoginSaas(appId)).body(para).post(url);
Response.prettyPrint();
try{
Assert.assertEquals(Response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("确认预算接口失败,返回信息:"+Response.asString());
}catch(Error er){
throw new Exception("确认预算token接口失败,返回信息:"+Response.asString());
}
return Response;
}
public Response doDraw() throws Exception{ public Response doDraw() throws Exception{
String url = "http://" + ManagerHost + "/newmanager/betOpenPrize/doDraw"; String url = "http://" + ManagerHost + "/newmanager/betOpenPrize/doDraw";
Map<String,Object> para = new HashMap<>(); Map<String,Object> para = new HashMap<>();
......
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