Commit 2066166c by 泽锋 李

fix

parent 243c0ad9
......@@ -13,17 +13,6 @@ namespace AutoGeneratePurchaseAdvise
static async Task Main(string[] args)
{
Console.WriteLine("采购建议计算任务启动...");
//PurchaseAdviseServices.Generate();
//PurchaseAdviseServices.AutoPushBuySys(1);
//PurchaseAdviseServices.AutoPushBuySys(1);
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(2);
//dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
//PurchaseAdviseServices.AutoPushBuySys(2);
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(1);
//dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
//PurchaseAdviseServices.AutoPushBuySys(2);
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -104,6 +104,34 @@ namespace AutoTurnOver.DB
throw new Exception("pps sku 刊登状态接口异常: " + ex.StackTrace);
}
}
/// <summary>
/// 获取平台费率
/// </summary>
/// <returns></returns>
public static api_platform_fee_result_dto.result_dto GetPlatformFee(api_platform_fee_input_dto data)
{
try
{
//查询采购建议明细
string url = ConfigHelper.GetValue("PostPlatCategoryRate");
string resultStr = HttpHelper.Request(url, RequestType.POST, data.datas.ToJson(), "application/json", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<api_platform_fee_result_dto>();
if (result == null)
{
return new api_platform_fee_result_dto.result_dto() { };
}
else
{
return result.result[0];
}
}
catch (Exception ex)
{
throw new Exception("平台费 接口异常: " + ex.Message);
throw new Exception("平台费 接口异常: " + ex.StackTrace);
}
}
/// <summary>
/// 获取预估物流费用
......
......@@ -1851,20 +1851,22 @@ Truncate table dc_report_cash_flow_group_day_temp;
insert dc_report_cash_flow_group_day_temp (`platform_type`,`web_site`,`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
(
select platform_type,web_site,year(occur_time) as 'year',month(occur_time) as 'month',day(occur_time) as 'day',sum(val) as 'val',data_type,1,min(occur_time) as 'date' from dc_report_cash_flow_log where is_delete=0 GROUP BY occur_time_year_month_no,day(occur_time)
select platform_type,web_site,year(occur_time) as 'year',month(occur_time) as 'month',day(occur_time) as 'day',sum(val) as 'val',data_type,1,min(occur_time) as 'date' from dc_report_cash_flow_log where is_delete=0 and occur_time>=@btime GROUP BY occur_time_year_month_no,day(occur_time)
)
;
", new { btime =DateTime.Now.AddMonths(-3).ToString("yyyy-MM-01 00:00:00")}, commandTimeout: 0);
_connection.Execute(@" -- 刷新 现金流汇总表
insert dc_report_cash_flow_group_day_temp (`platform_type`,`web_site`,`year`,`month`,`day`,`val`,`data_type`,`type`,`date`)
(
select platform_type,web_site,year(pay_time) as 'year',month(pay_time) as 'month',day(pay_time) as 'day',sum(val) as 'val',data_type,2,min(pay_time) as 'date' from dc_report_cash_flow_log where is_delete=0 GROUP BY pay_time_year_month_no,day(pay_time)
select platform_type,web_site,year(pay_time) as 'year',month(pay_time) as 'month',day(pay_time) as 'day',sum(val) as 'val',data_type,2,min(pay_time) as 'date' from dc_report_cash_flow_log where is_delete=0 and pay_time>=@btime GROUP BY pay_time_year_month_no,day(pay_time)
);
alter table dc_report_cash_flow_group_day rename dc_report_cash_flow_group_dayTemp;
alter table dc_report_cash_flow_group_day_temp rename dc_report_cash_flow_group_day;
alter table dc_report_cash_flow_group_dayTemp rename dc_report_cash_flow_group_day_temp;
truncate table dc_report_cash_flow_group_day_temp;
", commandTimeout: 0);
", new { btime = DateTime.Now.AddMonths(-3).ToString("yyyy-MM-01 00:00:00") }, commandTimeout: 0);
var datePar = new {
btime = DateTime.Now.GetMonthFirstDay(),
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models.ApiDto
{
/// <summary>
/// 平台费率查询
/// </summary>
public class api_platform_fee_input_dto
{
public List<data_dto> datas { get; set; }
public class data_dto
{
/// <summary>
/// 平台
/// </summary>
public string Plat { get; set; }
public string Site { get; set; }
/// <summary>
/// 类目id
/// </summary>
public int PlatCategoryId { get; set; }
}
}
public class api_platform_fee_result_dto
{
public int statusCode { get; set; }
public string message { get; set; }
public List<result_dto> result { get; set; }
public class result_dto
{
public string plat { get; set; }
public string site { get; set; }
public int? bailunCategoryId { get; set; }
public int? platCategoryId { get; set; }
/// <summary>
/// 平台费率
/// </summary>
public decimal categoryRate { get; set; }
}
}
}
......@@ -79,6 +79,20 @@ namespace AutoTurnOver.Models.Report
public decimal width { get; set; }
public DateTime update_time { get; set; }
/// <summary>
/// 尾程费单价
/// </summary>
public decimal? tail_logistics_fee { get; set; }
/// <summary>
/// 头程费单价
/// </summary>
public decimal? transfer_logistics_fee { get; set; }
/// <summary>
/// 平台费单价
/// </summary>
public decimal? platform_fee { get; set; }
public int platform_category_id { get; set; }
}
......
......@@ -4,5 +4,6 @@
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PostPlatCategoryRate": "http://test.profit.bailuntec.com/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
......@@ -4,5 +4,6 @@
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PostPlatCategoryRate": "http://test.profit.bailuntec.com/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
......@@ -4,5 +4,6 @@
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PostPlatCategoryRate": "http://172.31.255.11/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ using AutoTurnOver.Common;
using AutoTurnOver.DB;
using AutoTurnOver.Utility;
using AutoTurnOver.Models;
using AutoTurnOver.Models.ApiDto;
namespace AutoTurnOver.Controllers
{
......@@ -281,5 +282,32 @@ namespace AutoTurnOver.Controllers
}
/// <summary>
/// 查询物流费用
/// </summary>
/// <param name="m"></param>
/// <returns></returns>
[HttpPost]
public JsonResult GetFilterLogisticsAssignLine([FromBody]api_logistic_query_input_dto m)
{
try
{
var result = ApiUtility.GetFilterLogisticsAssignLine(m);
return new JsonResult(new
{
data = result,
success = true
});
}
catch (Exception ex)
{
return new JsonResult(new
{
success = false,
message = ex.Message
});
}
}
}
}
\ No newline at end of file
......@@ -40,5 +40,7 @@
"Saas_GetUser": "http://sso.bailuntec.com/GetUserResource",
"Saas_Users": "http://sso.bailuntec.com/GetUserByCompany",
"Saas_Departments": "http://sso.bailuntec.com/GetDepartmentsByCompanyId",
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus"
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"PostPlatCategoryRate": "http://test.profit.bailuntec.com/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
......@@ -40,5 +40,7 @@
"Saas_GetUser": "http://sso.bailuntec.com/GetUserResource",
"Saas_Users": "http://sso.bailuntec.com/GetUserByCompany",
"Saas_Departments": "http://sso.bailuntec.com/GetDepartmentsByCompanyId",
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus"
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"PostPlatCategoryRate": "http://172.31.255.11/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
......@@ -40,5 +40,7 @@
"Saas_GetUser": "http://sso.bailuntec.com/GetUserResource",
"Saas_Users": "http://sso.bailuntec.com/GetUserByCompany",
"Saas_Departments": "http://sso.bailuntec.com/GetDepartmentsByCompanyId",
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus"
"Saas_GetMenus": "http://sso.bailuntec.com/GetMenus",
"ApiLogisticsGetFilterLogisticsAssignLine": "http://lms.bailuntec.com/api/Logistics/ApiLogistics/GetFilterLogisticsAssignLine",
"PostPlatCategoryRate": "http://test.profit.bailuntec.com/api/platfee/ProfitPlatfee/PostPlatCategoryRate"
}
......@@ -15,7 +15,7 @@ namespace ResetOutofstock
Console.WriteLine("刷新缺货数据任务启动...");
//try
//{
// var now = DateTime.Now;
var now = DateTime.Now;
// report_cash_flow_dao.CalculationPurchaseOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")), "P2005250048", "LM-EO-007");
//}
//catch (Exception ex)
......@@ -24,8 +24,9 @@ namespace ResetOutofstock
// throw;
//}
//report.ResetCashFlowData();
//report.ResetCashFlowData();
report.ResetLastweekData();
//report.ResetLastweekData();
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<ResetOutofstockBackgrounService>();
......
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