| | |
| | | userShareGoodsRecord.setCreateTime(null);
|
| | | userShareGoodsRecord.setUpdateTime(null);
|
| | | listId.add(userShareGoodsRecord.getId());
|
| | | |
| | | // 改变图片尺寸
|
| | | String pictUrl = userShareGoodsRecord.getPicture();
|
| | | if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) {
|
| | | userShareGoodsRecord.setPicture(TbImgUtil.getTBSize320Img(pictUrl));
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
|
| | | // 今日浏览统计
|
| | |
| | | userShareGoodsRecord.setUpdateTime(new Date());
|
| | | userShareGoodsRecordMapper.updateByPrimaryKey(userShareGoodsRecord);
|
| | |
|
| | | Integer totalOrder = shareGoodsGroup.getTotalOrder();
|
| | | if (totalOrder == null ||totalOrder == 0 || totalOrder.equals(0)) {
|
| | | // 预计金额
|
| | | String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
|
| | | shareGoodsGroup.setUpdateTime(new Date());
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, new BigDecimal(rateStr));
|
| | | shareGoodsGroup.setTotalMoney(money);
|
| | | |
| | | userShareGoodsGroupService.updateByPrimaryKeySelective(shareGoodsGroup);
|
| | | }
|
| | | } else {
|
| | | // 最新商品
|
| | | shareGoodsGroup.setUpdateTime(new Date());
|
| | | userShareGoodsGroupService.updateByPrimaryKeySelective(shareGoodsGroup);
|
| | | |
| | | } else |
| | | {
|
| | | // 单个商品第一次分享
|
| | | Date date = new Date();
|
| | | userShareGoodsRecord.setPicture(taoBaoGoodsBrief.getPictUrl());
|
| | |
| | | shareGoodsGroup.setTotalOrder(0);
|
| | | shareGoodsGroup.setTotalBrowse(0);
|
| | | shareGoodsGroup.setTodayBrowse(0);
|
| | | shareGoodsGroup.setTotalMoney(new BigDecimal(0));
|
| | | shareGoodsGroup.setCreateTime(date);
|
| | | shareGoodsGroup.setUpdateTime(date);
|
| | | shareGoodsGroup.setCommonGoods(resultCommonGoods);
|
| | | shareGoodsGroup.setRecordId(userShareGoodsRecord.getId());
|
| | |
|
| | | // 预计金额
|
| | | String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, new BigDecimal(rateStr));
|
| | | shareGoodsGroup.setTotalMoney(money);
|
| | |
|
| | | userShareGoodsGroupService.insertSelective(shareGoodsGroup);
|
| | | }
|
| | |
| | |
|
| | | // 分享记录
|
| | | Date date = new Date();
|
| | | String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
|
| | |
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | | List<UserShareGoodsGroup> listGroup = new ArrayList<UserShareGoodsGroup>();
|
| | |
| | | shareGoodsGroup.setTotalOrder(0);
|
| | | shareGoodsGroup.setTotalBrowse(0);
|
| | | shareGoodsGroup.setTodayBrowse(0);
|
| | | shareGoodsGroup.setTotalMoney(new BigDecimal(0));
|
| | | shareGoodsGroup.setCreateTime(date);
|
| | | shareGoodsGroup.setUpdateTime(date);
|
| | | shareGoodsGroup.setCommonGoods(resultCommonGoods);
|
| | | shareGoodsGroup.setRecordId(userShareGoodsRecord.getId());
|
| | |
|
| | | // 预计金额
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, new BigDecimal(rateStr));
|
| | | shareGoodsGroup.setTotalMoney(money);
|
| | |
|
| | | listGroup.add(shareGoodsGroup);
|
| | |
|