From cc55ffcea74c7d23dadaa0860befbcdf98f35341 Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期一, 16 九月 2019 23:22:13 +0800 Subject: [PATCH] 资金相关包目录修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java index 66103fc..a75cbfa 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java @@ -34,8 +34,8 @@ import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra; import com.yeshi.fanli.entity.taobao.TaoBaoLink; import com.yeshi.fanli.entity.taobao.TaoKeAppInfo; -import com.yeshi.fanli.exception.ShareGoodsException; import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException; +import com.yeshi.fanli.exception.share.ShareGoodsException; import com.yeshi.fanli.exception.share.UserShareGoodsRecordException; import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException; @@ -253,7 +253,7 @@ data.put("shareMoney", "楼" + shareMoney.toString()); try { - ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO); + ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, false); data.put("shareId", shareRecord.getRedisKey()); } catch (Exception e) { try { @@ -320,7 +320,7 @@ TaoBaoGoodsBrief goods = taoBaoLink.getGoods(); // 璁$畻鎺ㄥ箍绾㈠寘 - String warningRate = configTaoLiJinService.getValueByKey("warning_value"); + String warningRate = configTaoLiJinService.getValueByKey("warning_value",null); BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods); // 鎺ㄥ箍绾㈠寘 涓嶈兘灏忎簬1 @@ -387,7 +387,7 @@ { String text = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid); if (StringUtil.isNullOrEmpty(text)) - text = configTaoLiJinService.getValueByKey("goods_share_text"); + text = configTaoLiJinService.getValueByKey("goods_share_text",new Date()); shareText = text.replace("{鏍囬}", taoBaoLink.getGoods().getTitle()) .replace("{鍟嗗搧鍘熶环}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "") @@ -419,7 +419,7 @@ data.put("shareMoney", "楼" + shareMoney.toString()); try { - ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO); + ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, true); data.put("shareId", shareRecord.getRedisKey()); } catch (Exception e) { try { @@ -607,6 +607,7 @@ public void updateRecord(AcceptData acceptData, String shareId, String type, PrintWriter out) { if (StringUtil.isNullOrEmpty(shareId)) { out.print(JsonUtil.loadFalseResult("鍙傛暟涓嶆纭�")); + return; } // 鏇存柊鍒嗕韩鐢熸晥 @@ -614,7 +615,7 @@ @Override public void run() { try { - userShareGoodsRecordService.takeEffectShareRecord(shareId); + userShareGoodsRecordService.takeEffectShareRecord(acceptData, shareId); } catch (UserShareGoodsRecordException eu) { try { LogHelper.errorDetailInfo(eu); @@ -834,7 +835,7 @@ if (tljId != null) { String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid); if (StringUtil.isNullOrEmpty(template)) - template = configTaoLiJinService.getValueByKey("goods_share_text"); + template = configTaoLiJinService.getValueByKey("goods_share_text",new Date()); return template; } else { String template = shareGoodsTextTemplateService.geteCouponTemplate(uid); @@ -885,7 +886,7 @@ @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST) public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) { if (tljId != null) { - out.print(JsonUtil.loadTrueResult(configTaoLiJinService.getValueByKey("share_goods_rules"))); + out.print(JsonUtil.loadTrueResult(configTaoLiJinService.getValueByKey("share_goods_rules",new Date()))); } else { out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules"))); } @@ -926,6 +927,11 @@ if (cid == 1 || cid == 2) { // 1 鐑攢鍗曞搧 2 鎺ㄨ崘濂借揣 if (cid == 1) { List<GoodsPicture> imgs = dynamicInfo.getImgs(); + if (imgs == null || imgs.size() == 0) { + out.print(JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦")); + return; + } + GoodsPicture goodsPicture = imgs.get(0); if (goodsPicture.getGoodState() == 1) { out.print(JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦")); @@ -933,6 +939,11 @@ } TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods(); + if (goods == null) { + out.print(JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦")); + return; + } + if (goods.getState() != null && goods.getState() == 1) { out.print(JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦")); return; @@ -966,7 +977,7 @@ title = "缁欎綘鎺ㄨ崘绮鹃�夊ソ鐗╀紭鎯犲埜锛岃喘鐗╁墠鍏堥鍒革紝鍒敊杩囦紭鎯犲摝~"; } data.put("title", title); - data.put("content", "鎴戝湪杩斿埄鍒稿彂鐜颁簡涓�涓緢濂界殑鍟嗗搧锛屽揩鏉ョ湅鐪媬"); + data.put("content",String.format("鎴戝湪%s鍙戠幇浜嗕竴涓緢濂界殑鍟嗗搧锛屽揩鏉ョ湅鐪媬",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()))); // 鍒嗕韩濂栭噾 ClientTextStyleVO desc = dynamicInfo.getDesc(); -- Gitblit v1.8.0