浏览代码

支付组件

zouxuan 4 月之前
父节点
当前提交
67a161f552

+ 6 - 6
mec-application/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -18,13 +18,13 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -34,15 +34,15 @@ import java.util.stream.Collectors;
 @RestController
 public class StudentPaymentOrderController extends BaseController {
 
-    @Autowired
+    @Resource
     private StudentPaymentOrderService studentPaymentOrderService;
-    @Autowired
+    @Resource
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
-    @Autowired
+    @Resource
     private OrganizationService organizationService;
-    @Autowired
+    @Resource
     private SysConfigDao sysConfigDao;
-    @Autowired
+    @Resource
     private StudentPaymentOrderDao studentPaymentOrderDao;
 
     @ApiOperation(value = "获取订单列表")

+ 0 - 4
mec-application/src/main/java/com/ym/mec/web/controller/payment/AdapayController.java

@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.huifu.adapay.core.AdapayCore;
 import com.huifu.adapay.core.util.AdapaySign;
-import com.microsvc.toolkit.middleware.payment.common.api.PaymentServiceContext;
-import com.microsvc.toolkit.middleware.payment.common.api.entity.PaymentMerchant;
 import com.ym.mec.biz.dal.entity.HfMember;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.dal.page.HfMemberQueryInfo;
@@ -53,8 +51,6 @@ public class AdapayController extends BaseController {
     private HfMemberService hfMemberService;
     @Resource
     private HfMerchantConfigService hfMerchantConfigService;
-    @Resource
-    private PaymentServiceContext paymentServiceContext;
 
     @Value("${spring.profiles.active:dev}")
     private String profiles;

+ 35 - 41
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java

@@ -27,8 +27,6 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.thirdparty.adapay.Payment;
-import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
@@ -40,7 +38,6 @@ import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
@@ -59,92 +56,89 @@ import static com.ym.mec.biz.dal.enums.CouponDetailTypeEnum.MEMBER;
 @Service
 public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, MemberRankSetting> implements MemberRankSettingService {
 
-    @Autowired
+    @Resource
     private MemberRankSettingDao memberRankSettingDao;
-    @Autowired
+    @Resource
     private MemberRankPrivilegesDao memberRankPrivilegesDao;
-    @Autowired
+    @Resource
     private StudentService studentService;
-    @Autowired
+    @Resource
     private StudentPaymentOrderService studentPaymentOrderService;
-    @Autowired
+    @Resource
     private SysUserCashAccountService sysUserCashAccountService;
-    @Autowired
+    @Resource
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
 
-    @Autowired
+    @Resource
     private LessonCoursewareService lessonCoursewareService;
 
-    @Autowired
+    @Resource
     private SysUserService sysUserService;
 
     @Resource
     private CbsMusicScoreCategoriesService cbsMusicScoreCategoriesService;
     @Lazy
-    @Autowired
+    @Resource
     private ContractService contractService;
-    @Autowired
+    @Resource
     private SysUserFeignService sysUserFeignService;
-    @Autowired
+    @Resource
     private CloudTeacherOrderService cloudTeacherOrderService;
-    @Autowired
+    @Resource
     private IdGeneratorService idGeneratorService;
-    @Autowired
+    @Resource
     private SysCouponCodeService sysCouponCodeService;
-    @Autowired
+    @Resource
     private StudentCloudCoachPaymentDetailsService studentCloudCoachPaymentDetailsService;
-    @Autowired
+    @Resource
     private CloudCoachPaymentProgramService cloudCoachPaymentProgramService;
-    @Autowired
+    @Resource
     private RedissonClient redissonClient;
-    @Autowired
+    @Resource
     private SysConfigDao sysConfigDao;
-    @Autowired
+    @Resource
     private SysMessageService sysMessageService;
-    @Autowired
+    @Resource
     private VipGroupActivityDao vipGroupActivityDao;
-    @Autowired
+    @Resource
     private TenantConfigService tenantConfigService;
-    @Autowired
+    @Resource
     private ActivityUserMapperService activityUserMapperService;
-    @Autowired
+    @Resource
     private MemberFeeSettingService memberFeeSettingService;
-    @Autowired
+    @Resource
     private TeacherDao teacherDao;
-    @Autowired
+    @Resource
     private LiveGoodsService liveGoodsService;
-    @Autowired
+    @Resource
     private TempBuyFreeLiveTheoryCourseDao tempBuyFreeLiveTheoryCourseDao;
-    @Autowired
+    @Resource
     private TempLittleArtistTrainingCampUserRelationDao tempLittleArtistTrainingCampUserRelationDao;
-    @Autowired
+    @Resource
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
 
-    @Autowired
+    @Resource
     private MemberRankCategoryMapperService memberRankCategoryMapperService;
 
-    @Autowired
+    @Resource
     private MemberRankCourseTypeMapperService memberRankCourseTypeMapperService;
     
-    @Autowired
-    private HfMerchantConfigService hfMerchantConfigService;
-
-    @Autowired
+    @Resource
     private SysMusicScoreDao sysMusicScoreDao;
 
-    @Autowired
+    @Resource
     private CloudTeacherOrderDao cloudTeacherOrderDao;
 
-    @Autowired
+    @Resource
     private MusicGroupDao musicGroupDao;
 
-    @Autowired
+    @Resource
     private TenantMemberRankSettingService tenantMemberRankSettingService;
 
-    @Autowired
+    @Resource
     private MemberRankOrganizationFeeMapperDao memberRankOrganizationFeeMapperDao;
 
-    @Autowired
+    @Resource
     private PaymentServiceContext paymentServiceContext;
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());

+ 0 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrderPayOpsServiceImpl.java

@@ -24,7 +24,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
-import com.ym.mec.thirdparty.yeepay.YeepayPaymentService;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.json.JsonUtil;
@@ -67,8 +66,6 @@ public class OrderPayOpsServiceImpl implements OrderPayOpsService {
     @Resource
     private HfMerchantConfigService hfMerchantConfigService;
     @Resource
-    private YeepayPaymentService yeepayPaymentService;
-    @Resource
     private RedissonClient redissonClient;
     @Resource
     private TenantConfigService tenantConfigService;

+ 17 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -34,8 +34,6 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.adapay.ConfigInit;
 import com.ym.mec.thirdparty.adapay.entity.BaseResult;
-import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
-import com.ym.mec.thirdparty.yeepay.YeepayPaymentService;
 import com.ym.mec.thirdparty.yqpay.*;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
@@ -132,14 +130,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     @Resource
     private ContractService contractService;
     @Resource
-    private HfMerchantConfigService hfMerchantConfigService;
-    @Resource
     private StudentDao studentDao;
     @Resource
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
     @Resource
-    private YeepayPaymentService yeepayPaymentService;
-    @Resource
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
     @Resource
     private StudentRepairDao studentRepairDao;
@@ -164,8 +158,6 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         return studentPaymentOrderDao;
     }
 
-    private final static Logger LOGGER = LoggerFactory.getLogger(StudentPaymentOrderServiceImpl.class);
-
     @Override
     public StudentPaymentOrderDao getDao() {
         return studentPaymentOrderDao;
@@ -363,10 +355,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     @Transactional
     public OrderCancelModel updateOrderStatus(Date date, StudentPaymentOrder payingOrder) throws Exception {
     	
-        HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(payingOrder.getTenantId(), payingOrder.getPaymentChannel());
+        /*HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(payingOrder.getTenantId(), payingOrder.getPaymentChannel());
         if(hfMerchantConfig == null){
             throw new BizException("机构[{}]汇付商户信息找不到", payingOrder.getTenantId());
-        }
+        }*/
         
 //        PaymentChannelEnum paymentChannel = PaymentChannelEnum.codeOf(payingOrder.getPaymentChannel());
         
@@ -519,13 +511,16 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         
         List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderService.getDao().getRouteOrders(order.getOrderNo());
 
-        HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(order.getTenantId(), order.getPaymentChannel());
+        /*HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(order.getTenantId(), order.getPaymentChannel());
         if(hfMerchantConfig == null){
             throw new BizException("机构[{}][{}]商户信息找不到", order.getTenantId(), order.getPaymentChannel());
-        }
+        }*/
         BasePaymentService paymentService = paymentServiceContext.getPaymentService(order.getPaymentChannel() + "_" + order.getTenantId());
         for (StudentPaymentRouteOrder routeOrder : routeOrders) {
             if (routeOrder.getRouteAmount().compareTo(BigDecimal.ZERO) == 0) {
+                routeOrder.setServiceFee(BigDecimal.ZERO);
+                routeOrder.setUpdateTime(date);
+                studentPaymentRouteOrderService.getDao().update(routeOrder);
                 continue;
             }
             // 执行分账逻辑
@@ -923,10 +918,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             return PayStatus.FAILED;
         }
         
-    	HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(studentPaymentOrder.getTenantId(), studentPaymentOrder.getPaymentChannel());
+    	/*HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(studentPaymentOrder.getTenantId(), studentPaymentOrder.getPaymentChannel());
         if(hfMerchantConfig == null){
         	throw new BizException("机构[{}]汇付商户信息找不到", studentPaymentOrder.getTenantId());
-        }
+        }*/
         PaymentResp paymentResp = paymentServiceContext.getPaymentService(paymentChannel + "_" + studentPaymentOrder.getTenantId())
                 .query(transNo, orderNo);
         if (paymentResp == null) {
@@ -1120,7 +1115,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         Date nowDate = new Date();
         //增加商品库存
         List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailService.queryOrderDetail(order.getId());
-        String goodsIds = studentPaymentOrderDetailList.stream().filter(t -> StringUtils.isNotBlank(t.getMinuendStockGoodsIdList())).map(t -> t.getMinuendStockGoodsIdList()).collect(Collectors.joining(","));
+        String goodsIds = studentPaymentOrderDetailList.stream().map(StudentPaymentOrderDetail::getMinuendStockGoodsIdList)
+                .filter(StringUtils::isNotBlank).collect(Collectors.joining(","));
         if(StringUtils.isNotBlank(goodsIds)){
         	List<Goods> goodsList = goodsService.getGoodsWithLocked(goodsIds);
         	Map<Integer,Goods> goodsMap = goodsList.stream().collect(Collectors.toMap(Goods :: getId, t -> t));
@@ -1140,7 +1136,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 				
 				batchUpdateGoodsMap.put(goods.getId(), goods);
         	}
-            if(batchUpdateGoodsMap.size() > 0){
+            if(!batchUpdateGoodsMap.isEmpty()){
             	goodsService.batchUpdate(new ArrayList<Goods>(batchUpdateGoodsMap.values()));
             }
         }
@@ -1168,9 +1164,9 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             if (studentRegistration.getMusicGroupStatus() == StudentMusicGroupStatusEnum.APPLY) {
                 List<StudentPaymentOrder> oldStudentPaymentOrderList = this.queryByCondition(GroupType.MUSIC, musicGroupId, userId, SUCCESS, OrderTypeEnum.APPLY);
                 //判断是否有成功的订单,如果有,表示已经处理过人数
-                if (oldStudentPaymentOrderList == null || oldStudentPaymentOrderList.size() == 0) {
+                if (CollectionUtils.isEmpty(oldStudentPaymentOrderList)) {
                     List<StudentPaymentOrderDetail> orderDetail = studentPaymentOrderDetailService.getOrderDetail(order.getId());
-                    if (orderDetail != null && orderDetail.size() > 0) {
+                    if (CollectionUtils.isNotEmpty(orderDetail)) {
                         long count = orderDetail.stream().filter(e -> e.getType() == OrderDetailTypeEnum.MUSICAL || e.getType() == OrderDetailTypeEnum.CLOUD_TEACHER).count();
                         MusicGroup musicGroup = musicGroupService.get(musicGroupId);
                         //如果购买了乐器或者云教练,或者不是会员团,那么关闭订单时人数减一
@@ -1376,7 +1372,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         studentGoodsSell.setGoodsJson(model.getOrderInfo());
         studentGoodsSell.setOrderNo(model.getOrderNo());
         List<Integer> couponIdList = model.getCouponIdList();
-        if (couponIdList != null && couponIdList.size() > 0) {
+        if (CollectionUtils.isNotEmpty(couponIdList)) {
             studentGoodsSell.setCouponIds(StringUtils.join(couponIdList, ","));
         }
         studentGoodsSell.setTenantId(student.getTenantId());
@@ -1467,13 +1463,13 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                         long count = goodsOrderItemVOS.stream().filter(e -> StringUtils.isEmpty(e.getOrderSn())).count();
                         //如果有空的商品货号,不处理
                         if(count == 0l){
-                            List<String> productSns = goodsOrderItemVOS.stream().map(e -> e.getProductSn()).distinct().collect(Collectors.toList());
+                            List<String> productSns = goodsOrderItemVOS.stream().map(GoodsOrderItemVO::getProductSn).distinct().collect(Collectors.toList());
                             List<Goods> goodsList = goodsService.getGoodsDao().findBySns(productSns);
                             //如果有不匹配的商品货号,不处理
                             if(CollectionUtils.isEmpty(goodsList) || goodsList.size() < productSns.size()){
                                 return;
                             }
-                            Map<String, Goods> goodsSnMap = goodsList.stream().collect(Collectors.groupingBy(e -> e.getSn(),
+                            Map<String, Goods> goodsSnMap = goodsList.stream().collect(Collectors.groupingBy(Goods::getSn,
                                     Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
                             List<StudentPaymentOrderDetail> orderDetails = new ArrayList<>();
                             List<SellOrder> sellOrders = new ArrayList<>();

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1386,7 +1386,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             
         }
 
-        if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED)) {
+        if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED) || studentPaymentOrder.getStatus().equals(DealStatusEnum.CLOSE)) {
             MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
             studentRegistration.setPayingStatus(0);
             studentRegistrationDao.update(studentRegistration);
@@ -1395,7 +1395,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             
             //增加商品库存
             List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailService.queryOrderDetail(studentPaymentOrder.getId());
-            String goodsIds = studentPaymentOrderDetailList.stream().filter(t -> StringUtils.isNotBlank(t.getMinuendStockGoodsIdList())).map(t -> t.getMinuendStockGoodsIdList()).collect(Collectors.joining(","));
+            String goodsIds = studentPaymentOrderDetailList.stream().map(StudentPaymentOrderDetail::getMinuendStockGoodsIdList)
+                    .filter(StringUtils::isNotBlank).collect(Collectors.joining(","));
             if(StringUtils.isNotBlank(goodsIds)){
 //            	GoodsProcurement goodsProcurement = null;
             	List<Goods> goodsList = goodsService.getGoodsWithLocked(goodsIds);
@@ -1435,7 +1436,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             		goodsProcurementDao.batchUpdate(new ArrayList<GoodsProcurement>(goodsProcurementMap.values()));
             	}*/
                 
-                if(batchUpdateGoodsMap.size() > 0){
+                if(!batchUpdateGoodsMap.isEmpty()){
                 	goodsService.batchUpdate(new ArrayList<Goods>(batchUpdateGoodsMap.values()));
                 }
             }

+ 24 - 24
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -31,13 +31,13 @@ import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
@@ -51,53 +51,53 @@ import static com.ym.mec.biz.dal.enums.DealStatusEnum.*;
 @Service
 public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRepair> implements StudentRepairService {
     private static final Logger log = LoggerFactory.getLogger(StudentRepairServiceImpl.class);
-    @Autowired
+    @Resource
     private StudentRepairDao studentRepairDao;
-    @Autowired
+    @Resource
     private SysUserFeignService sysUserFeignService;
-    @Autowired
+    @Resource
     private PayService payService;
-    @Autowired
+    @Resource
     private IdGeneratorService idGeneratorService;
-    @Autowired
+    @Resource
     private SysConfigDao sysConfigDao;
-    @Autowired
+    @Resource
     private StudentPaymentOrderService studentPaymentOrderService;
-    @Autowired
+    @Resource
     private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
-    @Autowired
+    @Resource
     private MusicGroupDao musicGroupDao;
-    @Autowired
+    @Resource
     private SysUserCashAccountService sysUserCashAccountService;
-    @Autowired
+    @Resource
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
-    @Autowired
+    @Resource
     private SysMessageService sysMessageService;
-    @Autowired
+    @Resource
     private StudentService studentService;
-    @Autowired
+    @Resource
     private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
-    @Autowired
+    @Resource
     private SellOrderService sellOrderService;
-    @Autowired
+    @Resource
     private StudentGoodsSellDao studentGoodsSellDao;
-    @Autowired
+    @Resource
     private StudentPaymentOrderAddressService studentPaymentOrderAddressService;
 
     @Lazy
-    @Autowired
+    @Resource
     private ContractService contractService;
-    @Autowired
+    @Resource
     private GoodsService goodsService;
-    @Autowired
+    @Resource
     private StudentInstrumentService studentInstrumentService;
-    @Autowired
+    @Resource
     private StudentGoodsSellService studentGoodsSellService;
-    @Autowired
+    @Resource
     private SysCouponCodeService sysCouponCodeService;
-    @Autowired
+    @Resource
     private TeacherService teacherService;
-    @Autowired
+    @Resource
     private MallFeignService mallFeignService;
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -666,6 +666,9 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
      * 获取协议变量参数
      */
     private Map<String, Object> getContractParam(TenantInfoPageVo tenantInfo) {
+        if (tenantInfo.getStudentUpLimit() == null) {
+            tenantInfo.setStudentUpLimit(0);
+        }
         //将数据转换为Map
         Map<String, Object> param = WrapperUtil.toMap(tenantInfo);
         //购买服务的时长单位

+ 39 - 73
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantOrderRecordServiceImpl.java

@@ -1,17 +1,11 @@
 package com.ym.mec.biz.service.impl;
 
-import java.math.BigDecimal;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.huifu.adapay.core.AdapayCore;
 import com.huifu.adapay.core.util.AdapaySign;
 import com.microsvc.toolkit.middleware.payment.common.api.BasePaymentService;
@@ -21,63 +15,37 @@ import com.microsvc.toolkit.middleware.payment.common.api.enums.PaymentStatus;
 import com.yeepay.g3.sdk.yop.encrypt.DigitalEnvelopeDTO;
 import com.yeepay.g3.sdk.yop.utils.DigitalEnvelopeUtils;
 import com.yeepay.g3.sdk.yop.utils.RSAKeyUtils;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.joda.time.LocalDateTime;
-import org.redisson.api.RBucket;
-import org.redisson.api.RedissonClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
 import com.ym.mec.biz.dal.dao.TenantOrderRecordDao;
 import com.ym.mec.biz.dal.dto.TenantOrderRecordDto;
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
-import com.ym.mec.biz.dal.entity.PlatformServe;
-import com.ym.mec.biz.dal.entity.PlatformServeDetail;
-import com.ym.mec.biz.dal.entity.TenantAssetsInfo;
-import com.ym.mec.biz.dal.entity.TenantConfig;
-import com.ym.mec.biz.dal.entity.TenantInfo;
-import com.ym.mec.biz.dal.entity.TenantOrderRecord;
-import com.ym.mec.biz.dal.entity.TenantProductInfo;
-import com.ym.mec.biz.dal.entity.TenantProxyDividend;
-import com.ym.mec.biz.dal.entity.TenantProxyUserRelation;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
-import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
-import com.ym.mec.biz.dal.enums.PeriodEnum;
-import com.ym.mec.biz.dal.enums.TenantOrderRecordEnum;
-import com.ym.mec.biz.service.CloudTeacherOrderService;
-import com.ym.mec.biz.service.HfMerchantConfigService;
-import com.ym.mec.biz.service.PlatformServeDetailService;
-import com.ym.mec.biz.service.PlatformServeService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.TenantAssetsInfoService;
-import com.ym.mec.biz.service.TenantConfigService;
-import com.ym.mec.biz.service.TenantInfoService;
-import com.ym.mec.biz.service.TenantOrderRecordService;
-import com.ym.mec.biz.service.TenantProductInfoService;
-import com.ym.mec.biz.service.TenantProxyDividendService;
-import com.ym.mec.biz.service.TenantProxyUserRelationService;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.exception.BizException;
 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.tenant.TenantContextHolder;
-import com.ym.mec.thirdparty.adapay.Payment;
 import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.LocalDateTime;
+import org.redisson.api.RBucket;
+import org.redisson.api.RedissonClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
 
 /**
  * 机构付款记录表(TenantOrderRecord)表服务实现类
@@ -89,37 +57,35 @@ import javax.servlet.http.HttpServletRequest;
 public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordDao, TenantOrderRecord> implements TenantOrderRecordService {
     private static final Logger log = LoggerFactory.getLogger(TenantOrderRecordServiceImpl.class);
 
-    @Autowired
+    @Resource
     private TenantProductInfoService tenantProductInfoService;
-    @Autowired
+    @Resource
     private PlatformServeService platformServeService;
-    @Autowired
+    @Resource
     private PlatformServeDetailService platformServeDetailService;
-    @Autowired
+    @Resource
     private TenantInfoService tenantInfoService;
-    @Autowired
+    @Resource
     private RedissonClient redissonClient;
-    @Autowired
+    @Resource
     private TenantAssetsInfoService assetsInfoService;
-    @Autowired
+    @Resource
     private TenantConfigService tenantConfigService;
-    @Autowired
+    @Resource
     private SysMessageService sysMessageService;
-    @Autowired
+    @Resource
     private CloudTeacherOrderDao cloudTeacherOrderDao;
-    @Autowired
+    @Resource
     private CloudTeacherOrderService cloudTeacherOrderService;
-    @Autowired
+    @Resource
     private TenantProxyDividendService tenantProxyDividendService;
-    @Autowired
+    @Resource
     private TenantProxyUserRelationService tenantProxyUserRelationService;
-
-    @Autowired
+    @Resource
     private HfMerchantConfigService hfMerchantConfigService;
-    
-    @Autowired
+    @Resource
     private TenantOrderRecordDao tenantOrderRecordDao;
-    @Autowired
+    @Resource
     private PaymentServiceContext paymentServiceContext;
 
     //订单不存在

+ 17 - 49
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantPaymentOrderServiceImpl.java

@@ -1,33 +1,10 @@
 package com.ym.mec.biz.service.impl;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import com.ym.mec.biz.service.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.alibaba.fastjson.JSON;
-import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.TenantEntryActivitiesDao;
 import com.ym.mec.biz.dal.dao.TenantPaymentOrderDao;
 import com.ym.mec.biz.dal.dto.PageInfoOrder;
-import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
-import com.ym.mec.biz.dal.entity.SysTenantAccountDetail.TransType;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.entity.TenantEntryActivities;
 import com.ym.mec.biz.dal.entity.TenantEntryActivities.SuitableUser;
@@ -36,55 +13,46 @@ import com.ym.mec.biz.dal.entity.TenantPaymentOrder.TenantPaymentType;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.dal.page.TenantPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.PayService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.TenantPaymentOrderService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 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.adapay.entity.HfMerchantConfig;
-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.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
 
 @Service
 public class TenantPaymentOrderServiceImpl extends BaseServiceImpl<Long, TenantPaymentOrder> implements TenantPaymentOrderService {
 
-    private static final Logger logger = LoggerFactory.getLogger(TenantPaymentOrderServiceImpl.class);
-
-    @Autowired
+    @Resource
     private TenantPaymentOrderDao tenantPaymentOrderDao;
 
-    @Autowired
+    @Resource
     private TenantEntryActivitiesDao tenantEntryActivitiesDao;
 
-    @Autowired
+    @Resource
     private IdGeneratorService idGeneratorService;
 
-    @Autowired
+    @Resource
     private PayService payService;
 
-    @Autowired
+    @Resource
     private SysConfigDao sysConfigDao;
 
-    @Autowired
+    @Resource
     private TeacherDao teacherDao;
 
-    @Autowired
-    private SysTenantAccountService sysTenantAccountService;
-
-    @Autowired
-    private YqPayFeignService yqPayFeignService;
-    @Autowired
-    private StudentPaymentRouteOrderDao studentPaymentRouteOrderDao;
-    
-    @Autowired
-    private HfMerchantConfigService hfMerchantConfigService;
-
     @Override
     public BaseDAO<Long, TenantPaymentOrder> getDAO() {
         return tenantPaymentOrderDao;

+ 6 - 4
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayFeignService.java

@@ -4,15 +4,17 @@ import feign.Logger;
 import feign.codec.Encoder;
 import feign.form.spring.SpringFormEncoder;
 import org.springframework.beans.factory.ObjectFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.support.SpringEncoder;
 import org.springframework.context.annotation.Bean;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.annotation.Resource;
 import java.util.Map;
 
 @FeignClient(value = "YqPayFeignService",url = "https://qyfquery.95epay.com",configuration = YqPayFeignService.FormSupportConfig.class)
@@ -34,7 +36,7 @@ public interface YqPayFeignService {
     class FormSupportConfig {
 
 
-        @Autowired
+        @Resource
         private ObjectFactory<HttpMessageConverters> messageConverters;
         // new一个form编码器,实现支持form表单提交
         @Bean