From d28bed1a1275131a5ca37f7da37961e2b518ac07 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 26 八月 2019 13:44:00 +0800 Subject: [PATCH] 淘礼金创建异常处理 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java index a443351..17887b7 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/PushController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.yeshi.utils.JsonUtil; +import org.yeshi.utils.taobao.TbImgUtil; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.common.JumpDetailV2; @@ -34,6 +35,7 @@ import com.yeshi.fanli.service.inter.push.PushService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.annotation.RequestSerializableByKey; import com.yeshi.fanli.util.factory.JumpDetailParamsFactory; import net.sf.json.JSONArray; @@ -120,7 +122,7 @@ * @param uid * @param deviceToken */ - + @RequestSerializableByKey(key = "#acceptData.device") @RequestMapping(value = "/uidBindDeviceToken", method = RequestMethod.POST) public void uidBindIOSDeviceToken(AcceptData acceptData, Long uid, String deviceToken, PrintWriter out) { if (uid != null && uid != 0 && !StringUtil.isNullOrEmpty(deviceToken)) { @@ -154,9 +156,11 @@ * -鐢ㄦ埛ID * @param out */ + @RequestSerializableByKey(key = "#acceptData.device") @RequestMapping(value = "/bindHWPush", method = RequestMethod.POST) public void bindHWDeviceToken(AcceptData acceptData, String token, Long uid, PrintWriter out) { - deviceTokenHWService.addDeviceToken(token, acceptData.getDevice(), uid); + deviceTokenHWService.addDeviceToken(token, acceptData.getDevice(), uid, + Integer.parseInt(acceptData.getVersion())); out.print(JsonUtil.loadTrueResult("鎴愬姛")); } @@ -212,7 +216,8 @@ // 缁熻鍟嗗搧鏁伴噺 long totalgoods = 0; // 鍟嗗搧id - Long auctionId = null; + CommonGoods commonGoods = null; + if (StringUtil.isNullOrEmpty(picture)) { try { List<PushGoodsGroup> listGroup = pushGoodsGroupService.getAllInfoByPushId(pushId); @@ -223,10 +228,9 @@ PushGoodsGroup pushGoodsGroup = listGroup.get(0); if (pushGoodsGroup != null) { - CommonGoods commonGoods = pushGoodsGroup.getCommonGoods(); + commonGoods = pushGoodsGroup.getCommonGoods(); if (commonGoods != null) { picture = commonGoods.getPicture(); - auctionId = commonGoods.getGoodsId(); } } } @@ -235,7 +239,7 @@ } } - result.put("picture", picture); + result.put("picture", TbImgUtil.getTBSize320Img(picture)); String fontColor1 = "#666666"; String fontColor2 = "#E5005C"; @@ -263,10 +267,12 @@ JumpDetailV2 jumpDetail = null; if (totalgoods == 1) { - - params = JumpDetailParamsFactory.createGoodsParams(auctionId); + params = JumpDetailParamsFactory.createGoodsParams(commonGoods.getGoodsId(), + commonGoods.getGoodsType()); // 鍗曚釜鍟嗗搧璺宠浆鍟嗗搧璇︽儏 - jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail"); + jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail", + Constant.getPlatformCode(acceptData.getPlatform()), + Integer.parseInt(acceptData.getVersion())); } else { String url = configService.get("push_goods_details"); @@ -278,7 +284,9 @@ params = JumpDetailParamsFactory.createWEBParams(url); // 璺宠浆鎺ㄨ崘璇︽儏 - jumpDetail = jumpDetailV2Service.getByTypeCache("web"); + jumpDetail = jumpDetailV2Service.getByTypeCache("web", + Constant.getPlatformCode(acceptData.getPlatform()), + Integer.parseInt(acceptData.getVersion())); } result.put("params", params); result.put("jumpDetail", jumpDetail); -- Gitblit v1.8.0