package com.yeshi.fanli.util.factory.msg;
|
|
import java.math.BigDecimal;
|
import java.util.Date;
|
|
import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
|
import com.yeshi.fanli.entity.bus.user.UserInfo;
|
|
public class MsgOrderDetailFactory {
|
|
/**
|
* 返利订单
|
*
|
* @param uid
|
* @param orderId
|
* @param goodsCount
|
* @param orderState
|
* @param payMoney
|
* @param money
|
* @param state
|
* @param beiZhu
|
* @return
|
*/
|
public static MsgOrderDetail createFanLiOrder(Long uid, String orderId, int goodsCount, int orderState,
|
BigDecimal payMoney, BigDecimal money, String beiZhu) {
|
if (uid == null)
|
return null;
|
MsgOrderDetail detail = new MsgOrderDetail();
|
detail.setBeiZhu(beiZhu);
|
detail.setCreateTime(new Date());
|
detail.setGoodsCount(goodsCount);
|
detail.setHongBaoMoney(money);
|
detail.setOrderId(orderId);
|
detail.setPayMoney(payMoney);
|
detail.setRead(false);
|
detail.setState(orderState);
|
detail.setType(MsgTypeOrderTypeEnum.fanli);
|
detail.setUser(new UserInfo(uid));
|
return detail;
|
}
|
|
/**
|
* 邀请订单
|
*
|
* @param uid
|
* @param orderId
|
* @param goodsCount
|
* @param orderState
|
* @param payMoney
|
* @param money
|
* @param state
|
* @param beiZhu
|
* @return
|
*/
|
public static MsgOrderDetail createInviteOrder(Long uid, String orderId, int goodsCount, int orderState,
|
BigDecimal payMoney, BigDecimal money, String beiZhu) {
|
if (payMoney == null || money == null || uid == null)
|
return null;
|
MsgOrderDetail detail = new MsgOrderDetail();
|
detail.setBeiZhu(beiZhu);
|
detail.setCreateTime(new Date());
|
detail.setGoodsCount(goodsCount);
|
detail.setHongBaoMoney(money);
|
detail.setOrderId(orderId);
|
detail.setPayMoney(payMoney);
|
detail.setRead(false);
|
detail.setState(orderState);
|
detail.setType(MsgTypeOrderTypeEnum.invite);
|
detail.setUser(new UserInfo(uid));
|
return detail;
|
}
|
|
/**
|
* 分享订单
|
*
|
* @param uid
|
* @param orderId
|
* @param goodsCount
|
* @param orderState
|
* @param payMoney
|
* @param money
|
* @param state
|
* @param beiZhu
|
* @return
|
*/
|
public static MsgOrderDetail createShareOrder(Long uid, String orderId, int goodsCount, int orderState,
|
BigDecimal payMoney, BigDecimal money, String beiZhu) {
|
if (payMoney == null || money == null || uid == null)
|
return null;
|
MsgOrderDetail detail = new MsgOrderDetail();
|
detail.setBeiZhu(beiZhu);
|
detail.setCreateTime(new Date());
|
detail.setGoodsCount(goodsCount);
|
detail.setHongBaoMoney(money);
|
detail.setOrderId(orderId);
|
detail.setPayMoney(payMoney);
|
detail.setRead(false);
|
detail.setState(orderState);
|
detail.setType(MsgTypeOrderTypeEnum.share);
|
detail.setUser(new UserInfo(uid));
|
return detail;
|
}
|
|
}
|