admin
2020-04-15 ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a
fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java
@@ -252,7 +252,6 @@
      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 {
@@ -688,13 +687,11 @@
      }
      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;
   }
@@ -748,19 +745,19 @@
      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));
@@ -787,17 +784,16 @@
    * @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);