|
@@ -0,0 +1,49 @@
|
|
|
+package com.zswl.cloud.springBtach.server.core.job.video;
|
|
|
+
|
|
|
+import com.github.microservice.auth.client.content.ResultContent;
|
|
|
+import com.zhongshu.payment.client.model.order.v2.CreateOrder2Model;
|
|
|
+import com.zswl.cloud.springBtach.server.core.job.standard.StandarOrderJob;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.experimental.Delegate;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
+import org.springframework.batch.core.Job;
|
|
|
+import org.springframework.batch.core.Step;
|
|
|
+import org.springframework.batch.core.launch.support.RunIdIncrementer;
|
|
|
+import org.springframework.batch.repeat.RepeatStatus;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+
|
|
|
+@Data
|
|
|
+@Log4j2
|
|
|
+@Configuration
|
|
|
+public class VideoOrderJob {
|
|
|
+ @Autowired
|
|
|
+ @Delegate
|
|
|
+ StandarOrderJob standarOrderJob;
|
|
|
+
|
|
|
+
|
|
|
+ public Step videoOrderStep() {
|
|
|
+ return getStepBuilderFactory().get("videoOrderStep").tasklet((it, ii) -> {
|
|
|
+
|
|
|
+ ThreadLocal<CreateOrder2Model> parameter = getParameter();
|
|
|
+
|
|
|
+
|
|
|
+ ResultContent creat = getOrderService2().creat(getParameter().get());
|
|
|
+
|
|
|
+ getResultContent().set(creat);
|
|
|
+ return RepeatStatus.FINISHED;
|
|
|
+ }).build();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public Job videoOrder() {
|
|
|
+ return getJobBuilderFactory()
|
|
|
+ .get("videoOrder")
|
|
|
+ .start(videoOrderStep())
|
|
|
+ .incrementer(new RunIdIncrementer())
|
|
|
+ .build();
|
|
|
+ }
|
|
|
+}
|