admin
2019-07-30 573c491b4a1ba60e12a5678a01c1546c0077c1ee
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java
@@ -197,6 +197,28 @@
                     }
                  }
               }
               String shareType = shareRecord.getShareType();
               if (StringUtil.isNullOrEmpty(shareType)) {
                  shareRecord.setShareType(UserShareGoodsRecord.SHARETYPE_SINGLE);
               }
               BigDecimal totalMoney = shareRecord.getTotalMoney();
               if (totalMoney == null) {
                  shareRecord.setTotalMoney(new BigDecimal(0));
               }
            }
         } else {
            for (UserShareGoodsRecord shareRecord : list) {
               String shareType = shareRecord.getShareType();
               if (StringUtil.isNullOrEmpty(shareType)) {
                  shareRecord.setShareType(UserShareGoodsRecord.SHARETYPE_SINGLE);
               }
               BigDecimal totalMoney = shareRecord.getTotalMoney();
               if (totalMoney == null) {
                  shareRecord.setTotalMoney(new BigDecimal(0));
               }
            }
         }
      }
@@ -621,7 +643,7 @@
      recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
      // 分享id
      String key = StringUtil.Md5(uid + "#" + auctionId);
      String key = StringUtil.Md5(uid + "#GoodsDetail#" + auctionId);
      redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
      recordDTO.setRedisKey(key);
@@ -659,7 +681,7 @@
      recordDTO.setSource(ShareSourceTypeEnum.storage);
      // 缓存分享商品信息
      String key = StringUtil.Md5(uid + "##" + id);
      String key = StringUtil.Md5(uid + "#GoodsStorage#" + id);
      recordDTO.setRedisKey(key);
      redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
@@ -698,7 +720,7 @@
      recordDTO.setSharePictureUrl(uploadResult.getUrl());
      recordDTO.setSource(ShareSourceTypeEnum.activity);
      // 缓存分享商品信息
      String key = StringUtil.Md5(uid + "##" + id);
      String key = StringUtil.Md5(uid + "#Activity#" + id);
      recordDTO.setRedisKey(key);
      redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
@@ -734,7 +756,7 @@
      recordDTO.setSource(ShareSourceTypeEnum.activity);
      // 缓存分享商品信息
      String key = StringUtil.Md5(uid + "##" + id);
      String key = StringUtil.Md5(uid + "#Dynamic#" + id);
      recordDTO.setRedisKey(key);
      redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20);
@@ -795,6 +817,9 @@
            }
         }
      }
      // 清理缓存
      redisManager.removeCommonString(shareKey);
   }
   /**
@@ -864,7 +889,7 @@
         }
      }
      InputStream inputStream = ImageUtil.drawGoodsShareBigImg(erCodeInputStream, portrait, listGoods);
      InputStream inputStream = ImageUtil.drawGoodsSharePicture(erCodeInputStream, portrait, listGoods);
      FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream,
            "sharegoods/share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png");