| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | return userTaoLiJinRecordMapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public UserTaoLiJinRecord createSelfBuyTaoLiJin(Long uid, BigDecimal couplePrice, TaoBaoGoodsBrief goods) |
| | |
| | | throw new UserTaoLiJinRecordException(101, "渠道未备案"); |
| | | } |
| | | UserTaoLiJinRecord record = createUserTaoLiJin(1, uid, goods.getAuctionId(), couplePrice, 1, name, |
| | | sendStartTime, sendEndTime, null, useEndTime, TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID); |
| | | sendStartTime, sendEndTime, null, useEndTime, pidManager.getPidCache(SystemEnum.blks, Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanliChannel)); |
| | | record.setSendUrl(record.getSendUrl() + "&relationId=" + relationId); |
| | | UserTaoLiJinRecord updateRecoed = new UserTaoLiJinRecord(); |
| | | updateRecoed.setId(record.getId()); |
| | |
| | | return record; |
| | | } else {// 返利库商品 |
| | | return createUserTaoLiJin(1, uid, goods.getAuctionId(), couplePrice, 1, name, sendStartTime, sendEndTime, null, |
| | | useEndTime, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT); |
| | | useEndTime, pidManager.getPidCache(SystemEnum.blks, Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanli)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum, |
| | | public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, String auctionId, BigDecimal perface, int totalNum, |
| | | String name, Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, String pid) |
| | | throws UserTaoLiJinRecordException { |
| | | |
| | |
| | | return list; |
| | | } |
| | | |
| | | List<Long> listGoodsId = new ArrayList<Long>(); |
| | | List<String> listGoodsId = new ArrayList<>(); |
| | | for (UserTaoLiJinRecordVO userTaoLiJinRecordVO : list) { |
| | | listGoodsId.add(userTaoLiJinRecordVO.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 组织相关数据 |
| | | for (UserTaoLiJinRecordVO userTaoLiJinRecordVO : list) { |
| | | long auctionId = userTaoLiJinRecordVO.getAuctionId().longValue(); |
| | | String auctionId = userTaoLiJinRecordVO.getAuctionId(); |
| | | |
| | | // 商品信息 |
| | | for (int i = 0; i < listGoods.size(); i++) { |
| | | CommonGoods commonGoods = listGoods.get(i); |
| | | long goodsId = commonGoods.getGoodsId().longValue(); |
| | | if (auctionId == goodsId) { |
| | | String goodsId = commonGoods.getGoodsId(); |
| | | if (TaoBaoUtil.isEqual(auctionId , goodsId)) { |
| | | userTaoLiJinRecordVO.setTitle(commonGoods.getTitle()); |
| | | userTaoLiJinRecordVO.setPictUrl(commonGoods.getPicture()); |
| | | if (CommonGoods.SHOP_TYPE_TB == commonGoods.getShopType()) { |
| | |
| | | BigDecimal shareMoney = new BigDecimal(0); |
| | | BigDecimal commission = userTaoLiJinRecordVO.getCommission(); |
| | | if (commission != null && commission.compareTo(shareMoney) > 0) { |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen,system); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(UserLevelEnum.daRen, system); |
| | | shareMoney = MoneyBigDecimalUtil.mul(commission, |
| | | MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100))); |
| | | shareMoney = BigDecimalUtil.getWithNoZera(shareMoney); |