|
@@ -2,12 +2,14 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
|
|
|
import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
import com.ym.mec.biz.dal.dto.PageInfoOrder;
|
|
|
import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
@@ -15,7 +17,9 @@ import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.common.service.IdGeneratorService;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.thirdparty.adapay.ConfigInit;
|
|
|
import com.ym.mec.thirdparty.adapay.Payment;
|
|
|
import com.ym.mec.thirdparty.yqpay.Msg;
|
|
|
import com.ym.mec.thirdparty.yqpay.RsqMsg;
|
|
@@ -62,6 +66,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
private SubjectChangeService subjectChangeService;
|
|
|
@Autowired
|
|
|
private DegreeRegistrationService degreeRegistrationService;
|
|
|
+ @Autowired
|
|
|
+ private StudentPaymentRouteOrderDao studentPaymentRouteOrderDao;
|
|
|
+ @Autowired
|
|
|
+ private IdGeneratorService idGeneratorService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, StudentPaymentOrder> getDAO() {
|
|
@@ -186,7 +194,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
if (status.equals("succeeded") ||
|
|
|
- (status.equals("failed") && payingOrder.getCreateTime().before(DateUtil.addMinutes(new Date(),-35)))) {
|
|
|
+ (status.equals("failed") && payingOrder.getCreateTime().before(DateUtil.addMinutes(new Date(), -35)))) {
|
|
|
try {
|
|
|
updateOrder(rpMap); //更新订单
|
|
|
} catch (Exception e) {
|
|
@@ -237,6 +245,29 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
order.setPaymentBusinessChannel(rpMap.get("channelType"));
|
|
|
|
|
|
+ if (status.equals(DealStatusEnum.SUCCESS) && order.getPaymentChannel().equals("ADAPAY")
|
|
|
+ && !rpMap.containsKey("simulation")) {
|
|
|
+ List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
|
|
|
+ for (StudentPaymentRouteOrder routeOrder : routeOrders) {
|
|
|
+ Map<String, Object> divMember = new HashMap<>();
|
|
|
+ divMember.put("member_id", routeOrder.getMerNo());//分佣账户
|
|
|
+ divMember.put("amount", routeOrder.getRouteAmount().setScale(2, BigDecimal.ROUND_HALF_UP));//分佣金额
|
|
|
+ divMember.put("fee_flag", "Y");
|
|
|
+ if (routeOrder.getMerNo().equals(ConfigInit.merNo)) {
|
|
|
+ divMember.put("member_id", 0);
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> divMembers = new ArrayList<>();
|
|
|
+ divMembers.add(divMember);
|
|
|
+
|
|
|
+ Map<String, Object> confirm = new HashMap<>();
|
|
|
+ confirm.put("payment_id", order.getTransNo());
|
|
|
+ confirm.put("order_no", idGeneratorService.generatorId("payment"));
|
|
|
+ confirm.put("confirm_amt", routeOrder.getRouteAmount());
|
|
|
+ confirm.put("div_members", divMembers);
|
|
|
+ Payment.createConfirm(confirm);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
callOrderCallBack(order);
|
|
|
}
|
|
|
|
|
@@ -417,6 +448,6 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
|
public List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status) {
|
|
|
- return studentPaymentOrderDao.getUserOrderByType(userId,type,status);
|
|
|
+ return studentPaymentOrderDao.getUserOrderByType(userId, type, status);
|
|
|
}
|
|
|
}
|