Commit 0f892b2f by 泽锋 李

新增调拨费同步任务

parent 5c65111a
...@@ -201,5 +201,38 @@ namespace AutoTurnOver.DB ...@@ -201,5 +201,38 @@ namespace AutoTurnOver.DB
throw new Exception(" lms 接口异常: " + ex.StackTrace); throw new Exception(" lms 接口异常: " + ex.StackTrace);
} }
} }
/// <summary>
/// 获取调拨单真实费用
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public static List<api_transfer_cost_real_dto.data_dto.items_dto> GetTransferCost(api_transfer_cost_real_input_dto data)
{
try
{
//查询采购建议明细
string url = ConfigHelper.GetValue("transfer_cost_real");
string resultStr = HttpHelper.Request(url, RequestType.POST, data.ToJson(), "application/json", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<api_transfer_cost_real_dto>();
if (result == null)
{
throw new Exception("未获取响应数据");
}
else
{
if (!result.isSuccess)
{
throw new Exception(result.message);
}
return result.data.items;
}
}
catch (Exception ex)
{
throw new Exception("调拨费用同步接口 异常: " + ex.Message);
throw new Exception("调拨费用同步接口 接口异常: " + ex.StackTrace);
}
}
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models.ApiDto
{
/// <summary>
/// 调拨系统获取真实费用
/// </summary>
public class api_transfer_cost_real_dto
{
public bool isSuccess { get; set; }
public string message { get; set; }
public data_dto data { get; set; }
public class data_dto
{
public List<items_dto> items { get; set; }
public class items_dto
{
public int id { get; set; }
public string boxCode { get; set; }
public string orderCode { get; set; }
public decimal blCost { get; set; }
public decimal blWeight { get; set; }
public decimal logisticCost { get; set; }
public decimal logisticWeight { get; set; }
public List<skus_dto> skus { get; set; }
public class skus_dto
{
public string sku { get; set; }
public string skuTitle { get; set; }
public int deliveryCount { get; set; }
public int storageCount { get; set; }
public decimal weight { get; set; }
public decimal skuAvgCost { get; set; }
}
}
}
}
public class api_transfer_cost_real_input_dto
{
public data_dto data { get; set; }
public class data_dto
{
public page_dto page { get; set; }
public class page_dto
{
public int page { get; set; }
public int rows { get; set; }
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
/// <summary>
/// 财务结算后的真实运费
/// </summary>
public class dc_base_transfer_cost_real
{
public int id { get; set; }
public string transfer_order_id { get; set; }
public string bailun_sku { get; set; }
public decimal sku_avg_cost { get; set; }
}
}
...@@ -16,6 +16,8 @@ namespace ResetOutofstock ...@@ -16,6 +16,8 @@ namespace ResetOutofstock
var now = DateTime.Now; var now = DateTime.Now;
//report_cash_flow_dao.CalculationTransferOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59"))); //report_cash_flow_dao.CalculationTransferOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")));
var builder = new HostBuilder().ConfigureServices((hostContext, services) => var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{ {
services.AddHostedService<ResetOutofstockBackgrounService>(); services.AddHostedService<ResetOutofstockBackgrounService>();
......
...@@ -131,6 +131,25 @@ namespace ResetOutofstock ...@@ -131,6 +131,25 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始同步真实调拨费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report_cash_flow_dao.SynchroTransferCost();
Console.WriteLine($"结束同步真实调拨费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Thread.Sleep(60 * 60 * 1000);
}
});
return Task.CompletedTask; return Task.CompletedTask;
} }
......
...@@ -11,5 +11,6 @@ ...@@ -11,5 +11,6 @@
}, },
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList", "WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics", "Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus" "PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"transfer_cost_real": "http://api.wms.bailuntec.com/api/services/app/OrderLogisticCostService/GetOrderLogisticCostPageList"
} }
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
"PPS_ShortagePush": "http://bltpro.bailuntec.com/api/EbayTask/PushSkuEditQtyTask", "PPS_ShortagePush": "http://bltpro.bailuntec.com/api/EbayTask/PushSkuEditQtyTask",
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList", "WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics", "Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus" "PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"transfer_cost_real": "http://api.wms.bailuntec.com/api/services/app/OrderLogisticCostService/GetOrderLogisticCostPageList"
} }
...@@ -11,5 +11,6 @@ ...@@ -11,5 +11,6 @@
}, },
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList", "WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics", "Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus" "PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"transfer_cost_real": "http://api.wms.bailuntec.com/api/services/app/OrderLogisticCostService/GetOrderLogisticCostPageList"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment