| | |
| | | return tb;
|
| | | }
|
| | |
|
| | |
|
| | | public static ScanHistory getScanHistory(TaoBaoGoodsBrief tb) {
|
| | | ScanHistory sh = new ScanHistory();
|
| | | Field[] fields = tb.getClass().getDeclaredFields();
|
| | |
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 获取商品的用户分成比例
|
| | | *
|
| | |
| | | * @return
|
| | | */
|
| | | public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | // 营销计划
|
| | | // if ("1".equalsIgnoreCase(goodsBrief.getTkMktStatus())) {
|
| | | // return "最高40%";
|
| | | // } else {
|
| | | // 计算返利
|
| | | // 无券
|
| | | return "¥" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取淘宝商品该获得多少佣金
|
| | | * |
| | | * @param goodsBrief
|
| | | * @param rate
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getGoodsHongBaoMoney(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | if (StringUtil.isNullOrEmpty(goodsBrief.getCouponInfo())
|
| | | || goodsBrief.getCouponInfo().trim().equalsIgnoreCase("无")) {
|
| | | return "¥" + goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000))
|
| | | .multiply(rate).setScale(2, BigDecimal.ROUND_DOWN);
|
| | |
|
| | | return goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000)).multiply(rate)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN);
|
| | | } else// 有券
|
| | | {
|
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goodsBrief.getCouponInfo());
|
| | |
| | | if (startFee.compareTo(goodsBrief.getZkPrice()) <= 0
|
| | | && goodsBrief.getZkPrice().compareTo(couponAccount) > 0) {
|
| | | BigDecimal finalPrice = goodsBrief.getZkPrice().subtract(couponAccount);
|
| | | return "¥" + finalPrice.multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000)).multiply(rate)
|
| | | return finalPrice.multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000)).multiply(rate)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN);
|
| | |
|
| | | } else {// 不能用券
|
| | | return "¥" + goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000))
|
| | | return goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000))
|
| | | .multiply(rate).setScale(2, BigDecimal.ROUND_DOWN);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // }
|
| | |
|
| | | // 获取券的红包显示
|