Commit 53eae7fa by lizefeng

把 在库+在途>缺货的改成0

parent 51851035
...@@ -39,9 +39,16 @@ namespace AutoTurnOver.DB ...@@ -39,9 +39,16 @@ namespace AutoTurnOver.DB
_connection.Execute(@" update _connection.Execute(@" update
dc_auto_turnover as t1, dc_auto_turnover as t1,
dc_base_sku as t2 dc_base_sku as t2
set t1.quantity_init_advise=IFNULL(t1.quantity_out_stock,0) set t1.quantity_init_advise=( t1.quantity_out_stock - ( t1.quantity_inventory + t1.quantity_transfer + t1.quantity_purchase ) )
where t1.bailun_sku = t2.bailun_sku where t1.bailun_sku = t2.bailun_sku
and t2.buyer_name='赵美聪' ", commandTimeout: 0); and t2.buyer_name='赵美聪' and ( t1.quantity_inventory + t1.quantity_transfer + t1.quantity_purchase < t1.quantity_out_stock ) ", commandTimeout: 0);
// 把 在库+在途>缺货的改成0
_connection.Execute(@" update
dc_auto_turnover as t1,
dc_base_sku as t2
set t1.quantity_init_advise=0
where t1.bailun_sku = t2.bailun_sku
and t2.buyer_name='赵美聪' and ( t1.quantity_inventory + t1.quantity_transfer + t1.quantity_purchase >= t1.quantity_out_stock ) ", commandTimeout: 0);
// 生成采购建议 // 生成采购建议
_connection.Execute(@" _connection.Execute(@"
......
...@@ -131,7 +131,7 @@ namespace AutoTurnOver.Services ...@@ -131,7 +131,7 @@ namespace AutoTurnOver.Services
{ {
//查询采购建议明细 //查询采购建议明细
string url = ConfigHelper.GetValue("PushBuyPlan"); string url = ConfigHelper.GetValue("PushBuyPlan");
string resultStr = HttpHelper.Request(url, RequestType.POST, "obj=" + WebUtility.UrlDecode(data.ToJson()), timeout: 0); string resultStr = HttpHelper.Request(url, RequestType.POST, "obj=" + WebUtility.UrlDecode(data.ToJson()), timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<BuyOutputResult>(); var result = resultStr.ToObj<BuyOutputResult>();
if (result == null) if (result == null)
{ {
......
...@@ -16,9 +16,9 @@ namespace AutoTurnOver.Utility ...@@ -16,9 +16,9 @@ namespace AutoTurnOver.Utility
public static string Request(string url, RequestType type, string data = "", string entype = null, int timeout = 0) public static string Request(string url, RequestType type, string data = "", string entype = null, int timeout = 0)
{ {
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
if (timeout < 0) if (timeout <= 0)
{ {
request.Timeout = 0x927c0; request.Timeout = 1000 * 30 ;
} }
else else
{ {
......
...@@ -25,7 +25,7 @@ namespace AutoTurnOver.Common ...@@ -25,7 +25,7 @@ namespace AutoTurnOver.Common
try try
{ {
string cookie; string cookie;
current.Request.Cookies.TryGetValue("BLUserAcct",out cookie); current.Request.Cookies.TryGetValue("BLUserAcct",out cookie);
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json"); var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
var configurationRoot = builder.Build(); var configurationRoot = builder.Build();
string url = ConfigHelper.GetValue("WebHost_GetUser"); string url = ConfigHelper.GetValue("WebHost_GetUser");
...@@ -42,7 +42,7 @@ namespace AutoTurnOver.Common ...@@ -42,7 +42,7 @@ namespace AutoTurnOver.Common
return data.data; return data.data;
} }
} }
catch catch(Exception ex)
{ {
current.Response.StatusCode = (int)HttpStatusCode.Unauthorized; current.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
return null; return null;
......
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