admin
2019-08-13 37194e2d4b4ab85f7f29c1e900c406afe294579a
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -40,10 +40,12 @@
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.impl.monitor.BusinessEmergent110ServiceImpl;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.UserTLJBuyHistoryService;
@@ -113,6 +115,9 @@
   @Resource
   private TLJBuyGoodsService tljBuyGoodsService;
   @Resource
   private BusinessEmergent110Service businessEmergent110Service;
   @Override
   public void addShareGoodsHistory(UserShareGoodsHistory history) {
@@ -792,7 +797,8 @@
   }
   @Override
   public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, Long auctionId) throws ShareGoodsException {
   public TaoBaoLink getTaoLiJinLinkForBuyWithOutFanLi(Long uid, Long auctionId, TaoKeAppInfo app)
         throws ShareGoodsException {
      if (uid == null || uid <= 0) {
         throw new ShareGoodsException(1, "用户ID不能为空");
      }
@@ -817,12 +823,16 @@
      }
      BigDecimal perface = TaoBaoUtil.getGoodsHongBaoMoney(goods, new BigDecimal(70));
      TaoKeAppInfo app = TaoBaoConstant.ownBuyApp;
      TaoLiJinDTO taoLiJinDTO = null;
      try {
         taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "自购立减", perface, 1, new Date(currentTime), sendEndTime,
               new Date(currentTime), sendEndTime, app);
         taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "自购立减", perface, 1,
               new Date(currentTime - 1000 * 60 * 10L), sendEndTime, new Date(currentTime - 1000 * 60 * 10L),
               sendEndTime, app);
      } catch (TaoKeApiException e) {
         if (e.getCode() == TaoKeApiException.CODE_TLJ_NO_MONEY) {// 资金不足
            TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppKeyCache(app.getAppKey());
            businessEmergent110Service.tljNoMoney(config.getAccount());
         }
         LogHelper.errorDetailInfo(e, e.getMessage(), null);
         throw new ShareGoodsException(5, "生成推广链接失败");
      }