Commit 1ebde957 by 泽锋 李

销量设置支持批量设置;

年度销量趋势按照仓库的国家进行汇总;日均只需要显示一位小数
修复周转表数据停止监控后,明细日期显示异常的问题;
parent 7924308a
......@@ -67,7 +67,7 @@ namespace AutoGeneratePurchaseAdvise
}
// 判断是不是指定的时间
if (now.Hour == 10 && now.Minute == 1)
if (now.Hour == 09 && now.Minute == 1)
{
Console.WriteLine($"开始 推送采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
......
......@@ -20,7 +20,7 @@ namespace AutoGeneratePurchaseAdvise
//purchase_advise.ReplaceLogistics(DateTime.Now);
//purchase_advise.WaitReplaceLogisticsTask();
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("2020-11-27 14:50:00")));
//PurchaseAdviseServices.AutoPushBuySys(6);
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 12:00:00")));
}
......
{
"ConnectionStrings": {
"Default": "server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;",
"ReadOnly": "server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
"ReadOnly": "server=gz-cdbrg-qdyec2j3.sql.tencentcdb.com;port=59667;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
},
"PushBuyPlan": "http://api.purchase.bailuntec.com/api/CreatePlanToPurchase",
"QiNiu": {
......
......@@ -6,6 +6,7 @@ using System.Linq;
using AutoTurnOver.Models.ApiDto;
using MySql.Data.MySqlClient;
using System.Text;
using AutoTurnOver.Utility;
namespace AutoTurnOver.DB
{
......@@ -575,8 +576,23 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
}
sql += " limit " + offset + "," + limit;
}
var obj = _connection.Query<dc_base_stock_dto>(sql, parameters, buffered: false, commandTimeout: 0);
return obj.AsList();
var obj = _connection.Query<dc_base_stock_dto>(sql, parameters, buffered: false, commandTimeout: 0).AsList();
foreach (var item in obj)
{
item.history_sevenday_sales = item.history_sevenday_sales.Round1();
item.history_fourteenday_sales = item.history_fourteenday_sales.Round1();
item.history_thirtyday_sales = item.history_thirtyday_sales.Round1();
item.history_sevenday_sales_ebay = item.history_sevenday_sales_ebay.Round1();
item.history_fourteenday_sales_ebay = item.history_fourteenday_sales_ebay.Round1();
item.history_thirtyday_sales_ebay = item.history_thirtyday_sales_ebay.Round1();
item.history_sevenday_sales_aliexpress = item.history_sevenday_sales_aliexpress.Round1();
item.history_fourteenday_sales_aliexpress = item.history_fourteenday_sales_aliexpress.Round1();
item.history_thirtyday_sales_aliexpress = item.history_thirtyday_sales_aliexpress.Round1();
item.history_sevenday_sales_amazon = item.history_sevenday_sales_amazon.Round1();
item.history_fourteenday_sales_amazon = item.history_fourteenday_sales_amazon.Round1();
item.history_thirtyday_sales_amazon = item.history_thirtyday_sales_amazon.Round1();
}
return obj;
}
/// <summary>
......
......@@ -1796,6 +1796,21 @@ and start_date<=@end_date and end_date>=@start_date
}
}
public static string BatchSaveSalesDayConfig(batch_sales_day_config_input_dto m, UserData user)
{
foreach (var item in m.datas)
{
SaveSalesDayConfig(new sales_day_config_input_dto()
{
bailun_sku = m.bailun_sku,
warehouse_code = m.warehouse_code,
date = item.date,
sales = item.sales
}, user);
}
return "";
}
/// <summary>
/// 删除配置
/// </summary>
......@@ -1806,6 +1821,16 @@ and start_date<=@end_date and end_date>=@start_date
_connection.Execute(" delete from sales_day_config where id=@id ", new { id = id });
return "";
}
/// <summary>
/// 删除配置
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static string BatchSaveSalesDayConfigDelete(string bailun_sku, string warehouse_code)
{
_connection.Execute(" delete from sales_day_config where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = bailun_sku, warehouse_code = warehouse_code });
return "";
}
public static dc_report_cash_flow_config GetCashFlowById(int id)
{
......
......@@ -8,6 +8,7 @@ using System.Linq;
using AutoTurnOver.Models.Base;
using AutoTurnOver.DB.Base;
using AutoTurnOver.Models.stock;
using AutoTurnOver.Utility;
namespace AutoTurnOver.DB
{
......@@ -297,10 +298,24 @@ from dc_auto_turnover as dat
var obj = _connection.Query<Models.dc_auto_turnover_list_dto>(sql, parameters, commandTimeout: 0);
var obj = _connection.Query<Models.dc_auto_turnover_list_dto>(sql, parameters, commandTimeout: 0).AsList();
//Console.WriteLine(sql);
return obj.AsList();
foreach (var item in obj)
{
item.history_sevenday_sales = item.history_sevenday_sales.Round1();
item.history_fourteenday_sales = item.history_fourteenday_sales.Round1();
item.history_thirtyday_sales = item.history_thirtyday_sales.Round1();
item.history_sevenday_sales_ebay = item.history_sevenday_sales_ebay.Round1();
item.history_fourteenday_sales_ebay = item.history_fourteenday_sales_ebay.Round1();
item.history_thirtyday_sales_ebay = item.history_thirtyday_sales_ebay.Round1();
item.history_sevenday_sales_aliexpress = item.history_sevenday_sales_aliexpress.Round1();
item.history_fourteenday_sales_aliexpress = item.history_fourteenday_sales_aliexpress.Round1();
item.history_thirtyday_sales_aliexpress = item.history_thirtyday_sales_aliexpress.Round1();
item.history_sevenday_sales_amazon = item.history_sevenday_sales_amazon.Round1();
item.history_fourteenday_sales_amazon = item.history_fourteenday_sales_amazon.Round1();
item.history_thirtyday_sales_amazon = item.history_thirtyday_sales_amazon.Round1();
}
return obj;
}
catch (Exception ex)
{
......
......@@ -67,6 +67,22 @@ namespace AutoTurnOver.DB
// 有时效符合条件的物流可用
if (selectItem != null)
{
var default_head_transport_config = _connection.QueryFirstOrDefault<dc_base_head_transport_config>(" select * from dc_base_head_transport_config where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{
bailun_sku = item.bailun_sku,
warehouse_code = item.warehouse_code
});
var remarks = $" 预计于:{item.start_time.ToString("yyyy-MM-dd")} 将缺货, 预计采购到货:{(DateTime.Now.AddDays(item.payment_before_delivery + item.inspection_delivery + item.supplier_delivery).ToString("yyyy-MM-dd"))}{ item.quantity }个 。\n 默认物流方案: ";
if (default_head_transport_config != null)
{
remarks += $"{default_head_transport_config.head_transport}-{default_head_transport_config.logistics_name} ( {default_head_transport_config.logistics_code} )";
}
else
{
remarks += " 未配置 ";
}
remarks += $" \n 默认时效 调拨天数: {item.transfer_delivery} , 入库天数:{item.abroad_inbound_delivery} 预计入库:{DateTime.Now.AddDays(item.payment_before_delivery + item.inspection_delivery + item.supplier_delivery + (int)Math.Round(item.transfer_delivery) + (int)Math.Round(item.abroad_inbound_delivery, 0)).ToString("yyyy-MM-dd")}";
remarks += $" \n 当前推荐物流平均时效 调拨天数: {Math.Round(selectItem.avg_sign_days)} , 入库天数:{Math.Round(selectItem.avg_put_days,0)} \n 预计入库 :{DateTime.Now.AddDays(item.payment_before_delivery + item.inspection_delivery + item.supplier_delivery + (int)Math.Round(selectItem.avg_sign_days) + (int)Math.Round(selectItem.avg_put_days, 0)).ToString("yyyy-MM-dd")} ";
_connection.Insert(new dc_auto_replace_logistics_task
{
bailun_sku = item.bailun_sku,
......@@ -84,7 +100,8 @@ namespace AutoTurnOver.DB
warehouse_code = item.warehouse_code,
update_date = DateTime.Now,
logistics_name = selectItem.logistics_name,
transport_type = selectItem.transport_type
transport_type = selectItem.transport_type,
remarks = remarks,
});
}
}
......@@ -128,7 +145,8 @@ t3.turnover_days,
t2.area_name,
t3.abroad_inbound_delivery,
t3.transfer_bale_delivery,
t3.transfer_delivery
t3.transfer_delivery,
t1.quantity
from dc_auto_forecast_fluctuation as t1
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
left join dc_auto_turnover as t3 on t1.warehouse_code =t3.warehouse_code and t1.bailun_sku = t3.bailun_sku
......@@ -373,7 +391,9 @@ select
) as 'purchase_type_jit',
t1.auto_replace_logistics_task_id,
tr_task.logistics_code,
tr_task.transport_type as 'task_transport_type'
tr_task.logistics_name,
tr_task.transport_type as 'task_transport_type',
tr_task.remarks as 'replace_logistics_remarks'
from dc_auto_turnover as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
......
......@@ -1062,19 +1062,18 @@ end
var etime = DateTime.Parse( btime.ToString("yyyy-12-31 23:59:59"));
// 查询基础数据
var base_datas = _connection.Query<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where product_type=@product_type and `date`>=@btime and `date`<=@etime ",new {
product_type = product_type,
var base_datas = _connection.Query<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where `date`>=@btime and `date`<=@etime and warehouse_type!='耗材仓' ", new {
btime = btime,
etime = etime
});
var months = new List<int> { 1,2,3,4,5,6,7,8,9,10,11,12};
var legendGroups = base_datas.GroupBy(s => s.country_code).OrderByDescending(s=>s.Sum(v=>v.sales)>=100).Take(10).ToList();
var legendGroups = base_datas.GroupBy(s => new { s.country_code ,s.warehouse_type}).ToList();
return new {
title = base_datas.Min(s=>s.product_type_desc),
legendDatas = legendGroups.Select(s=>s.Key),
xAxisDatas = months,
title = "年度销量趋势表",
legendDatas = legendGroups.Select(s=>$"{s.Key.warehouse_type}-{s.Key.country_code}" ),
xAxisDatas = months.Select(s=>$"{s}月"),
seriesDatas = legendGroups.Select(s=>new {
name = s.Key,
name = $"{s.Key.warehouse_type}-{s.Key.country_code}",
type = "line",
data = months.Select(m=> s.Where(b=>b.date.Month==m ).Sum(su=>su.sales))
})
......@@ -3828,59 +3827,63 @@ group by warehouse_code
var btime = DateTime.Now.AddYears(-1).ToString("yyyy-01-01 00:00:00");
var datas = _connection.Query<dc_report_sales_trend_year>(@"
select
ifnull(t2.product_type,-1) as 'product_type',
ifnull(t2.product_type_desc,'未知') as 'product_type_desc',
sum(t1.bailun_sku_quantity_ordered) as 'sales',
t1.receipt_country as 'country_code',
t2.area_name as 'country_code',
t2.hq_type as 'warehouse_type',
date_format(paid_time, '%Y-%m') as 'date_str',
paid_time as 'date',
1 as 'year_growth_rate',
now() as 'create_date',
now() as 'update_date'
from dc_base_oms_sku as t1
left join dc_base_sku as t2 on t1.bailun_sku =t2.bailun_sku
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
where t1.bailun_order_status != 'Canceled'
and t1.has_delete = 0
and t1.has_scalp = 0
and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0
and t1.paid_time>='2019-01-01' and t1.paid_time<'2020-01-01'
GROUP BY t2.product_type,t2.product_type_desc,t1.receipt_country,date_format(paid_time, '%Y-%m')
and t1.paid_time>=@btime -- and t1.paid_time<'2020-01-10'
GROUP BY t2.hq_type,t2.area_name,date_format(paid_time, '%Y-%m')
", new { btime },commandTimeout:0).ToList();
foreach (var item in datas)
{
var oldData = _connection.QuerySingleOrDefault<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where date_str=@date_str and product_type_desc=@product_type_desc and country_code=@country_code ",new {
country_code = item.country_code,
product_type_desc = item.product_type_desc,
date_str = item.date_str
});
if (oldData != null)
if(item.warehouse_type!=null && item.country_code != null)
{
item.year_growth_rate = oldData.year_growth_rate;
item.id = oldData.id;
}
var oldData = _connection.QuerySingleOrDefault<dc_report_sales_trend_year>(" select * from dc_report_sales_trend_year where date_str=@date_str and warehouse_type=@warehouse_type and country_code=@country_code ", new
{
country_code = item.country_code,
warehouse_type = item.warehouse_type,
date_str = item.date_str
});
var lastMonthDateStr = item.date.AddMonths(-1).ToString("yyyy-MM");
var lastMonthData = datas.FirstOrDefault(s => s.country_code == item.country_code && s.product_type_desc == item.product_type_desc && s.date_str == lastMonthDateStr);
if (lastMonthData != null && lastMonthData.sales > 0)
{
item.month_growth_rate = item.sales / lastMonthData.sales;
}
else
{
item.month_growth_rate = 1;
}
if (oldData != null)
{
item.year_growth_rate = oldData.year_growth_rate;
item.id = oldData.id;
}
if (item.id > 0)
{
_connection.Update(item);
}
else
{
_connection.Insert(item);
var lastMonthDateStr = item.date.AddMonths(-1).ToString("yyyy-MM");
var lastMonthData = datas.FirstOrDefault(s => s.country_code == item.country_code && s.warehouse_type == item.warehouse_type && s.date_str == lastMonthDateStr);
if (lastMonthData != null && lastMonthData.sales > 0)
{
item.month_growth_rate = item.sales / lastMonthData.sales;
}
else
{
item.month_growth_rate = 1;
}
if (item.id > 0)
{
_connection.Update(item);
}
else
{
_connection.Insert(item);
}
}
}
}
......
......@@ -7,8 +7,10 @@ namespace AutoTurnOver.Models.Report
public class dc_report_sales_trend_year
{
public int id { get; set; }
public string product_type { get; set; }
public string product_type_desc { get; set; }
/// <summary>
/// 仓库类型
/// </summary>
public string warehouse_type { get; set; }
public string date_str { get; set; }
public DateTime date { get; set; }
public string country_code { get; set; }
......
......@@ -11,6 +11,7 @@ namespace AutoTurnOver.Models.auto
public string warehouse_code { get; set; }
public string logistics_name { get; set; }
public string transport_type { get; set; }
public string remarks { get; set; }
public decimal transfer_bale_delivery { get; set; }
public decimal abroad_inbound_delivery { get; set; }
public decimal transfer_delivery { get; set; }
......
......@@ -8,6 +8,7 @@ namespace AutoTurnOver.Models.auto
{
public int id { get; set; }
public string bailun_sku { get; set; }
public int quantity { get; set; }
public string warehouse_code { get; set; }
public DateTime start_time { get; set; }
......
......@@ -29,4 +29,19 @@ namespace AutoTurnOver.Models.auto
public DateTime date { get; set; }
public decimal sales { get; set; }
}
public class batch_sales_day_config_input_dto
{
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
public List<data_dto> datas { get; set; }
public class data_dto
{
public DateTime date { get; set; }
public decimal sales { get; set; }
}
}
}
......@@ -185,12 +185,18 @@ namespace AutoTurnOver.Models
/// 推荐发送的渠道
/// </summary>
public string logistics_code { get; set; }
public string logistics_name { get; set; }
/// <summary>
/// 推荐发送的运输方式
/// </summary>
public string task_transport_type { get; set; }
/// <summary>
/// 物流切换备注
/// </summary>
public string replace_logistics_remarks { get; set; }
}
......
......@@ -11,6 +11,7 @@ namespace AutoTurnOver.Models
public string warehouse_code { get; set; }
public string head_transport { get; set; }
public string logistics_code { get; set; }
public string logistics_name { get; set; }
public DateTime create_date { get; set; }
public string create_user { get; set; }
public int is_delete { get; set; }
......
......@@ -998,11 +998,22 @@ namespace AutoTurnOver.Services
return DB.db_config.SaveSalesDayConfig(m, user);
}
public string BatchSaveSalesDayConfig(batch_sales_day_config_input_dto m,UserData user)
{
return DB.db_config.BatchSaveSalesDayConfig(m, user);
}
public string SaveSalesDayConfigDelete(int id )
{
return DB.db_config.SaveSalesDayConfigDelete(id);
}
public string BatchSaveSalesDayConfigDelete(string bailun_sku, string warehouse_code)
{
return DB.db_config.BatchSaveSalesDayConfigDelete(bailun_sku, warehouse_code);
}
public dc_report_cash_flow_config GetCashFlowById(int id)
......
......@@ -127,13 +127,14 @@ namespace AutoTurnOver.Services
var datas = new List<dc_auto_purchase_advise_detailed_dto>();
if (type == 1)
{
var new_remarks = ((remarks ?? "") +"系统切换更快的头程渠道:需要审核");
PushBuySys(2, original_datas, user, is_skip_error, new_remarks);
PushBuySys(2, original_datas, user, is_skip_error, remarks);
datas = json_datas.Where(s => s.auto_replace_logistics_task_id == null || s.auto_replace_logistics_task_id <= 0).ToList();
}
else if(type==2){
datas = json_datas.Where(s => s.auto_replace_logistics_task_id >0).ToList();
remarks = ((remarks ?? "") +"\n"+string.Join(",",datas.Select(s=> s.bailun_sku+":" +s.replace_logistics_remarks??"")));
}
if (datas == null || datas.Count<=0)
......@@ -155,7 +156,7 @@ namespace AutoTurnOver.Services
bp_sendtoCode = item.Key.warehouse_type != "国内仓" ? item.Key.warehouse_code : null,
sys_source = item.Any(s => s.type == 2) ? 2 : item.Any(s => s.type == 1) ? 1 : 3,
bi_buyplandetail = new List<bi_buyplandetail>(),
bp_remark = $"用户{user.UserName} 在 aims 操作推送-"+ remarks,
bp_remark = $"用户{user.UserName} 在 aims 操作推送- "+ remarks,
logistics_code = item.Min(v=>v.logistics_code)
};
......
......@@ -292,5 +292,16 @@ namespace AutoTurnOver.Utility
return new DateTime(time.Year, time.Month, day);
}
}
/// <summary>
/// 四舍五入保留一位小数
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
public static decimal Round1(this decimal val)
{
return Math.Round(val, 1);
}
}
}
......@@ -982,16 +982,33 @@ namespace AutoTurnOver.Controllers
return new JsonResult(result);
}
[HttpPost]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【周转表】->【手工配置销量】操作", 1)]
public JsonResult BatchSaveSalesDayConfig([FromBody]batch_sales_day_config_input_dto m)
{
var result = new Services.ConfigServices().BatchSaveSalesDayConfig(m, AutoUtility.GetUser());
return new JsonResult(result);
}
[HttpGet]
[UseAction]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【周转表】->【手工配置销量】删除", 1)]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【周转表】->【清除销量配置】删除", 1)]
public JsonResult SaveSalesDayConfigDelete(int id)
{
var result = new Services.ConfigServices().SaveSalesDayConfigDelete(id);
return new JsonResult(result);
}
[HttpGet]
[UseAction]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【周转表】->【批量清除销量配置】删除", 1)]
public JsonResult BatchSaveSalesDayConfigDelete(string bailun_sku,string warehouse_code)
{
var result = new Services.ConfigServices().BatchSaveSalesDayConfigDelete(bailun_sku, warehouse_code);
return new JsonResult(result);
}
/// <summary>
/// 导入
/// </summary>
......
......@@ -302,7 +302,7 @@ namespace AutoTurnOver.Controllers
[BrowseLog("Bailun_aims", "访问【百伦自动周转系统】->【自动下单管理】->【采购建议列表】->【推送采购系统】页面", 0)]
public JsonResult PushBuySys(int limit, int offset, int main_id, string sort, string sku, string warehousecode,
DateTime? end_date, DateTime? start_date, string warehousetype, int? warehousearea, string order,
bool? ispush = null, int? type = null, string supplier_name = null, string purchase_user = null, string product_inner_code = null, bool? is_multiple_warehouse = false,
bool? ispush = null, int? type = null, string supplier_name = null, string purchase_user = null, string product_inner_code = null, bool? is_multiple_warehouse = false, int? is_replace_logistics = null,
decimal? quantity_final_advise_price_max = null, decimal? quantity_final_advise_price_min = null, int? purchase_type_jit = null)
{
try
......@@ -324,7 +324,8 @@ namespace AutoTurnOver.Controllers
is_multiple_warehouse = is_multiple_warehouse.Value,
quantity_final_advise_price_max = quantity_final_advise_price_max,
quantity_final_advise_price_min = quantity_final_advise_price_min,
purchase_type_jit = purchase_type_jit
purchase_type_jit = purchase_type_jit,
is_replace_logistics = is_replace_logistics
};
var total = 0;
......
......@@ -57,8 +57,15 @@ namespace AutoTurnOver.Controllers
});
//[0.13, 0.12, 0.11, 0.11, 0.1, 0.09, 0.09, 0.08, 0.08, 0.07, 0.06, 0.06, 0.05, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
var turnover_date = MyMySqlConnection._connection_read_only.QueryFirstOrDefault<DateTime>(" select gmt_modified from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{
bailun_sku = sku,
warehouse_code = warehousecode
});
var date = new List<string>();
var today = DateTime.Now.AddDays(-7);
var today = turnover_date.AddDays(-7);
var weeks = new List<dynamic>();
var sales_day_configs = new List<dynamic>();
for (var i = 0; i < count; i++)
......@@ -68,7 +75,7 @@ namespace AutoTurnOver.Controllers
}
for (var i = -7; i < count; i++)
{
var dateI = today.AddDays(i);
var dateI = today.AddDays(i+7);
var date_str = dateI.ToString("yyyy-MM-dd");
var weekItem = dc_base_week_coefficient_datas.FirstOrDefault(s => s.week == (int)dateI.DayOfWeek);
......
......@@ -129,7 +129,7 @@ namespace AutoTurnOver.Models
SaasUserInfo userInfoData = userInfo.ToObj<SaasUserInfo>();
var controllerName = controllerActionDescriptor.ControllerTypeInfo.Name.Replace("Controller", "");
var requst_url = ("/api/" + controllerName + "/" + controllerActionDescriptor.MethodInfo.Name);
if (!userInfoData.menuInfoDtos.Any(s => s.menuUrl_list.Any(m => m != null && requst_url.Equals(m, StringComparison.OrdinalIgnoreCase))))
if (!userInfoData.menuInfoDtos.Any(s => s.menuUrl_list!=null && s.menuUrl_list.Any(m => m != null && requst_url.Equals(m, StringComparison.OrdinalIgnoreCase))))
{
context.Response.StatusCode = 401;
filterContext.Result = new ContentResult
......
......@@ -21,7 +21,7 @@ namespace ResetOutofstock
//dc_auto_pick_up_goods_order_dao.GenerateOrder(DateTime.Now.AddDays(-3), DateTime.Now);
//report.PurchaseWeekBackUp();
//report.ResetOmsOutofstock();
//report.CalculationSalesTrend();
}
catch (Exception ex)
{
......
......@@ -153,6 +153,7 @@ namespace ResetOutofstock
{
if (DateTime.Now.Hour >= 8)
{
Console.WriteLine($"开始刷新库存监控数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetStockMonitorData();
Console.WriteLine($"结束刷新库存监控数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
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