yujian
2019-02-28 70c9043f312a52a922cb15490d90a172b3515060
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -24,7 +24,7 @@
    * @param hongBaoList
    * @return
    */
   public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType,Long hbId, BigDecimal money)
   public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, Long hbId, BigDecimal money)
         throws UserMoneyDetailException {
      if (StringUtil.isNullOrEmpty(orderId))
@@ -38,8 +38,8 @@
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
      detail.setIdentifyCode(
            StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId+"-"+hbId));
      detail.setIdentifyCode(StringUtil
            .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbId));
      detail.setMoney(money);
      detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
      detail.setType(UserMoneyDetailTypeEnum.fanli);
@@ -408,6 +408,7 @@
      detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.extractReject.name() + ":" + extract.getId()));
      detail.setMoney(extract.getMoney());
      detail.setSourceIdentifyId(extract.getId());
      detail.setSubTitle("原路退回");
      detail.setTitle(UserMoneyDetailTypeEnum.extractReject.getDesc());
      detail.setType(UserMoneyDetailTypeEnum.extractReject);
      detail.setUpdateTime(new Date());
@@ -589,4 +590,34 @@
      return detail;
   }
   /**
    * 返利奖励
    *
    * @param orderId
    * @param money
    * @param user
    * @return
    * @throws UserMoneyDetailException
    */
   public static UserMoneyDetail createOrderReward(String orderId, BigDecimal money, UserInfo user)
         throws UserMoneyDetailException {
      if (StringUtil.isNullOrEmpty(orderId))
         throw new UserMoneyDetailException(1, "订单号不能为空");
      if (user == null)
         throw new UserMoneyDetailException(1, "UID不能为空");
      if (money == null)
         throw new UserMoneyDetailException(1, "金额不能为空");
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
      detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "老版本" + "-" + orderId));
      detail.setMoney(money);
      detail.setTitle(UserMoneyDetailTypeEnum.orderReward.getDesc());
      detail.setType(UserMoneyDetailTypeEnum.orderReward);
      detail.setUpdateTime(new Date());
      detail.setUserInfo(user);
//      detail.setDescInfo("订单号:" + orderId);
      return detail;
   }
}