| | |
| | | });
|
| | | }
|
| | | } else if ("订单结算".equals(taoBaoOrder.getOrderState())) {// 更新预估获取时间
|
| | | BigDecimal money = MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), rate);
|
| | | BigDecimal money = MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), rate);
|
| | | // 设置预计领取时间
|
| | | long settlementTime = TimeUtil.convertDateToTemp2(taoBaoOrder.getSettlementTime().trim());
|
| | | // 预计领取时间
|
| | |
| | | hongBaoMapper.updateByPrimaryKeySelective(updateChildHongBao);
|
| | | });
|
| | |
|
| | | BigDecimal estimate = taoBaoOrder.getEstimate();
|
| | | BigDecimal estimate = taoBaoOrder.geteIncome();
|
| | | updateHongBao.setPayMoney(taoBaoOrder.getSettlement());
|
| | | updateHongBao.setMoney(MoneyBigDecimalUtil.mul(estimate, rate));
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 创建红包
|
| | | JSONObject data = new JSONObject();
|
| | | HongBao hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.getEstimate()),
|
| | | data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getPayment(),
|
| | | taoBaoOrder.getAuctionId());
|
| | | HongBao hongBao = null;
|
| | | if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算"))
|
| | | // 订单结算应该取结算金额与预估收入
|
| | | hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.geteIncome()),
|
| | | data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getSettlement(),
|
| | | taoBaoOrder.getAuctionId());
|
| | | else
|
| | | hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.getEstimate()),
|
| | | data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getPayment(),
|
| | | taoBaoOrder.getAuctionId());
|
| | |
|
| | | hongBao.setOrderId(taoBaoOrder.getOrderId());
|
| | | hongBao.setOrderItemId(orderItem.getId());
|
| | | hongBao.setPreGettime(0L);
|
| | |
| | | else
|
| | | rate = new BigDecimal(hbm.getValue()).divide(new BigDecimal(100));
|
| | | if (rate.compareTo(new BigDecimal(0)) > 0) {
|
| | | HongBao hongBao2 = HongBaoFactory.createHongBao(
|
| | | HongBao hongBao2 = null;
|
| | | if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算")) {
|
| | | // 订单结算应该取结算金额与预估收入
|
| | | hongBao2 = HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), baseRate)),
|
| | | null, hongBao, boss, Constant.ONESALE);
|
| | | } else {
|
| | | hongBao2 = HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
|
| | | null, hongBao, boss, Constant.ONESALE);
|
| | | }
|
| | |
|
| | | HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
|
| | | null, hongBao, boss, Constant.ONESALE);
|
| | | // 设置订单号
|
| | |
| | | else
|
| | | rate = new BigDecimal(hbm.getValue()).divide(new BigDecimal(100));
|
| | | if (rate.compareTo(new BigDecimal(0)) > 0) {
|
| | |
|
| | | HongBao hongBao3 = HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
|
| | | null, hongBao, boss2, Constant.TWOSALE);
|
| | | // 订单结算应该取结算金额与预估收入
|
| | | HongBao hongBao3 = null;
|
| | | if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算"))
|
| | | hongBao3 = HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate,
|
| | | MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), baseRate)),
|
| | | null, hongBao, boss2, Constant.TWOSALE);
|
| | | else
|
| | | hongBao3 = HongBaoFactory.createHongBao(
|
| | | MoneyBigDecimalUtil.mul(rate,
|
| | | MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
|
| | | null, hongBao, boss2, Constant.TWOSALE);
|
| | | // 设置返利订单号
|
| | | hongBao3.setOrderId(taoBaoOrder.getOrderId());
|
| | | hongBaoMapper.insertSelective(hongBao3);
|