| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.util.CommonGoodsUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | | private UserShareGoodsRecordService userShareGoodsRecordService;
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal rate = manageService.getFanLiRate();
|
| | | BigDecimal rate = manageService.getFanLiRate(UserLevelEnum.daRen);
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | |
| | | BigDecimal totalMoney = new BigDecimal(0.00);
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
|
| | | for (UserGoodsStorage userGoodsStorage : listResult) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods);
|
| | | listGoodsBrief.add(goodsBrief);
|
| | |
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(goodsBrief, rate);
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(goodsBrief, rate,true);
|
| | | totalMoney = MoneyBigDecimalUtil.add(totalMoney, money);
|
| | | }
|
| | |
|
| | |
| | | FileUploadResult uploadResult = new FileUploadResult();
|
| | | uploadResult.setUrl(shareRecord.getSharePictureUrl());
|
| | |
|
| | | UserInfo user=userInfoService.selectByPKey(uid);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("revenue", listGoodsBrief.size() + "个商品预估分享奖金:¥" + totalMoney);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | data.put("shareImg", uploadResult);
|
| | | data.put("notifyDesc", configService.get("goods_share_multiple_notify"));
|
| | | data.put("notifyDesc", configService.getValue(ConfigKeyEnum.goodsShareMultipleNotify.getKey(), user.getSystem()));
|
| | | return data;
|
| | | }
|
| | |
|
| | |
| | | List<CommonGoods> listCommonGoods = new ArrayList<CommonGoods>();
|
| | |
|
| | | Integer goodsType = null;
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
|
| | | for (UserGoodsStorage userGoodsStorage : listResult) {
|
| | | CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
|
| | | BigDecimal money = CommonGoodsUtil.getCommission(commonGoods, rate);
|
| | |
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | data.put("shareImg", uploadResult);
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(uid);
|
| | | // 提示语不同
|
| | | if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | // 京东
|
| | | data.put("notifyDesc", configService.get("goods_share_notify_jd"));
|
| | | data.put("notifyDesc", configService.getValue(ConfigKeyEnum.goodsShareNotifyJD.getKey(),system));
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | // 拼多多
|
| | | data.put("notifyDesc", configService.get("goods_share_notify_pdd"));
|
| | | data.put("notifyDesc", configService.getValue(ConfigKeyEnum.goodsShareNotifyPDD.getKey(),system));
|
| | | } else {
|
| | | data.put("notifyDesc", configService.get("goods_share_multiple_notify"));
|
| | | data.put("notifyDesc", configService.getValue(ConfigKeyEnum.goodsShareMultipleNotify.getKey(),system));
|
| | | }
|
| | | return data;
|
| | | }
|