Commit b67e1e6e by lizefeng

之前没有推送时间的sku ,不计入无库仓数据

parent 115018c1
...@@ -18,6 +18,15 @@ namespace AutoTurnOver.DB ...@@ -18,6 +18,15 @@ namespace AutoTurnOver.DB
//查询采购建议明细 //查询采购建议明细
string url = ConfigHelper.GetValue("SaveDefaultWares"); string url = ConfigHelper.GetValue("SaveDefaultWares");
string resultStr = HttpHelper.Request(url, RequestType.POST, datas.ToJson(), "application/json", timeout: 1000 * 60 * 60 * 24); string resultStr = HttpHelper.Request(url, RequestType.POST, datas.ToJson(), "application/json", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<SaveDefaultWaresResponseDto>();
if (result == null)
{
throw new Exception("skums 系统异常: 推送失败");
}
if (result.statusCode != 200)
{
throw new Exception("skums 系统异常: " + result.message);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -55,6 +55,29 @@ where 1=1 ...@@ -55,6 +55,29 @@ where 1=1
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
if (search != null) if (search != null)
{ {
if (search.search_type > 0 && !string.IsNullOrWhiteSpace(search.key_words))
{
switch (search.search_type)
{
case 1:
sql += " and t_not_stock.product_inner_code=@product_inner_code ";
sqlCount += " and t_not_stock.product_inner_code=@product_inner_code ";
parameters.Add("product_inner_code", search.key_words);
break;
}
}
if (search.push_time_min != null)
{
sql += " and t2.push_time>=@push_time_min ";
sqlCount += " and t2.push_time>=@push_time_min ";
parameters.Add("push_time_min", search.push_time_min.Value.ToString("yyyy-MM-dd 00:00:00"));
}
if (search.push_time_max != null)
{
sql += " and t2.push_time<=@push_time_max ";
sqlCount += " and t2.push_time<=@push_time_max ";
parameters.Add("push_time_max", search.push_time_max.Value.ToString("yyyy-MM-dd 23:59:59"));
}
if (search.goods_sales_min!=null) if (search.goods_sales_min!=null)
{ {
sql += " and t_not_stock.success_sales>=@goods_sales_min "; sql += " and t_not_stock.success_sales>=@goods_sales_min ";
...@@ -212,7 +235,7 @@ where t1.sku = t2.bailun_sku and t2.product_inner_code in @product_inner_codes a ...@@ -212,7 +235,7 @@ where t1.sku = t2.bailun_sku and t2.product_inner_code in @product_inner_codes a
/// </summary> /// </summary>
public static void TransferWarehouse(string product_inner_codes) public static void TransferWarehouse(string product_inner_codes)
{ {
if (!string.IsNullOrWhiteSpace(product_inner_codes)) if (string.IsNullOrWhiteSpace(product_inner_codes))
{ {
throw new Exception("请选择商品"); throw new Exception("请选择商品");
} }
......
...@@ -402,21 +402,14 @@ sum(case when TIMESTAMPDIFF(day,t1.pay_time,now())<=7 then t1.bailun_sku_quantit ...@@ -402,21 +402,14 @@ sum(case when TIMESTAMPDIFF(day,t1.pay_time,now())<=7 then t1.bailun_sku_quantit
from dc_base_sku as t2 from dc_base_sku as t2
left join dc_base_oms_sku as t1 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_base_oms_sku as t1 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code left join dc_auto_config_sku_warehouse as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
where t2.warehouse_code='BLGZ03' and (t1.id is null or t1.bailun_order_status!='Canceled') and (t3.`status`=0 or t3.`status` is null) where t2.warehouse_code='BLGZ03' and (t1.id is null or t1.bailun_order_status!='Canceled') and (t3.`status`=0 or t3.`status` is null) and t2.push_time >= '2010-01-01'
GROUP BY t2.product_inner_code,t2.warehouse_code GROUP BY t2.product_inner_code,t2.warehouse_code
); );
alter table dc_not_stock_goods_sales rename dc_not_stock_goods_salesTemp; alter table dc_not_stock_goods_sales rename dc_not_stock_goods_salesTemp;
alter table dc_not_stock_goods_sales_temp rename dc_not_stock_goods_sales; alter table dc_not_stock_goods_sales_temp rename dc_not_stock_goods_sales;
alter table dc_not_stock_goods_salesTemp rename dc_not_stock_goods_sales_temp; alter table dc_not_stock_goods_salesTemp rename dc_not_stock_goods_sales_temp;
truncate table dc_not_stock_goods_sales_temp; truncate table dc_not_stock_goods_sales_temp; ", commandTimeout: 0);
", commandTimeout: 0);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -15,4 +15,11 @@ namespace AutoTurnOver.Models.ApiDto ...@@ -15,4 +15,11 @@ namespace AutoTurnOver.Models.ApiDto
public int areaId { get; set; } public int areaId { get; set; }
} }
public class SaveDefaultWaresResponseDto
{
public int statusCode { get; set; }
public string message { get; set; }
}
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
public class EliminateRequestDto
{
public string product_inner_codes { get; set; }
}
}
...@@ -106,6 +106,12 @@ namespace AutoTurnOver.Models ...@@ -106,6 +106,12 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public int? source_type { get; set; } public int? source_type { get; set; }
public int search_type { get; set; }
public string key_words { get; set; }
public DateTime? push_time_min { get; set; }
public DateTime? push_time_max { get; set; }
} }
public enum source_enum public enum source_enum
......
...@@ -16,14 +16,19 @@ namespace AutoTurnOver.Controllers ...@@ -16,14 +16,19 @@ namespace AutoTurnOver.Controllers
public class NotStockController : Controller public class NotStockController : Controller
{ {
[HttpGet] [HttpGet]
public JsonResult List(int limit, int offset, string order, string sort, decimal? goods_sales_max, decimal? goods_sales_min, int? source_type, int? success_states) public JsonResult List(int limit, int offset, string order, string sort, decimal? goods_sales_max, decimal? goods_sales_min,
int? source_type, int? success_states,int search_type,string key_words,DateTime? push_time_max, DateTime? push_time_min)
{ {
var m = new dc_not_stock_search_dto var m = new dc_not_stock_search_dto
{ {
goods_sales_max = goods_sales_max, goods_sales_max = goods_sales_max,
goods_sales_min = goods_sales_min, goods_sales_min = goods_sales_min,
source_type = source_type, source_type = source_type,
success_states = success_states success_states = success_states,
search_type = search_type,
key_words = key_words,
push_time_min = push_time_min,
push_time_max = push_time_max
}; };
var total = 0; var total = 0;
...@@ -42,11 +47,11 @@ namespace AutoTurnOver.Controllers ...@@ -42,11 +47,11 @@ namespace AutoTurnOver.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public JsonResult Eliminate([FromBody]string product_inner_codes) public JsonResult Eliminate([FromBody]EliminateRequestDto data)
{ {
try try
{ {
new Services.NotStockServices().Eliminate(product_inner_codes); new Services.NotStockServices().Eliminate(data.product_inner_codes);
return new JsonResult(new return new JsonResult(new
{ {
success = true success = true
...@@ -64,11 +69,11 @@ namespace AutoTurnOver.Controllers ...@@ -64,11 +69,11 @@ namespace AutoTurnOver.Controllers
} }
[HttpPost] [HttpPost]
public JsonResult TransferWarehouse([FromBody]string product_inner_codes) public JsonResult TransferWarehouse([FromBody]EliminateRequestDto data)
{ {
try try
{ {
new Services.NotStockServices().TransferWarehouse(product_inner_codes); new Services.NotStockServices().TransferWarehouse(data.product_inner_codes);
return new JsonResult(new return new JsonResult(new
{ {
success = true success = true
......
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
"Password": "SpaceHorse1", "Password": "SpaceHorse1",
"Defaultdatabase": 0 "Defaultdatabase": 0
}, },
"SaveDefaultWares": "http://api.skums.bailuntec.com/api/sku/productsku/gmtproductskus" "SaveDefaultWares": "http://api.skums.bailuntec.com/api/sku/productware/savedefaultwares"
} }
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