From 3f4b74dd7104c93b9f3e8fce9635bbcaa49658f8 Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Tue, 25 Apr 2023 01:53:40 +0800
Subject: [PATCH] 1
---
BBWY.Server.API/BBWY.Server.API.csproj | 4 +
.../AfterSaleOrderSyncController.cs | 27 --
.../BBWY.Server.Business.csproj | 9 +
.../BillCorrection/BillCorrectionBusiness.cs | 29 +-
.../EvaluationAssistantBusiness.cs | 370 ++++++++++++------
.../Extensions/OrderCostExtension.cs | 85 +++-
BBWY.Server.Business/Order/OrderBusiness.cs | 28 +-
.../Statistics/StatisticsBusiness.cs | 3 +-
.../Sync/OrderSyncBusiness.cs | 6 +-
BBWY.Server.Model/BBWY.Server.Model.csproj | 10 +
.../Dto/Response/Order/OrderResponse.cs | 8 +-
11 files changed, 374 insertions(+), 205 deletions(-)
delete mode 100644 BBWY.Server.API/Controllers/AfterSaleOrderSyncController.cs
diff --git a/BBWY.Server.API/BBWY.Server.API.csproj b/BBWY.Server.API/BBWY.Server.API.csproj
index 65f647df..ce58b62a 100644
--- a/BBWY.Server.API/BBWY.Server.API.csproj
+++ b/BBWY.Server.API/BBWY.Server.API.csproj
@@ -5,6 +5,10 @@
True
+
+
+
+
diff --git a/BBWY.Server.API/Controllers/AfterSaleOrderSyncController.cs b/BBWY.Server.API/Controllers/AfterSaleOrderSyncController.cs
deleted file mode 100644
index 8614924f..00000000
--- a/BBWY.Server.API/Controllers/AfterSaleOrderSyncController.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using BBWY.Server.Business;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-
-namespace BBWY.Server.API.Controllers
-{
-
- public class AfterSaleOrderSyncController : BaseApiController
- {
- private AfterSaleOrderSyncBusiness afterSaleOrderSyncBusiness;
-
- public AfterSaleOrderSyncController(IHttpContextAccessor httpContextAccessor,
- AfterSaleOrderSyncBusiness afterSaleOrderSyncBusiness) : base(httpContextAccessor)
- {
- this.afterSaleOrderSyncBusiness = afterSaleOrderSyncBusiness;
- }
-
- ///
- /// 全店同步售后订单
- ///
- [HttpPost]
- public void SyncAllShopAfterOrder()
- {
- afterSaleOrderSyncBusiness.SyncAllShopAfterOrder();
- }
- }
-}
diff --git a/BBWY.Server.Business/BBWY.Server.Business.csproj b/BBWY.Server.Business/BBWY.Server.Business.csproj
index 2fbbac4b..61b19159 100644
--- a/BBWY.Server.Business/BBWY.Server.Business.csproj
+++ b/BBWY.Server.Business/BBWY.Server.Business.csproj
@@ -5,6 +5,11 @@
True
+
+
+
+
+
@@ -22,4 +27,8 @@
+
+
+
+
diff --git a/BBWY.Server.Business/BillCorrection/BillCorrectionBusiness.cs b/BBWY.Server.Business/BillCorrection/BillCorrectionBusiness.cs
index 5bc104d9..b3893b1e 100644
--- a/BBWY.Server.Business/BillCorrection/BillCorrectionBusiness.cs
+++ b/BBWY.Server.Business/BillCorrection/BillCorrectionBusiness.cs
@@ -53,19 +53,19 @@ namespace BBWY.Server.Business
var sdOrderCostList = fsql.Select(sdOrderIds).ToList();
- var afterOrderList = fsql.Select()
- .Where(aso => orderIds.Contains(aso.OrderId))
- .GroupBy(aso => aso.OrderId)
- .ToList(g => new
- {
- OrderId = g.Key,
- AfterTotalCost = g.Sum(g.Value.AfterTotalCost)
- });
+ //var afterOrderList = fsql.Select()
+ // .Where(aso => orderIds.Contains(aso.OrderId))
+ // .GroupBy(aso => aso.OrderId)
+ // .ToList(g => new
+ // {
+ // OrderId = g.Key,
+ // AfterTotalCost = g.Sum(g.Value.AfterTotalCost)
+ // });
foreach (var order in orderList)
{
var orderCostDetail = orderCostDetailList.FirstOrDefault(ocd => ocd.OrderId == order.OrderId);
- var afterOrder = afterOrderList.FirstOrDefault(aso => aso.OrderId == order.OrderId);
+ //var afterOrder = afterOrderList.FirstOrDefault(aso => aso.OrderId == order.OrderId);
order.DeliveryExpressFreight = orderCostDetail?.DeliveryExpressFreight ?? 0M;
order.SkuAmount = orderCostDetail?.SkuAmount ?? 0M;
@@ -75,7 +75,7 @@ namespace BBWY.Server.Business
order.OutStorageAmount = orderCostDetail?.OutStorageAmount ?? 0M;
order.ConsumableAmount = orderCostDetail?.ConsumableAmount ?? 0M;
order.StorageAmount = orderCostDetail?.StorageAmount ?? 0M;
- order.AfterTotalCost = afterOrder?.AfterTotalCost ?? 0M;
+ //order.AfterTotalCost = afterOrder?.AfterTotalCost ?? 0M;
if (order.StorageType == Model.Enums.StorageType.SD)
{
@@ -94,7 +94,7 @@ namespace BBWY.Server.Business
var orderList = fsql.Select(orderIds).ToList();
var orderCostList = fsql.Select(orderIds).ToList();
var orderCostDetailList = fsql.Select().Where(ocd => orderIds.Contains(ocd.OrderId) && ocd.IsEnabled == true).ToList();
- var afterOrderList = fsql.Select().Where(aso => orderIds.Contains(aso.OrderId)).ToList();
+ //var afterOrderList = fsql.Select().Where(aso => orderIds.Contains(aso.OrderId)).ToList();
IList> updateOrderCostList = new List>();
IList> updateOrderCostDetailList = new List>();
@@ -110,13 +110,14 @@ namespace BBWY.Server.Business
var currentOrderCostDetailList = orderCostDetailList.Where(ocd => ocd.OrderId == billCorrectionRequest.OrderId).ToList();
if (currentOrderCostDetailList.Count() == 0 && order.StorageType != Model.Enums.StorageType.SD)
continue;
- var currentOrderAfterOrderList = afterOrderList.Where(aso => aso.OrderId == billCorrectionRequest.OrderId).ToList();
+ //var currentOrderAfterOrderList = afterOrderList.Where(aso => aso.OrderId == billCorrectionRequest.OrderId).ToList();
orderCost.DeliveryExpressFreight = billCorrectionRequest.NewDeliveryExpressFreight;
if (order.StorageType != Model.Enums.StorageType.SD)
{
- orderCost.CalculationOrderProfitAndCost(order, currentOrderAfterOrderList);
+ //orderCost.CalculationOrderProfitAndCost(order, currentOrderAfterOrderList);
+ orderCost.CalculationOrderProfitAndCost(order);
var singleDeliveryExpressFreight = billCorrectionRequest.NewDeliveryExpressFreight / currentOrderCostDetailList.Count();
foreach (var ocd in currentOrderCostDetailList)
{
@@ -128,7 +129,7 @@ namespace BBWY.Server.Business
}
else
{
- orderCost.CalculationSDOrderProfitAndCost(order, afterOrderList);
+ orderCost.CalculationSDOrderProfitAndCost(order);
}
var updateOrderCost = fsql.Update(orderCost.OrderId).Set(oc => oc.DeliveryExpressFreight, orderCost.DeliveryExpressFreight)
diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs
index 3fae25d3..93b5c894 100644
--- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs
+++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs
@@ -18,14 +18,11 @@ using Yitter.IdGenerator;
namespace BBWY.Server.Business
{
- public class EvaluationAssistantBusiness : BasePlatformRelayBusiness, IDenpendency
+ public class EvaluationAssistantBusiness : BaseBusiness, IDenpendency
{
- private IFreeSql fsql;
- private IIdGenerator idGenerator;
private TaskSchedulerManager taskSchedulerManager;
private VenderBusiness venderBusiness;
private DingDingBusiness dingDingBusiness;
- private NLogManager nLogManager;
private List validOrderStateList;
private List preTaskStateList;
private ProductBusiness productBusiness;
@@ -33,7 +30,15 @@ namespace BBWY.Server.Business
private char[] spliter;
- public EvaluationAssistantBusiness(RestApiService restApiService, IOptions options, YunDingBusiness yunDingBusiness, IFreeSql fsql, IIdGenerator idGenerator, TaskSchedulerManager taskSchedulerManager, VenderBusiness venderBusiness, DingDingBusiness dingDingBusiness, NLogManager nLogManager, ProductBusiness productBusiness, FreeSqlMultiDBManager freeSqlMultiDBManager) : base(restApiService, options, yunDingBusiness)
+ public EvaluationAssistantBusiness(IFreeSql fsql,
+ IIdGenerator idGenerator,
+ TaskSchedulerManager taskSchedulerManager,
+ VenderBusiness venderBusiness,
+ DingDingBusiness dingDingBusiness,
+ NLogManager nLogManager,
+ ProductBusiness productBusiness,
+ FreeSqlMultiDBManager freeSqlMultiDBManager,
+ IEnumerable platformSDKBusinessList) : base(fsql, nLogManager, idGenerator, platformSDKBusinessList)
{
this.fsql = fsql;
@@ -183,8 +188,7 @@ namespace BBWY.Server.Business
if (request.Id == 0)
{
- var relayAPIHost = GetPlatformRelayAPIHost(Enums.Platform.京东);
- var restApiResult_spu = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetProductList", new SearchProductRequest()
+ var spuResponse = productBusiness.GetProductList(new SearchProductRequest()
{
AppKey = request.AppKey,
AppSecret = request.AppSecret,
@@ -193,12 +197,24 @@ namespace BBWY.Server.Business
PageSize = 10,
Platform = Enums.Platform.京东,
Spu = request.MainProductSpu
- }, GetYunDingRequestHeader(), HttpMethod.Post);
- if (restApiResult_spu.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException(restApiResult_spu.Content) { Code = (int)restApiResult_spu.StatusCode };
- var spuResponse = JsonConvert.DeserializeObject>(restApiResult_spu.Content);
- if (!spuResponse.Success)
- throw new BusinessException(spuResponse.Msg) { Code = spuResponse.Code };
+ });
+
+ //var relayAPIHost = GetPlatformRelayAPIHost(Enums.Platform.京东);
+ //var restApiResult_spu = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetProductList", new SearchProductRequest()
+ //{
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // PageIndex = 1,
+ // PageSize = 10,
+ // Platform = Enums.Platform.京东,
+ // Spu = request.MainProductSpu
+ //}, GetYunDingRequestHeader(), HttpMethod.Post);
+ //if (restApiResult_spu.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException(restApiResult_spu.Content) { Code = (int)restApiResult_spu.StatusCode };
+ //var spuResponse = JsonConvert.DeserializeObject>(restApiResult_spu.Content);
+ //if (!spuResponse.Success)
+ // throw new BusinessException(spuResponse.Msg) { Code = spuResponse.Code };
var sort = fsql.Select().Where(pt => pt.ShopId == request.ShopId).ToAggregate(p => p.Max(p.Key.Sort));
var promotionTask = new PromotionTask()
@@ -219,8 +235,8 @@ namespace BBWY.Server.Business
PromotionId = 0,
Sort = sort + 1,
UpdateSortTime = DateTime.Now,
- SpuLogo = spuResponse.Data.Items[0].Logo,
- SpuPublishTime = spuResponse.Data.Items[0].CreateTime,
+ SpuLogo = spuResponse.Items[0].Logo,
+ SpuPublishTime = spuResponse.Items[0].CreateTime,
TaskCount = request.TaskCount,
CustomMotherSku = request.CustomMotherSku,
OuterId = request.OuterId
@@ -523,14 +539,15 @@ namespace BBWY.Server.Business
CheckRepeatSkuInRuningTask(runingTaskList, dbPromotionTask.MainProductSku);
- var host = GetPlatformRelayAPIHost(Enums.Platform.京东);
+ //var host = GetPlatformRelayAPIHost(Enums.Platform.京东);
var haveGiftTemplateSku = giftTemplateSkuList != null && giftTemplateSkuList.Count() > 0;
string barCode = string.Empty, categoryId = string.Empty;
IList multiCateProps = null;
var mainProductSkuInStore = false;
+ var platformSdkBusiness = GetPlatformSDKBusiness(Enums.Platform.京东);
if (haveGiftTemplateSku)
{
- var mainSkuResult = restApiService.SendRequest(host, "api/PlatformSDK/GetProductSkuList", new SearchProductSkuRequest()
+ var mainSkuListResponse = productBusiness.GetProductSkuList(new SearchProductSkuRequest()
{
AppKey = request.AppKey,
AppSecret = request.AppSecret,
@@ -538,34 +555,52 @@ namespace BBWY.Server.Business
IsContainSource = true,
Platform = request.Platform,
Spu = dbPromotionTask.MainProductSpu
- }, GetYunDingRequestHeader(), HttpMethod.Post);
- if (mainSkuResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException($"获取主商品sku失败 {mainSkuResult.Content}");
- var mainSkuListResponse = JsonConvert.DeserializeObject>>(mainSkuResult.Content);
- if (!mainSkuListResponse.Success)
- throw new BusinessException($"获取主商品sku失败 {mainSkuListResponse.Msg}");
+ });
- barCode = mainSkuListResponse.Data[0].Source.Value("barCode");
- categoryId = mainSkuListResponse.Data[0].Source.Value("categoryId");
- multiCateProps = mainSkuListResponse.Data[0].Source["multiCateProps"] != null ? mainSkuListResponse.Data[0].Source["multiCateProps"].ToList() : null;
+ //var mainSkuResult = restApiService.SendRequest(host, "api/PlatformSDK/GetProductSkuList", new SearchProductSkuRequest()
+ //{
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // IsContainSource = true,
+ // Platform = request.Platform,
+ // Spu = dbPromotionTask.MainProductSpu
+ //}, GetYunDingRequestHeader(), HttpMethod.Post);
+ //if (mainSkuResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException($"获取主商品sku失败 {mainSkuResult.Content}");
+ //var mainSkuListResponse = JsonConvert.DeserializeObject>>(mainSkuResult.Content);
+ //if (!mainSkuListResponse.Success)
+ // throw new BusinessException($"获取主商品sku失败 {mainSkuListResponse.Msg}");
+
+ barCode = mainSkuListResponse[0].Source.Value("barCode");
+ categoryId = mainSkuListResponse[0].Source.Value("categoryId");
+ multiCateProps = mainSkuListResponse[0].Source["multiCateProps"] != null ? mainSkuListResponse[0].Source["multiCateProps"].ToList() : null;
var jyStoreIdList = fsql.Select().Where(s => s.Type == Enums.StockType.京仓 || s.Name.Contains("云仓")).ToList(s => s.Id);
- foreach (var sku in mainSkuListResponse.Data)
+ foreach (var sku in mainSkuListResponse)
{
- var stockNumApiResult = restApiService.SendRequest(host, "api/platformsdk/GetStockNumBySku", new SearchProductSkuRequest()
+ var stockNumListResponse = platformSdkBusiness.GetStockNumBySku(new SearchProductSkuRequest()
{
AppKey = shop.AppKey,
AppSecret = shop.AppSecret,
AppToken = shop.AppToken,
Platform = shop.PlatformId,
Sku = sku.Id
- }, GetYunDingRequestHeader(), HttpMethod.Post);
- if (stockNumApiResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new Exception($"{sku} {stockNumApiResult.Content}");
- var stockNumListResponse = JsonConvert.DeserializeObject>(stockNumApiResult.Content);
-
- var skuStockNumList = stockNumListResponse.Data.Select(j => new
+ });
+ //var stockNumApiResult = restApiService.SendRequest(host, "api/platformsdk/GetStockNumBySku", new SearchProductSkuRequest()
+ //{
+ // AppKey = shop.AppKey,
+ // AppSecret = shop.AppSecret,
+ // AppToken = shop.AppToken,
+ // Platform = shop.PlatformId,
+ // Sku = sku.Id
+ //}, GetYunDingRequestHeader(), HttpMethod.Post);
+ //if (stockNumApiResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new Exception($"{sku} {stockNumApiResult.Content}");
+ //var stockNumListResponse = JsonConvert.DeserializeObject>(stockNumApiResult.Content);
+
+ var skuStockNumList = stockNumListResponse.Select(j => new
{
StockNum = j.Value("stockNum"),
StoreId = j.Value("storeId"),
@@ -577,7 +612,7 @@ namespace BBWY.Server.Business
}
}
- var httpApiResult = restApiService.SendRequest(host, "api/PlatformSDK/StartJDPromotionTask", new StartPromotionTaskRequest2()
+ var startResponse = platformSdkBusiness.StartJDPromotionTask(new StartPromotionTaskRequest2()
{
Id = dbPromotionTask.Id,
ActivityName = dbPromotionTask.ActivityName,
@@ -600,15 +635,16 @@ namespace BBWY.Server.Business
MainProductMultiCateProps = multiCateProps,
MainProductSkuInStore = mainProductSkuInStore,
OuterId = dbPromotionTask.OuterId
+ });
- }, GetYunDingRequestHeader(), HttpMethod.Post);
+ //var httpApiResult = restApiService.SendRequest(host, "api/PlatformSDK/StartJDPromotionTask", , GetYunDingRequestHeader(), HttpMethod.Post);
- if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException(httpApiResult.Content);
- var response = JsonConvert.DeserializeObject>(httpApiResult.Content);
- if (!response.Success)
- throw new BusinessException(response.Msg);
- var startResponse = response.Data;
+ //if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException(httpApiResult.Content);
+ //var response = JsonConvert.DeserializeObject>(httpApiResult.Content);
+ //if (!response.Success)
+ // throw new BusinessException(response.Msg);
+ //var startResponse = response.Data;
if (dbPromotionTask.GiftTemplateId != null &&
dbPromotionTask.GiftTemplateId != 0 &&
@@ -636,22 +672,6 @@ namespace BBWY.Server.Business
private void StartPromotionDelayTask(StartPromotionTaskRequest request, StartPromotionTaskResponse startResponse, PromotionTask promotionTask, ShopResponse shop)
{
- var host = GetPlatformRelayAPIHost(Enums.Platform.京东);
-
- var httpApiResult = restApiService.SendRequest(host, "api/PlatformSDK/StartJDPromotionDelayTask", new StartPromotionTaskDelayRequest()
- {
- Platform = Enums.Platform.京东,
- AppKey = request.AppKey,
- AppSecret = request.AppSecret,
- AppToken = request.AppToken,
- BrandName = startResponse.BrandName,
- FullTitle = promotionTask.FullTitle,
- JDPromotionId = startResponse.JDPromotionId,
- MainProductSpu = promotionTask.MainProductSpu,
- HaveGiftTemplate = promotionTask.GiftTemplateId != null && promotionTask.GiftTemplateId != 0,
- DeleteGiftSkuList = startResponse.DeleteGiftSkuList
- }, GetYunDingRequestHeader(), HttpMethod.Post, timeOutSeconds: 150);
-
var errorBack = new Action((id, errorMsg) =>
{
fsql.Update(id).Set(pt => pt.Status, Enums.PromitionTaskStatus.已停止)
@@ -659,17 +679,59 @@ namespace BBWY.Server.Business
.ExecuteAffrows();
Error(shop, $"评价助手-{shop.ShopName}", $"开始任务-延迟任务-任务Id {request.Id}", new Exception(errorMsg));
});
- if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK)
+
+ try
{
- errorBack(promotionTask.Id, httpApiResult.Content);
- return;
+
+
+ GetPlatformSDKBusiness(Enums.Platform.京东).StartJDPromotionDelayTask(new StartPromotionTaskDelayRequest()
+ {
+ Platform = Enums.Platform.京东,
+ AppKey = request.AppKey,
+ AppSecret = request.AppSecret,
+ AppToken = request.AppToken,
+ BrandName = startResponse.BrandName,
+ FullTitle = promotionTask.FullTitle,
+ JDPromotionId = startResponse.JDPromotionId,
+ MainProductSpu = promotionTask.MainProductSpu,
+ HaveGiftTemplate = promotionTask.GiftTemplateId != null && promotionTask.GiftTemplateId != 0,
+ DeleteGiftSkuList = startResponse.DeleteGiftSkuList
+ });
}
- var response = JsonConvert.DeserializeObject>(httpApiResult.Content);
- if (!response.Success)
+ catch (Exception ex)
{
- errorBack(promotionTask.Id, response.Msg);
+ errorBack(promotionTask.Id, ex.Message);
return;
}
+
+ //var host = GetPlatformRelayAPIHost(Enums.Platform.京东);
+
+ //var httpApiResult = restApiService.SendRequest(host, "api/PlatformSDK/StartJDPromotionDelayTask", new StartPromotionTaskDelayRequest()
+ //{
+ // Platform = Enums.Platform.京东,
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // BrandName = startResponse.BrandName,
+ // FullTitle = promotionTask.FullTitle,
+ // JDPromotionId = startResponse.JDPromotionId,
+ // MainProductSpu = promotionTask.MainProductSpu,
+ // HaveGiftTemplate = promotionTask.GiftTemplateId != null && promotionTask.GiftTemplateId != 0,
+ // DeleteGiftSkuList = startResponse.DeleteGiftSkuList
+ //}, GetYunDingRequestHeader(), HttpMethod.Post, timeOutSeconds: 150);
+
+
+ //if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK)
+ //{
+ // errorBack(promotionTask.Id, httpApiResult.Content);
+ // return;
+ //}
+ //var response = JsonConvert.DeserializeObject>(httpApiResult.Content);
+ //if (!response.Success)
+ //{
+ // errorBack(promotionTask.Id, response.Msg);
+ // return;
+ //}
}
///
@@ -681,23 +743,33 @@ namespace BBWY.Server.Business
var dbPromotionTask = fsql.Select(request.TaskId).ToOne();
if (dbPromotionTask.Status != Enums.PromitionTaskStatus.等待)
{
- var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
- "api/platformsdk/DeleteJDPromotionTask",
- new DeleteJDPromotionTaskRequest()
- {
- AppKey = request.AppKey,
- AppSecret = request.AppSecret,
- AppToken = request.AppToken,
- Platform = Enums.Platform.京东,
- PromotionId = dbPromotionTask.PromotionId.Value
- },
- GetYunDingRequestHeader(),
- HttpMethod.Post);
- if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException(httpResult.Content);
- var response = JsonConvert.DeserializeObject(httpResult.Content);
- if (!response.Success)
- throw new BusinessException(response.Msg);
+ GetPlatformSDKBusiness(Enums.Platform.京东).DeleteJDPromotionTask(
+ new DeleteJDPromotionTaskRequest()
+ {
+ AppKey = request.AppKey,
+ AppSecret = request.AppSecret,
+ AppToken = request.AppToken,
+ Platform = Enums.Platform.京东,
+ PromotionId = dbPromotionTask.PromotionId.Value
+ });
+
+ //var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
+ // "api/platformsdk/DeleteJDPromotionTask",
+ // new DeleteJDPromotionTaskRequest()
+ // {
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // Platform = Enums.Platform.京东,
+ // PromotionId = dbPromotionTask.PromotionId.Value
+ // },
+ // GetYunDingRequestHeader(),
+ // HttpMethod.Post);
+ //if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException(httpResult.Content);
+ //var response = JsonConvert.DeserializeObject(httpResult.Content);
+ //if (!response.Success)
+ // throw new BusinessException(response.Msg);
}
fsql.Transaction(() =>
@@ -725,24 +797,34 @@ namespace BBWY.Server.Business
if (!string.IsNullOrEmpty(dbPromotionTask.CustomMotherSku))
motherSkuIdList.AddRange(dbPromotionTask.CustomMotherSku.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
- var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
- "api/platformsdk/DeleteJDPromotionTaskSku",
- new DeleteJDPromotionTaskSkuRequest()
- {
- AppKey = request.AppKey,
- AppSecret = request.AppSecret,
- AppToken = request.AppToken,
- Platform = Enums.Platform.京东,
- PromotionId = dbPromotionTask.PromotionId.Value,
- SkuId = string.Join(",", motherSkuIdList)
- },
- GetYunDingRequestHeader(),
- HttpMethod.Post);
- if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException(httpResult.Content);
- var response = JsonConvert.DeserializeObject(httpResult.Content);
- if (!response.Success)
- throw new BusinessException(response.Msg);
+ GetPlatformSDKBusiness(Enums.Platform.京东).DeleteJDPromotionTaskSku(new DeleteJDPromotionTaskSkuRequest()
+ {
+ AppKey = request.AppKey,
+ AppSecret = request.AppSecret,
+ AppToken = request.AppToken,
+ Platform = Enums.Platform.京东,
+ PromotionId = dbPromotionTask.PromotionId.Value,
+ SkuId = string.Join(",", motherSkuIdList)
+ });
+
+ //var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
+ // "api/platformsdk/DeleteJDPromotionTaskSku",
+ // new DeleteJDPromotionTaskSkuRequest()
+ // {
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // Platform = Enums.Platform.京东,
+ // PromotionId = dbPromotionTask.PromotionId.Value,
+ // SkuId = string.Join(",", motherSkuIdList)
+ // },
+ // GetYunDingRequestHeader(),
+ // HttpMethod.Post);
+ //if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException(httpResult.Content);
+ //var response = JsonConvert.DeserializeObject(httpResult.Content);
+ //if (!response.Success)
+ // throw new BusinessException(response.Msg);
}
fsql.Transaction(() =>
@@ -766,26 +848,37 @@ namespace BBWY.Server.Business
if (dbPromotionTask.Status != Enums.PromitionTaskStatus.进行中)
throw new BusinessException("只能在任务处于进行中时才能停止");
- var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
- "api/platformsdk/SuspendJDPromotionTask",
- new SuspendDPromotionTaskRequest()
- {
- AppKey = request.AppKey,
- AppSecret = request.AppSecret,
- AppToken = request.AppToken,
- Platform = Enums.Platform.京东,
- PromotionId = dbPromotionTask.PromotionId.Value
- },
- GetYunDingRequestHeader(),
- HttpMethod.Post);
- if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
- throw new BusinessException(httpResult.Content);
- var response = JsonConvert.DeserializeObject(httpResult.Content);
- if (!response.Success)
+ GetPlatformSDKBusiness(Enums.Platform.京东).SuspendJDPromotionTask(new SuspendDPromotionTaskRequest()
{
- if (!response.Msg.Contains("促销已删除"))
- throw new BusinessException(response.Msg);
- }
+ AppKey = request.AppKey,
+ AppSecret = request.AppSecret,
+ AppToken = request.AppToken,
+ Platform = Enums.Platform.京东,
+ PromotionId = dbPromotionTask.PromotionId.Value
+ });
+
+ //var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
+ // "api/platformsdk/SuspendJDPromotionTask",
+ // new SuspendDPromotionTaskRequest()
+ // {
+ // AppKey = request.AppKey,
+ // AppSecret = request.AppSecret,
+ // AppToken = request.AppToken,
+ // Platform = Enums.Platform.京东,
+ // PromotionId = dbPromotionTask.PromotionId.Value
+ // },
+ // GetYunDingRequestHeader(),
+ // HttpMethod.Post);
+ //if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
+ // throw new BusinessException(httpResult.Content);
+ //var response = JsonConvert.DeserializeObject(httpResult.Content);
+ //if (!response.Success)
+ //{
+ // if (!response.Msg.Contains("促销已删除"))
+ // throw new BusinessException(response.Msg);
+ //}
+
+
fsql.Update(request.Id).Set(pt => pt.Status, Enums.PromitionTaskStatus.已停止).ExecuteAffrows();
}
@@ -979,18 +1072,35 @@ namespace BBWY.Server.Business
{
#region 提前完成任务量,暂停JD活动
{
- var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
- "api/platformsdk/SuspendJDPromotionTask",
- new SuspendDPromotionTaskRequest()
- {
- AppKey = shop.AppKey2,
- AppSecret = shop.AppSecret2,
- AppToken = shop.AppToken2,
- Platform = Enums.Platform.京东,
- PromotionId = promotionTask.PromotionId.Value
- },
- GetYunDingRequestHeader(),
- HttpMethod.Post);
+ try
+ {
+ GetPlatformSDKBusiness(Enums.Platform.京东).SuspendJDPromotionTask(new SuspendDPromotionTaskRequest()
+ {
+ AppKey = shop.AppKey2,
+ AppSecret = shop.AppSecret2,
+ AppToken = shop.AppToken2,
+ Platform = Enums.Platform.京东,
+ PromotionId = promotionTask.PromotionId.Value
+ });
+ }
+ catch (Exception ex)
+ {
+ Error(shop, loggerName, $"监控任务-暂停京东活动-任务Id {promotionTask.Id}", ex);
+ }
+
+
+ //var httpResult = restApiService.SendRequest(GetPlatformRelayAPIHost(Enums.Platform.京东),
+ // "api/platformsdk/SuspendJDPromotionTask",
+ // new SuspendDPromotionTaskRequest()
+ // {
+ // AppKey = shop.AppKey2,
+ // AppSecret = shop.AppSecret2,
+ // AppToken = shop.AppToken2,
+ // Platform = Enums.Platform.京东,
+ // PromotionId = promotionTask.PromotionId.Value
+ // },
+ // GetYunDingRequestHeader(),
+ // HttpMethod.Post);
//if (httpResult.StatusCode != System.Net.HttpStatusCode.OK)
//{
diff --git a/BBWY.Server.Business/Extensions/OrderCostExtension.cs b/BBWY.Server.Business/Extensions/OrderCostExtension.cs
index 2111990c..af30347e 100644
--- a/BBWY.Server.Business/Extensions/OrderCostExtension.cs
+++ b/BBWY.Server.Business/Extensions/OrderCostExtension.cs
@@ -8,11 +8,64 @@ namespace BBWY.Server.Business.Extensions
{
public static class OrderCostExtension
{
- public static void CalculationOrderProfitAndCost(this OrderCost orderCost, Order order, IList afterSaleOrders)
+ //public static void CalculationOrderProfitAndCost(this OrderCost orderCost, Order order, IList afterSaleOrders)
+ //{
+ // orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ // orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ // orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ // //退款之后平台扣点
+ // orderCost.PlatformCommissionAmount = (order.OrderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
+
+ // orderCost.Profit = order.OrderSellerPrice + order.FreightPrice - orderCost.RefundAmount -
+ // orderCost.PurchaseAmount -
+ // orderCost.DeliveryExpressFreight -
+ // orderCost.PlatformCommissionAmount -
+ // orderCost.AfterTotalCost +
+ // orderCost.RefundPurchaseAmount;
+ //}
+
+ //public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal orderSellerPrice,decimal freightPrice, IList afterSaleOrders)
+ //{
+ // orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ // orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ // orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ // //退款之后平台扣点
+ // orderCost.PlatformCommissionAmount = (orderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
+
+ // orderCost.Profit = orderSellerPrice + freightPrice - orderCost.RefundAmount -
+ // orderCost.PurchaseAmount -
+ // orderCost.DeliveryExpressFreight -
+ // orderCost.PlatformCommissionAmount -
+ // orderCost.AfterTotalCost +
+ // orderCost.RefundPurchaseAmount;
+ //}
+
+
+
+ //public static void CalculationSDOrderProfitAndCost(this OrderCost orderCost, Order order, IList afterSaleOrders)
+ //{
+ // orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ // orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ // orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ // //退款之后平台扣点
+ // orderCost.PlatformCommissionAmount = (order.OrderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
+ // orderCost.Profit = (orderCost.SDCommissionAmount + orderCost.SDOrderAmount + orderCost.DeliveryExpressFreight + orderCost.PlatformCommissionAmount + orderCost.AfterTotalCost) * -1;
+ //}
+
+
+
+ public static void CalculationOrderProfitAndCost(this OrderCost orderCost, Order order)
{
- orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
- orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
- orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+ //orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ //orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ //orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ orderCost.AfterTotalCost = 0;
+ orderCost.RefundAmount = 0;
+ orderCost.RefundPurchaseAmount = 0;
//退款之后平台扣点
orderCost.PlatformCommissionAmount = (order.OrderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
@@ -25,11 +78,15 @@ namespace BBWY.Server.Business.Extensions
orderCost.RefundPurchaseAmount;
}
- public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal orderSellerPrice,decimal freightPrice, IList afterSaleOrders)
+ public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal orderSellerPrice, decimal freightPrice)
{
- orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
- orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
- orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+ //orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ //orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ //orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ orderCost.AfterTotalCost = 0;
+ orderCost.RefundAmount = 0;
+ orderCost.RefundPurchaseAmount = 0;
//退款之后平台扣点
orderCost.PlatformCommissionAmount = (orderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
@@ -44,11 +101,15 @@ namespace BBWY.Server.Business.Extensions
- public static void CalculationSDOrderProfitAndCost(this OrderCost orderCost, Order order, IList afterSaleOrders)
+ public static void CalculationSDOrderProfitAndCost(this OrderCost orderCost, Order order)
{
- orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
- orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
- orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+ //orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost);
+ //orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M);
+ //orderCost.RefundPurchaseAmount = afterSaleOrders == null || afterSaleOrders.Count == 0M ? 0M : afterSaleOrders.Sum(aso => aso.RefundPurchaseAmount ?? 0);
+
+ orderCost.AfterTotalCost = 0;
+ orderCost.RefundAmount = 0;
+ orderCost.RefundPurchaseAmount = 0;
//退款之后平台扣点
orderCost.PlatformCommissionAmount = (order.OrderSellerPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio);
diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs
index 9ac6e109..15e1c2bb 100644
--- a/BBWY.Server.Business/Order/OrderBusiness.cs
+++ b/BBWY.Server.Business/Order/OrderBusiness.cs
@@ -212,9 +212,9 @@ namespace BBWY.Server.Business
#endregion
#region 处理售后信息
- var afterSaleOrderList = fsql.Select().Where(aso => orderIdList.Contains(aso.OrderId)).ToList();
- foreach (var order in orderList)
- order.AfterSaleOrderList = afterSaleOrderList.Where(aso => aso.OrderId == order.Id).ToList();
+ //var afterSaleOrderList = fsql.Select().Where(aso => orderIdList.Contains(aso.OrderId)).ToList();
+ //foreach (var order in orderList)
+ // order.AfterSaleOrderList = afterSaleOrderList.Where(aso => aso.OrderId == order.Id).ToList();
#endregion
//#region 翻译仓库Id
@@ -347,8 +347,8 @@ namespace BBWY.Server.Business
var orderCostDetailList = fsql.Select().Where(ocd => ocd.OrderId == orderId && ocd.IsEnabled == true).ToList().Map>();
var orderDropShippingList = fsql.Select().Where(ods => ods.OrderId == orderId).ToList().Map>();
- if (order.IsAfterSaleOrder)
- orderResponse.AfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == orderId).ToList();
+ //if (order.IsAfterSaleOrder)
+ // orderResponse.AfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == orderId).ToList();
//orderResponse.OrderDropShippingList = orderDropShippingList;
orderResponse.OrderDropShippingList = orderDropShippingList.Where(ods => ods.IsHistory == false).ToList();
@@ -445,7 +445,7 @@ namespace BBWY.Server.Business
orderSkuIds.Contains(po.SkuId)).ToList();
if (purchaserOrders.Count() == 0)
throw new BusinessException("库存为零不能自动计算成本");
- var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == autoCalculationCostRequest.OrderId).ToList();
+ //var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == autoCalculationCostRequest.OrderId).ToList();
var orderCost = fsql.Select(autoCalculationCostRequest.OrderId).ToOne();
var orderCostDetails = fsql.Select().Where(ocd => ocd.OrderId == autoCalculationCostRequest.OrderId && ocd.IsEnabled == true).ToList();
@@ -550,7 +550,7 @@ namespace BBWY.Server.Business
DeliveryExpressFreight = orderDeliveryExpressFreight,
CreateTime = DateTime.Now
};
- orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationOrderProfitAndCost(dbOrder);
insertOrderCost = fsql.Insert(orderCost);
#endregion
}
@@ -558,7 +558,7 @@ namespace BBWY.Server.Business
{
orderCost.PurchaseAmount += orderCostPurchaseAmount;
orderCost.DeliveryExpressFreight += orderDeliveryExpressFreight;
- orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationOrderProfitAndCost(dbOrder);
updateOrderCost = fsql.Update().SetSource(orderCost);
}
@@ -604,7 +604,7 @@ namespace BBWY.Server.Business
});
var avgPreferential = dbOrder.PreferentialAmount / orderSkuList.Count();
- var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == manualCalculationCostRequest.OrderId).ToList();
+ //var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == manualCalculationCostRequest.OrderId).ToList();
if (manualCalculationCostRequest.IsSetStorageType)
orderUpdate = fsql.Update(manualCalculationCostRequest.OrderId)
@@ -651,7 +651,7 @@ namespace BBWY.Server.Business
// orderCost.PurchaseAmount -
// orderCost.DeliveryExpressFreight -
// orderCost.PlatformCommissionAmount;
- orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationOrderProfitAndCost(dbOrder);
insertOrderCost = fsql.Insert(orderCost);
}
else
@@ -663,7 +663,7 @@ namespace BBWY.Server.Business
// orderCost.PurchaseAmount -
// orderCost.DeliveryExpressFreight -
// orderCost.PlatformCommissionAmount;
- orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationOrderProfitAndCost(dbOrder);
orderCost.IsManualEdited = true;
updateOrderCost = fsql.Update().SetSource(orderCost);
}
@@ -727,7 +727,7 @@ namespace BBWY.Server.Business
IUpdate updateOrderCost = null;
IInsert insertOrderCost = null;
- var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == sdCalculationCostRequest.OrderId).ToList();
+ //var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == sdCalculationCostRequest.OrderId).ToList();
orderUpdate = fsql.Update(sdCalculationCostRequest.OrderId).Set(o => o.SDType, sdCalculationCostRequest.SDType)
.Set(o => o.Flag, sdCalculationCostRequest.Flag)
@@ -759,7 +759,7 @@ namespace BBWY.Server.Business
};
//orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * orderCost.PlatformCommissionRatio;
//orderCost.Profit = (orderCost.SDCommissionAmount + orderCost.DeliveryExpressFreight + orderCost.PlatformCommissionAmount) * -1;
- orderCost.CalculationSDOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationSDOrderProfitAndCost(dbOrder);
insertOrderCost = fsql.Insert(orderCost);
}
else
@@ -768,7 +768,7 @@ namespace BBWY.Server.Business
orderCost.SDOrderAmount = sdCalculationCostRequest.SDOrderAmount;
orderCost.DeliveryExpressFreight = sdCalculationCostRequest.DeliveryExpressFreight;
//orderCost.Profit = (orderCost.SDCommissionAmount + orderCost.DeliveryExpressFreight + orderCost.PlatformCommissionAmount) * -1;
- orderCost.CalculationSDOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
+ orderCost.CalculationSDOrderProfitAndCost(dbOrder);
orderCost.IsManualEdited = true;
updateOrderCost = fsql.Update().SetSource(orderCost);
}
diff --git a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
index 65e8f67c..580d5567 100644
--- a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
+++ b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
@@ -308,7 +308,8 @@ namespace BBWY.Server.Business
response.WaitOutStoreCount = fsql.Select().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.待出库 && o.StartTime >= dt).Count();
- response.AfterSaleOrderUnhandleCount = fsql.Select().Where(aso => aso.ShopId == shopId && (aso.ProductHealth == null || aso.ProductResult == null) && aso.CreateTime >= afterDt).Count();
+ //response.AfterSaleOrderUnhandleCount = fsql.Select().Where(aso => aso.ShopId == shopId && (aso.ProductHealth == null || aso.ProductResult == null) && aso.CreateTime >= afterDt).Count();
+ response.AfterSaleOrderUnhandleCount = 0;
return response;
}
diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs
index c5e1076e..8433eabf 100644
--- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs
+++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs
@@ -486,7 +486,7 @@ namespace BBWY.Server.Business
SDCommissionAmount = sDCalculationCostRequest.SDCommissionAmount,
SDOrderAmount = sDCalculationCostRequest.SDOrderAmount
};
- orderCost.CalculationSDOrderProfitAndCost(dbOrder, null);
+ orderCost.CalculationSDOrderProfitAndCost(dbOrder);
insertOrderCostList.Add(orderCost);
}
else if (!fsql.Select(dbOrder.Id).Any()) //再查询一次数据库,以防同步开始执行后被人为操作扣减库存,造成重复扣减库存
@@ -577,9 +577,9 @@ namespace BBWY.Server.Business
CreateTime = DateTime.Now
};
if (dbOrder.OrderTotalPrice != 0)
- orderCost.CalculationOrderProfitAndCost(dbOrder, null);
+ orderCost.CalculationOrderProfitAndCost(dbOrder);
else
- orderCost.CalculationOrderProfitAndCost(orderSellerPrice, freightPrice, null);
+ orderCost.CalculationOrderProfitAndCost(orderSellerPrice, freightPrice);
insertOrderCostList.Add(orderCost);
#endregion
diff --git a/BBWY.Server.Model/BBWY.Server.Model.csproj b/BBWY.Server.Model/BBWY.Server.Model.csproj
index 9bee62e6..91d66149 100644
--- a/BBWY.Server.Model/BBWY.Server.Model.csproj
+++ b/BBWY.Server.Model/BBWY.Server.Model.csproj
@@ -5,6 +5,16 @@
True
+
+
+
+
+
+
+
+
+
+
diff --git a/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs b/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
index 6cd6bf12..fd134172 100644
--- a/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
+++ b/BBWY.Server.Model/Dto/Response/Order/OrderResponse.cs
@@ -195,10 +195,10 @@ namespace BBWY.Server.Model.Dto
///
public IList HistoryOrderDropShippingList { get; set; }
- ///
- /// 售后信息
- ///
- public IList AfterSaleOrderList { get; set; }
+ /////
+ ///// 售后信息
+ /////
+ //public IList AfterSaleOrderList { get; set; }
}
public class OrderListResponse