|
@@ -4,6 +4,7 @@ import com.github.microservice.auth.client.content.ResultContent;
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
import com.github.microservice.auth.security.helper.AuthHelper;
|
|
import com.zhongshu.payment.client.model.order.AdminSeachOrderModel;
|
|
import com.zhongshu.payment.client.model.order.AdminSeachOrderModel;
|
|
import com.zhongshu.payment.client.model.order.v2.ApplicantRefundParam2Model;
|
|
import com.zhongshu.payment.client.model.order.v2.ApplicantRefundParam2Model;
|
|
|
|
+import com.zhongshu.payment.client.model.order.v2.GoodsResultModel;
|
|
import com.zhongshu.payment.client.model.order.v2.RefundParam2Model;
|
|
import com.zhongshu.payment.client.model.order.v2.RefundParam2Model;
|
|
import com.zhongshu.payment.client.model.order.v2.WithdrawRequestModel;
|
|
import com.zhongshu.payment.client.model.order.v2.WithdrawRequestModel;
|
|
import com.zhongshu.payment.client.model.payment.QueryResponseModel;
|
|
import com.zhongshu.payment.client.model.payment.QueryResponseModel;
|
|
@@ -11,13 +12,25 @@ import com.zhongshu.payment.client.model.payment.zswl.ApplyWithdrawalsModel;
|
|
import com.zhongshu.payment.client.model.payment.zswl.CreatePayment2Model;
|
|
import com.zhongshu.payment.client.model.payment.zswl.CreatePayment2Model;
|
|
import com.zhongshu.payment.client.model.payment.zswl.CreatePaymentModel;
|
|
import com.zhongshu.payment.client.model.payment.zswl.CreatePaymentModel;
|
|
import com.zhongshu.payment.client.model.payment.zswl.SyncInformModel;
|
|
import com.zhongshu.payment.client.model.payment.zswl.SyncInformModel;
|
|
|
|
+import com.zhongshu.payment.client.service.v2.OrderService2;
|
|
import com.zhongshu.payment.client.service.v2.PaymentService2;
|
|
import com.zhongshu.payment.client.service.v2.PaymentService2;
|
|
import com.zhongshu.payment.client.type.Channel;
|
|
import com.zhongshu.payment.client.type.Channel;
|
|
-import com.zswl.cloud.shop.client.service.GoodsService;
|
|
|
|
|
|
+import com.zhongshu.payment.client.type.JobFlowMap;
|
|
|
|
+import com.zhongshu.payment.client.type.JobFlowType;
|
|
|
|
+import com.zswl.cloud.springBtach.server.core.job.standard.StandarPayJob;
|
|
|
|
+import lombok.SneakyThrows;
|
|
|
|
+import org.springframework.batch.core.Job;
|
|
|
|
+import org.springframework.batch.core.JobParameters;
|
|
|
|
+import org.springframework.batch.core.JobParametersBuilder;
|
|
|
|
+import org.springframework.batch.core.explore.JobExplorer;
|
|
|
|
+import org.springframework.batch.core.launch.JobLauncher;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.context.ApplicationContext;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
@Service
|
|
@Service
|
|
public class PaymentService {
|
|
public class PaymentService {
|
|
|
|
|
|
@@ -29,14 +42,38 @@ public class PaymentService {
|
|
AuthHelper authHelper;
|
|
AuthHelper authHelper;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- GoodsService goodsService;
|
|
|
|
|
|
+ OrderService2 orderService2;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private StandarPayJob standarPayJob;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ApplicationContext applicationContext;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private JobExplorer jobExplorer;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private JobLauncher jobLauncher;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @SneakyThrows
|
|
public ResultContent creatPayOrder(CreatePaymentModel createPaymentModel) {
|
|
public ResultContent creatPayOrder(CreatePaymentModel createPaymentModel) {
|
|
CreatePayment2Model createPayment2Model = new CreatePayment2Model();
|
|
CreatePayment2Model createPayment2Model = new CreatePayment2Model();
|
|
BeanUtils.copyProperties(createPaymentModel, createPayment2Model);
|
|
BeanUtils.copyProperties(createPaymentModel, createPayment2Model);
|
|
createPayment2Model.setAuthUserId(authHelper.getCurrentUser().getUserId());
|
|
createPayment2Model.setAuthUserId(authHelper.getCurrentUser().getUserId());
|
|
- return paymentService2.creatPayOrder(createPayment2Model);
|
|
|
|
|
|
+
|
|
|
|
+ ResultContent<GoodsResultModel> goodsResultModelResultContent = orderService2.orderInfo(createPaymentModel.getOrderNo());
|
|
|
|
+ JobFlowMap jobFlowMap = goodsResultModelResultContent.getContent().getJobFlowMap();
|
|
|
|
+ String jobName = jobFlowMap.getJobMapping().get(JobFlowType.CratePlayOrder);
|
|
|
|
+ ThreadLocal<CreatePayment2Model> parameter = standarPayJob.getParameter();
|
|
|
|
+ parameter.set(createPayment2Model);
|
|
|
|
+ Job job = (Job) applicationContext.getBean(jobName);
|
|
|
|
+ JobParameters parameters = new JobParametersBuilder(jobExplorer)
|
|
|
|
+ .getNextJobParameters(job)
|
|
|
|
+ .addLong("time", System.currentTimeMillis()).toJobParameters();
|
|
|
|
+ jobLauncher.run(job, parameters).getExitStatus();
|
|
|
|
+ return standarPayJob.getResultContent().get();
|
|
}
|
|
}
|
|
|
|
|
|
public ResultContent query(String orderNo) {
|
|
public ResultContent query(String orderNo) {
|