Commit 3ec2cfa2 by zhouminghui

fix

parent 3c8a65d7
...@@ -14,5 +14,6 @@ ...@@ -14,5 +14,6 @@
/// 前端Vue表头 /// 前端Vue表头
/// </summary> /// </summary>
public string ColumnText { get; set; } public string ColumnText { get; set; }
public int Total { get; set; }
} }
} }
...@@ -1954,7 +1954,7 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina ...@@ -1954,7 +1954,7 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
/// <param name="bailunSku"></param> /// <param name="bailunSku"></param>
/// <param name="month"></param> /// <param name="month"></param>
/// <returns></returns> /// <returns></returns>
public CommonApiResponseDto<GetMonthStockWeightingOutputDto> GetMonthStockWeightingList(string bailunSku, string month) public CommonApiResponseDto<GetMonthStockWeightingOutputDto> GetMonthStockWeightingList(string bailunSku, string month,int page,int limit)
{ {
var result = new CommonApiResponseDto<GetMonthStockWeightingOutputDto> { Data = new GetMonthStockWeightingOutputDto() }; var result = new CommonApiResponseDto<GetMonthStockWeightingOutputDto> { Data = new GetMonthStockWeightingOutputDto() };
if (string.IsNullOrWhiteSpace(month)) return result; if (string.IsNullOrWhiteSpace(month)) return result;
...@@ -1984,12 +1984,25 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina ...@@ -1984,12 +1984,25 @@ AND platform_type = '{item.platform_type}' AND financecategoryname = '{item.fina
sql.Append(" FROM dc_month_stock_weighting WHERE 1=1 "); sql.Append(" FROM dc_month_stock_weighting WHERE 1=1 ");
if (!string.IsNullOrWhiteSpace(bailunSku)) if (!string.IsNullOrWhiteSpace(bailunSku))
{ {
sql.Append(" AND bailun_sku = @bailun_sku"); //sql.Append(" AND bailun_sku in @bailun_sku ");
param.Add("bailun_sku", bailunSku); //param.Add("bailun_sku", bailunSku);
sql.Append($" AND bailun_sku like '%{bailunSku}%' ");
}
sql.Append(" GROUP BY bailun_sku ");
//sql.Append(" limit @limit offset @offset ");
//param.Add("limit", limit);
//param.Add("offset", (page - 1) * limit);
using (var cn = new MySqlConnection(GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
int total = 0;
result.Data.Data = cn.Page<dynamic>(page, limit, sql.ToString(), ref total, param).AsList();
result.Data.Total = total;
result.Data.ColumnText = vueColumn.ToString();
} }
sql.Append(" GROUP BY bailun_sku;");
result.Data.Data = SimpleCRUD.Query<dynamic>(sql.ToString(), param, GlobalConfig.ConnectionString);
result.Data.ColumnText = vueColumn.ToString();
return result; return result;
} }
#endregion #endregion
......
...@@ -620,11 +620,13 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -620,11 +620,13 @@ namespace Bailun.DC.WebApi.Controllers
/// </summary> /// </summary>
/// <param name="bailunSku"></param> /// <param name="bailunSku"></param>
/// <param name="month"></param> /// <param name="month"></param>
/// <param name="page"></param>
/// <param name="limit"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("getMonthStockWeightingList")] [HttpPost("getMonthStockWeightingList")]
public CommonApiResponseDto<GetMonthStockWeightingOutputDto> GetMonthStockWeightingList(string bailunSku, string month) public CommonApiResponseDto<GetMonthStockWeightingOutputDto> GetMonthStockWeightingList(string bailunSku, string month, int page = 1, int limit = 20)
{ {
return new FinanceService().GetMonthStockWeightingList(bailunSku, month); return new FinanceService().GetMonthStockWeightingList(bailunSku, month, page, limit);
} }
#endregion #endregion
} }
......
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