| | |
| | | return CommonOrder.STATE_SX;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean updateHongBao(HongBaoOrder hongBaoOrder, CommonOrder commonOrder, int type,
|
| | | Map<Integer, HongBaoOrder> notificationMap, Date placeOrderTime)
|
| | | throws HongBaoException, UserAccountException {
|
| | |
| | | }
|
| | |
|
| | | child.setUserInfo(user);
|
| | | child.setUrank(user.getRank());
|
| | | child.setUrank(userLevel.getOrderRank());
|
| | | child.setVersion(2);
|
| | | child.setCreateTime(new Date());
|
| | | child.setOrderType(commonOrder.getSourceType());
|
| | | if (child.getMoney() == null)
|
| | | return null;
|
| | | if (child.getMoney().compareTo(new BigDecimal(0)) <= 0 && userLevel == UserLevelEnum.daRen)
|
| | | return null;
|
| | | return child;
|
| | | }
|
| | |
| | | return hongBao;
|
| | | }
|
| | |
|
| | | private HongBaoV2 createFanLiUpdateHongBao(CommonOrder commonOrder, BigDecimal fanliRate, Long hongBaoId,
|
| | | private HongBaoV2 createFanLiUpdateHongBao(CommonOrder commonOrder, BigDecimal money, Long hongBaoId,
|
| | | boolean mianDan) throws HongBaoException, UserAccountException {
|
| | | HongBaoV2 hongBao = new HongBaoV2(hongBaoId);
|
| | | hongBao.setUpdateTime(new Date());
|
| | | hongBao.setMoney(money);
|
| | | // 更改状态与资金
|
| | | if (commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | | hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | hongBao.setMoney(MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
|
| | |
|
| | | if (mianDan)
|
| | | hongBao.setMoney(commonOrder.getPayment());
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
|
| | | if (commonOrder.getSourceType() == Constant.SOURCE_TYPE_PDD)// 拼多多15天过1个小时到账
|
| | | hongBao.setPreGetTime(new Date(
|
| | | commonOrder.getSettleTime().getTime() + 1000 * 60 * 60 * 24 * 15L + 1000 * 60 * 60 * 1L));
|
| | |
| | | * @throws HongBaoException
|
| | | * @throws UserAccountException
|
| | | */
|
| | | private HongBaoV2 createShareUpdateHongBao(CommonOrder commonOrder, BigDecimal fanliRate, Long hongBaoId)
|
| | | private HongBaoV2 createShareUpdateHongBao(CommonOrder commonOrder, BigDecimal money, Long hongBaoId)
|
| | | throws HongBaoException, UserAccountException {
|
| | | HongBaoV2 hongBao = new HongBaoV2(hongBaoId);
|
| | | hongBao.setUpdateTime(new Date());
|
| | | hongBao.setMoney(money);
|
| | | // 更改状态与资金
|
| | | if (commonOrder.getState() == CommonOrder.STATE_FK) {
|
| | | hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
|
| | | hongBao.setMoney(MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
|
| | | } else if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_WQ) {
|
| | | hongBao.setState(HongBaoV2.STATE_KELINGQU);
|
| | | hongBao.setMoney(MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(commonOrder.getSettleTime());
|
| | | calendar.add(Calendar.MONTH, 1);
|