yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderService.java
@@ -5,12 +5,16 @@
import java.util.List;
import java.util.Map;
import com.yeshi.fanli.dto.order.CommonOrderAddResultDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.order.ESOrder;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.vo.order.CommonOrderVO;
import com.yeshi.fanli.vo.order.OrderCountVO;
import net.sf.json.JSONObject;
@@ -46,7 +50,7 @@
    * @throws CommonOrderException
    */
   public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
         Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
         Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
         throws CommonOrderException;
   /**
@@ -62,7 +66,7 @@
    * @throws CommonOrderException
    */
   long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
         String startTime, String endTime, Integer dateType) throws CommonOrderException;
         String startTime, String endTime, Integer dateType, List<Integer> listSource) throws CommonOrderException;
   /**
    * 移动段订单列表
@@ -75,8 +79,9 @@
    *            到账状态
    * @return
    */
   public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
         String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
   public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type,
         Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, List<Integer> listSource)
         throws CommonOrderException,Exception;
   /**
    * 统计订单-根据红包类型 自购 邀请 分享
@@ -84,7 +89,7 @@
    * @param uid
    * @return
    */
   public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day);
   public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day, Integer source);
   /**
    * 统计订单
@@ -92,7 +97,8 @@
    * @param uid
    * @return
    */
   public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime);
   public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime,
         Integer source);
   /**
    * 统计订单
@@ -100,7 +106,8 @@
    * @param uid
    * @return
    */
   public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime);
   public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime,
         Integer source);
   /**
    * 统计奖金订单数量、金额
@@ -113,7 +120,7 @@
    * @return
    */
   public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
         String endTime);
         String endTime, Integer source);
   /**
    * 根据条件统计
@@ -124,8 +131,8 @@
    * @param endTime
    * @return
    */
   public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
         Integer day);
   public Long countUserOrderToApp(Long uid, Integer type, String startTime, String endTime,
         Integer day, Integer source, Integer state, Integer stateOrder);
   /**
    * 根据订单号与订单类型查询订单
@@ -144,7 +151,7 @@
    * @return
    * @throws CommonOrderException
    */
   public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
   public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
   /**
    * 缓存拼多多类普通订单
@@ -154,7 +161,7 @@
    * @return
    * @throws CommonOrderException
    */
   public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
   public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
   /**
    * 缓存京东普通订单
@@ -164,7 +171,7 @@
    * @return
    * @throws CommonOrderException
    */
   public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
   public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
   /**
    * 根据用户ID,订单状态,结算时间统计订单数量
@@ -218,31 +225,13 @@
    */
   public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state,
         Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException;
         Integer type, Integer orderState, String startTime, String endTime, Integer source,
         List<Long> listShopId, List<Long> listGoodsId, Date minTime, BigDecimal money)
         throws CommonOrderException;
   public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
         String startTime, String endTime) throws CommonOrderException;
   /**
    * 根据订单号获取信息
    *
    * @param orderNo
    * @return
    * @throws CommonOrderException
    */
   public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException;
   /**
    * 查询券奖励金额以及订单信息
    *
    * @param uid
    * @param state
    * @param orderNo
    * @return
    * @throws CommonOrderException
    */
   public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer state, String orderNo)
         throws CommonOrderException;
         String startTime, String endTime, Integer source,
         List<Long> listShopId, List<Long> listGoodsId,Date minTime, BigDecimal money) throws CommonOrderException;
   /**
    * 查询订单
@@ -252,7 +241,7 @@
    * @return
    * @throws CommonOrderException
    */
   public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState)
   public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState, Integer sourceType)
         throws CommonOrderException;
   /**
@@ -261,7 +250,7 @@
    * @param orderNo
    * @return
    */
   public JSONObject getRewardJumpInfo(String orderNo);
   public JSONObject getRewardJumpInfo(String orderNo, Integer goodsType);
   /**
    * 根据交易号获取订单详情
@@ -288,4 +277,103 @@
    */
   public List<CommonOrder> listBySourceTypeAndTradeId(int sourceType, String tradeId);
   /**
    * 根据条件查询订单
    *
    * @param sourceType
    * @param state
    * @param minTime
    * @param maxTime
    * @param page
    * @param pageSize
    * @return
    */
   public List<CommonOrder> listBySourceTypeAndStateAndThirdCrateTime(int sourceType, Integer state, Long minTime,
         Long maxTime, int page, int pageSize);
   /**
    * 查询订单 -根据订单号
    *
    * @param uid
    * @param orderNO
    * @return
    */
   public List<CommonOrder> getByOrderNo(Long uid, String orderNO);
   /**
    * 根据用户ID查询最近一条有效的订单
    *
    * @param uid
    * @return
    */
   public CommonOrder selectLatestValidByUid(Long uid);
   /**
    * 查询首笔有效订单
    * @param uid
    * @return
    */
   public CommonOrderVO firstValidOrderByUid(Long uid);
   /**
    * 查询首笔有效订单
    * @param uid
    * @param type 类型: 1自购  2分享 3邀请
    * @return
    */
   public CommonOrderVO firstValidOrderByUidAndType(Long uid, Integer type);
   /**
    * 查询是否上月到账订单
    * @param uid
    * @param type 类型: 1自购  2分享 3邀请
    * @return
    */
   public CommonOrderVO firstValidOrderLastMonthByUidAndType(Long uid, Integer type);
   /**
    * 首个分享订单
    * @param uid
    * @return
    */
   public CommonOrder getFirstShareOrderByUid(Long uid);
   /**
    * 订单中获得有效奖金
    * @param orderNo
    * @param sourceType
    * @return
    */
   public BigDecimal getTotalRewardMoneyByOrderNoAndSourceType(String orderNo, Integer sourceType);
   /**
    * 统计24小时有效自购订单
    * @param uid
    * @param minTime
    * @return
    */
   public long count24HValidOrderByUid(Long uid, Date minTime);
   /**
    * 订单统计有效数量
    * @param uid
    * @param day
    * @param source
    * @return
    */
   public OrderCountVO getOrderCount(Long uid, Integer day,  List<Integer> listSource);
   /**
    * 搜索订单信息
    * @param page
    * @param size
    * @param uid
    * @param list
    * @return
    */
   public List<CommonOrderVO> searchOrderByUid(int page, int size, Long uid, List<ESOrder> list) throws Exception;
   public long countSearchOrderByUid(Long uid, List<ESOrder> list);
}