| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | 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.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
|
| | |
| | | // 分享id
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | Constant.SOURCE_TYPE_TAOBAO, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | |
|
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
|
| | | LogHelper.error("推广红包比例:"+warningRate);
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
|
| | |
|
| | | LogHelper.error("推广红包:"+spreadMoney);
|
| | | // 推广红包 不能小于1
|
| | | if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "该商品淘礼金不足"));
|
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | Constant.SOURCE_TYPE_TAOBAO, true);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | |
|
| | | final TaoBaoLink taobaoLink = taoBaoLink;
|
| | | final TaoBaoGoodsBrief finalGoods=goods;
|
| | | final TaoBaoGoodsBrief finalGoods = goods;
|
| | | // 异步操作
|
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | Constant.SOURCE_TYPE_JD, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | |
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_PDD);
|
| | | Constant.SOURCE_TYPE_PDD, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|