From d46dea27b6ec3e0fb32ec7d137699e9fc7d609b0 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 12 十二月 2019 14:18:11 +0800 Subject: [PATCH] 订单补贴消息修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java | 69 +++++++++++++++++++--------------- 1 files changed, 38 insertions(+), 31 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java index eb734af..2df56e4 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java @@ -14,6 +14,7 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.FloatAD; +import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum; import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState; import com.yeshi.fanli.entity.bus.user.UserActiveLog; import com.yeshi.fanli.entity.common.JumpDetailV2; @@ -23,7 +24,7 @@ import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.homemodule.FloatADService; import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService; -import com.yeshi.fanli.service.inter.redpack.RedPackWinNewUserService; +import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService; import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService; import com.yeshi.fanli.service.inter.user.TBPidService; @@ -78,7 +79,7 @@ private UserActiveLogService userActiveLogService; @Resource - private RedPackWinNewUserService redPackWinNewUserService; + private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService; /** * s 棣栭〉閰嶇疆淇℃伅 @@ -109,7 +110,7 @@ // 鏃犳柊浜哄脊妗� 鍒欐煡璇㈤粯璁� FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0); - if (floatAD != null) { + if (floatAD != null && floatAD.getTypeEnum() != FloatADTypeEnum.newUserRedPack) { JSONObject detail = new JSONObject(); detail.put("img", floatAD.getPicture()); detail.put("jumpDetail", floatAD.getJumpDetail()); @@ -156,40 +157,46 @@ uid = null; // 娲诲姩寮规 - List<FloatAD> listAD = null; - if (redPackWinNewUserService.verifyHasReward(uid)) { - listAD = floatADService.getValidByPosition(FloatAD.POSITION_INDEX); - } else { - listAD = floatADService.getValidCommonByPosition(FloatAD.POSITION_INDEX); - } - + List<FloatAD> listAD = new ArrayList<FloatAD>(); List<FloatImgDetailVO> listVO = new ArrayList<FloatImgDetailVO>(); - if (listAD != null && !listAD.isEmpty()) { - for (FloatAD floatAD : listAD) { - JumpDetailV2 jumpDetail = floatAD.getJumpDetail(); - if (jumpDetail != null) { - jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId()); - if (jumpDetail != null) { - jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin()); - } - } - FloatImgDetailVO floatImgVO = new FloatImgDetailVO(); - floatImgVO.setId(floatAD.getId().toString()); - floatImgVO.setImg(floatAD.getPicture()); - floatImgVO.setParams(floatAD.getParams()); - floatImgVO.setJumpDetail(jumpDetail); - floatImgVO.setShowTime(floatAD.getShowMode()); - floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin()); - if (floatAD.getPlaySound() != null) - floatImgVO.setPlaySound(floatAD.getPlaySound());// 榛樿閮芥挱鏀鹃煶鏁� - else - floatImgVO.setPlaySound(false); - listVO.add(floatImgVO); + + List<FloatAD> list = floatADService.getValidByPosition(FloatAD.POSITION_INDEX); + if (list != null && !list.isEmpty()) + listAD.addAll(list); + + for (int i = 0; i < listAD.size(); i++) { + FloatAD floatAD = listAD.get(i); + FloatADTypeEnum typeEnum = floatAD.getTypeEnum(); + if (typeEnum == FloatADTypeEnum.newUserRedPack && !userTaoLiJinNewbiesService.verifyHasReward(uid, acceptData.getDevice())) { + listAD.remove(i); + i--; + continue; } + + JumpDetailV2 jumpDetail = floatAD.getJumpDetail(); + if (jumpDetail != null) { + jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId()); + if (jumpDetail != null) { + jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin()); + } + } + FloatImgDetailVO floatImgVO = new FloatImgDetailVO(); + floatImgVO.setId(floatAD.getId().toString()); + floatImgVO.setImg(floatAD.getPicture()); + floatImgVO.setParams(floatAD.getParams()); + floatImgVO.setJumpDetail(jumpDetail); + floatImgVO.setShowTime(floatAD.getShowMode()); + floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin()); + if (floatAD.getPlaySound() != null) + floatImgVO.setPlaySound(floatAD.getPlaySound());// 榛樿閮芥挱鏀鹃煶鏁� + else + floatImgVO.setPlaySound(false); + listVO.add(floatImgVO); } JSONObject data = new JSONObject(); data.put("listAD", JsonUtil.getApiCommonGson().toJson(listVO)); + data.put("protocol", configService.get("user_protocol_home_data")); // 棰嗗埜甯姪閾炬帴,1.5.2鍚庣敓鏁� String couponHelp = configService.get("taobao_coupon_help"); -- Gitblit v1.8.0