admin
2020-04-15 ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -680,5 +680,47 @@
      detail.setUserInfo(new UserInfo(uid));
      return detail;
   }
   /**
    * 团队分红
    * @Title: createTeamDividents
    * @Description:
    * @param uid
    * @param money
    * @param time
    * @return
    * @throws UserMoneyDetailException
    * UserMoneyDetail 返回类型
    * @throws
    */
   public static UserMoneyDetail createTeamDividents(Long uid, BigDecimal money, Date time)
         throws UserMoneyDetailException {
      if (money == null)
         throw new UserMoneyDetailException(1, "返利金额为空");
      if (uid == null)
         throw new UserMoneyDetailException(1, "UID为空");
      if (time == null)
         throw new UserMoneyDetailException(1, "发生时间为空");
      Calendar ca = Calendar.getInstance();
      ca.setTime(time);
      ca.add(Calendar.MONTH, -1);
      String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年M月");
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
      detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.teamDividents.name() + "-" + uid + "-" + timeF));
      detail.setMoney(money);
      detail.setTitle(UserMoneyDetailTypeEnum.teamDividents.getDesc());
      detail.setType(UserMoneyDetailTypeEnum.teamDividents);
      detail.setDescInfo(timeF);
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      return detail;
   }
}