using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using VueWebApi.DLL.BLL;
using VueWebApi.Tools;
namespace VueWebApi.Controllers
{
[RoutePrefix(prefix: "api/ReportManager")]
[ControllerGroup("报表管理", "在线接口")]
[ChannelActionFilter]
public class ReportManagerController : ApiController
{
//定义全局信息返回变量
ToMessage mes = new ToMessage();
RedisHelper redis = new RedisHelper();
#region[委外报表记录查询]
///
/// 委外报表记录查询
///
/// 工单编号
/// 产品编码
/// 产品名称
/// 规格型号
/// 工序名称
/// 供方名称
/// 操作类型
/// 收料时间
/// 页码
/// 每页显示条数
/// 排序字段
/// 排序规则
///
[Route(template: "OutSourceReportSearch")]
[HttpGet]
public HttpResponseMessage OutSourceReportSearch(int page, int rows, string prop, string order, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string suppername = null, string type = null,string receivdate=null)
{
string receivopendate = ""; //收料开始时间
string receivclosedate = ""; //收料结束时间
if (receivdate != "" && receivdate != null)
{
receivopendate = receivdate.Split('~')[0].ToString();
receivclosedate = receivdate.Split('~')[1].ToString();
}
int startNum = rows * (page - 1) + 1; //起始记录rowNum
int endNum = rows * page; //结束记录 rowNum
mes = ReportManagerBLL.OutSourceReportSearch(wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate, startNum, endNum, prop, order);
return TJson.toJson(mes);
}
#endregion
#region[委外报表记录导出]
///
/// 委外报表记录导出
///
/// 工单编号
/// 产品编码
/// 产品名称
/// 规格型号
/// 工序名称
/// 供方名称
/// 操作类型
/// 收料时间
///
[Route(template: "OutSourceReportExcelSearch")]
[HttpGet]
public HttpResponseMessage OutSourceReportExcelSearch(string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string suppername = null, string type = null, string receivdate = null)
{
string receivopendate = ""; //收料开始时间
string receivclosedate = ""; //收料结束时间
if (receivdate != "" && receivdate != null)
{
receivopendate = receivdate.Split('~')[0].ToString();
receivclosedate = receivdate.Split('~')[1].ToString();
}
mes = ReportManagerBLL.OutSourceReportExcelSearch(wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate);
return TJson.toJson(mes);
}
#endregion
#region[班组工资报表记录查询]
///
/// 班组工资报表记录查询
///
/// 工单编号
/// 产品编码
/// 产品名称
/// 规格型号
/// 工序名称
/// 生产班组
/// 操作人员
/// 操作时间
/// 页码
/// 每页显示条数
/// 排序字段
/// 排序规则
///
[Route(template: "GroupSalaryReportSearch")]
[HttpGet]
public HttpResponseMessage GroupSalaryReportSearch(int page, int rows, string prop, string order, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string username = null, string operdate = null)
{
string operopendate = ""; //收料开始时间
string operclosedate = ""; //收料结束时间
if (operdate != "" && operdate != null)
{
operopendate = operdate.Split('~')[0].ToString();
operclosedate = operdate.Split('~')[1].ToString();
}
int startNum = rows * (page - 1) + 1; //起始记录rowNum
int endNum = rows * page; //结束记录 rowNum
mes = ReportManagerBLL.GroupSalaryReportSearch(wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate, startNum, endNum, prop, order);
return TJson.toJson(mes);
}
#endregion
}
}