소스 검색

Merge branch 'bly_store' of http://1.14.104.71:10880/root/ylrz_his_scrm_java into bly_store

# Conflicts:
#	fs-service/src/main/resources/application-config-bly.yml
15376779826 3 주 전
부모
커밋
b789fff9bd
41개의 변경된 파일9053개의 추가작업 그리고 128개의 파일을 삭제
  1. 0 2
      fs-admin/src/main/java/com/fs/his/task/WatchCourseTask.java
  2. 0 2
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreHealthOrderScrmController.java
  3. 0 2
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderPromotionScrmController.java
  4. 36 38
      fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java
  5. 38 37
      fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java
  6. 81 3
      fs-company/src/main/java/com/fs/company/controller/common/CommonController.java
  7. 1 2
      fs-company/src/main/java/com/fs/company/controller/common/Test.java
  8. 0 2
      fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java
  9. 1 1
      fs-quartz/src/main/java/com/fs/quartz/config/ScheduleConfig.java
  10. 3 0
      fs-service/src/main/java/com/fs/erp/domain/ErpOrderQuery.java
  11. 1 1
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdian/api/WdtClient.java
  12. 16 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/Client.java
  13. 48 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/Pager.java
  14. 18 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/WdtErpException.java
  15. 35 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/WdtTradeAPI.java
  16. 29 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/ErrorInfo.java
  17. 1410 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelf2Request.java
  18. 57 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelf2Response.java
  19. 967 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelfRequest.java
  20. 34 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelfResponse.java
  21. 393 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/QuerySelfOrderDetailRequest.java
  22. 2947 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/QuerySelfOrderDetailResponse.java
  23. 550 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/RawRefundUpload2Request.java
  24. 60 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/RawRefundUpload2Response.java
  25. 74 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/StockSearch2Request.java
  26. 700 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/StockSearch2Response.java
  27. 17 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/Api.java
  28. 55 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/ApiFactory.java
  29. 50 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/ExApiFactory.java
  30. 349 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/WdtTwoClient.java
  31. 24 0
      fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/utils/HandUtils.java
  32. 161 0
      fs-service/src/main/java/com/fs/erp/service/impl/WdtTwoErpGoodsServiceImpl.java
  33. 848 0
      fs-service/src/main/java/com/fs/erp/service/impl/WdtTwoErpOrderServiceImpl.java
  34. 7 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java
  35. 6 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreCartScrmServiceImpl.java
  36. 37 28
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  37. 0 2
      fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreOrderScrmController.java
  38. 0 2
      fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java
  39. 0 2
      fs-user-app/src/main/java/com/fs/app/controller/store/PayScrmController.java
  40. 0 2
      fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java
  41. 0 2
      fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

+ 0 - 2
fs-admin/src/main/java/com/fs/his/task/WatchCourseTask.java

@@ -15,8 +15,6 @@ import org.springframework.stereotype.Component;
 @Component("storeTask")
 public class WatchCourseTask
 {
-    @Autowired
-    IErpOrderService erpOrderService;
 
     @Autowired
     private IFsUserWatchCourseStatisticsService fsUserWatchCourseStatisticsService;

+ 0 - 2
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreHealthOrderScrmController.java

@@ -44,8 +44,6 @@ public class FsStoreHealthOrderScrmController extends BaseController {
     @Autowired
     private IFsStoreOrderStatusScrmService orderStatusService;
 
-    @Autowired
-    IErpOrderService erpOrderService;
     @Autowired
     IFsStorePaymentScrmService paymentService;
 

+ 0 - 2
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderPromotionScrmController.java

@@ -47,8 +47,6 @@ public class FsStoreOrderPromotionScrmController extends BaseController {
     @Autowired
     private IFsStoreOrderStatusScrmService orderStatusService;
 
-    @Autowired
-    IErpOrderService erpOrderService;
     @Autowired
     IFsStorePaymentScrmService paymentService;
 

+ 36 - 38
fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java

@@ -21,8 +21,6 @@ public class ErpTask {
 
     @Autowired
     private FsErpFinishPushMapper fsErpFinishPushMapper;
-    @Autowired
-    private IErpOrderService erpOrderService;
 
     @Autowired
     private IFsStoreOrderScrmService fsStoreOrderService;
@@ -31,41 +29,41 @@ public class ErpTask {
     /**
      * 推送完成订单到ERP
      */
-    public void pushFinishOrderToErp(){
-        List<FsErpFinishPush> fsErpFinishPushes = fsErpFinishPushMapper.queryPenddingOrder();
-        for (FsErpFinishPush fsErpFinishPush : fsErpFinishPushes) {
-            FsStoreOrderScrm fsStoreOrder = fsStoreOrderService.selectFsStoreOrderById(fsErpFinishPush.getOrderId());
-
-            try {
-
-                ErpOrder erpOrder = fsStoreOrderService.getErpOrder(fsStoreOrder);
-
-                ErpOrderResponse erpOrderResponse = erpOrderService.finishOrder(erpOrder);
-
-                fsErpFinishPush.setParams(erpOrderResponse.getRequestRawData());
-                fsErpFinishPush.setResult(erpOrderResponse.getResponseRawData());
-                fsErpFinishPush.setUpdateTime(new Date());
-
-                if(erpOrderResponse.getSuccess()!= null && erpOrderResponse.getSuccess()){
-                    fsErpFinishPush.setTaskStatus(1);
-
-                    log.error("推送完成订单到ERP成功! 订单号: {}",fsErpFinishPush.getOrderId());
-                } else {
-                    fsErpFinishPush.setTaskStatus(2);
-                    fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
-                    log.error("推送完成订单到ERP失败! 订单号: {}",fsErpFinishPush.getOrderId());
-                }
-            } catch (Throwable e) {
-                fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
-                fsErpFinishPush.setErrorMessage(ExceptionUtils.getStackTrace(e));
-                fsErpFinishPush.setTaskStatus(2);
-                log.error("订单推送失败!原因: {}", ExceptionUtils.getStackTrace(e),e);
-            }
-
-
-            fsErpFinishPushMapper.updateById(fsErpFinishPush);
-        }
-
-    }
+//    public void pushFinishOrderToErp(){
+//        List<FsErpFinishPush> fsErpFinishPushes = fsErpFinishPushMapper.queryPenddingOrder();
+//        for (FsErpFinishPush fsErpFinishPush : fsErpFinishPushes) {
+//            FsStoreOrderScrm fsStoreOrder = fsStoreOrderService.selectFsStoreOrderById(fsErpFinishPush.getOrderId());
+//
+//            try {
+//
+//                ErpOrder erpOrder = fsStoreOrderService.getErpOrder(fsStoreOrder);
+//
+//                ErpOrderResponse erpOrderResponse = erpOrderService.finishOrder(erpOrder);
+//
+//                fsErpFinishPush.setParams(erpOrderResponse.getRequestRawData());
+//                fsErpFinishPush.setResult(erpOrderResponse.getResponseRawData());
+//                fsErpFinishPush.setUpdateTime(new Date());
+//
+//                if(erpOrderResponse.getSuccess()!= null && erpOrderResponse.getSuccess()){
+//                    fsErpFinishPush.setTaskStatus(1);
+//
+//                    log.error("推送完成订单到ERP成功! 订单号: {}",fsErpFinishPush.getOrderId());
+//                } else {
+//                    fsErpFinishPush.setTaskStatus(2);
+//                    fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
+//                    log.error("推送完成订单到ERP失败! 订单号: {}",fsErpFinishPush.getOrderId());
+//                }
+//            } catch (Throwable e) {
+//                fsErpFinishPush.setRetryCount(fsErpFinishPush.getRetryCount()+1);
+//                fsErpFinishPush.setErrorMessage(ExceptionUtils.getStackTrace(e));
+//                fsErpFinishPush.setTaskStatus(2);
+//                log.error("订单推送失败!原因: {}", ExceptionUtils.getStackTrace(e),e);
+//            }
+//
+//
+//            fsErpFinishPushMapper.updateById(fsErpFinishPush);
+//        }
+//
+//    }
 
 }

+ 38 - 37
fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java

@@ -87,9 +87,6 @@ public class MallStoreTask
     @Autowired
     private FsStorePaymentScrmMapper fsStorePaymentMapper;
 
-
-    @Autowired
-    private IErpGoodsService erpGoodsService;
     @Autowired
     private ISysConfigService configService;
     @Autowired
@@ -119,6 +116,10 @@ public class MallStoreTask
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
 
+    @Autowired
+    @Qualifier("wdtTwoErpOrderServiceImpl")
+    private IErpOrderService wdtTwoOrderService;
+
     @Autowired
     @Qualifier("hzOMSErpOrderServiceImpl")
     private IErpOrderService hzOMSOrderService;
@@ -142,8 +143,6 @@ public class MallStoreTask
     private FsCourseRedPacketLogMapper fsCourseRedPacketLogMapper;
 
 
-    @Autowired
-    IErpOrderService erpOrderService;
 
     //@Autowired
     //private IFsUserWatchCourseStatisticsService fsUserWatchCourseStatisticsService;
@@ -238,38 +237,38 @@ public class MallStoreTask
     }
 
 
-    public void storeProdUpdateCostPrice()
-    {
-        String json=configService.selectConfigByKey("store.config");
-        StoreConfig config=JSONUtil.toBean(json,StoreConfig.class);
-
-        List<FsStoreProductAttrValueScrm> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(new FsStoreProductAttrValueScrm());
-        for (FsStoreProductAttrValueScrm value : values) {
-            ErpGoodsQueryRequert query = new ErpGoodsQueryRequert();
-            query.setCode(value.getBarCode());
-            ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query);
-            List<ErpGoods> items = goods.getItems();
-
-            if (items!=null&&items.size()>0){
-                ErpGoods erpGoods = items.get(0);
-                BigDecimal salesPrice = erpGoods.getSales_price();
-                if (salesPrice!=null&&salesPrice.compareTo(BigDecimal.ZERO) != 0){
-                    BigDecimal divide = salesPrice.multiply(new BigDecimal(config.getSalesPriceRate())).divide(new BigDecimal("100"));
-                    System.out.println("代理价格"+divide);
-                    System.out.println("成本价"+salesPrice);
-                    FsStoreProductAttrValueScrm va = new FsStoreProductAttrValueScrm();
-                    va.setCost(salesPrice);
-                    va.setAgentPrice(divide);
-                    va.setId(value.getId());
-                    fsStoreProductAttrValueMapper.updateFsStoreProductAttrValue(va);
-                }
-            }
-            System.out.println(goods);
-        }
-
-
-
-    }
+//    public void storeProdUpdateCostPrice()
+//    {
+//        String json=configService.selectConfigByKey("store.config");
+//        StoreConfig config=JSONUtil.toBean(json,StoreConfig.class);
+//
+//        List<FsStoreProductAttrValueScrm> values = fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueList(new FsStoreProductAttrValueScrm());
+//        for (FsStoreProductAttrValueScrm value : values) {
+//            ErpGoodsQueryRequert query = new ErpGoodsQueryRequert();
+//            query.setCode(value.getBarCode());
+//            ErpGoodsQueryResponse goods = erpGoodsService.getGoods(query);
+//            List<ErpGoods> items = goods.getItems();
+//
+//            if (items!=null&&items.size()>0){
+//                ErpGoods erpGoods = items.get(0);
+//                BigDecimal salesPrice = erpGoods.getSales_price();
+//                if (salesPrice!=null&&salesPrice.compareTo(BigDecimal.ZERO) != 0){
+//                    BigDecimal divide = salesPrice.multiply(new BigDecimal(config.getSalesPriceRate())).divide(new BigDecimal("100"));
+//                    System.out.println("代理价格"+divide);
+//                    System.out.println("成本价"+salesPrice);
+//                    FsStoreProductAttrValueScrm va = new FsStoreProductAttrValueScrm();
+//                    va.setCost(salesPrice);
+//                    va.setAgentPrice(divide);
+//                    va.setId(value.getId());
+//                    fsStoreProductAttrValueMapper.updateFsStoreProductAttrValue(va);
+//                }
+//            }
+//            System.out.println(goods);
+//        }
+//
+//
+//
+//    }
     public void couponOp()
     {
         couponUserService.updateFsCouponByExpire();
@@ -493,6 +492,8 @@ public class MallStoreTask
                     erpOrderService = jSTOrderService;
                 }else if (erpType == 6) {
                     erpOrderService = k9OrderService;
+                }else if (erpType == 7) {
+                    erpOrderService = wdtTwoOrderService;
                 }
             }
         }

+ 81 - 3
fs-company/src/main/java/com/fs/company/controller/common/CommonController.java

@@ -12,12 +12,25 @@ import com.fs.common.utils.file.FileUploadUtils;
 import com.fs.common.utils.file.FileUtils;
 import com.fs.company.utils.AudioUtils;
 import com.fs.company.vo.WangUploadVO;
+import com.fs.erp.domain.ErpDeliverys;
+import com.fs.erp.domain.ErpOrderQuery;
+import com.fs.erp.dto.ErpGoodsStockQueryRequert;
+import com.fs.erp.dto.ErpGoodsStockQueryResponse;
+import com.fs.erp.dto.ErpOrderQueryRequert;
+import com.fs.erp.dto.ErpOrderQueryResponse;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.erp.service.impl.WdtTwoErpGoodsServiceImpl;
 import com.fs.framework.config.ServerConfig;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.service.TokenService;
+import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.FsExportTask;
 import com.fs.his.dto.InquiryConfigDTO;
 import com.fs.his.service.IFsExportTaskService;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.im.dto.OpenImResponseDTO;
 import com.fs.im.service.OpenIMService;
 import com.fs.qw.service.IQwWorkTaskService;
@@ -28,6 +41,7 @@ import com.fs.system.service.ISysConfigService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -42,6 +56,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
+
 /**
  * 通用请求处理
  *
@@ -61,6 +77,12 @@ public class CommonController
     @Autowired
     private QwApiService qwApiService;
 
+    @Autowired
+    private FsStoreOrderScrmMapper fsStoreOrderMapper;
+
+    @Autowired
+    private IFsStoreOrderScrmService orderService;
+
 
     @Autowired
     private ISysConfigService configService;
@@ -68,6 +90,13 @@ public class CommonController
     @Autowired
     private OpenIMService openIMService;
 
+    @Autowired
+    private ConfigUtil configUtil;
+
+    @Autowired
+    @Qualifier("wdtTwoErpOrderServiceImpl")
+    private IErpOrderService wdtTwoOrderService;
+
     @Autowired
     private TokenService tokenService;
 //    @Autowired
@@ -81,15 +110,64 @@ public class CommonController
     @Autowired
     private IQwWorkTaskService qwWorkTaskService;
 
-    @PostMapping("common/test")
-    public R test() throws Exception
+    @Autowired
+    private WdtTwoErpGoodsServiceImpl wdtTwoErpGoodsService;
+
+    @GetMapping("common/test")
+    public R test(String barcode) throws Exception
     {
-        qwWorkTaskService.delQwWorkTaskByOver();
+//        qwWorkTaskService.delQwWorkTaskByOver();
       //  qwWorkTaskService.addQwWorkByFirstCourse();
 //        qwWorkTaskService.addQwWorkByCourse();
 //        qwWorkTaskService.addQwWorkByConversionDay();
+        List<FsStoreOrderScrm> list = fsStoreOrderMapper.selectUpdateExpress();
+        for (FsStoreOrderScrm order : list){
+            if(!"2016767346466619392".equals(order.getExtendOrderId())){
+                continue;
+            }
+
+            ErpOrderQueryRequert request = new ErpOrderQueryRequert();
+            request.setCode(order.getExtendOrderId());
+            IErpOrderService erpOrderService = getErpOrderService();
+            ErpOrderQueryResponse response = erpOrderService.getOrder(request);
+            if(response.getOrders()!=null&&response.getOrders().size()>0){
+                for(ErpOrderQuery orderQuery : response.getOrders()){
+                    if(orderQuery.getDeliverys()!=null&&orderQuery.getDeliverys().size()>0){
+                        for(ErpDeliverys delivery:orderQuery.getDeliverys()){
+                            if(delivery.getDelivery()&& org.apache.commons.lang3.StringUtils.isNotEmpty(delivery.getMail_no())){
+                                //更新商订单状态 删除REDIS
+                                orderService.deliveryOrder(order.getOrderCode(),order.getExtendOrderId(),delivery.getMail_no(),delivery.getExpress_code(),delivery.getExpress_name());
+//                                redisCache.deleteObject(DELIVERY+":"+order.getExtendOrderId());
+                            }
+                        }
+
+                    }
+                }
+
+            }
+
+        }
+
+
       return R.ok();
     }
+
+    private IErpOrderService getErpOrderService(){
+        //判断是否开启erp
+        IErpOrderService erpOrderService = null;
+        FsSysConfig erpConfig = configUtil.getSysConfig();
+        Integer erpOpen = erpConfig.getErpOpen();
+        if (erpOpen != null && erpOpen == 1) {
+            //判断erp类型
+            Integer erpType = erpConfig.getErpType();
+            if (erpType != null) {
+                 if (erpType == 7) {
+                    erpOrderService = wdtTwoOrderService;
+                }
+            }
+        }
+        return erpOrderService;
+    }
     /**
      * 通用下载请求
      *

+ 1 - 2
fs-company/src/main/java/com/fs/company/controller/common/Test.java

@@ -175,8 +175,7 @@ public class Test {
     @Autowired
     @Qualifier("k9OrderScrmServiceImpl")
     private IErpOrderService k9OrderService;
-    @Autowired
-    IErpOrderService erpOrderService;
+
     @GetMapping("test")
     public void fileDownload() {
         deliveryOpScrm();

+ 0 - 2
fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java

@@ -469,8 +469,6 @@ public class FsStoreOrderController extends BaseController
         }
         return R.ok().put("data",expressInfoDTO);
     }
-    @Autowired
-    IErpOrderService erpOrderService;
 
     @GetMapping("/getEroOrder/{extendOrderId}")
     public R getEroOrder(@PathVariable("extendOrderId") String extendOrderId) {

+ 1 - 1
fs-quartz/src/main/java/com/fs/quartz/config/ScheduleConfig.java

@@ -8,7 +8,7 @@ import java.util.Properties;
 
 /**
  * 定时任务配置
- * 
+ *
 
  */
 @Configuration

+ 3 - 0
fs-service/src/main/java/com/fs/erp/domain/ErpOrderQuery.java

@@ -28,6 +28,9 @@ public class ErpOrderQuery {
     String receiver_address;
     Integer delivery_state;
 
+    // 发货时间
+    Date consignTime;
+
 
 
     List<ErpDeliverys> deliverys;

+ 1 - 1
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdian/api/WdtClient.java

@@ -47,7 +47,7 @@ public class WdtClient {
 	private int readTimeout = 15000;//15秒
 
 
-	private WdtClient(){}
+	public WdtClient(){}
 
 
 	private static String getStringFromException(Throwable e) {

+ 16 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/Client.java

@@ -0,0 +1,16 @@
+package com.fs.erp.dto.sdk.wangdianTwo;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+
+public interface Client
+{
+	/**
+	 * 设置超时时间, 毫秒
+	 *
+	 * @return
+	 */
+	void setTimeout(int ms);
+
+	Object execute(String method, Object[] args, Pager pager, Type returnType) throws WdtErpException, IOException;
+}

+ 48 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/Pager.java

@@ -0,0 +1,48 @@
+package com.fs.erp.dto.sdk.wangdianTwo;
+
+public class Pager
+{
+	// 分页大小
+	private int pageSize = 0;
+	// 页码
+	private int pageNo = 0;
+	// 是否返回总页数
+	private boolean calcTotal = false;
+
+	public Pager(int pageSize, int pageNo, boolean calcTotal)
+	{
+		this.pageSize = pageSize;
+		this.pageNo = pageNo;
+		this.calcTotal = calcTotal;
+	}
+
+	public int getPageSize()
+	{
+		return pageSize;
+	}
+
+	public void setPageSize(int pageSize)
+	{
+		this.pageSize = pageSize;
+	}
+
+	public int getPageNo()
+	{
+		return pageNo;
+	}
+
+	public void setPageNo(int pageNo)
+	{
+		this.pageNo = pageNo;
+	}
+
+	public boolean isCalcTotal()
+	{
+		return calcTotal;
+	}
+
+	public void setCalcTotal(boolean calcTotal)
+	{
+		this.calcTotal = calcTotal;
+	}
+}

+ 18 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/WdtErpException.java

@@ -0,0 +1,18 @@
+package com.fs.erp.dto.sdk.wangdianTwo;
+
+@SuppressWarnings("serial")
+public class WdtErpException extends Exception
+{
+	private int code;
+
+	public WdtErpException(int code, String message)
+	{
+		super(message);
+		this.code = code;
+	}
+
+	public int getCode()
+	{
+		return code;
+	}
+}

+ 35 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/WdtTradeAPI.java

@@ -0,0 +1,35 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api;
+
+
+import com.fs.erp.dto.sdk.wangdianTwo.api.dto.*;
+import com.fs.erp.dto.sdk.wangdianTwo.impl.Api;
+import com.fs.erp.dto.sdk.wangdianTwo.Pager;
+
+import java.util.List;
+public interface WdtTradeAPI
+{
+	// blyjkcy3
+	// 原接口 trade_push.php  ??? ??
+	@Api(value = "sales.RawTrade.pushSelf2", paged = false)
+	PushSelf2Response pushSelf2(String shopNo, List<PushSelf2Request.RawTrade> rawTradeList,
+							  List<PushSelf2Request.RawTradeOrder> rawTradeOrderList, List<PushSelf2Request.DiscountInfo> rawTradeDiscountList);
+
+
+	// stock_query.php
+	@Api(value = "wms.StockSpec.search2", paged = true)
+	StockSearch2Response search2(StockSearch2Request request, Pager pager);
+
+	// sales_trade_query.php
+	@Api(value = "sales.TradeQuery.querySelfOrderWithDetail", paged = true)
+	QuerySelfOrderDetailResponse querySelfOrderWithDetail(QuerySelfOrderDetailRequest request, Pager pager);
+
+    // sales_refund_push.php
+	@Api(value = "aftersales.refund.RawRefund.upload2", paged = false)
+	RawRefundUpload2Response rawRefundUpload(String shopNo,List<RawRefundUpload2Request.RefundOrder> orderList);
+
+
+
+
+
+
+}

+ 29 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/ErrorInfo.java

@@ -0,0 +1,29 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+/**
+ * @description: xgb
+ * @author: Xgb
+ * @createDate: 2026/1/28
+ * @version: 1.0
+ */
+public class ErrorInfo {
+    private String no;
+
+    private String error;
+
+    public String getNo() {
+        return no;
+    }
+
+    public void setNo(String no) {
+        this.no = no;
+    }
+
+    public String getError() {
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+}

+ 1410 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelf2Request.java

@@ -0,0 +1,1410 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 订单同步接口请求参数实体类
+ */
+public class PushSelf2Request {
+
+    /**
+     * 店铺编号
+     */
+    @SerializedName("shop_no")
+    private String shopNo;
+
+    /**
+     * 原始单信息
+     */
+    private List<RawTrade> rawTrades;
+
+
+    private List<RawTradeOrder> RawTradeOrders;
+
+    private List<DiscountInfo> DiscountInfos;
+
+    // Getters and Setters
+    public String getShopNo() {
+        return shopNo;
+    }
+
+    public void setShopNo(String shopNo) {
+        this.shopNo = shopNo;
+    }
+
+    public List<RawTrade> getRawTrades() {
+        return rawTrades;
+    }
+
+    public void setRawTrades(List<RawTrade> rawTrades) {
+        this.rawTrades = rawTrades;
+    }
+
+    public List<RawTradeOrder> getRawTradeOrders() {
+        return RawTradeOrders;
+    }
+
+    public void setRawTradeOrders(List<RawTradeOrder> rawTradeOrders) {
+        RawTradeOrders = rawTradeOrders;
+    }
+
+    public List<DiscountInfo> getDiscountInfos() {
+        return DiscountInfos;
+    }
+
+    public void setDiscountInfos(List<DiscountInfo> discountInfos) {
+        DiscountInfos = discountInfos;
+    }
+
+    /**
+     * 原始单信息实体类
+     */
+    public static class RawTrade {
+
+        /**
+         * 原始单号(商城、官网等平台的订单编号)
+         */
+        @SerializedName("tid")
+        private String tid;
+
+        /**
+         * 处理状态
+         * 10: 待递交, 20: 已递交,30: 部分发货,40: 已发货,60: 已完成,70: 已取消
+         */
+        @SerializedName("process_status")
+        private Integer processStatus;
+
+        /**
+         * 平台状态
+         * 10未确认 20待尾款 30待发货 40部分发货 50已发货 60已签收 70已完成 80已退款 90已关闭
+         */
+        @SerializedName("trade_status")
+        private Integer tradeStatus;
+
+        /**
+         * 退款状态
+         * 0无退款 1申请退款 2部分退款 3全部退款
+         */
+        @SerializedName("refund_status")
+        private Integer refundStatus;
+
+        /**
+         * 付款状态
+         * 0未付款 1部分付款 2已付款
+         */
+        @SerializedName("pay_status")
+        private Integer payStatus;
+
+        /**
+         * 子订单个数
+         */
+        @SerializedName("order_count")
+        private Integer orderCount;
+
+        /**
+         * 货品总数量
+         */
+        @SerializedName("goods_count")
+        private BigDecimal goodsCount;
+
+        /**
+         * 支付方式
+         * 1在线转帐 2现金,3银行转账,4邮局汇款 5预付款 6刷卡 7支付宝 8微信支付
+         */
+        @SerializedName("pay_method")
+        private Integer payMethod;
+
+        /**
+         * 下单时间
+         */
+        @SerializedName("trade_time")
+        private String tradeTime;
+
+        /**
+         * 支付时间
+         */
+        @SerializedName("pay_time")
+        private String payTime;
+
+        /**
+         * 交易结束时间
+         */
+        @SerializedName("end_time")
+        private String endTime;
+
+        /**
+         * 买家昵称/客户网名
+         */
+        @SerializedName("buyer_nick")
+        private String buyerNick;
+
+        /**
+         * 买家备注
+         */
+        @SerializedName("buyer_message")
+        private String buyerMessage;
+
+        /**
+         * 买家邮箱
+         */
+        @SerializedName("buyer_email")
+        private String buyerEmail;
+
+        /**
+         * 买家地区
+         */
+        @SerializedName("buyer_area")
+        private String buyerArea;
+
+        /**
+         * 收件人姓名
+         */
+        @SerializedName("receiver_name")
+        private String receiverName;
+
+        /**
+         * 省市区(空格分隔,示例:北京 北京市 朝阳区)
+         */
+        @SerializedName("receiver_area")
+        private String receiverArea;
+
+        /**
+         * 地址(不包含省市区,示例:xx街道xx小区xx号楼101)
+         */
+        @SerializedName("receiver_address")
+        private String receiverAddress;
+
+        /**
+         * 收件人邮编
+         */
+        @SerializedName("receiver_zip")
+        private String receiverZip;
+
+        /**
+         * 收件人手机号(11位手机号码)
+         */
+        @SerializedName("receiver_mobile")
+        private String receiverMobile;
+
+        /**
+         * 收件人固话号(11位固话号码)
+         */
+        @SerializedName("receiver_telno")
+        private String receiverTelno;
+
+        /**
+         * 邮费
+         */
+        @SerializedName("post_amount")
+        private BigDecimal postAmount;
+
+        /**
+         * 其他费用
+         */
+        @SerializedName("other_amount")
+        private BigDecimal otherAmount;
+
+        /**
+         * 优惠金额
+         */
+        @SerializedName("discount")
+        private BigDecimal discount;
+
+        /**
+         * 应收金额(售前退款会变化)
+         */
+        @SerializedName("receivable")
+        private BigDecimal receivable;
+
+        /**
+         * 平台费用
+         */
+        @SerializedName("platform_cost")
+        private BigDecimal platformCost;
+
+        /**
+         * 发票类别
+         * 0:不需要 1:普通发票 2:增值税普通发票 3:增值税专用发票
+         */
+        @SerializedName("invoice_type")
+        private Integer invoiceType;
+
+        /**
+         * 发票抬头
+         */
+        @SerializedName("invoice_title")
+        private String invoiceTitle;
+
+        /**
+         * 发票内容
+         * 格式:纳税人识别号:*******;地址:*******;开户银行:*******;银行账号:******;联系电话:*****,电子邮箱*****
+         */
+        @SerializedName("invoice_content")
+        private String invoiceContent;
+
+        /**
+         * 物流类别
+         */
+        @SerializedName("logistics_type")
+        private Integer logisticsType;
+
+        /**
+         * 物流编号(系统物流编号)
+         */
+        @SerializedName("cust_data")
+        private String custData;
+
+        /**
+         * 发货条件
+         * 1款到发货 2货到付款(包含部分货到付款) 3分期付款
+         */
+        @SerializedName("delivery_term")
+        private Integer deliveryTerm;
+
+        /**
+         * 平台支付订单ID
+         */
+        @SerializedName("pay_id")
+        private String payId;
+
+        /**
+         * 客服备注
+         */
+        @SerializedName("remark")
+        private String remark;
+
+        /**
+         * 客服备注标记
+         * 标旗(1 红、2 黄、3 绿、4 蓝、5 紫 无则填0)
+         */
+        @SerializedName("remark_flag")
+        private Integer remarkFlag;
+
+        /**
+         * 货到付款金额(若delivery_term=2,则为应付金额,否则为0)
+         */
+        @SerializedName("cod_amount")
+        private BigDecimal codAmount;
+
+        /**
+         * 是否是自流转
+         * true自流转,false 非自流转
+         */
+        @SerializedName("is_auto_wms")
+        private Boolean isAutoWms;
+
+        /**
+         * 仓库编号(仅自流转订单填写该仓库编号, 非自流转订单传入空字符串即可)
+         */
+        @SerializedName("warehouse_no")
+        private String warehouseNo;
+
+        /**
+         * 买家支付宝帐号
+         */
+        @SerializedName("pay_account")
+        private String payAccount;
+
+        /**
+         * 买家要求的送货日期
+         */
+        @SerializedName("to_deliver_time")
+        private String toDeliverTime;
+
+        /**
+         * 已收金额(已从平台收款的金额)
+         */
+        @SerializedName("received")
+        private BigDecimal received;
+
+        /**
+         * 淘宝新增,物流到货时效,单位小时
+         */
+        @SerializedName("consign_interval")
+        private Integer consignInterval;
+
+        /**
+         * 已付金额
+         */
+        @SerializedName("paid")
+        private BigDecimal paid;
+
+        /**
+         * 是否能合并订单
+         * 0:默认 3:不允许合并
+         */
+        @SerializedName("is_sealed")
+        private Byte isSealed;
+
+        /**
+         * 分销商名称
+         */
+        @SerializedName("fenxiao_nick")
+        private String fenxiaoNick;
+
+        /**
+         * 证件类型
+         * 0:无 1:身份证 2:军官证 3:护照
+         */
+        @SerializedName("id_card_type")
+        private Integer idCardType;
+
+        /**
+         * 证件号
+         */
+        @SerializedName("id_card")
+        private String idCard;
+
+        /**
+         * 省份id
+         */
+        @SerializedName("receiver_province_no")
+        private Integer receiverProvinceNo;
+
+        /**
+         * 市id
+         */
+        @SerializedName("receiver_city_no")
+        private Integer receiverCityNo;
+
+        /**
+         * 区id
+         */
+        @SerializedName("receiver_district_no")
+        private Integer receiverDistrictNo;
+
+        // Getters and Setters
+        public String getTid() {
+            return tid;
+        }
+
+        public void setTid(String tid) {
+            this.tid = tid;
+        }
+
+        public Integer getProcessStatus() {
+            return processStatus;
+        }
+
+        public void setProcessStatus(Integer processStatus) {
+            this.processStatus = processStatus;
+        }
+
+        public Integer getTradeStatus() {
+            return tradeStatus;
+        }
+
+        public void setTradeStatus(Integer tradeStatus) {
+            this.tradeStatus = tradeStatus;
+        }
+
+        public Integer getRefundStatus() {
+            return refundStatus;
+        }
+
+        public void setRefundStatus(Integer refundStatus) {
+            this.refundStatus = refundStatus;
+        }
+
+        public Integer getPayStatus() {
+            return payStatus;
+        }
+
+        public void setPayStatus(Integer payStatus) {
+            this.payStatus = payStatus;
+        }
+
+        public Integer getOrderCount() {
+            return orderCount;
+        }
+
+        public void setOrderCount(Integer orderCount) {
+            this.orderCount = orderCount;
+        }
+
+        public BigDecimal getGoodsCount() {
+            return goodsCount;
+        }
+
+        public void setGoodsCount(BigDecimal goodsCount) {
+            this.goodsCount = goodsCount;
+        }
+
+        public Integer getPayMethod() {
+            return payMethod;
+        }
+
+        public void setPayMethod(Integer payMethod) {
+            this.payMethod = payMethod;
+        }
+
+        public String getTradeTime() {
+            return tradeTime;
+        }
+
+        public void setTradeTime(String tradeTime) {
+            this.tradeTime = tradeTime;
+        }
+
+        public String getPayTime() {
+            return payTime;
+        }
+
+        public void setPayTime(String payTime) {
+            this.payTime = payTime;
+        }
+
+        public String getEndTime() {
+            return endTime;
+        }
+
+        public void setEndTime(String endTime) {
+            this.endTime = endTime;
+        }
+
+        public String getBuyerNick() {
+            return buyerNick;
+        }
+
+        public void setBuyerNick(String buyerNick) {
+            this.buyerNick = buyerNick;
+        }
+
+        public String getBuyerMessage() {
+            return buyerMessage;
+        }
+
+        public void setBuyerMessage(String buyerMessage) {
+            this.buyerMessage = buyerMessage;
+        }
+
+        public String getBuyerEmail() {
+            return buyerEmail;
+        }
+
+        public void setBuyerEmail(String buyerEmail) {
+            this.buyerEmail = buyerEmail;
+        }
+
+        public String getBuyerArea() {
+            return buyerArea;
+        }
+
+        public void setBuyerArea(String buyerArea) {
+            this.buyerArea = buyerArea;
+        }
+
+        public String getReceiverName() {
+            return receiverName;
+        }
+
+        public void setReceiverName(String receiverName) {
+            this.receiverName = receiverName;
+        }
+
+        public String getReceiverArea() {
+            return receiverArea;
+        }
+
+        public void setReceiverArea(String receiverArea) {
+            this.receiverArea = receiverArea;
+        }
+
+        public String getReceiverAddress() {
+            return receiverAddress;
+        }
+
+        public void setReceiverAddress(String receiverAddress) {
+            this.receiverAddress = receiverAddress;
+        }
+
+        public String getReceiverZip() {
+            return receiverZip;
+        }
+
+        public void setReceiverZip(String receiverZip) {
+            this.receiverZip = receiverZip;
+        }
+
+        public String getReceiverMobile() {
+            return receiverMobile;
+        }
+
+        public void setReceiverMobile(String receiverMobile) {
+            this.receiverMobile = receiverMobile;
+        }
+
+        public String getReceiverTelno() {
+            return receiverTelno;
+        }
+
+        public void setReceiverTelno(String receiverTelno) {
+            this.receiverTelno = receiverTelno;
+        }
+
+        public BigDecimal getPostAmount() {
+            return postAmount;
+        }
+
+        public void setPostAmount(BigDecimal postAmount) {
+            this.postAmount = postAmount;
+        }
+
+        public BigDecimal getOtherAmount() {
+            return otherAmount;
+        }
+
+        public void setOtherAmount(BigDecimal otherAmount) {
+            this.otherAmount = otherAmount;
+        }
+
+        public BigDecimal getDiscount() {
+            return discount;
+        }
+
+        public void setDiscount(BigDecimal discount) {
+            this.discount = discount;
+        }
+
+        public BigDecimal getReceivable() {
+            return receivable;
+        }
+
+        public void setReceivable(BigDecimal receivable) {
+            this.receivable = receivable;
+        }
+
+        public BigDecimal getPlatformCost() {
+            return platformCost;
+        }
+
+        public void setPlatformCost(BigDecimal platformCost) {
+            this.platformCost = platformCost;
+        }
+
+        public Integer getInvoiceType() {
+            return invoiceType;
+        }
+
+        public void setInvoiceType(Integer invoiceType) {
+            this.invoiceType = invoiceType;
+        }
+
+        public String getInvoiceTitle() {
+            return invoiceTitle;
+        }
+
+        public void setInvoiceTitle(String invoiceTitle) {
+            this.invoiceTitle = invoiceTitle;
+        }
+
+        public String getInvoiceContent() {
+            return invoiceContent;
+        }
+
+        public void setInvoiceContent(String invoiceContent) {
+            this.invoiceContent = invoiceContent;
+        }
+
+        public Integer getLogisticsType() {
+            return logisticsType;
+        }
+
+        public void setLogisticsType(Integer logisticsType) {
+            this.logisticsType = logisticsType;
+        }
+
+        public String getCustData() {
+            return custData;
+        }
+
+        public void setCustData(String custData) {
+            this.custData = custData;
+        }
+
+        public Integer getDeliveryTerm() {
+            return deliveryTerm;
+        }
+
+        public void setDeliveryTerm(Integer deliveryTerm) {
+            this.deliveryTerm = deliveryTerm;
+        }
+
+        public String getPayId() {
+            return payId;
+        }
+
+        public void setPayId(String payId) {
+            this.payId = payId;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public Integer getRemarkFlag() {
+            return remarkFlag;
+        }
+
+        public void setRemarkFlag(Integer remarkFlag) {
+            this.remarkFlag = remarkFlag;
+        }
+
+        public BigDecimal getCodAmount() {
+            return codAmount;
+        }
+
+        public void setCodAmount(BigDecimal codAmount) {
+            this.codAmount = codAmount;
+        }
+
+        public Boolean getIsAutoWms() {
+            return isAutoWms;
+        }
+
+        public void setIsAutoWms(Boolean isAutoWms) {
+            this.isAutoWms = isAutoWms;
+        }
+
+        public String getWarehouseNo() {
+            return warehouseNo;
+        }
+
+        public void setWarehouseNo(String warehouseNo) {
+            this.warehouseNo = warehouseNo;
+        }
+
+        public String getPayAccount() {
+            return payAccount;
+        }
+
+        public void setPayAccount(String payAccount) {
+            this.payAccount = payAccount;
+        }
+
+        public String getToDeliverTime() {
+            return toDeliverTime;
+        }
+
+        public void setToDeliverTime(String toDeliverTime) {
+            this.toDeliverTime = toDeliverTime;
+        }
+
+        public BigDecimal getReceived() {
+            return received;
+        }
+
+        public void setReceived(BigDecimal received) {
+            this.received = received;
+        }
+
+        public Integer getConsignInterval() {
+            return consignInterval;
+        }
+
+        public void setConsignInterval(Integer consignInterval) {
+            this.consignInterval = consignInterval;
+        }
+
+        public BigDecimal getPaid() {
+            return paid;
+        }
+
+        public void setPaid(BigDecimal paid) {
+            this.paid = paid;
+        }
+
+        public Byte getIsSealed() {
+            return isSealed;
+        }
+
+        public void setIsSealed(Byte isSealed) {
+            this.isSealed = isSealed;
+        }
+
+        public String getFenxiaoNick() {
+            return fenxiaoNick;
+        }
+
+        public void setFenxiaoNick(String fenxiaoNick) {
+            this.fenxiaoNick = fenxiaoNick;
+        }
+
+        public Integer getIdCardType() {
+            return idCardType;
+        }
+
+        public void setIdCardType(Integer idCardType) {
+            this.idCardType = idCardType;
+        }
+
+        public String getIdCard() {
+            return idCard;
+        }
+
+        public void setIdCard(String idCard) {
+            this.idCard = idCard;
+        }
+
+        public Integer getReceiverProvinceNo() {
+            return receiverProvinceNo;
+        }
+
+        public void setReceiverProvinceNo(Integer receiverProvinceNo) {
+            this.receiverProvinceNo = receiverProvinceNo;
+        }
+
+        public Integer getReceiverCityNo() {
+            return receiverCityNo;
+        }
+
+        public void setReceiverCityNo(Integer receiverCityNo) {
+            this.receiverCityNo = receiverCityNo;
+        }
+
+        public Integer getReceiverDistrictNo() {
+            return receiverDistrictNo;
+        }
+
+        public void setReceiverDistrictNo(Integer receiverDistrictNo) {
+            this.receiverDistrictNo = receiverDistrictNo;
+        }
+    }
+
+    /**
+     * 原始子单信息实体类
+     */
+    public static class RawTradeOrder {
+
+        /**
+         * 原始订单号
+         */
+        @SerializedName("tid")
+        private String tid;
+
+        /**
+         * 原始子单号(平台订单货品表主键,子订单唯一标识)
+         */
+        @SerializedName("oid")
+        private String oid;
+
+        /**
+         * 平台的状态
+         * 10未确认 20待尾款 30待发货 40部分发货 50已发货 60已签收 70已完成 80已退款 90已关闭
+         */
+        @SerializedName("status")
+        private Integer status;
+
+        /**
+         * 退款标记
+         * 0无退款1取消退款,2已申请退款,3等待退货,4等待收货,5退款成功,6未付款关闭
+         */
+        @SerializedName("refund_status")
+        private Integer refundStatus;
+
+        /**
+         * 平台货品ID(平台系统货品SPU的唯一标识)
+         */
+        @SerializedName("goods_id")
+        private String goodsId;
+
+        /**
+         * 平台规格ID(平台系统单品SKU的的唯一标识)
+         */
+        @SerializedName("spec_id")
+        private String specId;
+
+        /**
+         * 货品编号
+         */
+        @SerializedName("goods_no")
+        private String goodsNo;
+
+        /**
+         * 规格编码
+         */
+        @SerializedName("spec_no")
+        private String specNo;
+
+        /**
+         * 货品名称
+         */
+        @SerializedName("goods_name")
+        private String goodsName;
+
+        /**
+         * 规格名称
+         */
+        @SerializedName("spec_name")
+        private String specName;
+
+        /**
+         * 子单类型(0正常货品 1虚拟货品 2服务)
+         */
+        @SerializedName("order_type")
+        private Integer orderType;
+
+        /**
+         * 平台类目
+         */
+        @SerializedName("cid")
+        private String cid;
+
+        /**
+         * 数量
+         */
+        @SerializedName("num")
+        private BigDecimal num;
+
+        /**
+         * 单价
+         */
+        @SerializedName("price")
+        private BigDecimal price;
+
+        /**
+         * 优惠(平台折扣, 不包含手工调整和分摊优惠)
+         */
+        @SerializedName("discount")
+        private BigDecimal discount;
+
+        /**
+         * 分摊优惠(退款不变)
+         */
+        @SerializedName("share_discount")
+        private BigDecimal shareDiscount;
+
+        /**
+         * 总价格
+         */
+        @SerializedName("total_amount")
+        private BigDecimal totalAmount;
+
+        /**
+         * 手工调整的优惠金额
+         */
+        @SerializedName("adjust_amount")
+        private BigDecimal adjustAmount;
+
+        /**
+         * 退款金额
+         */
+        @SerializedName("refund_amount")
+        private BigDecimal refundAmount;
+
+        /**
+         * 备注
+         */
+        @SerializedName("remark")
+        private String remark;
+
+        /**
+         * json串,若无可传空字符串
+         */
+        @SerializedName("json")
+        private String json;
+
+        /**
+         * 赠品方式
+         * 0非赠品 1自动赠送 2手工赠送 4周期购赠送 8平台赠送 32阶梯满赠 64CRM追加赠送 65 主品
+         */
+        @SerializedName("gift_type")
+        private Integer giftType;
+
+        // Getters and Setters
+        public String getTid() {
+            return tid;
+        }
+
+        public void setTid(String tid) {
+            this.tid = tid;
+        }
+
+        public String getOid() {
+            return oid;
+        }
+
+        public void setOid(String oid) {
+            this.oid = oid;
+        }
+
+        public Integer getStatus() {
+            return status;
+        }
+
+        public void setStatus(Integer status) {
+            this.status = status;
+        }
+
+        public Integer getRefundStatus() {
+            return refundStatus;
+        }
+
+        public void setRefundStatus(Integer refundStatus) {
+            this.refundStatus = refundStatus;
+        }
+
+        public String getGoodsId() {
+            return goodsId;
+        }
+
+        public void setGoodsId(String goodsId) {
+            this.goodsId = goodsId;
+        }
+
+        public String getSpecId() {
+            return specId;
+        }
+
+        public void setSpecId(String specId) {
+            this.specId = specId;
+        }
+
+        public String getGoodsNo() {
+            return goodsNo;
+        }
+
+        public void setGoodsNo(String goodsNo) {
+            this.goodsNo = goodsNo;
+        }
+
+        public String getSpecNo() {
+            return specNo;
+        }
+
+        public void setSpecNo(String specNo) {
+            this.specNo = specNo;
+        }
+
+        public String getGoodsName() {
+            return goodsName;
+        }
+
+        public void setGoodsName(String goodsName) {
+            this.goodsName = goodsName;
+        }
+
+        public String getSpecName() {
+            return specName;
+        }
+
+        public void setSpecName(String specName) {
+            this.specName = specName;
+        }
+
+        public Integer getOrderType() {
+            return orderType;
+        }
+
+        public void setOrderType(Integer orderType) {
+            this.orderType = orderType;
+        }
+
+        public String getCid() {
+            return cid;
+        }
+
+        public void setCid(String cid) {
+            this.cid = cid;
+        }
+
+        public BigDecimal getNum() {
+            return num;
+        }
+
+        public void setNum(BigDecimal num) {
+            this.num = num;
+        }
+
+        public BigDecimal getPrice() {
+            return price;
+        }
+
+        public void setPrice(BigDecimal price) {
+            this.price = price;
+        }
+
+        public BigDecimal getDiscount() {
+            return discount;
+        }
+
+        public void setDiscount(BigDecimal discount) {
+            this.discount = discount;
+        }
+
+        public BigDecimal getShareDiscount() {
+            return shareDiscount;
+        }
+
+        public void setShareDiscount(BigDecimal shareDiscount) {
+            this.shareDiscount = shareDiscount;
+        }
+
+        public BigDecimal getTotalAmount() {
+            return totalAmount;
+        }
+
+        public void setTotalAmount(BigDecimal totalAmount) {
+            this.totalAmount = totalAmount;
+        }
+
+        public BigDecimal getAdjustAmount() {
+            return adjustAmount;
+        }
+
+        public void setAdjustAmount(BigDecimal adjustAmount) {
+            this.adjustAmount = adjustAmount;
+        }
+
+        public BigDecimal getRefundAmount() {
+            return refundAmount;
+        }
+
+        public void setRefundAmount(BigDecimal refundAmount) {
+            this.refundAmount = refundAmount;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public String getJson() {
+            return json;
+        }
+
+        public void setJson(String json) {
+            this.json = json;
+        }
+
+        public Integer getGiftType() {
+            return giftType;
+        }
+
+        public void setGiftType(Integer giftType) {
+            this.giftType = giftType;
+        }
+    }
+
+    /**
+     * 优惠信息实体类
+     * 平台,tid,oid,sn,type 联合组成唯一
+     */
+    public static class DiscountInfo {
+
+        /**
+         * 原始订单号
+         */
+        @SerializedName("tid")
+        private String tid;
+
+        /**
+         * 原始子单号
+         */
+        @SerializedName("oid")
+        private String oid;
+
+        /**
+         * 唯一编码(平台上优惠的唯一标识)
+         */
+        @SerializedName("sn")
+        private String sn;
+
+        /**
+         * 优惠名称
+         */
+        @SerializedName("name")
+        private String name;
+
+        /**
+         * 优惠详情
+         */
+        @SerializedName("detail")
+        private String detail;
+
+        /**
+         * 优惠金额
+         */
+        @SerializedName("amount")
+        private BigDecimal amount;
+
+        // Getters and Setters
+        public String getTid() {
+            return tid;
+        }
+
+        public void setTid(String tid) {
+            this.tid = tid;
+        }
+
+        public String getOid() {
+            return oid;
+        }
+
+        public void setOid(String oid) {
+            this.oid = oid;
+        }
+
+        public String getSn() {
+            return sn;
+        }
+
+        public void setSn(String sn) {
+            this.sn = sn;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getDetail() {
+            return detail;
+        }
+
+        public void setDetail(String detail) {
+            this.detail = detail;
+        }
+
+        public BigDecimal getAmount() {
+            return amount;
+        }
+
+        public void setAmount(BigDecimal amount) {
+            this.amount = amount;
+        }
+    }
+
+    /**
+     * 枚举类 - 处理状态
+     */
+    public enum ProcessStatus {
+        WAIT_TO_SUBMIT(10, "待递交"),
+        SUBMITTED(20, "已递交"),
+        PARTIAL_SHIPPED(30, "部分发货"),
+        SHIPPED(40, "已发货"),
+        COMPLETED(60, "已完成"),
+        CANCELED(70, "已取消");
+
+        private final Integer code;
+        private final String desc;
+
+        ProcessStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 平台状态
+     */
+    public enum TradeStatus {
+        UNCONFIRMED(10, "未确认"),
+        WAIT_FINAL_PAYMENT(20, "待尾款"),
+        WAIT_SHIPPING(30, "待发货"),
+        PARTIAL_SHIPPED(40, "部分发货"),
+        SHIPPED(50, "已发货"),
+        SIGNED(60, "已签收"),
+        COMPLETED(70, "已完成"),
+        REFUNDED(80, "已退款"),
+        CLOSED(90, "已关闭");
+
+        private final Integer code;
+        private final String desc;
+
+        TradeStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 退款状态
+     */
+    public enum RefundStatus {
+        NO_REFUND(0, "无退款"),
+        APPLY_REFUND(1, "申请退款"),
+        PARTIAL_REFUND(2, "部分退款"),
+        FULL_REFUND(3, "全部退款");
+
+        private final Integer code;
+        private final String desc;
+
+        RefundStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 支付状态
+     */
+    public enum PayStatus {
+        NOT_PAID(0, "未付款"),
+        PARTIAL_PAID(1, "部分付款"),
+        FULL_PAID(2, "已付款");
+
+        private final Integer code;
+        private final String desc;
+
+        PayStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 支付方式
+     */
+    public enum PayMethod {
+        ONLINE_TRANSFER(1, "在线转帐"),
+        CASH(2, "现金"),
+        BANK_TRANSFER(3, "银行转账"),
+        POSTAL_REMITTANCE(4, "邮局汇款"),
+        PREPAYMENT(5, "预付款"),
+        CARD_PAYMENT(6, "刷卡"),
+        ALIPAY(7, "支付宝"),
+        WECHAT_PAY(8, "微信支付");
+
+        private final Integer code;
+        private final String desc;
+
+        PayMethod(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 发货条件
+     */
+    public enum DeliveryTerm {
+        PAY_BEFORE_DELIVERY(1, "款到发货"),
+        CASH_ON_DELIVERY(2, "货到付款"),
+        INSTALLMENT(3, "分期付款");
+
+        private final Integer code;
+        private final String desc;
+
+        DeliveryTerm(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 发票类型
+     */
+    public enum InvoiceType {
+        NO_INVOICE(0, "不需要"),
+        GENERAL_INVOICE(1, "普通发票"),
+        VAT_GENERAL_INVOICE(2, "增值税普通发票"),
+        VAT_SPECIAL_INVOICE(3, "增值税专用发票");
+
+        private final Integer code;
+        private final String desc;
+
+        InvoiceType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 枚举类 - 赠品方式
+     */
+    public enum GiftType {
+        NOT_GIFT(0, "非赠品"),
+        AUTO_GIFT(1, "自动赠送"),
+        MANUAL_GIFT(2, "手工赠送"),
+        SUBSCRIPTION_GIFT(4, "周期购赠送"),
+        PLATFORM_GIFT(8, "平台赠送"),
+        TIERED_GIFT(32, "阶梯满赠"),
+        CRM_ADDITIONAL_GIFT(64, "CRM追加赠送"),
+        MAIN_PRODUCT(65, "主品");
+
+        private final Integer code;
+        private final String desc;
+
+        GiftType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+}

+ 57 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelf2Response.java

@@ -0,0 +1,57 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+import java.util.Map;
+
+public class PushSelf2Response
+{
+	/**
+	 * {"status":0,"data":{"chg_count":0,"new_count":1}}
+	 */
+	// 更新订单数
+	@SerializedName("chg_count")
+	private Integer chgCount;
+	// 新增订单数
+	@SerializedName("new_count")
+	private Integer newCount;
+	// 错误信息
+	// 单号 no	String
+	// 错误信息	error	String
+	@SerializedName("error_list")
+	private List<ErrorInfo> errorList;
+
+	public Integer getChgCount()
+	{
+		return chgCount;
+	}
+
+	public void setChgCount(Integer chgCount)
+	{
+		this.chgCount = chgCount;
+	}
+
+	public Integer getNewCount()
+	{
+		return newCount;
+	}
+
+	public void setNewCount(Integer newCount)
+	{
+		this.newCount = newCount;
+	}
+
+
+	public List<ErrorInfo> getErrorList()
+	{
+		return errorList;
+	}
+
+	public void setErrorList(List<ErrorInfo> errorList)
+	{
+		this.errorList = errorList;
+	}
+
+
+}

+ 967 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelfRequest.java

@@ -0,0 +1,967 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+public class PushSelfRequest
+{
+	@SerializedName("shop_no")
+	private String shopNo;
+
+	public static class RawTrade
+	{
+		/**
+		 * 平台状态 未确认
+		 */
+		public static final byte TRADE_STATUS_TO_CONFIRM = 10;
+		/**
+		 * 平台状态 待尾款
+		 */
+		public static final byte TRADE_STATUS_PART_PAID = 20;
+		/**
+		 * 平台状态 待发货
+		 */
+		public static final byte TRADE_STATUS_WAIT_CONSIGN = 30;
+		/**
+		 * 平台状态 部分发货
+		 */
+		public static final byte TRADE_STATUS_PART_CONSIGN = 40;
+		/**
+		 * 平台状态 已发货
+		 */
+		public static final byte TRADE_STATUS_CONSIGNED = 50;
+		/**
+		 * 平台状态 已签收
+		 */
+		public static final byte TRADE_STATUS_SIGNED = 60;
+		/**
+		 * 平台状态 已完成
+		 */
+		public static final byte TRADE_STATUS_COMPLETE = 70;
+		/**
+		 * 平台状态 已退款
+		 */
+		public static final byte TRADE_STATUS_REFUND = 80;
+		/**
+		 * 平台状态 已关闭(付款前取消)
+		 */
+		public static final byte TRADE_STATUS_CLOSED = 90;
+
+		// 付款状态
+		public static final byte PAY_STATUS_UNPAY = 0; // 未付款
+		public static final byte PAY_STATUS_PART_PAID = 1; // 部分付款
+		public static final byte PAY_STATUS_FULL_PAID = 2; // 已付款
+
+		// 退款状态
+		public static final byte REFUND_NONE = 0; // 无退款
+		public static final byte REFUND_APPLY = 1; // 申请退款
+		public static final byte REFUND_PART = 2; // 部分退款
+		public static final byte REFUND_FULL = 3; // 全部退款
+
+		/**
+		 ** 款到发货
+		 */
+		public static final byte DELIVERY_TERM_DAP = 1; // 款到发货
+		/**
+		 * 货到付款
+		 */
+		public static final byte DELIVERY_TERM_COD = 2; // 货到付款(包含部分货到付款)
+
+		public static final byte PROCESS_STATUS_WAIT_DELIVERY = 10; // 待递交
+		public static final byte PROCESS_STATUS_CANCEL = 70; // 已取消
+
+		// 1在线转帐 2现金,3银行转账,4邮局汇款 5预付款 6刷卡
+		public static final byte PAY_METHOD_ONLINE = 1;
+		public static final byte PAY_METHOD_CASH = 2;
+		public static final byte PAY_METHOD_BANK = 3;
+		public static final byte PAY_METHOD_REMITTANCE = 4;
+		public static final byte PAY_METHOD_ADVANCES = 5;
+		public static final byte PAY_METHOD_CARD = 5;
+
+		// 0 不需要,1普通发票,2增值税发票
+		public static final byte INVOICE_TYPE_NONE = 0;
+		public static final byte INVOICE_TYPE_ORDINARY = 1;
+		public static final byte INVOICE_TYPE_VAT = 2;
+
+		@SerializedName("delivery_term")
+		private int deliveryTerm = DELIVERY_TERM_DAP;
+		@SerializedName("refund_status")
+		private byte refundStatus = REFUND_NONE;
+		@SerializedName("trade_status")
+		private byte tradeStatus = TRADE_STATUS_WAIT_CONSIGN;
+		@SerializedName("pay_status")
+		private byte payStatus = PAY_STATUS_FULL_PAID;
+		@SerializedName("process_status")
+		private byte processStatus = PROCESS_STATUS_WAIT_DELIVERY;
+
+		@SerializedName("tid")
+		private String tid;
+
+		// !!!
+		@SerializedName("is_auto_wms")
+		private Boolean autoWms;
+		@SerializedName("warehouse_no")
+		private String warehouseNo;
+		@SerializedName("goods_count")
+		private BigDecimal goodsCount = new BigDecimal(0.0000D);
+		@SerializedName("order_count")
+		private Integer orderCount = 0;
+		@SerializedName("trade_time")
+		private String tradeTime;
+		@SerializedName("remark_flag")
+		private Integer remarkFlag;
+		@SerializedName("consign_interval")
+		private Integer consignInterval;
+		@SerializedName("to_deliver_time")
+		private String toDeliverTime;
+		@SerializedName("platform_cost")
+		private BigDecimal platformCost;
+		@SerializedName("logistics_type")
+		private Integer logisticsType;
+		@SerializedName("end_time")
+		private String endTime;
+		@SerializedName("pay_time")
+		private String payTime;
+		@SerializedName("pay_method")
+		private Byte payMethod;
+		@SerializedName("remark")
+		private String remark = "";
+		@SerializedName("pay_account")
+		private String payAccount = "";
+		@SerializedName("pay_id")
+		private String payId = "";
+		@SerializedName("receiver_zip")
+		private String receiverZip = "";
+		@SerializedName("receiver_telno")
+		private String receiverTelno = "";
+		@SerializedName("receiver_name")
+		private String receiverName = "";
+		@SerializedName("receiver_area")
+		private String receiverArea = "";
+		@SerializedName("receiver_mobile")
+		private String receiverMobile = "";
+		@SerializedName("receiver_address")
+		private String receiverAddress = "";
+		@SerializedName("buyer_nick")
+		private String buyerNick = "";
+		@SerializedName("buyer_email")
+		private String buyerEmail = "";
+		@SerializedName("buyer_message")
+		private String buyerMessage = "";
+		@SerializedName("buyer_area")
+		private String buyerArea = "";
+		@SerializedName("invoice_type")
+		private Byte invoiceType;
+		@SerializedName("invoice_content")
+		private String invoiceContent = "";
+		@SerializedName("invoice_title")
+		private String invoiceTitle = "";
+		@SerializedName("receivable")
+		private BigDecimal receivable = BigDecimal.ZERO; // 应收金额
+		@SerializedName("post_amount")
+		private BigDecimal postAmount = BigDecimal.ZERO; // 邮费
+		@SerializedName("discount")
+		private BigDecimal discount = BigDecimal.ZERO; // 折扣
+		@SerializedName("received")
+		private BigDecimal received = BigDecimal.ZERO; // 已收金额
+		@SerializedName("cod_amount")
+		private BigDecimal codAmount = BigDecimal.ZERO; // COD金额
+		@SerializedName("other_amount")
+		private BigDecimal otherAmount = BigDecimal.ZERO; // 其他费用
+
+		public String getWarehouseNo()
+		{
+			return warehouseNo;
+		}
+
+		public void setWarehouseNo(String warehouseNo)
+		{
+			this.warehouseNo = warehouseNo;
+		}
+
+		public int getDeliveryTerm()
+		{
+			return deliveryTerm;
+		}
+
+		public void setDeliveryTerm(int deliveryTerm)
+		{
+			this.deliveryTerm = deliveryTerm;
+		}
+
+		public byte getRefundStatus()
+		{
+			return refundStatus;
+		}
+
+		public void setRefundStatus(byte refundStatus)
+		{
+			this.refundStatus = refundStatus;
+		}
+
+		public byte getTradeStatus()
+		{
+			return tradeStatus;
+		}
+
+		public void setTradeStatus(byte tradeStatus)
+		{
+			this.tradeStatus = tradeStatus;
+		}
+
+		public byte getPayStatus()
+		{
+			return payStatus;
+		}
+
+		public void setPayStatus(byte payStatus)
+		{
+			this.payStatus = payStatus;
+		}
+
+		public byte getProcessStatus()
+		{
+			return processStatus;
+		}
+
+		public void setProcessStatus(byte processStatus)
+		{
+			this.processStatus = processStatus;
+		}
+
+		public String getTid()
+		{
+			return tid;
+		}
+
+		public void setTid(String tid)
+		{
+			this.tid = tid;
+		}
+
+		public Boolean getAutoWms()
+		{
+			return autoWms;
+		}
+
+		public void setAutoWms(Boolean autoWms)
+		{
+			this.autoWms = autoWms;
+		}
+
+		public BigDecimal getGoodsCount()
+		{
+			return goodsCount;
+		}
+
+		public void setGoodsCount(BigDecimal goodsCount)
+		{
+			this.goodsCount = goodsCount;
+		}
+
+		public Integer getOrderCount()
+		{
+			return orderCount;
+		}
+
+		public void setOrderCount(Integer orderCount)
+		{
+			this.orderCount = orderCount;
+		}
+
+		public String getTradeTime()
+		{
+			return tradeTime;
+		}
+
+		public void setTradeTime(String tradeTime)
+		{
+			this.tradeTime = tradeTime;
+		}
+
+		public Integer getRemarkFlag()
+		{
+			return remarkFlag;
+		}
+
+		public void setRemarkFlag(Integer remarkFlag)
+		{
+			this.remarkFlag = remarkFlag;
+		}
+
+		public Integer getConsignInterval()
+		{
+			return consignInterval;
+		}
+
+		public void setConsignInterval(Integer consignInterval)
+		{
+			this.consignInterval = consignInterval;
+		}
+
+		public String getToDeliverTime()
+		{
+			return toDeliverTime;
+		}
+
+		public void setToDeliverTime(String toDeliverTime)
+		{
+			this.toDeliverTime = toDeliverTime;
+		}
+
+		public BigDecimal getPlatformCost()
+		{
+			return platformCost;
+		}
+
+		public void setPlatformCost(BigDecimal platformCost)
+		{
+			this.platformCost = platformCost;
+		}
+
+		public Integer getLogisticsType()
+		{
+			return logisticsType;
+		}
+
+		public void setLogisticsType(Integer logisticsType)
+		{
+			this.logisticsType = logisticsType;
+		}
+
+		public String getEndTime()
+		{
+			return endTime;
+		}
+
+		public void setEndTime(String endTime)
+		{
+			this.endTime = endTime;
+		}
+
+		public String getPayTime()
+		{
+			return payTime;
+		}
+
+		public void setPayTime(String payTime)
+		{
+			this.payTime = payTime;
+		}
+
+		public Byte getPayMethod()
+		{
+			return payMethod;
+		}
+
+		public void setPayMethod(Byte payMethod)
+		{
+			this.payMethod = payMethod;
+		}
+
+		public String getRemark()
+		{
+			return remark;
+		}
+
+		public void setRemark(String remark)
+		{
+			this.remark = remark;
+		}
+
+		public String getPayAccount()
+		{
+			return payAccount;
+		}
+
+		public void setPayAccount(String payAccount)
+		{
+			this.payAccount = payAccount;
+		}
+
+		public String getPayId()
+		{
+			return payId;
+		}
+
+		public void setPayId(String payId)
+		{
+			this.payId = payId;
+		}
+
+		public String getReceiverZip()
+		{
+			return receiverZip;
+		}
+
+		public void setReceiverZip(String receiverZip)
+		{
+			this.receiverZip = receiverZip;
+		}
+
+		public String getReceiverTelno()
+		{
+			return receiverTelno;
+		}
+
+		public void setReceiverTelno(String receiverTelno)
+		{
+			this.receiverTelno = receiverTelno;
+		}
+
+		public String getReceiverName()
+		{
+			return receiverName;
+		}
+
+		public void setReceiverName(String receiverName)
+		{
+			this.receiverName = receiverName;
+		}
+
+		public String getReceiverArea()
+		{
+			return receiverArea;
+		}
+
+		public void setReceiverArea(String receiverArea)
+		{
+			this.receiverArea = receiverArea;
+		}
+
+		public String getReceiverMobile()
+		{
+			return receiverMobile;
+		}
+
+		public void setReceiverMobile(String receiverMobile)
+		{
+			this.receiverMobile = receiverMobile;
+		}
+
+		public String getReceiverAddress()
+		{
+			return receiverAddress;
+		}
+
+		public void setReceiverAddress(String receiverAddress)
+		{
+			this.receiverAddress = receiverAddress;
+		}
+
+		public String getBuyerNick()
+		{
+			return buyerNick;
+		}
+
+		public void setBuyerNick(String buyerNick)
+		{
+			this.buyerNick = buyerNick;
+		}
+
+		public String getBuyerEmail()
+		{
+			return buyerEmail;
+		}
+
+		public void setBuyerEmail(String buyerEmail)
+		{
+			this.buyerEmail = buyerEmail;
+		}
+
+		public String getBuyerMessage()
+		{
+			return buyerMessage;
+		}
+
+		public void setBuyerMessage(String buyerMessage)
+		{
+			this.buyerMessage = buyerMessage;
+		}
+
+		public String getBuyerArea()
+		{
+			return buyerArea;
+		}
+
+		public void setBuyerArea(String buyerArea)
+		{
+			this.buyerArea = buyerArea;
+		}
+
+		public Byte getInvoiceType()
+		{
+			return invoiceType;
+		}
+
+		public void setInvoiceType(Byte invoiceType)
+		{
+			this.invoiceType = invoiceType;
+		}
+
+		public String getInvoiceContent()
+		{
+			return invoiceContent;
+		}
+
+		public void setInvoiceContent(String invoiceContent)
+		{
+			this.invoiceContent = invoiceContent;
+		}
+
+		public String getInvoiceTitle()
+		{
+			return invoiceTitle;
+		}
+
+		public void setInvoiceTitle(String invoiceTitle)
+		{
+			this.invoiceTitle = invoiceTitle;
+		}
+
+		public BigDecimal getReceivable()
+		{
+			return receivable;
+		}
+
+		public void setReceivable(BigDecimal receivable)
+		{
+			this.receivable = receivable;
+		}
+
+		public BigDecimal getPostAmount()
+		{
+			return postAmount;
+		}
+
+		public void setPostAmount(BigDecimal postAmount)
+		{
+			this.postAmount = postAmount;
+		}
+
+		public BigDecimal getDiscount()
+		{
+			return discount;
+		}
+
+		public void setDiscount(BigDecimal discount)
+		{
+			this.discount = discount;
+		}
+
+		public BigDecimal getReceived()
+		{
+			return received;
+		}
+
+		public void setReceived(BigDecimal received)
+		{
+			this.received = received;
+		}
+
+		public BigDecimal getCodAmount()
+		{
+			return codAmount;
+		}
+
+		public void setCodAmount(BigDecimal codAmount)
+		{
+			this.codAmount = codAmount;
+		}
+
+		public BigDecimal getOtherAmount()
+		{
+			return otherAmount;
+		}
+
+		public void setOtherAmount(BigDecimal otherAmount)
+		{
+			this.otherAmount = otherAmount;
+		}
+	}
+
+	public static class RawTradeOrder
+	{
+		public static final byte ORDER_TYPE_NORMAL = 0; // 普通货品
+		public static final byte ORDER_TYPE_VIRTUAL = 1; // 虚拟货品
+		public static final byte ORDER_TYPE_SERVICE = 2; // 服务
+
+		// 退款状态
+		public static final byte REFUND_STATUS_NONE = 0; // 无退款
+		public static final byte REFUND_STATUS_CANCEL = 1; // 取消退款,
+		public static final byte REFUND_STATUS_APPLY = 2; // 已申请退款,
+		public static final byte REFUND_STATUS_AGREE = 3; // 等待退货,
+		public static final byte REFUND_STATUS_WAIT_RECEIVE = 4; // 等待收货,
+		public static final byte REFUND_STATUS_SUCCESS = 5; // 退款成功
+		public static final byte REFUND_STATUS_DISCARD = 6; // 未付款关闭
+
+		// 平台状态
+		public static final byte PLATFORM_STATUS = 30;
+
+		@SerializedName("tid")
+		private String tid;
+		@SerializedName("oid")
+		private String oid;
+		@SerializedName("status")
+		private Byte status;
+		@SerializedName("refund_status")
+		private Byte refundStatus;
+		@SerializedName("goods_id")
+		private String goodsId;
+		@SerializedName("spec_id")
+		private String specId;
+		@SerializedName("goods_no")
+		private String goodsNo;
+		@SerializedName("spec_no")
+		private String specNo;
+		@SerializedName("goods_name")
+		private String goodsName;
+		@SerializedName("spec_name")
+		private String specName;
+		@SerializedName("order_type")
+		private Byte orderType = ORDER_TYPE_NORMAL;
+		@SerializedName("cid")
+		private String cid = "";
+		@SerializedName("num")
+		private BigDecimal num;
+		@SerializedName("price")
+		private BigDecimal price;
+		@SerializedName("discount")
+		private BigDecimal discount;
+		@SerializedName("share_discount")
+		private BigDecimal shareDiscount;
+		@SerializedName("adjust_amount")
+		private BigDecimal adjustAmount;
+		@SerializedName("refund_amount")
+		private BigDecimal refundAmount;
+		@SerializedName("total_amount")
+		private BigDecimal totalAmount;
+		@SerializedName("remark")
+		private String remark;
+		@SerializedName("json")
+		private String json;
+
+
+
+		public String getTid()
+		{
+			return tid;
+		}
+
+		public void setTid(String tid)
+		{
+			this.tid = tid;
+		}
+
+		public String getOid()
+		{
+			return oid;
+		}
+
+		public void setOid(String oid)
+		{
+			this.oid = oid;
+		}
+
+		public Byte getStatus()
+		{
+			return status;
+		}
+
+		public void setStatus(Byte status)
+		{
+			this.status = status;
+		}
+
+		public Byte getRefundStatus()
+		{
+			return refundStatus;
+		}
+
+		public void setRefundStatus(Byte refundStatus)
+		{
+			this.refundStatus = refundStatus;
+		}
+
+		public Byte getOrderType()
+		{
+			return orderType;
+		}
+
+		public void setOrderType(Byte orderType)
+		{
+			this.orderType = orderType;
+		}
+
+		public String getGoodsName()
+		{
+			return goodsName;
+		}
+
+		public void setGoodsName(String goodsName)
+		{
+			this.goodsName = goodsName;
+		}
+
+		public String getGoodsNo()
+		{
+			return goodsNo;
+		}
+
+		public void setGoodsNo(String goodsNo)
+		{
+			this.goodsNo = goodsNo;
+		}
+
+		public String getGoodsId()
+		{
+			return goodsId;
+		}
+
+		public void setGoodsId(String goodsId)
+		{
+			this.goodsId = goodsId;
+		}
+
+		public String getSpecNo()
+		{
+			return specNo;
+		}
+
+		public void setSpecNo(String specNo)
+		{
+			this.specNo = specNo;
+		}
+
+		public String getSpecId()
+		{
+			return specId;
+		}
+
+		public void setSpecId(String specId)
+		{
+			this.specId = specId;
+		}
+
+		public String getJson()
+		{
+			return json;
+		}
+
+		public void setJson(String json)
+		{
+			this.json = json;
+		}
+
+		public String getSpecName()
+		{
+			return specName;
+		}
+
+		public void setSpecName(String specName)
+		{
+			this.specName = specName;
+		}
+
+		public String getRemark()
+		{
+			return remark;
+		}
+
+		public void setRemark(String remark)
+		{
+			this.remark = remark;
+		}
+
+		public String getCid()
+		{
+			return cid;
+		}
+
+		public void setCid(String cid)
+		{
+			this.cid = cid;
+		}
+
+		public BigDecimal getNum()
+		{
+			return num;
+		}
+
+		public void setNum(BigDecimal num)
+		{
+			this.num = num;
+		}
+
+		public BigDecimal getPrice()
+		{
+			return price;
+		}
+
+		public void setPrice(BigDecimal price)
+		{
+			this.price = price;
+		}
+
+		public BigDecimal getShareDiscount()
+		{
+			return shareDiscount;
+		}
+
+		public void setShareDiscount(BigDecimal shareDiscount)
+		{
+			this.shareDiscount = shareDiscount;
+		}
+
+		public BigDecimal getDiscount()
+		{
+			return discount;
+		}
+
+		public void setDiscount(BigDecimal discount)
+		{
+			this.discount = discount;
+		}
+
+		public BigDecimal getAdjustAmount()
+		{
+			return adjustAmount;
+		}
+
+		public void setAdjustAmount(BigDecimal adjustAmount)
+		{
+			this.adjustAmount = adjustAmount;
+		}
+
+		public BigDecimal getRefundAmount()
+		{
+			return refundAmount;
+		}
+
+		public void setRefundAmount(BigDecimal refundAmount)
+		{
+			this.refundAmount = refundAmount;
+		}
+
+		public BigDecimal getTotalAmount()
+		{
+			return totalAmount;
+		}
+
+		public void setTotalAmount(BigDecimal totalAmount)
+		{
+			this.totalAmount = totalAmount;
+		}
+	}
+
+	public static class RawTradeDiscount
+	{
+		@SerializedName("tid")
+		private String tid;
+		@SerializedName("oid")
+		private String oid;
+		@SerializedName("sn")
+		private String sn;
+		@SerializedName("type")
+		private String type;
+		@SerializedName("name")
+		private String name;
+		@SerializedName("is_bonus")
+		private Byte isBonus;
+		@SerializedName("detail")
+		private String detail;
+		@SerializedName("amount")
+		private BigDecimal amount;
+
+		public String getTid()
+		{
+			return tid;
+		}
+
+		public void setTid(String tid)
+		{
+			this.tid = tid;
+		}
+
+		public String getOid()
+		{
+			return oid;
+		}
+
+		public void setOid(String oid)
+		{
+			this.oid = oid;
+		}
+
+		public String getSn()
+		{
+			return sn;
+		}
+
+		public void setSn(String sn)
+		{
+			this.sn = sn;
+		}
+
+		public String getType()
+		{
+			return type;
+		}
+
+		public void setType(String type)
+		{
+			this.type = type;
+		}
+
+		public String getName()
+		{
+			return name;
+		}
+
+		public void setName(String name)
+		{
+			this.name = name;
+		}
+
+		public Byte getIsBonus()
+		{
+			return isBonus;
+		}
+
+		public void setIsBonus(Byte isBonus)
+		{
+			this.isBonus = isBonus;
+		}
+
+		public String getDetail()
+		{
+			return detail;
+		}
+
+		public void setDetail(String detail)
+		{
+			this.detail = detail;
+		}
+
+		public BigDecimal getAmount()
+		{
+			return amount;
+		}
+
+		public void setAmount(BigDecimal amount)
+		{
+			this.amount = amount;
+		}
+	}
+
+	public String getShopNo()
+	{
+		return shopNo;
+	}
+
+	public void setShopNo(String shopNo)
+	{
+		this.shopNo = shopNo;
+	}
+}

+ 34 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/PushSelfResponse.java

@@ -0,0 +1,34 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+
+public class PushSelfResponse
+{
+	/**
+	 * {"status":0,"data":{"chg_count":0,"new_count":1}}
+	 */
+	@SerializedName("chg_count")
+	private Integer chgCount;
+	@SerializedName("new_count")
+	private Integer newCount;
+
+	public Integer getChgCount()
+	{
+		return chgCount;
+	}
+
+	public void setChgCount(Integer chgCount)
+	{
+		this.chgCount = chgCount;
+	}
+
+	public Integer getNewCount()
+	{
+		return newCount;
+	}
+
+	public void setNewCount(Integer newCount)
+	{
+		this.newCount = newCount;
+	}
+}

+ 393 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/QuerySelfOrderDetailRequest.java

@@ -0,0 +1,393 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * 订单查询接口请求参数实体类
+ */
+public class QuerySelfOrderDetailRequest {
+
+    /**
+     * 开始时间(修改起始时间)
+     * 若无订单编号/原始单号/物流单号,则为必填
+     * 示例:"2021-11-11 00:00:00"
+     */
+    @SerializedName("start_time")
+    private String startTime;
+
+    /**
+     * 结束时间(修改结束时间)
+     * 若无订单编号/原始单号/物流单号,则为必填
+     * 示例:"2021-11-11 01:00:00"
+     */
+    @SerializedName("end_time")
+    private String endTime;
+
+    /**
+     * 仓库编号
+     */
+    @SerializedName("warehouse_no")
+    private String warehouseNo;
+
+    /**
+     * 订单状态
+     * 若多个状态则以","隔开
+     * 订单状态: 4线下退款 5已取消 6待转预订单(待审核) 7待转已完成 10未付款 12待尾款 15等未付 16延时审核
+     * 19预订单前处理 20审核前处理 21自流转待发货 23异常订单 24换货预订单 25待处理预订单 27待分配预订单
+     * 30待客审 35待财审 40审核中 55已审核 95已发货 96成本确认 101已过账 110已完成
+     */
+    @SerializedName("status")
+    private String status;
+
+    /**
+     * 订单编号
+     */
+    @SerializedName("trade_no")
+    private String tradeNo;
+
+    /**
+     * 店铺编号(暂不支持批量查询)
+     */
+    @SerializedName("shop_no")
+    private String shopNo;
+
+    /**
+     * 物流单号(V1.4.9.9版本以上支持按照物流单号查询不传入时间范围)
+     */
+    @SerializedName("logistics_no")
+    private String logisticsNo;
+
+    /**
+     * 原始单号,多个原始单号之间使用英文逗号分隔
+     */
+    @SerializedName("src_tid")
+    private String srcTid;
+
+    /**
+     * 是否使用从库查询
+     * 使用:true 不使用:false(仅对开通从库配置客户生效)
+     */
+    @SerializedName("is_slave")
+    private Boolean isSlave;
+
+    /**
+     * 是否计算分摊邮费
+     * 默认false,计算:true 不计算:false
+     */
+    @SerializedName("cal_share_post_amount")
+    private Boolean calSharePostAmount;
+
+    /**
+     * 订单来源
+     * 1、API抓单 2、手工建单 3、导入 4、复制订单 5、接口推送 6、补发订单 7、PDA选货开单 8、分销补发订单
+     */
+    @SerializedName("trade_from")
+    private String tradeFrom;
+
+    /**
+     * 排序类型
+     * 0:默认排序 1:修改时间降序
+     */
+    @SerializedName("order_type")
+    private Integer orderType;
+
+    /**
+     * 时间类型
+     * 1:修改时间 2:付款时间 3:下单时间 默认1
+     */
+    @SerializedName("time_type")
+    private Integer timeType;
+
+    /**
+     * 是否返回赠品关联关系
+     * 0:不返回 1:返回 默认1
+     */
+    @SerializedName("need_gift_relation")
+    private Boolean needGiftRelation;
+
+    /**
+     * 是否强制指定src_tid精准查询(避免模糊查)
+     * 0:(默认值)否 1:是
+     */
+    @SerializedName("accurate_query")
+    private Boolean accurateQuery;
+
+    /**
+     * 是否截取物流单号
+     * 0: (默认值) 不截取 1:截取
+     */
+    @SerializedName("cut_logistics_no")
+    private Boolean cutLogisticsNo;
+
+    // Getters and Setters
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getWarehouseNo() {
+        return warehouseNo;
+    }
+
+    public void setWarehouseNo(String warehouseNo) {
+        this.warehouseNo = warehouseNo;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getTradeNo() {
+        return tradeNo;
+    }
+
+    public void setTradeNo(String tradeNo) {
+        this.tradeNo = tradeNo;
+    }
+
+    public String getShopNo() {
+        return shopNo;
+    }
+
+    public void setShopNo(String shopNo) {
+        this.shopNo = shopNo;
+    }
+
+    public String getLogisticsNo() {
+        return logisticsNo;
+    }
+
+    public void setLogisticsNo(String logisticsNo) {
+        this.logisticsNo = logisticsNo;
+    }
+
+    public String getSrcTid() {
+        return srcTid;
+    }
+
+    public void setSrcTid(String srcTid) {
+        this.srcTid = srcTid;
+    }
+
+    public Boolean getIsSlave() {
+        return isSlave;
+    }
+
+    public void setIsSlave(Boolean isSlave) {
+        this.isSlave = isSlave;
+    }
+
+    public Boolean getCalSharePostAmount() {
+        return calSharePostAmount;
+    }
+
+    public void setCalSharePostAmount(Boolean calSharePostAmount) {
+        this.calSharePostAmount = calSharePostAmount;
+    }
+
+    public String getTradeFrom() {
+        return tradeFrom;
+    }
+
+    public void setTradeFrom(String tradeFrom) {
+        this.tradeFrom = tradeFrom;
+    }
+
+    public Integer getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(Integer orderType) {
+        this.orderType = orderType;
+    }
+
+    public Integer getTimeType() {
+        return timeType;
+    }
+
+    public void setTimeType(Integer timeType) {
+        this.timeType = timeType;
+    }
+
+    public Boolean getNeedGiftRelation() {
+        return needGiftRelation;
+    }
+
+    public void setNeedGiftRelation(Boolean needGiftRelation) {
+        this.needGiftRelation = needGiftRelation;
+    }
+
+    public Boolean getAccurateQuery() {
+        return accurateQuery;
+    }
+
+    public void setAccurateQuery(Boolean accurateQuery) {
+        this.accurateQuery = accurateQuery;
+    }
+
+    public Boolean getCutLogisticsNo() {
+        return cutLogisticsNo;
+    }
+
+    public void setCutLogisticsNo(Boolean cutLogisticsNo) {
+        this.cutLogisticsNo = cutLogisticsNo;
+    }
+
+    /**
+     * 订单状态枚举
+     */
+    public enum OrderStatus {
+        OFFLINE_REFUND(4, "线下退款"),
+        CANCELED(5, "已取消"),
+        WAIT_PREORDER(6, "待转预订单(待审核)"),
+        WAIT_COMPLETE(7, "待转已完成"),
+        UNPAID(10, "未付款"),
+        WAIT_FINAL_PAYMENT(12, "待尾款"),
+        WAIT_UNPAID(15, "等未付"),
+        DELAY_REVIEW(16, "延时审核"),
+        PRE_ORDER_PREPROCESS(19, "预订单前处理"),
+        BEFORE_REVIEW_PREPROCESS(20, "审核前处理"),
+        AUTO_FLOW_WAIT_SHIP(21, "自流转待发货"),
+        ABNORMAL_ORDER(23, "异常订单"),
+        EXCHANGE_PREORDER(24, "换货预订单"),
+        PENDING_PREORDER(25, "待处理预订单"),
+        WAIT_ASSIGN_PREORDER(27, "待分配预订单"),
+        WAIT_CUSTOMER_REVIEW(30, "待客审"),
+        WAIT_FINANCE_REVIEW(35, "待财审"),
+        UNDER_REVIEW(40, "审核中"),
+        REVIEWED(55, "已审核"),
+        SHIPPED(95, "已发货"),
+        COST_CONFIRMATION(96, "成本确认"),
+        POSTED(101, "已过账"),
+        COMPLETED(110, "已完成");
+
+        private final Integer code;
+        private final String desc;
+
+        OrderStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+
+        /**
+         * 将多个状态转换为逗号分隔的字符串
+         */
+        public static String toStatusString(OrderStatus... statuses) {
+            if (statuses == null || statuses.length == 0) {
+                return "";
+            }
+
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < statuses.length; i++) {
+                if (i > 0) {
+                    sb.append(",");
+                }
+                sb.append(statuses[i].getCode());
+            }
+            return sb.toString();
+        }
+    }
+
+    /**
+     * 订单来源枚举
+     */
+    public enum TradeFrom {
+        API_CRAWL(1, "API抓单"),
+        MANUAL_CREATE(2, "手工建单"),
+        IMPORT(3, "导入"),
+        COPY_ORDER(4, "复制订单"),
+        INTERFACE_PUSH(5, "接口推送"),
+        RESEND_ORDER(6, "补发订单"),
+        PDA_CREATE(7, "PDA选货开单"),
+        DISTRIBUTION_RESEND(8, "分销补发订单");
+
+        private final Integer code;
+        private final String desc;
+
+        TradeFrom(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 排序类型枚举
+     */
+    public enum OrderType {
+        DEFAULT(0, "默认排序"),
+        MODIFY_TIME_DESC(1, "修改时间降序");
+
+        private final Integer code;
+        private final String desc;
+
+        OrderType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 时间类型枚举
+     */
+    public enum TimeType {
+        MODIFY_TIME(1, "修改时间"),
+        PAY_TIME(2, "付款时间"),
+        ORDER_TIME(3, "下单时间");
+
+        private final Integer code;
+        private final String desc;
+
+        TimeType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+}

+ 2947 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/QuerySelfOrderDetailResponse.java

@@ -0,0 +1,2947 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 订单查询响应实体类
+ */
+public class QuerySelfOrderDetailResponse {
+
+    /**
+     * 总数(查询条件总单据数)
+     */
+    @SerializedName("total_count")
+    private Integer totalCount;
+
+    /**
+     * 单据数据(订单相关数据)
+     */
+    @SerializedName("order")
+    private List<OrderInfo> order;
+
+    // Getters and Setters
+    public Integer getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(Integer totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    public List<OrderInfo> getOrder() {
+        return order;
+    }
+
+    public void setOrder(List<OrderInfo> order) {
+        this.order = order;
+    }
+
+    /**
+     * 订单主信息实体类
+     */
+    public static class OrderInfo {
+
+        /**
+         * 订单唯一键
+         */
+        @SerializedName("trade_id")
+        private Long tradeId;
+
+        /**
+         * 订单编号(旺店通系统订单号)
+         */
+        @SerializedName("trade_no")
+        private String tradeNo;
+
+        /**
+         * 平台ID
+         */
+        @SerializedName("platform_id")
+        private Integer platformId;
+
+        /**
+         * 仓库类型
+         * 1、普通仓库,大于1为委外仓库(如京东仓储,物流宝等)
+         */
+        @SerializedName("warehouse_type")
+        private Integer warehouseType;
+
+        /**
+         * 原始单号(平台订单号),如果有多个,以","分隔
+         */
+        @SerializedName("src_tids")
+        private String srcTids;
+
+        /**
+         * 平台支付帐号
+         */
+        @SerializedName("pay_account")
+        private String payAccount;
+
+        /**
+         * 订单状态
+         */
+        @SerializedName("trade_status")
+        private Integer tradeStatus;
+
+        /**
+         * 订单类型
+         * 1、网店销售 2、线下订单 3、售后换货 4、批发业务 5、保修换新 6、保修完成 7、现款销售 8、分销订单
+         * 101-110、自定义类型一到十
+         */
+        @SerializedName("trade_type")
+        private Integer tradeType;
+
+        /**
+         * 发货条件
+         * 1、款到发货 2、货到付款(包含部分货到付款) 3、分期付款 4、挂账
+         */
+        @SerializedName("delivery_term")
+        private Integer deliveryTerm;
+
+        /**
+         * 京东几环(淘宝模糊化后的买家昵称)
+         */
+        @SerializedName("receiver_ring")
+        private String receiverRing;
+
+        /**
+         * 冻结原因
+         */
+        @SerializedName("freeze_reason")
+        private String freezeReason;
+
+        /**
+         * 退款状态
+         * 0、无退款 1、申请退款 2、部分退款 3、全部退款
+         */
+        @SerializedName("refund_status")
+        private Integer refundStatus;
+
+        /**
+         * 分销类别
+         * 0、非分销订单 1、代销 2、经销
+         */
+        @SerializedName("fenxiao_type")
+        private Integer fenxiaoType;
+
+        /**
+         * 分销商昵称
+         */
+        @SerializedName("fenxiao_nick")
+        private String fenxiaoNick;
+
+        /**
+         * 下单时间(毫秒级时间戳,例如:1631861379000)
+         */
+        @SerializedName("trade_time")
+        private String tradeTime;
+
+        /**
+         * 付款时间,例如:2020-10-19 00:00:00
+         */
+        @SerializedName("pay_time")
+        private String payTime;
+
+        /**
+         * 发货时间(毫秒级时间戳,例如:1631861379000)
+         */
+        @SerializedName("consign_time")
+        private String consignTime;
+
+        /**
+         * 客户网名
+         */
+        @SerializedName("buyer_nick")
+        private String buyerNick;
+
+        /**
+         * 收货人/收件人
+         */
+        @SerializedName("receiver_name")
+        private String receiverName;
+
+        /**
+         * 省份id
+         */
+        @SerializedName("receiver_province")
+        private Integer receiverProvince;
+
+        /**
+         * 城市id
+         */
+        @SerializedName("receiver_city")
+        private Integer receiverCity;
+
+        /**
+         * 地区id
+         */
+        @SerializedName("receiver_district")
+        private Integer receiverDistrict;
+
+        /**
+         * 收件人地址
+         */
+        @SerializedName("receiver_address")
+        private String receiverAddress;
+
+        /**
+         * 手机
+         */
+        @SerializedName("receiver_mobile")
+        private String receiverMobile;
+
+        /**
+         * 固话
+         */
+        @SerializedName("receiver_telno")
+        private String receiverTelno;
+
+        /**
+         * 邮编
+         */
+        @SerializedName("receiver_zip")
+        private String receiverZip;
+
+        /**
+         * 地区(省市区空格分隔)
+         */
+        @SerializedName("receiver_area")
+        private String receiverArea;
+
+        /**
+         * 大头笔
+         */
+        @SerializedName("receiver_dtb")
+        private String receiverDtb;
+
+        /**
+         * 异常订单原因(位运算)
+         * 2、修改地址 4、修改发票 8、更换仓库 16、修改备注 32、更换货品 128、拦截赠品 256、拦截换货
+         * 512、买家留言变化 1024、拦截平台已发货
+         */
+        @SerializedName("bad_reason")
+        private Integer badReason;
+
+        /**
+         * 物流单号
+         */
+        @SerializedName("logistics_no")
+        private String logisticsNo;
+
+        /**
+         * 买家留言
+         */
+        @SerializedName("buyer_message")
+        private String buyerMessage;
+
+        /**
+         * 客服备注
+         */
+        @SerializedName("cs_remark")
+        private String csRemark;
+
+        /**
+         * 标旗(1 红、2 黄、3 绿、4 蓝、5 紫、6 橙、7 浅蓝、8 浅粉、9 深绿、10 桃红)
+         */
+        @SerializedName("remark_flag")
+        private Integer remarkFlag;
+
+        /**
+         * 打印备注
+         */
+        @SerializedName("print_remark")
+        private String printRemark;
+
+        /**
+         * 货品种类数
+         */
+        @SerializedName("goods_type_count")
+        private BigDecimal goodsTypeCount;
+
+        /**
+         * 货品总量
+         */
+        @SerializedName("goods_count")
+        private BigDecimal goodsCount;
+
+        /**
+         * 总货款(折前总额)
+         */
+        @SerializedName("goods_amount")
+        private BigDecimal goodsAmount;
+
+        /**
+         * 邮费(买家支付邮费)
+         */
+        @SerializedName("post_amount")
+        private BigDecimal postAmount;
+
+        /**
+         * 其他费用
+         */
+        @SerializedName("other_amount")
+        private BigDecimal otherAmount;
+
+        /**
+         * 优惠
+         */
+        @SerializedName("discount")
+        private BigDecimal discount;
+
+        /**
+         * 应收
+         */
+        @SerializedName("receivable")
+        private BigDecimal receivable;
+
+        /**
+         * COD金额(货到付款金额)
+         */
+        @SerializedName("cod_amount")
+        private BigDecimal codAmount;
+
+        /**
+         * 买家COD费用
+         */
+        @SerializedName("ext_cod_fee")
+        private BigDecimal extCodFee;
+
+        /**
+         * 预估货品成本
+         */
+        @SerializedName("goods_cost")
+        private BigDecimal goodsCost;
+
+        /**
+         * 预估邮资成本
+         */
+        @SerializedName("post_cost")
+        private BigDecimal postCost;
+
+        /**
+         * 预估重量(kg)
+         */
+        @SerializedName("weight")
+        private BigDecimal weight;
+
+        /**
+         * 预估毛利
+         */
+        @SerializedName("profit")
+        private BigDecimal profit;
+
+        /**
+         * 税额
+         */
+        @SerializedName("tax")
+        private BigDecimal tax;
+
+        /**
+         * 税率
+         */
+        @SerializedName("tax_rate")
+        private BigDecimal taxRate;
+
+        /**
+         * 佣金
+         */
+        @SerializedName("commission")
+        private BigDecimal commission;
+
+        /**
+         * 发票类型
+         * 0:不需要 1:普通发票 2:增值税普通发票 3:增值税专用发票
+         */
+        @SerializedName("invoice_type")
+        private Integer invoiceType;
+
+        /**
+         * 发票抬头
+         */
+        @SerializedName("invoice_title")
+        private String invoiceTitle;
+
+        /**
+         * 发票内容
+         */
+        @SerializedName("invoice_content")
+        private String invoiceContent;
+
+        /**
+         * 业务员
+         */
+        @SerializedName("salesman_name")
+        private String salesmanName;
+
+        /**
+         * 审核人
+         */
+        @SerializedName("checker_name")
+        private String checkerName;
+
+        /**
+         * 财审人
+         */
+        @SerializedName("fchecker_name")
+        private String fcheckerName;
+
+        /**
+         * 签出人
+         */
+        @SerializedName("checkouter_name")
+        private String checkouterName;
+
+        /**
+         * 出库单号(系统产生的出库单号)
+         */
+        @SerializedName("stockout_no")
+        private String stockoutNo;
+
+        /**
+         * 标记名称
+         */
+        @SerializedName("flag_name")
+        private String flagName;
+
+        /**
+         * 订单来源
+         * 1、API抓单 2、手工建单 3、导入 4、复制订单 5、接口推送 6、补发订单 7、PDA选货开单 8、分销补发订单
+         */
+        @SerializedName("trade_from")
+        private Integer tradeFrom;
+
+        /**
+         * 货品商家编码,多种货品为空,组合装时为组合装编码
+         */
+        @SerializedName("single_spec_no")
+        private String singleSpecNo;
+
+        /**
+         * 原始货品数量
+         */
+        @SerializedName("raw_goods_count")
+        private BigDecimal rawGoodsCount;
+
+        /**
+         * 原始货品种类数
+         */
+        @SerializedName("raw_goods_type_count")
+        private Integer rawGoodsTypeCount;
+
+        /**
+         * 币种
+         */
+        @SerializedName("currency")
+        private String currency;
+
+        /**
+         * 发票ID(自增生成),0代表没有发票或已取消/已冲红
+         */
+        @SerializedName("invoice_id")
+        private Integer invoiceId;
+
+        /**
+         * 版本号
+         */
+        @SerializedName("version_id")
+        private Integer versionId;
+
+        /**
+         * 修改时间,例如:2020-10-19 00:00:00
+         */
+        @SerializedName("modified")
+        private String modified;
+
+        /**
+         * 递交时间(毫秒级时间戳,例如:1631861379000)
+         */
+        @SerializedName("created")
+        private String created;
+
+        /**
+         * 审核时间
+         */
+        @SerializedName("check_time")
+        private String checkTime;
+
+        /**
+         * 证件类别
+         */
+        @SerializedName("id_card_type")
+        private Integer idCardType;
+
+        /**
+         * 店铺编号
+         */
+        @SerializedName("shop_no")
+        private String shopNo;
+
+        /**
+         * 店铺名称
+         */
+        @SerializedName("shop_name")
+        private String shopName;
+
+        /**
+         * 店铺备注
+         */
+        @SerializedName("shop_remark")
+        private String shopRemark;
+
+        /**
+         * 仓库编号,如订单无仓库的话,则不返回该字段
+         */
+        @SerializedName("warehouse_no")
+        private String warehouseNo;
+
+        /**
+         * 客户姓名
+         */
+        @SerializedName("customer_name")
+        private String customerName;
+
+        /**
+         * 客户编码
+         */
+        @SerializedName("customer_no")
+        private String customerNo;
+
+        /**
+         * 物流公司名称
+         */
+        @SerializedName("logistics_name")
+        private String logisticsName;
+
+        /**
+         * 物流公司编号
+         */
+        @SerializedName("logistics_code")
+        private String logisticsCode;
+
+        /**
+         * 物流类型名称
+         */
+        @SerializedName("logistics_type_name")
+        private String logisticsTypeName;
+
+        /**
+         * 送货时间,例如:2020-10-19 00:00:00
+         */
+        @SerializedName("to_deliver_time")
+        private String toDeliverTime;
+
+        /**
+         * 计划发货时间
+         */
+        @SerializedName("delay_to_time")
+        private String delayToTime;
+
+        /**
+         * 最晚发货时间
+         */
+        @SerializedName("estimate_consign_time")
+        private String estimateConsignTime;
+
+        /**
+         * 店铺id
+         */
+        @SerializedName("shop_id")
+        private Integer shopId;
+
+        /**
+         * 仓库id
+         */
+        @SerializedName("warehouse_id")
+        private Integer warehouseId;
+
+        /**
+         * 体积
+         */
+        @SerializedName("volume")
+        private BigDecimal volume;
+
+        /**
+         * 订单标签
+         */
+        @SerializedName("trade_label")
+        private String tradeLabel;
+
+        /**
+         * 订单掩码
+         * 1:使用智选物流 2:货品标签 4:预订单自动激活失败 16:订单货品指定批次 32:平台自动流转仓库
+         * 64:部分发货 128:全部发货 256:优先占用 512:待分配转审核失败或订单审核失败
+         * 1024:催未付款订单短信发送标记 2048:拆分
+         * 在判断的时候使用&运算
+         */
+        @SerializedName("trade_mask")
+        private Integer tradeMask;
+
+        /**
+         * 店铺平台id
+         */
+        @SerializedName("shop_platform_id")
+        private Integer shopPlatformId;
+
+        /**
+         * 子平台id
+         */
+        @SerializedName("sub_platform_id")
+        private Integer subPlatformId;
+
+        /**
+         * 包装
+         */
+        @SerializedName("package_name")
+        private String packageName;
+
+        /**
+         * 包装id
+         */
+        @SerializedName("package_id")
+        private Integer packageId;
+
+        /**
+         * 包装成本(计划成本)
+         */
+        @SerializedName("package_cost")
+        private BigDecimal packageCost;
+
+        /**
+         * 已付
+         */
+        @SerializedName("paid")
+        private BigDecimal paid;
+
+        /**
+         * 大件类型
+         * 1:普通套件 2:独立套件 3:分组单发,未使用 -1:非单发件
+         */
+        @SerializedName("large_type")
+        private Integer largeType;
+
+        /**
+         * 赠品标记
+         * 1:自动赠送 2:手工赠送 4:回购赠送 8:平台赠送
+         * (注意:如果是3,则表示既有自动赠送也有手工赠送"1+2")
+         */
+        @SerializedName("gift_mask")
+        private Integer giftMask;
+
+        /**
+         * 客户id
+         */
+        @SerializedName("customer_id")
+        private Integer customerId;
+
+        /**
+         * 其他成本
+         */
+        @SerializedName("other_cost")
+        private BigDecimal otherCost;
+
+        /**
+         * 不可合并拆分
+         */
+        @SerializedName("is_sealed")
+        private Boolean isSealed;
+
+        /**
+         * 客户类型(0:普通客户;1:分销商;2:线下批发)
+         */
+        @SerializedName("customer_type")
+        private Integer customerType;
+
+        /**
+         * 物流公司id
+         */
+        @SerializedName("logistics_id")
+        private Integer logisticsId;
+
+        /**
+         * 取消原因
+         */
+        @SerializedName("cancel_reason")
+        private String cancelReason;
+
+        /**
+         * 驳回原因
+         */
+        @SerializedName("revert_reason")
+        private String revertReason;
+
+        /**
+         * 订单标签掩码
+         */
+        @SerializedName("new_trade_label")
+        private String newTradeLabel;
+
+        /**
+         * 分销原始单号(无长度限制)
+         */
+        @SerializedName("fenxiao_tid")
+        private String fenxiaoTid;
+
+        /**
+         * 客户唯一编码
+         */
+        @SerializedName("customer_unique_id")
+        private String customerUniqueId;
+
+        /**
+         * 平台标签
+         */
+        @SerializedName("platform_label")
+        private String platformLabel;
+
+        /**
+         * 分销商编号
+         */
+        @SerializedName("fenxiao_nick_no")
+        private String fenxiaoNickNo;
+
+        /**
+         * 预物流同步单号
+         */
+        @SerializedName("pre_sync_logistics_no")
+        private String preSyncLogisticsNo;
+
+        /**
+         * 预物流同步时间
+         */
+        @SerializedName("pre_sync_time")
+        private String preSyncTime;
+
+        /**
+         * 订单结束时间
+         */
+        @SerializedName("end_time")
+        private String endTime;
+
+        /**
+         * 订单结算时间
+         */
+        @SerializedName("settle_time")
+        private String settleTime;
+
+        /**
+         * 订单便签
+         */
+        @SerializedName("tasks")
+        private String tasks;
+
+        /**
+         * 冻结原因id
+         */
+        @SerializedName("freeze_reason_id")
+        private Integer freezeReasonId;
+
+        /**
+         * 标记id
+         */
+        @SerializedName("flag_id")
+        private Integer flagId;
+
+        /**
+         * 订单明细
+         */
+        @SerializedName("detail_list")
+        private List<OrderDetail> detailList;
+
+        public Long getTradeId() {
+            return tradeId;
+        }
+
+        public void setTradeId(Long tradeId) {
+            this.tradeId = tradeId;
+        }
+
+        public String getTradeNo() {
+            return tradeNo;
+        }
+
+        public void setTradeNo(String tradeNo) {
+            this.tradeNo = tradeNo;
+        }
+
+        public Integer getPlatformId() {
+            return platformId;
+        }
+
+        public void setPlatformId(Integer platformId) {
+            this.platformId = platformId;
+        }
+
+        public Integer getWarehouseType() {
+            return warehouseType;
+        }
+
+        public void setWarehouseType(Integer warehouseType) {
+            this.warehouseType = warehouseType;
+        }
+
+        public String getSrcTids() {
+            return srcTids;
+        }
+
+        public void setSrcTids(String srcTids) {
+            this.srcTids = srcTids;
+        }
+
+        public String getPayAccount() {
+            return payAccount;
+        }
+
+        public void setPayAccount(String payAccount) {
+            this.payAccount = payAccount;
+        }
+
+        public Integer getTradeStatus() {
+            return tradeStatus;
+        }
+
+        public void setTradeStatus(Integer tradeStatus) {
+            this.tradeStatus = tradeStatus;
+        }
+
+        public Integer getTradeType() {
+            return tradeType;
+        }
+
+        public void setTradeType(Integer tradeType) {
+            this.tradeType = tradeType;
+        }
+
+        public Integer getDeliveryTerm() {
+            return deliveryTerm;
+        }
+
+        public void setDeliveryTerm(Integer deliveryTerm) {
+            this.deliveryTerm = deliveryTerm;
+        }
+
+        public String getReceiverRing() {
+            return receiverRing;
+        }
+
+        public void setReceiverRing(String receiverRing) {
+            this.receiverRing = receiverRing;
+        }
+
+        public String getFreezeReason() {
+            return freezeReason;
+        }
+
+        public void setFreezeReason(String freezeReason) {
+            this.freezeReason = freezeReason;
+        }
+
+        public Integer getRefundStatus() {
+            return refundStatus;
+        }
+
+        public void setRefundStatus(Integer refundStatus) {
+            this.refundStatus = refundStatus;
+        }
+
+        public Integer getFenxiaoType() {
+            return fenxiaoType;
+        }
+
+        public void setFenxiaoType(Integer fenxiaoType) {
+            this.fenxiaoType = fenxiaoType;
+        }
+
+        public String getFenxiaoNick() {
+            return fenxiaoNick;
+        }
+
+        public void setFenxiaoNick(String fenxiaoNick) {
+            this.fenxiaoNick = fenxiaoNick;
+        }
+
+        public String getTradeTime() {
+            return tradeTime;
+        }
+
+        public void setTradeTime(String tradeTime) {
+            this.tradeTime = tradeTime;
+        }
+
+        public String getPayTime() {
+            return payTime;
+        }
+
+        public void setPayTime(String payTime) {
+            this.payTime = payTime;
+        }
+
+        public String getConsignTime() {
+            return consignTime;
+        }
+
+        public void setConsignTime(String consignTime) {
+            this.consignTime = consignTime;
+        }
+
+        public String getBuyerNick() {
+            return buyerNick;
+        }
+
+        public void setBuyerNick(String buyerNick) {
+            this.buyerNick = buyerNick;
+        }
+
+        public String getReceiverName() {
+            return receiverName;
+        }
+
+        public void setReceiverName(String receiverName) {
+            this.receiverName = receiverName;
+        }
+
+        public Integer getReceiverProvince() {
+            return receiverProvince;
+        }
+
+        public void setReceiverProvince(Integer receiverProvince) {
+            this.receiverProvince = receiverProvince;
+        }
+
+        public Integer getReceiverCity() {
+            return receiverCity;
+        }
+
+        public void setReceiverCity(Integer receiverCity) {
+            this.receiverCity = receiverCity;
+        }
+
+        public Integer getReceiverDistrict() {
+            return receiverDistrict;
+        }
+
+        public void setReceiverDistrict(Integer receiverDistrict) {
+            this.receiverDistrict = receiverDistrict;
+        }
+
+        public String getReceiverAddress() {
+            return receiverAddress;
+        }
+
+        public void setReceiverAddress(String receiverAddress) {
+            this.receiverAddress = receiverAddress;
+        }
+
+        public String getReceiverMobile() {
+            return receiverMobile;
+        }
+
+        public void setReceiverMobile(String receiverMobile) {
+            this.receiverMobile = receiverMobile;
+        }
+
+        public String getReceiverTelno() {
+            return receiverTelno;
+        }
+
+        public void setReceiverTelno(String receiverTelno) {
+            this.receiverTelno = receiverTelno;
+        }
+
+        public String getReceiverZip() {
+            return receiverZip;
+        }
+
+        public void setReceiverZip(String receiverZip) {
+            this.receiverZip = receiverZip;
+        }
+
+        public String getReceiverArea() {
+            return receiverArea;
+        }
+
+        public void setReceiverArea(String receiverArea) {
+            this.receiverArea = receiverArea;
+        }
+
+        public String getReceiverDtb() {
+            return receiverDtb;
+        }
+
+        public void setReceiverDtb(String receiverDtb) {
+            this.receiverDtb = receiverDtb;
+        }
+
+        public Integer getBadReason() {
+            return badReason;
+        }
+
+        public void setBadReason(Integer badReason) {
+            this.badReason = badReason;
+        }
+
+        public String getLogisticsNo() {
+            return logisticsNo;
+        }
+
+        public void setLogisticsNo(String logisticsNo) {
+            this.logisticsNo = logisticsNo;
+        }
+
+        public String getBuyerMessage() {
+            return buyerMessage;
+        }
+
+        public void setBuyerMessage(String buyerMessage) {
+            this.buyerMessage = buyerMessage;
+        }
+
+        public String getCsRemark() {
+            return csRemark;
+        }
+
+        public void setCsRemark(String csRemark) {
+            this.csRemark = csRemark;
+        }
+
+        public Integer getRemarkFlag() {
+            return remarkFlag;
+        }
+
+        public void setRemarkFlag(Integer remarkFlag) {
+            this.remarkFlag = remarkFlag;
+        }
+
+        public String getPrintRemark() {
+            return printRemark;
+        }
+
+        public void setPrintRemark(String printRemark) {
+            this.printRemark = printRemark;
+        }
+
+        public BigDecimal getGoodsTypeCount() {
+            return goodsTypeCount;
+        }
+
+        public void setGoodsTypeCount(BigDecimal goodsTypeCount) {
+            this.goodsTypeCount = goodsTypeCount;
+        }
+
+        public BigDecimal getGoodsCount() {
+            return goodsCount;
+        }
+
+        public void setGoodsCount(BigDecimal goodsCount) {
+            this.goodsCount = goodsCount;
+        }
+
+        public BigDecimal getGoodsAmount() {
+            return goodsAmount;
+        }
+
+        public void setGoodsAmount(BigDecimal goodsAmount) {
+            this.goodsAmount = goodsAmount;
+        }
+
+        public BigDecimal getPostAmount() {
+            return postAmount;
+        }
+
+        public void setPostAmount(BigDecimal postAmount) {
+            this.postAmount = postAmount;
+        }
+
+        public BigDecimal getOtherAmount() {
+            return otherAmount;
+        }
+
+        public void setOtherAmount(BigDecimal otherAmount) {
+            this.otherAmount = otherAmount;
+        }
+
+        public BigDecimal getDiscount() {
+            return discount;
+        }
+
+        public void setDiscount(BigDecimal discount) {
+            this.discount = discount;
+        }
+
+        public BigDecimal getReceivable() {
+            return receivable;
+        }
+
+        public void setReceivable(BigDecimal receivable) {
+            this.receivable = receivable;
+        }
+
+        public BigDecimal getCodAmount() {
+            return codAmount;
+        }
+
+        public void setCodAmount(BigDecimal codAmount) {
+            this.codAmount = codAmount;
+        }
+
+        public BigDecimal getExtCodFee() {
+            return extCodFee;
+        }
+
+        public void setExtCodFee(BigDecimal extCodFee) {
+            this.extCodFee = extCodFee;
+        }
+
+        public BigDecimal getGoodsCost() {
+            return goodsCost;
+        }
+
+        public void setGoodsCost(BigDecimal goodsCost) {
+            this.goodsCost = goodsCost;
+        }
+
+        public BigDecimal getPostCost() {
+            return postCost;
+        }
+
+        public void setPostCost(BigDecimal postCost) {
+            this.postCost = postCost;
+        }
+
+        public BigDecimal getWeight() {
+            return weight;
+        }
+
+        public void setWeight(BigDecimal weight) {
+            this.weight = weight;
+        }
+
+        public BigDecimal getProfit() {
+            return profit;
+        }
+
+        public void setProfit(BigDecimal profit) {
+            this.profit = profit;
+        }
+
+        public BigDecimal getTax() {
+            return tax;
+        }
+
+        public void setTax(BigDecimal tax) {
+            this.tax = tax;
+        }
+
+        public BigDecimal getTaxRate() {
+            return taxRate;
+        }
+
+        public void setTaxRate(BigDecimal taxRate) {
+            this.taxRate = taxRate;
+        }
+
+        public BigDecimal getCommission() {
+            return commission;
+        }
+
+        public void setCommission(BigDecimal commission) {
+            this.commission = commission;
+        }
+
+        public Integer getInvoiceType() {
+            return invoiceType;
+        }
+
+        public void setInvoiceType(Integer invoiceType) {
+            this.invoiceType = invoiceType;
+        }
+
+        public String getInvoiceTitle() {
+            return invoiceTitle;
+        }
+
+        public void setInvoiceTitle(String invoiceTitle) {
+            this.invoiceTitle = invoiceTitle;
+        }
+
+        public String getInvoiceContent() {
+            return invoiceContent;
+        }
+
+        public void setInvoiceContent(String invoiceContent) {
+            this.invoiceContent = invoiceContent;
+        }
+
+        public String getSalesmanName() {
+            return salesmanName;
+        }
+
+        public void setSalesmanName(String salesmanName) {
+            this.salesmanName = salesmanName;
+        }
+
+        public String getCheckerName() {
+            return checkerName;
+        }
+
+        public void setCheckerName(String checkerName) {
+            this.checkerName = checkerName;
+        }
+
+        public String getFcheckerName() {
+            return fcheckerName;
+        }
+
+        public void setFcheckerName(String fcheckerName) {
+            this.fcheckerName = fcheckerName;
+        }
+
+        public String getCheckouterName() {
+            return checkouterName;
+        }
+
+        public void setCheckouterName(String checkouterName) {
+            this.checkouterName = checkouterName;
+        }
+
+        public String getStockoutNo() {
+            return stockoutNo;
+        }
+
+        public void setStockoutNo(String stockoutNo) {
+            this.stockoutNo = stockoutNo;
+        }
+
+        public String getFlagName() {
+            return flagName;
+        }
+
+        public void setFlagName(String flagName) {
+            this.flagName = flagName;
+        }
+
+        public Integer getTradeFrom() {
+            return tradeFrom;
+        }
+
+        public void setTradeFrom(Integer tradeFrom) {
+            this.tradeFrom = tradeFrom;
+        }
+
+        public String getSingleSpecNo() {
+            return singleSpecNo;
+        }
+
+        public void setSingleSpecNo(String singleSpecNo) {
+            this.singleSpecNo = singleSpecNo;
+        }
+
+        public BigDecimal getRawGoodsCount() {
+            return rawGoodsCount;
+        }
+
+        public void setRawGoodsCount(BigDecimal rawGoodsCount) {
+            this.rawGoodsCount = rawGoodsCount;
+        }
+
+        public Integer getRawGoodsTypeCount() {
+            return rawGoodsTypeCount;
+        }
+
+        public void setRawGoodsTypeCount(Integer rawGoodsTypeCount) {
+            this.rawGoodsTypeCount = rawGoodsTypeCount;
+        }
+
+        public String getCurrency() {
+            return currency;
+        }
+
+        public void setCurrency(String currency) {
+            this.currency = currency;
+        }
+
+        public Integer getInvoiceId() {
+            return invoiceId;
+        }
+
+        public void setInvoiceId(Integer invoiceId) {
+            this.invoiceId = invoiceId;
+        }
+
+        public Integer getVersionId() {
+            return versionId;
+        }
+
+        public void setVersionId(Integer versionId) {
+            this.versionId = versionId;
+        }
+
+        public String getModified() {
+            return modified;
+        }
+
+        public void setModified(String modified) {
+            this.modified = modified;
+        }
+
+        public String getCreated() {
+            return created;
+        }
+
+        public void setCreated(String created) {
+            this.created = created;
+        }
+
+        public String getCheckTime() {
+            return checkTime;
+        }
+
+        public void setCheckTime(String checkTime) {
+            this.checkTime = checkTime;
+        }
+
+        public Integer getIdCardType() {
+            return idCardType;
+        }
+
+        public void setIdCardType(Integer idCardType) {
+            this.idCardType = idCardType;
+        }
+
+        public String getShopNo() {
+            return shopNo;
+        }
+
+        public void setShopNo(String shopNo) {
+            this.shopNo = shopNo;
+        }
+
+        public String getShopName() {
+            return shopName;
+        }
+
+        public void setShopName(String shopName) {
+            this.shopName = shopName;
+        }
+
+        public String getShopRemark() {
+            return shopRemark;
+        }
+
+        public void setShopRemark(String shopRemark) {
+            this.shopRemark = shopRemark;
+        }
+
+        public String getWarehouseNo() {
+            return warehouseNo;
+        }
+
+        public void setWarehouseNo(String warehouseNo) {
+            this.warehouseNo = warehouseNo;
+        }
+
+        public String getCustomerName() {
+            return customerName;
+        }
+
+        public void setCustomerName(String customerName) {
+            this.customerName = customerName;
+        }
+
+        public String getCustomerNo() {
+            return customerNo;
+        }
+
+        public void setCustomerNo(String customerNo) {
+            this.customerNo = customerNo;
+        }
+
+        public String getLogisticsName() {
+            return logisticsName;
+        }
+
+        public void setLogisticsName(String logisticsName) {
+            this.logisticsName = logisticsName;
+        }
+
+        public String getLogisticsCode() {
+            return logisticsCode;
+        }
+
+        public void setLogisticsCode(String logisticsCode) {
+            this.logisticsCode = logisticsCode;
+        }
+
+        public String getLogisticsTypeName() {
+            return logisticsTypeName;
+        }
+
+        public void setLogisticsTypeName(String logisticsTypeName) {
+            this.logisticsTypeName = logisticsTypeName;
+        }
+
+        public String getToDeliverTime() {
+            return toDeliverTime;
+        }
+
+        public void setToDeliverTime(String toDeliverTime) {
+            this.toDeliverTime = toDeliverTime;
+        }
+
+        public String getDelayToTime() {
+            return delayToTime;
+        }
+
+        public void setDelayToTime(String delayToTime) {
+            this.delayToTime = delayToTime;
+        }
+
+        public String getEstimateConsignTime() {
+            return estimateConsignTime;
+        }
+
+        public void setEstimateConsignTime(String estimateConsignTime) {
+            this.estimateConsignTime = estimateConsignTime;
+        }
+
+        public Integer getShopId() {
+            return shopId;
+        }
+
+        public void setShopId(Integer shopId) {
+            this.shopId = shopId;
+        }
+
+        public Integer getWarehouseId() {
+            return warehouseId;
+        }
+
+        public void setWarehouseId(Integer warehouseId) {
+            this.warehouseId = warehouseId;
+        }
+
+        public BigDecimal getVolume() {
+            return volume;
+        }
+
+        public void setVolume(BigDecimal volume) {
+            this.volume = volume;
+        }
+
+        public String getTradeLabel() {
+            return tradeLabel;
+        }
+
+        public void setTradeLabel(String tradeLabel) {
+            this.tradeLabel = tradeLabel;
+        }
+
+        public Integer getTradeMask() {
+            return tradeMask;
+        }
+
+        public void setTradeMask(Integer tradeMask) {
+            this.tradeMask = tradeMask;
+        }
+
+        public Integer getShopPlatformId() {
+            return shopPlatformId;
+        }
+
+        public void setShopPlatformId(Integer shopPlatformId) {
+            this.shopPlatformId = shopPlatformId;
+        }
+
+        public Integer getSubPlatformId() {
+            return subPlatformId;
+        }
+
+        public void setSubPlatformId(Integer subPlatformId) {
+            this.subPlatformId = subPlatformId;
+        }
+
+        public String getPackageName() {
+            return packageName;
+        }
+
+        public void setPackageName(String packageName) {
+            this.packageName = packageName;
+        }
+
+        public Integer getPackageId() {
+            return packageId;
+        }
+
+        public void setPackageId(Integer packageId) {
+            this.packageId = packageId;
+        }
+
+        public BigDecimal getPackageCost() {
+            return packageCost;
+        }
+
+        public void setPackageCost(BigDecimal packageCost) {
+            this.packageCost = packageCost;
+        }
+
+        public BigDecimal getPaid() {
+            return paid;
+        }
+
+        public void setPaid(BigDecimal paid) {
+            this.paid = paid;
+        }
+
+        public Integer getLargeType() {
+            return largeType;
+        }
+
+        public void setLargeType(Integer largeType) {
+            this.largeType = largeType;
+        }
+
+        public Integer getGiftMask() {
+            return giftMask;
+        }
+
+        public void setGiftMask(Integer giftMask) {
+            this.giftMask = giftMask;
+        }
+
+        public Integer getCustomerId() {
+            return customerId;
+        }
+
+        public void setCustomerId(Integer customerId) {
+            this.customerId = customerId;
+        }
+
+        public BigDecimal getOtherCost() {
+            return otherCost;
+        }
+
+        public void setOtherCost(BigDecimal otherCost) {
+            this.otherCost = otherCost;
+        }
+
+        public Boolean getSealed() {
+            return isSealed;
+        }
+
+        public void setSealed(Boolean sealed) {
+            isSealed = sealed;
+        }
+
+        public Integer getCustomerType() {
+            return customerType;
+        }
+
+        public void setCustomerType(Integer customerType) {
+            this.customerType = customerType;
+        }
+
+        public Integer getLogisticsId() {
+            return logisticsId;
+        }
+
+        public void setLogisticsId(Integer logisticsId) {
+            this.logisticsId = logisticsId;
+        }
+
+        public String getCancelReason() {
+            return cancelReason;
+        }
+
+        public void setCancelReason(String cancelReason) {
+            this.cancelReason = cancelReason;
+        }
+
+        public String getRevertReason() {
+            return revertReason;
+        }
+
+        public void setRevertReason(String revertReason) {
+            this.revertReason = revertReason;
+        }
+
+        public String getNewTradeLabel() {
+            return newTradeLabel;
+        }
+
+        public void setNewTradeLabel(String newTradeLabel) {
+            this.newTradeLabel = newTradeLabel;
+        }
+
+        public String getFenxiaoTid() {
+            return fenxiaoTid;
+        }
+
+        public void setFenxiaoTid(String fenxiaoTid) {
+            this.fenxiaoTid = fenxiaoTid;
+        }
+
+        public String getCustomerUniqueId() {
+            return customerUniqueId;
+        }
+
+        public void setCustomerUniqueId(String customerUniqueId) {
+            this.customerUniqueId = customerUniqueId;
+        }
+
+        public String getPlatformLabel() {
+            return platformLabel;
+        }
+
+        public void setPlatformLabel(String platformLabel) {
+            this.platformLabel = platformLabel;
+        }
+
+        public String getFenxiaoNickNo() {
+            return fenxiaoNickNo;
+        }
+
+        public void setFenxiaoNickNo(String fenxiaoNickNo) {
+            this.fenxiaoNickNo = fenxiaoNickNo;
+        }
+
+        public String getPreSyncLogisticsNo() {
+            return preSyncLogisticsNo;
+        }
+
+        public void setPreSyncLogisticsNo(String preSyncLogisticsNo) {
+            this.preSyncLogisticsNo = preSyncLogisticsNo;
+        }
+
+        public String getPreSyncTime() {
+            return preSyncTime;
+        }
+
+        public void setPreSyncTime(String preSyncTime) {
+            this.preSyncTime = preSyncTime;
+        }
+
+        public String getEndTime() {
+            return endTime;
+        }
+
+        public void setEndTime(String endTime) {
+            this.endTime = endTime;
+        }
+
+        public String getSettleTime() {
+            return settleTime;
+        }
+
+        public void setSettleTime(String settleTime) {
+            this.settleTime = settleTime;
+        }
+
+        public String getTasks() {
+            return tasks;
+        }
+
+        public void setTasks(String tasks) {
+            this.tasks = tasks;
+        }
+
+        public Integer getFreezeReasonId() {
+            return freezeReasonId;
+        }
+
+        public void setFreezeReasonId(Integer freezeReasonId) {
+            this.freezeReasonId = freezeReasonId;
+        }
+
+        public Integer getFlagId() {
+            return flagId;
+        }
+
+        public void setFlagId(Integer flagId) {
+            this.flagId = flagId;
+        }
+
+        public List<OrderDetail> getDetailList() {
+            return detailList;
+        }
+
+        public void setDetailList(List<OrderDetail> detailList) {
+            this.detailList = detailList;
+        }
+    }
+
+    /**
+     * 订单明细实体类
+     */
+    public static class OrderDetail {
+
+        /**
+         * 订单唯一键
+         */
+        @SerializedName("trade_id")
+        private Long tradeId;
+
+        /**
+         * 订单明细唯一键
+         */
+        @SerializedName("rec_id")
+        private Long recId;
+
+        /**
+         * 平台ID
+         */
+        @SerializedName("platform_id")
+        private Integer platformId;
+
+        /**
+         * 原始子单号
+         */
+        @SerializedName("src_oid")
+        private String srcOid;
+
+        /**
+         * 原始单号
+         */
+        @SerializedName("src_tid")
+        private String srcTid;
+
+        /**
+         * 赠品方式
+         * 0非赠品 1自动赠送 2手工赠送 4周期购赠送 8平台赠送 32阶梯满赠 64CRM追加赠送 65 主品
+         */
+        @SerializedName("gift_type")
+        private Integer giftType;
+
+        /**
+         * 支付状态(0:未付款 1:部分付款 2:已付款)
+         */
+        @SerializedName("pay_status")
+        private Integer payStatus;
+
+        /**
+         * 退款状态
+         * 0、无退款 1、取消退款 2、申请退款 3、待退款 4、待还原 5、退款成功 6、已退(未付款关闭)
+         */
+        @SerializedName("refund_status")
+        private Integer refundStatus;
+
+        /**
+         * 退款模式(1、担保 2、非担保 3、在线非担保)
+         */
+        @SerializedName("guarantee_mode")
+        private Integer guaranteeMode;
+
+        /**
+         * 子单平台状态
+         * 10、未确认 20、待尾款 30、待发货 40、部分发货 50、已发货 60、已签收 70、已完成 80、已退款 90、已关闭
+         */
+        @SerializedName("platform_status")
+        private Integer platformStatus;
+
+        /**
+         * 发货条件(1、款到发货 2、货到付款(包含部分货到付款) 3、分期付款)
+         */
+        @SerializedName("delivery_term")
+        private Integer deliveryTerm;
+
+        /**
+         * 数量
+         */
+        @SerializedName("num")
+        private BigDecimal num;
+
+        /**
+         * 标价,手工新建时使用货品属性中的"零售价"
+         */
+        @SerializedName("price")
+        private BigDecimal price;
+
+        /**
+         * 售后退款数量
+         */
+        @SerializedName("refund_num")
+        private BigDecimal refundNum;
+
+        /**
+         * 成交价,原始单折扣及分摊之后的价格
+         */
+        @SerializedName("order_price")
+        private BigDecimal orderPrice;
+
+        /**
+         * 分摊后价格,进入ERP后再次调整的价格,默认值与order_price一致
+         */
+        @SerializedName("share_price")
+        private BigDecimal sharePrice;
+
+        /**
+         * 手工调整价,正数为加价,负数为减价,暂未处理
+         */
+        @SerializedName("adjust")
+        private BigDecimal adjust;
+
+        /**
+         * 优惠
+         */
+        @SerializedName("discount")
+        private BigDecimal discount;
+
+        /**
+         * 分摊后总价
+         */
+        @SerializedName("share_amount")
+        private BigDecimal shareAmount;
+
+        /**
+         * 税率
+         */
+        @SerializedName("tax_rate")
+        private BigDecimal taxRate;
+
+        /**
+         * 货品名称
+         */
+        @SerializedName("goods_name")
+        private String goodsName;
+
+        /**
+         * 货品编号
+         */
+        @SerializedName("goods_no")
+        private String goodsNo;
+
+        /**
+         * 规格名称
+         */
+        @SerializedName("spec_name")
+        private String specName;
+
+        /**
+         * 商家编码
+         */
+        @SerializedName("spec_no")
+        private String specNo;
+
+        /**
+         * 规格码
+         */
+        @SerializedName("spec_code")
+        private String specCode;
+
+        /**
+         * 组合装编码
+         */
+        @SerializedName("suite_no")
+        private String suiteNo;
+
+        /**
+         * 如果是组合装拆分的,此为组合装名称
+         */
+        @SerializedName("suite_name")
+        private String suiteName;
+
+        /**
+         * 组合装数量,不受拆分合并影响
+         */
+        @SerializedName("suite_num")
+        private BigDecimal suiteNum;
+
+        /**
+         * 组合装分摊后总价
+         */
+        @SerializedName("suite_amount")
+        private BigDecimal suiteAmount;
+
+        /**
+         * 组合装优惠
+         */
+        @SerializedName("suite_discount")
+        private BigDecimal suiteDiscount;
+
+        /**
+         * 平台货品名称
+         */
+        @SerializedName("api_goods_name")
+        private String apiGoodsName;
+
+        /**
+         * 平台规格名称
+         */
+        @SerializedName("api_spec_name")
+        private String apiSpecName;
+
+        /**
+         * 平台货品id
+         */
+        @SerializedName("api_goods_id")
+        private String apiGoodsId;
+
+        /**
+         * 平台规格id
+         */
+        @SerializedName("api_spec_id")
+        private String apiSpecId;
+
+        /**
+         * 货品id(系统货品主键)
+         */
+        @SerializedName("goods_id")
+        private Integer goodsId;
+
+        /**
+         * 单品id(系统单品主键)
+         */
+        @SerializedName("spec_id")
+        private Integer specId;
+
+        /**
+         * 佣金
+         */
+        @SerializedName("commission")
+        private BigDecimal commission;
+
+        /**
+         * 货品类型
+         * 0:其它 1:销售货品 2:原材料 3:包装物 4:周转材料 5:虚拟商品 6:固定资产 8:分装箱
+         */
+        @SerializedName("goods_type")
+        private Integer goodsType;
+
+        /**
+         * 订单内部来源
+         * 0:无来源 1:手机 2:聚划算 32:开具电子发票 2048:当日达 4096:次日达 8192:承诺时效
+         * 2097152:区域零售 4194304:拼多多厂家代打 8388608:周期购 1048576:预售单
+         * 33554432:前N有礼 524288:天猫物流升级 64:按需配送 256:承诺结构化/QIC 16384:商仓鸟配
+         */
+        @SerializedName("from_mask")
+        private Integer fromMask;
+
+        /**
+         * 订单内部来源扩展
+         * 2:小时达订单 4:自选物流 16:国补订单
+         */
+        @SerializedName("from_mask_ext")
+        private Integer fromMaskExt;
+
+        /**
+         * 子单备注
+         */
+        @SerializedName("remark")
+        private String remark;
+
+        /**
+         * 修改时间(毫秒级时间戳,例如:1631861379000)
+         */
+        @SerializedName("modified")
+        private String modified;
+
+        /**
+         * 创建时间(毫秒级时间戳,例如:1631861379000)
+         */
+        @SerializedName("created")
+        private String created;
+
+        /**
+         * 单品自定义属性1
+         */
+        @SerializedName("prop1")
+        private String prop1;
+
+        /**
+         * 单品自定义属性2
+         */
+        @SerializedName("prop2")
+        private String prop2;
+
+        /**
+         * 单品自定义属性3
+         */
+        @SerializedName("prop3")
+        private String prop3;
+
+        /**
+         * 单品自定义属性4
+         */
+        @SerializedName("prop4")
+        private String prop4;
+
+        /**
+         * 单品自定义属性5
+         */
+        @SerializedName("prop5")
+        private String prop5;
+
+        /**
+         * 单品自定义属性6
+         */
+        @SerializedName("prop6")
+        private String prop6;
+
+        /**
+         * 货品重量(子单预估货品总重量)
+         */
+        @SerializedName("weight")
+        private BigDecimal weight;
+
+        /**
+         * 图片路径
+         */
+        @SerializedName("img_url")
+        private String imgUrl;
+
+        /**
+         * 实发数量(此数量为发货数量,删除操作等于将此值设置为0)
+         */
+        @SerializedName("actual_num")
+        private BigDecimal actualNum;
+
+        /**
+         * 条码
+         */
+        @SerializedName("barcode")
+        private String barcode;
+
+        /**
+         * 已付
+         */
+        @SerializedName("paid")
+        private BigDecimal paid;
+
+        /**
+         * 组合装id
+         */
+        @SerializedName("suite_id")
+        private Integer suiteId;
+
+        /**
+         * bind_oid
+         */
+        @SerializedName("bind_oid")
+        private String bindOid;
+
+        /**
+         * 打印组合装(0:组合装明细 1:组合装及明细 2:组合装)
+         */
+        @SerializedName("print_suite_mode")
+        private Integer printSuiteMode;
+
+        /**
+         * 天猫物流升级信息(mask类型值,在判断的时候使用&运算)
+         * 1:天猫物流升级-顺丰配送 2:需要回传 4:天猫物流升级-按需配送 8:天猫物流升级-承诺发货时效
+         * 16:天猫物流升级-承诺达时效 32:天猫物流升级-预售下沉 64:天猫物流升级-预计到货时效
+         * 128:天猫物流升级-配送线路异常 1024:定金链接 2048:补款链接 4096:确认收货
+         */
+        @SerializedName("flag")
+        private Integer flag;
+
+        /**
+         * 库存保留情况
+         * 0:未保留(取消的订单或完成) 1:无库存记录 2:未付款 3:已保留待审核 4:待发货 5:预订单库存
+         */
+        @SerializedName("stock_state")
+        private Integer stockState;
+
+        /**
+         * 平台已发货
+         */
+        @SerializedName("is_consigned")
+        private Boolean isConsigned;
+
+        /**
+         * 是否付款
+         */
+        @SerializedName("is_received")
+        private Integer isReceived;
+
+        /**
+         * 平台类目主键
+         */
+        @SerializedName("cid")
+        private Integer cid;
+
+        /**
+         * 最后更新时间,DateTime格式
+         */
+        @SerializedName("modified_date")
+        private String modifiedDate;
+
+        /**
+         * 创建时间,DateTime格式
+         */
+        @SerializedName("created_date")
+        private String createdDate;
+
+        /**
+         * 分摊邮费
+         */
+        @SerializedName("share_post_price")
+        private BigDecimal sharePostPrice;
+
+        /**
+         * 发票内容
+         */
+        @SerializedName("invoice_content")
+        private String invoiceContent;
+
+        /**
+         * 支付时间,DateTime格式,取自原始订单支付时间
+         */
+        @SerializedName("pay_time")
+        private String payTime;
+
+        /**
+         * 货品简称
+         */
+        @SerializedName("short_name")
+        private String shortName;
+
+        /**
+         * 赠品关联关系
+         */
+        @SerializedName("goods_gift_relation")
+        private String goodsGiftRelation;
+
+        /**
+         * 成本价
+         */
+        @SerializedName("avg_cost")
+        private BigDecimal avgCost;
+
+        /**
+         * 分类名称
+         */
+        @SerializedName("class_name")
+        private String className;
+
+        /**
+         * 基本单位id
+         */
+        @SerializedName("base_unit_id")
+        private Integer baseUnitId;
+
+        /**
+         * 基本单位名称
+         */
+        @SerializedName("base_unit_name")
+        private String baseUnitName;
+
+        /**
+         * 分销商id
+         */
+        @SerializedName("fenxiao_rec_id")
+        private Integer fenxiaoRecId;
+
+        public Long getTradeId() {
+            return tradeId;
+        }
+
+        public void setTradeId(Long tradeId) {
+            this.tradeId = tradeId;
+        }
+
+        public Long getRecId() {
+            return recId;
+        }
+
+        public void setRecId(Long recId) {
+            this.recId = recId;
+        }
+
+        public Integer getPlatformId() {
+            return platformId;
+        }
+
+        public void setPlatformId(Integer platformId) {
+            this.platformId = platformId;
+        }
+
+        public String getSrcOid() {
+            return srcOid;
+        }
+
+        public void setSrcOid(String srcOid) {
+            this.srcOid = srcOid;
+        }
+
+        public String getSrcTid() {
+            return srcTid;
+        }
+
+        public void setSrcTid(String srcTid) {
+            this.srcTid = srcTid;
+        }
+
+        public Integer getGiftType() {
+            return giftType;
+        }
+
+        public void setGiftType(Integer giftType) {
+            this.giftType = giftType;
+        }
+
+        public Integer getPayStatus() {
+            return payStatus;
+        }
+
+        public void setPayStatus(Integer payStatus) {
+            this.payStatus = payStatus;
+        }
+
+        public Integer getRefundStatus() {
+            return refundStatus;
+        }
+
+        public void setRefundStatus(Integer refundStatus) {
+            this.refundStatus = refundStatus;
+        }
+
+        public Integer getGuaranteeMode() {
+            return guaranteeMode;
+        }
+
+        public void setGuaranteeMode(Integer guaranteeMode) {
+            this.guaranteeMode = guaranteeMode;
+        }
+
+        public Integer getPlatformStatus() {
+            return platformStatus;
+        }
+
+        public void setPlatformStatus(Integer platformStatus) {
+            this.platformStatus = platformStatus;
+        }
+
+        public Integer getDeliveryTerm() {
+            return deliveryTerm;
+        }
+
+        public void setDeliveryTerm(Integer deliveryTerm) {
+            this.deliveryTerm = deliveryTerm;
+        }
+
+        public BigDecimal getNum() {
+            return num;
+        }
+
+        public void setNum(BigDecimal num) {
+            this.num = num;
+        }
+
+        public BigDecimal getPrice() {
+            return price;
+        }
+
+        public void setPrice(BigDecimal price) {
+            this.price = price;
+        }
+
+        public BigDecimal getRefundNum() {
+            return refundNum;
+        }
+
+        public void setRefundNum(BigDecimal refundNum) {
+            this.refundNum = refundNum;
+        }
+
+        public BigDecimal getOrderPrice() {
+            return orderPrice;
+        }
+
+        public void setOrderPrice(BigDecimal orderPrice) {
+            this.orderPrice = orderPrice;
+        }
+
+        public BigDecimal getSharePrice() {
+            return sharePrice;
+        }
+
+        public void setSharePrice(BigDecimal sharePrice) {
+            this.sharePrice = sharePrice;
+        }
+
+        public BigDecimal getAdjust() {
+            return adjust;
+        }
+
+        public void setAdjust(BigDecimal adjust) {
+            this.adjust = adjust;
+        }
+
+        public BigDecimal getDiscount() {
+            return discount;
+        }
+
+        public void setDiscount(BigDecimal discount) {
+            this.discount = discount;
+        }
+
+        public BigDecimal getShareAmount() {
+            return shareAmount;
+        }
+
+        public void setShareAmount(BigDecimal shareAmount) {
+            this.shareAmount = shareAmount;
+        }
+
+        public BigDecimal getTaxRate() {
+            return taxRate;
+        }
+
+        public void setTaxRate(BigDecimal taxRate) {
+            this.taxRate = taxRate;
+        }
+
+        public String getGoodsName() {
+            return goodsName;
+        }
+
+        public void setGoodsName(String goodsName) {
+            this.goodsName = goodsName;
+        }
+
+        public String getGoodsNo() {
+            return goodsNo;
+        }
+
+        public void setGoodsNo(String goodsNo) {
+            this.goodsNo = goodsNo;
+        }
+
+        public String getSpecName() {
+            return specName;
+        }
+
+        public void setSpecName(String specName) {
+            this.specName = specName;
+        }
+
+        public String getSpecNo() {
+            return specNo;
+        }
+
+        public void setSpecNo(String specNo) {
+            this.specNo = specNo;
+        }
+
+        public String getSpecCode() {
+            return specCode;
+        }
+
+        public void setSpecCode(String specCode) {
+            this.specCode = specCode;
+        }
+
+        public String getSuiteNo() {
+            return suiteNo;
+        }
+
+        public void setSuiteNo(String suiteNo) {
+            this.suiteNo = suiteNo;
+        }
+
+        public String getSuiteName() {
+            return suiteName;
+        }
+
+        public void setSuiteName(String suiteName) {
+            this.suiteName = suiteName;
+        }
+
+        public BigDecimal getSuiteNum() {
+            return suiteNum;
+        }
+
+        public void setSuiteNum(BigDecimal suiteNum) {
+            this.suiteNum = suiteNum;
+        }
+
+        public BigDecimal getSuiteAmount() {
+            return suiteAmount;
+        }
+
+        public void setSuiteAmount(BigDecimal suiteAmount) {
+            this.suiteAmount = suiteAmount;
+        }
+
+        public BigDecimal getSuiteDiscount() {
+            return suiteDiscount;
+        }
+
+        public void setSuiteDiscount(BigDecimal suiteDiscount) {
+            this.suiteDiscount = suiteDiscount;
+        }
+
+        public String getApiGoodsName() {
+            return apiGoodsName;
+        }
+
+        public void setApiGoodsName(String apiGoodsName) {
+            this.apiGoodsName = apiGoodsName;
+        }
+
+        public String getApiSpecName() {
+            return apiSpecName;
+        }
+
+        public void setApiSpecName(String apiSpecName) {
+            this.apiSpecName = apiSpecName;
+        }
+
+        public String getApiGoodsId() {
+            return apiGoodsId;
+        }
+
+        public void setApiGoodsId(String apiGoodsId) {
+            this.apiGoodsId = apiGoodsId;
+        }
+
+        public String getApiSpecId() {
+            return apiSpecId;
+        }
+
+        public void setApiSpecId(String apiSpecId) {
+            this.apiSpecId = apiSpecId;
+        }
+
+        public Integer getGoodsId() {
+            return goodsId;
+        }
+
+        public void setGoodsId(Integer goodsId) {
+            this.goodsId = goodsId;
+        }
+
+        public Integer getSpecId() {
+            return specId;
+        }
+
+        public void setSpecId(Integer specId) {
+            this.specId = specId;
+        }
+
+        public BigDecimal getCommission() {
+            return commission;
+        }
+
+        public void setCommission(BigDecimal commission) {
+            this.commission = commission;
+        }
+
+        public Integer getGoodsType() {
+            return goodsType;
+        }
+
+        public void setGoodsType(Integer goodsType) {
+            this.goodsType = goodsType;
+        }
+
+        public Integer getFromMask() {
+            return fromMask;
+        }
+
+        public void setFromMask(Integer fromMask) {
+            this.fromMask = fromMask;
+        }
+
+        public Integer getFromMaskExt() {
+            return fromMaskExt;
+        }
+
+        public void setFromMaskExt(Integer fromMaskExt) {
+            this.fromMaskExt = fromMaskExt;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public String getModified() {
+            return modified;
+        }
+
+        public void setModified(String modified) {
+            this.modified = modified;
+        }
+
+        public String getCreated() {
+            return created;
+        }
+
+        public void setCreated(String created) {
+            this.created = created;
+        }
+
+        public String getProp1() {
+            return prop1;
+        }
+
+        public void setProp1(String prop1) {
+            this.prop1 = prop1;
+        }
+
+        public String getProp2() {
+            return prop2;
+        }
+
+        public void setProp2(String prop2) {
+            this.prop2 = prop2;
+        }
+
+        public String getProp3() {
+            return prop3;
+        }
+
+        public void setProp3(String prop3) {
+            this.prop3 = prop3;
+        }
+
+        public String getProp4() {
+            return prop4;
+        }
+
+        public void setProp4(String prop4) {
+            this.prop4 = prop4;
+        }
+
+        public String getProp5() {
+            return prop5;
+        }
+
+        public void setProp5(String prop5) {
+            this.prop5 = prop5;
+        }
+
+        public String getProp6() {
+            return prop6;
+        }
+
+        public void setProp6(String prop6) {
+            this.prop6 = prop6;
+        }
+
+        public BigDecimal getWeight() {
+            return weight;
+        }
+
+        public void setWeight(BigDecimal weight) {
+            this.weight = weight;
+        }
+
+        public String getImgUrl() {
+            return imgUrl;
+        }
+
+        public void setImgUrl(String imgUrl) {
+            this.imgUrl = imgUrl;
+        }
+
+        public BigDecimal getActualNum() {
+            return actualNum;
+        }
+
+        public void setActualNum(BigDecimal actualNum) {
+            this.actualNum = actualNum;
+        }
+
+        public String getBarcode() {
+            return barcode;
+        }
+
+        public void setBarcode(String barcode) {
+            this.barcode = barcode;
+        }
+
+        public BigDecimal getPaid() {
+            return paid;
+        }
+
+        public void setPaid(BigDecimal paid) {
+            this.paid = paid;
+        }
+
+        public Integer getSuiteId() {
+            return suiteId;
+        }
+
+        public void setSuiteId(Integer suiteId) {
+            this.suiteId = suiteId;
+        }
+
+        public String getBindOid() {
+            return bindOid;
+        }
+
+        public void setBindOid(String bindOid) {
+            this.bindOid = bindOid;
+        }
+
+        public Integer getPrintSuiteMode() {
+            return printSuiteMode;
+        }
+
+        public void setPrintSuiteMode(Integer printSuiteMode) {
+            this.printSuiteMode = printSuiteMode;
+        }
+
+        public Integer getFlag() {
+            return flag;
+        }
+
+        public void setFlag(Integer flag) {
+            this.flag = flag;
+        }
+
+        public Integer getStockState() {
+            return stockState;
+        }
+
+        public void setStockState(Integer stockState) {
+            this.stockState = stockState;
+        }
+
+        public Boolean getConsigned() {
+            return isConsigned;
+        }
+
+        public void setConsigned(Boolean consigned) {
+            isConsigned = consigned;
+        }
+
+        public Integer getIsReceived() {
+            return isReceived;
+        }
+
+        public void setIsReceived(Integer isReceived) {
+            this.isReceived = isReceived;
+        }
+
+        public Integer getCid() {
+            return cid;
+        }
+
+        public void setCid(Integer cid) {
+            this.cid = cid;
+        }
+
+        public String getModifiedDate() {
+            return modifiedDate;
+        }
+
+        public void setModifiedDate(String modifiedDate) {
+            this.modifiedDate = modifiedDate;
+        }
+
+        public String getCreatedDate() {
+            return createdDate;
+        }
+
+        public void setCreatedDate(String createdDate) {
+            this.createdDate = createdDate;
+        }
+
+        public BigDecimal getSharePostPrice() {
+            return sharePostPrice;
+        }
+
+        public void setSharePostPrice(BigDecimal sharePostPrice) {
+            this.sharePostPrice = sharePostPrice;
+        }
+
+        public String getInvoiceContent() {
+            return invoiceContent;
+        }
+
+        public void setInvoiceContent(String invoiceContent) {
+            this.invoiceContent = invoiceContent;
+        }
+
+        public String getPayTime() {
+            return payTime;
+        }
+
+        public void setPayTime(String payTime) {
+            this.payTime = payTime;
+        }
+
+        public String getShortName() {
+            return shortName;
+        }
+
+        public void setShortName(String shortName) {
+            this.shortName = shortName;
+        }
+
+        public String getGoodsGiftRelation() {
+            return goodsGiftRelation;
+        }
+
+        public void setGoodsGiftRelation(String goodsGiftRelation) {
+            this.goodsGiftRelation = goodsGiftRelation;
+        }
+
+        public BigDecimal getAvgCost() {
+            return avgCost;
+        }
+
+        public void setAvgCost(BigDecimal avgCost) {
+            this.avgCost = avgCost;
+        }
+
+        public String getClassName() {
+            return className;
+        }
+
+        public void setClassName(String className) {
+            this.className = className;
+        }
+
+        public Integer getBaseUnitId() {
+            return baseUnitId;
+        }
+
+        public void setBaseUnitId(Integer baseUnitId) {
+            this.baseUnitId = baseUnitId;
+        }
+
+        public String getBaseUnitName() {
+            return baseUnitName;
+        }
+
+        public void setBaseUnitName(String baseUnitName) {
+            this.baseUnitName = baseUnitName;
+        }
+
+        public Integer getFenxiaoRecId() {
+            return fenxiaoRecId;
+        }
+
+        public void setFenxiaoRecId(Integer fenxiaoRecId) {
+            this.fenxiaoRecId = fenxiaoRecId;
+        }
+    }
+
+    /**
+     * 订单状态枚举
+     */
+    public enum OrderStatus {
+        OFFLINE_REFUND(4, "线下退款"),
+        CANCELED(5, "已取消"),
+        WAIT_PREORDER(6, "待转预订单(待审核)"),
+        WAIT_COMPLETE(7, "待转已完成"),
+        UNPAID(10, "未付款"),
+        WAIT_FINAL_PAYMENT(12, "待尾款"),
+        WAIT_UNPAID(15, "等未付"),
+        DELAY_REVIEW(16, "延时审核"),
+        PRE_ORDER_PREPROCESS(19, "预订单前处理"),
+        BEFORE_REVIEW_PREPROCESS(20, "审核前处理"),
+        AUTO_FLOW_WAIT_SHIP(21, "自流转待发货"),
+        ABNORMAL_ORDER(23, "异常订单"),
+        EXCHANGE_PREORDER(24, "换货预订单"),
+        PENDING_PREORDER(25, "待处理预订单"),
+        WAIT_ASSIGN_PREORDER(27, "待分配预订单"),
+        WAIT_CUSTOMER_REVIEW(30, "待客审"),
+        WAIT_FINANCE_REVIEW(35, "待财审"),
+        UNDER_REVIEW(40, "审核中"),
+        REVIEWED(55, "已审核"),
+        SHIPPED(95, "已发货"),
+        COST_CONFIRMATION(96, "成本确认"),
+        POSTED(101, "已过账"),
+        COMPLETED(110, "已完成");
+
+        private final Integer code;
+        private final String desc;
+
+        OrderStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 订单类型枚举
+     */
+    public enum TradeType {
+        ONLINE_SALES(1, "网店销售"),
+        OFFLINE_ORDER(2, "线下订单"),
+        AFTER_SALES_EXCHANGE(3, "售后换货"),
+        WHOLESALE_BUSINESS(4, "批发业务"),
+        WARRANTY_RENEWAL(5, "保修换新"),
+        WARRANTY_COMPLETED(6, "保修完成"),
+        CASH_SALES(7, "现款销售"),
+        DISTRIBUTION_ORDER(8, "分销订单"),
+        CUSTOM_TYPE_1(101, "自定义类型一"),
+        CUSTOM_TYPE_2(102, "自定义类型二"),
+        CUSTOM_TYPE_3(103, "自定义类型三"),
+        CUSTOM_TYPE_4(104, "自定义类型四"),
+        CUSTOM_TYPE_5(105, "自定义类型五"),
+        CUSTOM_TYPE_6(106, "自定义类型六"),
+        CUSTOM_TYPE_7(107, "自定义类型七"),
+        CUSTOM_TYPE_8(108, "自定义类型八"),
+        CUSTOM_TYPE_9(109, "自定义类型九"),
+        CUSTOM_TYPE_10(110, "自定义类型十");
+
+        private final Integer code;
+        private final String desc;
+
+        TradeType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 发货条件枚举
+     */
+    public enum DeliveryTerm {
+        PAY_BEFORE_DELIVERY(1, "款到发货"),
+        CASH_ON_DELIVERY(2, "货到付款"),
+        INSTALLMENT(3, "分期付款"),
+        CREDIT_SALES(4, "挂账");
+
+        private final Integer code;
+        private final String desc;
+
+        DeliveryTerm(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 退款状态枚举
+     */
+    public enum RefundStatus {
+        NO_REFUND(0, "无退款"),
+        APPLY_REFUND(1, "申请退款"),
+        PARTIAL_REFUND(2, "部分退款"),
+        FULL_REFUND(3, "全部退款");
+
+        private final Integer code;
+        private final String desc;
+
+        RefundStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 分销类别枚举
+     */
+    public enum FenxiaoType {
+        NOT_FENXIAO(0, "非分销订单"),
+        CONSIGNMENT(1, "代销"),
+        DISTRIBUTION(2, "经销");
+
+        private final Integer code;
+        private final String desc;
+
+        FenxiaoType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 发票类型枚举
+     */
+    public enum InvoiceType {
+        NO_INVOICE(0, "不需要"),
+        GENERAL_INVOICE(1, "普通发票"),
+        VAT_GENERAL_INVOICE(2, "增值税普通发票"),
+        VAT_SPECIAL_INVOICE(3, "增值税专用发票");
+
+        private final Integer code;
+        private final String desc;
+
+        InvoiceType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 订单来源枚举
+     */
+    public enum TradeFrom {
+        API_CRAWL(1, "API抓单"),
+        MANUAL_CREATE(2, "手工建单"),
+        IMPORT(3, "导入"),
+        COPY_ORDER(4, "复制订单"),
+        INTERFACE_PUSH(5, "接口推送"),
+        RESEND_ORDER(6, "补发订单"),
+        PDA_CREATE(7, "PDA选货开单"),
+        DISTRIBUTION_RESEND(8, "分销补发订单");
+
+        private final Integer code;
+        private final String desc;
+
+        TradeFrom(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+}

+ 550 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/RawRefundUpload2Request.java

@@ -0,0 +1,550 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+import java.math.BigDecimal;
+import java.util.List;
+
+
+/**
+ * 退款单同步接口请求参数实体类
+ */
+public class RawRefundUpload2Request {
+
+    /**
+     * 店铺编号
+     */
+    @SerializedName("shop_no")
+    private String shopNo;
+
+    /**
+     * 原始退款单实体类
+     */
+    private List<RefundOrder> orderList;
+
+
+    // Getters and Setters
+    public String getShopNo() {
+        return shopNo;
+    }
+
+    public void setShopNo(String shopNo) {
+        this.shopNo = shopNo;
+    }
+
+    public List<RefundOrder> getOrderList() {
+        return orderList;
+    }
+
+    public void setOrderList(List<RefundOrder> refundOrder) {
+        this.orderList = refundOrder;
+    }
+
+    /**
+     * 原始退款单实体类
+     */
+    public static class RefundOrder {
+
+        /**
+         * 原始退款单号
+         */
+        @SerializedName("refund_no")
+        private String refundNo;
+
+        /**
+         * 货品数量
+         */
+        @SerializedName("num")
+        private BigDecimal num;
+
+        /**
+         * 原始单号
+         */
+        @SerializedName("tid")
+        private String tid;
+
+        /**
+         * 原始子单号
+         */
+        @SerializedName("oid")
+        private String oid;
+
+        /**
+         * 退款单类型
+         * 0取消订单 1退款(未发货,退款申请) 2退货 3换货 4退款不退货
+         * 当type=3时原始退款单递交不会生成系统退货单
+         */
+        @SerializedName("type")
+        private Integer type;
+
+        /**
+         * 平台状态
+         * 1取消退款,2已申请退款,3等待退货,4等待收货,5退款成功
+         */
+        @SerializedName("status")
+        private Integer status;
+
+        /**
+         * 退款版本,默认传1即可
+         */
+        @SerializedName("refund_version")
+        private String refundVersion;
+
+        /**
+         * 申请退款金额
+         */
+        @SerializedName("refund_amount")
+        private BigDecimal refundAmount;
+
+        /**
+         * 实际退款金额
+         */
+        @SerializedName("actual_refund_amount")
+        private BigDecimal actualRefundAmount;
+
+        /**
+         * 标题,对应原始退款单页面主单货品字段,若无传空字符串
+         */
+        @SerializedName("title")
+        private String title;
+
+        /**
+         * 物流公司名称(支持自定义推送),若无传空字符串
+         */
+        @SerializedName("logistics_name")
+        private String logisticsName;
+
+        /**
+         * 物流单号,若无传空字符串
+         */
+        @SerializedName("logistics_no")
+        private String logisticsNo;
+
+        /**
+         * 客户网名
+         */
+        @SerializedName("buyer_nick")
+        private String buyerNick;
+
+        /**
+         * 退款创建时间
+         */
+        @SerializedName("refund_time")
+        private String refundTime;
+
+        /**
+         * 退款成功时间
+         */
+        @SerializedName("current_phase_timeout")
+        private String currentPhaseTimeout;
+
+        /**
+         * 是否售后退款单
+         * 0:否 1:是
+         */
+        @SerializedName("is_aftersale")
+        private Integer isAftersale;
+
+        /**
+         * 退款原因
+         */
+        @SerializedName("reason")
+        private String reason;
+
+        /**
+         * 单价
+         */
+        @SerializedName("price")
+        private BigDecimal price;
+
+        /**
+         * 买家支付帐号
+         */
+        @SerializedName("pay_account")
+        private String payAccount;
+
+        /**
+         * 支付订单号
+         */
+        @SerializedName("pay_no")
+        private String payNo;
+
+        /**
+         * 备注
+         */
+        @SerializedName("remark")
+        private String remark;
+
+        /**
+         * 退款货品总价
+         */
+        @SerializedName("total_amount")
+        private BigDecimal totalAmount;
+
+        /**
+         * 平台规格编号
+         */
+        @SerializedName("spec_no")
+        private String specNo;
+
+        /**
+         * 平台规格id
+         */
+        @SerializedName("spec_id")
+        private String specId;
+
+        /**
+         * 平台货品编号
+         */
+        @SerializedName("goods_no")
+        private String goodsNo;
+
+        /**
+         * 平台货品id
+         */
+        @SerializedName("goods_id")
+        private String goodsId;
+
+        /**
+         * 修改掩码
+         * 1:新订单 2:状态变化 4:金额变化
+         */
+        @SerializedName("modify_flag")
+        private Integer modifyFlag;
+
+        // Getters and Setters
+        public String getRefundNo() {
+            return refundNo;
+        }
+
+        public void setRefundNo(String refundNo) {
+            this.refundNo = refundNo;
+        }
+
+        public BigDecimal getNum() {
+            return num;
+        }
+
+        public void setNum(BigDecimal num) {
+            this.num = num;
+        }
+
+        public String getTid() {
+            return tid;
+        }
+
+        public void setTid(String tid) {
+            this.tid = tid;
+        }
+
+        public String getOid() {
+            return oid;
+        }
+
+        public void setOid(String oid) {
+            this.oid = oid;
+        }
+
+        public Integer getType() {
+            return type;
+        }
+
+        public void setType(Integer type) {
+            this.type = type;
+        }
+
+        public Integer getStatus() {
+            return status;
+        }
+
+        public void setStatus(Integer status) {
+            this.status = status;
+        }
+
+        public String getRefundVersion() {
+            return refundVersion;
+        }
+
+        public void setRefundVersion(String refundVersion) {
+            this.refundVersion = refundVersion;
+        }
+
+        public BigDecimal getRefundAmount() {
+            return refundAmount;
+        }
+
+        public void setRefundAmount(BigDecimal refundAmount) {
+            this.refundAmount = refundAmount;
+        }
+
+        public BigDecimal getActualRefundAmount() {
+            return actualRefundAmount;
+        }
+
+        public void setActualRefundAmount(BigDecimal actualRefundAmount) {
+            this.actualRefundAmount = actualRefundAmount;
+        }
+
+        public String getTitle() {
+            return title;
+        }
+
+        public void setTitle(String title) {
+            this.title = title;
+        }
+
+        public String getLogisticsName() {
+            return logisticsName;
+        }
+
+        public void setLogisticsName(String logisticsName) {
+            this.logisticsName = logisticsName;
+        }
+
+        public String getLogisticsNo() {
+            return logisticsNo;
+        }
+
+        public void setLogisticsNo(String logisticsNo) {
+            this.logisticsNo = logisticsNo;
+        }
+
+        public String getBuyerNick() {
+            return buyerNick;
+        }
+
+        public void setBuyerNick(String buyerNick) {
+            this.buyerNick = buyerNick;
+        }
+
+        public String getRefundTime() {
+            return refundTime;
+        }
+
+        public void setRefundTime(String refundTime) {
+            this.refundTime = refundTime;
+        }
+
+        public String getCurrentPhaseTimeout() {
+            return currentPhaseTimeout;
+        }
+
+        public void setCurrentPhaseTimeout(String currentPhaseTimeout) {
+            this.currentPhaseTimeout = currentPhaseTimeout;
+        }
+
+        public Integer getIsAftersale() {
+            return isAftersale;
+        }
+
+        public void setIsAftersale(Integer isAftersale) {
+            this.isAftersale = isAftersale;
+        }
+
+        public String getReason() {
+            return reason;
+        }
+
+        public void setReason(String reason) {
+            this.reason = reason;
+        }
+
+        public BigDecimal getPrice() {
+            return price;
+        }
+
+        public void setPrice(BigDecimal price) {
+            this.price = price;
+        }
+
+        public String getPayAccount() {
+            return payAccount;
+        }
+
+        public void setPayAccount(String payAccount) {
+            this.payAccount = payAccount;
+        }
+
+        public String getPayNo() {
+            return payNo;
+        }
+
+        public void setPayNo(String payNo) {
+            this.payNo = payNo;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+
+        public BigDecimal getTotalAmount() {
+            return totalAmount;
+        }
+
+        public void setTotalAmount(BigDecimal totalAmount) {
+            this.totalAmount = totalAmount;
+        }
+
+        public String getSpecNo() {
+            return specNo;
+        }
+
+        public void setSpecNo(String specNo) {
+            this.specNo = specNo;
+        }
+
+        public String getSpecId() {
+            return specId;
+        }
+
+        public void setSpecId(String specId) {
+            this.specId = specId;
+        }
+
+        public String getGoodsNo() {
+            return goodsNo;
+        }
+
+        public void setGoodsNo(String goodsNo) {
+            this.goodsNo = goodsNo;
+        }
+
+        public String getGoodsId() {
+            return goodsId;
+        }
+
+        public void setGoodsId(String goodsId) {
+            this.goodsId = goodsId;
+        }
+
+        public Integer getModifyFlag() {
+            return modifyFlag;
+        }
+
+        public void setModifyFlag(Integer modifyFlag) {
+            this.modifyFlag = modifyFlag;
+        }
+    }
+
+    /**
+     * 退款单类型枚举
+     */
+    public enum RefundType {
+        CANCEL_ORDER(0, "取消订单"),
+        REFUND_BEFORE_SHIP(1, "退款(未发货,退款申请)"),
+        RETURN_GOODS(2, "退货"),
+        EXCHANGE_GOODS(3, "换货"),
+        REFUND_WITHOUT_RETURN(4, "退款不退货");
+
+        private final Integer code;
+        private final String desc;
+
+        RefundType(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 退款单状态枚举
+     */
+    public enum RefundStatus {
+        CANCEL_REFUND(1, "取消退款"),
+        APPLY_REFUND(2, "已申请退款"),
+        WAIT_RETURN(3, "等待退货"),
+        WAIT_RECEIVE(4, "等待收货"),
+        REFUND_SUCCESS(5, "退款成功");
+
+        private final Integer code;
+        private final String desc;
+
+        RefundStatus(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 是否售后退款单枚举
+     */
+    public enum IsAftersale {
+        NO(0, "否"),
+        YES(1, "是");
+
+        private final Integer code;
+        private final String desc;
+
+        IsAftersale(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+    }
+
+    /**
+     * 修改掩码枚举
+     */
+    public enum ModifyFlag {
+        NEW_ORDER(1, "新订单"),
+        STATUS_CHANGE(2, "状态变化"),
+        AMOUNT_CHANGE(4, "金额变化");
+
+        private final Integer code;
+        private final String desc;
+
+        ModifyFlag(Integer code, String desc) {
+            this.code = code;
+            this.desc = desc;
+        }
+
+        public Integer getCode() {
+            return code;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+
+        /**
+         * 组合修改掩码(使用位运算)
+         */
+        public static Integer combine(ModifyFlag... flags) {
+            if (flags == null || flags.length == 0) {
+                return 0;
+            }
+
+            int result = 0;
+            for (ModifyFlag flag : flags) {
+                result |= flag.getCode();
+            }
+            return result;
+        }
+    }
+
+}

+ 60 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/RawRefundUpload2Response.java

@@ -0,0 +1,60 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 退款单同步接口响应参数实体类
+ */
+public class RawRefundUpload2Response {
+
+    /**
+     * {"status":0,"data":{"chg_count":0,"new_count":1}}
+     */
+    // 更新订单数
+    @SerializedName("chg_count")
+    private Integer chgCount;
+    // 新增订单数
+    @SerializedName("new_count")
+    private Integer newCount;
+
+    // 错误信息
+    // 单号 no	String
+    // 错误信息	error	String
+    @SerializedName("error_list")
+    private List<ErrorInfo> errorList;
+
+    public Integer getChgCount()
+    {
+        return chgCount;
+    }
+
+    public void setChgCount(Integer chgCount)
+    {
+        this.chgCount = chgCount;
+    }
+
+    public Integer getNewCount()
+    {
+        return newCount;
+    }
+
+    public void setNewCount(Integer newCount)
+    {
+        this.newCount = newCount;
+    }
+
+    public List<ErrorInfo> getErrorList()
+    {
+        return errorList;
+    }
+
+    public void setErrorList(List<ErrorInfo> errorList)
+    {
+        this.errorList = errorList;
+    }
+
+}

+ 74 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/StockSearch2Request.java

@@ -0,0 +1,74 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import java.util.List;
+
+public class StockSearch2Request
+{
+	private String startTime;
+	private String endTime;
+	private List<String> specNos;
+	private String warehouseNo;
+	private Integer mask;
+
+	private Integer needAlarmInfo;
+
+	public String getStartTime()
+	{
+		return startTime;
+	}
+
+	public void setStartTime(String startTime)
+	{
+		this.startTime = startTime;
+	}
+
+	public String getEndTime()
+	{
+		return endTime;
+	}
+
+	public void setEndTime(String endTime)
+	{
+		this.endTime = endTime;
+	}
+
+	public List<String> getSpecNos()
+	{
+		return specNos;
+	}
+
+	public void setSpecNos(List<String> specNos)
+	{
+		this.specNos = specNos;
+	}
+
+	public String getWarehouseNo()
+	{
+		return warehouseNo;
+	}
+
+	public void setWarehouseNo(String warehouseNo)
+	{
+		this.warehouseNo = warehouseNo;
+	}
+
+	public Integer getMask()
+	{
+		return mask;
+	}
+
+	public void setMask(Integer mask)
+	{
+		this.mask = mask;
+	}
+
+	public Integer getNeedAlarmInfo()
+	{
+		return needAlarmInfo;
+	}
+
+	public void setNeedAlarmInfo(Integer needAlarmInfo)
+	{
+		this.needAlarmInfo = needAlarmInfo;
+	}
+}

+ 700 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/api/dto/StockSearch2Response.java

@@ -0,0 +1,700 @@
+package com.fs.erp.dto.sdk.wangdianTwo.api.dto;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public class StockSearch2Response
+{
+	@SerializedName("total_count") private Integer total;
+	@SerializedName("detail_list") private List<Detail> detailList;
+
+	public Integer getTotal()
+	{
+		return total;
+	}
+
+	public void setTotal(Integer total)
+	{
+		this.total = total;
+	}
+
+	public List<Detail> getDetailList()
+	{
+		return detailList;
+	}
+
+	public void setDetailList(List<Detail> detailList)
+	{
+		this.detailList = detailList;
+	}
+
+	public static class Detail
+	{
+		@SerializedName("spec_code") private String specCode;
+		@SerializedName("to_transfer_num") private BigDecimal toTransferNum;
+		@SerializedName("warehouse_type") private Integer warehouseType;
+		@SerializedName("brand_no") private String brandNo;
+		@SerializedName("wms_stock_diff") private Integer wmsStockDiff;
+		@SerializedName("refund_exch_num") private BigDecimal refundExchNum;
+		@SerializedName("spec_no") private String specNo;
+		@SerializedName("defect") private Boolean defect;
+		@SerializedName("modified") private Long modified;
+		@SerializedName("barcode") private String barcode;
+		@SerializedName("part_paid_num") private BigDecimal partPaidNum;
+		@SerializedName("goods_name") private String goodsName;
+		@SerializedName("lock_num") private BigDecimal lockNum;
+		@SerializedName("created") private Long created;
+		@SerializedName("available_send_stock") private BigDecimal availableSendStock;
+		@SerializedName("subscribe_num") private BigDecimal subscribeNum;
+		@SerializedName("weight") private BigDecimal weight;
+		@SerializedName("brand_name") private String brandName;
+		@SerializedName("unpay_num") private BigDecimal unpayNum;
+		@SerializedName("sending_num") private BigDecimal sendingNum;
+		@SerializedName("to_process_in_num") private BigDecimal toProcessInNum;
+		@SerializedName("warehouse_name") private String warehouseName;
+		@SerializedName("img_url") private String imgUrl;
+		@SerializedName("refund_num") private BigDecimal refundNum;
+		@SerializedName("to_process_out_num") private BigDecimal toProcessOutNum;
+		@SerializedName("order_num") private BigDecimal orderNum;
+		@SerializedName("status") private Integer status;
+		@SerializedName("flag_id") private Integer flagId;
+		@SerializedName("wms_sync_stock") private BigDecimal wmsSyncStock;
+		@SerializedName("to_purchase_num") private BigDecimal toPurchaseNum;
+		@SerializedName("wms_preempty_stock") private BigDecimal wmsPreemptyStock;
+		@SerializedName("goods_no") private String goodsNo;
+		@SerializedName("stock_num") private BigDecimal stockNum;
+		@SerializedName("purchase_arrive_num") private BigDecimal purchaseArriveNum;
+		@SerializedName("wms_preempty_diff") private BigDecimal wmsPreemptyDiff;
+		@SerializedName("remark") private String remark;
+		@SerializedName("flag_name") private String flagName;
+		@SerializedName("return_num") private BigDecimal returnNum;
+		@SerializedName("purchase_num") private BigDecimal purchaseNum;
+		@SerializedName("warehouse_no") private String warehouseNo;
+		@SerializedName("spec_id") private Integer specId;
+		@SerializedName("return_exch_num") private BigDecimal returnExchNum;
+		@SerializedName("rec_id") private Integer recId;
+		@SerializedName("to_other_in_num") private BigDecimal toOtherInNum;
+		@SerializedName("to_other_out_num") private BigDecimal toOtherOutNum;
+		@SerializedName("refund_onway_num") private BigDecimal refundOnwayNum;
+		@SerializedName("transfer_num") private BigDecimal transferNum;
+		@SerializedName("spec_name") private String specName;
+		@SerializedName("return_onway_num") private BigDecimal returnOnwayNum;
+		@SerializedName("warehouse_id") private Integer warehouseId;
+		@SerializedName("last_inout_time") private String lastInoutTime;
+		@SerializedName("last_pd_time") private String lastPdTime;
+
+
+		@SerializedName("aux_unit_name")
+		private String auxUnitName;
+
+		@SerializedName("safe_stock")
+		private BigDecimal safeStock;
+
+		@SerializedName("safe_stock_upper")
+		private BigDecimal safeStockUpper;
+
+		@SerializedName("alarm_type")
+		private Integer alarmType;
+
+		@SerializedName("alarm_days")
+		private BigDecimal alarmDays;
+
+		@SerializedName("alarm_days_upper")
+		private BigDecimal alarmDaysUpper;
+
+		@SerializedName("cycle_days")
+		private BigDecimal cycleDays;
+
+		public String getSpecCode()
+		{
+			return specCode;
+		}
+
+		public void setSpecCode(String specCode)
+		{
+			this.specCode = specCode;
+		}
+
+		public BigDecimal getToTransferNum()
+		{
+			return toTransferNum;
+		}
+
+		public void setToTransferNum(BigDecimal toTransferNum)
+		{
+			this.toTransferNum = toTransferNum;
+		}
+
+		public Integer getWarehouseType()
+		{
+			return warehouseType;
+		}
+
+		public void setWarehouseType(Integer warehouseType)
+		{
+			this.warehouseType = warehouseType;
+		}
+
+		public String getBrandNo()
+		{
+			return brandNo;
+		}
+
+		public void setBrandNo(String brandNo)
+		{
+			this.brandNo = brandNo;
+		}
+
+		public Integer getWmsStockDiff()
+		{
+			return wmsStockDiff;
+		}
+
+		public void setWmsStockDiff(Integer wmsStockDiff)
+		{
+			this.wmsStockDiff = wmsStockDiff;
+		}
+
+		public BigDecimal getRefundExchNum()
+		{
+			return refundExchNum;
+		}
+
+		public void setRefundExchNum(BigDecimal refundExchNum)
+		{
+			this.refundExchNum = refundExchNum;
+		}
+
+		public String getSpecNo()
+		{
+			return specNo;
+		}
+
+		public void setSpecNo(String specNo)
+		{
+			this.specNo = specNo;
+		}
+
+		public Boolean getDefect()
+		{
+			return defect;
+		}
+
+		public void setDefect(Boolean defect)
+		{
+			this.defect = defect;
+		}
+
+		public Long getModified()
+		{
+			return modified;
+		}
+
+		public void setModified(Long modified)
+		{
+			this.modified = modified;
+		}
+
+		public String getBarcode()
+		{
+			return barcode;
+		}
+
+		public void setBarcode(String barcode)
+		{
+			this.barcode = barcode;
+		}
+
+		public BigDecimal getPartPaidNum()
+		{
+			return partPaidNum;
+		}
+
+		public void setPartPaidNum(BigDecimal partPaidNum)
+		{
+			this.partPaidNum = partPaidNum;
+		}
+
+		public String getGoodsName()
+		{
+			return goodsName;
+		}
+
+		public void setGoodsName(String goodsName)
+		{
+			this.goodsName = goodsName;
+		}
+
+		public BigDecimal getLockNum()
+		{
+			return lockNum;
+		}
+
+		public void setLockNum(BigDecimal lockNum)
+		{
+			this.lockNum = lockNum;
+		}
+
+		public Long getCreated()
+		{
+			return created;
+		}
+
+		public void setCreated(Long created)
+		{
+			this.created = created;
+		}
+
+		public BigDecimal getAvailableSendStock()
+		{
+			return availableSendStock;
+		}
+
+		public void setAvailableSendStock(BigDecimal availableSendStock)
+		{
+			this.availableSendStock = availableSendStock;
+		}
+
+		public BigDecimal getSubscribeNum()
+		{
+			return subscribeNum;
+		}
+
+		public void setSubscribeNum(BigDecimal subscribeNum)
+		{
+			this.subscribeNum = subscribeNum;
+		}
+
+		public BigDecimal getWeight()
+		{
+			return weight;
+		}
+
+		public void setWeight(BigDecimal weight)
+		{
+			this.weight = weight;
+		}
+
+		public String getBrandName()
+		{
+			return brandName;
+		}
+
+		public void setBrandName(String brandName)
+		{
+			this.brandName = brandName;
+		}
+
+		public BigDecimal getUnpayNum()
+		{
+			return unpayNum;
+		}
+
+		public void setUnpayNum(BigDecimal unpayNum)
+		{
+			this.unpayNum = unpayNum;
+		}
+
+		public BigDecimal getSendingNum()
+		{
+			return sendingNum;
+		}
+
+		public void setSendingNum(BigDecimal sendingNum)
+		{
+			this.sendingNum = sendingNum;
+		}
+
+		public BigDecimal getToProcessInNum()
+		{
+			return toProcessInNum;
+		}
+
+		public void setToProcessInNum(BigDecimal toProcessInNum)
+		{
+			this.toProcessInNum = toProcessInNum;
+		}
+
+		public String getWarehouseName()
+		{
+			return warehouseName;
+		}
+
+		public void setWarehouseName(String warehouseName)
+		{
+			this.warehouseName = warehouseName;
+		}
+
+		public String getImgUrl()
+		{
+			return imgUrl;
+		}
+
+		public void setImgUrl(String imgUrl)
+		{
+			this.imgUrl = imgUrl;
+		}
+
+		public BigDecimal getRefundNum()
+		{
+			return refundNum;
+		}
+
+		public void setRefundNum(BigDecimal refundNum)
+		{
+			this.refundNum = refundNum;
+		}
+
+		public BigDecimal getToProcessOutNum()
+		{
+			return toProcessOutNum;
+		}
+
+		public void setToProcessOutNum(BigDecimal toProcessOutNum)
+		{
+			this.toProcessOutNum = toProcessOutNum;
+		}
+
+		public BigDecimal getOrderNum()
+		{
+			return orderNum;
+		}
+
+		public void setOrderNum(BigDecimal orderNum)
+		{
+			this.orderNum = orderNum;
+		}
+
+		public Integer getStatus()
+		{
+			return status;
+		}
+
+		public void setStatus(Integer status)
+		{
+			this.status = status;
+		}
+
+		public Integer getFlagId()
+		{
+			return flagId;
+		}
+
+		public void setFlagId(Integer flagId)
+		{
+			this.flagId = flagId;
+		}
+
+		public BigDecimal getWmsSyncStock()
+		{
+			return wmsSyncStock;
+		}
+
+		public void setWmsSyncStock(BigDecimal wmsSyncStock)
+		{
+			this.wmsSyncStock = wmsSyncStock;
+		}
+
+		public BigDecimal getToPurchaseNum()
+		{
+			return toPurchaseNum;
+		}
+
+		public void setToPurchaseNum(BigDecimal toPurchaseNum)
+		{
+			this.toPurchaseNum = toPurchaseNum;
+		}
+
+		public BigDecimal getWmsPreemptyStock()
+		{
+			return wmsPreemptyStock;
+		}
+
+		public void setWmsPreemptyStock(BigDecimal wmsPreemptyStock)
+		{
+			this.wmsPreemptyStock = wmsPreemptyStock;
+		}
+
+		public String getGoodsNo()
+		{
+			return goodsNo;
+		}
+
+		public void setGoodsNo(String goodsNo)
+		{
+			this.goodsNo = goodsNo;
+		}
+
+		public BigDecimal getStockNum()
+		{
+			return stockNum;
+		}
+
+		public void setStockNum(BigDecimal stockNum)
+		{
+			this.stockNum = stockNum;
+		}
+
+		public BigDecimal getPurchaseArriveNum()
+		{
+			return purchaseArriveNum;
+		}
+
+		public void setPurchaseArriveNum(BigDecimal purchaseArriveNum)
+		{
+			this.purchaseArriveNum = purchaseArriveNum;
+		}
+
+		public BigDecimal getWmsPreemptyDiff()
+		{
+			return wmsPreemptyDiff;
+		}
+
+		public void setWmsPreemptyDiff(BigDecimal wmsPreemptyDiff)
+		{
+			this.wmsPreemptyDiff = wmsPreemptyDiff;
+		}
+
+		public String getRemark()
+		{
+			return remark;
+		}
+
+		public void setRemark(String remark)
+		{
+			this.remark = remark;
+		}
+
+		public String getFlagName()
+		{
+			return flagName;
+		}
+
+		public void setFlagName(String flagName)
+		{
+			this.flagName = flagName;
+		}
+
+		public BigDecimal getReturnNum()
+		{
+			return returnNum;
+		}
+
+		public void setReturnNum(BigDecimal returnNum)
+		{
+			this.returnNum = returnNum;
+		}
+
+		public BigDecimal getPurchaseNum()
+		{
+			return purchaseNum;
+		}
+
+		public void setPurchaseNum(BigDecimal purchaseNum)
+		{
+			this.purchaseNum = purchaseNum;
+		}
+
+		public String getWarehouseNo()
+		{
+			return warehouseNo;
+		}
+
+		public void setWarehouseNo(String warehouseNo)
+		{
+			this.warehouseNo = warehouseNo;
+		}
+
+		public Integer getSpecId()
+		{
+			return specId;
+		}
+
+		public void setSpecId(Integer specId)
+		{
+			this.specId = specId;
+		}
+
+		public BigDecimal getReturnExchNum()
+		{
+			return returnExchNum;
+		}
+
+		public void setReturnExchNum(BigDecimal returnExchNum)
+		{
+			this.returnExchNum = returnExchNum;
+		}
+
+		public Integer getRecId()
+		{
+			return recId;
+		}
+
+		public void setRecId(Integer recId)
+		{
+			this.recId = recId;
+		}
+
+		public BigDecimal getToOtherInNum()
+		{
+			return toOtherInNum;
+		}
+
+		public void setToOtherInNum(BigDecimal toOtherInNum)
+		{
+			this.toOtherInNum = toOtherInNum;
+		}
+
+		public BigDecimal getToOtherOutNum()
+		{
+			return toOtherOutNum;
+		}
+
+		public void setToOtherOutNum(BigDecimal toOtherOutNum)
+		{
+			this.toOtherOutNum = toOtherOutNum;
+		}
+
+		public BigDecimal getRefundOnwayNum()
+		{
+			return refundOnwayNum;
+		}
+
+		public void setRefundOnwayNum(BigDecimal refundOnwayNum)
+		{
+			this.refundOnwayNum = refundOnwayNum;
+		}
+
+		public BigDecimal getTransferNum()
+		{
+			return transferNum;
+		}
+
+		public void setTransferNum(BigDecimal transferNum)
+		{
+			this.transferNum = transferNum;
+		}
+
+		public String getSpecName()
+		{
+			return specName;
+		}
+
+		public void setSpecName(String specName)
+		{
+			this.specName = specName;
+		}
+
+		public BigDecimal getReturnOnwayNum()
+		{
+			return returnOnwayNum;
+		}
+
+		public void setReturnOnwayNum(BigDecimal returnOnwayNum)
+		{
+			this.returnOnwayNum = returnOnwayNum;
+		}
+
+		public Integer getWarehouseId()
+		{
+			return warehouseId;
+		}
+
+		public void setWarehouseId(Integer warehouseId)
+		{
+			this.warehouseId = warehouseId;
+		}
+
+		public String getLastInoutTime()
+		{
+			return lastInoutTime;
+		}
+
+		public void setLastInoutTime(String lastInoutTime)
+		{
+			this.lastInoutTime = lastInoutTime;
+		}
+
+		public String getLastPdTime()
+		{
+			return lastPdTime;
+		}
+
+		public void setLastPdTime(String lastPdTime)
+		{
+			this.lastPdTime = lastPdTime;
+		}
+
+		public String getAuxUnitName()
+		{
+			return auxUnitName;
+		}
+
+		public void setAuxUnitName(String auxUnitName)
+		{
+			this.auxUnitName = auxUnitName;
+		}
+
+		public BigDecimal getSafeStock()
+		{
+			return safeStock;
+		}
+
+		public void setSafeStock(BigDecimal safeStock)
+		{
+			this.safeStock = safeStock;
+		}
+
+		public BigDecimal getSafeStockUpper()
+		{
+			return safeStockUpper;
+		}
+
+		public void setSafeStockUpper(BigDecimal safeStockUpper)
+		{
+			this.safeStockUpper = safeStockUpper;
+		}
+
+		public Integer getAlarmType()
+		{
+			return alarmType;
+		}
+
+		public void setAlarmType(Integer alarmType)
+		{
+			this.alarmType = alarmType;
+		}
+
+		public BigDecimal getAlarmDays()
+		{
+			return alarmDays;
+		}
+
+		public void setAlarmDays(BigDecimal alarmDays)
+		{
+			this.alarmDays = alarmDays;
+		}
+
+		public BigDecimal getAlarmDaysUpper()
+		{
+			return alarmDaysUpper;
+		}
+
+		public void setAlarmDaysUpper(BigDecimal alarmDaysUpper)
+		{
+			this.alarmDaysUpper = alarmDaysUpper;
+		}
+
+		public BigDecimal getCycleDays()
+		{
+			return cycleDays;
+		}
+
+		public void setCycleDays(BigDecimal cycleDays)
+		{
+			this.cycleDays = cycleDays;
+		}
+	}
+}

+ 17 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/Api.java

@@ -0,0 +1,17 @@
+package com.fs.erp.dto.sdk.wangdianTwo.impl;
+
+import java.lang.annotation.*;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Api
+{
+	// 方法名
+	public String value();
+
+	// 是否分页
+	public boolean paged() default false;
+
+
+}

+ 55 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/ApiFactory.java

@@ -0,0 +1,55 @@
+package com.fs.erp.dto.sdk.wangdianTwo.impl;
+
+
+
+import com.fs.erp.dto.sdk.wangdianTwo.Client;
+import com.fs.erp.dto.sdk.wangdianTwo.Pager;
+import com.fs.erp.dto.sdk.wangdianTwo.WdtErpException;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.Type;
+
+public class ApiFactory
+{
+	private static class DynamicProxy implements InvocationHandler
+	{
+		private Client client;
+
+		public DynamicProxy(Client client)
+		{
+			this.client = client;
+		}
+
+		@Override
+		public Object invoke(Object inst, Method method, Object[] args) throws Throwable
+		{
+			Api api = method.getAnnotation(Api.class);
+			if (api == null)
+				throw new WdtErpException(-1, "Api Name not indicated");
+
+			Pager pager = null;
+			// 如果分页查询, 最后一个参数是pager
+			if (api.paged())
+			{
+				int len = args.length;
+				pager = (Pager) args[len - 1];
+
+				Object[] newParams = new Object[len - 1];
+				System.arraycopy(args, 0, newParams, 0, len - 1);
+				args = newParams;
+			}
+
+			Type returnType = method.getGenericReturnType();
+
+			return this.client.execute(api.value(), args, pager, returnType);
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public static <T> T get(Client client, Class<T> iface)
+	{
+		return (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class<?>[] { iface }, new DynamicProxy(client));
+	}
+}

+ 50 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/ExApiFactory.java

@@ -0,0 +1,50 @@
+package com.fs.erp.dto.sdk.wangdianTwo.impl;
+
+
+
+import com.fs.erp.dto.sdk.wangdianTwo.Client;
+import com.fs.erp.dto.sdk.wangdianTwo.WdtErpException;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+public class ExApiFactory
+{
+	private static class DynamicProxy implements InvocationHandler
+	{
+		private Client client;
+
+		public DynamicProxy(Client client)
+		{
+			this.client = client;
+		}
+
+		@Override
+		public Object invoke(Object inst, Method method, Object[] args) throws Throwable
+		{
+			Api api = method.getAnnotation(Api.class);
+			if (api == null)
+				throw new WdtErpException(-1, "Api Name not indicated");
+
+			// 如果分页查询, 最后一个参数是pager
+			if (api.paged())
+				throw new IllegalArgumentException("Pagination is not supported for Script Api");
+
+			int len = args.length;
+
+			Object[] newParams = new Object[len + 1];
+			newParams[0] = api.value();
+			System.arraycopy(args, 0, newParams, 1, len);
+
+			return this.client.execute("system.ScriptExtension.call", newParams, null, method.getReturnType());
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public static <T> T get(Client client, Class<T> iface)
+	{
+		return (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class<?>[] { iface }, new DynamicProxy(client));
+	}
+
+}

+ 349 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/impl/WdtTwoClient.java

@@ -0,0 +1,349 @@
+package com.fs.erp.dto.sdk.wangdianTwo.impl;
+
+
+import com.fs.erp.dto.sdk.wangdianTwo.Client;
+import com.fs.erp.dto.sdk.wangdianTwo.Pager;
+import com.fs.erp.dto.sdk.wangdianTwo.WdtErpException;
+import com.google.gson.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+import java.util.TreeMap;
+
+@Slf4j
+public class WdtTwoClient implements Client
+{
+	private static final String WDT_SERVICE_URL = "http://wdt.wangdian.cn/";
+	// 协议版本号
+	public static final String version = "1.0";
+	private static final int WDT_UNIX_TIMESTAMP_DIFF = 1325347200;
+
+	private String sid; // 卖家标识
+	private String url; // 服务器URL
+	private String key; // openapi key
+	private String secret; // openapi secret
+	private String salt; // openapi salt
+	private int timeout = 30000; // http超时时间, 默认30秒
+	private boolean isMultiTenantMode = false ;
+
+	private static class BooleanJsonDeserializer implements JsonDeserializer<Boolean>
+	{
+		@Override
+		public Boolean deserialize(JsonElement json, Type type, JsonDeserializationContext context)
+				throws JsonParseException
+		{
+			if (json.isJsonPrimitive())
+			{
+				JsonPrimitive primitive = (JsonPrimitive) json;
+				if (primitive.isBoolean())
+					return primitive.getAsBoolean();
+
+				if (primitive.isNumber())
+				{
+					Number num = primitive.getAsNumber();
+					if (num instanceof Integer || num instanceof Long || num instanceof Short || num instanceof Byte)
+						return num.intValue() != 0;
+
+					return num.doubleValue() != 0;
+				}
+			}
+
+			return !json.isJsonNull();
+		}
+
+		static final BooleanJsonDeserializer INSTANCE = new BooleanJsonDeserializer();
+	}
+
+	private static Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
+			.registerTypeAdapter(boolean.class, BooleanJsonDeserializer.INSTANCE)
+			.registerTypeAdapter(Boolean.class, BooleanJsonDeserializer.INSTANCE).create();
+
+	private static JsonParser parser = new JsonParser();
+
+	private WdtTwoClient(String sid, String url, String key, String secret, boolean isMultiTenantMode)
+	{
+		if (url.endsWith("/"))
+			url += "openapi";
+		else
+			url += "/openapi";
+		this.url = url;
+
+		this.sid = sid;
+		this.key = key;
+
+		int pos = secret.indexOf(':');
+		this.secret = secret.substring(0, pos);
+		this.salt = secret.substring(pos + 1);
+		this.isMultiTenantMode = isMultiTenantMode;
+	}
+
+	private String urlEncode(String data) throws UnsupportedEncodingException
+	{
+		return URLEncoder.encode(data, StandardCharsets.UTF_8.name());
+	}
+
+	private String ToQueryString(Map<String, String> args) throws UnsupportedEncodingException
+	{
+		StringBuilder sb = new StringBuilder();
+
+		boolean first = true;
+		for (Map.Entry<String, String> item : args.entrySet())
+		{
+			if (!first)
+				sb.append('&');
+			else
+				first = false;
+
+			sb.append(urlEncode(item.getKey()));
+			sb.append('=');
+			sb.append(urlEncode(item.getValue()));
+		}
+
+		return sb.toString();
+	}
+
+	private static String md5(String info)
+	{
+		try
+		{
+			// 获取 MessageDigest 对象,参数为 MD5 字符串,表示这是一个 MD5 算法(其他还有 SHA1 算法等):
+			MessageDigest md5 = MessageDigest.getInstance("MD5");
+			// update(byte[])方法,输入原数据
+			// 类似StringBuilder对象的append()方法,追加模式,属于一个累计更改的过程
+			md5.update(info.getBytes(StandardCharsets.UTF_8));
+			// digest()被调用后,MessageDigest对象就被重置,即不能连续再次调用该方法计算原数据的MD5值。可以手动调用reset()方法重置输入源。
+			// digest()返回值16位长度的哈希值,由byte[]承接
+			byte[] md5Array = md5.digest();
+			// byte[]通常我们会转化为十六进制的32位长度的字符串来使用,本文会介绍三种常用的转换方法
+			return bytesToHex(md5Array);
+		}
+		catch (NoSuchAlgorithmException e)
+		{
+			throw new RuntimeException(e);
+		}
+	}
+
+	private static String bytesToHex(byte[] md5Array)
+	{
+		StringBuilder strBuilder = new StringBuilder();
+		for (int i = 0; i < md5Array.length; i++)
+		{
+			int temp = 0xff & md5Array[i];
+			String hexString = Integer.toHexString(temp);
+			if (hexString.length() == 1)
+			{// 如果是十六进制的0f,默认只显示f,此时要补上0
+				strBuilder.append("0").append(hexString);
+			}
+			else
+			{
+				strBuilder.append(hexString);
+			}
+		}
+
+		return strBuilder.toString();
+	}
+
+	/**
+	 * 计算签名
+	 * @param args 请求参数
+	 * @param secret secret
+	 * @return 签名
+	 */
+	private String sign(Map<String, String> args, String secret)
+	{
+		StringBuilder sb = new StringBuilder();
+		sb.append(secret);
+		for (Map.Entry<String, String> item : args.entrySet())
+		{
+			if (item.getKey().equals("sign"))
+				continue;
+
+			sb.append(item.getKey());
+			sb.append(item.getValue());
+		}
+		sb.append(secret);
+
+		return md5(sb.toString());
+	}
+
+	/**
+	 *
+	 * @param method 方法名称
+	 * @param args 请求参数
+	 * @param pager 分页参数
+	 * @param returnType 返回值类型
+	 * @return 响应信息
+	 * @throws WdtErpException wdt返回的错误信息
+	 * @throws IOException 请求异常
+	 */
+	@Override
+	public Object execute(String method, Object[] args, Pager pager, Type returnType)
+			throws WdtErpException, IOException
+	{
+		Map<String, String> requestParams = new TreeMap<>();
+		requestParams.put("sid", this.sid);
+		requestParams.put("key", this.key);
+		requestParams.put("method", method);
+		requestParams.put("salt", this.salt);
+		requestParams.put("timestamp",
+				Integer.toString((int) (System.currentTimeMillis() / 1000 - WDT_UNIX_TIMESTAMP_DIFF)));
+		requestParams.put("v", version);
+
+		if (pager != null)
+		{
+			requestParams.put("page_size", Integer.toString(pager.getPageSize()));
+			requestParams.put("page_no", Integer.toString(pager.getPageNo()));
+			requestParams.put("calc_total", pager.isCalcTotal() ? "1" : "0");
+		}
+
+		// 请求参数
+		String body = gson.toJson(args);
+		requestParams.put("body", body);
+		log.info("requestParams: {}", requestParams);
+		// 计算签名
+		String sign = this.sign(requestParams, this.secret);
+		requestParams.remove("body");
+		requestParams.put("sign", sign);
+
+		String requestUrl = this.url + "?" + this.ToQueryString(requestParams);
+
+
+
+		PrintWriter outWriter = null;
+		BufferedReader inReader = null;
+		String responseBody;
+		try
+		{
+			URL url = new URL(requestUrl);
+
+			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+			conn.setConnectTimeout(timeout);
+			conn.setReadTimeout(timeout);
+
+			if (this.isMultiTenantMode)
+				conn.setRequestProperty("Connection", "close");
+
+			conn.setRequestProperty("Content-Type", "application/json");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+
+			OutputStream outStream = conn.getOutputStream();
+			outWriter = new PrintWriter(new OutputStreamWriter(outStream, StandardCharsets.UTF_8));
+
+			outWriter.write(body);
+			outWriter.flush();
+
+			InputStream in = conn.getInputStream();
+			inReader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
+
+			StringBuilder sb = new StringBuilder();
+			int len;
+			char[] tmp = new char[256];
+			while ((len = inReader.read(tmp)) > 0)
+			{
+				sb.append(tmp, 0, len);
+			}
+			responseBody = sb.toString();
+		}
+		finally
+		{
+			if (outWriter != null)
+				outWriter.close();
+
+			if (inReader != null)
+				inReader.close();
+		}
+
+		JsonObject jsonResponse = parser.parse(responseBody).getAsJsonObject();
+
+		log.info("responseBody: {}", responseBody);
+
+		int status = jsonResponse.get("status").getAsInt();
+		if (status > 0)
+		{
+			String message = jsonResponse.get("message").getAsString();
+			throw new WdtErpException(status, message);
+		}
+
+		if (returnType.equals(void.class) || returnType.equals(Void.class))
+			return null;
+
+		Object result;
+		if (!jsonResponse.has("data"))
+			result = null;
+		else if (jsonResponse.get("data").isJsonArray())
+			result = gson.fromJson(jsonResponse, returnType);
+		else
+			result = gson.fromJson(jsonResponse.get("data"), returnType);
+
+		if (pager == null || !pager.isCalcTotal() || result == null || !(returnType instanceof Class))
+			return result;
+
+		if (!jsonResponse.has("total"))
+			return result;
+
+		Class<?> returnClass = (Class<?>) returnType;
+		try
+		{
+			Method[] methods = returnClass.getDeclaredMethods();
+			for (Method m : methods)
+			{
+				if (m.getName().equals("setTotal"))
+				{
+					Class<?>[] argsType = m.getParameterTypes();
+					if (argsType.length == 1)
+					{
+						Class<?> argType = argsType[0];
+						if (argType == Integer.class || argType == int.class)
+							m.invoke(result, jsonResponse.get("total").getAsInt());
+						else if (argType == Long.class || argType == long.class)
+							m.invoke(result, jsonResponse.get("total").getAsLong());
+						else
+							continue;
+
+						break;
+					}
+				}
+			}
+		}
+		catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
+		{
+			e.printStackTrace();
+		}
+
+		return result;
+
+	}
+
+	@Override
+	public void setTimeout(int timeout)
+	{
+		this.timeout = timeout;
+	}
+
+	public static Client get(String sid, String url, String key, String secret, boolean isMultiTenantMode)
+	{
+		return new WdtTwoClient(sid, url, key, secret, isMultiTenantMode);
+	}
+
+	public static Client get(String sid, String url, String key, String secret)
+	{
+		return new WdtTwoClient(sid, url, key, secret, false);
+	}
+
+	public static Client get(String sid, String key, String secret)
+	{
+		return new WdtTwoClient(sid, WDT_SERVICE_URL, key, secret, false);
+	}
+}

+ 24 - 0
fs-service/src/main/java/com/fs/erp/dto/sdk/wangdianTwo/utils/HandUtils.java

@@ -0,0 +1,24 @@
+package com.fs.erp.dto.sdk.wangdianTwo.utils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class HandUtils
+{
+	/**
+	 * 校验是否为合法的datetime字符串
+	 *
+	 * @param datetime
+	 * @return
+	 */
+	public static boolean dateValidityCheck(String datetime)
+	{
+		String regex = "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))"
+				+ "[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))"
+				+ "[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|"
+				+ "(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1][0-9])|([2][0-4]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$";
+		Pattern p = Pattern.compile(regex);
+		Matcher m = p.matcher(datetime);
+		return m.matches();
+	}
+}

+ 161 - 0
fs-service/src/main/java/com/fs/erp/service/impl/WdtTwoErpGoodsServiceImpl.java

@@ -0,0 +1,161 @@
+package com.fs.erp.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fs.erp.domain.*;
+import com.fs.erp.dto.*;
+import com.fs.erp.dto.sdk.wangdian.enums.DeliveryTerm;
+import com.fs.erp.dto.sdk.wangdian.enums.PaymentStatus;
+import com.fs.erp.dto.sdk.wangdian.enums.RefundStatus;
+import com.fs.erp.dto.sdk.wangdian.enums.TradeStatus;
+import com.fs.erp.dto.sdk.wangdianTwo.Pager;
+import com.fs.erp.dto.sdk.wangdianTwo.api.WdtTradeAPI;
+import com.fs.erp.dto.sdk.wangdianTwo.api.dto.*;
+import com.fs.erp.dto.sdk.wangdianTwo.impl.ApiFactory;
+import com.fs.erp.dto.sdk.wangdianTwo.impl.WdtTwoClient;
+import com.fs.erp.service.IErpGoodsService;
+import com.fs.his.domain.FsUser;
+import com.fs.his.mapper.FsUserMapper;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.hisStore.config.FsErpConfig;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.hc.openapi.tool.util.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.http.client.utils.DateUtils;
+import org.apache.http.util.Asserts;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+
+/**
+ * @Description: 旗舰版 erp
+ * @Param:
+ * @Return:
+ * @Author xgb
+ * @Date 2026/1/26 9:31
+ */
+@Slf4j
+@Service
+@Primary
+public class WdtTwoErpGoodsServiceImpl implements IErpGoodsService {
+
+    @Autowired
+    ConfigUtil configUtil;
+
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderScrmService;
+
+    @Autowired
+    private IFsStoreOrderItemScrmService fsStoreOrderItemScrmService;
+
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductScrmService;
+
+    @Autowired
+    private FsUserMapper fsUserMapper;
+
+
+
+    // 延迟初始化这些字段
+    private WdtTwoClient client;
+    private WdtTradeAPI api;
+
+    @PostConstruct
+    private void init() {
+        // 在 Spring 容器完成依赖注入后初始化
+        this.client = (WdtTwoClient)WdtTwoClient.get(
+                configUtil.getErpConfig().getErpWdSid(),
+                configUtil.getSysConfig().getErpWdBaseUrl(),
+                configUtil.getErpConfig().getErpWdAppKey(),
+                configUtil.getErpConfig().getErpWdAppsecret()
+        );
+        this.api = ApiFactory.get(client, WdtTradeAPI.class);
+    }
+
+
+    @Override
+    public BaseResponse addGoods(ErpGoods goods) {
+        return null;
+    }
+
+    @Override
+    public BaseResponse addGoodsScrm(ErpGoods goods) {
+        return null;
+    }
+
+
+    @Override
+    public ErpGoodsQueryResponse getGoods(ErpGoodsQueryRequert param) {
+        return null;
+    }
+
+
+    @Override
+    public ErpGoodsQueryResponse getGoodsScrm(ErpGoodsQueryRequert param) {
+        return null;
+    }
+
+    @Override
+    public ErpGoodsStockQueryResponse getGoodsStockScrm(ErpGoodsStockQueryRequert param) {
+        return null;
+    }
+
+
+    /**
+     * @Description: 库存查询
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/1/27 16:24
+     */
+    @Override
+    public ErpGoodsStockQueryResponse getGoodsStock(ErpGoodsStockQueryRequert param) {
+        String barcode = param.getBarcode();
+        Asserts.notNull(barcode, "barcode不能为空!");
+
+        StockSearch2Request request = new StockSearch2Request();
+        request.setSpecNos(Collections.singletonList(barcode));
+
+
+        StockSearch2Response response = api.search2(request, new Pager(1, 0, true));
+        if (response.getTotal() <= 0) {
+            log.info("获取erp库存失败! 商品编码{}", barcode);
+            throw new RuntimeException("该商品erp系统不存在");
+        }
+        List<StockSearch2Response.Detail> detailList = response.getDetailList();
+        List<ErpGoodsStock> list = new ArrayList<>();
+        for (StockSearch2Response.Detail stock : detailList) {
+            ErpGoodsStock erpGoodsStock = new ErpGoodsStock();
+            erpGoodsStock.setBarcode(barcode);
+            erpGoodsStock.setQty(String.valueOf(stock.getStockNum()).split("\\.")[0]); //999979.0000
+            erpGoodsStock.setSalable_qty(String.valueOf(stock.getAvailableSendStock()).split("\\.")[0]); //999976.0000
+            list.add(erpGoodsStock);
+        }
+
+        ErpGoodsStockQueryResponse erpGoodsStockQueryResponse = new ErpGoodsStockQueryResponse();
+        erpGoodsStockQueryResponse.setStocks(list);
+        return erpGoodsStockQueryResponse;
+
+
+    }
+
+
+
+}
+
+
+
+
+

+ 848 - 0
fs-service/src/main/java/com/fs/erp/service/impl/WdtTwoErpOrderServiceImpl.java

@@ -0,0 +1,848 @@
+package com.fs.erp.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.PropertyNamingStrategy;
+import com.alibaba.fastjson.parser.ParserConfig;
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fs.common.exception.ServiceException;
+import com.fs.erp.converter.ErpWdtToErpOrderMapper;
+import com.fs.erp.domain.*;
+import com.fs.erp.dto.*;
+import com.fs.erp.dto.sdk.wangdian.api.WdtClient;
+import com.fs.erp.dto.sdk.wangdian.enums.*;
+import com.fs.erp.dto.sdk.wangdianTwo.Pager;
+import com.fs.erp.dto.sdk.wangdianTwo.api.WdtTradeAPI;
+import com.fs.erp.dto.sdk.wangdianTwo.api.dto.*;
+import com.fs.erp.dto.sdk.wangdianTwo.impl.ApiFactory;
+import com.fs.erp.dto.sdk.wangdianTwo.impl.WdtTwoClient;
+import com.fs.erp.dto.wdt.*;
+import com.fs.erp.service.IErpOrderService;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.domain.FsStoreOrder;
+import com.fs.his.domain.FsStoreOrderItem;
+import com.fs.his.domain.FsStoreProduct;
+import com.fs.his.domain.FsUser;
+import com.fs.his.mapper.FsStoreOrderMapper;
+import com.fs.his.mapper.FsUserMapper;
+import com.fs.his.service.IFsStoreOrderItemService;
+import com.fs.his.service.IFsStoreOrderService;
+import com.fs.his.service.IFsStoreProductService;
+import com.fs.his.utils.ConfigUtil;
+import com.fs.hisStore.config.FsErpConfig;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.domain.FsStoreProductScrm;
+import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
+import com.fs.hisStore.service.IFsStoreProductScrmService;
+import com.fs.hisStore.vo.FsStoreOrderItemVO;
+import com.hc.openapi.tool.util.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.http.client.utils.DateUtils;
+import org.apache.http.util.Asserts;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+
+@Slf4j
+@Service
+@Primary
+public class WdtTwoErpOrderServiceImpl implements IErpOrderService {
+
+    @Autowired
+    ConfigUtil configUtil;
+
+    @Autowired
+    private IFsStoreOrderScrmService fsStoreOrderScrmService;
+
+    @Autowired
+    private IFsStoreOrderItemScrmService fsStoreOrderItemScrmService;
+
+    @Autowired
+    private IFsStoreProductScrmService fsStoreProductScrmService;
+
+    @Autowired
+    private FsUserMapper fsUserMapper;
+
+
+
+    // 延迟初始化这些字段
+    private WdtTwoClient client;
+    private WdtTradeAPI api;
+
+    @PostConstruct
+    private void init() {
+        // 在 Spring 容器完成依赖注入后初始化
+        this.client = (WdtTwoClient)WdtTwoClient.get(
+                configUtil.getErpConfig().getErpWdSid(),
+                configUtil.getSysConfig().getErpWdBaseUrl(),
+                configUtil.getErpConfig().getErpWdAppKey(),
+                configUtil.getErpConfig().getErpWdAppsecret()
+        );
+        this.api = ApiFactory.get(client, WdtTradeAPI.class);
+    }
+
+
+    @Override
+    public ErpOrderResponse addOrder(ErpOrder order) {
+        return null;
+    }
+
+
+    /**
+     * @Description: 物流推送
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/1/27 11:35
+     */
+    @Override
+    public ErpOrderResponse addOrderScrm(ErpOrder order) {
+        PushSelf2Request request = new PushSelf2Request();
+        if (StringUtils.isNotEmpty(order.getShopNo())) {
+            request.setShopNo(order.getShopNo());
+        }
+
+        PushSelf2Request.RawTrade rawTrade = new PushSelf2Request.RawTrade();
+
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderScrmService.selectFsStoreOrderByOrderCode(order.getPlatform_code());
+        BigDecimal couponPrice = fsStoreOrder.getCouponPrice();
+
+        // 订单id
+        rawTrade.setTid(order.getPlatform_code());
+        // 平台状态
+        rawTrade.setTradeStatus(TradeStatus.PAID_WAITING_FOR_SHIPMENT.getValue());
+        // 是否执行自动递交以系统配置为准 10: 待递交, 20: 已递交,30: 部分发货,40: 已发货,60: 已完成,70: 已取消
+        rawTrade.setProcessStatus(10);
+        // 0无退款 1申请退款 2部分退款 3全部退款
+        rawTrade.setRefundStatus(0);
+
+        // 1在线转帐 2现金,3银行转账,4邮局汇款 5预付款 6刷卡 7支付宝 8微信支付
+        rawTrade.setPayMethod(1);
+        // 下单时间
+        rawTrade.setTradeTime(order.getDeal_datetime());
+        // 支付时间
+        rawTrade.setPayTime(order.getDeal_datetime());
+        // 交易结束时间
+        rawTrade.setEndTime(null);
+        // 买家昵称/客户网名
+        rawTrade.setBuyerNick(order.getReceiver_name());
+        // 买家备注
+        rawTrade.setBuyerMessage(order.getBuyer_memo());
+        // 买家邮箱
+        rawTrade.setBuyerEmail("");
+        // 买家地区
+        rawTrade.setBuyerArea("");
+        // 收件人姓名
+        rawTrade.setReceiverName(order.getReceiver_name());
+        // 省市区空格分隔,示例【北京 北京市 朝阳区】,省市区推送旺店通地址库
+        rawTrade.setReceiverArea(order.getReceiver_province() + " " + order.getReceiver_city() + " " + order.getReceiver_district());
+        // 收件人详细地址,不包含省市区
+        rawTrade.setReceiverAddress(order.getReceiver_address());
+        // 收件人邮编
+        rawTrade.setReceiverZip("");
+        // 收件人手机
+        rawTrade.setReceiverMobile(order.getReceiver_mobile());
+        // 收件人电话
+        rawTrade.setReceiverTelno("");
+        // 邮费
+        rawTrade.setPostAmount(fsStoreOrder.getFreightPrice());
+        // 其他费用
+        rawTrade.setOtherAmount(BigDecimal.ZERO);
+        // 优惠金额
+        rawTrade.setDiscount(BigDecimal.ZERO);
+        // 应收金额
+        rawTrade.setReceivable(fsStoreOrder.getPayPrice());
+        // 平台费用
+        rawTrade.setPlatformCost(BigDecimal.ZERO);
+        // 发票类别 0:不需要,1:普通发票,2:增值税普通发票电子,3:增值税普通发票纸质,4:增值税专用发票
+//        rawTrade.setInvoiceType();
+        // 发票内容
+//        rawTrade.setInvoiceContent("");
+        // 物流类别
+//        rawTrade.setLogisticsType();
+        // 物流编号
+//        rawTrade.setCustData();
+
+
+        // 如果是货到付款
+        if ("2".equals(fsStoreOrder.getPayType())) {
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.PARTIALLY_PAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.CASH_ON_DELIVERY.getValue());
+            // 货到付款金额 = 物流代收金额-优惠金额
+            rawTrade.setCodAmount(fsStoreOrder.getPayDelivery().subtract(couponPrice));
+
+        } else if ("3".equals(fsStoreOrder.getPayType())) {
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.UNPAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.CASH_ON_DELIVERY.getValue());
+            // 货到付款金额 = 物流代收金额-优惠金额
+            rawTrade.setCodAmount(fsStoreOrder.getPayDelivery().subtract(couponPrice));
+        } else { // 如果是线上付款
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.FULLY_PAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.PAYMENT_BEFORE_DELIVERY.getValue());
+        }
+        // 平台支付订单ID
+        rawTrade.setPayId(String.valueOf(fsStoreOrder.getOrderCode()));
+        // 客服备注
+        rawTrade.setRemark(order.getSeller_memo());
+        // 客服备注标记 标旗(1 红、2 黄、3 绿、4 蓝、5 紫 无则填0)
+        rawTrade.setRemarkFlag(0);
+        // 是否是自流转 true自流转,false 非自流转
+        rawTrade.setIsAutoWms(false);
+        // 仓库编号
+        rawTrade.setWarehouseNo("");
+        if (fsStoreOrder.getPayMoney() != null) {
+            // 已付
+            rawTrade.setPaid(fsStoreOrder.getPayMoney());
+        }
+
+        // 还有的字段看接口文档 ....
+        request.setRawTrades(Collections.singletonList(rawTrade));
+
+        // 商品总价
+        BigDecimal totalPrice = fsStoreOrder.getTotalPrice();
+        // 总折扣金额 = 优惠券金额 + 折扣金额
+        BigDecimal totalDiscountPrice = BigDecimal.ZERO;
+        // 折扣金额
+        BigDecimal discountPrice = totalPrice.subtract(fsStoreOrder.getPayPrice());
+        totalDiscountPrice = couponPrice.add(discountPrice);
+
+        // 防止除零错误
+        if (totalPrice.compareTo(BigDecimal.ZERO) == 0) {
+            totalPrice = BigDecimal.ONE;
+        }
+
+        List<FsStoreOrderItemVO> fsStoreOrderItemVOS = fsStoreOrderItemScrmService.selectFsStoreOrderItemListByOrderId(fsStoreOrder.getId());
+        List<PushSelf2Request.RawTradeOrder> rawTradeOrders = new ArrayList<>();
+        BigDecimal nummber = BigDecimal.ZERO;
+        for (FsStoreOrderItemVO fsStoreOrderItem : fsStoreOrderItemVOS) {
+            PushSelf2Request.RawTradeOrder rawTradeOrder = new PushSelf2Request.RawTradeOrder();
+            // 原始订单号
+            rawTradeOrder.setTid(order.getPlatform_code());
+
+            // 原始子单号
+            rawTradeOrder.setOid(String.format("%s%s", fsStoreOrderItem.getOrderCode(), fsStoreOrderItem.getItemId()));
+            // 状态
+            rawTradeOrder.setStatus(TradeStatus.PAID_WAITING_FOR_SHIPMENT.getValue());
+            // 退款状态
+            rawTradeOrder.setRefundStatus(RefundStatus.NO_REFUND.getValue());
+
+            FsStoreProductScrm fsStoreProduct = fsStoreProductScrmService.selectFsStoreProductById(fsStoreOrderItem.getProductId());
+            if (fsStoreProduct == null) {
+                log.error("该商品不存在! 商品id[{}] ", fsStoreOrderItem.getProductId());
+                throw new RuntimeException("该商品不存在!");
+            }
+
+            // 平台货品ID
+            rawTradeOrder.setGoodsId(String.valueOf(fsStoreProduct.getProductId()));
+            JSONObject jsonObject = JSON.parseObject(fsStoreOrderItem.getJsonInfo());
+            rawTradeOrder.setSpecId(jsonObject.getString("sku"));
+            rawTradeOrder.setGoodsNo(jsonObject.getString("barCode"));
+            rawTradeOrder.setSpecNo(jsonObject.getString("sku"));
+            // 货品名称
+            rawTradeOrder.setGoodsName(fsStoreProduct.getProductName());
+            // 子单类型 0正常货品 1虚拟货品 2服务
+            rawTradeOrder.setOrderType(0);
+            // 平台类目
+//            rawTradeOrder.setCid();
+            // 数量
+            rawTradeOrder.setNum(BigDecimal.valueOf(fsStoreOrderItem.getNum()));
+            nummber = nummber.add(rawTradeOrder.getNum());
+            // 单价
+            //由于商品改价 用item里面的单价
+            rawTradeOrder.setPrice(jsonObject.getBigDecimal("price"));
+            // 调整
+            rawTradeOrder.setAdjustAmount(BigDecimal.ZERO);
+            // 优惠
+            rawTradeOrder.setDiscount(BigDecimal.ZERO);
+
+            // 分摊优惠
+            // 分摊比例
+            BigDecimal price = fsStoreProduct.getPrice().multiply(BigDecimal.valueOf(fsStoreOrderItem.getNum()));
+            BigDecimal divide = price.divide(totalPrice, RoundingMode.HALF_UP);
+            rawTradeOrder.setShareDiscount(divide.multiply(totalDiscountPrice));
+
+            // 总价格
+            rawTradeOrder.setTotalAmount(rawTradeOrder.getPrice().multiply(rawTradeOrder.getNum()));
+            // 退款金额
+            rawTradeOrder.setRefundAmount(BigDecimal.ZERO);
+            // 备注
+            rawTradeOrder.setRemark("");
+            // json串
+            rawTradeOrder.setJson("");
+            // 赠品方式 赠品方式 0非赠品1自动赠送2手工赠送4周期购赠送8平台赠送32阶梯满赠64CRM追加赠送65 主品
+            rawTradeOrder.setGiftType(0);
+
+            rawTradeOrders.add(rawTradeOrder);
+        }
+
+        // 最后一个商品的分摊优惠等于总优惠减去前面分摊优惠之和
+        Asserts.check(CollectionUtils.isNotEmpty(rawTradeOrders), "订单 {} 商品不能为空!", order.getPlatform_code());
+        long size = rawTradeOrders.size();
+        if (size > 1) {
+            PushSelf2Request.RawTradeOrder rawTradeOrder = rawTradeOrders.get(rawTradeOrders.size() - 1);
+            rawTradeOrder.setShareDiscount(totalDiscountPrice.subtract(rawTradeOrders.stream()
+                    .limit(size - 1L)
+                    .map(item -> Optional.ofNullable(item.getShareDiscount()).orElse(BigDecimal.ZERO))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add)));
+        }
+
+
+        request.setRawTradeOrders(rawTradeOrders);
+
+        // 原始单包含的子订单数,rawTradeOrderList节点下所有子单数之和
+        rawTrade.setOrderCount(fsStoreOrderItemVOS.size());
+        // 货品总数量,rawTradeOrderList节点下所有“num”数量之和
+        rawTrade.setGoodsCount(nummber);
+
+        // 优惠券 目前不添加
+        PushSelf2Response response = api.pushSelf2(request.getShopNo(), request.getRawTrades(), request.getRawTradeOrders(), request.getDiscountInfos());
+        if (response.getChgCount() <= 0 && response.getNewCount()<=0) {
+            log.info("订单推送失败: [{}]", response.getErrorList().get(0).getError());
+            throw new RuntimeException(String.format("订单推送失败, 原因: %s", response.getErrorList().get(0).getError()));
+        } else {
+            log.info("订单推送成功!");
+            ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
+            erpOrderResponse.setCode(order.getPlatform_code());
+            erpOrderResponse.setSuccess(true);
+            erpOrderResponse.setRequestRawData(JSON.toJSONString(request));
+            erpOrderResponse.setResponseRawData(JSON.toJSONString(response));
+            return erpOrderResponse;
+        }
+    }
+
+
+
+
+    @Override
+    public ErpOrderResponse refundOrder(ErpRefundOrder order) {
+        return null;
+    }
+
+    @Override
+    public ErpOrderResponse refundOrderScrm(ErpRefundOrder order) {
+        return null;
+    }
+
+    @Override
+    public ErpDeliverysResponse getDeliver(ErpDeliverysRequest param) {
+        return null;
+    }
+
+
+    @Override
+    public ErpOrderQueryResponse getScrmOrder(ErpOrderQueryRequert param) {
+        return null;
+    }
+
+    @Override
+    public ErpOrderQueryResponse getOrder(ErpOrderQueryRequert param){
+        QuerySelfOrderDetailRequest request = new QuerySelfOrderDetailRequest();
+        request.setSrcTid(param.getCode());
+        QuerySelfOrderDetailResponse response = api.querySelfOrderWithDetail(request, new Pager(1, 0, true));
+        if (response.getTotalCount() <= 0) {
+            log.info("订单信息不存在 订单号{}", param.getCode());
+            throw new RuntimeException("订单信息不存在");
+        }
+        return toErpOrderQueryResponse(response);
+    }
+
+    /**
+     * @Description: 订单查询
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/1/27 16:53
+     */
+    public ErpOrderQueryResponse getOrderScrm(ErpOrderQueryRequert param) {
+
+        QuerySelfOrderDetailRequest request = new QuerySelfOrderDetailRequest();
+        request.setSrcTid(param.getCode());
+        QuerySelfOrderDetailResponse response = api.querySelfOrderWithDetail(request, new Pager(1, 0, true));
+        if (response.getTotalCount() <= 0) {
+            log.info("订单信息不存在 订单号{}", param.getCode());
+            throw new RuntimeException("订单信息不存在");
+        }
+        return toErpOrderQueryResponse(response);
+
+    }
+
+    /**
+     * @Description: 只用于单个订单查询的返回结果转换
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/1/28 9:20
+     */
+    private ErpOrderQueryResponse toErpOrderQueryResponse(QuerySelfOrderDetailResponse source) {
+        ErpOrderQueryResponse response = new ErpOrderQueryResponse();
+        QuerySelfOrderDetailResponse.OrderInfo order = source.getOrder().get(0);
+
+        // 订单信息
+        ErpOrderQuery erpOrderQuery = new ErpOrderQuery();
+        // 快递编号
+        if (order.getLogisticsCode() != null) {
+            erpOrderQuery.setExpress_code(order.getLogisticsCode());
+        }
+        // 快递名称
+        if (order.getLogisticsName() != null) {
+            erpOrderQuery.setExpress_name(order.getLogisticsName());
+        }
+
+        // 收货人
+        if (order.getReceiverName() != null) {
+            erpOrderQuery.setReceiver_name(order.getReceiverName());
+        }
+
+        // 电话
+        if (order.getReceiverMobile() != null) {
+            erpOrderQuery.setReceiver_mobile(order.getReceiverMobile());
+        }
+
+        //地址
+        if (order.getReceiverAddress() != null) {
+            erpOrderQuery.setReceiver_address(order.getReceiverAddress());
+        }
+
+        // 运单号
+        if (order.getLogisticsNo() != null) {
+            erpOrderQuery.setExpress_code(order.getLogisticsNo());
+        }
+
+        // 订单状态
+        if (order.getTradeStatus() != null) {
+            erpOrderQuery.setDelivery_state(order.getTradeStatus());
+        }
+
+        // 订单号
+        if (order.getSrcTids() != null) {
+            erpOrderQuery.setCode(order.getSrcTids());
+        }
+        // 商品数量
+        if (order.getGoodsCount() != null) {
+            erpOrderQuery.setQty(order.getGoodsCount().intValue());
+        }
+        // 商品金额
+        if (order.getReceivable() != null) {
+            erpOrderQuery.setAmount(order.getReceivable().doubleValue());
+        }
+        // 支付金额
+        if (order.getPaid() != null) {
+            erpOrderQuery.setPayment(order.getPaid().doubleValue());
+        }
+
+        if(order.getConsignTime() != null){
+            // todo
+        }
+
+        // 物流信息
+        ErpDeliverys erpDeliverys = new ErpDeliverys();
+        erpDeliverys.setExpress_code(order.getLogisticsCode());
+        erpDeliverys.setExpress_name(order.getLogisticsName());
+        erpDeliverys.setMail_no(order.getLogisticsNo());
+        erpDeliverys.setDelivery(true);
+        erpOrderQuery.setDeliverys(Collections.singletonList(erpDeliverys));
+
+        response.setOrders(Collections.singletonList(erpOrderQuery));
+        return response;
+    }
+
+    //   // sales_refund_push.php
+    //	@Api(value = "aftersales.refund.RawRefund.upload2", paged = true)
+    //	StockSearch2Response rawRefundUpload(StockSearch2Request request, Pager pager);
+
+    /**
+     * @Description: 退款
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/1/28 9:23
+     */
+    @Override
+    public BaseResponse refundUpdateScrm(ErpRefundUpdateRequest param) {
+
+
+        FsErpConfig erpconfig = configUtil.getErpConfig();
+        log.info("退款单更新: {}", param);
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderScrmService.selectFsStoreOrderByOrderCode(param.getTid());
+
+        ErpOrderQueryRequert queryRequert = new ErpOrderQueryRequert();
+        queryRequert.setCode(fsStoreOrder.getExtendOrderId());
+
+        // 95已发货
+        //
+        //96 成本确认(待录入计划成本,订单结算时有货品无计划成本)
+        //
+        //101 已过账
+        //
+        //110已完成
+        Set<Integer> status = new HashSet<>();
+        status.add(95);
+        status.add(96);
+        status.add(101);
+        status.add(105);
+        status.add(110);
+
+        ErpOrderQueryResponse orderScrm = getOrderScrm(queryRequert);
+        ErpOrderQuery erpOrderQuery = orderScrm.getOrders().get(0);
+        Integer deliveryState = erpOrderQuery.getDelivery_state();
+        // 如果是未发货
+        if (!status.contains(deliveryState)) {
+            log.info("售前退款 参数: {}", param);
+            try {
+                ErpOrder order = fsStoreOrderScrmService.getErpOrder(fsStoreOrder);
+
+                Asserts.check(ObjectUtils.isNotNull(order), "该订单不存在!");
+
+                return getErpOrderRefundScrmResponse(order);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        //--------------售后退款------------
+        log.info("售后退款 参数: {}", param);
+        Map<String, String> map = new HashMap<>();
+
+
+        Asserts.check(ObjectUtils.isNotNull(fsStoreOrder), "该订单不存在! 订单id: {} ", param.getTid());
+
+        List<FsStoreOrderItemVO> fsStoreOrderItemVOS = fsStoreOrderItemScrmService.selectFsStoreOrderItemListByOrderId(fsStoreOrder.getId());
+
+        // 查询用户名称
+        FsUser fsUser = fsUserMapper.selectFsUserById(fsStoreOrder.getUserId());
+
+        RawRefundUpload2Request request = new RawRefundUpload2Request();
+        request.setShopNo(erpconfig.getErpWdShopCode());
+        List<RawRefundUpload2Request.RefundOrder> orders = new ArrayList<>();
+        for (FsStoreOrderItemVO item : fsStoreOrderItemVOS) {
+
+
+            RawRefundUpload2Request.RefundOrder order = new RawRefundUpload2Request.RefundOrder();
+            // 原始退款单号
+            order.setRefundNo(String.format("%s%s", item.getOrderCode(), item.getItemId()));
+            // 货品数量
+            order.setNum(BigDecimal.valueOf(item.getNum()));
+            // 原始单号
+            order.setTid(param.getTid());
+            // 原始子单号
+            order.setOid(String.format("%s%s", item.getOrderCode(), item.getItemId()));
+            // 退款单类型 0取消订单1退款(未发货,退款申请)2退货3换货4退款不退货
+            order.setType(2);
+            // 1取消退款,2已申请退款,3等待退货,4等待收货,5退款成功
+            order.setStatus(5);
+            // 退款版本
+            order.setRefundVersion("1");
+            JSONObject jsonObject = JSON.parseObject(item.getJsonInfo());
+            BigDecimal onePrice = jsonObject.getBigDecimal("price");
+            // 申请退款金额
+            order.setRefundAmount(onePrice.multiply(order.getNum()));
+            // 实际退款金额
+            order.setActualRefundAmount(order.getRefundAmount());
+            // 标题,对应原始退款单页面主单货品字段,若无传空字符串
+            order.setTitle("");
+            // 客户网名
+            order.setBuyerNick(fsUser != null ? fsUser.getNickName() : "");
+            // 是否售后退款单 0:否 1:是
+            order.setIsAftersale(1);
+            //
+            order.setReason("自研平台退款");
+            // 单价
+            order.setPrice(onePrice);
+            // 退款创建时间
+            order.setRefundTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
+            // 退款完成时间
+            order.setCurrentPhaseTimeout(order.getRefundTime());
+            // 物流
+            order.setLogisticsNo("");
+            order.setLogisticsName("");
+
+            orders.add(order);
+        }
+
+        request.setOrderList(orders);
+
+
+        RawRefundUpload2Response response = api.rawRefundUpload(request.getShopNo(),request.getOrderList());
+        if (response.getChgCount() <= 0 && response.getNewCount()<=0) {
+            log.info("退款单更新失败: {}", response);
+            throw new RuntimeException(String.format("退款单更新失败, 原因: %s", response.getErrorList().get(0).getError()));
+
+        } else {
+            log.info("退款单更新成功");
+            return new BaseResponse();
+        }
+    }
+
+
+    @Override
+    public BaseResponse refundUpdate(ErpRefundUpdateRequest param){
+        return null;
+    }
+
+    @Override
+    public ErpOrderResponse finishOrder(ErpOrder order){
+        return null;
+    }
+
+    @Override
+    public void getOrderDeliveryStatus(FsStoreOrder order) {
+
+    }
+
+    @Override
+    public void getOrderScrmDeliveryStatus(FsStoreOrderScrm order) {
+
+    }
+
+    /**
+     * scrm 如果未发货 修改订单为退款
+     *
+     * @param order 订单参数
+     * @return
+     */
+    private BaseResponse getErpOrderRefundScrmResponse(ErpOrder order) {
+
+        PushSelf2Request request = new PushSelf2Request();
+        if (StringUtils.isNotEmpty(order.getShopNo())) {
+            request.setShopNo(order.getShopNo());
+        }
+
+        PushSelf2Request.RawTrade rawTrade = new PushSelf2Request.RawTrade();
+
+        FsStoreOrderScrm fsStoreOrder = fsStoreOrderScrmService.selectFsStoreOrderByOrderCode(order.getPlatform_code());
+        BigDecimal couponPrice = fsStoreOrder.getCouponPrice();
+
+        // 订单id
+        rawTrade.setTid(order.getPlatform_code());
+        // 平台状态
+        rawTrade.setTradeStatus(TradeStatus.REFUNDED.getValue());
+        // 是否执行自动递交以系统配置为准 10: 待递交, 20: 已递交,30: 部分发货,40: 已发货,60: 已完成,70: 已取消
+        rawTrade.setProcessStatus(70);
+        // 0无退款 1申请退款 2部分退款 3全部退款
+        rawTrade.setRefundStatus(3);
+
+        // 1在线转帐 2现金,3银行转账,4邮局汇款 5预付款 6刷卡 7支付宝 8微信支付
+        rawTrade.setPayMethod(1);
+        // 下单时间
+        rawTrade.setTradeTime(order.getDeal_datetime());
+        // 支付时间
+        rawTrade.setPayTime(order.getDeal_datetime());
+        // 交易结束时间
+        rawTrade.setEndTime(null);
+        // 买家昵称/客户网名
+        rawTrade.setBuyerNick(order.getReceiver_name());
+        // 买家备注
+        rawTrade.setBuyerMessage(order.getBuyer_memo());
+        // 买家邮箱
+        rawTrade.setBuyerEmail("");
+        // 买家地区
+        rawTrade.setBuyerArea("");
+        // 收件人姓名
+        rawTrade.setReceiverName(order.getReceiver_name());
+        // 省市区空格分隔,示例【北京 北京市 朝阳区】,省市区推送旺店通地址库
+        rawTrade.setReceiverArea(order.getReceiver_province() + " " + order.getReceiver_city() + " " + order.getReceiver_district());
+        // 收件人详细地址,不包含省市区
+        rawTrade.setReceiverAddress(order.getReceiver_address());
+        // 收件人邮编
+        rawTrade.setReceiverZip("");
+        // 收件人手机
+        rawTrade.setReceiverMobile(order.getReceiver_mobile());
+        // 收件人电话
+        rawTrade.setReceiverTelno("");
+        // 邮费
+        rawTrade.setPostAmount(fsStoreOrder.getFreightPrice());
+        // 其他费用
+        rawTrade.setOtherAmount(BigDecimal.ZERO);
+        // 优惠金额
+        rawTrade.setDiscount(BigDecimal.ZERO);
+        // 应收金额
+        rawTrade.setReceivable(fsStoreOrder.getPayPrice());
+        // 平台费用
+        rawTrade.setPlatformCost(BigDecimal.ZERO);
+        // 发票类别 0:不需要,1:普通发票,2:增值税普通发票电子,3:增值税普通发票纸质,4:增值税专用发票
+//        rawTrade.setInvoiceType();
+        // 发票内容
+//        rawTrade.setInvoiceContent("");
+        // 物流类别
+//        rawTrade.setLogisticsType();
+        // 物流编号
+//        rawTrade.setCustData();
+
+
+        // 如果是货到付款
+        if ("2".equals(fsStoreOrder.getPayType())) {
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.PARTIALLY_PAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.CASH_ON_DELIVERY.getValue());
+            // 货到付款金额 = 物流代收金额-优惠金额
+            rawTrade.setCodAmount(fsStoreOrder.getPayDelivery().subtract(couponPrice));
+
+        } else if ("3".equals(fsStoreOrder.getPayType())) {
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.UNPAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.CASH_ON_DELIVERY.getValue());
+            // 货到付款金额 = 物流代收金额-优惠金额
+            rawTrade.setCodAmount(fsStoreOrder.getPayDelivery().subtract(couponPrice));
+        } else { // 如果是线上付款
+            // 支付状态
+            rawTrade.setPayStatus(PaymentStatus.FULLY_PAID.getValue());
+            // 发货条件
+            rawTrade.setDeliveryTerm(DeliveryTerm.PAYMENT_BEFORE_DELIVERY.getValue());
+        }
+        // 平台支付订单ID
+        rawTrade.setPayId(String.valueOf(fsStoreOrder.getOrderCode()));
+        // 客服备注
+        rawTrade.setRemark(order.getSeller_memo());
+        // 客服备注标记 标旗(1 红、2 黄、3 绿、4 蓝、5 紫 无则填0)
+        rawTrade.setRemarkFlag(0);
+        // 是否是自流转 true自流转,false 非自流转
+        rawTrade.setIsAutoWms(false);
+        // 仓库编号
+        rawTrade.setWarehouseNo("");
+        if (fsStoreOrder.getPayMoney() != null) {
+            // 已付
+            rawTrade.setPaid(fsStoreOrder.getPayMoney());
+        }
+
+        // 还有的字段看接口文档 ....
+        request.setRawTrades(Collections.singletonList(rawTrade));
+
+        // 商品总价
+        BigDecimal totalPrice = fsStoreOrder.getTotalPrice();
+        // 总折扣金额 = 优惠券金额 + 折扣金额
+        BigDecimal totalDiscountPrice = BigDecimal.ZERO;
+        // 折扣金额
+        BigDecimal discountPrice = totalPrice.subtract(fsStoreOrder.getPayPrice());
+        totalDiscountPrice = couponPrice.add(discountPrice);
+
+        // 防止除零错误
+        if (totalPrice.compareTo(BigDecimal.ZERO) == 0) {
+            totalPrice = BigDecimal.ONE;
+        }
+
+        List<FsStoreOrderItemVO> fsStoreOrderItemVOS = fsStoreOrderItemScrmService.selectFsStoreOrderItemListByOrderId(fsStoreOrder.getId());
+        List<PushSelf2Request.RawTradeOrder> rawTradeOrders = new ArrayList<>();
+        BigDecimal nummber = BigDecimal.ZERO;
+        for (FsStoreOrderItemVO fsStoreOrderItem : fsStoreOrderItemVOS) {
+            PushSelf2Request.RawTradeOrder rawTradeOrder = new PushSelf2Request.RawTradeOrder();
+            // 原始订单号
+            rawTradeOrder.setTid(order.getPlatform_code());
+
+            // 原始子单号
+            rawTradeOrder.setOid(String.format("%s%s", fsStoreOrderItem.getOrderCode(), fsStoreOrderItem.getItemId()));
+            // 状态
+            rawTradeOrder.setStatus(TradeStatus.PAID_WAITING_FOR_SHIPMENT.getValue());
+            // 退款状态
+            rawTradeOrder.setRefundStatus(RefundStatus.NO_REFUND.getValue());
+
+            FsStoreProductScrm fsStoreProduct = fsStoreProductScrmService.selectFsStoreProductById(fsStoreOrderItem.getProductId());
+            if (fsStoreProduct == null) {
+                log.error("该商品不存在! 商品id[{}] ", fsStoreOrderItem.getProductId());
+                throw new RuntimeException("该商品不存在!");
+            }
+
+            // 平台货品ID
+            rawTradeOrder.setGoodsId(String.valueOf(fsStoreProduct.getProductId()));
+            JSONObject jsonObject = JSON.parseObject(fsStoreOrderItem.getJsonInfo());
+            rawTradeOrder.setSpecId(jsonObject.getString("sku"));
+            rawTradeOrder.setGoodsNo(jsonObject.getString("barCode"));
+            rawTradeOrder.setSpecNo(jsonObject.getString("sku"));
+            // 货品名称
+            rawTradeOrder.setGoodsName(fsStoreProduct.getProductName());
+            // 子单类型 0正常货品 1虚拟货品 2服务
+            rawTradeOrder.setOrderType(0);
+            // 平台类目
+//            rawTradeOrder.setCid();
+            // 数量
+            rawTradeOrder.setNum(BigDecimal.valueOf(fsStoreOrderItem.getNum()));
+            nummber = nummber.add(rawTradeOrder.getNum());
+            // 单价
+            //由于商品改价 用item里面的单价
+            rawTradeOrder.setPrice(jsonObject.getBigDecimal("price"));
+            // 调整
+            rawTradeOrder.setAdjustAmount(BigDecimal.ZERO);
+            // 优惠
+            rawTradeOrder.setDiscount(BigDecimal.ZERO);
+
+            // 分摊优惠
+            // 分摊比例
+            BigDecimal price = fsStoreProduct.getPrice().multiply(BigDecimal.valueOf(fsStoreOrderItem.getNum()));
+            BigDecimal divide = price.divide(totalPrice, RoundingMode.HALF_UP);
+            rawTradeOrder.setShareDiscount(divide.multiply(totalDiscountPrice));
+
+            // 总价格
+            rawTradeOrder.setTotalAmount(rawTradeOrder.getPrice().multiply(rawTradeOrder.getNum()));
+            // 退款金额
+            rawTradeOrder.setRefundAmount(BigDecimal.ZERO);
+            // 备注
+            rawTradeOrder.setRemark("");
+            // json串
+            rawTradeOrder.setJson("");
+            // 赠品方式 赠品方式 0非赠品1自动赠送2手工赠送4周期购赠送8平台赠送32阶梯满赠64CRM追加赠送65 主品
+            rawTradeOrder.setGiftType(0);
+
+            rawTradeOrders.add(rawTradeOrder);
+        }
+
+        // 最后一个商品的分摊优惠等于总优惠减去前面分摊优惠之和
+        Asserts.check(CollectionUtils.isNotEmpty(rawTradeOrders), "订单 {} 商品不能为空!", order.getPlatform_code());
+        long size = rawTradeOrders.size();
+        if (size > 1) {
+            PushSelf2Request.RawTradeOrder rawTradeOrder = rawTradeOrders.get(rawTradeOrders.size() - 1);
+            rawTradeOrder.setShareDiscount(totalDiscountPrice.subtract(rawTradeOrders.stream()
+                    .limit(size - 1L)
+                    .map(item -> Optional.ofNullable(item.getShareDiscount()).orElse(BigDecimal.ZERO))
+                    .reduce(BigDecimal.ZERO, BigDecimal::add)));
+        }
+
+
+        request.setRawTradeOrders(rawTradeOrders);
+
+        // 原始单包含的子订单数,rawTradeOrderList节点下所有子单数之和
+        rawTrade.setOrderCount(fsStoreOrderItemVOS.size());
+        // 货品总数量,rawTradeOrderList节点下所有“num”数量之和
+        rawTrade.setGoodsCount(nummber);
+
+        // 优惠券 目前不添加
+        PushSelf2Response response = api.pushSelf2(request.getShopNo(), request.getRawTrades(), request.getRawTradeOrders(), request.getDiscountInfos());
+        if (response.getChgCount() <= 0 && response.getNewCount()<=0) {
+            log.info("未发货退款单更新失败: {}", response);
+            throw new RuntimeException(String.format("退款单更新失败, 原因: %s", response.getErrorList().get(0).getError()));
+        } else {
+            log.info("未发货退款单更新成功");
+            ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
+            erpOrderResponse.setCode(order.getPlatform_code());
+            erpOrderResponse.setSuccess(true);
+            erpOrderResponse.setRequestRawData(JSON.toJSONString(request));
+            erpOrderResponse.setResponseRawData(JSON.toJSONString(response));
+            return erpOrderResponse;
+        }
+    }
+
+    @Override
+    public Map<String,Object>  stockOutOrderQueryTrade(ErpOrderQueryRequert param){
+        return null;
+    }
+
+}

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java

@@ -106,6 +106,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
     @Autowired
     private TzBankService tzBankService;
     @Autowired
+    @Qualifier("erpOrderServiceImpl")
     private IErpOrderService erpOrderService;
     @Autowired
     @Qualifier("hzOMSErpOrderServiceImpl")
@@ -126,6 +127,10 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
     @Qualifier("k9OrderScrmServiceImpl")
     private IErpOrderService k9OrderService;
 
+    @Autowired
+    @Qualifier("wdtTwoErpOrderServiceImpl")
+    private IErpOrderService wdtTwoOrderService;
+
     @Autowired
     private FsStorePaymentMapper fsStorePaymentMapper;
     @Autowired
@@ -617,6 +622,8 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
                         jSTOrderService.refundUpdate(request);
                     } else if (erpType == 6) {
                         k9OrderService.refundUpdate(request);
+                    }else if (erpType == 7) {
+                        wdtTwoOrderService.refundUpdate(request);
                     }
                 }
             }

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreCartScrmServiceImpl.java

@@ -58,6 +58,10 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
     @Qualifier("wdtErpGoodsServiceImpl")
     private IErpGoodsService wdtErpGoodsService;
 
+    @Autowired
+    @Qualifier("wdtTwoErpGoodsServiceImpl")
+    private IErpGoodsService wdtTwoErpGoodsService;
+
     @Autowired
     @Qualifier("k9StockScrmServiceImpl")
     private IErpGoodsService k9StockService;
@@ -340,6 +344,8 @@ public class FsStoreCartScrmServiceImpl implements IFsStoreCartScrmService
                 } else if (erpType == 3) {
                     //旺店通
                     goodsService = k9StockService;
+                }else if(erpType == 7){ // 旺店通旗舰版
+                    goodsService = wdtTwoErpGoodsService;
                 }
             }
         }

+ 37 - 28
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -245,6 +245,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     @Qualifier("wdtErpOrderServiceImpl")
     private IErpOrderService wdtOrderService;
 
+    @Autowired
+    @Qualifier("wdtTwoErpOrderServiceImpl")
+    private IErpOrderService wdtTwoOrderService;
+
     @Autowired
     @Qualifier("k9OrderScrmServiceImpl")
     private IErpOrderService k9OrderService;
@@ -1145,17 +1149,17 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         FsStoreOrderScrm order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderCode);
         if (order != null && order.getStatus() == OrderInfoEnum.STATUS_1.getValue()) {
             // 查询订单出库时间
-            ErpOrderQueryRequert param=new ErpOrderQueryRequert();
-            param.setCode(extendOrderId);
-            Map<String, Object> result=wdtOrderService.stockOutOrderQueryTrade(param);
-            List<Map<String, Object>> stockoutList=(List<Map<String, Object>>) result.get("stockout_list");
-            String consignTime=null;
-            if(stockoutList!=null&& !stockoutList.isEmpty()){
-                if(stockoutList.get(0).get("consign_time")!=null){
-                    consignTime = stockoutList.get(0).get("consign_time").toString();
-                    log.info("发货时间:{}",consignTime);
-                }
-            }
+//            ErpOrderQueryRequert param=new ErpOrderQueryRequert();
+//            param.setCode(extendOrderId);
+//            Map<String, Object> result=wdtOrderService.stockOutOrderQueryTrade(param);
+//            List<Map<String, Object>> stockoutList=(List<Map<String, Object>>) result.get("stockout_list");
+//            String consignTime=null;
+//            if(stockoutList!=null&& !stockoutList.isEmpty()){
+//                if(stockoutList.get(0).get("consign_time")!=null){
+//                    consignTime = stockoutList.get(0).get("consign_time").toString();
+//                    log.info("发货时间:{}",consignTime);
+//                }
+//            }
 
             FsExpressScrm express = expressService.selectFsExpressByOmsCode(deliverCode);
             if (express != null) {
@@ -1164,17 +1168,19 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             }
             order.setStatus(OrderInfoEnum.STATUS_2.getValue());
             order.setDeliveryId(deliveryId);
-//            if(StringUtils.isEmpty(consignTime)){
+//            if(StringUtils.isEmptconsignTime)){
 //                // 后期优化
 //                logger.info("发货时间为空更新为当前时间,订单:{}",orderCode);
 //                order.setDeliverySendTime(new Date());
 //            }else {
 //                order.setDeliverySendTime(DateUtils.parseDate(consignTime));
 //            }
+            // todo 后面优化
+            order.setDeliverySendTime(new Date());
             // 定时每2小时同步物流信息
-            if(StringUtils.isNotBlank(consignTime) && !consignTime.startsWith("0000")){
-                order.setDeliverySendTime(DateUtils.parseDate(consignTime));
-            }
+//            if(StringUtils.isNotBlank(consignTime) && !consignTime.startsWith("0000")){
+//                order.setDeliverySendTime(DateUtils.parseDate(consignTime));
+//            }
 
 
             fsStoreOrderMapper.updateFsStoreOrder(order);
@@ -1804,17 +1810,6 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             erpOrder.setShop_code(erpConfig.getErpJstShopCode());
         }
 
-
-            //查询出这个订单是哪个公司得,并且拿到绑定店铺id
-        Company company =companyMapper.selectCompanyById(order.getCompanyId());
-
-        //判定公司是否绑定店铺,绑定则赋值,不绑定则跳过
-        if (ObjectUtil.isNotEmpty(company)&&ObjectUtil.isNotEmpty(company.getStoreId())){
-            FsStoreScrm fsStoreScrm = fsStoreMapper.selectFsStoreByStoreId(company.getStoreId());
-            if (ObjectUtil.isNotEmpty(fsStoreScrm)){
-                erpOrder.setShopNo(fsStoreScrm.getStoreNo());
-            }
-        }
         log.info("进入到erp传入参数erpOrder={}",erpOrder);
         ErpOrderResponse response = erpOrderService.addOrderScrm(erpOrder);
 //        ErpOrderResponse response= k9OrderService.addOmsOrder(order.getId());
@@ -1841,6 +1836,18 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         erpOrder.setPlatform_code(order.getOrderCode());
         erpOrder.setWarehouse_code(erpConfig.getErpWarehouseCode());
         erpOrder.setShop_code(erpConfig.getErpShopCode());
+        erpOrder.setShopNo(erpConfig.getErpWdShopCode());
+        //查询出这个订单是哪个公司得,并且拿到绑定店铺id
+        Company company =companyMapper.selectCompanyById(order.getCompanyId());
+
+        //判定公司是否绑定店铺,绑定则赋值,不绑定则跳过
+        if (ObjectUtil.isNotEmpty(company)&&ObjectUtil.isNotEmpty(company.getStoreId())){
+            FsStoreScrm fsStoreScrm = fsStoreMapper.selectFsStoreByStoreId(company.getStoreId());
+            if (ObjectUtil.isNotEmpty(fsStoreScrm)){
+                erpOrder.setShopNo(fsStoreScrm.getStoreNo());
+            }
+        }
+
         erpOrder.setBuyer_account(order.getRealName());
 
 //      erpOrder.setPost_fee(order.getTotalPostage().doubleValue());
@@ -1886,7 +1893,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             CompanyUser companyUser = companyUserService.selectCompanyUserById(order.getCompanyUserId());
             if (companyUser != null) {
                 // 获取公司名称
-                Company company = companyService.selectCompanyById(companyUser.getCompanyId());
+//                Company company = companyService.selectCompanyById(companyUser.getCompanyId());
                 if(company !=null){
                     erpOrder.setSeller_memo(company.getCompanyName());
                 }
@@ -3081,7 +3088,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                 //管易
                 erpOrderService = gyOrderService;
             } else if (erpType == 2) {
-                //旺店通
+                //旺店通 企业版
                 erpOrderService = wdtOrderService;
             } else if (erpType == 3) {
                 //瀚智OMS
@@ -3095,6 +3102,8 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             } else if (erpType == 6) {
                 //金博
                 erpOrderService = k9OrderService;
+            }else if(erpType == 7){ // 旺店通旗舰版
+                erpOrderService = wdtTwoOrderService;
             }
         }
         return erpOrderService;

+ 0 - 2
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreOrderScrmController.java

@@ -57,8 +57,6 @@ public class FsStoreOrderScrmController extends BaseController
     @Autowired
     private IFsExpressService expressService;
 
-    @Autowired
-    IErpOrderService erpOrderService;
     @Autowired
     FsStoreOrderItemScrmMapper fsStoreOrderItemMapper;
     @Autowired

+ 0 - 2
fs-store/src/main/java/com/fs/store/controller/store/FsStoreOrderController.java

@@ -55,8 +55,6 @@ public class FsStoreOrderController extends BaseController
     @Autowired
     private IFsExpressService expressService;
 
-    @Autowired
-    IErpOrderService erpOrderService;
     @Autowired
     FsStoreOrderItemMapper fsStoreOrderItemMapper;
     @Autowired

+ 0 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/PayScrmController.java

@@ -48,8 +48,6 @@ public class PayScrmController {
 
     @Autowired
     private FSSysConfig sysConfig;
-    @Autowired
-    IErpOrderService erpOrderService;
 
     @Autowired
     private IFsStoreOrderItemScrmService storeOrderItemService;

+ 0 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/ProductScrmController.java

@@ -49,8 +49,6 @@ public class ProductScrmController extends AppBaseController {
     private IFsStoreOrderScrmService orderService;
     @Autowired
     private IFsStoreProductRelationScrmService productRelationService;
-    @Autowired
-    IErpGoodsService goodsService;
 
     @Autowired
     private IFsStoreScrmService storeScrmService;

+ 0 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -99,8 +99,6 @@ public class StoreOrderScrmController extends AppBaseController {
     @Autowired
     private FSSysConfig sysConfig;
     @Autowired
-    private IErpOrderService erpOrderService;
-    @Autowired
     private ISysConfigService configService;
     @Autowired
     private IFsStoreAfterSalesScrmService afterSalesService;