admin
2019-08-26 d28bed1a1275131a5ca37f7da37961e2b518ac07
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
import com.yeshi.fanli.exception.money.UserMoneyDetailException;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -45,6 +46,7 @@
      detail.setDescInfo("订单号:" + orderId);
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(orderType);
      return detail;
   }
@@ -60,7 +62,7 @@
    * @return
    * @throws UserMoneyDetailException
    */
   public static UserMoneyDetail createShare(Long uid, int validCount, int weiQuanCount, int invalidCount,
   public static UserMoneyDetail createShare(Long uid,int orderType, int validCount, int weiQuanCount, int invalidCount,
         BigDecimal money, Date time) throws UserMoneyDetailException {
      if (money == null)
         throw new UserMoneyDetailException(1, "返利金额为空");
@@ -75,7 +77,7 @@
      ca.setTime(time);
      ca.add(Calendar.MONTH, -1);
      String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年MM月");
      String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
@@ -86,6 +88,7 @@
      detail.setDescInfo(String.format("有效订单:%s笔  维权订单:%s笔  失效订单:%s笔", validCount, weiQuanCount, invalidCount));
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(orderType);
      return detail;
   }
@@ -101,7 +104,7 @@
    * @return
    * @throws UserMoneyDetailException
    */
   public static UserMoneyDetail createInvite(Long uid, int validCount, int weiQuanCount, int invalidCount,
   public static UserMoneyDetail createInvite(Long uid,int orderType, int validCount, int weiQuanCount, int invalidCount,
         BigDecimal money, Date time) throws UserMoneyDetailException {
      if (money == null)
         throw new UserMoneyDetailException(1, "返利金额为空");
@@ -116,7 +119,7 @@
      ca.setTime(time);
      ca.add(Calendar.MONTH, -1);
      String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年MM月");
      String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
      UserMoneyDetail detail = new UserMoneyDetail();
      detail.setCreateTime(new Date());
@@ -128,6 +131,7 @@
         detail.setDescInfo(String.format("有效订单:%s笔   维权订单:%s笔   失效订单:%s笔", validCount, weiQuanCount, invalidCount));
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(orderType);
      return detail;
   }
@@ -167,6 +171,7 @@
      detail.setDescInfo("订单号:" + drawBack.getOrderId());
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
      return detail;
   }
@@ -206,6 +211,7 @@
      detail.setDescInfo("订单号:" + drawBack.getOrderId());
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
      return detail;
   }
@@ -245,6 +251,7 @@
      detail.setDescInfo("订单号:" + drawBack.getOrderId());
      detail.setUpdateTime(new Date());
      detail.setUserInfo(new UserInfo(uid));
      detail.setOrderType(Constant.SOURCE_TYPE_TAOBAO);
      return detail;
   }
@@ -415,7 +422,7 @@
    * @return
    * @throws UserMoneyDetailException
    */
   public static UserMoneyDetail createOrderReward(String orderId, BigDecimal money, UserInfo user)
   public static UserMoneyDetail createOrderReward(String orderId,int orderType, BigDecimal money, UserInfo user)
         throws UserMoneyDetailException {
      if (StringUtil.isNullOrEmpty(orderId))
         throw new UserMoneyDetailException(1, "订单号不能为空");
@@ -432,6 +439,7 @@
      detail.setType(UserMoneyDetailTypeEnum.orderReward);
      detail.setUpdateTime(new Date());
      detail.setUserInfo(user);
      detail.setOrderType(orderType);
      // detail.setDescInfo("订单号:" + orderId);
      return detail;
   }
@@ -445,7 +453,7 @@
    * @return
    * @throws UserMoneyDetailException
    */
   public static UserMoneyDetail createRepeatStatistic(String orderId, BigDecimal money, UserInfo user)
   public static UserMoneyDetail createRepeatStatistic(String orderId,int orderType,  BigDecimal money, UserInfo user)
         throws UserMoneyDetailException {
      if (StringUtil.isNullOrEmpty(orderId))
         throw new UserMoneyDetailException(1, "订单号不能为空");
@@ -464,6 +472,7 @@
      detail.setUpdateTime(new Date());
      detail.setUserInfo(user);
      detail.setDescInfo("订单号:" + orderId);
      detail.setOrderType(orderType);
      return detail;
   }