Commit 53eae7fa by lizefeng

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

parent 51851035
......@@ -39,9 +39,16 @@ namespace AutoTurnOver.DB
_connection.Execute(@" update
dc_auto_turnover as t1,
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
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(@"
......
......@@ -131,7 +131,7 @@ namespace AutoTurnOver.Services
{
//查询采购建议明细
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>();
if (result == null)
{
......
......@@ -16,9 +16,9 @@ namespace AutoTurnOver.Utility
public static string Request(string url, RequestType type, string data = "", string entype = null, int timeout = 0)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
if (timeout < 0)
if (timeout <= 0)
{
request.Timeout = 0x927c0;
request.Timeout = 1000 * 30 ;
}
else
{
......
......@@ -25,7 +25,7 @@ namespace AutoTurnOver.Common
try
{
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 configurationRoot = builder.Build();
string url = ConfigHelper.GetValue("WebHost_GetUser");
......@@ -42,7 +42,7 @@ namespace AutoTurnOver.Common
return data.data;
}
}
catch
catch(Exception ex)
{
current.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
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