|
@@ -1,6 +1,9 @@
|
|
package com.ym.mec.biz.service.impl;
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dto.PageInfoOrder;
|
|
import com.ym.mec.biz.dal.dto.PageInfoOrder;
|
|
import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
|
|
import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
|
|
@@ -10,21 +13,21 @@ import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
|
|
+import com.ym.mec.biz.dal.vo.StudentPaymentOrderVo;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.page.PageInfo;
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
|
+import com.ym.mec.common.page.PageUtil;
|
|
|
|
+import com.ym.mec.common.page.WrapperUtil;
|
|
import com.ym.mec.common.service.IdGeneratorService;
|
|
import com.ym.mec.common.service.IdGeneratorService;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
import com.ym.mec.thirdparty.adapay.ConfigInit;
|
|
import com.ym.mec.thirdparty.adapay.ConfigInit;
|
|
import com.ym.mec.thirdparty.adapay.Payment;
|
|
import com.ym.mec.thirdparty.adapay.Payment;
|
|
-import com.ym.mec.thirdparty.yqpay.Msg;
|
|
|
|
-import com.ym.mec.thirdparty.yqpay.RsqMsg;
|
|
|
|
-import com.ym.mec.thirdparty.yqpay.YqPayFeignService;
|
|
|
|
-import com.ym.mec.thirdparty.yqpay.YqPayUtil;
|
|
|
|
|
|
+import com.ym.mec.thirdparty.yqpay.*;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -101,6 +104,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
private ActivityUserMapperDao activityUserMapperDao;
|
|
private ActivityUserMapperDao activityUserMapperDao;
|
|
@Autowired
|
|
@Autowired
|
|
private StudentService studentService;
|
|
private StudentService studentService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, StudentPaymentOrder> getDAO() {
|
|
public BaseDAO<Long, StudentPaymentOrder> getDAO() {
|
|
@@ -374,10 +379,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
}
|
|
}
|
|
|
|
|
|
private Boolean confirmOrder(StudentPaymentOrder order) {
|
|
private Boolean confirmOrder(StudentPaymentOrder order) {
|
|
- // 只有大雅延迟分账,其他实时分账
|
|
|
|
- if (order.getTenantId() != 1) {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+ // 只有大雅延迟分账,其他实时分账
|
|
|
|
+ if (order.getTenantId() != 1) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
|
|
List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
|
|
for (StudentPaymentRouteOrder routeOrder : routeOrders) {
|
|
for (StudentPaymentRouteOrder routeOrder : routeOrders) {
|
|
@@ -790,4 +795,39 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
sysCouponCodeService.quit(order.getCouponCodeId());
|
|
sysCouponCodeService.quit(order.getCouponCodeId());
|
|
return BaseController.succeed();
|
|
return BaseController.succeed();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 只查询成功的订单
|
|
|
|
+ *
|
|
|
|
+ * @param param
|
|
|
|
+ */
|
|
|
|
+ public PageInfo<StudentPaymentOrderVo> queryOrder(Map<String, Object> param) throws Exception {
|
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if (Objects.isNull(user)) {
|
|
|
|
+ throw new BizException("未查询到学员信息!");
|
|
|
|
+ }
|
|
|
|
+ param.put("user", user.getId());
|
|
|
|
+ String queryDateStr = WrapperUtil.toStr(param, "queryDate", "请选择查询日期!");
|
|
|
|
+ Date startDate = DateUtils.parseDate(queryDateStr + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Date endDate = DateUtils.addMonths(startDate, 1);
|
|
|
|
+ param.put("startDate", startDate);
|
|
|
|
+ param.put("endDate", endDate);
|
|
|
|
+ Page<StudentPaymentOrderVo> pageInfo = PageUtil.getPageInfo(param);
|
|
|
|
+ pageInfo.setDesc("a.create_time_");
|
|
|
|
+ return PageUtil.pageInfo(studentPaymentOrderDao.queryStudentOrderPage(pageInfo, param));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询订单明细
|
|
|
|
+ *
|
|
|
|
+ * @param orderNo 订单编号
|
|
|
|
+ */
|
|
|
|
+ public StudentPaymentOrderVo queryOrderDetail(String orderNo) {
|
|
|
|
+ Optional.ofNullable(orderNo)
|
|
|
|
+ .map(this::findOrderByOrderNo)
|
|
|
|
+ .orElseThrow(() -> new BizException("未查询到该订单数据!"));
|
|
|
|
+ return studentPaymentOrderDao.queryOrderDetail(orderNo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|