using HH.WMS.BLL;
|
using HH.WMS.BLL.AllQuery;
|
using HH.WMS.Common;
|
using HH.WMS.Entitys;
|
using HH.WMS.Entitys.Basic;
|
using HH.WMS.Entitys.Common;
|
using HH.WMS.WebApi.Areas.Common.Controllers;
|
using Newtonsoft.Json;
|
using Newtonsoft.Json.Converters;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.Http;
|
|
namespace HH.WMS.WebApi.Areas.AllQuery.Controllers
|
{
|
public class ReportController : BaseController
|
{
|
#region 获取KPI报表
|
/// <summary>
|
/// 获取KPI报表
|
/// </summary>
|
/// <param name="searchModel"></param>
|
/// <returns></returns>
|
/// <History>[Hanhe(DBS)] created by 2019/1/3</History>
|
[HttpPost]
|
public OperateResult GetKpiList(SearchModel searchModel)
|
{
|
return ValidateToken(searchModel.TokenId, x =>
|
{
|
try
|
{
|
OperateResult result;
|
result = BLLCreator.Create<ReportBll>().GetKpiList(searchModel);
|
return result;
|
}
|
catch (Exception ex)
|
{
|
return OperateResult.Error(ex.Message.ToString());
|
}
|
});
|
}
|
#endregion
|
|
#region 新增U8对比数据
|
/// <summary>
|
/// 新增U8对比数据
|
/// </summary>
|
/// <param name="compareList"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public OperateResult AddU8CompareData(List<TN_WM_STOCKQTY_COMPAREEntity> compareList)
|
{
|
try
|
{
|
OperateResult result;
|
result = BLLCreator.CreateDapper<TN_WM_STOCKQTY_COMPAREEntity>().AddRange(compareList);
|
return result;
|
}
|
catch (Exception ex)
|
{
|
return OperateResult.Error(ex.Message.ToString());
|
}
|
|
}
|
#endregion
|
|
#region 库存对比统计
|
/// <summary>
|
/// 物流公司统计
|
/// </summary>
|
/// <param name="searchModel"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public string GetStockCompareReport(SearchModel searchModel)
|
{
|
return ValidateToken(searchModel.TokenId, t =>
|
{
|
long total;
|
var dt = BLLCreator.Create<ReportBll>().GetStockCompareReport(searchModel, out total);
|
OperateResult pagingList = OperateResult.Succeed(null, new
|
{
|
rows = dt,
|
total = total
|
});
|
|
IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
|
timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
|
return JsonConvert.SerializeObject(pagingList, timeFormat);
|
});
|
}
|
#endregion
|
|
#region 物流公司统计
|
/// <summary>
|
/// 物流公司统计
|
/// </summary>
|
/// <param name="searchModel"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public OperateResult GetLogisticsReport(SearchModel searchModel)
|
{
|
return ValidateToken(searchModel.TokenId, t =>
|
{
|
long total;
|
var dt = BLLCreator.Create<ReportBll>().GetLogisticsReport(searchModel, out total);
|
return OperateResult.Succeed(null, new
|
{
|
rows = dt,
|
total = total
|
});
|
});
|
}
|
#endregion
|
|
#region 物流出库详情
|
/// <summary>
|
/// 物流出库详情
|
/// </summary>
|
/// <param name="searchModel"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public string GetLogisticsDetail(SearchModel searchModel)
|
{
|
return ValidateToken(searchModel.TokenId, t =>
|
{
|
var dt = BLLCreator.Create<ReportBll>().GetLogisticsDetail(searchModel);
|
|
IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
|
timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
return JsonConvert.SerializeObject(OperateResult.Succeed(null, dt), timeFormat);
|
});
|
}
|
#endregion
|
}
|
}
|