1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
 
    }
}