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 #region[班组工资报表记录查看报工人员] /// /// 班组工资报表记录查看报工人员 /// /// 报工记录主表id /// [Route(template: "GroupSalaryReportSearchUser")] [HttpGet] public HttpResponseMessage GroupSalaryReportSearchUser(string id) { mes = ReportManagerBLL.GroupSalaryReportSearchUser(id); return TJson.toJson(mes); } #endregion #region[班组工资报表记录导出] /// /// 班组工资报表记录查询 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 生产班组 /// 操作人员 /// 操作时间 /// [Route(template: "GroupSalaryReportExcelSearch")] [HttpGet] public HttpResponseMessage GroupSalaryReportExcelSearch(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(); } mes = ReportManagerBLL.GroupSalaryReportExcelSearch(wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate); return TJson.toJson(mes); } #endregion #region[人员工资明细报表] /// /// 人员工资明细报表 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 生产班组 /// 报工人员 /// 报工时间 /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// [Route(template: "PeopleSalaryReportSearch")] [HttpGet] public HttpResponseMessage PeopleSalaryReportSearch(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 reportname = null, string reportdate = null) { string reportopendate = ""; //报工开始时间 string reportclosedate = ""; //报工结束时间 if (reportdate != "" && reportdate != null) { reportopendate = reportdate.Split('~')[0].ToString(); reportclosedate = reportdate.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.PeopleSalaryReportSearch(wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order); return TJson.toJson(mes); } #endregion #region[人员工资明细报表导出] /// /// 人员工资明细报表导出 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 生产班组 /// 报工人员 /// 报工时间 /// [Route(template: "PeopleSalaryReportExcelSearch")] [HttpGet] public HttpResponseMessage PeopleSalaryReportExcelSearch(string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string reportname = null, string reportdate = null) { string reportopendate = ""; //报工开始时间 string reportclosedate = ""; //报工结束时间 if (reportdate != "" && reportdate != null) { reportopendate = reportdate.Split('~')[0].ToString(); reportclosedate = reportdate.Split('~')[1].ToString(); } mes = ReportManagerBLL.PeopleSalaryReportExcelSearch(wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate); return TJson.toJson(mes); } #endregion #region[不良明细报表] /// /// 不良明细报表 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 缺陷代码 /// 缺陷名称 /// 报工人员 /// 报工时间 /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// [Route(template: "DefectDetailsReportSearch")] [HttpGet] public HttpResponseMessage DefectDetailsReportSearch(int page, int rows, string prop, string order, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null,string defectcode=null,string defectname=null, string reportname = null, string reportdate = null) { string reportopendate = ""; //报工开始时间 string reportclosedate = ""; //报工结束时间 if (reportdate != "" && reportdate != null) { reportopendate = reportdate.Split('~')[0].ToString(); reportclosedate = reportdate.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.DefectDetailsReportSearch(wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order); return TJson.toJson(mes); } #endregion #region[不良明细报表导出] /// /// 不良明细报表导出 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 缺陷代码 /// 缺陷名称 /// 报工人员 /// 报工时间 /// [Route(template: "DefectDetailsReportExcelSearch")] [HttpGet] public HttpResponseMessage DefectDetailsReportExcelSearch(string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string defectcode = null, string defectname = null, string reportname = null, string reportdate = null) { string reportopendate = ""; //报工开始时间 string reportclosedate = ""; //报工结束时间 if (reportdate != "" && reportdate != null) { reportopendate = reportdate.Split('~')[0].ToString(); reportclosedate = reportdate.Split('~')[1].ToString(); } mes = ReportManagerBLL.DefectDetailsReportExcelSearch(wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate); return TJson.toJson(mes); } #endregion #region[品质异常排行报表(取报工不良记录缺陷分组汇总条数)] /// /// 品质异常排行报表 /// /// [Route(template: "QuaneryDefectReportSearch")] [HttpGet] public HttpResponseMessage QuaneryDefectReportSearch() { mes = ReportManagerBLL.QuaneryDefectReportSearch(); return TJson.toJson(mes); } #endregion #region[维修明细报表] /// /// 维修明细报表 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 操作类型 /// 缺陷名称 /// 维修人员 /// 维修时间 /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// [Route(template: "MaintenanceDetailsReportSearch")] [HttpGet] public HttpResponseMessage MaintenanceDetailsReportSearch(int page, int rows, string prop, string order, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string style = null, string defectname = null, string repairname = null, string repairdate = null) { string repairopendate = ""; //维修开始时间 string repairclosedate = ""; //维修结束时间 if (repairdate != "" && repairdate != null) { repairopendate = repairdate.Split('~')[0].ToString(); repairclosedate = repairdate.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.MaintenanceDetailsReportSearch(wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate, startNum, endNum, prop, order); return TJson.toJson(mes); } #endregion #region[维修明细报表导出] /// /// 维修明细报表导出 /// /// 工单编号 /// 产品编码 /// 产品名称 /// 规格型号 /// 工序名称 /// 操作类型 /// 缺陷名称 /// 维修人员 /// 维修时间 /// [Route(template: "MaintenanceDetailsReportExcelSearch")] [HttpGet] public HttpResponseMessage MaintenanceDetailsReportExcelSearch(string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string style = null, string defectname = null, string repairname = null, string repairdate = null) { string repairopendate = ""; //维修开始时间 string repairclosedate = ""; //维修结束时间 if (repairdate != "" && repairdate != null) { repairopendate = repairdate.Split('~')[0].ToString(); repairclosedate = repairdate.Split('~')[1].ToString(); } mes = ReportManagerBLL.MaintenanceDetailsReportExcelSearch(wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate); return TJson.toJson(mes); } #endregion #region[安灯报表明细] /// /// 安灯报表明细 /// /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// 车间编码 /// 呼叫类型编码 /// 呼叫人员 /// 呼叫时间 /// 设备编码 /// 设备名称 /// 响应人员 /// 响应时间 /// [Route(template: "AnDonReportDefinitSearch")] [HttpGet] public HttpResponseMessage AnDonReportDefinitSearch(int page, int rows, string prop, string order, string wkshopcode = null, string calltypecode = null, string calluser = null, string calldate = null, string eqpcode = null, string eqpname = null, string responduser = null, string responddate = null) { string callopendate = ""; //呼叫开始时间 string callclosedate = ""; //呼叫结束时间 string respondopendate = ""; //响应开始时间 string respondclosedate = ""; //响应结束时间 if (calldate != "" && calldate != null) { callopendate = calldate.Split('~')[0].ToString(); callclosedate = calldate.Split('~')[1].ToString(); } if (responddate != "" && responddate != null) { respondopendate = responddate.Split('~')[0].ToString(); respondclosedate = responddate.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.AnDonReportDefinitSearch(wkshopcode, calltypecode, calluser, callopendate, callclosedate, eqpcode, eqpname, responduser,respondopendate, respondclosedate, startNum, endNum, prop, order); return TJson.toJson(mes); } #endregion #region[安灯报表明细导出] /// /// 安灯报表明细导出 /// /// 车间编码 /// 呼叫类型编码 /// 呼叫人员 /// 呼叫时间 /// 设备编码 /// 设备名称 /// 响应人员 /// 响应时间 /// [Route(template: "AnDonReportDefinitExcelSearch")] [HttpGet] public HttpResponseMessage AnDonReportDefinitExcelSearch(string wkshopcode = null, string calltypecode = null, string calluser = null, string calldate = null, string eqpcode = null, string eqpname = null, string responduser = null, string responddate = null) { string callopendate = ""; //呼叫开始时间 string callclosedate = ""; //呼叫结束时间 string respondopendate = ""; //响应开始时间 string respondclosedate = ""; //响应结束时间 if (calldate != "" && calldate != null) { callopendate = calldate.Split('~')[0].ToString(); callclosedate = calldate.Split('~')[1].ToString(); } if (responddate != "" && responddate != null) { respondopendate = responddate.Split('~')[0].ToString(); respondclosedate = responddate.Split('~')[1].ToString(); } mes = ReportManagerBLL.AnDonReportDefinitExcelSearch(wkshopcode, calltypecode, calluser, callopendate, callclosedate, eqpcode, eqpname, responduser, respondopendate, respondclosedate); return TJson.toJson(mes); } #endregion #region[安灯报表汇总] /// /// 安灯报表汇总 /// /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// 车间编码 /// 呼叫类型编码 /// 呼叫时间 /// 响应时间 /// [Route(template: "AnDonReportSumSearch")] [HttpGet] public HttpResponseMessage AnDonReportSumSearch(int page, int rows, string prop, string order, string wkshopcode = null, string calltypecode = null, string calldate = null, string responddate = null) { string callopendate = ""; //呼叫开始时间 string callclosedate = ""; //呼叫结束时间 string respondopendate = ""; //响应开始时间 string respondclosedate = ""; //响应结束时间 if (calldate != "" && calldate != null) { callopendate = calldate.Split('~')[0].ToString(); callclosedate = calldate.Split('~')[1].ToString(); } if (responddate != "" && responddate != null) { respondopendate = responddate.Split('~')[0].ToString(); respondclosedate = responddate.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.AnDonReportSumSearch(wkshopcode, calltypecode, callopendate, callclosedate, respondopendate, respondclosedate, startNum, endNum, prop, order); return TJson.toJson(mes); } #endregion #region[安灯报表汇总导出] /// /// 安灯报表汇总导出 /// /// 车间编码 /// 呼叫类型编码 /// 呼叫时间 /// 响应时间 /// [Route(template: "AnDonReportSumExcelSearch")] [HttpGet] public HttpResponseMessage AnDonReportSumExcelSearch(string wkshopcode = null, string calltypecode = null, string calldate = null, string responddate = null) { string callopendate = ""; //呼叫开始时间 string callclosedate = ""; //呼叫结束时间 string respondopendate = ""; //响应开始时间 string respondclosedate = ""; //响应结束时间 if (calldate != "" && calldate != null) { callopendate = calldate.Split('~')[0].ToString(); callclosedate = calldate.Split('~')[1].ToString(); } if (responddate != "" && responddate != null) { respondopendate = responddate.Split('~')[0].ToString(); respondclosedate = responddate.Split('~')[1].ToString(); } mes = ReportManagerBLL.AnDonReportSumExcelSearch(wkshopcode, calltypecode, callopendate, callclosedate, respondopendate, respondclosedate); return TJson.toJson(mes); } #endregion } }