From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 30 七月 2019 09:07:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java | 122 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 112 insertions(+), 10 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java index 9ed78f1..54a979e 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java @@ -12,16 +12,27 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.FloatAD; +import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState; +import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord; +import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin; +import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum; +import com.yeshi.fanli.entity.bus.user.UserActiveLog; import com.yeshi.fanli.entity.config.AppHomeFloatImg; import com.yeshi.fanli.entity.taobao.ClientTBPid; import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; 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.taobao.TaoBaoUnionConfigService; +import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService; +import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService; import com.yeshi.fanli.service.inter.user.TBPidService; +import com.yeshi.fanli.service.inter.user.UserActiveLogService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.ThreadUtil; +import com.yeshi.fanli.util.VersionUtil; import net.sf.json.JSONObject; @@ -53,14 +64,29 @@ @Resource private JumpDetailV2Service jumpDetailV2Service; + @Resource + private MsgDeviceReadStateService msgDeviceReadStateService; + + @Resource + private UserTaoLiJinOriginService uerTaoLiJinOriginService; + + @Resource + private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService; + + @Resource + private UserActiveLogService userActiveLogService; + /** - * 棣栭〉閰嶇疆淇℃伅 + * s 棣栭〉閰嶇疆淇℃伅 * * @param acceptData * @param out */ @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST) public void getHomeConfig(AcceptData acceptData, Long uid, PrintWriter out) { + if (uid != null && uid == 0L) + uid = null; + AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(); if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) { appHomeFloatImg = null; @@ -76,8 +102,28 @@ data.put("floatNotifyImg", notifyImg); } - // 鎮诞澶у浘 1.5.2 -2019.3.20 - FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX); + FloatAD floatAD = null; + + if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) { + if (uid == null) { + DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice()); + if (deviceRecord == null) { + floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1); + } + } else { + UserTaoLiJinOrigin userTaoLiJin = uerTaoLiJinOriginService.getByUidAndOrigin(uid, + TaoLiJinOriginEnum.newbiesWin.name()); + if (userTaoLiJin == null) { + floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1); + } + } + } + + // 鏃犳柊浜哄脊妗� 鍒欐煡璇㈤粯璁� + if (floatAD == null) { + floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0); + } + if (floatAD != null) { JSONObject detail = new JSONObject(); detail.put("img", floatAD.getPicture()); @@ -85,13 +131,7 @@ detail.put("params", floatAD.getParams()); detail.put("showTime", floatAD.getShowMode()); detail.put("accountLogin", floatAD.isJumpNeedLogin()); - - if (uid != null && userInfoExtraService.isNewUser(uid)) { - // 鏂扮敤鎴� - data.put("floatImgDetail", detail); - } else { - data.put("floatImgDetail", detail); - } + data.put("floatImgDetail", detail); } // 棰嗗埜甯姪閾炬帴,1.5.2鍚庣敓鏁� @@ -104,6 +144,47 @@ data.put("htmlLink", configService.get("index_html_link_android")); } + // 鍒ゆ柇鏂拌�佺敤鎴� + UserActiveLog da = null; + if (uid != null) + da = userActiveLogService.getFirstActiveInfo(uid); + // 鏂颁汉 + if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) { + data.put("userTimeType", 0); + } else {// 鑰佷汉 + data.put("userTimeType", 1); + } + data.put("hotFuctionLink", configService.get("hot_function_url")); + out.print(JsonUtil.loadTrueResult(data)); + } + + /** + * 娑堟伅涓績寮规 + * + * @param acceptData + * @param uid + * @param out + */ + @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST) + public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) { + JSONObject data = new JSONObject(); + boolean show = false; + if (uid != null) { + show = uerTaoLiJinOriginService.hasRankHongBao(uid); + } + + if (show) { + FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_MSGCENTER, null); + if (floatAD != null) { + JSONObject detail = new JSONObject(); + detail.put("img", floatAD.getPicture()); + detail.put("jumpDetail", floatAD.getJumpDetail()); + detail.put("params", floatAD.getParams()); + detail.put("showTime", floatAD.getShowMode()); + detail.put("accountLogin", floatAD.isJumpNeedLogin()); + data.put("floatImgDetail", detail); + } + } out.print(JsonUtil.loadTrueResult(data)); } @@ -259,6 +340,27 @@ JSONObject data = new JSONObject(); data.put("meiqia", "1".equalsIgnoreCase(configService.get("kefu_meiqia")) ? true : false);// 鏄惁璺宠浆缇庢唇锛屼笉璺宠浆缇庢唇灏辩敤鍘熸潵鐨� out.print(JsonUtil.loadTrueResult(data)); + // 璁剧疆娑堟伅宸茶 + ThreadUtil.run(new Runnable() { + @Override + public void run() { + msgDeviceReadStateService.setDeviceMsgRead(MsgDeviceReadState.TYPE_KEFU, acceptData.getDevice(), + "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2); + } + }); + } + + /** + * 鑾峰彇閭�璇风爜甯姪閾炬帴 + * + * @param acceptData + * @param out + */ + @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST) + public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) { + JSONObject data = new JSONObject(); + data.put("helpUrl", configService.get("invite_code_input_help")); + out.print(JsonUtil.loadTrueResult(data)); } } -- Gitblit v1.8.0