Commit 4844f52f by guanzhenshan

增加获取拦截itemid的数量接口

parent 25a160da
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Orders
{
/// <summary>
/// 拦截订单itemid
/// </summary>
public class mInterceptOrderItemid
{
/// <summary>
/// 平台类型
/// </summary>
public string platform_type { get; set; }
/// <summary>
/// 平台单号
/// </summary>
public string origin_order_id { get; set; }
/// <summary>
/// 付款时间
/// </summary>
public DateTime paid_time { get; set; }
/// <summary>
/// itemid
/// </summary>
public string item_id { get; set; }
/// <summary>
/// 拦截数量
/// </summary>
public int count { get; set; }
/// <summary>
/// 最后更新时间
/// </summary>
public DateTime gmt_modified { get; set; }
}
}
...@@ -4662,6 +4662,49 @@ namespace Bailun.DC.Services ...@@ -4662,6 +4662,49 @@ namespace Bailun.DC.Services
#endregion #endregion
#region 拦截订单
public List<mInterceptOrderItemid> ListInterceptOrderItemId(int page,int pagesize,DateTime? start, DateTime? end, string platform)
{
var sqlparam = new DynamicParameters();
var sql = "select origin_order_id,paid_time,item_id,(platform_sku_quantity_ordered-platform_sku_quantity_shipped) count,gmt_modified from dc_base_oms_platform_sku where bailun_order_status!='Canceled' and bailun_payment_status!='Canceled' and bailun_interception_status!='None' and platform_sku_quantity_ordered>platform_sku_quantity_shipped ";
if (start.HasValue)
{
sql += " and gmt_modified>=@start";
sqlparam.Add("start", start.Value);
}
if (end.HasValue)
{
sql += " and gmt_modified<@end";
sqlparam.Add("end", end.Value.AddDays(1));
}
if (!string.IsNullOrEmpty(platform))
{
sql += " and platform_type=@platform";
sqlparam.Add("platform", platform);
}
//分页记录
sql += " limit "+(page-1)*pagesize+","+pagesize;
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if(cn.State== System.Data.ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.Query<mInterceptOrderItemid>(sql, sqlparam, null, true, 2 * 60).AsList();
return obj;
}
}
#endregion
#region 图表 #region 图表
/// <summary> /// <summary>
......
...@@ -335,5 +335,36 @@ namespace Bailun.DC.Web.Controllers ...@@ -335,5 +335,36 @@ namespace Bailun.DC.Web.Controllers
} }
/// <summary>
/// 获取拦截的itemid
/// </summary>
/// <param name="start">开始时间</param>
/// <param name="end">结束时间</param>
/// <param name="platform">平台类型</param>
/// <returns></returns>
[HttpPost]
public JsonResult ListInterceptItemid(int page,DateTime? start, DateTime? end, string platform = "Aliexpress")
{
var pagesize = 1000;
try
{
var obj = new Services.OrdersServices().ListInterceptOrderItemId(page, pagesize, start, end, platform);
return Json(new {
success = true,
msg = "",
list = obj
});
}
catch (Exception ex)
{
return Json(new
{
success = false,
msg = ex.Message,
});
}
}
} }
} }
\ No newline at end of file
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