From 0922bfdb56bc30125d6fc8e13c50cdda7cd9dc72 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 09 九月 2019 18:59:52 +0800 Subject: [PATCH] 提现自动绑定修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 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..8b381b1 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; -- Gitblit v1.8.0