gongfuzhu há 1 ano atrás
pai
commit
c6388d5e51
17 ficheiros alterados com 679 adições e 636 exclusões
  1. 0 153
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/request/CreateOrder2Request.java
  2. 0 184
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/request/CreateOrdereRquest.java
  3. 99 0
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/request/CreateOrder2Request.java
  4. 120 0
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/request/CreateOrdereRquest.java
  5. 36 0
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/CreateOrder2Response.java
  6. 18 0
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/CreateOrdereResponse.java
  7. 68 0
      SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/OrderDetailResponse.java
  8. 42 19
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/api/ypp/YppApi.java
  9. 3 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/YppController.java
  10. 0 148
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/CreateOrderStep2Demo.java
  11. 0 51
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/StandardOrderJobDemo.java
  12. 0 73
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/Ypp/YppOrderJob.java
  13. 3 8
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/dfy/HotelPayJob.java
  14. 102 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/YppDeliveryJob.java
  15. 80 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/YppPayJob.java
  16. 106 0
      SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/YppService.java
  17. 2 0
      SpringBatchServiceServer/src/main/resources/application-dev.yml

+ 0 - 153
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/request/CreateOrder2Request.java

@@ -1,153 +0,0 @@
-package com.zswl.cloud.springBatch.client.model.request;
-
-import java.time.OffsetDateTime;
-
-/**
- * TicketOrderChannelCreate2Dto,渠道下单
- */
-public class CreateOrder2Request {
-    /**
-     * 有票票分配的appId
-     */
-    private String appId;
-    /**
-     * 影院地址
-     */
-    private String cinemaAddress;
-    /**
-     * 影院编码
-     */
-    private String cinemaCode;
-    /**
-     * 影院名称
-     */
-    private String cinemaName;
-    /**
-     * 城市名称
-     */
-    private String cityName;
-    /**
-     * 快速票
-     */
-    private Boolean fastTicket;
-    /**
-     * 影厅名称
-     */
-    private String hallName;
-    /**
-     * 是否情侣座(true/false)
-     */
-    private Boolean loveSeat;
-    /**
-     * 影片编码
-     */
-    private String movieCode;
-    /**
-     * 影片名称
-     */
-    private String movieName;
-    /**
-     * 影票类型(2D/ 3D)
-     */
-    private String movieVersion;
-    /**
-     * 第三方订单号
-     */
-    private String orderId;
-    private Long orderPayMode;
-    /**
-     * 原票价单价
-     */
-    private Double originPrice;
-    /**
-     * 影片海报图
-     */
-    private String postImageUrl;
-    /**
-     * 座位名称(多个用逗号分隔)
-     */
-    private String seatNames;
-    /**
-     * 开场时间
-     */
-    private OffsetDateTime sessionBeginTime;
-    /**
-     * 结束时间
-     */
-    private OffsetDateTime sessionEndTime;
-    /**
-     * 是否可调座
-     */
-    private boolean switchSeat;
-    /**
-     * 是否是测试订单(测试订单不会真实出票,请联系测试人员模拟出票、退款等)
-     */
-    private Boolean test;
-    /**
-     * 用户手机号
-     */
-    private String userMobile;
-
-    public String getAppId() { return appId; }
-    public void setAppId(String value) { this.appId = value; }
-
-    public String getCinemaAddress() { return cinemaAddress; }
-    public void setCinemaAddress(String value) { this.cinemaAddress = value; }
-
-    public String getCinemaCode() { return cinemaCode; }
-    public void setCinemaCode(String value) { this.cinemaCode = value; }
-
-    public String getCinemaName() { return cinemaName; }
-    public void setCinemaName(String value) { this.cinemaName = value; }
-
-    public String getCityName() { return cityName; }
-    public void setCityName(String value) { this.cityName = value; }
-
-    public Boolean getFastTicket() { return fastTicket; }
-    public void setFastTicket(Boolean value) { this.fastTicket = value; }
-
-    public String getHallName() { return hallName; }
-    public void setHallName(String value) { this.hallName = value; }
-
-    public Boolean getLoveSeat() { return loveSeat; }
-    public void setLoveSeat(Boolean value) { this.loveSeat = value; }
-
-    public String getMovieCode() { return movieCode; }
-    public void setMovieCode(String value) { this.movieCode = value; }
-
-    public String getMovieName() { return movieName; }
-    public void setMovieName(String value) { this.movieName = value; }
-
-    public String getMovieVersion() { return movieVersion; }
-    public void setMovieVersion(String value) { this.movieVersion = value; }
-
-    public String getOrderId() { return orderId; }
-    public void setOrderId(String value) { this.orderId = value; }
-
-    public Long getOrderPayMode() { return orderPayMode; }
-    public void setOrderPayMode(Long value) { this.orderPayMode = value; }
-
-    public Double getOriginPrice() { return originPrice; }
-    public void setOriginPrice(Double value) { this.originPrice = value; }
-
-    public String getPostImageUrl() { return postImageUrl; }
-    public void setPostImageUrl(String value) { this.postImageUrl = value; }
-
-    public String getSeatNames() { return seatNames; }
-    public void setSeatNames(String value) { this.seatNames = value; }
-
-    public OffsetDateTime getSessionBeginTime() { return sessionBeginTime; }
-    public void setSessionBeginTime(OffsetDateTime value) { this.sessionBeginTime = value; }
-
-    public OffsetDateTime getSessionEndTime() { return sessionEndTime; }
-    public void setSessionEndTime(OffsetDateTime value) { this.sessionEndTime = value; }
-
-    public boolean getSwitchSeat() { return switchSeat; }
-    public void setSwitchSeat(boolean value) { this.switchSeat = value; }
-
-    public Boolean getTest() { return test; }
-    public void setTest(Boolean value) { this.test = value; }
-
-    public String getUserMobile() { return userMobile; }
-    public void setUserMobile(String value) { this.userMobile = value; }
-}

+ 0 - 184
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/request/CreateOrdereRquest.java

@@ -1,184 +0,0 @@
-package com.zswl.cloud.springBatch.client.model.request;
-
-import java.time.OffsetDateTime;
-
-/**
- * TicketOrderChannelCreateDto,渠道下单
- */
-public class CreateOrdereRquest {
-    /**
-     * 应用AppId
-     */
-    private String appId;
-    /**
-     * 观众列表ID,用,分隔
-     */
-    private String audience;
-    /**
-     * 购买模式:0优惠购票 1原价票
-     */
-    private Long buyModel;
-    /**
-     * 影院地址
-     */
-    private String cinemaAddress;
-    /**
-     * 影院编码
-     */
-    private String cinemaCode;
-    /**
-     * 影院ID
-     */
-    private String cinemaId;
-    /**
-     * 影院经度
-     */
-    private Double cinemaLat;
-    /**
-     * 影院纬度
-     */
-    private Double cinemaLng;
-    /**
-     * 影院名称
-     */
-    private String cinemaName;
-    /**
-     * 城市ID
-     */
-    private String cityId;
-    /**
-     * 城市名称
-     */
-    private String cityName;
-    /**
-     * 自定义参数
-     */
-    private String entPara;
-    /**
-     * 影厅名称
-     */
-    private String hallName;
-    /**
-     * 电影编码
-     */
-    private String movieCode;
-    /**
-     * 电影ID
-     */
-    private String movieId;
-    /**
-     * 电影名称
-     */
-    private String movieName;
-    /**
-     * 影票类型(英语 3D)
-     */
-    private String movieVersion;
-    /**
-     * 座位id,多个座位用逗号分隔
-     */
-    private String originalSeatIds;
-    /**
-     * 电影海报地址
-     */
-    private String postImageUrl;
-    /**
-     * 座位名称(多个用逗号分隔)
-     */
-    private String seatNames;
-    /**
-     * 开场时间
-     */
-    private OffsetDateTime sessionBeginTime;
-    /**
-     * 结束时间
-     */
-    private OffsetDateTime sessionEndTime;
-    /**
-     * 场次ID
-     */
-    private String sessionId;
-    /**
-     * 票源id
-     */
-    private String sourceId;
-    /**
-     * 用户手机号
-     */
-    private String userMobile;
-
-    public String getAppId() { return appId; }
-    public void setAppId(String value) { this.appId = value; }
-
-    public String getAudience() { return audience; }
-    public void setAudience(String value) { this.audience = value; }
-
-    public Long getBuyModel() { return buyModel; }
-    public void setBuyModel(Long value) { this.buyModel = value; }
-
-    public String getCinemaAddress() { return cinemaAddress; }
-    public void setCinemaAddress(String value) { this.cinemaAddress = value; }
-
-    public String getCinemaCode() { return cinemaCode; }
-    public void setCinemaCode(String value) { this.cinemaCode = value; }
-
-    public String getCinemaId() { return cinemaId; }
-    public void setCinemaId(String value) { this.cinemaId = value; }
-
-    public Double getCinemaLat() { return cinemaLat; }
-    public void setCinemaLat(Double value) { this.cinemaLat = value; }
-
-    public Double getCinemaLng() { return cinemaLng; }
-    public void setCinemaLng(Double value) { this.cinemaLng = value; }
-
-    public String getCinemaName() { return cinemaName; }
-    public void setCinemaName(String value) { this.cinemaName = value; }
-
-    public String getCityId() { return cityId; }
-    public void setCityId(String value) { this.cityId = value; }
-
-    public String getCityName() { return cityName; }
-    public void setCityName(String value) { this.cityName = value; }
-
-    public String getEntPara() { return entPara; }
-    public void setEntPara(String value) { this.entPara = value; }
-
-    public String getHallName() { return hallName; }
-    public void setHallName(String value) { this.hallName = value; }
-
-    public String getMovieCode() { return movieCode; }
-    public void setMovieCode(String value) { this.movieCode = value; }
-
-    public String getMovieId() { return movieId; }
-    public void setMovieId(String value) { this.movieId = value; }
-
-    public String getMovieName() { return movieName; }
-    public void setMovieName(String value) { this.movieName = value; }
-
-    public String getMovieVersion() { return movieVersion; }
-    public void setMovieVersion(String value) { this.movieVersion = value; }
-
-    public String getOriginalSeatIds() { return originalSeatIds; }
-    public void setOriginalSeatIds(String value) { this.originalSeatIds = value; }
-
-    public String getPostImageUrl() { return postImageUrl; }
-    public void setPostImageUrl(String value) { this.postImageUrl = value; }
-
-    public String getSeatNames() { return seatNames; }
-    public void setSeatNames(String value) { this.seatNames = value; }
-
-    public OffsetDateTime getSessionBeginTime() { return sessionBeginTime; }
-    public void setSessionBeginTime(OffsetDateTime value) { this.sessionBeginTime = value; }
-
-    public OffsetDateTime getSessionEndTime() { return sessionEndTime; }
-    public void setSessionEndTime(OffsetDateTime value) { this.sessionEndTime = value; }
-
-    public String getSessionId() { return sessionId; }
-    public void setSessionId(String value) { this.sessionId = value; }
-
-    public String getSourceId() { return sourceId; }
-    public void setSourceId(String value) { this.sourceId = value; }
-
-    public String getUserMobile() { return userMobile; }
-    public void setUserMobile(String value) { this.userMobile = value; }
-}

+ 99 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/request/CreateOrder2Request.java

@@ -0,0 +1,99 @@
+package com.zswl.cloud.springBatch.client.model.ypp.request;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.OffsetDateTime;
+
+/**
+ * TicketOrderChannelCreate2Dto,渠道下单
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CreateOrder2Request {
+    /**
+     * 有票票分配的appId
+     */
+    private String appId;
+    /**
+     * 影院地址
+     */
+    private String cinemaAddress;
+    /**
+     * 影院编码
+     */
+    private String cinemaCode;
+    /**
+     * 影院名称
+     */
+    private String cinemaName;
+    /**
+     * 城市名称
+     */
+    private String cityName;
+    /**
+     * 快速票
+     */
+    private Boolean fastTicket;
+    /**
+     * 影厅名称
+     */
+    private String hallName;
+    /**
+     * 是否情侣座(true/false)
+     */
+    private Boolean loveSeat;
+    /**
+     * 影片编码
+     */
+    private String movieCode;
+    /**
+     * 影片名称
+     */
+    private String movieName;
+    /**
+     * 影票类型(2D/ 3D)
+     */
+    private String movieVersion;
+    /**
+     * 第三方订单号
+     */
+    private String orderId;
+    private Long orderPayMode;
+    /**
+     * 原票价单价
+     */
+    private Double originPrice;
+    /**
+     * 影片海报图
+     */
+    private String postImageUrl;
+    /**
+     * 座位名称(多个用逗号分隔)
+     */
+    private String seatNames;
+    /**
+     * 开场时间
+     */
+    private OffsetDateTime sessionBeginTime;
+    /**
+     * 结束时间
+     */
+    private OffsetDateTime sessionEndTime;
+    /**
+     * 是否可调座
+     */
+    private boolean switchSeat;
+    /**
+     * 是否是测试订单(测试订单不会真实出票,请联系测试人员模拟出票、退款等)
+     */
+    private Boolean test;
+    /**
+     * 用户手机号
+     */
+    private String userMobile;
+
+
+}

+ 120 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/request/CreateOrdereRquest.java

@@ -0,0 +1,120 @@
+package com.zswl.cloud.springBatch.client.model.ypp.request;
+
+import com.zhongshu.payment.client.type.Channel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.OffsetDateTime;
+
+/**
+ * TicketOrderChannelCreateDto,渠道下单
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CreateOrdereRquest {
+    /**
+     * 应用AppId
+     */
+    private String appId;
+    /**
+     * 观众列表ID,用,分隔
+     */
+    private String audience;
+    /**
+     * 购买模式:0优惠购票 1原价票
+     */
+    private Long buyModel;
+    /**
+     * 影院地址
+     */
+    private String cinemaAddress;
+    /**
+     * 影院编码
+     */
+    private String cinemaCode;
+    /**
+     * 影院ID
+     */
+    private String cinemaId;
+    /**
+     * 影院经度
+     */
+    private Double cinemaLat;
+    /**
+     * 影院纬度
+     */
+    private Double cinemaLng;
+    /**
+     * 影院名称
+     */
+    private String cinemaName;
+    /**
+     * 城市ID
+     */
+    private String cityId;
+    /**
+     * 城市名称
+     */
+    private String cityName;
+    /**
+     * 自定义参数
+     */
+    private String entPara;
+    /**
+     * 影厅名称
+     */
+    private String hallName;
+    /**
+     * 电影编码
+     */
+    private String movieCode;
+    /**
+     * 电影ID
+     */
+    private String movieId;
+    /**
+     * 电影名称
+     */
+    private String movieName;
+    /**
+     * 影票类型(英语 3D)
+     */
+    private String movieVersion;
+    /**
+     * 座位id,多个座位用逗号分隔
+     */
+    private String originalSeatIds;
+    /**
+     * 电影海报地址
+     */
+    private String postImageUrl;
+    /**
+     * 座位名称(多个用逗号分隔)
+     */
+    private String seatNames;
+    /**
+     * 开场时间
+     */
+    private OffsetDateTime sessionBeginTime;
+    /**
+     * 结束时间
+     */
+    private OffsetDateTime sessionEndTime;
+    /**
+     * 场次ID
+     */
+    private String sessionId;
+    /**
+     * 票源id
+     */
+    private String sourceId;
+    /**
+     * 用户手机号
+     */
+    private String userMobile;
+
+    private Channel channel;
+
+}

+ 36 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/CreateOrder2Response.java

@@ -0,0 +1,36 @@
+// ApifoxModel.java
+
+package com.zswl.cloud.springBatch.client.model.ypp.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * ChannelTicketOrderResultRequestResult
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CreateOrder2Response {
+    /**
+     * code
+     */
+    private Long code;
+    private ChannelTicketOrderResult data;
+    /**
+     * message
+     */
+    private String message;
+
+    @Data
+    @AllArgsConstructor
+    @NoArgsConstructor
+    public class ChannelTicketOrderResult {
+        /**
+         * 平台订单号
+         */
+        private String orderId;
+    }
+}
+

+ 18 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/CreateOrdereResponse.java

@@ -0,0 +1,18 @@
+package com.zswl.cloud.springBatch.client.model.ypp.response;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * TicketOrderChannelCreateDto,渠道下单
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CreateOrdereResponse {
+    private Long code;
+    private String data;
+    private String message;
+}

+ 68 - 0
SpringBatchServiceClient/src/main/java/com/zswl/cloud/springBatch/client/model/ypp/response/OrderDetailResponse.java

@@ -0,0 +1,68 @@
+// ApifoxModel.java
+
+package com.zswl.cloud.springBatch.client.model.ypp.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.OffsetDateTime;
+
+/**
+ * TicketOrderSimpleDtoRequestResult
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OrderDetailResponse {
+    /**
+     * code
+     */
+    private Long code;
+    private TicketOrderSimpleDto data;
+    /**
+     * message
+     */
+    private String message;
+
+    @Data
+    @AllArgsConstructor
+    @NoArgsConstructor
+    public class TicketOrderSimpleDto {
+        /**
+         * 是否可支付
+         */
+        private Boolean canPay;
+        /**
+         * 影院名称
+         */
+        private String cinemaName;
+        /**
+         * 城市名称
+         */
+        private String cityName;
+        /**
+         * 创建时间
+         */
+        private OffsetDateTime createTime;
+        /**
+         * 自定义参数
+         */
+        private String entPara;
+        /**
+         * 自定义订单号
+         */
+        private String id;
+        /**
+         * 电影名称
+         */
+        private String movieName;
+        private Long orderState;
+        /**
+         * 用户总票价
+         */
+        private BigDecimal totalUserPrice;
+
+    }
+}

+ 42 - 19
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/api/ypp/YppApi.java

@@ -7,11 +7,14 @@ import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONConfig;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.zswl.cloud.springBatch.client.model.request.CreateOrder2Request;
-import com.zswl.cloud.springBatch.client.model.request.CreateOrdereRquest;
+import com.zswl.cloud.springBatch.client.model.ypp.request.CreateOrder2Request;
+import com.zswl.cloud.springBatch.client.model.ypp.request.CreateOrdereRquest;
 import com.zswl.cloud.springBatch.client.model.request.OrderListRequest;
-import com.zswl.cloud.springBtach.server.core.api.ypp.request.SessionRequest;
+import com.zswl.cloud.springBatch.client.model.ypp.response.CreateOrdereResponse;
+import com.zswl.cloud.springBatch.client.model.ypp.response.OrderDetailResponse;
+import com.zswl.cloud.springBatch.client.model.ypp.response.CreateOrder2Response;
+import com.zswl.cloud.springBtach.server.core.dao.ApiLogDao;
+import com.zswl.cloud.springBtach.server.core.domain.ApiLog;
 import com.zswl.cloud.springBtach.server.core.helper.RedisHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -20,7 +23,6 @@ import org.springframework.util.Assert;
 import org.springframework.web.util.UriComponentsBuilder;
 
 import java.util.HashMap;
-import java.util.Optional;
 
 //接口地址 https://apifox.com/apidoc/shared-48c64918-c4ce-49f4-b846-d23855299d7a/doc-2590155
 @Component
@@ -30,12 +32,21 @@ public class YppApi {
     RedisHelper redisHelper;
 
 
+    @Autowired
+    private ApiLogDao apiLogDao;
+
     @Value("${ypp.entId}")
     private String entId;
 
     @Value("${ypp.appSecret}")
     private String appSecret;
 
+    @Value("${ypp.appId}")
+    private String appId;
+    @Value("${ypp.test}")
+    private Boolean test;
+
+
     private final String tokenName = "ypp-token";
     private final String tokenValue = "Bearer ";
 
@@ -46,9 +57,11 @@ public class YppApi {
      * @param orderId
      * @return
      */
-    public JSONObject order_detail(String orderId) {
+    public OrderDetailResponse order_detail(String orderId) {
         String entries = httpGet("https://channel.youpiaopiao.cn/api/movie/order_detail?id=" + orderId);
-        return JSONUtil.parseObj(entries);
+
+        OrderDetailResponse bean = JSONUtil.toBean(entries, OrderDetailResponse.class);
+        return bean;
 
     }
 
@@ -59,8 +72,8 @@ public class YppApi {
      * @param mobile
      * @return
      */
-    public JSONObject pay_order(String orderId, String mobile) {
-        String entries = httpGet("https://channel.youpiaopiao.cn/api/movie/pay_order?id=" + orderId + "&test=&mobile=" + mobile);
+    public JSONObject pay_order(String orderId) {
+        String entries = httpGet("https://channel.youpiaopiao.cn/api/movie/pay_order?id=" + orderId + "&test="+test);
         return JSONUtil.parseObj(entries);
 
     }
@@ -95,9 +108,10 @@ public class YppApi {
      * @param createOrdereRquest
      * @return
      */
-    public JSONObject create_order(CreateOrdereRquest createOrdereRquest) {
+    public CreateOrdereResponse create_order(CreateOrdereRquest createOrdereRquest) {
         JSONObject entries = httpPost("https://channel.youpiaopiao.cn/api/movie/create_order", createOrdereRquest);
-        return entries;
+        CreateOrdereResponse bean = JSONUtil.toBean(entries, CreateOrdereResponse.class);
+        return bean;
 
     }
 
@@ -107,9 +121,10 @@ public class YppApi {
      * @param createOrder2Request
      * @return
      */
-    public JSONObject create_order2(CreateOrder2Request createOrder2Request) {
+    public CreateOrder2Response create_order2(CreateOrder2Request createOrder2Request) {
+        createOrder2Request.setAppId(appId);
         JSONObject entries = httpPost("https://channel.youpiaopiao.cn/api/movie/create_order2", createOrder2Request);
-        return entries;
+        return JSONUtil.toBean(entries, CreateOrder2Response.class);
 
     }
 
@@ -127,7 +142,9 @@ public class YppApi {
         builder.queryParam("pageIndex", pageIndex);
         builder.queryParam("pageSize", pageSize);
         String entries = httpGet(builder.build().toUriString());
-        return JSONUtil.parseObj(entries);
+        JSONConfig jsonConfig = JSONConfig.create();
+        jsonConfig.setIgnoreError(true);
+        return JSONUtil.parseObj(entries, jsonConfig);
 
     }
 
@@ -243,10 +260,10 @@ public class YppApi {
         UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(baseUrl);
         builder.queryParam("movieId", movieId);
         builder.queryParam("cinemaId", cinemaId);
-
-
         String entries = httpGet(builder.build().toUriString());
-        return JSONUtil.parseObj(entries);
+        JSONConfig jsonConfig = JSONConfig.create();
+        jsonConfig.setIgnoreError(true);
+        return JSONUtil.parseObj(entries, jsonConfig);
     }
 
     /**
@@ -268,7 +285,9 @@ public class YppApi {
         builder.queryParam("movieId", movieId);
         builder.queryParam("sid", sid);
         String entries = httpGet(builder.build().toUriString());
-        return JSONUtil.parseObj(entries);
+        JSONConfig jsonConfig = JSONConfig.create();
+        jsonConfig.setIgnoreError(true);
+        return JSONUtil.parseObj(entries, jsonConfig);
     }
 
     /**
@@ -284,10 +303,15 @@ public class YppApi {
     }
 
     private String httpGet(String url) {
+        ApiLog apiLog = new ApiLog();
+        apiLog.setRequest(url);
+        apiLog.setSystem("ypp");
         String token = getoken();
         HttpRequest get = HttpUtil.createGet(url);
         HttpResponse execute = get.header("Authorization", token).execute();
         String body = execute.body();
+        apiLog.setResponse(body);
+        apiLogDao.save(apiLog);
         JSONObject entries = JSONUtil.parseObj(body);
         Integer code = (Integer) entries.get("code");
         Assert.isTrue(execute.isOk(), "飘飘响应错误");
@@ -307,7 +331,6 @@ public class YppApi {
         String response = execute.body();
         JSONObject entries = JSONUtil.parseObj(response);
         Integer code = (Integer) entries.get("code");
-        Assert.isTrue(execute.isOk(), "票票响应错误");
         Assert.isTrue(code.equals(0), String.valueOf(entries.get("message")));
         return entries;
     }

+ 3 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/controller/YppController.java

@@ -20,6 +20,9 @@ public class YppController {
     private YppService yppService;
 
 
+
+
+
     @ApiOperation("热映电影(pageIndex从0开始)")
     @ResourceAuth(value = "user", type = AuthType.User)
     @RequestMapping(value = "movies", method = RequestMethod.GET)

+ 0 - 148
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/CreateOrderStep2Demo.java

@@ -1,148 +0,0 @@
-package com.zswl.cloud.springBtach.server.core.job;
-
-import com.github.microservice.auth.security.helper.AuthHelper;
-import com.github.microservice.core.helper.SpringBeanHelper;
-import com.zhongshu.payment.client.service.v2.OrderService2;
-import com.zswl.cloud.shop.client.service.ShopService;
-import com.zswl.cloud.springBtach.server.core.helper.RedisHelper;
-import com.zswl.cloud.springBtach.server.core.job.Ypp.YppOrderJob;
-import lombok.experimental.Delegate;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
-import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
-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;
-import org.springframework.context.annotation.Lazy;
-
-import javax.annotation.Resource;
-
-@Configuration
-public class CreateOrderStep2Demo {
-
-    @Resource
-    private StepBuilderFactory stepBuilderFactory;
-
-    @Resource
-    private JobBuilderFactory jobBuilderFactory;
-
-    @Autowired
-    OrderService2 orderService2;
-
-    @Autowired
-    ShopService shopService;
-
-    @Autowired
-    AuthHelper authHelper;
-
-    @Autowired
-    RedisHelper redisHelper;
-
-    @Lazy
-    @Autowired
-    YppOrderJob createOrderStep;
-
-
-    @Autowired
-    @Delegate
-    private StandardOrderJobDemo standardStep;
-
-    @Autowired
-    private SpringBeanHelper springBeanHelper;
-
-
-    @Bean
-    public Step checkLocalOrder() {
-        //tasklet 执行step逻辑, 类似 Thread()--->可以执行runable接口
-//        return stepBuilderFactory.get("createCommon")
-//                .tasklet(createCommonTasklet())
-//                .build();
-        return null;
-    }
-
-
-    @Bean
-    public Step check1Step() {
-        //tasklet 执行step逻辑, 类似 Thread()--->可以执行runable接口
-//        return stepBuilderFactory.get("createCommon")
-//                .tasklet(createCommonTasklet())
-//                .build();
-        return null;
-    }
-
-    @Bean
-    public Step check2Step() {
-        //tasklet 执行step逻辑, 类似 Thread()--->可以执行runable接口
-//        return stepBuilderFactory.get("createCommon")
-//                .tasklet(createCommonTasklet())
-//                .build();
-        return null;
-    }
-
-    @Bean
-    public Step check3Step() {
-        //tasklet 执行step逻辑, 类似 Thread()--->可以执行runable接口
-//        return stepBuilderFactory.get("createCommon")
-//                .tasklet(createCommonTasklet())
-//                .build();
-        return null;
-    }
-
-    @Bean
-    public Step buildPlatformOrder() {
-        //tasklet 执行step逻辑, 类似 Thread()--->可以执行runable接口
-//        return stepBuilderFactory.get("createCommon")
-//                .tasklet(createCommonTasklet())
-//                .build();
-
-
-//        var user = new User();
-//        Map<String,Object>  map = BeanMap.create(user);
-//
-//        map.get("name").equals(user.getName());
-//        user.setName("sss");
-//
-//        map.put("name","sss");
-//
-//        map.entrySet().forEach(it->{
-//            System.out.println(it.getKey()+" - "+ it.getValue());
-//        });
-
-
-        return stepBuilderFactory.get("createCommon")
-                .tasklet((contribution, chunkContext) -> {
-
-
-                    //todo OderService.create()
-
-                    return RepeatStatus.FINISHED;
-                })
-                .build();
-    }
-
-
-//    @Bean
-//    public Job creatOrder() {
-//        return jobBuilderFactory
-//                .get("creatOrder")
-//                .incrementer(new RunIdIncrementer())
-//                .start(createOrderStep.createCommonStep())
-//                .next(this.checkFrom())
-//                .next(check2Step())
-//                .next(buildPlatformOrder())
-//                .listener(new JobExecutionListener() {
-//                    @Override
-//                    public void beforeJob(JobExecution jobExecution) {
-//
-//                    }
-//
-//                    @Override
-//                    public void afterJob(JobExecution jobExecution) {
-//                        publish("order", jobExecution.getJobId(), Map.of());
-//                    }
-//                })
-//                .build();
-//    }
-
-}

+ 0 - 51
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/StandardOrderJobDemo.java

@@ -1,51 +0,0 @@
-package com.zswl.cloud.springBtach.server.core.job;
-
-
-import com.zswl.cloud.springBtach.server.core.event.JobEvent;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
-import org.springframework.batch.repeat.RepeatStatus;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.Map;
-
-
-@Component
-public class StandardOrderJobDemo {
-
-    @Resource
-    private StepBuilderFactory stepBuilderFactory;
-
-    @Autowired
-    private ApplicationContext applicationContext;
-
-
-    public Step checkFrom() {
-        return stepBuilderFactory.get("createCommon")
-                .tasklet(( contribution,  chunkContext)->{
-
-
-
-                    return RepeatStatus.FINISHED;
-                })
-                .build();
-    }
-
-
-    public void publish(String type,Long id,Object other){
-        applicationContext.publishEvent(new JobEvent(Map.of(
-                "type",type,
-                "id",id,
-                "other",other
-        )));
-    }
-
-
-
-
-
-
-}

+ 0 - 73
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/Ypp/YppOrderJob.java

@@ -1,73 +0,0 @@
-package com.zswl.cloud.springBtach.server.core.job.Ypp;
-
-import cn.hutool.json.JSONUtil;
-import com.github.microservice.auth.security.helper.AuthHelper;
-import com.zhongshu.payment.client.service.v2.OrderService2;
-import com.zswl.cloud.shop.client.service.ShopService;
-import com.zswl.cloud.springBtach.server.core.helper.RedisHelper;
-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
-@Configuration
-@Log4j2
-public class YppOrderJob {
-
-
-
-    @Autowired
-    OrderService2 orderService2;
-
-    @Autowired
-    ShopService shopService;
-
-    @Autowired
-    AuthHelper authHelper;
-
-    @Autowired
-    RedisHelper redisHelper;
-
-    @Autowired
-    @Delegate
-    StandarOrderJob standardOrderJob;
-
-    public Step chk() {
-        return getStepBuilderFactory().get("chk").tasklet((it, ii) -> {
-            log.info("这个是有票票的创建订单检查流程");
-
-            return RepeatStatus.FINISHED;
-        }).build();
-    }
-
-
-    public Step createCommonStep() {
-        return getStepBuilderFactory().get("createCommon")
-                .tasklet((contribution, chunkContext) -> {
-
-                    log.info("入参数据:{}",JSONUtil.toJsonStr(getParameter().get()));
-
-                    return RepeatStatus.FINISHED;
-                })
-                .build();
-    }
-
-    @Bean
-    public Job YppOrder() {
-        return getJobBuilderFactory()
-                .get("YppOrder")
-                .start(chk())
-                .next(createCommonStep())
-                .incrementer(new RunIdIncrementer())
-                .build();
-    }
-
-}

+ 3 - 8
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/dfy/HotelPayJob.java

@@ -16,18 +16,16 @@ import com.zswl.cloud.springBatch.client.model.dfy.Hotel.response.OrderDetailRes
 import com.zswl.cloud.springBtach.server.core.api.dfy.DomesticHotelApi;
 import com.zswl.cloud.springBtach.server.core.job.standard.StandarPayJob;
 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.configuration.annotation.JobBuilderFactory;
-import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
 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;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 @Data
@@ -36,12 +34,9 @@ import java.util.List;
 public class HotelPayJob {
 
     @Autowired
+    @Delegate
     private StandarPayJob standarPayJob;
 
-    @Resource
-    private JobBuilderFactory jobBuilderFactory;
-    @Resource
-    private StepBuilderFactory stepBuilderFactory;
 
     @Autowired
     PaymentService2 paymentService2;
@@ -54,7 +49,7 @@ public class HotelPayJob {
 
 
     public Step hotelPayStep() {
-        return stepBuilderFactory.get("hotelPayStep")
+        return getStepBuilderFactory().get("hotelPayStep")
                 .tasklet((contribution, chunkContext) -> {
                     CreatePayment2Model createPayment2Model = standarPayJob.getParameter().get();
                     ResultContent<List<GoodsResultModel>> listResultContent = orderService2.goodsDetail(createPayment2Model.getOrderNo());

+ 102 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/YppDeliveryJob.java

@@ -0,0 +1,102 @@
+package com.zswl.cloud.springBtach.server.core.job.ypp;
+
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.github.microservice.auth.client.content.ResultContent;
+import com.github.microservice.auth.client.content.ResultState;
+import com.github.microservice.auth.security.helper.AuthHelper;
+import com.zhongshu.payment.client.model.order.v2.GoodsResultModel;
+import com.zhongshu.payment.client.model.order.v2.UpdateGoodsModel;
+import com.zhongshu.payment.client.model.payment.SubOrdersConfirmResponseModel;
+import com.zhongshu.payment.client.service.v2.OrderService2;
+import com.zhongshu.payment.client.service.v2.PaymentService2;
+import com.zhongshu.payment.client.type.OrderType;
+import com.zswl.cloud.shop.client.service.ShopService;
+import com.zswl.cloud.springBatch.client.model.ypp.response.CreateOrdereResponse;
+import com.zswl.cloud.springBtach.server.core.api.ypp.YppApi;
+import com.zswl.cloud.springBtach.server.core.helper.RedisHelper;
+import com.zswl.cloud.springBtach.server.core.job.standard.StandarDeliveryJob;
+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;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@Configuration
+@Log4j2
+public class YppDeliveryJob {
+
+
+    @Autowired
+    OrderService2 orderService2;
+
+    @Autowired
+    ShopService shopService;
+
+    @Autowired
+    AuthHelper authHelper;
+
+    @Autowired
+    RedisHelper redisHelper;
+
+    @Autowired
+    private YppApi yppApi;
+
+    @Autowired
+    private PaymentService2 paymentService2;
+
+    @Autowired
+    @Delegate
+    StandarDeliveryJob standarDeliveryJob;
+
+
+    public Step yppDeliveryStep() {
+        return getStepBuilderFactory().get("yppDeliveryStep")
+                .tasklet((contribution, chunkContext) -> {
+
+                    GoodsResultModel goodsResultModel = getParameter().get();
+                    String extend = goodsResultModel.getExtend();
+                    CreateOrdereResponse bean = JSONUtil.toBean(extend, CreateOrdereResponse.class);
+                    yppApi.pay_order(bean.getData());
+
+                    // 分账
+                    ResultContent<SubOrdersConfirmResponseModel> subOrdersConfirmResponseModelResultContent = paymentService2.subOrdersConfirm(goodsResultModel.getId(), goodsResultModel.getShopId());
+                    if (!subOrdersConfirmResponseModelResultContent.getState().equals(ResultState.Success)) {
+                        log.info("分账失败:{}", JSONUtil.toJsonStr(goodsResultModel));
+                        getResultContent().set(ResultContent.build(ResultState.Fail));
+                    }
+
+
+                    UpdateGoodsModel updateGoodsModel = new UpdateGoodsModel();
+                    updateGoodsModel.setId(goodsResultModel.getId());
+                    updateGoodsModel.setDelivery(true);
+                    updateGoodsModel.setGoodsState(OrderType.WAIT_USE);
+                    orderService2.updateGoods(updateGoodsModel);
+
+                    getResultContent().set(ResultContent.build(ResultState.Success));
+
+                    return RepeatStatus.FINISHED;
+                })
+                .build();
+    }
+
+    @Bean
+    public Job yppDelivery() {
+        return getJobBuilderFactory()
+                .get("yppDelivery")
+                .start(yppDeliveryStep())
+                .incrementer(new RunIdIncrementer())
+                .build();
+    }
+
+}

+ 80 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/job/ypp/YppPayJob.java

@@ -0,0 +1,80 @@
+package com.zswl.cloud.springBtach.server.core.job.ypp;
+
+import cn.hutool.json.JSONUtil;
+import com.github.microservice.auth.client.content.ResultContent;
+import com.github.microservice.auth.client.content.ResultState;
+import com.zhongshu.payment.client.model.order.v2.GoodsResultModel;
+import com.zhongshu.payment.client.model.payment.zswl.CreatePayment2Model;
+import com.zhongshu.payment.client.service.v2.OrderService2;
+import com.zhongshu.payment.client.service.v2.PaymentService2;
+import com.zswl.cloud.springBatch.client.model.ypp.response.CreateOrdereResponse;
+import com.zswl.cloud.springBatch.client.model.ypp.response.OrderDetailResponse;
+import com.zswl.cloud.springBtach.server.core.api.ypp.YppApi;
+import com.zswl.cloud.springBtach.server.core.job.standard.StandarPayJob;
+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;
+
+import java.util.List;
+
+@Data
+@Configuration
+@Log4j2
+public class YppPayJob {
+
+    @Autowired
+    @Delegate
+    private StandarPayJob standarPayJob;
+
+
+    @Autowired
+    PaymentService2 paymentService2;
+
+    @Autowired
+    OrderService2 orderService2;
+
+    @Autowired
+    private YppApi yppApi;
+
+
+    public Step yppPayStep() {
+        return getStepBuilderFactory().get("hotelPayStep")
+                .tasklet((contribution, chunkContext) -> {
+                    CreatePayment2Model createPayment2Model = standarPayJob.getParameter().get();
+
+                    ResultContent<List<GoodsResultModel>> listResultContent = orderService2.goodsDetail(createPayment2Model.getOrderNo());
+                    GoodsResultModel goodsResultModel = listResultContent.getContent().get(0);
+                    String extend = goodsResultModel.getExtend();
+
+                    CreateOrdereResponse bean = JSONUtil.toBean(extend, CreateOrdereResponse.class);
+                    OrderDetailResponse orderDetailResponse = yppApi.order_detail(bean.getData());
+                    if (!orderDetailResponse.getData().getCanPay()) {
+                        standarPayJob.getResultContent().set(ResultContent.build(ResultState.Fail, "渠道订单无法支付"));
+                        return RepeatStatus.FINISHED;
+                    }
+
+
+                    standarPayJob.getResultContent().set(paymentService2.creatPayOrder(createPayment2Model));
+                    return RepeatStatus.FINISHED;
+                })
+                .build();
+    }
+
+    @Bean
+    public Job yppPay() {
+        return getJobBuilderFactory()
+                .get("yppPay")
+                .start(yppPayStep())
+                .incrementer(new RunIdIncrementer())
+                .build();
+    }
+
+
+}

+ 106 - 0
SpringBatchServiceServer/src/main/java/com/zswl/cloud/springBtach/server/core/service/YppService.java

@@ -1,12 +1,32 @@
 package com.zswl.cloud.springBtach.server.core.service;
 
 
+import cn.hutool.core.lang.Snowflake;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.github.microservice.auth.client.content.ResultContent;
+import com.github.microservice.auth.client.content.ResultState;
+import com.github.microservice.auth.security.helper.AuthHelper;
+import com.zhongshu.payment.client.model.order.v2.CreateOrder2Model;
+import com.zhongshu.payment.client.service.v2.OrderService2;
+import com.zhongshu.payment.client.type.JobFlowMap;
+import com.zhongshu.payment.client.type.TransferOwner;
+import com.zhongshu.payment.client.type.TransferType;
+import com.zswl.cloud.shop.client.service.ShopService;
+import com.zswl.cloud.shop.client.vo.life.AccountDetailVo;
+import com.zswl.cloud.shop.client.vo.life.SharePlatformVo;
+import com.zswl.cloud.springBatch.client.model.ypp.request.CreateOrdereRquest;
+import com.zswl.cloud.springBatch.client.model.ypp.response.CreateOrdereResponse;
+import com.zswl.cloud.springBatch.client.model.ypp.response.OrderDetailResponse;
 import com.zswl.cloud.springBtach.server.core.api.ypp.YppApi;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
 @Log4j2
 @Service
 public class YppService {
@@ -14,13 +34,99 @@ public class YppService {
     @Autowired
     private YppApi yppApi;
 
+    @Autowired
+    private OrderService2 orderService2;
+
+    @Autowired
+    private Snowflake snowflake;
+
+    @Autowired
+    private AuthHelper authHelper;
+
+    @Autowired
+    private ShopService shopService;
+
+
+    public ResultContent create_order2(CreateOrdereRquest createOrdereRquest) {
+        com.zswl.cloud.shop.client.ret.ResultContent<AccountDetailVo> shopSetting = shopService.shopSetting("有票票");
+        if (!shopSetting.getState().equals(com.zswl.cloud.shop.client.ret.ResultState.Success)) {
+            return ResultContent.build(ResultState.Fail, "有票票信息未配置");
+        }
+        String orderNo = snowflake.nextIdStr();
+        AccountDetailVo accountDetailVo = shopSetting.getContent();
+        // 分账信息
+        String shopId = accountDetailVo.getAccountId();
+        String authAccount = accountDetailVo.getAuthAccount();
+        SharePlatformVo sharePlatformVo = accountDetailVo.getSharePlatformVo();
+
+
+        CreateOrdereResponse createOrdereResponse = yppApi.create_order(createOrdereRquest);
+        String data = createOrdereResponse.getData();
+        OrderDetailResponse orderDetailResponse = yppApi.order_detail(data);
+        BigDecimal totalUserPrice = orderDetailResponse.getData().getTotalUserPrice();
+
+
+        CreateOrder2Model createOrder2Model = new CreateOrder2Model();
+        createOrder2Model.setOrderNo(orderNo);
+        createOrder2Model.setUserId(authHelper.getCurrentUser().getUserId());
+        createOrder2Model.setShopId(shopId);
+        JSONObject shopInfo = new JSONObject();
+        shopInfo.set("shopName", createOrdereRquest.getCinemaName());
+        createOrder2Model.setShopInfo(shopInfo);
+        createOrder2Model.setTotalAmount(totalUserPrice);
+        createOrder2Model.setDiscountAmount(BigDecimal.ZERO);
+        createOrder2Model.setPayAmount(totalUserPrice);
+        createOrder2Model.setAccesserUserId(authAccount);
+        createOrder2Model.setChannel(createOrdereRquest.getChannel());
+
+
+        JSONObject goodsInfo = JSONUtil.parseObj(createOrdereRquest);
+        goodsInfo.set("goodsName", createOrdereRquest.getMovieName());
+        goodsInfo.set("goodsPath", createOrdereRquest.getPostImageUrl());
+        goodsInfo.set("channelOrderId", data);
+
+
+        CreateOrder2Model.Goods goods = new CreateOrder2Model.Goods();
+        goods.setGoodsId(createOrdereRquest.getMovieId());
+        goods.setJobFlowMap(JobFlowMap.YPP);
+        goods.setGoodsInfo(goodsInfo);
+        goods.setPayAmount(totalUserPrice);
+        goods.setValidDay(90);
+        goods.setTransferType(sharePlatformVo.getShareType().equals(1) ? TransferType.RATIO : TransferType.FIXED);
+
+        List<CreateOrder2Model.Owner> ownerList = new ArrayList<>();
+
+        CreateOrder2Model.Owner platfor = new CreateOrder2Model.Owner();
+        platfor.setOwner(TransferOwner.PLATFORM);
+        platfor.setValue(sharePlatformVo.getPlatformRate());
+
+        CreateOrder2Model.Owner buy = new CreateOrder2Model.Owner();
+        buy.setOwner(TransferOwner.BUY_SHOP);
+        buy.setValue(sharePlatformVo.getBuyShopRate());
+        buy.setShopId(shopId);
+
+        CreateOrder2Model.Owner use = new CreateOrder2Model.Owner();
+        use.setOwner(TransferOwner.USE_SHOP);
+        use.setValue(sharePlatformVo.getCheckShopRate());
+
+        ownerList.add(platfor);
+        ownerList.add(buy);
+        ownerList.add(use);
+        goods.setTransferRrule(ownerList);
+        goods.setExtend(JSONUtil.toJsonStr(createOrdereResponse));
+        createOrder2Model.setGoodsList(List.of(goods));
+
+        return orderService2.creat(createOrder2Model);
+    }
 
     public ResultContent movies(String cityId, String pageIndex, String pageSize) {
         return ResultContent.buildContent(yppApi.movies(cityId, pageIndex, pageSize));
     }
+
     public ResultContent coming_movies(String cityId) {
         return ResultContent.buildContent(yppApi.coming_movies(cityId));
     }
+
     public ResultContent movie_detail(String movieId) {
         return ResultContent.buildContent(yppApi.movie_detail(movieId));
     }

+ 2 - 0
SpringBatchServiceServer/src/main/resources/application-dev.yml

@@ -33,6 +33,8 @@ swagger:
 ypp:
   entId: 101206
   appSecret: VqJfaVYc87wDKk8Gad4yAx9v8TFNhrt0
+  appId: 101206
+  test: true
 
 # 笛风云
 dfy: