Commit 98b9dadb by 泽锋 李

fix

parent 6fa7d598
......@@ -1022,6 +1022,38 @@ from dc_auto_turnover where gmt_modified>=@btime and gmt_modified<=@etime
)
", new { btime = DateTime.Now.ToDayHome(), etime = DateTime.Now.ToDayEnd() });
}
/// <summary>
/// 获取数据来源
/// </summary>
/// <returns></returns>
public static List<dc_base_order_data_source> GetOrderDataSource(dc_base_order_data_source_search_dto searchData, int offset, int limit, ref int total)
{
var sql = " select * from dc_base_order_data_source as t1 where 1=1 ";
var countSql = " select count(1) from dc_base_order_data_source as t1 where 1=1 ";
DynamicParameters parameters = new DynamicParameters();
if(!string.IsNullOrWhiteSpace(searchData.bailun_sku))
{
sql += " and t1.bailun_sku=@bailun_sku ";
countSql += " and t1.bailun_sku=@bailun_sku ";
parameters.Add("bailun_sku",searchData.bailun_sku);
}
if (!string.IsNullOrWhiteSpace(searchData.warehouse_code))
{
sql += " and t1.warehouse_code=@warehouse_code ";
countSql += " and t1.warehouse_code=@warehouse_code ";
parameters.Add("warehouse_code", searchData.warehouse_code);
}
if (!string.IsNullOrWhiteSpace(searchData.order_type_str))
{
sql += " and t1.order_type=@order_type ";
countSql += " and t1.order_type=@order_type ";
parameters.Add("order_type", searchData.order_type_str);
}
sql += " limit " + offset + "," + limit;
total = _connection.QueryFirstOrDefault<int>(countSql, parameters);
return _connection.Query<dc_base_order_data_source>(sql, parameters).AsList();
}
}
......
......@@ -20,4 +20,29 @@ namespace AutoTurnOver.Models
public string logistics_name { get; set; }
public string transport_type { get; set; }
}
public class dc_base_order_data_source_search_dto
{
public int order_type { get; set; }
public string order_type_str { get {
if (order_type == 11)
{
return "采购单-签收天数计算";
}
else if (order_type == 12)
{
return "采购单-质检入库天数计算";
}
else if (order_type == 2)
{
return "调拨单-平均天数计算";
}
else
{
return "";
}
} }
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
}
}
......@@ -31,7 +31,7 @@ namespace AutoTurnOver.Purchase.AverageTarget
//PurchaseAverageTargetServices.CalculationTransfer();
//report.ResetTransExpectArrivaltime();
//dc_auto_return_goods_config_dao.NewCalculation();
//PurchaseAverageTargetServices.CalculationTransfer(days: 180);
//PurchaseAverageTargetServices.CalculationTransfer("948890401", days: 360);
}
catch (Exception ex)
{
......
......@@ -31,6 +31,11 @@ namespace AutoTurnOver.Services
m.categoryModels = ApiServices.GetNewClientNodesByIds(m.categoryIds.Split(',').Select(s=>int.Parse(s)).ToList());
}
return DB.dc_auto_turnover.List(m,offset, limit, ref total,order,sort, isSum);
}
public List<dc_base_order_data_source> GetOrderDataSource(dc_base_order_data_source_search_dto m,int offset, int limit, ref int total)
{
return DB.dc_auto_turnover.GetOrderDataSource(m,offset, limit, ref total);
}
public IEnumerable<string> GetLabelList() {
......
......@@ -56,6 +56,40 @@ namespace AutoTurnOver.Controllers
}
}
/// <summary>
/// 查看平均数的数据来源
/// </summary>
/// <param name="m"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <returns></returns>
public JsonResult GetOrderDataSource([FromQuery] dc_base_order_data_source_search_dto m, [FromQuery] int offset, [FromQuery] int limit)
{
try
{
var total = 0;
var service = new Services.SkuAutoTurnServices();
var list = service.GetOrderDataSource(m, offset, limit, ref total);
return new JsonResult(new
{
rows = list,
total = total,
pagecount = (total / limit + (total % limit > 0 ? 1 : 0))
});
}
catch (Exception ex)
{
return new JsonResult(new
{
message = ex.Message,
stack_trace = ex.StackTrace
});
}
}
public JsonResult GetLabelList()
{
......
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