yl
2023-09-22 bd14d44a46cd191d0deb15b6f752f9477b818398
VueWebApi/Controllers/ReportManagerController.cs
@@ -11,7 +11,7 @@
{
    [RoutePrefix(prefix: "api/ReportManager")]
    [ControllerGroup("报表管理", "在线接口")]
    //[ChannelActionFilter]
    [ChannelActionFilter]
    public class ReportManagerController : ApiController
    {
        //定义全局信息返回变量
@@ -23,6 +23,7 @@
        /// <summary>
        /// 委外报表记录查询
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -38,7 +39,7 @@
        /// <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)
        public HttpResponseMessage OutSourceReportSearch(int page, int rows, string prop, string order,string wkshopcode=null, 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 = "";    //收料结束时间
@@ -49,7 +50,7 @@
            }
            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);
            mes = ReportManagerBLL.OutSourceReportSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
@@ -58,6 +59,7 @@
        /// <summary>
        /// 委外报表记录导出
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -69,7 +71,7 @@
        /// <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)
        public HttpResponseMessage OutSourceReportExcelSearch(string wkshopcode = null, 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 = "";    //收料结束时间
@@ -78,7 +80,7 @@
                receivopendate = receivdate.Split('~')[0].ToString();
                receivclosedate = receivdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.OutSourceReportExcelSearch(wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate);
            mes = ReportManagerBLL.OutSourceReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate);
            return TJson.toJson(mes);
        }
        #endregion
@@ -89,6 +91,7 @@
        /// <summary>
        /// 班组工资报表记录查询
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
@@ -98,6 +101,7 @@
        /// <param name="groupcode">生产班组</param>
        /// <param name="username">操作人员</param>
        /// <param name="operdate">操作时间</param>
        /// <param name="rejectstepcode">剔除工序(固定薪资工序不参与计算)</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
@@ -105,7 +109,7 @@
        /// <returns></returns>
        [Route(template: "GroupSalaryReportSearch")]
        [HttpGet]
        public HttpResponseMessage GroupSalaryReportSearch(int page, int rows, string prop, string order,string compute, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string username = null, string operdate = null)
        public HttpResponseMessage GroupSalaryReportSearch(int page, int rows, string prop, string order, string compute, string wkshopcode = null, 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 rejectstepcode=null)
        {
            string operopendate = "";  //报工开始时间
            string operclosedate = "";    //报工结束时间
@@ -116,7 +120,7 @@
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.GroupSalaryReportSearch(compute,wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate, startNum, endNum, prop, order);
            mes = ReportManagerBLL.GroupSalaryReportSearch(wkshopcode,compute, wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate, rejectstepcode, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
@@ -140,6 +144,7 @@
        /// <summary>
        /// 班组工资报表记录查询
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
@@ -149,10 +154,11 @@
        /// <param name="groupcode">生产班组</param>
        /// <param name="username">操作人员</param>
        /// <param name="operdate">操作时间</param>
        /// <param name="rejectstepcode">剔除工序(固定薪资工序不参与计算)</param>
        /// <returns></returns>
        [Route(template: "GroupSalaryReportExcelSearch")]
        [HttpGet]
        public HttpResponseMessage GroupSalaryReportExcelSearch(string compute, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string username = null, string operdate = null)
        public HttpResponseMessage GroupSalaryReportExcelSearch(string compute, string wkshopcode = null, 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 rejectstepcode=null)
        {
            string operopendate = "";  //报工开始时间
            string operclosedate = "";    //报工结束时间
@@ -161,7 +167,7 @@
                operopendate = operdate.Split('~')[0].ToString();
                operclosedate = operdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.GroupSalaryReportExcelSearch(compute,wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate);
            mes = ReportManagerBLL.GroupSalaryReportExcelSearch(wkshopcode,compute, wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate, rejectstepcode);
            return TJson.toJson(mes);
        }
        #endregion
@@ -171,6 +177,7 @@
        /// <summary>
        /// 人员工资明细报表
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
@@ -180,6 +187,7 @@
        /// <param name="groupcode">生产班组</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <param name = "rejectstepcode" > 剔除工序(固定薪资工序不参与计算) </param >
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
@@ -187,7 +195,7 @@
        /// <returns></returns>
        [Route(template: "PeopleSalaryReportSearch")]
        [HttpGet]
        public HttpResponseMessage PeopleSalaryReportSearch(int page, int rows, string prop, string order,string compute, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string reportname = null, string reportdate = null)
        public HttpResponseMessage PeopleSalaryReportSearch(int page, int rows, string prop, string order,string compute, string wkshopcode = null, 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 rejectstepcode=null)
        {
            string reportopendate = "";  //报工开始时间
            string reportclosedate = "";    //报工结束时间
@@ -198,7 +206,7 @@
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.PeopleSalaryReportSearch(compute,wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order);
            mes = ReportManagerBLL.PeopleSalaryReportSearch(wkshopcode,compute, wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate, rejectstepcode, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
@@ -207,6 +215,7 @@
        /// <summary>
        /// 人员工资明细报表导出
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
@@ -216,10 +225,11 @@
        /// <param name="groupcode">生产班组</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <param name = "rejectstepcode" > 剔除工序(固定薪资工序不参与计算) </param >
        /// <returns></returns>
        [Route(template: "PeopleSalaryReportExcelSearch")]
        [HttpGet]
        public HttpResponseMessage PeopleSalaryReportExcelSearch(string compute, string wocode = null, string partcode = null, string partname = null, string partspec = null, string stepname = null, string groupcode = null, string reportname = null, string reportdate = null)
        public HttpResponseMessage PeopleSalaryReportExcelSearch(string compute, string wkshopcode = null, 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 rejectstepcode=null)
        {
            string reportopendate = "";  //报工开始时间
            string reportclosedate = "";    //报工结束时间
@@ -228,7 +238,7 @@
                reportopendate = reportdate.Split('~')[0].ToString();
                reportclosedate = reportdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.PeopleSalaryReportExcelSearch(compute,wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate);
            mes = ReportManagerBLL.PeopleSalaryReportExcelSearch(wkshopcode,compute, wocode, partcode, partname, partspec, stepname, groupcode, reportname, reportopendate, reportclosedate, rejectstepcode);
            return TJson.toJson(mes);
        }
        #endregion
@@ -238,6 +248,7 @@
        /// <summary>
        /// 不良明细报表 
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -254,7 +265,7 @@
        /// <returns></returns>
        [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)
        public HttpResponseMessage DefectDetailsReportSearch(int page, int rows, string prop, string order,string wkshopcode=null, 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 = "";    //报工结束时间
@@ -265,7 +276,7 @@
            }
            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);
            mes = ReportManagerBLL.DefectDetailsReportSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
@@ -274,6 +285,7 @@
        /// <summary>
        /// 不良明细报表导出 
        /// </summary>
        /// <param name=" wkshopcode">车间编码</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -286,7 +298,7 @@
        /// <returns></returns>
        [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)
        public HttpResponseMessage DefectDetailsReportExcelSearch(string wkshopcode=null, 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 = "";    //报工结束时间
@@ -295,7 +307,7 @@
                reportopendate = reportdate.Split('~')[0].ToString();
                reportclosedate = reportdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.DefectDetailsReportExcelSearch(wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate);
            mes = ReportManagerBLL.DefectDetailsReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate);
            return TJson.toJson(mes);
        }
        #endregion
@@ -320,6 +332,7 @@
        /// <summary>
        /// 维修明细报表 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -336,7 +349,7 @@
        /// <returns></returns>
        [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)
        public HttpResponseMessage MaintenanceDetailsReportSearch(int page, int rows, string prop, string order,string wkshopcode=null, 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 = "";    //维修结束时间
@@ -347,7 +360,7 @@
            }
            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);
            mes = ReportManagerBLL.MaintenanceDetailsReportSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
@@ -356,6 +369,7 @@
        /// <summary>
        /// 维修明细报表导出 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
@@ -368,7 +382,7 @@
        /// <returns></returns>
        [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)
        public HttpResponseMessage MaintenanceDetailsReportExcelSearch(string wkshopcode = null, 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 = "";    //维修结束时间
@@ -377,7 +391,7 @@
                repairopendate = repairdate.Split('~')[0].ToString();
                repairclosedate = repairdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.MaintenanceDetailsReportExcelSearch(wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate);
            mes = ReportManagerBLL.MaintenanceDetailsReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate);
            return TJson.toJson(mes);
        }
        #endregion
@@ -533,5 +547,125 @@
            return TJson.toJson(mes);
        }
        #endregion
        #region[物流检验记录查询]
        /// <summary>
        /// 物流检验记录查询
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示数据条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <param name="checktypecode">检验类型编码</param>
        /// <param name="partcode">物料编码</param>
        /// <param name="partname">物料名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="labcode">条码编号</param>
        /// <param name="customercode">往来单位编码</param>
        /// <param name="batchno">批次条码</param>
        /// <param name="checkuser">检验人员</param>
        /// <param name="checkdate">检验时间</param>
        /// <returns></returns>
        [Route(template: "LogisticsCheckSearch")]
        [HttpGet]
        public HttpResponseMessage LogisticsCheckSearch(int page, int rows, string prop, string order, string checktypecode = null, string partcode = null, string partname = null, string partspec = null, string labcode = null,string customercode=null,string batchno=null,string checkuser=null,string checkdate=null)
        {
            string opencheckdate = "";     //响应开始时间
            string closecheckdate = "";    //响应结束时间
            if (checkdate != "" && checkdate != null)
            {
                opencheckdate = checkdate.Split('~')[0].ToString();
                closecheckdate = checkdate.Split('~')[1].ToString();
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.LogisticsCheckSearch(checktypecode,partcode,partname,partspec,labcode,customercode,batchno,checkuser, opencheckdate, closecheckdate, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
        #region[物流检验,查看检验明细]
        /// <summary>
        /// 物流检验,查看检验明细
        /// </summary>
        /// <param name="checkid">检验记录ID</param>
        /// <returns></returns>
        [Route(template: "LogisticsCheckSubSearch")]
        [HttpGet]
        public HttpResponseMessage LogisticsCheckSubSearch(string checkid)
        {
            mes = ReportManagerBLL.LogisticsCheckSubSearch(checkid);
            return TJson.toJson(mes);
        }
        #endregion
        #region[生产进度报表]
        /// <summary>
        /// 生产进度报表
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="status">工单状态</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="routecode">工艺路线编码</param>
        /// <param name="routename">工艺路线名称</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="lm_date">单据日期</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <returns></returns>
        [Route(template: "ProductionScheduleReportSearch")]
        [HttpGet]
        public HttpResponseMessage ProductionScheduleReportSearch(int page, int rows, string prop, string order, string wkshopcode=null, string status=null, string wocode = null, string routecode = null, string routename = null, string partcode = null, string partname = null, string partspec = null,string lm_date=null)
        {
            string opendate = "";     //开始时间
            string closedate = "";    //结束时间
            if (lm_date != "" && lm_date != null)
            {
                opendate = lm_date.Split('~')[0].ToString();
                closedate = lm_date.Split('~')[1].ToString();
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.ProductionScheduleReportSearch(wkshopcode,status, wocode, routecode, routename, partcode, partname, partspec, opendate, closedate, startNum, endNum, prop, order);
            return TJson.toJson(mes);
        }
        #endregion
        #region[生产进度报表导出]
        /// <summary>
        /// 生产进度报表导出
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="status">工单状态</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="routecode">工艺路线编码</param>
        /// <param name="routename">工艺路线名称</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="lm_date">单据日期</param>
        /// <returns></returns>
        [Route(template: "ProductionScheduleReportExcelSearch")]
        [HttpGet]
        public HttpResponseMessage ProductionScheduleReportExcelSearch(string wkshopcode=null, string status = null, string wocode = null, string routecode = null, string routename = null, string partcode = null, string partname = null, string partspec = null, string lm_date = null)
        {
            string opendate = "";     //开始时间
            string closedate = "";    //结束时间
            if (lm_date != "" && lm_date != null)
            {
                opendate = lm_date.Split('~')[0].ToString();
                closedate = lm_date.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.ProductionScheduleReportExcelSearch(wkshopcode,status, wocode, routecode, routename, partcode, partname, partspec, opendate, closedate);
            return TJson.toJson(mes);
        }
        #endregion
    }
}