diff --git a/BBWY.1688SDK/APIFacade.cs b/BBWY.1688SDK/APIFacade.cs new file mode 100644 index 00000000..24a71cbb --- /dev/null +++ b/BBWY.1688SDK/APIFacade.cs @@ -0,0 +1,39 @@ +using com.alibaba.openapi.client; +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.policy; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetSdkClient.sdk +{ + public class APIFacade + { + private ClientPolicy clientPolicy; + + public APIFacade(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + + private SyncAPIClient getAPIClient() + { + return new SyncAPIClient(clientPolicy); + } + + public AuthorizationToken getToken(string code) + { + + return getAPIClient().getToken(code); + + } + + public AuthorizationToken refreshToken(String refreshToken) + { + return getAPIClient().refreshToken(refreshToken); + } + } +} diff --git a/BBWY.1688SDK/APIId.cs b/BBWY.1688SDK/APIId.cs new file mode 100644 index 00000000..0fefda53 --- /dev/null +++ b/BBWY.1688SDK/APIId.cs @@ -0,0 +1,43 @@ +using System; + +namespace com.alibaba.openapi.client +{ + public class APIId + { + public APIId() + { + + } + + public APIId(String namespaceValue,String name, int version) + { + this.NamespaceValue = namespaceValue; + this.Name = name; + this.version = version; + } + + private String namespaceValue; + + public String NamespaceValue + { + get { return namespaceValue; } + set { namespaceValue = value; } + } + private String name; + + public String Name + { + get { return name; } + set { name = value; } + } + private int version; + + public int Version + { + get { return version; } + set { version = value; } + } + + + } +} diff --git a/BBWY.1688SDK/BBWY.1688SDK.csproj b/BBWY.1688SDK/BBWY.1688SDK.csproj new file mode 100644 index 00000000..4b4233dd --- /dev/null +++ b/BBWY.1688SDK/BBWY.1688SDK.csproj @@ -0,0 +1,16 @@ + + + + netstandard2.0 + BBWY._1688SDK + + + + + + + + + + + diff --git a/BBWY.1688SDK/GatewayAPIRequest.cs b/BBWY.1688SDK/GatewayAPIRequest.cs new file mode 100644 index 00000000..8d4508a7 --- /dev/null +++ b/BBWY.1688SDK/GatewayAPIRequest.cs @@ -0,0 +1,23 @@ +using com.alibaba.openapi.client.entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + public class GatewayAPIRequest + { + [DataMember(Order = 0)] + private APIId apiId; + + public APIId ApiId + { + get { return apiId; } + set { apiId = value; } + } + + } +} diff --git a/BBWY.1688SDK/GatewayAPIResponse.cs b/BBWY.1688SDK/GatewayAPIResponse.cs new file mode 100644 index 00000000..15a3bfe8 --- /dev/null +++ b/BBWY.1688SDK/GatewayAPIResponse.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class GatewayAPIResponse + { + } +} diff --git a/BBWY.1688SDK/Request.cs b/BBWY.1688SDK/Request.cs new file mode 100644 index 00000000..54835073 --- /dev/null +++ b/BBWY.1688SDK/Request.cs @@ -0,0 +1,66 @@ +using com.alibaba.openapi.client.entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class Request + { + [DataMember(Order = 0)] + private APIId apiId; + + public APIId ApiId + { + get { return apiId; } + set { apiId = value; } + } + private Dictionary addtionalParams = new Dictionary(); + + public Dictionary AddtionalParams + { + get { return addtionalParams; } + set { addtionalParams = value; } + } + private Object requestEntity; + + public Object RequestEntity + { + get { return requestEntity; } + set { requestEntity = value; } + } + private Dictionary attachments; + + public Dictionary Attachments + { + get { return attachments; } + set { attachments = value; } + } + private String authCodeKey; + + public String AuthCodeKey + { + get { return authCodeKey; } + set { authCodeKey = value; } + } + [DataMember(Order = 1)] + private String accessToken; + + public String AccessToken + { + get { return accessToken; } + set { accessToken = value; } + } + private AuthorizationToken authToken; + + internal AuthorizationToken AuthToken + { + get { return authToken; } + set { authToken = value; } + } + } +} diff --git a/BBWY.1688SDK/Response.cs b/BBWY.1688SDK/Response.cs new file mode 100644 index 00000000..5db43fa6 --- /dev/null +++ b/BBWY.1688SDK/Response.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using com.alibaba.openapi.client.entity; + +namespace com.alibaba.openapi.client +{ + public class Response + { + private int statusCode; + + public int StatusCode + { + get { return statusCode; } + set { statusCode = value; } + } + private Object result; + + public Object Result + { + get { return result; } + set { result = value; } + } + private Exception exception; + + public Exception Exception + { + get { return exception; } + set { exception = value; } + } + private String charset = "UTF-8"; + + public String Charset + { + get { return charset; } + set { charset = value; } + } + private String encoding; + + public String Encoding + { + get { return encoding; } + set { encoding = value; } + } + + private ResponseWrapper responseWrapper; + + internal ResponseWrapper ResponseWrapper + { + get { return responseWrapper; } + set { responseWrapper = value; } + } + } +} diff --git a/BBWY.1688SDK/SyncAPIClient.cs b/BBWY.1688SDK/SyncAPIClient.cs new file mode 100644 index 00000000..9d49d04a --- /dev/null +++ b/BBWY.1688SDK/SyncAPIClient.cs @@ -0,0 +1,117 @@ +using BBWY.Common.Http; +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.http; +using com.alibaba.openapi.client.policy; +using Newtonsoft.Json.Linq; +using System; + +namespace com.alibaba.openapi.client +{ + public class SyncAPIClient + { + private ClientPolicy clientPolicy; + private RestApiService restApiService; + private HttpClient alibabaHttpClient; + + public SyncAPIClient(String appKey, String appSecret) + { + this.clientPolicy = new ClientPolicy(); + this.clientPolicy.AppKey = appKey; + this.clientPolicy.SecretKey = appSecret; + } + + public SyncAPIClient(String appKey, String appSecret, RestApiService restApiService) + { + this.clientPolicy = new ClientPolicy(); + this.clientPolicy.AppKey = appKey; + this.clientPolicy.SecretKey = appSecret; + this.restApiService = restApiService; + this.alibabaHttpClient = new HttpClient(clientPolicy, restApiService); + } + + public SyncAPIClient(String appKey, String appSecret, String gatewayHost) + { + this.clientPolicy = new ClientPolicy(); + this.clientPolicy.AppKey = appKey; + this.clientPolicy.SecretKey = appSecret; + this.clientPolicy.ServerHost = gatewayHost; + } + + public SyncAPIClient(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + public JObject NewRequest(Request request, RequestPolicy policy) + { + return alibabaHttpClient.NewRequest(request, policy); + } + + public T send(Request request, RequestPolicy policy) + { + HttpClient httpClient = new HttpClient(clientPolicy); + T result = httpClient.request(request, policy); + return result; + } + + public Res execute(GatewayAPIRequest gatewayAPIRequest, String accessToken) + { + HttpClient httpClient = new HttpClient(clientPolicy); + RequestPolicy policy = new RequestPolicy(); + policy.UseHttps = true; + Request request = new Request(); + request.ApiId = gatewayAPIRequest.ApiId; + request.RequestEntity = gatewayAPIRequest; + request.AccessToken = accessToken; + Res result = httpClient.request(request, policy); + return result; + } + + public AuthorizationToken getToken(String code) + { + + APIId apiId = new APIId(); + apiId.Name = "getToken"; + apiId.NamespaceValue = "system.oauth2"; + apiId.Version = 1; + + Request request = new Request(); + request.ApiId = apiId; + + request.AddtionalParams["code"] = code; + request.AddtionalParams["grant_type"] = "authorization_code"; + request.AddtionalParams["need_refresh_token"] = true; + request.AddtionalParams["client_id"] = clientPolicy.AppKey; + request.AddtionalParams["client_secret"] = clientPolicy.SecretKey; + request.AddtionalParams["redirect_uri"] = "default"; + RequestPolicy oauthPolicy = new RequestPolicy(); + oauthPolicy.UseHttps = true; + + return this.send(request, oauthPolicy); + } + + public AuthorizationToken refreshToken(String refreshToken) + { + + APIId apiId = new APIId(); + apiId.Name = "getToken"; + apiId.NamespaceValue = "system.oauth2"; + apiId.Version = 1; + + Request request = new Request(); + request.ApiId = apiId; + + request.AddtionalParams["refreshToken"] = refreshToken; + request.AddtionalParams["grant_type"] = "refresh_token"; + request.AddtionalParams["client_id"] = clientPolicy.AppKey; + request.AddtionalParams["client_secret"] = clientPolicy.SecretKey; + request.AddtionalParams["redirect_uri"] = "default"; + RequestPolicy oauthPolicy = new RequestPolicy(); + oauthPolicy.UseHttps = true; + return this.send(request, oauthPolicy); + + + } + } +} + diff --git a/BBWY.1688SDK/entity/AuthorizationToken.cs b/BBWY.1688SDK/entity/AuthorizationToken.cs new file mode 100644 index 00000000..15163a7b --- /dev/null +++ b/BBWY.1688SDK/entity/AuthorizationToken.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class AuthorizationToken + { + [DataMember(Order = 0)] + private String access_token; + [DataMember(Order = 1)] + private String refresh_token; + [DataMember(Order = 2)] + private long expires_in; + [DataMember(Order = 3)] + private DateTime expires_time; + [DataMember(Order = 4)] + private DateTime refresh_token_timeout; + [DataMember(Order = 5)] + private String resource_owner; + [DataMember(Order = 6)] + private String uid; + [DataMember(Order = 7)] + private long aliId; + [DataMember(Order = 8)] + private String memberId; + + /** + * 获取access_token + * + * @return the accessToken + */ + public String getAccess_token() + { + return access_token; + } + + /** + * 获取access_token过期时间 + * + * @return the accessTokenTimeout + */ + public long getExpires_in() + { + return expires_in; + } + + /** + * 获取refresh_token + * + * @return the refreshToken + */ + public String getRefresh_token() + { + return refresh_token; + } + + /** + * 获取refresh_token过期时间 + * + * @return the refreshTokenTimeout + */ + public DateTime getRefresh_token_timeout() + { + return refresh_token_timeout; + } + + public String getMemberId() + { + return memberId; + } + + public void setMemberId(String memberId) + { + this.memberId = memberId; + } + + /** + * 获取resource_owner + * + * @return the resourceOwnerId + */ + public String getResource_owner() + { + return resource_owner; + } + + /** + * 获取uid + * + * @return the uid + */ + public String getUid() + { + return uid; + } + + /** + * 获取aliId + * + * @return the aliId + */ + public long getAliId() + { + return aliId; + } + + public void setAccess_token(String accessToken) + { + this.access_token = accessToken; + } + + public void setRefresh_token(String refreshToken) + { + this.refresh_token = refreshToken; + } + + public void setExpires_in(long accessTokenTimeout) + { + this.expires_in = accessTokenTimeout; + DateTime now = new DateTime(); + this.expires_time = now.AddSeconds(accessTokenTimeout); + } + + public void setRefresh_token_timeout(DateTime refresh_token_timeout) + { + this.refresh_token_timeout = refresh_token_timeout; + } + + public void setResource_owner(String resourceOwnerId) + { + this.resource_owner = resourceOwnerId; + } + + public void setUid(String uid) + { + this.uid = uid; + } + + public void setAliId(long aliId) + { + this.aliId = aliId; + } + + /** + * 获取access_token过期时间,Date格式 + * + * @return the accessTokenTimeout + */ + public DateTime getExpires_time() + { + return expires_time; + } + } +} diff --git a/BBWY.1688SDK/entity/ErrorExceptionDesc.cs b/BBWY.1688SDK/entity/ErrorExceptionDesc.cs new file mode 100644 index 00000000..62fce097 --- /dev/null +++ b/BBWY.1688SDK/entity/ErrorExceptionDesc.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + [DataContract(Namespace = "com.alibaba.openapi.client")] + public class ErrorExceptionDesc + { + [DataMember(Order = 0)] + private string error_code; + [DataMember(Order = 1)] + private string error_message; + [DataMember(Order = 2)] + private string exception; + + public string getError_code() + { + return this.error_code; + } + + public string getError_message() + { + return this.error_message; + } + + public string getException() + { + return this.exception; + } + } +} diff --git a/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs b/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs new file mode 100644 index 00000000..20533221 --- /dev/null +++ b/BBWY.1688SDK/entity/OrderPreview/CreateOrderPreview.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace BBWY._1688SDK.entity.OrderPreview +{ + [DataContract] + public class CreateOrderPreview + { + [DataMember] + public AddressParam addressParam { get; set; } + [DataMember] + public IList cargoParamList { get; set; } + [DataMember] + public string flow { get; set; } + } + [DataContract] + public class AddressParam + { + [DataMember] + public string fullName { get; set; } + [DataMember] + public string mobile { get; set; } + [DataMember] + public string phone { get; set; } + [DataMember] + public string postCode { get; set; } + [DataMember] + public string address { get; set; } + [DataMember] + public string provinceText { get; set; } + [DataMember] + public string cityText { get; set; } + [DataMember] + public string areaText { get; set; } + [DataMember] + public string townText { get; set; } + + } + [DataContract] + public class CargoParam + { + [DataMember] + public long offerId { get; set; } + [DataMember] + public string specId { get; set; } + [DataMember] + public int quantity { get; set; } + } +} diff --git a/BBWY.1688SDK/entity/ResponseStatus.cs b/BBWY.1688SDK/entity/ResponseStatus.cs new file mode 100644 index 00000000..139a9572 --- /dev/null +++ b/BBWY.1688SDK/entity/ResponseStatus.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + public class ResponseStatus + { + private String code; + + public String Code + { + get { return code; } + set { code = value; } + } + private String message; + + public String Message + { + get { return message; } + set { message = value; } + } + + + } +} diff --git a/BBWY.1688SDK/entity/ResponseWrapper.cs b/BBWY.1688SDK/entity/ResponseWrapper.cs new file mode 100644 index 00000000..2d9f868a --- /dev/null +++ b/BBWY.1688SDK/entity/ResponseWrapper.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace com.alibaba.openapi.client.entity +{ + public class ResponseWrapper + { + private String invokeStartTime; + + public String InvokeStartTime + { + get { return invokeStartTime; } + set { invokeStartTime = value; } + } + private long invokeCostTime; + + public long InvokeCostTime + { + get { return invokeCostTime; } + set { invokeCostTime = value; } + } + private ResponseStatus status; + + internal ResponseStatus Status + { + get { return status; } + set { status = value; } + } + private Object result; + + public Object Result + { + get { return result; } + set { result = value; } + } + } +} diff --git a/BBWY.1688SDK/example/ExampleFacade.cs b/BBWY.1688SDK/example/ExampleFacade.cs new file mode 100644 index 00000000..7cce8ab5 --- /dev/null +++ b/BBWY.1688SDK/example/ExampleFacade.cs @@ -0,0 +1,88 @@ +using com.alibaba.openapi.client; +using com.alibaba.openapi.client.entity; +using com.alibaba.openapi.client.policy; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using com.alibaba.china.openapi.client.example.param.apiexample; + +namespace com.alibaba.china.openapi.client.example +{ + + public class ExampleFacade + { + private ClientPolicy clientPolicy; + + public ExampleFacade(ClientPolicy clientPolicy) + { + this.clientPolicy = clientPolicy; + } + + private SyncAPIClient getAPIClient() + { + return new SyncAPIClient(clientPolicy); + } + + public AuthorizationToken getToken(string code) + { + + return getAPIClient().getToken(code); + + } + + public AuthorizationToken refreshToken(String refreshToken) + { + return getAPIClient().refreshToken(refreshToken); + } + + + + + public ExampleFamilyGetResult exampleFamilyGet(ExampleFamilyGetParam param) { + RequestPolicy reqPolicy = new RequestPolicy(); + reqPolicy.HttpMethod="POST"; + reqPolicy.NeedAuthorization=false; + reqPolicy.RequestSendTimestamp=false; + reqPolicy.UseHttps=false; + reqPolicy.UseSignture=false; + reqPolicy.AccessPrivateApi=false; + + Request request = new Request (); + APIId apiId = new APIId(); + apiId.Name = "example.family.get"; + apiId.NamespaceValue = "api.example"; + apiId.Version = 1; + request.ApiId = apiId; + + request.RequestEntity=param; + + return this.getAPIClient().send(request, reqPolicy); + } + + + + public ExampleFamilyPostResult exampleFamilyPost(ExampleFamilyPostParam param, string accessToken) { + RequestPolicy reqPolicy = new RequestPolicy(); + reqPolicy.HttpMethod="POST"; + reqPolicy.NeedAuthorization=false; + reqPolicy.RequestSendTimestamp=false; + reqPolicy.UseHttps=false; + reqPolicy.UseSignture=true; + reqPolicy.AccessPrivateApi=false; + + Request request = new Request (); + APIId apiId = new APIId(); + apiId.Name = "example.family.post"; + apiId.NamespaceValue = "api.example"; + apiId.Version = 1; + request.ApiId = apiId; + + request.RequestEntity=param; + request.AccessToken=accessToken; + return this.getAPIClient().send(request, reqPolicy); + } + } +} \ No newline at end of file diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs b/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs new file mode 100644 index 00000000..4b9fe3b4 --- /dev/null +++ b/BBWY.1688SDK/example/param/apiexample/ExampleCar.cs @@ -0,0 +1,160 @@ +using com.alibaba.openapi.client.primitive; +using com.alibaba.openapi.client.util; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; + + +namespace com.alibaba.china.openapi.client.example.param.apiexample +{ +[DataContract(Namespace = "com.alibaba.openapi.client")] +public class ExampleCar { + + [DataMember(Order = 1)] + private string builtDate; + + /** + * @return + */ + public DateTime? getBuiltDate() { + if (builtDate != null) + { + DateTime datetime = DateUtil.formatFromStr(builtDate); + return datetime; + } + return null; + } + + /** + * 设置 * + * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBuiltDate(DateTime builtDate) {
+     	         	    this.builtDate = DateUtil.format(builtDate);
+     	        }
+    
+        [DataMember(Order = 2)]
+    private string boughtDate;
+    
+        /**
+       * @return 
+    */
+        public DateTime? getBoughtDate() {
+                 if (boughtDate != null)
+          {
+              DateTime datetime = DateUtil.formatFromStr(boughtDate);
+              return datetime;
+          }
+    	  return null;
+    	    }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBoughtDate(DateTime boughtDate) {
+     	         	    this.boughtDate = DateUtil.format(boughtDate);
+     	        }
+    
+        [DataMember(Order = 3)]
+    private string name;
+    
+        /**
+       * @return 
+    */
+        public string getName() {
+               	return name;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setName(string name) {
+     	         	    this.name = name;
+     	        }
+    
+        [DataMember(Order = 4)]
+    private string builtArea;
+    
+        /**
+       * @return 
+    */
+        public string getBuiltArea() {
+               	return builtArea;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBuiltArea(string builtArea) {
+     	         	    this.builtArea = builtArea;
+     	        }
+    
+        [DataMember(Order = 5)]
+    private string carNumber;
+    
+        /**
+       * @return 
+    */
+        public string getCarNumber() {
+               	return carNumber;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setCarNumber(string carNumber) {
+     	         	    this.carNumber = carNumber;
+     	        }
+    
+        [DataMember(Order = 6)]
+    private double? price;
+    
+        /**
+       * @return 
+    */
+        public double? getPrice() {
+               	return price;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setPrice(double price) {
+     	         	    this.price = price;
+     	        }
+    
+        [DataMember(Order = 7)]
+    private int? seats;
+    
+        /**
+       * @return 
+    */
+        public int? getSeats() {
+               	return seats;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setSeats(int seats) {
+     	         	    this.seats = seats;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs
new file mode 100644
index 00000000..51580a39
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamily.cs
@@ -0,0 +1,144 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+    [DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamily
+    {
+
+        [DataMember(Order = 1)]
+        private int? familyNumber;
+
+        /**
+       * @return 家庭编号
+    */
+        public int? getFamilyNumber()
+        {
+            return familyNumber;
+        }
+
+        /**
+         * 设置家庭编号     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setFamilyNumber(int familyNumber)
+        {
+            this.familyNumber = familyNumber;
+        }
+
+        [DataMember(Order = 2)]
+        private ExamplePerson father;
+
+        /**
+       * @return 父亲对象,可以为空
+    */
+        public ExamplePerson getFather()
+        {
+            return father;
+        }
+
+        /**
+         * 设置父亲对象,可以为空     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setFather(ExamplePerson father)
+        {
+            this.father = father;
+        }
+
+        [DataMember(Order = 3)]
+        private ExamplePerson mother;
+
+        /**
+       * @return 母亲对象,可以为空
+    */
+        public ExamplePerson getMother()
+        {
+            return mother;
+        }
+
+        /**
+         * 设置母亲对象,可以为空     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setMother(ExamplePerson mother)
+        {
+            this.mother = mother;
+        }
+
+        [DataMember(Order = 4)]
+        private ExamplePerson[] children;
+
+        /**
+       * @return 孩子列表
+    */
+        public ExamplePerson[] getChildren()
+        {
+            return children;
+        }
+
+        /**
+         * 设置孩子列表     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setChildren(ExamplePerson[] children)
+        {
+            this.children = children;
+        }
+
+        [DataMember(Order = 5)]
+        private ExampleCar[] ownedCars;
+
+        /**
+       * @return 拥有的汽车信息
+    */
+        public ExampleCar[] getOwnedCars()
+        {
+            return ownedCars;
+        }
+
+        /**
+         * 设置拥有的汽车信息     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setOwnedCars(ExampleCar[] ownedCars)
+        {
+            this.ownedCars = ownedCars;
+        }
+
+        [DataMember(Order = 6)]
+        private ExampleHouse myHouse;
+
+        /**
+       * @return 所住的房屋信息
+    */
+        public ExampleHouse getMyHouse()
+        {
+            return myHouse;
+        }
+
+        /**
+         * 设置所住的房屋信息     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setMyHouse(ExampleHouse myHouse)
+        {
+            this.myHouse = myHouse;
+        }
+
+
+    }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs
new file mode 100644
index 00000000..f2318237
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetParam.cs
@@ -0,0 +1,41 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using com.alibaba.openapi.client;
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyGetParam : GatewayAPIRequest
+    {
+    public ExampleFamilyGetParam()
+    {
+        this.ApiId = new APIId("api.example", "example.family.get",1);
+    }
+
+    [DataMember(Order = 1)]
+    private int? familyNumber;
+    
+    /**
+       * @return 可接受参数1或者2,其余参数无法找到family对象
+    */
+    public int? getFamilyNumber() {
+        return familyNumber;
+    }
+    
+    /**
+     * 设置可接受参数1或者2,其余参数无法找到family对象     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setFamilyNumber(int familyNumber) {
+     	 this.familyNumber = familyNumber;
+    }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs
new file mode 100644
index 00000000..36d53bab
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyGetResult.cs
@@ -0,0 +1,37 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using com.alibaba.openapi.client;
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyGetResult : GatewayAPIResponse
+    {
+
+       [DataMember(Order = 1)]
+    private ExampleFamily result;
+    
+        /**
+       * @return 
+    */
+        public ExampleFamily getResult() {
+               	return result;
+            }
+    
+    /**
+     * 设置     *
+          
+             * 此参数必填
+          */
+    public void setResult(ExampleFamily result) {
+     	         	    this.result = result;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs
new file mode 100644
index 00000000..087c88a8
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostParam.cs
@@ -0,0 +1,81 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+    [DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyPostParam
+    {
+
+        [DataMember(Order = 1)]
+        private ExampleFamily family;
+
+        /**
+       * @return 上传Family对象信息
+    */
+        public ExampleFamily getFamily()
+        {
+            return family;
+        }
+
+        /**
+         * 设置上传Family对象信息     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setFamily(ExampleFamily family)
+        {
+            this.family = family;
+        }
+
+        [DataMember(Order = 2)]
+        private string comments;
+
+        /**
+       * @return 备注信息
+    */
+        public string getComments()
+        {
+            return comments;
+        }
+
+        /**
+         * 设置备注信息     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setComments(string comments)
+        {
+            this.comments = comments;
+        }
+
+        [DataMember(Order = 3)]
+        private byte[] houseImg;
+
+        /**
+       * @return 房屋信息
+    */
+        public byte[] getHouseImg()
+        {
+            return houseImg;
+        }
+
+        /**
+         * 设置房屋信息     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setHouseImg(byte[] houseImg)
+        {
+            this.houseImg = houseImg;
+        }
+
+
+    }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs
new file mode 100644
index 00000000..7ef81163
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleFamilyPostResult.cs
@@ -0,0 +1,56 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleFamilyPostResult
+    {
+
+       [DataMember(Order = 1)]
+    private ExampleFamily result;
+    
+        /**
+       * @return 返回的接听信息
+    */
+        public ExampleFamily getResult() {
+               	return result;
+            }
+    
+    /**
+     * 设置返回的接听信息     *
+          
+             * 此参数必填
+          */
+    public void setResult(ExampleFamily result) {
+     	         	    this.result = result;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private string resultDesc;
+    
+        /**
+       * @return 返回结果描述
+    */
+        public string getResultDesc() {
+               	return resultDesc;
+            }
+    
+    /**
+     * 设置返回结果描述     *
+          
+             * 此参数必填
+          */
+    public void setResultDesc(string resultDesc) {
+     	         	    this.resultDesc = resultDesc;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs b/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs
new file mode 100644
index 00000000..728a04de
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExampleHouse.cs
@@ -0,0 +1,102 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+    [DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExampleHouse
+    {
+
+        [DataMember(Order = 1)]
+        private string location;
+
+        /**
+       * @return 
+    */
+        public string getLocation()
+        {
+            return location;
+        }
+
+        /**
+         * 设置     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setLocation(string location)
+        {
+            this.location = location;
+        }
+
+        [DataMember(Order = 2)]
+        private int? areaSize;
+
+        /**
+       * @return 
+    */
+        public int? getAreaSize()
+        {
+            return areaSize;
+        }
+
+        /**
+         * 设置     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setAreaSize(int areaSize)
+        {
+            this.areaSize = areaSize;
+        }
+
+        [DataMember(Order = 3)]
+        private bool? rent;
+
+        /**
+       * @return 
+    */
+        public bool? getRent()
+        {
+            return rent;
+        }
+
+        /**
+         * 设置     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setRent(bool rent)
+        {
+            this.rent = rent;
+        }
+
+        [DataMember(Order = 4)]
+        private int? rooms;
+
+        /**
+       * @return 
+    */
+        public int? getRooms()
+        {
+            return rooms;
+        }
+
+        /**
+         * 设置     *
+         * 参数示例:
     
+                 * 此参数必填
+              */
+        public void setRooms(int rooms)
+        {
+            this.rooms = rooms;
+        }
+
+
+    }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs b/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs
new file mode 100644
index 00000000..636baff1
--- /dev/null
+++ b/BBWY.1688SDK/example/param/apiexample/ExamplePerson.cs
@@ -0,0 +1,99 @@
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+
+
+namespace com.alibaba.china.openapi.client.example.param.apiexample
+{
+[DataContract(Namespace = "com.alibaba.openapi.client")]
+    public class ExamplePerson
+    {
+
+       [DataMember(Order = 1)]
+    private string name;
+    
+        /**
+       * @return 
+    */
+        public string getName() {
+               	return name;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setName(string name) {
+     	         	    this.name = name;
+     	        }
+    
+        [DataMember(Order = 2)]
+    private int? age;
+    
+        /**
+       * @return 
+    */
+        public int? getAge() {
+               	return age;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setAge(int age) {
+     	         	    this.age = age;
+     	        }
+    
+        [DataMember(Order = 3)]
+    private string birthday;
+    
+        /**
+       * @return 
+    */
+        public DateTime? getBirthday() {
+                 if (birthday != null)
+          {
+              DateTime datetime = DateUtil.formatFromStr(birthday);
+              return datetime;
+          }
+    	  return null;
+    	    }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setBirthday(DateTime birthday) {
+     	         	    this.birthday = DateUtil.format(birthday);
+     	        }
+    
+        [DataMember(Order = 4)]
+    private string mobileNumber;
+    
+        /**
+       * @return 
+    */
+        public string getMobileNumber() {
+               	return mobileNumber;
+            }
+    
+    /**
+     * 设置     *
+     * 参数示例:
     
+             * 此参数必填
+          */
+    public void setMobileNumber(string mobileNumber) {
+     	         	    this.mobileNumber = mobileNumber;
+     	        }
+    
+    
+  }
+}
\ No newline at end of file
diff --git a/BBWY.1688SDK/exception/OceanException.cs b/BBWY.1688SDK/exception/OceanException.cs
new file mode 100644
index 00000000..fcf0d9a3
--- /dev/null
+++ b/BBWY.1688SDK/exception/OceanException.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.exception
+{
+    public class OceanException : Exception
+    {
+        public OceanException(string mess)
+            : base(mess)
+        {
+            
+        }
+         public OceanException()
+        {
+
+        }
+        private string error_code;
+
+        private string error_message;
+
+        private string exception;
+
+        public string getError_code()
+        {
+            return this.error_code;
+        }
+
+        public void setError_code(string error_code)
+        {
+            this.error_code = error_code;
+        }
+
+        public string getError_message()
+        {
+            return this.error_message;
+        }
+
+        public void setError_message(string error_message)
+        {
+            this.error_message = error_message;
+        }
+
+        public string getException()
+        {
+            return this.exception;
+        }
+
+        public void setException(String exception)
+        {
+            this.exception = exception;
+        }
+
+    }
+}
diff --git a/BBWY.1688SDK/http/HttpClient.cs b/BBWY.1688SDK/http/HttpClient.cs
new file mode 100644
index 00000000..658f6994
--- /dev/null
+++ b/BBWY.1688SDK/http/HttpClient.cs
@@ -0,0 +1,243 @@
+using BBWY.Common.Http;
+using com.alibaba.openapi.client.entity;
+using com.alibaba.openapi.client.policy;
+using com.alibaba.openapi.client.serialize;
+using com.alibaba.openapi.client.util;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Web;
+
+namespace com.alibaba.openapi.client.http
+{
+    public class HttpClient
+    {
+        private ClientPolicy clientPolicy;
+        private RestApiService restApiService;
+        private IDictionary requestHeader;
+
+        public HttpClient(ClientPolicy clientPolicy)
+        {
+            this.clientPolicy = clientPolicy;
+        }
+
+        public HttpClient(ClientPolicy clientPolicy, RestApiService restApiService)
+        {
+            this.clientPolicy = clientPolicy;
+            this.restApiService = restApiService;
+            this.requestHeader = new Dictionary()
+            {
+                { "User-Agent","Ocean/NET-SDKClient"}
+            };
+        }
+
+        public JObject NewRequest(Request request, RequestPolicy requestPolicy)
+        {
+            StringBuilder path = createProtocolRequestPath(requestPolicy, request);
+            Dictionary parameters = createParameterDictionary(requestPolicy, request);
+            signature(path.ToString(), parameters, requestPolicy, clientPolicy);
+            string paramString = createParameterStr(parameters);
+            Uri uri = new Uri(buildRequestUri(requestPolicy, request));
+
+            var result = restApiService.SendRequest($"{uri.Scheme}://{uri.Host}",
+                                                    uri.LocalPath,
+                                                    paramString,
+                                                    requestHeader,
+                                                    requestPolicy.HttpMethod.Equals("GET") ? HttpMethod.Get : HttpMethod.Post,
+                                                    RestApiService.ContentType_Form);
+            if (result.StatusCode != HttpStatusCode.OK)
+                throw new Exception(result.Content.ToString());
+            return JObject.Parse(result.Content);
+        }
+
+        public T request(Request request, RequestPolicy requestPolicy)
+        {
+            StringBuilder path = createProtocolRequestPath(requestPolicy, request);
+            Dictionary parameters = createParameterDictionary(requestPolicy, request);
+            StringBuilder queryBuilder = new StringBuilder();
+            signature(path.ToString(), parameters, requestPolicy, clientPolicy);
+            if ("GET".Equals(requestPolicy.HttpMethod))
+            {
+
+                String queryString = createParameterStr(parameters);
+                String uriStr = buildRequestUri(requestPolicy, request);
+                uriStr = uriStr + "?" + queryString;
+                Uri uri = new Uri(uriStr);
+                HttpWebRequest httpWebRequest = WebRequest.Create(uri) as HttpWebRequest;
+
+                httpWebRequest.Method = "GET";
+                httpWebRequest.KeepAlive = false;
+                httpWebRequest.AllowAutoRedirect = true;
+                httpWebRequest.ContentType = "application/x-www-form-urlencoded";
+                httpWebRequest.UserAgent = "Ocean/NET-SDKClient";
+
+                HttpWebResponse response = httpWebRequest.GetResponse() as HttpWebResponse;
+                Stream responseStream = response.GetResponseStream();
+
+                DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                ResponseWrapper rw = deSerializer.deSerialize(responseStream, typeof(T), Encoding.UTF8.EncodingName);
+                return (T)rw.Result;
+            }
+            else
+            {
+                String postString = createParameterStr(parameters);
+                byte[] postData = Encoding.UTF8.GetBytes(postString);
+                String uriStr = buildRequestUri(requestPolicy, request);
+                Uri uri = new Uri(uriStr);
+                HttpWebRequest httpWebRequest = WebRequest.Create(uri) as HttpWebRequest;
+
+                httpWebRequest.Method = "POST";
+                httpWebRequest.KeepAlive = false;
+                httpWebRequest.AllowAutoRedirect = true;
+                httpWebRequest.ContentType = "application/x-www-form-urlencoded";
+                httpWebRequest.UserAgent = "Ocean/NET-SDKClient";
+                httpWebRequest.ContentLength = postData.Length;
+
+                System.IO.Stream outputStream = httpWebRequest.GetRequestStream();
+                outputStream.Write(postData, 0, postData.Length);
+                outputStream.Close();
+                try
+                {
+                    HttpWebResponse response = httpWebRequest.GetResponse() as HttpWebResponse;
+                    Stream responseStream = response.GetResponseStream();
+
+
+                    DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                    ResponseWrapper rw = deSerializer.deSerialize(responseStream, typeof(T), Encoding.UTF8.EncodingName);
+                    return (T)rw.Result;
+                }
+                catch (System.Net.WebException webException)
+                {
+                    HttpWebResponse response = webException.Response as HttpWebResponse;
+                    Stream responseStream = response.GetResponseStream();
+                    DeSerializer deSerializer = SerializerProvider.getInstance().getDeSerializer(requestPolicy.ResponseProtocol);
+                    Exception rw = deSerializer.buildException(responseStream, 500, Encoding.UTF8.EncodingName);
+                    throw rw;
+                }
+            }
+        }
+
+        private String buildRequestUri(RequestPolicy requestPolicy, Request request)
+        {
+            String schema = "http";
+            int port = clientPolicy.HttpPort;
+            if (requestPolicy.UseHttps)
+            {
+                schema = "https";
+                port = clientPolicy.HttpsPort;
+            }
+            StringBuilder relativeBuilder = new StringBuilder(schema);
+            relativeBuilder.Append("://");
+            relativeBuilder.Append(clientPolicy.ServerHost);
+            if (port != 80 && port != 443)
+            {
+                relativeBuilder.Append(":");
+                relativeBuilder.Append(port);
+            }
+
+            if (requestPolicy.AccessPrivateApi)
+            {
+                relativeBuilder.Append("/api");
+            }
+            else
+            {
+                relativeBuilder.Append("/openapi");
+            }
+
+            relativeBuilder.Append("/");
+            relativeBuilder.Append(createProtocolRequestPath(requestPolicy, request));
+            return relativeBuilder.ToString();
+        }
+
+        private StringBuilder createProtocolRequestPath(RequestPolicy requestPolicy, Request request)
+        {
+
+            StringBuilder relativeBuilder = new StringBuilder();
+
+            relativeBuilder.Append(requestPolicy.RequestProtocol);
+            relativeBuilder.Append("/").Append(request.ApiId.Version);
+            relativeBuilder.Append("/").Append(request.ApiId.NamespaceValue);
+            relativeBuilder.Append("/").Append(request.ApiId.Name);
+            relativeBuilder.Append("/").Append(clientPolicy.AppKey);
+            return relativeBuilder;
+
+        }
+
+        private String createParameterStr(Dictionary parameters)
+        {
+            StringBuilder paramBuilder = new StringBuilder();
+            foreach (KeyValuePair kvp in parameters)
+            {
+                String encodedValue = null;
+                if (kvp.Value != null)
+                {
+                    String tempValue = kvp.Value.ToString();
+                    byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(tempValue);
+                    encodedValue = HttpUtility.UrlEncode(byteArray, 0, byteArray.Length);
+                }
+                paramBuilder.Append(kvp.Key).Append("=").Append(encodedValue);
+                paramBuilder.Append("&");
+            }
+            return paramBuilder.ToString();
+        }
+
+        private Dictionary createParameterDictionary(RequestPolicy requestPolicy, Request request)
+        {
+
+            Serializer serializer = SerializerProvider.getInstance().getSerializer(requestPolicy.RequestProtocol);
+
+            Dictionary parameters = serializer.serialize(request.RequestEntity);
+            if (!requestPolicy.RequestProtocol.Equals(requestPolicy.ResponseProtocol))
+            {
+                parameters.Add("_aop_responseFormat", requestPolicy.ResponseProtocol);
+            }
+            if (requestPolicy.RequestSendTimestamp)
+            {
+                parameters.Add("_aop_timestamp", DateUtil.currentTimeMillis());
+            }
+            parameters.Add("_aop_datePattern", DateUtil.getDatePattern());
+            foreach (KeyValuePair kvp in request.AddtionalParams)
+            {
+                parameters.Add(kvp.Key, kvp.Value);
+            }
+            if (request.AccessToken != null)
+            {
+                parameters.Add("access_token", request.AccessToken);
+            }
+            return parameters;
+        }
+
+        private void signature(String path, Dictionary parameters, RequestPolicy requestPolicy, ClientPolicy clientPolicy)
+        {
+            if (!requestPolicy.UseSignture)
+            {
+                return;
+            }
+            if (clientPolicy.AppKey == null
+                    || clientPolicy.SecretKey == null)
+            {
+                return;
+            }
+            byte[] sign = SignatureUtil.hmacSha1(path, parameters, clientPolicy.SecretKey);
+            String signStr = SignatureUtil.toHex(sign);
+            if (signStr != null)
+            {
+                parameters.Add("_aop_signature", signStr);
+            }
+        }
+
+
+        private WebClient createWebClient()
+        {
+
+            WebClient client = new WebClient();
+            client.Headers.Add("user-agent", "Ocean/SDK Client");
+
+            return client;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/policy/ClientPolicy.cs b/BBWY.1688SDK/policy/ClientPolicy.cs
new file mode 100644
index 00000000..15a98f55
--- /dev/null
+++ b/BBWY.1688SDK/policy/ClientPolicy.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class ClientPolicy
+    {
+        private string serverHost = "gw.open.1688.com";
+
+        public string ServerHost
+        {
+            get { return serverHost; }
+            set { serverHost = value; }
+        }
+        private int httpPort = 80;
+
+        public int HttpPort
+        {
+            get { return httpPort; }
+            set { httpPort = value; }
+        }
+        private int httpsPort = 443;
+
+        public int HttpsPort
+        {
+            get { return httpsPort; }
+            set { httpsPort = value; }
+        }
+        private string appKey;
+
+        public string AppKey
+        {
+            get { return appKey; }
+            set { appKey = value; }
+        }
+        private string secretKey;
+
+        public string SecretKey
+        {
+            get { return secretKey; }
+            set { secretKey = value; }
+        }
+        private int defaultTimeout = 5000;
+
+        public int DefaultTimeout
+        {
+            get { return defaultTimeout; }
+            set { defaultTimeout = value; }
+        }
+        private string defaultContentCharset = "UTF-8";
+
+        public string DefaultContentCharset
+        {
+            get { return defaultContentCharset; }
+            set { defaultContentCharset = value; }
+        }
+        private bool defaultUseHttps = true;
+
+        public bool DefaultUseHttps
+        {
+            get { return defaultUseHttps; }
+            set { defaultUseHttps = value; }
+        }
+
+
+    }
+}
diff --git a/BBWY.1688SDK/policy/GrantType.cs b/BBWY.1688SDK/policy/GrantType.cs
new file mode 100644
index 00000000..4f4e0397
--- /dev/null
+++ b/BBWY.1688SDK/policy/GrantType.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class GrantType
+    {
+       public  const string  refresh_token="refresh_token";
+        /**
+         * 请求参数通过json串的方式传递,默认格式_data_={"key":"value"}
+         */
+       public  const string get_token = "get_token";
+    }
+}
diff --git a/BBWY.1688SDK/policy/Protocol.cs b/BBWY.1688SDK/policy/Protocol.cs
new file mode 100644
index 00000000..3b7a5a4c
--- /dev/null
+++ b/BBWY.1688SDK/policy/Protocol.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class Protocol
+    {
+        public  const string param2 = "param2";
+        /**
+         * 请求参数通过json串的方式传递,默认格式_data_={"key":"value"}
+         */
+        public  const string json2 = "json2";
+        /**
+         * 
+         * 请求参数通过xml的方式传递,默认格式_data_=<test>data</test>
+         */
+        public  const string xml2 = "xml2";
+        public  const string param = "param";
+        public  const string json = "json";
+        public  const string xml = "xml";
+        public  const string http = "http";
+    }
+}
diff --git a/BBWY.1688SDK/policy/RequestPolicy.cs b/BBWY.1688SDK/policy/RequestPolicy.cs
new file mode 100644
index 00000000..762226e7
--- /dev/null
+++ b/BBWY.1688SDK/policy/RequestPolicy.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.policy
+{
+    public class RequestPolicy
+    {
+        private bool requestSendTimestamp = false;
+
+        public bool RequestSendTimestamp
+        {
+            get { return requestSendTimestamp; }
+            set { requestSendTimestamp = value; }
+        }
+        private bool useHttps = false;
+
+        public bool UseHttps
+        {
+            get { return useHttps; }
+            set { useHttps = value; }
+        }
+        private string requestProtocol = Protocol.param2;
+
+        internal string RequestProtocol
+        {
+            get { return requestProtocol; }
+            set { requestProtocol = value; }
+        }
+        private string responseProtocol = Protocol.json2;
+
+        internal string ResponseProtocol
+        {
+            get { return responseProtocol; }
+            set { responseProtocol = value; }
+        }
+        private bool responseCompress = true;
+
+        public bool ResponseCompress
+        {
+            get { return responseCompress; }
+            set { responseCompress = value; }
+        }
+        private int requestCompressThreshold = -1;
+
+        public int RequestCompressThreshold
+        {
+            get { return requestCompressThreshold; }
+            set { requestCompressThreshold = value; }
+        }
+        private int timeout = 5000;
+
+        public int Timeout
+        {
+            get { return timeout; }
+            set { timeout = value; }
+        }
+        private string httpMethod = "POST";
+
+        public string HttpMethod
+        {
+            get { return httpMethod; }
+            set { httpMethod = value; }
+        }
+        private String queryStringCharset = "GB18030";
+
+        public String QueryStringCharset
+        {
+            get { return queryStringCharset; }
+            set { queryStringCharset = value; }
+        }
+        private String contentCharset = "UTF-8";
+
+        public String ContentCharset
+        {
+            get { return contentCharset; }
+            set { contentCharset = value; }
+        }
+        private bool useSignture = true;
+
+        public bool UseSignture
+        {
+            get { return useSignture; }
+            set { useSignture = value; }
+        }
+        private bool needAuthorization = false;
+
+        public bool NeedAuthorization
+        {
+            get { return needAuthorization; }
+            set { needAuthorization = value; }
+        }
+        private bool accessPrivateApi = false;
+
+        public bool AccessPrivateApi
+        {
+            get { return accessPrivateApi; }
+            set { accessPrivateApi = value; }
+        }
+        private int defaultApiVersion = 1;
+
+        public int DefaultApiVersion
+        {
+            get { return defaultApiVersion; }
+            set { defaultApiVersion = value; }
+        }
+
+
+
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableBool.cs b/BBWY.1688SDK/primitive/NullableBool.cs
new file mode 100644
index 00000000..63caafdb
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableBool.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableBool : NullablePrimitiveObject
+    {
+        public NullableBool(bool value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        bool value;
+        private Boolean isNull = true;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(bool value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public bool getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableByte.cs b/BBWY.1688SDK/primitive/NullableByte.cs
new file mode 100644
index 00000000..4d73775d
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableByte.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableByte : NullablePrimitiveObject
+    {
+        public NullableByte(byte value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        byte value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(byte value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public byte getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableChar.cs b/BBWY.1688SDK/primitive/NullableChar.cs
new file mode 100644
index 00000000..f7375045
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableChar.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableChar : NullablePrimitiveObject
+    {
+        public NullableChar(char value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        char value;
+        private Boolean isNull = true;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(char value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public char getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableDateTime.cs b/BBWY.1688SDK/primitive/NullableDateTime.cs
new file mode 100644
index 00000000..1b621c05
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableDateTime.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableDateTime : NullablePrimitiveObject
+    {
+        public NullableDateTime(DateTime value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        DateTime value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(DateTime value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public DateTime getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableDouble.cs b/BBWY.1688SDK/primitive/NullableDouble.cs
new file mode 100644
index 00000000..2bd5c3cf
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableDouble.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableDouble : NullablePrimitiveObject
+    {
+        public NullableDouble(double value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        double value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(double value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public double getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableFloat.cs b/BBWY.1688SDK/primitive/NullableFloat.cs
new file mode 100644
index 00000000..8a294cf3
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableFloat.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableFloat : NullablePrimitiveObject
+    {
+        public NullableFloat(float value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        float value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(float value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public float getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableInt.cs b/BBWY.1688SDK/primitive/NullableInt.cs
new file mode 100644
index 00000000..a9fd6def
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableInt.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableInt : NullablePrimitiveObject
+    {
+        public NullableInt(int value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        int value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(int value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public int getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullableLong.cs b/BBWY.1688SDK/primitive/NullableLong.cs
new file mode 100644
index 00000000..1dfd55ac
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullableLong.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullableLong : NullablePrimitiveObject
+    {
+        public NullableLong(long value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        long value;
+        private Boolean isNull;
+
+        public Boolean IsNull
+        {
+            get { return isNull; }
+        }
+
+        public void setValue(long value)
+        {
+            this.value = value;
+            this.isNull = false;
+        }
+
+        public long getValue()
+        {
+            return this.value;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs b/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs
new file mode 100644
index 00000000..e9a4ef41
--- /dev/null
+++ b/BBWY.1688SDK/primitive/NullablePrimitiveObject.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.primitive
+{
+    public class NullablePrimitiveObject
+    {
+    }
+}
diff --git a/BBWY.1688SDK/serialize/DeSerializer.cs b/BBWY.1688SDK/serialize/DeSerializer.cs
new file mode 100644
index 00000000..332ed39f
--- /dev/null
+++ b/BBWY.1688SDK/serialize/DeSerializer.cs
@@ -0,0 +1,21 @@
+using com.alibaba.openapi.client.entity;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public interface DeSerializer
+    {
+        //返回该反序列化接口支持的数据协议.
+         String supportedContentType();
+
+         ResponseWrapper deSerialize(Stream istream, Type resultType, String charSet);
+
+         Exception buildException(Stream inputStream, int statusCode, String charSet);
+
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Json2Deserializer.cs b/BBWY.1688SDK/serialize/Json2Deserializer.cs
new file mode 100644
index 00000000..2b12b423
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Json2Deserializer.cs
@@ -0,0 +1,56 @@
+using com.alibaba.openapi.client.entity;
+using com.alibaba.openapi.client.exception;
+using com.alibaba.openapi.client.policy;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class Json2Deserializer : DeSerializer
+    {
+        //返回该反序列化接口支持的数据协议.
+        public String supportedContentType()
+        {
+            return Protocol.json2;
+        }
+
+        public ResponseWrapper deSerialize(Stream istream, Type resultType, String charSet)
+        {
+            StreamReader sr = new StreamReader(istream, Encoding.UTF8);
+            string strhtml = sr.ReadToEnd();
+            using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(strhtml)))
+            {
+                DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(resultType);
+                object result = jsonSerializer.ReadObject(ms);
+                ResponseWrapper responseWrapper = new ResponseWrapper();
+                responseWrapper.Result = result;
+
+                return responseWrapper;
+            }
+        }
+
+        public Exception buildException(Stream istream, int statusCode, String charSet)
+        {
+
+
+            //istream.Position = 0;
+            DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ErrorExceptionDesc));
+            object resultObj = jsonSerializer.ReadObject(istream);
+            ErrorExceptionDesc result = (ErrorExceptionDesc)resultObj;
+            String errorCodeStr = result.getError_code();
+            String errorMesage = result.getError_message();
+
+            OceanException oceanException = new OceanException(errorMesage);
+            oceanException.setError_code(errorCodeStr);
+            oceanException.setError_message(errorMesage);
+            return oceanException;
+
+
+        }
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Param2RequestSerializer.cs b/BBWY.1688SDK/serialize/Param2RequestSerializer.cs
new file mode 100644
index 00000000..29093c7d
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Param2RequestSerializer.cs
@@ -0,0 +1,137 @@
+using com.alibaba.openapi.client.policy;
+using com.alibaba.openapi.client.primitive;
+using com.alibaba.openapi.client.util;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization.Json;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class Param2RequestSerializer : Serializer
+    {
+        public String supportedContentType()
+        {
+            return Protocol.param2;
+        }
+
+        public Dictionary serialize(Object serializer)
+        {
+            //Dictionary result = serializeNest(serializer);
+            //return result;
+            return serializeParam(serializer);
+        }
+
+        private Dictionary serializeNest(Object serializer)
+        {
+            Dictionary result = new Dictionary();
+            if (serializer == null)
+            {
+                return result;
+            }
+            Type type = serializer.GetType();
+
+            IEnumerable fis = type.GetRuntimeFields();
+            TextInfo tInfo = Thread.CurrentThread.CurrentCulture.TextInfo;
+
+            foreach (FieldInfo fi in fis)
+            {
+                Type fieldType = fi.FieldType;
+
+                String piName = fi.Name;
+                String firstCharacter = piName.Substring(0, 1);
+                String upperFirstCharacter = firstCharacter.ToUpper(Thread.CurrentThread.CurrentCulture);
+                String tempName = upperFirstCharacter + piName.Substring(1);
+                if (!"ApiId".Equals(tempName))
+                {
+                    MethodInfo mi = type.GetMethod("get" + tempName);
+                    object value = mi.Invoke(serializer, null);
+                    if (value != null)
+                    {
+                        object trueValue = null;
+                        if (fieldType.IsAssignableFrom(typeof(bool?))
+                            || fieldType.IsAssignableFrom(typeof(byte?))
+                            || fieldType.IsAssignableFrom(typeof(char?))
+                            || fieldType.IsAssignableFrom(typeof(double?))
+                            || fieldType.IsAssignableFrom(typeof(float?))
+                            || fieldType.IsAssignableFrom(typeof(int?))
+                            || fieldType.IsAssignableFrom(typeof(long?)))
+                        {
+                            trueValue = value;
+                        }
+                        else if (fieldType.IsAssignableFrom(typeof(String)))
+                        {
+                            if (value.GetType().IsAssignableFrom(typeof(DateTime)))
+                            {
+                                DateTime dateTime = (DateTime)value;
+                                trueValue = DateUtil.formatForOcean(dateTime);
+                            }
+                            else
+                            {
+                                trueValue = value;
+                            }
+                        }
+                        else if (fieldType.IsAssignableFrom(typeof(DateTime?)))
+                        {
+                            DateTime dateTime = (DateTime)value;
+                            trueValue = DateUtil.format(dateTime);
+                        }
+                        else if (fieldType.IsAssignableFrom(typeof(Byte[])) || fieldType.IsAssignableFrom(typeof(byte[])))
+                        {
+                            trueValue = Convert.ToBase64String((byte[])value);
+                        }
+                        else
+                        {
+                            DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(fieldType);
+                            MemoryStream stream = new MemoryStream();
+                            dataContractJsonSerializer.WriteObject(stream, value);
+                            byte[] dataBytes = new byte[stream.Length];
+                            stream.Position = 0;
+                            stream.Read(dataBytes, 0, (int)stream.Length);
+
+                            string dataString = Encoding.UTF8.GetString(dataBytes);
+                            trueValue = dataString;
+                        }
+                        result.Add(piName, trueValue);
+                    }
+
+                }
+            }
+            return result;
+        }
+
+        private Dictionary serializeParam(object param)
+        {
+            Dictionary result = new Dictionary();
+            Type type = param.GetType();
+            var properties = type.GetProperties();
+            foreach (var property in properties)
+            {
+                var value = property.GetValue(param);
+                var valueType = value.GetType();
+                if (valueType.IsAssignableFrom(typeof(string)) ||
+                    valueType.IsAssignableFrom(typeof(bool?)) ||
+                    valueType.IsAssignableFrom(typeof(byte?)) ||
+                    valueType.IsAssignableFrom(typeof(char?)) ||
+                    valueType.IsAssignableFrom(typeof(double?)) ||
+                    valueType.IsAssignableFrom(typeof(float?)) ||
+                    valueType.IsAssignableFrom(typeof(int?)) ||
+                    valueType.IsAssignableFrom(typeof(long?)))
+                    result.Add(property.Name, value);
+                else
+                {
+                    result.Add(property.Name, JsonConvert.SerializeObject(value));
+                }
+            }
+            return result;
+        }
+
+    }
+}
diff --git a/BBWY.1688SDK/serialize/Serializer.cs b/BBWY.1688SDK/serialize/Serializer.cs
new file mode 100644
index 00000000..7dfba74c
--- /dev/null
+++ b/BBWY.1688SDK/serialize/Serializer.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public interface Serializer
+    {
+
+        //返回该反序列化接口支持的数据协议.
+         String supportedContentType();
+
+        //序列化方法
+         Dictionary serialize(Object serializer);
+    }
+}
diff --git a/BBWY.1688SDK/serialize/SerializerProvider.cs b/BBWY.1688SDK/serialize/SerializerProvider.cs
new file mode 100644
index 00000000..86249f53
--- /dev/null
+++ b/BBWY.1688SDK/serialize/SerializerProvider.cs
@@ -0,0 +1,60 @@
+using com.alibaba.openapi.client.policy;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.serialize
+{
+    public class SerializerProvider
+    {
+        private static SerializerProvider instance;
+        private static Object lockObject=new Object();
+        public static SerializerProvider getInstance()
+        {
+            if (instance == null)
+            {
+                lock (lockObject)
+                {
+                    if (instance == null)
+                    {
+                        instance = new SerializerProvider();
+                        instance.initial();
+                    }
+                }
+            }
+            return instance;
+        }
+
+        private SerializerProvider()
+        {
+
+        }
+
+        private void initial()
+        {
+            serializerStore.Add(Protocol.param2, new Param2RequestSerializer());
+            deSerializerStore.Add(Protocol.param2, new Json2Deserializer());
+            deSerializerStore.Add(Protocol.json2, new Json2Deserializer());
+        }
+    
+        private  Dictionary serializerStore = new Dictionary();
+
+        public  Serializer getSerializer(String contentType)
+        {
+            return serializerStore[contentType];
+        }
+
+        private  Dictionary deSerializerStore = new Dictionary();
+
+        public  DeSerializer getDeSerializer(String contentType)
+        {
+            return deSerializerStore[contentType];
+        }
+
+        
+
+
+    }
+}
diff --git a/BBWY.1688SDK/util/DateUtil.cs b/BBWY.1688SDK/util/DateUtil.cs
new file mode 100644
index 00000000..242fd011
--- /dev/null
+++ b/BBWY.1688SDK/util/DateUtil.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.util
+{
+    public class DateUtil
+    {
+        //这里定义两个日期格式,由于.Net平台的毫秒格式用fff表示,Ocean平台(Java)的毫秒格式用SSS表示。
+        private static string Date_Pattern = "yyyyMMddHHmmssfff";
+     
+        private static string Date_PatternForOcean = "yyyyMMddHHmmssSSS";
+
+
+        public static String getDatePattern()
+        {
+            return Date_PatternForOcean;
+        }
+
+        public static String format(DateTime date)
+        {
+            return date.ToString(Date_Pattern);
+        }
+
+        public static String formatForOcean(DateTime date)
+        {
+            String value = date.ToString("yyyyMMddHHmmssfffzzz");
+            String newValue = value.Replace(":", "");
+            return newValue;
+        }
+
+        public static DateTime formatFromStr(String dateDesc)
+        {
+            if (dateDesc.Contains("+") || dateDesc.Contains("-"))
+            {
+                try
+                {
+                    IFormatProvider culture = new CultureInfo("zh-CN", true);
+                    DateTime datetime = DateTime.ParseExact(dateDesc, "yyyyMMddHHmmssfffzzz", culture);
+                    return datetime;
+                }
+                catch (Exception x)
+                {
+                    String message = x.Message;
+                }
+            }
+                IFormatProvider newculture = new CultureInfo("zh-CN", true);
+                DateTime newdatetime = DateTime.ParseExact(dateDesc, Date_Pattern, newculture);
+                return newdatetime;
+        }
+
+
+
+        public static long currentTimeMillis()
+        {
+            System.DateTime current = new DateTime();
+            System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
+            double ms = (current - startTime).TotalMilliseconds;
+            long b = Convert.ToInt64(ms);
+            return b;
+        }
+    }
+}
diff --git a/BBWY.1688SDK/util/SignatureUtil.cs b/BBWY.1688SDK/util/SignatureUtil.cs
new file mode 100644
index 00000000..ceb22a28
--- /dev/null
+++ b/BBWY.1688SDK/util/SignatureUtil.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace com.alibaba.openapi.client.util
+{
+    public class SignatureUtil
+    {
+        public static byte[] hmacSha1(String path, Dictionary parameters, String signingKey)
+        {
+            List lists = new List();
+            foreach (KeyValuePair kvp in parameters)
+            {
+                lists.Add(kvp.Key + kvp.Value);
+            }
+            lists.Sort(StringComparer.Ordinal);
+            StringBuilder sb = new StringBuilder();
+            sb.Append(path);
+            foreach (String param in lists)
+            {
+                sb.Append(param);
+            }
+            String contentToHmac = sb.ToString();
+            byte[] byteToHmac = System.Text.Encoding.UTF8.GetBytes(contentToHmac);
+            byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(signingKey);
+            HMACSHA1 hmac = new HMACSHA1(byteArray);
+            byte[] hashValue = hmac.ComputeHash(byteToHmac, 0, byteToHmac.Length);
+            return hashValue;
+        }
+
+        public static string toHex( byte[] bytes)
+        {
+            char[] c = new char[bytes.Length * 2];
+
+            byte b;
+
+            for (int bx = 0, cx = 0; bx < bytes.Length; ++bx, ++cx)
+            {
+                b = ((byte)(bytes[bx] >> 4));
+                c[cx] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30);
+
+                b = ((byte)(bytes[bx] & 0x0F));
+                c[++cx] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30);
+            }
+
+            return new string(c).ToUpper();
+        }
+
+        public static byte[] hexToBytes( string str)
+        {
+            if (str.Length == 0 || str.Length % 2 != 0)
+                return new byte[0];
+
+            byte[] buffer = new byte[str.Length / 2];
+            char c;
+            for (int bx = 0, sx = 0; bx < buffer.Length; ++bx, ++sx)
+            {
+                // Convert first half of byte
+                c = str[sx];
+                buffer[bx] = (byte)((c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')) << 4);
+
+                // Convert second half of byte
+                c = str[++sx];
+                buffer[bx] |= (byte)(c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0'));
+            }
+
+            return buffer;
+        }
+    }
+}
diff --git a/BBWY.Client/APIServices/OrderService.cs b/BBWY.Client/APIServices/OrderService.cs
index a170b632..b164607f 100644
--- a/BBWY.Client/APIServices/OrderService.cs
+++ b/BBWY.Client/APIServices/OrderService.cs
@@ -33,7 +33,7 @@ namespace BBWY.Client.APIServices
             {
                 orderId,
                 startDate,
-                EndDate = endDate.Date.AddDays(1).AddSeconds(-1),
+                endDate,
                 orderState,
                 pageIndex,
                 pageSize,
diff --git a/BBWY.Client/APIServices/PurchaseOrderService.cs b/BBWY.Client/APIServices/PurchaseOrderService.cs
index ba7d78e7..b6c37501 100644
--- a/BBWY.Client/APIServices/PurchaseOrderService.cs
+++ b/BBWY.Client/APIServices/PurchaseOrderService.cs
@@ -2,6 +2,7 @@
 using BBWY.Common.Http;
 using BBWY.Common.Models;
 using System.Collections.Generic;
+using System.Linq;
 using System.Net.Http;
 
 namespace BBWY.Client.APIServices
@@ -48,5 +49,83 @@ namespace BBWY.Client.APIServices
                                        null,
                                        HttpMethod.Delete);
         }
+
+        /// 
+        /// 预览订单
+        /// 
+        /// 
+        /// 
+        /// 
+        public ApiResponse PreviewPurchaseOrder(Consignee consignee, IList purchaseSchemeProductSkuList, Platform purchasePlatform, PurchaseAccount purchaseAccount, PurchaseOrderMode purchaseOrderMode)
+        {
+            return SendRequest(globalContext.BBYWApiHost, "api/purchaseOrder/PreviewPurchaseOrder", new
+            {
+                purchaseOrderMode,
+                consignee,
+                CargoParamList = purchaseSchemeProductSkuList.Select(sku => new
+                {
+                    ProductId = sku.PurchaseProductId,
+                    SkuId = sku.PurchaseSkuId,
+                    SpecId = sku.PurchaseSkuSpecId,
+                    Quantity = sku.ItemTotal
+                }),
+                Platform = purchasePlatform,
+                AppKey = purchaseAccount.AppKey,
+                AppSecret = purchaseAccount.AppSecret,
+                AppToken = purchaseAccount.AppToken,
+                SaveResponseLog = true
+            }, null, HttpMethod.Post);
+        }
+
+        /// 
+        /// 创建采购单
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        /// 
+        public ApiResponse FastCreateOrder(Consignee consignee,
+                                           IList purchaseSchemeProductSkuList,
+                                           Platform purchasePlatform,
+                                           PurchaseAccount purchaseAccount,
+                                           PurchaseOrderMode purchaseOrderMode,
+                                           string tradeMode,
+                                           string remark,
+                                           string orderId,
+                                           long shopId,
+                                           string buyerAccount,
+                                           string sellerAccount)
+        {
+            return SendRequest(globalContext.BBYWApiHost, "api/purchaseOrder/FastCreateOrder", new
+            {
+                purchaseOrderMode,
+                consignee,
+                CargoParamList = purchaseSchemeProductSkuList.Select(sku => new
+                {
+                    ProductId = sku.PurchaseProductId,
+                    SkuId = sku.PurchaseSkuId,
+                    SpecId = sku.PurchaseSkuSpecId,
+                    Quantity = sku.ItemTotal
+                }),
+                Platform = purchasePlatform,
+                AppKey = purchaseAccount.AppKey,
+                AppSecret = purchaseAccount.AppSecret,
+                AppToken = purchaseAccount.AppToken,
+                SaveResponseLog = true,
+                tradeMode,
+                remark,
+                orderId,
+                shopId,
+                buyerAccount,
+                sellerAccount
+            }, null, HttpMethod.Post);
+        }
     }
 }
diff --git a/BBWY.Client/App.xaml b/BBWY.Client/App.xaml
index 0c4e72d0..19e6c302 100644
--- a/BBWY.Client/App.xaml
+++ b/BBWY.Client/App.xaml
@@ -20,6 +20,7 @@
             
             
             
+            
         
     
 
diff --git a/BBWY.Client/Converters/EnumToBooleanConverter.cs b/BBWY.Client/Converters/EnumToBooleanConverter.cs
new file mode 100644
index 00000000..0933e9b5
--- /dev/null
+++ b/BBWY.Client/Converters/EnumToBooleanConverter.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace BBWY.Client.Converters
+{
+    public class EnumToBooleanConverter : IValueConverter
+    {
+        /// 
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return value == null ? false : value.Equals(parameter);
+        }
+
+        /// 
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
+        }
+    }
+}
diff --git a/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs b/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs
index 446e7072..a285f0d9 100644
--- a/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs
@@ -86,6 +86,11 @@ namespace BBWY.Client.Models
         /// 
         public string VenderRemark { get; set; }
 
+        /// 
+        /// 采购备注
+        /// 
+        public string PurchaseRemark { get; set; }
+
         public StorageType? StorageType { get; set; }
 
         /// 
diff --git a/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs b/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs
new file mode 100644
index 00000000..258076d7
--- /dev/null
+++ b/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs
@@ -0,0 +1,9 @@
+namespace BBWY.Client.Models
+{
+    public class OrderTradeTypeResponse
+    {
+        public string Code { get; set; }
+
+        public string Name { get; set; }
+    }
+}
diff --git a/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs b/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
new file mode 100644
index 00000000..845a2611
--- /dev/null
+++ b/BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
@@ -0,0 +1,25 @@
+namespace BBWY.Client.Models
+{
+    public class PreviewOrderResponse
+    {
+        /// 
+        /// 总额
+        /// 
+        public decimal TotalAmount { get; set; }
+
+        /// 
+        /// 货款总额
+        /// 
+        public decimal ProductAmount { get; set; }
+
+        /// 
+        /// 运费
+        /// 
+        public decimal FreightAmount { get; set; }
+
+        /// 
+        /// 交易方式
+        /// 
+        public OrderTradeTypeResponse OrderTradeType { get; set; }
+    }
+}
diff --git a/BBWY.Client/Models/APIModel/Response/PurchaseOrderResponse.cs b/BBWY.Client/Models/APIModel/Response/PurchaseOrder/PurchaseOrderResponse.cs
similarity index 100%
rename from BBWY.Client/Models/APIModel/Response/PurchaseOrderResponse.cs
rename to BBWY.Client/Models/APIModel/Response/PurchaseOrder/PurchaseOrderResponse.cs
diff --git a/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs b/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs
index c6e91524..97f5559e 100644
--- a/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs
@@ -1,4 +1,6 @@
-namespace BBWY.Client.Models
+using System.Collections.Generic;
+
+namespace BBWY.Client.Models
 {
     public class ShopResponse
     {
@@ -18,5 +20,23 @@
 
         public string AppToken { get; set; }
 
+        public IList PurchaseList { get; set; }
+    }
+
+    public class PurchaseAccountResponse
+    {
+        public long Id { get; set; }
+
+        public string AccountName { get; set; }
+
+        public long ShopId { get; set; }
+
+        public Platform PurchasePlatformId { get; set; }
+
+        public string AppKey { get; set; }
+
+        public string AppSecret { get; set; }
+
+        public string AppToken { get; set; }
     }
 }
diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs
index f446b363..3790cc9d 100644
--- a/BBWY.Client/Models/Enums.cs
+++ b/BBWY.Client/Models/Enums.cs
@@ -20,6 +20,15 @@
         线下采购 = 1
     }
 
+    /// 
+    /// 采购单模式
+    /// 
+    public enum PurchaseOrderMode
+    {
+        批发 = 0,
+        代发 = 1
+    }
+
     /// 
     /// 仓储类型
     /// 
diff --git a/BBWY.Client/Models/MappingProfile.cs b/BBWY.Client/Models/MappingProfile.cs
index 54251f4c..d9d6c71b 100644
--- a/BBWY.Client/Models/MappingProfile.cs
+++ b/BBWY.Client/Models/MappingProfile.cs
@@ -19,9 +19,11 @@ namespace BBWY.Client.Models
                                               .ForMember(t => t.Name, opt => opt.MapFrom(f => f.UserName));
 
             CreateMap().ForMember(t => t.ShopId, opt => opt.MapFrom(f => f.ShopId))
-                                              .ForMember(t => t.Name, opt => opt.MapFrom(f => f.ShopName))
-                                              .ForMember(t => t.VenderType, opt => opt.MapFrom(f => f.ShopType))
-                                              .ForMember(t => t.Platform, opt => opt.MapFrom(f => f.PlatformId));
+                                           .ForMember(t => t.Name, opt => opt.MapFrom(f => f.ShopName))
+                                           .ForMember(t => t.VenderType, opt => opt.MapFrom(f => f.ShopType))
+                                           .ForMember(t => t.Platform, opt => opt.MapFrom(f => f.PlatformId))
+                                           .ForMember(t => t.PurchaseAccountList, opt => opt.MapFrom(f => f.PurchaseList));
+            CreateMap();
 
             CreateMap();
             CreateMap();
diff --git a/BBWY.Client/Models/Order/Order.cs b/BBWY.Client/Models/Order/Order.cs
index 8a289fd0..0c09ee2c 100644
--- a/BBWY.Client/Models/Order/Order.cs
+++ b/BBWY.Client/Models/Order/Order.cs
@@ -93,7 +93,10 @@ namespace BBWY.Client.Models
         /// 
         public string VenderRemark { get; set; }
 
-
+        /// 
+        /// 采购备注
+        /// 
+        public string PurchaseRemark { get; set; }
 
         /// 
         /// 仓储类型
diff --git a/BBWY.Client/Models/Order/RelationPurchaseOrderSku.cs b/BBWY.Client/Models/Order/RelationPurchaseOrderSku.cs
index 177f0f43..87082933 100644
--- a/BBWY.Client/Models/Order/RelationPurchaseOrderSku.cs
+++ b/BBWY.Client/Models/Order/RelationPurchaseOrderSku.cs
@@ -5,6 +5,12 @@ namespace BBWY.Client.Models
 {
     public class RelationPurchaseOrderSku : NotifyObject
     {
+        public RelationPurchaseOrderSku()
+        {
+            SingleSkuAmountStr = (0).ToString();
+        }
+
+        private string singleSkuAmountStr;
         private decimal singleSkuAmount;
         private decimal skuAmount;
 
@@ -18,6 +24,18 @@ namespace BBWY.Client.Models
 
         public string Title { get; set; }
 
+        public string SingleSkuAmountStr
+        {
+            get => singleSkuAmountStr; set
+            {
+                if (Set(ref singleSkuAmountStr, value))
+                {
+                    if (decimal.TryParse(value, out decimal d))
+                        SingleSkuAmount = d;
+                }
+            }
+        }
+
         public decimal SingleSkuAmount
         {
             get => singleSkuAmount;
@@ -41,5 +59,6 @@ namespace BBWY.Client.Models
 
         [JsonIgnore]
         public Action OnSkuAmountChanged { get; set; }
+
     }
 }
diff --git a/BBWY.Client/Models/Shop/Shop.cs b/BBWY.Client/Models/Shop/Shop.cs
index 92f1fb14..0facae53 100644
--- a/BBWY.Client/Models/Shop/Shop.cs
+++ b/BBWY.Client/Models/Shop/Shop.cs
@@ -1,4 +1,6 @@
-namespace BBWY.Client.Models
+using System.Collections.Generic;
+
+namespace BBWY.Client.Models
 {
     public class Shop : NotifyObject
     {
@@ -26,5 +28,12 @@
         public string AppToken { get; set; }
 
         public string Name { get => name; set { Set(ref name, value); } }
+
+        public IList PurchaseAccountList { get; set; }
+    }
+
+    public class PurchaseAccount : PurchaseAccountResponse
+    {
+
     }
 }
diff --git a/BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs b/BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs
index d38c7049..2c9f2ac2 100644
--- a/BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs
+++ b/BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs
@@ -5,6 +5,7 @@ using BBWY.Common.Models;
 using GalaSoft.MvvmLight.Command;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Linq;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Input;
@@ -21,6 +22,8 @@ namespace BBWY.Client.ViewModels
         public string OrderId { get; set; }
 
         public int ItemTotal { get; set; }
+        public Consignee Consignee { get; set; }
+
         public IList PurchaseSchemeList { get; set; }
 
 
@@ -49,15 +52,17 @@ namespace BBWY.Client.ViewModels
         {
             this.ItemTotal = 0;
             this.OrderId = this.SkuId = this.SkuName = string.Empty;
+            this.Consignee = null;
             PurchaseSchemeList.Clear();
         }
 
-        public void SetData(string orderId, string skuId, string skuName, int itemTotal)
+        public void SetData(string orderId, string skuId, string skuName, int itemTotal, Consignee consignee)
         {
             this.OrderId = orderId;
             this.SkuId = skuId;
             this.SkuName = skuName;
             this.ItemTotal = itemTotal;
+            this.Consignee = consignee;
         }
 
         public void LoadPurchaseScheme(string skuId)
@@ -102,8 +107,22 @@ namespace BBWY.Client.ViewModels
 
         public void PreviewPurchase(PurchaseScheme purchaseScheme)
         {
-            var p = new _1688Purchase(this.OrderId, this.ItemTotal, purchaseScheme);
-            p.ShowDialog();
+            var count = globalContext.User.Shop.PurchaseAccountList == null ? 0 : globalContext.User.Shop.PurchaseAccountList.Count();
+            if (count > 1)
+            {
+                //选择采购账号
+            }
+            else if (count == 1)
+            {
+                GalaSoft.MvvmLight.Messaging.Messenger.Default.Send(null, "ChoosePurchaseScheme_Close");
+                var p = new _1688Purchase(this.OrderId, this.ItemTotal, purchaseScheme, globalContext.User.Shop.PurchaseAccountList[0], this.Consignee);
+                p.ShowDialog();
+            }
+            else
+            {
+                MessageBox.Show("缺少采购账号", "提示");
+                return;
+            }
         }
     }
 }
diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
index 2d73a25c..320c224f 100644
--- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
+++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
@@ -101,23 +101,36 @@ namespace BBWY.Client.ViewModels
             this.choosePurchaseSchemeViewModel = choosePurchaseSchemeViewModel;
             OrderList = new ObservableCollection();
             EndDate = DateTime.Now;
-            StartDate = DateTime.Now.Date.AddDays(-29);
+            StartDate = DateTime.Now.Date.AddDays(-6);
             ToDayOrderAchievement = new ToDayOrderAchievement();
             SetOrderStateCommand = new RelayCommand(SetOrderState);
             SearchOrderCommand = new RelayCommand(() =>
             {
                 PageIndex = 1;
-                Task.Factory.StartNew(() => LoadOrder(1));
+                Task.Factory.StartNew(() => LoadOrder(1));  //手动点击查询订单
                 Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate));
             });
-            CopyTextCommand = new RelayCommand(s => Clipboard.SetText(s));
+            CopyTextCommand = new RelayCommand(s =>
+            {
+                try
+                {
+                    Clipboard.SetText(s);
+                }
+                catch (Exception ex)
+                {
+                    Console.ForegroundColor = ConsoleColor.Red;
+                    Console.WriteLine(ex);
+                    Console.ResetColor();
+                }
+            }
+            );
             CopyOrderWaybillCommand = new RelayCommand(o => Clipboard.SetText(o.WaybillNo));
             SetSearchDateCommand = new RelayCommand(d =>
             {
                 EndDate = d == 1 ? DateTime.Now.Date.AddDays(-1) : DateTime.Now;
                 StartDate = DateTime.Now.Date.AddDays(d * -1);
                 PageIndex = 1;
-                Task.Factory.StartNew(() => LoadOrder(1));
+                Task.Factory.StartNew(() => LoadOrder(1));  //点击日期查询订单
                 Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate));
             });
             OrderPageIndexChangedCommand = new RelayCommand(p =>
@@ -141,9 +154,14 @@ namespace BBWY.Client.ViewModels
             SearchSku = String.Empty;
             SearchWaybill = String.Empty;
             EndDate = DateTime.Now;
-            StartDate = DateTime.Now.Date.AddDays(-29);
+            StartDate = DateTime.Now.Date.AddDays(-6);
             PageIndex = 1;
-            Task.Factory.StartNew(() => LoadOrder(1));
+            Task.Factory.StartNew(() => LoadOrder(1));  //选择状态查询订单
+        }
+
+        public void RefreshOrder()
+        {
+            Task.Factory.StartNew(() => LoadOrder(PageIndex));
         }
 
         private void LoadOrder(int pageIndex)
@@ -257,7 +275,7 @@ namespace BBWY.Client.ViewModels
                 }
                 else if (chooseDFType.DFType == DFType.在线采购)
                 {
-                    choosePurchaseSchemeViewModel.SetData(order.Id, order.ItemList[0].Id, order.ItemList[0].Title, order.ItemList[0].ItemTotal);
+                    choosePurchaseSchemeViewModel.SetData(order.Id, order.ItemList[0].Id, order.ItemList[0].Title, order.ItemList[0].ItemTotal, order.Consignee);
                     var choosePurchaseScheme = new ChoosePurchaseScheme();
                     choosePurchaseScheme.ShowDialog();
                 }
@@ -282,7 +300,7 @@ namespace BBWY.Client.ViewModels
                                 App.Current.Dispatcher.Invoke(() => MessageBox.Show(response.Msg, "关联采购订单"));
                                 return;
                             }
-                            LoadOrder(PageIndex); //手动计算成功刷新订单列表
+                            LoadOrder(PageIndex); //关联订单刷新订单列表
                         });
         }
 
@@ -316,7 +334,7 @@ namespace BBWY.Client.ViewModels
                                 App.Current.Dispatcher.Invoke(() => MessageBox.Show(response.Msg, "设置刷单成本"));
                                 return;
                             }
-                            LoadOrder(PageIndex); //手动计算成功刷新订单列表
+                            LoadOrder(PageIndex); //设置刷单刷新订单列表
                         });
         }
 
@@ -333,7 +351,8 @@ namespace BBWY.Client.ViewModels
                     SkuId = osku.Id,
                     Quantity = osku.ItemTotal,
                     Title = osku.Title,
-                    SingleSkuAmount = (order.OrderCostDetailList.FirstOrDefault(ocd => ocd.SkuId == osku.Id)?.SkuAmount / osku.ItemTotal) ?? 0
+                    SingleSkuAmount = (order.OrderCostDetailList.FirstOrDefault(ocd => ocd.SkuId == osku.Id)?.SkuAmount / osku.ItemTotal) ?? 0,
+                    SingleSkuAmountStr = ((order.OrderCostDetailList.FirstOrDefault(ocd => ocd.SkuId == osku.Id)?.SkuAmount / osku.ItemTotal) ?? 0).ToString()
                 }).ToList());
                 relationPurchaseOrder.Closed += RelationPurchaseOrder_Closed;
                 relationPurchaseOrder.ShowDialog();
diff --git a/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs b/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs
index 53cb9f55..af3df55c 100644
--- a/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs
+++ b/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs
@@ -1,6 +1,7 @@
 using BBWY.Client.APIServices;
 using BBWY.Client.Models;
 using BBWY.Common.Trigger;
+using GalaSoft.MvvmLight.Command;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -8,35 +9,92 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Input;
 
 namespace BBWY.Client.ViewModels
 {
     public class _1688PreviewPurchaseViewModel : BaseVM
     {
+        public ICommand FastCreateOrderCommand { get; set; }
+
         public IList PurchaseSchemeProductSkuList { get; set; }
 
         public PurchaseScheme PurchaseScheme { get; set; }
+        public PurchaseAccount PurchaseAccount { get; set; }
         public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
 
+        public decimal ProductAmount { get => productAmount; set { Set(ref productAmount, value); } }
+        public decimal FreightAmount { get => freightAmount; set { Set(ref freightAmount, value); } }
+        public decimal TotalAmount { get => totalAmount; set { Set(ref totalAmount, value); } }
+        public string ContactName { get => contactName; set { Set(ref contactName, value); } }
+        public string Address { get => address; set { Set(ref address, value); } }
+        public string Mobile { get => mobile; set { Set(ref mobile, value); } }
+        public string Province { get => province; set { Set(ref province, value); } }
+        public string City { get => city; set { Set(ref city, value); } }
+        public string County { get => county; set { Set(ref county, value); } }
+        public string Town { get => town; set { Set(ref town, value); } }
+        public string PrucahseRemark { get => prucahseRemark; set { Set(ref prucahseRemark, value); } }
+
+        public PurchaseOrderMode PurchaseOrderMode
+        {
+            get => purchaseOrderMode; set
+            {
+                if (Set(ref purchaseOrderMode, value))
+                    OnDelayTriggerExecute(Guid.NewGuid().ToString());
+            }
+        }
+
+        private OrderListViewModel orderListViewModel;
+        private GlobalContext globalContext;
         private string orderId;
         private int skuItemCount;
         private bool isLoading;
         private OneBoundAPIService oneBoundAPIService;
+        private PurchaseOrderService purchaseOrderService;
         private DelayTrigger delayTrigger;
 
-        public _1688PreviewPurchaseViewModel(OneBoundAPIService oneBoundAPIService)
+        private decimal productAmount;
+        private decimal freightAmount;
+        private decimal totalAmount;
+        private string contactName;
+        private string address;
+        private string mobile;
+        private string province;
+        private string city;
+        private string county;
+        private string town;
+        private string prucahseRemark;
+        private PurchaseOrderMode purchaseOrderMode = PurchaseOrderMode.代发;
+        private string tradeMode;
+
+        public _1688PreviewPurchaseViewModel(OneBoundAPIService oneBoundAPIService, PurchaseOrderService purchaseOrderService, GlobalContext globalContext, OrderListViewModel orderListViewModel)
         {
             this.oneBoundAPIService = oneBoundAPIService;
+            this.purchaseOrderService = purchaseOrderService;
             this.delayTrigger = new DelayTrigger();
             this.delayTrigger.OnExecute = OnDelayTriggerExecute;
             PurchaseSchemeProductSkuList = new ObservableCollection();
+            FastCreateOrderCommand = new RelayCommand(FastCreateOrder);
+            this.globalContext = globalContext;
+            this.orderListViewModel = orderListViewModel;
+            //PurchaseOrderMode = PurchaseOrderMode.代发;
         }
 
-        public void SetData(string orderId, int skuItemCount, PurchaseScheme purchaseScheme)
+        public void SetData(string orderId, int skuItemCount, PurchaseScheme purchaseScheme, PurchaseAccount purchaseAccount, Consignee consignee)
         {
             this.orderId = orderId;
             this.skuItemCount = skuItemCount;
             this.PurchaseScheme = purchaseScheme;
+            this.PurchaseAccount = purchaseAccount;
+
+            this.ContactName = consignee.ContactName;
+            this.Address = consignee.Address;
+            this.Province = consignee.Province;
+            this.City = consignee.City;
+            this.County = consignee.County;
+            this.Town = consignee.Town;
+            //this.Mobile = consignee.Mobile;
         }
 
         protected override void Load()
@@ -53,7 +111,14 @@ namespace BBWY.Client.ViewModels
             Task.Factory.StartNew(() =>
             {
                 WaitHandle.WaitAll(waitList.ToArray());
-                IsLoading = false;
+                //IsLoading = false;
+                if (PurchaseSchemeProductSkuList.Count() > 0)
+                    OnDelayTriggerExecute(Guid.NewGuid().ToString());
+                else
+                {
+                    IsLoading = false;
+                    App.Current.Dispatcher.Invoke(() => MessageBox.Show("采购方案商品加载失败,请重新打开预览窗口", "提示"));
+                }
             });
         }
 
@@ -62,7 +127,11 @@ namespace BBWY.Client.ViewModels
             PurchaseSchemeProductSkuList.Clear();
             PurchaseScheme = null;
             orderId = string.Empty;
+            tradeMode = string.Empty;
             skuItemCount = 0;
+            ProductAmount = FreightAmount = TotalAmount = 0;
+            ContactName = Address = Mobile = Province = City = County = Town = PrucahseRemark = string.Empty;
+
         }
 
         private void LoadPurchaseProduct(PurchaseSchemeProduct purchaseSchemeProduct, ManualResetEvent ewh)
@@ -70,7 +139,7 @@ namespace BBWY.Client.ViewModels
             var purchaseSchemeProductSkuList = LoadPurchaseProductCore(purchaseSchemeProduct.PurchaseProductId, out string errorMsg);
             if (purchaseSchemeProductSkuList != null && purchaseSchemeProductSkuList.Count > 0)
             {
-                App.Current.Dispatcher.BeginInvoke((Action)delegate
+                App.Current.Dispatcher.Invoke(() =>
                 {
                     foreach (var purchaseSchemeProductSku in purchaseSchemeProductSkuList)
                     {
@@ -85,7 +154,6 @@ namespace BBWY.Client.ViewModels
             }
             ewh.Set();
             ewh.Dispose();
-
         }
 
         private IList LoadPurchaseProductCore(string purchseProductId, out string errorMsg)
@@ -98,6 +166,7 @@ namespace BBWY.Client.ViewModels
                 //记录日志
 
                 errorMsg = response.Msg;
+                Console.WriteLine(errorMsg);
                 return null;
             }
             var jobject = response.Data;
@@ -153,7 +222,93 @@ namespace BBWY.Client.ViewModels
 
         private void OnDelayTriggerExecute(string key)
         {
-         
+            if (string.IsNullOrEmpty(key))
+                return;
+            IsLoading = true;
+            Task.Factory.StartNew(() => purchaseOrderService.PreviewPurchaseOrder(new Consignee()
+            {
+                Address = Address,
+                City = City,
+                ContactName = ContactName,
+                County = County,
+                Mobile = Mobile,
+                Province = Province,
+                TelePhone = Mobile,
+                Town = Town
+            }, PurchaseSchemeProductSkuList, Platform.阿里巴巴, PurchaseAccount, PurchaseOrderMode))
+                        .ContinueWith(t =>
+                        {
+                            IsLoading = false;
+                            var r = t.Result;
+                            if (!r.Success)
+                            {
+                                ProductAmount = FreightAmount = TotalAmount = 0;
+                                tradeMode = string.Empty;
+                                App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "预览订单报价"));
+                                return;
+                            }
+                            ProductAmount = r.Data.ProductAmount;
+                            FreightAmount = r.Data.FreightAmount;
+                            TotalAmount = r.Data.TotalAmount;
+                            tradeMode = r.Data.OrderTradeType?.Code;
+                        });
+        }
+
+        private void FastCreateOrder()
+        {
+            if (TotalAmount == 0)
+            {
+                MessageBox.Show("总金额为0不能提交订单", "提示");
+                return;
+            }
+            if (string.IsNullOrEmpty(Mobile) ||
+                string.IsNullOrEmpty(Address) ||
+                string.IsNullOrEmpty(City) ||
+                string.IsNullOrEmpty(Province) ||
+                string.IsNullOrEmpty(County) ||
+                string.IsNullOrEmpty(Town) ||
+                string.IsNullOrEmpty(ContactName))
+            {
+                MessageBox.Show("收货人信息不全", "下单");
+                return;
+            }
+
+            IsLoading = true;
+            Task.Factory.StartNew(() => purchaseOrderService.FastCreateOrder(new Consignee()
+            {
+                Address = Address,
+                City = City,
+                ContactName = ContactName,
+                County = County,
+                Mobile = Mobile,
+                Province = Province,
+                TelePhone = Mobile,
+                Town = Town
+            }, PurchaseSchemeProductSkuList,
+               Platform.阿里巴巴,
+               PurchaseAccount,
+               PurchaseOrderMode,
+               tradeMode,
+               PrucahseRemark,
+               orderId,
+               globalContext.User.Shop.ShopId,
+               PurchaseAccount.AccountName,
+               PurchaseScheme.PurchaserName)).ContinueWith(t =>
+               {
+                   IsLoading = false;
+                   var r = t.Result;
+                   if (!r.Success)
+                   {
+                       App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "下单"));
+                       return;
+                   }
+
+                   //刷新订单列表
+                   orderListViewModel.RefreshOrder();
+
+                   //关闭当前窗口
+                   GalaSoft.MvvmLight.Messaging.Messenger.Default.Send(null, "OnlinePurchase_Close");
+               });
         }
     }
 }
diff --git a/BBWY.Client/ViewModels/Ware/BindingPurchaseProductViewModel.cs b/BBWY.Client/ViewModels/Ware/BindingPurchaseProductViewModel.cs
index a23d4a25..61eb6f46 100644
--- a/BBWY.Client/ViewModels/Ware/BindingPurchaseProductViewModel.cs
+++ b/BBWY.Client/ViewModels/Ware/BindingPurchaseProductViewModel.cs
@@ -98,8 +98,8 @@ namespace BBWY.Client.ViewModels
                      var waitList = new List();
                      foreach (var sku in ProductSkuList)
                      {
-                        //当前SKU下当前采购商的采购方案
-                        var apiScheme = purchaseSchemeList.FirstOrDefault(s => s.SkuId == sku.Id && s.PurchaserId == PurchaserId);
+                         //当前SKU下当前采购商的采购方案
+                         var apiScheme = purchaseSchemeList.FirstOrDefault(s => s.SkuId == sku.Id && s.PurchaserId == PurchaserId);
 
                          if (apiScheme == null)
                              continue;
@@ -246,6 +246,7 @@ namespace BBWY.Client.ViewModels
 
             productSku.SelectedPurchaseScheme.PurchaseSchemeProductList.Add(new PurchaseSchemeProduct()
             {
+                Id = DateTime.Now.ToFileTime(),
                 IsEditing = true,
                 ProductId = productSku.ProductId,
                 SkuId = productSku.Id
@@ -280,7 +281,7 @@ namespace BBWY.Client.ViewModels
             }
             var sku = ProductSkuList.FirstOrDefault(s => s.Id == purchaseSchemeProduct.SkuId);
             var purchaseUrl = match.Groups[1].Value;
-            if (sku.SelectedPurchaseScheme.PurchaseSchemeProductList.Any(p => p.PurchaseUrl == purchaseUrl))
+            if (sku.SelectedPurchaseScheme.PurchaseSchemeProductList.Any(p => p.Id != purchaseSchemeProduct.Id && p.PurchaseUrl == purchaseUrl))
             {
                 MessageBox.Show("商品链接重复");
                 return;
diff --git a/BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml.cs b/BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml.cs
index afd36fd8..181cfe0c 100644
--- a/BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml.cs
+++ b/BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml.cs
@@ -1,4 +1,5 @@
 using BBWY.Controls;
+using GalaSoft.MvvmLight.Messaging;
 
 namespace BBWY.Client.Views.Order
 {
@@ -10,6 +11,18 @@ namespace BBWY.Client.Views.Order
         public ChoosePurchaseScheme()
         {
             InitializeComponent();
+            this.Loaded += ChoosePurchaseScheme_Loaded;
+            this.Unloaded += ChoosePurchaseScheme_Unloaded;
+        }
+
+        private void ChoosePurchaseScheme_Unloaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            Messenger.Default.Unregister(this);
+        }
+
+        private void ChoosePurchaseScheme_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            Messenger.Default.Register(this, "ChoosePurchaseScheme_Close", (x) => this.Close());
         }
     }
 }
diff --git a/BBWY.Client/Views/Order/OrderList.xaml b/BBWY.Client/Views/Order/OrderList.xaml
index bf1028aa..453d82aa 100644
--- a/BBWY.Client/Views/Order/OrderList.xaml
+++ b/BBWY.Client/Views/Order/OrderList.xaml
@@ -476,7 +476,7 @@
 
                                 
                                     
-                                        
+                                        
                                         
                                     
 
diff --git a/BBWY.Client/Views/Order/RelationPurchaseOrder.xaml b/BBWY.Client/Views/Order/RelationPurchaseOrder.xaml
index 04b10983..2341956b 100644
--- a/BBWY.Client/Views/Order/RelationPurchaseOrder.xaml
+++ b/BBWY.Client/Views/Order/RelationPurchaseOrder.xaml
@@ -123,7 +123,7 @@
                                            TextWrapping="Wrap"/>
                             
                             
+                                        Text="{Binding SingleSkuAmountStr,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
 
                             
 
diff --git a/BBWY.Client/Views/Purchase/1688Purchase.xaml b/BBWY.Client/Views/Purchase/1688Purchase.xaml
index 3cac376f..1defc6aa 100644
--- a/BBWY.Client/Views/Purchase/1688Purchase.xaml
+++ b/BBWY.Client/Views/Purchase/1688Purchase.xaml
@@ -4,6 +4,7 @@
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:local="clr-namespace:BBWY.Client.Views.Purchase"
+           xmlns:cmodel="clr-namespace:BBWY.Client.Models"
            xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
             xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
            mc:Ignorable="d"
@@ -28,6 +29,9 @@
             
             
         
+
+        
+
         
             
@@ -77,7 +81,7 @@
                 
                 
             
-            
             
                 
-                
+                
                 
                 
                 
-                
+                
                 
             
         
 
         
-            
-            
-            
+            
+            
+                
+                    
+                    
+                    
+                    
+                    
+                
+                
+                
+                
+                
+                
+            
+
+            
         
 
         
             
-            
+            
             
         
-        
+        
+            
+            
+        
+        
     
 
diff --git a/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs b/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs
index ae6532ef..03b81284 100644
--- a/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs
+++ b/BBWY.Client/Views/Purchase/1688Purchase.xaml.cs
@@ -1,6 +1,7 @@
 using BBWY.Client.Models;
 using BBWY.Client.ViewModels;
 using BBWY.Controls;
+using GalaSoft.MvvmLight.Messaging;
 
 namespace BBWY.Client.Views.Purchase
 {
@@ -9,10 +10,22 @@ namespace BBWY.Client.Views.Purchase
     /// 
     public partial class _1688Purchase : BWindow
     {
-        public _1688Purchase(string orderId, int skuItemCount, PurchaseScheme purchaseScheme)
+        public _1688Purchase(string orderId, int skuItemCount, PurchaseScheme purchaseScheme, PurchaseAccount purchaseAccount, Consignee consignee)
         {
             InitializeComponent();
-            (this.DataContext as _1688PreviewPurchaseViewModel).SetData(orderId, skuItemCount, purchaseScheme);
+            (this.DataContext as _1688PreviewPurchaseViewModel).SetData(orderId, skuItemCount, purchaseScheme, purchaseAccount, consignee);
+            this.Loaded += _1688Purchase_Loaded;
+            this.Unloaded += _1688Purchase_Unloaded;
+        }
+
+        private void _1688Purchase_Unloaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            Messenger.Default.Unregister(this);
+        }
+
+        private void _1688Purchase_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+            Messenger.Default.Register(this, "OnlinePurchase_Close", (x) => this.Dispatcher.Invoke(() => this.Close()));
         }
     }
 }
diff --git a/BBWY.Server.API/Controllers/OrderController.cs b/BBWY.Server.API/Controllers/OrderController.cs
index f08b50ee..72acd51e 100644
--- a/BBWY.Server.API/Controllers/OrderController.cs
+++ b/BBWY.Server.API/Controllers/OrderController.cs
@@ -88,6 +88,16 @@ namespace BBWY.Server.API.Controllers
             orderBusiness.OutStock(outStockRequest);
         }
 
+        /// 
+        /// 指定时间范围的订单同步
+        /// 
+        /// 
+        [HttpPost]
+        public void SyncOrderByDate([FromBody] SyncOrderByDateRequest syncOrderByDateRequest)
+        {
+            orderBusiness.SyncOrderByDate(syncOrderByDateRequest);
+        }
+
         /// 
         /// 订单同步
         /// 
diff --git a/BBWY.Server.API/Controllers/PlatformSDKController.cs b/BBWY.Server.API/Controllers/PlatformSDKController.cs
index 3caea906..c3cd8487 100644
--- a/BBWY.Server.API/Controllers/PlatformSDKController.cs
+++ b/BBWY.Server.API/Controllers/PlatformSDKController.cs
@@ -115,9 +115,20 @@ namespace BBWY.Server.API.Controllers
         /// 
         /// 
         [HttpPost]
-        public void OutStock(OutStockRequest outStockRequest)
+        public void OutStock([FromBody]OutStockRequest outStockRequest)
         {
             platformSDKBusinessList.FirstOrDefault(p => p.Platform == outStockRequest.Platform).OutStock(outStockRequest);
         }
+
+        /// 
+        /// 订单预览
+        /// 
+        /// 
+        /// 
+        [HttpPost]
+        public PreviewOrderResponse PreviewOrder([FromBody]PreviewOrderReuqest previewOrderReuqest)
+        {
+            return platformSDKBusinessList.FirstOrDefault(p => p.Platform == previewOrderReuqest.Platform).PreviewOrder(previewOrderReuqest);
+        }
     }
 }
diff --git a/BBWY.Server.API/Controllers/PurchaseOrderController.cs b/BBWY.Server.API/Controllers/PurchaseOrderController.cs
index 7d07d658..c16f3d42 100644
--- a/BBWY.Server.API/Controllers/PurchaseOrderController.cs
+++ b/BBWY.Server.API/Controllers/PurchaseOrderController.cs
@@ -2,7 +2,9 @@
 using BBWY.Server.Model.Dto;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using System;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace BBWY.Server.API.Controllers
 {
@@ -10,7 +12,8 @@ namespace BBWY.Server.API.Controllers
     {
         private PurchaseOrderBusiness purchaseOrderBusiness;
 
-        public PurchaseOrderController(PurchaseOrderBusiness purchaseOrderBusiness, IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
+        public PurchaseOrderController(PurchaseOrderBusiness purchaseOrderBusiness,
+                                       IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
         {
             this.purchaseOrderBusiness = purchaseOrderBusiness;
         }
@@ -38,5 +41,26 @@ namespace BBWY.Server.API.Controllers
         {
             purchaseOrderBusiness.DeletePurchaseOrder(id);
         }
+
+        /// 
+        /// 订单预览
+        /// 
+        /// 
+        /// 
+        [HttpPost]
+        public PreviewOrderResponse PreviewPurchaseOrder([FromBody] PreviewOrderReuqest previewOrderReuqest)
+        {
+            return purchaseOrderBusiness.PreviewPurchaseOrder(previewOrderReuqest);
+        }
+
+        /// 
+        /// 创建在线采购单
+        /// 
+        /// 
+        [HttpPost]
+        public void FastCreateOrder([FromBody]CreateOnlinePurchaseOrderRequest createOnlinePurchaseOrderRequest)
+        {
+            purchaseOrderBusiness.FastCreateOrder(createOnlinePurchaseOrderRequest);
+        }
     }
 }
diff --git a/BBWY.Server.API/Startup.cs b/BBWY.Server.API/Startup.cs
index 4f7b4508..20570bbe 100644
--- a/BBWY.Server.API/Startup.cs
+++ b/BBWY.Server.API/Startup.cs
@@ -67,6 +67,7 @@ namespace BBWY.Server.API
             });
             services.BatchRegisterServices(new Assembly[] { Assembly.Load("BBWY.Server.Business") }, typeof(IDenpendency));
             services.AddSingleton();
+            services.AddSingleton();
 
             //var stores = Configuration.GetSection("Stores").Get>();
 
diff --git a/BBWY.Server.Business/BBWY.Server.Business.csproj b/BBWY.Server.Business/BBWY.Server.Business.csproj
index 1c50ffda..58ecf8d7 100644
--- a/BBWY.Server.Business/BBWY.Server.Business.csproj
+++ b/BBWY.Server.Business/BBWY.Server.Business.csproj
@@ -5,6 +5,12 @@
     True
   
 
+  
+    
+    
+    
+  
+
   
     
     
@@ -15,6 +21,7 @@
   
 
   
+    
     
     
     
diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs
index c3cc13d0..1cd91861 100644
--- a/BBWY.Server.Business/Order/OrderBusiness.cs
+++ b/BBWY.Server.Business/Order/OrderBusiness.cs
@@ -15,6 +15,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Net.Http;
+using System.Threading.Tasks;
 using Yitter.IdGenerator;
 
 namespace BBWY.Server.Business
@@ -26,12 +27,14 @@ namespace BBWY.Server.Business
         private IDictionary> syncOrderMethodDic;
         private IIdGenerator idGenerator;
         private IDictionary mdsApiHeader;
+        private TaskSchedulerManager taskSchedulerManager;
 
-        public OrderBusiness(RestApiService restApiService, IConfiguration configuration, ILogger logger, IFreeSql fsql, IIdGenerator idGenerator, IOptions options) : base(restApiService, options)
+        public OrderBusiness(RestApiService restApiService, IConfiguration configuration, ILogger logger, IFreeSql fsql, IIdGenerator idGenerator, IOptions options, TaskSchedulerManager taskSchedulerManager) : base(restApiService, options)
         {
             this.logger = logger;
             this.fsql = fsql;
             this.idGenerator = idGenerator;
+            this.taskSchedulerManager = taskSchedulerManager;
             syncOrderMethodDic = new Dictionary>()
             {
                 { Enums.Platform.京东, SyncJDOrder }
@@ -45,6 +48,8 @@ namespace BBWY.Server.Business
         {
             if (searchOrderRequest.OrderState == Enums.OrderState.已取消)
                 searchOrderRequest.ExcludeCanceled = false;
+            if (searchOrderRequest.EndDate != null)
+                searchOrderRequest.EndDate = searchOrderRequest.EndDate.Value.Date.AddDays(1).AddSeconds(-1);
 
             var select = fsql.Select().LeftJoin((o, ocs, oct, ods) => o.Id == ocs.OrderId)
                                                                                            .LeftJoin((o, ocs, oct, ods) => o.Id == oct.OrderId)
@@ -100,6 +105,7 @@ namespace BBWY.Server.Business
                 StoreId = o.StoreId,
                 StoreOrder = o.StoreOrder,
                 VenderRemark = o.VenderRemark,
+                PurchaseRemark = o.PurchaseRemark,
                 WaybillNo = o.WaybillNo,
                 Flag = o.Flag,
                 SDType = o.SDType,
@@ -650,7 +656,15 @@ namespace BBWY.Server.Business
                                                        .ExecuteAffrows();
         }
 
-        public void SyncOrder(long shopId, string orderId)
+        /// 
+        /// 同步订单
+        /// 
+        /// 
+        /// 
+        /// 默认3小时前
+        /// 默认当前时间
+        /// 
+        public void SyncOrder(long shopId, string orderId, DateTime? startTime = null, DateTime? endTime = null)
         {
             #region 获取店铺信息;
             var shopResult = restApiService.SendRequest(globalConfig.MdsApi, "/TaskList/Shop/GetShopsByShopId", $"shopId={shopId}", mdsApiHeader, HttpMethod.Get, enableRandomTimeStamp: true);
@@ -681,8 +695,8 @@ namespace BBWY.Server.Business
                 var relayAPIHost = GetPlatformRelayAPIHost((Enums.Platform)platformId);
                 var orderListApiResult = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetOrderList", new SearchPlatformOrderRequest()
                 {
-                    StartDate = DateTime.Now.AddHours(-3),
-                    EndDate = DateTime.Now,
+                    StartDate = startTime ?? DateTime.Now.AddHours(-3),
+                    EndDate = endTime ?? DateTime.Now,
                     AppKey = appKey,
                     AppSecret = appSecret,
                     AppToken = appToken,
@@ -712,6 +726,62 @@ namespace BBWY.Server.Business
             }
         }
 
+        public void SyncOrderByDate(SyncOrderByDateRequest syncOrderByDateRequest)
+        {
+            if (fsql.Select().Where(ost => ost.ShopId == syncOrderByDateRequest.ShopId && ost.State == Enums.OrderSyncState.Running).Any())
+                throw new BusinessException("存在未结束的同步任务,请稍后同步");
+            syncOrderByDateRequest.EndTime = syncOrderByDateRequest.EndTime.Date.AddDays(1).AddSeconds(-1);
+            if ((syncOrderByDateRequest.EndTime - syncOrderByDateRequest.StartTime).Days > 7)
+                throw new BusinessException("同步任务时差最长7天");
+
+            var orderSyncTask = new OrderSyncTask()
+            {
+                Id = idGenerator.NewLong(),
+                ShopId = syncOrderByDateRequest.ShopId,
+                State = Enums.OrderSyncState.Running,
+                SyncStartTime = syncOrderByDateRequest.StartTime,
+                SyncEndTime = syncOrderByDateRequest.EndTime
+            };
+            fsql.Insert(orderSyncTask).ExecuteAffrows();
+            Task.Factory.StartNew(() =>
+            {
+                var currentStartTime = syncOrderByDateRequest.StartTime;
+                var currentEndTime = currentStartTime.AddHours(3);
+                var keeploop = true;
+                while (keeploop)
+                {
+                    try
+                    {
+                        SyncOrder(syncOrderByDateRequest.ShopId, String.Empty, currentStartTime, currentEndTime);
+                    }
+                    catch (Exception ex) { }
+                    finally
+                    {
+                        var lessHour = (syncOrderByDateRequest.EndTime - currentEndTime).TotalHours;
+                        if (lessHour > 3)
+                        {
+                            currentStartTime = currentStartTime.AddHours(3);
+                            currentEndTime = currentEndTime.AddHours(3);
+                        }
+                        else if (lessHour > 0 && lessHour < 3)
+                        {
+                            currentStartTime = currentEndTime;
+                            currentEndTime = syncOrderByDateRequest.EndTime;
+                        }
+                        else if (lessHour <= 0)
+                        {
+                            keeploop = false;
+                        }
+                    }
+                }
+                try
+                {
+                    fsql.Update(orderSyncTask.Id).Set(ost => ost.State, Enums.OrderSyncState.End).ExecuteAffrows();
+                }
+                catch (Exception ex) { }
+            }, System.Threading.CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.SyncOrderTaskScheduler);
+        }
+
         private void SyncJDOrder(JArray orderTokenJArray, long shopId, string relayAPIHost, string appKey, string appSecret, string appToken)
         {
             var orderTokenList = orderTokenJArray.Where(o => o.Value("orderTotalPrice") != 0);
@@ -737,7 +807,6 @@ namespace BBWY.Server.Business
                 dbOrderCostDetailList = fsql.Select().Where(ocd => interfaceCanceledOrderIdList.Contains(ocd.OrderId)).ToList();
             }
 
-
             var orderSkuIds = new List();
             foreach (var orderJToken in orderTokenList)
             {
diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
index 0aac43f0..56ea584a 100644
--- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs
@@ -19,8 +19,6 @@ namespace BBWY.Server.Business
     {
         public override Enums.Platform Platform => Enums.Platform.京东;
 
-        private ILogger logger;
-
         private readonly string searchFields = "orderId,venderId,orderType,payType,orderTotalPrice,orderSellerPrice,orderPayment,freightPrice,orderState,orderStateRemark,orderRemark,orderStartTime,orderEndTime,modified,consigneeInfo,itemInfoList,couponDetailList,taxFee,venderRemark,pin,waybill,storeOrder,storeId,sellerDiscount";
 
         private readonly IDictionary flagDictionary = new Dictionary()
@@ -34,7 +32,7 @@ namespace BBWY.Server.Business
         };
 
 
-        public JDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache) { this.logger = logger; }
+        public JDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger) { }
 
         private IJdClient GetJdClient(string appKey, string appSecret)
         {
@@ -161,6 +159,7 @@ namespace BBWY.Server.Business
 
         public override IList GetOrderList(SearchPlatformOrderRequest searchOrderRequest)
         {
+            //logger.Info($"searchOrderRequest ${JsonConvert.SerializeObject(searchOrderRequest)}");
             if (searchOrderRequest.StartDate == null || searchOrderRequest.EndDate == null)
                 throw new BusinessException("缺少开始/结束日期");
             if ((searchOrderRequest.EndDate.Value - searchOrderRequest.StartDate.Value).TotalDays > 30)
@@ -179,7 +178,7 @@ namespace BBWY.Server.Business
                     if (searchOrderRequest.StartDate != null)
                         fbpReq.startDate = searchOrderRequest.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
                     if (searchOrderRequest.EndDate != null)
-                        fbpReq.endDate = searchOrderRequest.EndDate.Value.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
+                        fbpReq.endDate = searchOrderRequest.EndDate.Value.Date.ToString("yyyy-MM-dd HH:mm:ss");
                     if (string.IsNullOrEmpty(searchOrderRequest.OrderState))
                     {
                         fbpReq.orderState = "DengDaiDaYin,DengDaiChuKu,DengDaiDaBao,DengDaiFaHuo,ZiTiTuZhong,ShangMenTiHuo,ZiTiTuiHuo,DengDaiQueRenShouHuo,PeiSongTuiHuo,HuoDaoFuKuanQueRen,WanCheng,DengDaiFenQiFuKuan,ServiceFinished,SuoDing,DengDaiTuiKuan,DengDaiKeHuHuiFu,TRADE_CANCELED,LOCKED";
@@ -212,7 +211,7 @@ namespace BBWY.Server.Business
                     if (searchOrderRequest.StartDate != null)
                         sopReq.startDate = searchOrderRequest.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
                     if (searchOrderRequest.EndDate != null)
-                        sopReq.endDate = searchOrderRequest.EndDate.Value.Date.AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
+                        sopReq.endDate = searchOrderRequest.EndDate.Value.Date.ToString("yyyy-MM-dd HH:mm:ss");
                     if (string.IsNullOrEmpty(searchOrderRequest.OrderState))
                     {
                         //WAIT_SELLER_STOCK_OUT,WAIT_GOODS_RECEIVE_CONFIRM,WAIT_SELLER_DELIVER,PAUSE,FINISHED_L,TRADE_CANCELED,LOCKED
@@ -229,6 +228,8 @@ namespace BBWY.Server.Business
                     //sopReq.dateType = "";
 
                     var sopResponse = jdClient.Execute(sopReq, searchOrderRequest.AppToken, DateTime.Now.ToLocalTime());
+
+                    //logger.Info($"sopResponse is null ${sopResponse == null}");
                     if (searchOrderRequest.SaveResponseLog)
                         logger.Info($"sopResponse\r\n{JsonConvert.SerializeObject(sopResponse)}");
                     if (sopResponse.IsError)
@@ -347,6 +348,7 @@ namespace BBWY.Server.Business
             var decryptContactName = tdeClient.DecryptString(orderInfo["consigneeInfo"].Value("fullname"));
             var decryptAddress = tdeClient.DecryptString(orderInfo["consigneeInfo"].Value("fullAddress"));
 
+            /*
             PopOrderGetmobilelistRequest decryptMobileReq = new PopOrderGetmobilelistRequest();
             decryptMobileReq.appName = "订单管家";
             decryptMobileReq.orderId = decryptConsigneeRequest.OrderId;
@@ -367,13 +369,13 @@ namespace BBWY.Server.Business
 
             var decryptMobile = decryptMobileResponse.Json["jingdong_pop_order_getmobilelist_responce"]["result"]["data"][decryptConsigneeRequest.OrderId].Value("consMobilePhone");
             var decryptTelePhone = decryptMobileResponse.Json["jingdong_pop_order_getmobilelist_responce"]["result"]["data"][decryptConsigneeRequest.OrderId].Value("customerPhone");
-
+            */
             return new ConsigneeSimpleResponse()
             {
                 Address = decryptAddress,
                 ContactName = decryptContactName,
-                Mobile = decryptMobile,
-                TelePhone = decryptTelePhone
+                //Mobile = decryptMobile,
+                //TelePhone = decryptTelePhone
             };
         }
 
diff --git a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
index 6f1f0e4f..e2e26e5d 100644
--- a/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/PDDBusiness.cs
@@ -1,4 +1,6 @@
-using Microsoft.Extensions.Caching.Memory;
+using BBWY.Server.Model;
+using Microsoft.Extensions.Caching.Memory;
+using NLog;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -7,7 +9,8 @@ namespace BBWY.Server.Business
 {
     public class PDDBusiness : PlatformSDKBusiness
     {
-        public PDDBusiness(IMemoryCache memoryCache) : base(memoryCache)
+        public override Enums.Platform Platform => Enums.Platform.拼多多;
+        public PDDBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger)
         {
         }
     }
diff --git a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
index 8c969ddb..c883ec10 100644
--- a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs
@@ -2,6 +2,7 @@
 using BBWY.Server.Model.Dto;
 using Microsoft.Extensions.Caching.Memory;
 using Newtonsoft.Json.Linq;
+using NLog;
 using System;
 using System.Collections.Generic;
 
@@ -11,16 +12,20 @@ namespace BBWY.Server.Business
     {
         protected IMemoryCache memoryCache;
 
-        protected TimeSpan expirationTimeSpan = TimeSpan.FromMinutes(60);
+        protected TimeSpan expirationTimeSpan;
 
         /// 
         /// 产品平台
         /// 
         public virtual Enums.Platform Platform { get; }
 
-        public PlatformSDKBusiness(IMemoryCache memoryCache)
+        protected ILogger logger;
+
+        public PlatformSDKBusiness(IMemoryCache memoryCache, ILogger logger)
         {
             this.memoryCache = memoryCache;
+            this.logger = logger;
+            this.expirationTimeSpan = TimeSpan.FromMinutes(60);
         }
 
         public virtual ProductListResponse GetProductList(SearchProductRequest searchProductRequest)
@@ -67,5 +72,16 @@ namespace BBWY.Server.Business
         {
             throw new NotImplementedException();
         }
+
+        public virtual PreviewOrderResponse PreviewOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            throw new NotImplementedException();
+        }
+
+        public virtual CreateOnlinePurchaseOrderResponse FastCreateOrder(CreateOnlinePurchaseOrderRequest createOnlinePurchaseOrderRequest)
+        {
+            throw new NotImplementedException();
+        }
+
     }
 }
diff --git a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
index c143488c..b5873afb 100644
--- a/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
+++ b/BBWY.Server.Business/PlatformSDK/TaoBaoBusiness.cs
@@ -1,5 +1,6 @@
 using BBWY.Server.Model;
 using Microsoft.Extensions.Caching.Memory;
+using NLog;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -8,10 +9,10 @@ namespace BBWY.Server.Business
 {
     public class TaoBaoBusiness : PlatformSDKBusiness
     {
-        public override Enums.Platform Platform => Enums.Platform.淘宝;
-
-        public TaoBaoBusiness(IMemoryCache memoryCache) : base(memoryCache)
+        public TaoBaoBusiness(IMemoryCache memoryCache, ILogger logger) : base(memoryCache, logger)
         {
         }
+
+        public override Enums.Platform Platform => Enums.Platform.淘宝;
     }
 }
diff --git a/BBWY.Server.Business/PlatformSDK/_1688Business.cs b/BBWY.Server.Business/PlatformSDK/_1688Business.cs
new file mode 100644
index 00000000..526fcf79
--- /dev/null
+++ b/BBWY.Server.Business/PlatformSDK/_1688Business.cs
@@ -0,0 +1,212 @@
+using BBWY._1688SDK.entity.OrderPreview;
+using BBWY.Common.Http;
+using BBWY.Common.Models;
+using BBWY.Server.Model;
+using BBWY.Server.Model.Db;
+using BBWY.Server.Model.Dto;
+using com.alibaba.openapi.client;
+using com.alibaba.openapi.client.policy;
+using Microsoft.Extensions.Caching.Memory;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace BBWY.Server.Business
+{
+    public class _1688Business : PlatformSDKBusiness
+    {
+        public override Enums.Platform Platform => Enums.Platform.阿里巴巴;
+        private RestApiService restApiService;
+        private _1688TradeTypeCompare _1688TradeTypeCompare;
+
+        public _1688Business(IMemoryCache memoryCache, ILogger logger, RestApiService restApiService) : base(memoryCache, logger)
+        {
+            this.restApiService = restApiService;
+            _1688TradeTypeCompare = new _1688TradeTypeCompare();
+        }
+
+        private SyncAPIClient GetSyncAPIClient(string appKey, string appSecret)
+        {
+            if (!memoryCache.TryGetValue(appKey, out SyncAPIClient syncAPIClient))
+            {
+                syncAPIClient = new SyncAPIClient(appKey, appSecret, restApiService);
+                memoryCache.Set(appKey, syncAPIClient, expirationTimeSpan);
+            }
+            return syncAPIClient;
+        }
+
+        public override PreviewOrderResponse PreviewOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            var client = GetSyncAPIClient(previewOrderReuqest.AppKey, previewOrderReuqest.AppSecret);
+            RequestPolicy reqPolicy = new RequestPolicy();
+            reqPolicy.HttpMethod = "POST";
+            reqPolicy.NeedAuthorization = false;
+            reqPolicy.RequestSendTimestamp = false;
+            reqPolicy.UseHttps = false;
+            reqPolicy.UseSignture = true;
+            reqPolicy.AccessPrivateApi = false;
+
+            Request request = new Request();
+            APIId apiId = new APIId();
+            apiId.Name = "alibaba.createOrder.preview";
+            apiId.NamespaceValue = "com.alibaba.trade";
+            apiId.Version = 1;
+            request.ApiId = apiId;
+
+            var param = new CreateOrderPreview()
+            {
+                addressParam = new AddressParam()
+                {
+                    fullName = previewOrderReuqest.Consignee.ContactName,
+                    mobile = previewOrderReuqest.Consignee.Mobile,
+                    phone = previewOrderReuqest.Consignee.TelePhone,
+                    postCode = "000000",
+                    address = previewOrderReuqest.Consignee.Address,
+                    provinceText = previewOrderReuqest.Consignee.Province,
+                    cityText = previewOrderReuqest.Consignee.City,
+                    areaText = previewOrderReuqest.Consignee.County,
+                    townText = previewOrderReuqest.Consignee.Town
+                },
+                cargoParamList = new List(),
+                flow = previewOrderReuqest.PurchaseOrderMode == Enums.PurchaseOrderMode.批发 ? "general" : "saleproxy"
+            };
+            foreach (var cargo in previewOrderReuqest.CargoParamList)
+            {
+                param.cargoParamList.Add(new CargoParam()
+                {
+                    offerId = long.Parse(cargo.ProductId),
+                    specId = cargo.SpecId,
+                    quantity = cargo.Quantity
+                });
+            }
+            request.RequestEntity = param;
+            if (!string.IsNullOrEmpty(previewOrderReuqest.AppToken))
+                request.AccessToken = previewOrderReuqest.AppToken;
+            var result = client.NewRequest(request, reqPolicy);
+            if (result.Value("success") != true)
+                throw new BusinessException(result.Value("errorMsg")) { Code = 0 };
+
+            var orderPreviewResuslt = (JArray)result["orderPreviewResuslt"];
+            List intersectTradeModeList = new List();
+
+            foreach (var orderPreviewJToken in orderPreviewResuslt)
+            {
+                if (orderPreviewJToken["tradeModelList"] == null)
+                    throw new BusinessException("当前交易不可通过API下单,请使用1688网页交易 [交易模式列表为空]");
+                var tradeModeJArray = ((JArray)orderPreviewJToken["tradeModelList"]).Where(tradeJToken => tradeJToken.Value("opSupport"));
+                if (tradeModeJArray.Count() == 0)
+                    throw new BusinessException("当前交易不可通过API下单,请使用1688网页交易 [没有支持开放平台下单的交易模式]");
+
+                if (intersectTradeModeList.Count() == 0)
+                    intersectTradeModeList.AddRange(tradeModeJArray);
+                else
+                    intersectTradeModeList = intersectTradeModeList.Intersect(tradeModeJArray, _1688TradeTypeCompare).ToList();
+            }
+
+            if (intersectTradeModeList.Count() == 0)
+                throw new BusinessException("当前交易不可通过API下单,请使用1688网页交易 [多个拆单之间没有相同的交易模式]");
+            return new PreviewOrderResponse()
+            {
+                FreightAmount = orderPreviewResuslt.Sum(jt => jt.Value("sumCarriage")) / 100M,
+                ProductAmount = orderPreviewResuslt.Sum(jt => jt.Value("sumPaymentNoCarriage")) / 100M,
+                TotalAmount = orderPreviewResuslt.Sum(jt => jt.Value("sumPayment")) / 100M,
+                OrderTradeType = new OrderTradeTypeResponse()
+                {
+                    Code = intersectTradeModeList.First().Value("tradeType"),
+                    Name = intersectTradeModeList.First().Value("name"),
+                }
+            };
+        }
+
+        public override CreateOnlinePurchaseOrderResponse FastCreateOrder(CreateOnlinePurchaseOrderRequest createOnlinePurchaseOrderRequest)
+        {
+            var client = GetSyncAPIClient(createOnlinePurchaseOrderRequest.AppKey, createOnlinePurchaseOrderRequest.AppSecret);
+            RequestPolicy reqPolicy = new RequestPolicy();
+            reqPolicy.HttpMethod = "POST";
+            reqPolicy.NeedAuthorization = false;
+            reqPolicy.RequestSendTimestamp = false;
+            reqPolicy.UseHttps = false;
+            reqPolicy.UseSignture = true;
+            reqPolicy.AccessPrivateApi = false;
+
+            Request request = new Request();
+            APIId apiId = new APIId();
+            apiId.Name = "alibaba.trade.fastCreateOrder";
+            apiId.NamespaceValue = "com.alibaba.trade";
+            apiId.Version = 1;
+            request.ApiId = apiId;
+
+            var param = new
+            {
+                flow = createOnlinePurchaseOrderRequest.PurchaseOrderMode == Enums.PurchaseOrderMode.批发 ? "general" : "saleproxy",
+                message = createOnlinePurchaseOrderRequest.Remark,
+                addressParam = new
+                {
+                    fullName = createOnlinePurchaseOrderRequest.Consignee.ContactName,
+                    mobile = createOnlinePurchaseOrderRequest.Consignee.Mobile,
+                    phone = createOnlinePurchaseOrderRequest.Consignee.Mobile,
+                    cityText = createOnlinePurchaseOrderRequest.Consignee.City,
+                    provinceText = createOnlinePurchaseOrderRequest.Consignee.Province,
+                    areaText = createOnlinePurchaseOrderRequest.Consignee.County,
+                    townText = createOnlinePurchaseOrderRequest.Consignee.Town,
+                    address = createOnlinePurchaseOrderRequest.Consignee.Address
+                },
+                cargoParamList = createOnlinePurchaseOrderRequest.CargoParamList.Select(cargo => new
+                {
+                    offerId = long.Parse(cargo.ProductId),
+                    specId = cargo.SpecId,
+                    quantity = cargo.Quantity
+                }),
+                tradeType = createOnlinePurchaseOrderRequest.TradeMode
+            };
+
+            request.RequestEntity = param;
+            if (!string.IsNullOrEmpty(createOnlinePurchaseOrderRequest.AppToken))
+                request.AccessToken = createOnlinePurchaseOrderRequest.AppToken;
+            var result = client.NewRequest(request, reqPolicy);
+            if (result.Value("success") != true)
+                throw new BusinessException(result.Value("errorMsg")) { Code = 0 };
+
+            var totalSuccessAmount = result["result"].Value("totalSuccessAmount") / 100M; //采购单总金额,单位分
+            var purchaseOrderId = result["result"].Value("orderId"); //采购单号
+            var postFee = result["result"].Value("postFee") / 100M;  //采购单运费,单位分
+            var purchaseAmount = totalSuccessAmount - postFee;  //采购成本
+
+            var failedOfferJArray = result["failedOfferList"] != null ? (JArray)result["failedOfferList"] : null;
+            if (failedOfferJArray != null)
+            {
+                StringBuilder failOrderStringBuilder = new StringBuilder();
+                foreach (var failedOfferJToken in failedOfferJArray)
+                    failOrderStringBuilder.AppendLine(failedOfferJToken.ToString());
+                var ex = new Exception(failOrderStringBuilder.ToString());
+                logger.Error(ex, $"下单部分商品失败 采购单Id{purchaseOrderId} 请求参数{JsonConvert.SerializeObject(createOnlinePurchaseOrderRequest)}");
+            }
+
+            return new CreateOnlinePurchaseOrderResponse()
+            {
+                TotalAmount = totalSuccessAmount,
+                ProductAmount = purchaseAmount,
+                FreightAmount = postFee,
+                PurchaseOrderId = purchaseOrderId,
+                FailProductMessageList = failedOfferJArray == null ? null : failedOfferJArray.Select(failedOfferJToken => failedOfferJToken.ToString()).ToList()
+            };
+        }
+    }
+
+    public class _1688TradeTypeCompare : IEqualityComparer
+    {
+        public bool Equals(JToken x, JToken y)
+        {
+            return x.Value("tradeType").Equals(y.Value("tradeType"));
+        }
+
+        public int GetHashCode(JToken obj)
+        {
+            return obj.GetHashCode();
+        }
+    }
+}
diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
index bd68fe02..c717fe86 100644
--- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
+++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
@@ -2,15 +2,21 @@
 using BBWY.Common.Models;
 using BBWY.Server.Model.Db;
 using BBWY.Server.Model.Dto;
+using FreeSql;
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Yitter.IdGenerator;
 
 namespace BBWY.Server.Business
 {
     public class PurchaseOrderBusiness : BaseBusiness, IDenpendency
     {
-        public PurchaseOrderBusiness(IFreeSql fsql, NLog.ILogger logger, IIdGenerator idGenerator) : base(fsql, logger, idGenerator) { }
+        private IEnumerable platformSDKBusinessList;
+        public PurchaseOrderBusiness(IFreeSql fsql, NLog.ILogger logger, IIdGenerator idGenerator, IEnumerable platformSDKBusinessList) : base(fsql, logger, idGenerator)
+        {
+            this.platformSDKBusinessList = platformSDKBusinessList;
+        }
 
         public void AddPurchaseOrder(AddPurchaseOrderRequest addPurchaseOrderRequest)
         {
@@ -57,5 +63,129 @@ namespace BBWY.Server.Business
         {
             fsql.Delete(id).ExecuteAffrows();
         }
+
+        public PreviewOrderResponse PreviewPurchaseOrder(PreviewOrderReuqest previewOrderReuqest)
+        {
+            if (previewOrderReuqest.Platform != Model.Enums.Platform.阿里巴巴)
+                throw new NotImplementedException();
+            return platformSDKBusinessList.FirstOrDefault(p => p.Platform == previewOrderReuqest.Platform).PreviewOrder(previewOrderReuqest);
+        }
+
+        public void FastCreateOrder(CreateOnlinePurchaseOrderRequest createOnlinePurchaseOrderRequest)
+        {
+            if (createOnlinePurchaseOrderRequest.Platform != Model.Enums.Platform.阿里巴巴)
+                throw new NotImplementedException();
+            var dbOrder = fsql.Select(createOnlinePurchaseOrderRequest.OrderId).ToOne();
+            if (dbOrder == null)
+                throw new BusinessException("订单不存在");
+            if (dbOrder.OrderState != Model.Enums.OrderState.等待采购)
+                throw new BusinessException("只能为等待采购的订单进行采购");
+            var orderSku = fsql.Select().Where(osku => osku.OrderId == createOnlinePurchaseOrderRequest.OrderId).ToOne();
+            if (orderSku == null)
+                throw new BusinessException("订单Sku不存在");
+
+            var createOrderResponse = platformSDKBusinessList.FirstOrDefault(p => p.Platform == createOnlinePurchaseOrderRequest.Platform)
+                                                             .FastCreateOrder(createOnlinePurchaseOrderRequest);
+
+            IInsert insertPurchaseOrder = null;
+            IInsert insertOrderCostDetail = null;
+            IInsert insertOrderCost = null;
+            IInsert insertOrderDropShipping = null;
+
+            #region 采购单
+            var purchaseOrder = new PurchaseOrder()
+            {
+                Id = idGenerator.NewLong(),
+                CreateTime = DateTime.Now,
+                ProductId = orderSku.ProductId,
+                SkuId = orderSku.SkuId,
+                PurchaseMethod = Model.Enums.PurchaseMethod.线上采购,
+                PurchaseOrderId = createOrderResponse.PurchaseOrderId,
+                PurchasePlatform = createOnlinePurchaseOrderRequest.Platform,
+                PurchaseQuantity = orderSku.ItemTotal.Value,
+                RemainingQuantity = 0,
+                ShopId = createOnlinePurchaseOrderRequest.ShopId,
+                SingleConsumableAmount = 0,
+                SingleDeliveryFreight = 0,
+                SingleFirstFreight = 0,
+                SingleStorageAmount = 0,
+                SingleOperationAmount = 0,
+                SingleSkuAmount = createOrderResponse.ProductAmount / orderSku.ItemTotal.Value,
+                SingleFreight = createOrderResponse.FreightAmount / orderSku.ItemTotal.Value,
+                StorageType = Model.Enums.StorageType.代发
+            };
+            insertPurchaseOrder = fsql.Insert(purchaseOrder);
+            #endregion
+
+            #region 成本明细
+            var orderCostDetail = new OrderCostDetail()
+            {
+                Id = idGenerator.NewLong(),
+                ConsumableAmount = 0,
+                CreateTime = DateTime.Now,
+                DeductionQuantity = orderSku.ItemTotal.Value,
+                DeliveryExpressFreight = 0,
+                FirstFreight = 0,
+                OperationAmount = 0,
+                OrderId = createOnlinePurchaseOrderRequest.OrderId,
+                ProductId = orderSku.ProductId,
+                PurchaseFreight = createOrderResponse.FreightAmount,
+                PurchaseOrderPKId = purchaseOrder.Id,
+                SkuAmount = createOrderResponse.ProductAmount,
+                SkuId = orderSku.SkuId,
+                StorageAmount = 0,
+                UnitCost = purchaseOrder.UnitCost,
+                TotalCost = createOrderResponse.TotalAmount //purchaseOrder.UnitCost * orderSku.ItemTotal.Value
+            };
+            insertOrderCostDetail = fsql.Insert(orderCostDetail);
+            #endregion
+
+            #region 订单成本
+            var orderCost = new OrderCost()
+            {
+                OrderId = orderSku.OrderId,
+                CreateTime = DateTime.Now,
+                DeliveryExpressFreight = 0,
+                IsManualEdited = false,
+                PlatformCommissionRatio = 0.05M,
+                PreferentialAmount = dbOrder.PreferentialAmount,
+                SDCommissionAmount = 0,
+                PurchaseAmount = createOrderResponse.TotalAmount
+            };
+            orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * orderCost.PlatformCommissionRatio;
+            orderCost.Profit = dbOrder.OrderSellerPrice +
+                               dbOrder.FreightPrice -
+                               orderCost.PurchaseAmount -
+                               orderCost.DeliveryExpressFreight -
+                               orderCost.PlatformCommissionAmount;
+            insertOrderCost = fsql.Insert(orderCost);
+            #endregion
+
+            #region 采购信息
+            var orderDropShipping = new OrderDropShipping()
+            {
+                OrderId = createOnlinePurchaseOrderRequest.OrderId,
+                BuyerAccount = createOnlinePurchaseOrderRequest.BuyerAccount,
+                SellerAccount = createOnlinePurchaseOrderRequest.SellerAccount,
+                CreateTime = DateTime.Now,
+                DeliveryFreight = 0,
+                PurchaseAmount = createOrderResponse.TotalAmount,
+                PurchaseOrderId = createOrderResponse.PurchaseOrderId,
+                PurchasePlatform = createOnlinePurchaseOrderRequest.Platform
+            };
+            insertOrderDropShipping = fsql.Insert(orderDropShipping);
+            #endregion
+
+            fsql.Transaction(() =>
+            {
+                insertPurchaseOrder.ExecuteAffrows();
+                insertOrderCostDetail.ExecuteAffrows();
+                insertOrderCost.ExecuteAffrows();
+                insertOrderDropShipping.ExecuteAffrows();
+                fsql.Update(createOnlinePurchaseOrderRequest.OrderId).Set(o => o.OrderState, Model.Enums.OrderState.待出库)
+                                                                            .Set(o => o.StorageType, Model.Enums.StorageType.代发)
+                                                                            .ExecuteAffrows();
+            });
+        }
     }
 }
diff --git a/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs b/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs
index b4e83dbf..595eb4ba 100644
--- a/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs
+++ b/BBWY.Server.Business/PurchaseScheme/PurchaseSchemeBusiness.cs
@@ -29,6 +29,15 @@ namespace BBWY.Server.Business
         {
             if (batchCURDSchemeRequest.EditPurchaseSchemeList.Count == 0 && batchCURDSchemeRequest.AddPurchaseSchemeList.Count == 0)
                 throw new BusinessException("非法参数");
+            if (batchCURDSchemeRequest.AddPurchaseSchemeList.Any(p => string.IsNullOrEmpty(p.PurchaserId) || 
+                                                                      string.IsNullOrEmpty(p.PurchaserName) ||
+                                                                      string.IsNullOrEmpty(p.PurchaserLocation)))
+                throw new BusinessException("新增方案中有采购商Id/Name/Location为空");
+
+            if (batchCURDSchemeRequest.AddPurchaseSchemeList.Any(p => string.IsNullOrEmpty(p.PurchaserId) ||
+                                                                      string.IsNullOrEmpty(p.PurchaserName) ||
+                                                                      string.IsNullOrEmpty(p.PurchaserLocation)))
+                throw new BusinessException("编辑方案中有采购商Id/Name/Location为空");
 
             List addPurchaseSchemeList = null;
             List addPurchaseSchemeProductList = new List();
diff --git a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
index 1e886422..7d379c78 100644
--- a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
+++ b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
@@ -19,13 +19,13 @@ namespace BBWY.Server.Business
 
         public OrderAchievementResponse GetOrderAchievementStatistics(OrderAchievementRequest request)
         {
-            request.EndTime = request.EndTime.Date.AddDays(1);
+            request.EndTime = request.EndTime.Date.AddDays(1).AddSeconds(-1);
             var response = fsql.Select().LeftJoin((o, oc) => o.Id == oc.OrderId)
                                                           .Where((o, oc) => o.ShopId == request.ShopId &&
                                                                             o.OrderState != null &&
                                                                             !invalidOrderStateList.Contains(o.OrderState.Value) &&
                                                                             o.StartTime >= request.StartTime &&
-                                                                            o.StartTime < request.EndTime)
+                                                                            o.StartTime <= request.EndTime)
                                                          .ToAggregate((o, oc) => new OrderAchievementResponse()
                                                          {
                                                              OrderCount = o.Count(),
diff --git a/BBWY.Server.Business/Vender/VenderBusiness.cs b/BBWY.Server.Business/Vender/VenderBusiness.cs
index 32e49b6c..d93417c3 100644
--- a/BBWY.Server.Business/Vender/VenderBusiness.cs
+++ b/BBWY.Server.Business/Vender/VenderBusiness.cs
@@ -20,7 +20,7 @@ namespace BBWY.Server.Business
         public VenderResponse GetVenderInfo(PlatformRequest platformRequest)
         {
             var relayAPIHost = GetPlatformRelayAPIHost(platformRequest.Platform);
-            var sendResult = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetVenderInfo", platformRequest, null, System.Net.Http.HttpMethod.Post);
+            var sendResult = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetVenderInfo", platformRequest, null, HttpMethod.Post);
             if (sendResult.StatusCode != System.Net.HttpStatusCode.OK)
                 throw new BusinessException(sendResult.Content) { Code = (int)sendResult.StatusCode };
             var response = JsonConvert.DeserializeObject>(sendResult.Content);
diff --git a/BBWY.Server.Model/Db/Order/Order.cs b/BBWY.Server.Model/Db/Order/Order.cs
index e5d467e9..5e5f8f9e 100644
--- a/BBWY.Server.Model/Db/Order/Order.cs
+++ b/BBWY.Server.Model/Db/Order/Order.cs
@@ -116,6 +116,9 @@ namespace BBWY.Server.Model.Db
 
         public string VenderRemark { get; set; }
 
+
+        public string PurchaseRemark { get; set; }
+
         /// 
         /// 仓库Id
         /// 
diff --git a/BBWY.Server.Model/Db/Order/OrderDropShipping.cs b/BBWY.Server.Model/Db/Order/OrderDropShipping.cs
index f7651ae1..557ec12f 100644
--- a/BBWY.Server.Model/Db/Order/OrderDropShipping.cs
+++ b/BBWY.Server.Model/Db/Order/OrderDropShipping.cs
@@ -17,7 +17,7 @@ namespace BBWY.Server.Model.Db
         /// 
         /// 买家账号
         /// 
-        [Column(StringLength = 50)]
+        [Column(StringLength = 200)]
         public string BuyerAccount { get; set; }
 
         [Column(DbType = "datetime")]
@@ -38,7 +38,7 @@ namespace BBWY.Server.Model.Db
         /// 
         /// 采购单号
         /// 
-        [Column(StringLength = 50)]
+        [Column(StringLength = 200)]
         public string PurchaseOrderId { get; set; }
 
         /// 
@@ -50,7 +50,7 @@ namespace BBWY.Server.Model.Db
         /// 
         /// 卖家账号
         /// 
-        [Column(StringLength = 50)]
+        [Column(StringLength = 200)]
         public string SellerAccount { get; set; }
 
     }
diff --git a/BBWY.Server.Model/Db/Order/OrderSyncTask.cs b/BBWY.Server.Model/Db/Order/OrderSyncTask.cs
new file mode 100644
index 00000000..e80d36e8
--- /dev/null
+++ b/BBWY.Server.Model/Db/Order/OrderSyncTask.cs
@@ -0,0 +1,28 @@
+using FreeSql.DataAnnotations;
+using System;
+
+namespace BBWY.Server.Model.Db
+{
+
+    [Table(Name = "ordersynctask", DisableSyncStructure = true)]
+    public partial class OrderSyncTask
+    {
+
+        [Column(DbType = "bigint(1)", IsPrimary = true)]
+        public long Id { get; set; }
+
+        [Column(DbType = "bigint(1)")]
+        public long ShopId { get; set; }
+
+        [Column(DbType = "int(1)", MapType = typeof(int))]
+        public Enums.OrderSyncState State { get; set; }
+
+        [Column(DbType = "datetime")]
+        public DateTime SyncEndTime { get; set; }
+
+        [Column(DbType = "datetime")]
+        public DateTime SyncStartTime { get; set; }
+
+    }
+
+}
diff --git a/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs b/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs
index fd730ea0..9352327f 100644
--- a/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs
+++ b/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs
@@ -29,6 +29,9 @@ namespace BBWY.Server.Model.Db
         //[Column(DbType = "decimal(20,2)")]
         //public decimal Freight { get; set; } = 0.00M;
 
+        /// 
+        /// 产品Id
+        /// 
         [Column(StringLength = 50)]
         public string ProductId { get; set; }
 
diff --git a/BBWY.Server.Model/Dto/Request/Order/SyncOrderByDateRequest.cs b/BBWY.Server.Model/Dto/Request/Order/SyncOrderByDateRequest.cs
new file mode 100644
index 00000000..04a8b3af
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/Order/SyncOrderByDateRequest.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class SyncOrderByDateRequest
+    {
+        public long ShopId { get; set; }
+
+        public DateTime StartTime { get; set; }
+
+        public DateTime EndTime { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs
new file mode 100644
index 00000000..6f6f13df
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CargoParamRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class CargoParamRequest
+    {
+        public string ProductId { get; set; }
+        public string SkuId { get; set; }
+        public string SpecId { get; set; }
+        public int Quantity { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs
new file mode 100644
index 00000000..320e8ef5
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/ConsigneeRequest.cs
@@ -0,0 +1,43 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class ConsigneeRequest
+    {
+        /// 
+        /// 联系人名称
+        /// 
+        public string ContactName { get; set; }
+
+        /// 
+        /// 座机
+        /// 
+        public string TelePhone { get; set; }
+
+        /// 
+        /// 手机
+        /// 
+        public string Mobile { get; set; }
+
+        public string Address { get; set; }
+
+        /// 
+        /// 省
+        /// 
+        public string Province { get; set; }
+
+        /// 
+        /// 市
+        /// 
+        public string City { get; set; }
+
+        /// 
+        /// 县
+        /// 
+        public string County { get; set; }
+
+        /// 
+        /// 镇
+        /// 
+        public string Town { get; set; }
+
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs
new file mode 100644
index 00000000..a73ba736
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs
@@ -0,0 +1,32 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class CreateOnlinePurchaseOrderRequest : PreviewOrderReuqest
+    {
+        /// 
+        /// 下单模式
+        /// 
+        public string TradeMode { get; set; }
+
+        /// 
+        /// 采购单留言
+        /// 
+        public string Remark { get; set; }
+
+        /// 
+        /// 店铺订单Id
+        /// 
+        public string OrderId { get; set; }
+
+        /// 
+        /// 店铺Id
+        /// 
+        public long ShopId { get; set; }
+
+        /// 
+        /// 买家账号
+        /// 
+        public string BuyerAccount { get; set; }
+
+        public string SellerAccount { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs
new file mode 100644
index 00000000..23d13394
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/PreviewOrderReuqest.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class PreviewOrderReuqest: PlatformRequest
+    {
+        /// 
+        /// 订单模式
+        /// 1688 general大市场订单 saleproxy分销订单
+        /// 
+        public Enums.PurchaseOrderMode PurchaseOrderMode { get; set; }
+
+        public ConsigneeRequest Consignee { get; set; }
+
+        public IList CargoParamList { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs b/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
index b0643a61..3c9b1d79 100644
--- a/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
+++ b/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
@@ -92,6 +92,11 @@ namespace BBWY.Server.Model.Dto
         /// 
         public string VenderRemark { get; set; }
 
+        /// 
+        /// 采购备注
+        /// 
+        public string PurchaseRemark { get; set; }
+
         public Enums.StorageType? StorageType { get; set; }
 
         /// 
diff --git a/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderResponse.cs b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderResponse.cs
new file mode 100644
index 00000000..3517a7a7
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderResponse.cs
@@ -0,0 +1,30 @@
+using System.Collections.Generic;
+
+namespace BBWY.Server.Model.Dto
+{
+    public class CreateOnlinePurchaseOrderResponse
+    {
+
+        public string PurchaseOrderId { get; set; }
+
+        /// 
+        /// 订单总额
+        /// 
+        public decimal TotalAmount { get; set; }
+
+        /// 
+        /// 货款总额
+        /// 
+        public decimal ProductAmount { get; set; }
+
+        /// 
+        /// 运费总额
+        /// 
+        public decimal FreightAmount { get; set; }
+
+        /// 
+        /// 下单失败的商品信息
+        /// 
+        public IList FailProductMessageList { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs
new file mode 100644
index 00000000..1ad9b62b
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/OrderTradeTypeResponse.cs
@@ -0,0 +1,9 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class OrderTradeTypeResponse
+    {
+        public string Code { get; set; }
+
+        public string Name { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
new file mode 100644
index 00000000..e69eeead
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
@@ -0,0 +1,25 @@
+namespace BBWY.Server.Model.Dto
+{
+    public class PreviewOrderResponse
+    {
+        /// 
+        /// 总额
+        /// 
+        public decimal TotalAmount { get; set; }
+
+        /// 
+        /// 货款总额
+        /// 
+        public decimal ProductAmount { get; set; }
+
+        /// 
+        /// 运费
+        /// 
+        public decimal FreightAmount { get; set; }
+
+        /// 
+        /// 支持的交易方式
+        /// 
+        public OrderTradeTypeResponse OrderTradeType { get; set; }
+    }
+}
diff --git a/BBWY.Server.Model/Enums.cs b/BBWY.Server.Model/Enums.cs
index 59a0570a..6e767a6f 100644
--- a/BBWY.Server.Model/Enums.cs
+++ b/BBWY.Server.Model/Enums.cs
@@ -22,6 +22,15 @@
             线下采购 = 1
         }
 
+        /// 
+        /// 采购单模式
+        /// 
+        public enum PurchaseOrderMode
+        {
+            批发 = 0,
+            代发 = 1
+        }
+
         /// 
         /// 仓储类型
         /// 
@@ -83,5 +92,14 @@
             精准打标 = 1,
             京礼金 = 2
         }
+
+        /// 
+        /// 订单同步任务状态
+        /// 
+        public enum OrderSyncState
+        {
+            Running = 0,
+            End = 1
+        }
     }
 }
diff --git a/BBWY.sln b/BBWY.sln
index 77d29a96..d545c4d3 100644
--- a/BBWY.sln
+++ b/BBWY.sln
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31808.319
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30225.117
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BBWY.Client", "BBWY.Client\BBWY.Client.csproj", "{04DAF636-2630-45BB-BEFA-264EC273E920}"
 EndProject
@@ -30,6 +30,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		.editorconfig = .editorconfig
 	EndProjectSection
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BBWY.1688SDK", "BBWY.1688SDK\BBWY.1688SDK.csproj", "{1A7EB438-5DEF-4940-8CB2-C58141C75524}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -68,6 +70,10 @@ Global
 		{2DC24A1B-EFE0-4F9D-8A9A-A6B530696E17}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{2DC24A1B-EFE0-4F9D-8A9A-A6B530696E17}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{2DC24A1B-EFE0-4F9D-8A9A-A6B530696E17}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1A7EB438-5DEF-4940-8CB2-C58141C75524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1A7EB438-5DEF-4940-8CB2-C58141C75524}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1A7EB438-5DEF-4940-8CB2-C58141C75524}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1A7EB438-5DEF-4940-8CB2-C58141C75524}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -80,6 +86,7 @@ Global
 		{5FC60547-0934-4AAD-921B-F4DA03C9F47D} = {B545F3FA-E6A7-4CB1-B92D-801C66357CF5}
 		{E38A95F5-05E6-4856-811C-30D7A1B77C68} = {B545F3FA-E6A7-4CB1-B92D-801C66357CF5}
 		{2DC24A1B-EFE0-4F9D-8A9A-A6B530696E17} = {B131026A-2025-4A74-ABF1-644059FADF78}
+		{1A7EB438-5DEF-4940-8CB2-C58141C75524} = {B131026A-2025-4A74-ABF1-644059FADF78}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {CC045257-4D86-45FD-A1F0-2715C024F1B5}