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[委外报表记录查询]
|
/// <summary>
|
/// 委外报表记录查询
|
/// </summary>
|
/// <param name="wocode">工单编号</param>
|
/// <param name="partcode">产品编码</param>
|
/// <param name="partname">产品名称</param>
|
/// <param name="partspec">规格型号</param>
|
/// <param name="stepname">工序名称</param>
|
/// <param name="suppername">供方名称</param>
|
/// <param name="type">操作类型</param>
|
/// <param name="receivdate">收料时间</param>
|
/// <param name="page">页码</param>
|
/// <param name="rows">每页显示条数</param>
|
/// <param name="prop">排序字段</param>
|
/// <param name="order">排序规则</param>
|
/// <returns></returns>
|
[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[委外报表记录导出]
|
/// <summary>
|
/// 委外报表记录导出
|
/// </summary>
|
/// <param name="wocode">工单编号</param>
|
/// <param name="partcode">产品编码</param>
|
/// <param name="partname">产品名称</param>
|
/// <param name="partspec">规格型号</param>
|
/// <param name="stepname">工序名称</param>
|
/// <param name="suppername">供方名称</param>
|
/// <param name="type">操作类型</param>
|
/// <param name="receivdate">收料时间</param>
|
/// <returns></returns>
|
[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[班组工资报表记录查询]
|
/// <summary>
|
/// 班组工资报表记录查询
|
/// </summary>
|
/// <param name="wocode">工单编号</param>
|
/// <param name="partcode">产品编码</param>
|
/// <param name="partname">产品名称</param>
|
/// <param name="partspec">规格型号</param>
|
/// <param name="stepname">工序名称</param>
|
/// <param name="groupcode">生产班组</param>
|
/// <param name="username">操作人员</param>
|
/// <param name="operdate">操作时间</param>
|
/// <param name="page">页码</param>
|
/// <param name="rows">每页显示条数</param>
|
/// <param name="prop">排序字段</param>
|
/// <param name="order">排序规则</param>
|
/// <returns></returns>
|
[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
|
|
}
|
}
|