Procházet zdrojové kódy

订单插入定时(存入测试表)

zhaoxian před 7 měsíci
rodič
revize
afc69a6e5a

+ 34 - 18
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -2116,12 +2116,13 @@ public class SupplyChainController extends BaseController {
     /**
      * 接口链接:
      * https://open.kwaixiaodian.com/zone/new/docs/api?name=open.distribution.investment.activity.open.close&version=1
+     * 状态修改
      */
     @GetMapping("/addList")
-    @ApiOperation(value = "分销团长订单列表(游标方式)")
+    @ApiOperation(value = "分销团长订单列表(游标方式),状态修改")
     public void addList(String beginDate, String endDate) {
         List<String> allDatesOfTwoTimes = DateUtils.getAllDatesOfTwoTimes(beginDate, endDate);
-        allDatesOfTwoTimes.forEach(date -> addListCService.submit(() -> {
+        allDatesOfTwoTimes.forEach(date -> updateListCService.submit(() -> {
             try {
                 supplyChainService.addList(date, date, "");
             } catch (InterruptedException e) {
@@ -2130,24 +2131,39 @@ public class SupplyChainController extends BaseController {
         }));
     }
 
-    @GetMapping("/addListC")
-    @ApiOperation(value = "多日期本地调试---分销团长订单列表")
-    public void addListC(String beginDate, String endDate) {
-        List<String> allDatesOfTwoTimes = DateUtils.getAllDatesOfTwoTimes(beginDate, endDate);
-        allDatesOfTwoTimes.forEach(date -> addListCService.submit(() -> {
-            try {
-                long currentTimeMillis = System.currentTimeMillis();
-                System.out.println(date + "开始执行ing...");
-                supplyChainService.addList(date, date, "");
-                System.out.println(date + "用时:" + (System.currentTimeMillis() - currentTimeMillis) / 60000 + "分");
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }));
+
+    /**
+     * 新增 open.distribution.cps.leader.order.cursor.list
+     * 接口链接:
+     * https://open.kwaixiaodian.com/zone/new/docs/api?name=open.distribution.investment.activity.open.close&version=1
+     */
+    @GetMapping("/insertOrderList")
+    @ApiOperation(value = "新增分销团长订单列表(游标方式)")
+    public void insertOrderList(Integer queryType, String beginDate, String endDate) {
+        try {
+            supplyChainService.insertOrderList(queryType, beginDate, endDate);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
-    static ExecutorService fxNowService = Executors.newFixedThreadPool(10);
+    /**
+     * 当日2小时内数据新增
+     * open.distribution.cps.leader.order.cursor.list
+     * 接口链接:
+     * https://open.kwaixiaodian.com/zone/new/docs/api?name=open.distribution.investment.activity.open.close&version=1
+     */
+    @GetMapping("/insertNowdayOrderList")
+    @ApiOperation(value = "新增当天分销团长订单列表(游标方式)")
+    public void insertNowdayOrderList() {
+        try {
+            supplyChainService.insertNowdayOrderList();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 
+    static ExecutorService fxNowService = Executors.newFixedThreadPool(10);
 
     @PostMapping(value = "/ruixuanAccept")
     public Map<String, Object> ruixuanAccept(@RequestBody String eventsEncoded) {
@@ -2258,7 +2274,7 @@ public class SupplyChainController extends BaseController {
                                 supplyChainService.updateOrder(eventJSon);
                             } else if ("kwaishop_distribute_activity_item_change".equals(event)) {
                                 supplyChainService.updateItem(eventJSon);
-                            }else if ("kwaishop_distribution_regimentalOrder".equals(event)) {
+                            } else if ("kwaishop_distribution_regimentalOrder".equals(event)) {
                                 supplyChainService.insertOrder(eventJSon);
                             }
                         }

+ 49 - 5
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouSupplyChain.java

@@ -1,5 +1,6 @@
 package com.ruixuan.isc.entity;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.annotation.Excel;
 import com.ruixuan.common.utils.Check;
@@ -233,7 +234,7 @@ public class KuaishouSupplyChain {
     /**
      * 资金流转类型 [1:服务费收入订单] [2:服务费支出订单]
      */
-    private Long fundType;
+    private Integer fundType;
     /**
      * 二级团长服务费(分)
      */
@@ -250,10 +251,8 @@ public class KuaishouSupplyChain {
     public KuaishouSupplyChain(JSONObject info) {
         this.setOid(info.getLong("oid"));
         JSONObject orderProductInfo = info.getJSONObject("orderProductInfo");
-        Long itemId = null;
         if (!Check.isNull(orderProductInfo)) {
-            itemId = orderProductInfo.getLong("itemId");
-            this.setItemId(itemId);
+            this.setItemId(orderProductInfo.getLong("itemId"));
             this.setItemTitle(orderProductInfo.getString("itemTitle"));
             this.setReservePrice(orderProductInfo.getLong("itemPrice"));
             this.setImageUrl(orderProductInfo.getString("itemUrl"));
@@ -288,7 +287,6 @@ public class KuaishouSupplyChain {
         this.setTotalRegimentalSettleAmount(0L);//待结算 预估填入
         this.setStatDate(DateUtils.timestamptoStr(info.getLong("orderCreateTime")));
         this.setStatHour(DateUtils.timestamptoHour(info.getLong("orderCreateTime")));
-        this.setItemCommissionRate(info.getLong("promoterCommissionRate"));
         this.setExpendRegimentalSettleAmount(info.getLong("expendRegimentalSettleAmount"));
         this.setExpendEstimateSettleAmount(info.getLong("expendEstimateSettleAmount"));
         this.setExpendRegimentalPromotionRate(info.getLong("expendRegimentalPromotionRate"));
@@ -296,4 +294,50 @@ public class KuaishouSupplyChain {
         this.setPromoterCommissionRate(info.getLong("promoterCommissionRate"));
     }
 
+    public KuaishouSupplyChain(JSONObject info,String type) {
+        this.setOid(info.getLong("oid"));
+        this.setRegimentalId(info.getLong("activityUserId"));
+        this.setActivityId(info.getLong("activityId"));
+        this.setSecondActivityId(info.getLong("secondActivityId"));
+        this.setOrderStatus(info.getInteger("cpsOrderStatus"));
+        this.setOrderCreateTime(info.getLong("orderCreateTime"));
+        this.setOrderAmount(info.getLong("orderTradeAmount"));
+        this.setPayAmount(info.getLong("payAmount"));
+        this.setRegimentalPromotionRate(info.getLong("regimentalPromotionRate"));
+        this.setRegimentalPromotionAmount(info.getLong("regimentalPromotionAmount"));
+        JSONArray cpsOrderProductView = info.getJSONArray("cpsOrderProductView");
+        if (!Check.isNull(cpsOrderProductView)) {
+            JSONObject object = cpsOrderProductView.getJSONObject(0);
+            this.setItemId(object.getLong("itemId"));
+            this.setItemTitle(object.getString("itemTitle"));
+            this.setReservePrice(object.getLong("itemPrice"));
+            this.setImageUrl(object.getString("itemUrl"));
+            this.setSellerId(object.getLong("sellerId"));
+            this.setSellerNickName(object.getString("sellerNickName"));
+            this.setSkuId(object.getLong("skuId"));
+            this.setNum(object.getLong("num"));
+        }
+        this.setStatDate(DateUtils.timestamptoStr(info.getLong("orderCreateTime")));
+        this.setStatHour(DateUtils.timestamptoHour(info.getLong("orderCreateTime")));
+        this.setSendTime(info.getLong("sendTime"));
+        this.setSendStatus(info.getInteger("sendStatus"));
+        this.setRecvTime(info.getLong("recvTime"));
+        this.setPromoterId(info.getLong("promotionId"));
+        this.setPromoterNickName(info.getString("promotionNickName"));
+        this.setExpendRegimentalSettleAmount(info.getLong("expendRegimentalSettleAmount"));
+        this.setExpendEstimateSettleAmount(info.getLong("expendEstimateSettleAmount"));
+        this.setExpendRegimentalPromotionRate(info.getLong("expendRegimentalPromotionRate"));
+        this.setBaseAmount(info.getLong("baseAmount"));
+        this.setShareRate(info.getLong("shareRateStr"));
+        this.setExcitationIncome(info.getLong("excitationInCome"));
+        this.setServiceIncome(info.getLong("serviceIncome"));
+        this.setSettlementBizType(info.getInteger("settlementBizType"));
+        this.setSettlementBizTypeDesc(1 == info.getInteger("settlementBizType") ? "快分销" : "快手聚力计划");
+        this.setFundType(info.getInteger("fundType"));
+        this.setServiceAmount(info.getLong("serviceAmount"));
+        this.setSecondServiceAmount(info.getLong("secondServiceAmount"));
+        this.setPromoterCommissionRate(info.getLong("promoterCommissionRate"));
+        this.setTotalRegimentalSettleAmount(0L);//待结算 预估填入
+    }
+
 }

+ 3 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java

@@ -269,6 +269,8 @@ public interface SupplyChainMapper {
 
     List<JSONObject> getBytedanceCourtshipGmvHourByDateRoi(@Param("userList") List<Long> userList, @Param("date") Long date, @Param("hourType") Integer hourType);
 
-    void rinsertOne(@Param("ownership") String ownership, @Param("supplyChain") KuaishouSupplyChain supplyChain);
+    void replaceOne(@Param("ownership") String ownership, @Param("supplyChain") KuaishouSupplyChain supplyChain);
+
+    void replaceBatchOrder(@Param("ownership") String ownership, @Param("supplyChainList") List<KuaishouSupplyChain> supplyChainList);
 
 }

+ 6 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java

@@ -173,12 +173,17 @@ public interface ISupplyChainService {
     void updateItem(JSONObject eventJSon);
 
     void insertOrder(JSONObject eventJSon);
+
     /*
      *分销团长订单列表(游标方式)
      * open.distribution.cps.leader.order.cursor.list
      */
     void addList(String beginDate, String endDate, String pcursor) throws InterruptedException;
 
+    void insertOrderList(Integer queryType, String beginDate, String endDate) throws Exception;
+
+    void insertNowdayOrderList()throws Exception;
+
     /*
      *团长查询招商活动列表
      * open.distribution.investment.activity.open.list
@@ -220,4 +225,5 @@ public interface ISupplyChainService {
 
 
     List<JSONObject> getBytedanceCourtshipGmvHourByDateRoi(List<Long> userList, Long dataNow, Integer hourType);
+
 }

+ 217 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -37,6 +37,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @Slf4j
 @Service
@@ -806,14 +808,15 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                 if (!Check.isNull(itemCheck)) {
                     ownership = itemCheck.getOwnership();
                 }
-                supplyChainMapper.rinsertOne("rocket", supplyChain);
+//                supplyChainMapper.replaceOne(ownership, supplyChain);
+                supplyChainMapper.replaceOne("rocket", supplyChain);// todo 测试完 删除改行 放开上面 并修改数据表
             }  //更新
             else if (2 == messageType) {
                 Integer cpsOrderStatus = info.getInteger("cpsOrderStatus");
                 Long oid = info.getLong("oid");
                 if (cpsOrderStatus == 60 || cpsOrderStatus == 40) {
 //                    Integer i = updateOrderRegimentalSettleAmount(oid, cpsOrderStatus);
-                    Integer i = updateOrderRegimentalSettleAmountCeshi(oid, cpsOrderStatus);
+                    Integer i = updateOrderRegimentalSettleAmountCeshi(oid, cpsOrderStatus);// todo 测试完 删除改行 放开上面
                     if (i <= 0) {
                         log.error("订单ID:{},状态:{} 修改失败", oid, cpsOrderStatus);
                     }
@@ -874,6 +877,218 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
 
     }
 
+    static ExecutorService ruixuanService = Executors.newFixedThreadPool(6);
+    static ExecutorService miaogousiService = Executors.newFixedThreadPool(3);
+    static ExecutorService rocketService = Executors.newFixedThreadPool(3);
+    static ExecutorService yufuService = Executors.newFixedThreadPool(3);
+    static ExecutorService yuxiuService = Executors.newFixedThreadPool(3);
+    static ExecutorService zhishuiService = Executors.newFixedThreadPool(3);
+
+    @Override
+    public void insertOrderList(Integer queryType, String beginDate, String endDate) throws Exception {
+        String url = "https://openapi.kwaixiaodian.com";
+        Long beginTime = DateUtils.getStartLongTime(beginDate);
+        Long endTime = DateUtils.getEndLongTime(endDate);
+
+        /* List<KuaishouAccessToken> tokens = accessTokenService.getTokenInfos();
+        tokens.forEach(token -> ruixuanService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+        //秒构思
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> mgsTokens = accessTokenService.getMgsTokenInfos();
+        mgsTokens.forEach(token -> miaogousiService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+        */
+        //TODO 测完放开
+        //王炸
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
+        rocketTokens.forEach(token -> rocketService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+        //TODO 测完放开
+       /*//预付
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
+        yufuTokens.forEach(token -> yufuService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+
+        //毓秀
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> yuxiuTokens = accessTokenService.getYuxiuTokenInfos();
+        yuxiuTokens.forEach(token -> yuxiuService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+
+        //止水
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> zhishuiTokens = accessTokenService.getZhishuiTokenInfos();
+        zhishuiTokens.forEach(token -> zhishuiService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));*/
+
+    }
+
+    @Override
+    public void insertNowdayOrderList() throws Exception {
+        String url = "https://openapi.kwaixiaodian.com";
+        //2小时前 时间戳
+        Long beginTime = DateUtils.getTimeStamp(DateUtils.getHourTime(-2));
+        //当前时间
+        Long endTime = DateUtils.getTimeStamp(DateUtils.getTime());
+        /* List<KuaishouAccessToken> tokens = accessTokenService.getTokenInfos();
+        tokens.forEach(token -> ruixuanService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+        //秒构思
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> mgsTokens = accessTokenService.getMgsTokenInfos();
+        mgsTokens.forEach(token -> miaogousiService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+        */
+        //TODO 测完放开
+        //王炸
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
+        rocketTokens.forEach(token -> rocketService.submit(() -> {
+            insertRuixuanOrderList(1, token, beginTime, endTime, url, "", 1);
+        }));
+        //TODO 测完放开
+       /*//预付
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
+        yufuTokens.forEach(token -> yufuService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+
+        //毓秀
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> yuxiuTokens = accessTokenService.getYuxiuTokenInfos();
+        yuxiuTokens.forEach(token -> yuxiuService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));
+
+        //止水
+        Thread.sleep(3000);
+        List<KuaishouAccessToken> zhishuiTokens = accessTokenService.getZhishuiTokenInfos();
+        zhishuiTokens.forEach(token -> zhishuiService.submit(() -> {
+            insertRuixuanOrderList(queryType, token, beginTime, endTime, url, "", 1);
+        }));*/
+
+    }
+
+    private void insertRuixuanOrderList(Integer queryType, KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, int counts) {
+        try {
+            List<KuaishouSupplyChain> ruixuanList = new ArrayList<>();
+            List<KuaishouSupplyChain> mgsList = new ArrayList<>();
+            List<KuaishouSupplyChain> rocketList = new ArrayList<>();
+            List<KuaishouSupplyChain> yufuList = new ArrayList<>();
+            List<KuaishouSupplyChain> yuxiuList = new ArrayList<>();
+            List<KuaishouSupplyChain> zhishuiList = new ArrayList<>();
+            String appKey = accessToken.getAppKey();
+            String signSecret = accessToken.getSignSecret();
+            if (Check.isNull(signSecret) || Check.isNull(appKey)) {
+                return;
+            }
+            AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url, appKey, signSecret);
+            OpenDistributionCpsLeaderOrderCursorListRequest request = new OpenDistributionCpsLeaderOrderCursorListRequest();
+            request.setAccessToken(accessToken.getAccessToken());
+            request.setApiMethodVersion(1L);
+
+            //排序类型 [1:按指定查询类型降序] [2:按指定查询类型升序]
+            request.setSortType(1);
+            //查询类型 [1:按分销订单创建时间查询] [2:按分销订单更新时间查询][4:按订单实际创建时间查询]
+            request.setQueryType(queryType);
+            //分销订单状态 [0:全部订单] [30:已付款] [50:已收货] [60:已结算] [80:已失效]
+            request.setCpsOrderStatus(0);
+            request.setDistributorId(0l);
+            request.setBeginTime(beginTime);
+            request.setEndTime(endTime);
+            request.setPcursor(pcursor);
+            request.setPageize(100);
+            request.setFundType(1);
+            OpenDistributionCpsLeaderOrderCursorListResponse response = null;
+            try {
+                response = client.execute(request);
+            } catch (KsMerchantApiException e) {
+                e.printStackTrace();
+            }
+            JSONObject obj = JSONObject.parseObject(GsonUtils.toJSON(response));
+            String code = obj.getString("code");
+            if ("1".equals(code)) {
+                JSONObject data = obj.getJSONObject("data");
+                pcursor = data.getString("pcursor");
+                JSONArray orderView = data.getJSONArray("orderView");
+
+                for (int i = 0; i < orderView.size(); i++) {
+                    JSONObject info = orderView.getJSONObject(i);
+                    KuaishouSupplyChain supplyChain = new KuaishouSupplyChain(info, "1");
+
+                    String ownership = null;
+                    Criteria criteria = new Criteria();
+                    criteria = Criteria.where("_id").is(supplyChain.getItemId());
+                    Query query = new Query(criteria);
+                    ItemCheck itemCheck = mongoTemplate.findOne(query, ItemCheck.class);
+                    if (!Check.isNull(itemCheck)) {
+                        ownership = itemCheck.getOwnership();
+                    }
+                    //TODO 放开下面代码
+                  /*  if (Check.isNull(ownership) || "ruixuan".equals(ownership)) {
+                        ruixuanList.add(supplyChain);
+                    }
+                    if ("miaogousi".equals(ownership)) {
+                        mgsList.add(supplyChain);
+                    }*/
+                    if ("rocket".equals(ownership)) {
+                        rocketList.add(supplyChain);
+                    }
+                    /*if ("yufu".equals(ownership)) {
+                        yufuList.add(supplyChain);
+                    }
+                    if ("yuxiu".equals(ownership)) {
+                        yuxiuList.add(supplyChain);
+                    }
+                    if ("zhishui".equals(ownership)) {
+                        zhishuiList.add(supplyChain);
+                    }*/
+                }
+            } else {
+                log.error("===查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("msg"));
+                log.error("游标:{},执行次数:{}", pcursor, counts);
+                if (counts <= 3) {
+                    insertRuixuanOrderList(queryType, accessToken, beginTime, endTime, url, pcursor, counts + 1);
+                }
+            }
+            if (!Check.isNull(ruixuanList)) {
+                supplyChainMapper.replaceBatchOrder("ruixuan", ruixuanList); //TODO 测试完 修改该方法数据表
+            }
+            if (!Check.isNull(mgsList)) {
+                supplyChainMapper.replaceBatchOrder("miaogousi", mgsList);
+            }
+            if (!Check.isNull(rocketList)) {
+                supplyChainMapper.replaceBatchOrder("rocket", rocketList);
+            }
+            if (!Check.isNull(yufuList)) {
+                supplyChainMapper.replaceBatchOrder("yufu", yufuList);
+            }
+            if (!Check.isNull(yuxiuList)) {
+                supplyChainMapper.replaceBatchOrder("yuxiu", yuxiuList);
+            }
+            if (!Check.isNull(zhishuiList)) {
+                supplyChainMapper.replaceBatchOrder("zhishui", zhishuiList);
+            }
+            if (!"nomore".equals(pcursor)) {
+                insertRuixuanOrderList(queryType, accessToken, beginTime, endTime, url, pcursor, 1);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
     private void getInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
         List<Long> ruixuanList = new ArrayList<>();
         List<Long> mgsList = new ArrayList<>();

+ 103 - 1
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -4141,7 +4141,7 @@
         where item_id = #{itemId}
     </update>
 
-    <insert id="rinsertOne">
+    <insert id="replaceOne">
         replace into
         <choose>
             <when test='ownership == null '>
@@ -4240,4 +4240,106 @@
         )
     </insert>
 
+
+    <insert id="replaceBatchOrder">
+        replace into
+        <choose>
+            <when test='ownership == null '>
+                ruixuan.kuaishou_supply_chain_ceshi
+            </when>
+            <otherwise>
+                ${ownership}.kuaishou_supply_chain_ceshi
+            </otherwise>
+        </choose>
+        (
+        regimental_id,
+        oid,
+        item_id,
+        item_title,
+        reserve_price,
+        image_url,
+        order_status,
+        order_create_time,
+        send_status,
+        settlement_biz_type,
+        settlement_biz_type_desc,
+        send_time,
+        recv_time,
+        seller_id,
+        promoter_id,
+        promoter_nick_name,
+        activity_id,
+        order_amount,
+        pay_amount,
+        regimental_promotion_rate,
+        share_rate,
+        base_amount,
+        service_amount,
+        regimental_promotion_amount,
+        total_regimental_settle_amount,
+        stat_date,
+        stat_hour,
+        item_commission_rate,
+        second_activity_user_id,
+        second_activity_id,
+        seller_nick_name,
+        sku_id,
+        num,
+        expend_regimental_settle_amount,
+        expend_estimate_settle_amount,
+        expend_regimental_promotion_rate,
+        excitation_income,
+        service_income,
+        fund_type,
+        second_service_amount,
+        promoter_commission_rate
+        )
+        values
+        <foreach collection="supplyChainList" item="supplyChain" separator=",">
+            (
+            #{supplyChain.regimentalId},
+            #{supplyChain.oid},
+            #{supplyChain.itemId},
+            #{supplyChain.itemTitle},
+            #{supplyChain.reservePrice},
+            #{supplyChain.imageUrl},
+            #{supplyChain.orderStatus},
+            #{supplyChain.orderCreateTime},
+            #{supplyChain.sendStatus},
+            #{supplyChain.settlementBizType},
+            #{supplyChain.settlementBizTypeDesc},
+            #{supplyChain.sendTime},
+            #{supplyChain.recvTime},
+            #{supplyChain.sellerId},
+            #{supplyChain.promoterId},
+            #{supplyChain.promoterNickName},
+            #{supplyChain.activityId},
+            #{supplyChain.orderAmount},
+            #{supplyChain.payAmount},
+            #{supplyChain.regimentalPromotionRate},
+            #{supplyChain.shareRate},
+            #{supplyChain.baseAmount},
+            #{supplyChain.serviceAmount},
+            #{supplyChain.regimentalPromotionAmount},
+            #{supplyChain.totalRegimentalSettleAmount},
+            #{supplyChain.statDate},
+            #{supplyChain.statHour},
+            #{supplyChain.itemCommissionRate},
+            #{supplyChain.secondActivityUserId},
+            #{supplyChain.secondActivityId},
+            #{supplyChain.sellerNickName},
+            #{supplyChain.skuId},
+            #{supplyChain.num},
+            #{supplyChain.expendRegimentalSettleAmount},
+            #{supplyChain.expendEstimateSettleAmount},
+            #{supplyChain.expendRegimentalPromotionRate},
+            #{supplyChain.excitationIncome},
+            #{supplyChain.serviceIncome},
+            #{supplyChain.fundType},
+            #{supplyChain.secondServiceAmount},
+            #{supplyChain.promoterCommissionRate}
+            )
+        </foreach>
+    </insert>
+
 </mapper>