StudentPaymentOrderService.java 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. package com.ym.mec.biz.service;
  2. import java.math.BigDecimal;
  3. import java.util.Date;
  4. import java.util.List;
  5. import java.util.Map;
  6. import org.apache.ibatis.annotations.Param;
  7. import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
  8. import com.ym.mec.biz.dal.dto.PageInfoOrder;
  9. import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
  10. import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
  11. import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
  12. import com.ym.mec.biz.dal.entity.ActivityUserMapper;
  13. import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
  14. import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
  15. import com.ym.mec.biz.dal.enums.DealStatusEnum;
  16. import com.ym.mec.biz.dal.enums.GroupType;
  17. import com.ym.mec.biz.dal.enums.OrderTypeEnum;
  18. import com.ym.mec.biz.dal.enums.PayStatus;
  19. import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
  20. import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
  21. import com.ym.mec.biz.dal.vo.StudentPaymentOrderVo;
  22. import com.ym.mec.common.entity.HttpResponseResult;
  23. import com.ym.mec.common.entity.MallCreateOrderModel;
  24. import com.ym.mec.common.entity.OrderCancelModel;
  25. import com.ym.mec.common.page.PageInfo;
  26. import com.ym.mec.common.service.BaseService;
  27. import com.ym.mec.thirdparty.adapay.entity.BaseResult;
  28. import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
  29. public interface StudentPaymentOrderService extends BaseService<Long, StudentPaymentOrder> {
  30. StudentPaymentOrderDao getDao();
  31. Map createOrder(StudentPaymentOrder studentPaymentOrder, List<StudentPaymentOrderDetail> details, String payReceiver) throws Exception;
  32. /**
  33. * 查询订单列表
  34. *
  35. * @param groupType
  36. * @param musicGroupId
  37. * @param userId
  38. * @param status
  39. * @param type
  40. * @return
  41. */
  42. List<StudentPaymentOrder> queryByCondition(GroupType groupType, String musicGroupId, Integer userId, DealStatusEnum status, OrderTypeEnum type);
  43. /**
  44. * 查询报名缴费订单
  45. *
  46. * @param musicGroupId
  47. * @param status
  48. * @return
  49. */
  50. List<StudentPaymentOrder> findMusicGroupApplyOrderByStatus(Integer userId, String musicGroupId, DealStatusEnum status);
  51. /**
  52. * 根据orderNo查询订单
  53. *
  54. * @param orderNo
  55. * @return
  56. */
  57. StudentPaymentOrder findOrderByOrderNo(String orderNo);
  58. List<StudentPaymentOrder> findOrderByOrderNos(List<String> orderNoList);
  59. /**
  60. * 根据批次号查询
  61. *
  62. * @param userId 用户编号
  63. * @param batchNo 批次号
  64. * @param status 状态
  65. * @return
  66. */
  67. List<StudentPaymentOrder> queryByBatchNo(Integer userId, String batchNo, DealStatusEnum status);
  68. /**
  69. * 查询支付中订单
  70. *
  71. * @param status
  72. * @return
  73. */
  74. List<StudentPaymentOrder> findOrdersByStatus(DealStatusEnum status, String paymentChannel);
  75. /**
  76. * 查询支付中超时的订单
  77. *
  78. * @param orderNoList
  79. * @param status
  80. * @param beforeTime
  81. * @return
  82. */
  83. List<StudentPaymentOrder> findOrdersOverTime(List<String> orderNoList, DealStatusEnum status, Date beforeTime);
  84. void queryOrderStatus() throws Exception;
  85. /**
  86. * 检查并修改订单状态
  87. *
  88. * @param date
  89. * @param payConfigMap
  90. * @param payingOrder
  91. * @param checkTime
  92. * @return
  93. */
  94. OrderCancelModel updateOrderStatus(Date date, Map<Integer, HfMerchantConfig> payConfigMap, StudentPaymentOrder payingOrder, Boolean checkTime) throws Exception;
  95. //退优惠券和余额
  96. void quitCouponAndBalance(StudentPaymentOrder order);
  97. void updateOrder(Map<String, String> rpMap) throws Exception;
  98. List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params);
  99. /**
  100. * 获取零星收费订单列表
  101. *
  102. * @param queryInfo
  103. * @return
  104. */
  105. PageInfo<SporadicChargeInfoDto> sporadicQueryPage(SporadicOrderQueryInfo queryInfo);
  106. PageInfoOrder<StudentPaymentOrderDto> OrderQueryPage(StudentPaymentOrderQueryInfo queryInfo);
  107. /**
  108. * 获取订单第三方状态
  109. *
  110. * @param id
  111. * @return
  112. */
  113. Boolean getOrderStatus(Long id) throws Exception;
  114. /**
  115. * 获取分部支付成功支付中订单数量
  116. *
  117. * @param organId
  118. * @return
  119. */
  120. Integer findOrganPayOrderNum(Integer organId);
  121. /**
  122. * 获取用户某种类型的订单
  123. *
  124. * @param userId
  125. * @param type
  126. * @param status
  127. * @return
  128. */
  129. List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status);
  130. /**
  131. * 从新提交分账信息
  132. *
  133. * @param startTime
  134. * @param endTime
  135. * @return
  136. */
  137. List<StudentPaymentOrder> reConfirmOrder(Date startTime, Date endTime);
  138. /**
  139. * 获取学生报名的订单
  140. *
  141. * @param studentId
  142. * @param musicGroupId
  143. * @return
  144. */
  145. List<StudentPaymentOrderExportDto> getUserApplyOrders(Integer studentId, String musicGroupId);
  146. /**
  147. * 获取用户支付中的乐器置换订单
  148. *
  149. * @param userId
  150. * @param replacementId
  151. * @return
  152. */
  153. StudentPaymentOrder getUserReplacementIngOrder(Integer userId, Integer replacementId);
  154. void callOrderCallBack(StudentPaymentOrder order) throws Exception;
  155. int batchUpdate(List<StudentPaymentOrder> studentPaymentOrderList);
  156. PayStatus queryPayStatus(StudentPaymentOrder studentPaymentOrder) throws Exception;
  157. /**
  158. * 获取购买了乐器的报名订单
  159. *
  160. * @param musicGroupId
  161. * @param studentId
  162. * @return
  163. */
  164. Integer getOrderIdByMusical(@Param("musicGroupId") String musicGroupId, @Param("studentId") Integer studentId);
  165. /**
  166. * @param vipGroupActivityId
  167. * @return void
  168. * @description: 活动赠送课程,或者会员
  169. * @author zx
  170. * @date 2021/10/11 10:36
  171. */
  172. ActivityUserMapper activityGive(Integer vipGroupActivityId,
  173. StudentPaymentOrder studentPaymentOrder,
  174. String vipGroupId,
  175. String practiceGroupId);
  176. /**
  177. * @param order
  178. * @param repeatPay
  179. * @return com.ym.mec.common.entity.HttpResponseResult
  180. * @description: 校验重复支付
  181. * @author zx
  182. * @date 2021/12/29 14:50
  183. */
  184. HttpResponseResult checkRepeatPay(StudentPaymentOrder order, Boolean repeatPay) throws Exception;
  185. /**
  186. * @description: 订单关闭时需要更改已缴费学员数
  187. * @param order
  188. * @return void
  189. * @author zx
  190. * @date 2022/1/18 13:39
  191. */
  192. void cutSubjectPlan(StudentPaymentOrder order);
  193. PageInfo<StudentPaymentOrderVo> queryOrder(Map<String, Object> param) throws Exception;
  194. StudentPaymentOrderVo queryOrderDetail(String orderNo);
  195. List<StudentPaymentOrder> queryByDealStatus(String musicGroupId, OrderTypeEnum orderType, DealStatusEnum status);
  196. StudentPaymentOrder lockOrder(Long paymentOrderId);
  197. /**
  198. * @description: 退还账户余额和优惠券
  199. * @param studentPaymentOrder
  200. * @param memo
  201. * @return void
  202. * @author zx
  203. * @date 2022/1/20 16:23
  204. */
  205. void returnBalanceAndCoupon(StudentPaymentOrder studentPaymentOrder,String memo);
  206. //获取云教练订单
  207. StudentPaymentOrder getMemberIngOrder(OrderTypeEnum member, DealStatusEnum status);
  208. Map createOrder(MallCreateOrderModel model) throws Exception;
  209. void mallBuyOrderCallback(StudentPaymentOrder order);
  210. void mallBuyOrderCallback1(Long orderId);
  211. void mallSaveOrderInfo(MallCreateOrderModel model);
  212. OrderCancelModel cancelOrder(StudentPaymentOrder orderByOrderNo, String reason);
  213. // 撤销支付
  214. BaseResult<Map<String, Object>> refund(String orderNo, String notifyUrl, String refundNo);
  215. // 查询优惠券优惠券金额
  216. Map couponAmount(MallCreateOrderModel model);
  217. // 订单收货状态更新
  218. void receive(String orderNo, boolean autoReceive);
  219. // 查询余额
  220. BigDecimal balance(Long userId);
  221. }