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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using VueWebCoreApi.DLL.BLL;
using VueWebCoreApi.Models;
using VueWebCoreApi.Models.InventoryModel;
using VueWebCoreApi.Tools;
 
namespace VueWebCoreApi.Controllers
{
    [ApiExplorerSettings(GroupName = "统计报表")]
    [ApiController]
    [Route("api/[controller]")]
    [ChannelActionFilter]
    public class ReportManagerController : Controller
    {
        //定义全局信息返回变量
        ToMessage mes = new ToMessage();
        RedisCommon redis = new RedisCommon();
 
        #region[生产进度报表]
        /// <summary>
        /// 生产进度报表
        /// </summary>
        /// <param name="status">工单状态</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="socode">销售单号</param>
        /// <param name="wocode">工单编号</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 JsonResult ProductionScheduleReportSearch(int page, int rows, string prop, string order, string status = null,string socode=null, string wocode = null,string wkshopcode=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(status, wkshopcode, socode, wocode,partcode, partname, partspec, opendate, closedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[生产进度报表导出]
        /// <summary>
        /// 生产进度报表导出
        /// </summary>
        /// <param name="status">工单状态</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="socode">销售单号</param>
        /// <param name="wocode">工单编号</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 JsonResult ProductionScheduleReportExcelSearch(string status = null, string wkshopcode = null, string socode = null, string wocode = 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(status, wkshopcode, socode,wocode, partcode, partname, partspec, opendate, closedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[班组工资报表记录查询]
        /// <summary>
        /// 班组工资报表记录查询
        /// </summary>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="socode">销售单号</param>
        /// <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 JsonResult GroupSalaryReportSearch(int page, int rows, string prop, string order, string compute,string wkshopcode=null,string socode=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 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(compute, wkshopcode, socode, wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[班组工资报表记录查看报工人员]
        /// <summary>
        /// 班组工资报表记录查看报工人员
        /// </summary>
        /// <param name="id">报工记录主表id</param>
        /// <returns></returns>
        [Route(template: "GroupSalaryReportSearchUser")]
        [HttpGet]
        public JsonResult GroupSalaryReportSearchUser(string id)
        {
            mes = ReportManagerBLL.GroupSalaryReportSearchUser(id);
            return Json(mes);
        }
        #endregion
 
        #region[班组工资报表记录导出]
        /// <summary>
        /// 班组工资报表记录查询
        /// </summary>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="socode">销售单号</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <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>
        /// <returns></returns>
        [Route(template: "GroupSalaryReportExcelSearch")]
        [HttpGet]
        public JsonResult GroupSalaryReportExcelSearch(string compute,string wkshopcode=null, string socode = 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 operopendate = "";  //报工开始时间
            string operclosedate = "";    //报工结束时间
            if (operdate != "" && operdate != null)
            {
                operopendate = operdate.Split('~')[0].ToString();
                operclosedate = operdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.GroupSalaryReportExcelSearch(compute,wkshopcode, socode, wocode, partcode, partname, partspec, stepname, groupcode, username, operopendate, operclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[人员工资明细报表]
        /// <summary>
        /// 人员工资明细报表
        /// </summary>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="socode">销售单号</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepcode">工序编号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <returns></returns>
        [Route(template: "PeopleSalaryReportSearch")]
        [HttpGet]
        public JsonResult PeopleSalaryReportSearch(int page, int rows, string prop, string order, string compute,string wkshopcode=null,string socode=null, string wocode = null, string partcode = null, string partname = null, string partspec = null,string stepcode=null, string stepname = 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(compute, wkshopcode, socode, wocode, partcode, partname, partspec, stepcode, stepname, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[人员工资明细报表导出]
        /// <summary>
        /// 人员工资明细报表导出
        /// </summary>
        /// <param name="compute">计算方式(逐道/末道)</param>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="socode">销售单号</param>
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepcode">工序编号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <returns></returns>
        [Route(template: "PeopleSalaryReportExcelSearch")]
        [HttpGet]
        public JsonResult PeopleSalaryReportExcelSearch(string compute,string wkshopcode=null,string socode=null, string wocode = null, string partcode = null, string partname = null, string partspec = null,string stepcode=null, string stepname = 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(compute, wkshopcode, socode, wocode, partcode, partname, partspec,stepcode,stepname, reportname, reportopendate, reportclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[委外报表记录查询]
        /// <summary>
        /// 委外报表记录查询
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <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 JsonResult 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 = "";    //收料结束时间
            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(wkshopcode,wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[委外报表记录导出]
        /// <summary>
        /// 委外报表记录导出
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <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 JsonResult 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 = "";    //收料结束时间
            if (receivdate != "" && receivdate != null)
            {
                receivopendate = receivdate.Split('~')[0].ToString();
                receivclosedate = receivdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.OutSourceReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, suppername, type, receivopendate, receivclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[不良明细报表]
        /// <summary>
        /// 不良明细报表 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="defectcode">缺陷代码</param>
        /// <param name="defectname">缺陷名称</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <returns></returns>
        [Route(template: "DefectDetailsReportSearch")]
        [HttpGet]
        public JsonResult 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 = "";    //报工结束时间
            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(wkshopcode,wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[不良明细报表导出]
        /// <summary>
        /// 不良明细报表导出 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="defectcode">缺陷代码</param>
        /// <param name="defectname">缺陷名称</param>
        /// <param name="reportname">报工人员</param>
        /// <param name="reportdate">报工时间</param>
        /// <returns></returns>
        [Route(template: "DefectDetailsReportExcelSearch")]
        [HttpGet]
        public JsonResult 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 = "";    //报工结束时间
            if (reportdate != "" && reportdate != null)
            {
                reportopendate = reportdate.Split('~')[0].ToString();
                reportclosedate = reportdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.DefectDetailsReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, defectcode, defectname, reportname, reportopendate, reportclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[维修明细报表]
        /// <summary>
        /// 维修明细报表 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="style">操作类型</param>
        /// <param name="defectname">缺陷名称</param>
        /// <param name="repairname">维修人员</param>
        /// <param name="repairdate">维修时间</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <returns></returns>
        [Route(template: "MaintenanceDetailsReportSearch")]
        [HttpGet]
        public JsonResult 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 = "";    //维修结束时间
            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(wkshopcode,wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[维修明细报表导出]
        /// <summary>
        /// 维修明细报表导出 
        /// </summary>
        /// <param name="wkshopcode">车间编号</param >
        /// <param name="wocode">工单编号</param>
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="partspec">规格型号</param>
        /// <param name="stepname">工序名称</param>
        /// <param name="style">操作类型</param>
        /// <param name="defectname">缺陷名称</param>
        /// <param name="repairname">维修人员</param>
        /// <param name="repairdate">维修时间</param>
        /// <returns></returns>
        [Route(template: "MaintenanceDetailsReportExcelSearch")]
        [HttpGet]
        public JsonResult 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 = "";    //维修结束时间
            if (repairdate != "" && repairdate != null)
            {
                repairopendate = repairdate.Split('~')[0].ToString();
                repairclosedate = repairdate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.MaintenanceDetailsReportExcelSearch(wkshopcode,wocode, partcode, partname, partspec, stepname, style, defectname, repairname, repairopendate, repairclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[安灯报表明细]
        /// <summary>
        /// 安灯报表明细
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="calltypecode">呼叫类型编码</param>
        /// <param name="calluser">呼叫人员</param>
        /// <param name="calldate">呼叫时间</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="eqpname">设备名称</param>
        /// <param name="responduser">响应人员</param>
        /// <param name="responddate">响应时间</param>
        /// <returns></returns>
        [Route(template: "AnDonReportDefinitSearch")]
        [HttpGet]
        public JsonResult 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 Json(mes);
        }
        #endregion
 
        #region[安灯报表明细导出]
        /// <summary>
        /// 安灯报表明细导出
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="calltypecode">呼叫类型编码</param>
        /// <param name="calluser">呼叫人员</param>
        /// <param name="calldate">呼叫时间</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="eqpname">设备名称</param>
        /// <param name="responduser">响应人员</param>
        /// <param name="responddate">响应时间</param>
        /// <returns></returns>
        [Route(template: "AnDonReportDefinitExcelSearch")]
        [HttpGet]
        public JsonResult 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 Json(mes);
        }
        #endregion
 
 
        #region[安灯报表汇总]
        /// <summary>
        /// 安灯报表汇总
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="calltypecode">呼叫类型编码</param>     
        /// <param name="calldate">呼叫时间</param>
        /// <param name="responddate">响应时间</param>
        /// <returns></returns>
        [Route(template: "AnDonReportSumSearch")]
        [HttpGet]
        public JsonResult AnDonReportSumSearch(int page, int rows, string prop, string order, string wkshopcode = null, string eqpcode = 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, eqpcode, calltypecode, callopendate, callclosedate, respondopendate, respondclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[安灯报表汇总导出]
        /// <summary>
        /// 安灯报表汇总导出
        /// </summary>
        /// <param name="wkshopcode">车间编码</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="calltypecode">呼叫类型编码</param>
        /// <param name="calldate">呼叫时间</param>
        /// <param name="responddate">响应时间</param>
        /// <returns></returns>
        [Route(template: "AnDonReportSumExcelSearch")]
        [HttpGet]
        public JsonResult AnDonReportSumExcelSearch(string wkshopcode = null, string eqpcode = 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, eqpcode, calltypecode, callopendate, callclosedate, respondopendate, respondclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[T8入库记录表头]
        /// <summary>
        /// T8入库记录表头
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <param name="hbillno">入库单号</param>
        /// <param name="hbdate">单据日期</param>
        /// <param name="username">操作人员</param>
        /// <param name="userdate">操作时间</param>     
        /// <returns></returns>
        [Route(template: "StorageRecordMainSearch")]
        [HttpGet]
        public JsonResult StorageRecordMainSearch(int page, int rows, string prop, string order, string hbillno = null, string hbdate = null, string username = null, string userdate = null)
        {
            string hbdateopendate = "";     //单据开始时间
            string hbdateclosedate = "";    //单据结束时间
            string userdateopendate = "";     //操作开始时间
            string userdateclosedate = "";    //操作结束时间
            if (hbdate != "" && hbdate != null)
            {
                hbdateopendate = hbdate.Split('~')[0].ToString();
                hbdateclosedate = hbdate.Split('~')[1].ToString();
            }
            if (userdate != "" && userdate != null)
            {
                userdateopendate = userdate.Split('~')[0].ToString();
                userdateclosedate = userdate.Split('~')[1].ToString();
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.StorageRecordMainSearch(hbillno, username, hbdateopendate, hbdateclosedate, userdateopendate, userdateclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[T8入库记录表体]
        /// <summary>
        /// T8入库记录表体
        /// </summary>
        /// <param name="hbillno">入库单号</param> 
        /// <returns></returns>
        [Route(template: "StorageRecordSubSearch")]
        [HttpGet]
        public JsonResult StorageRecordSubSearch(string hbillno = null)
        {
            mes = ReportManagerBLL.StorageRecordSubSearch(hbillno);
            return Json(mes);
        }
        #endregion
 
        #region[T8入库记录删除]
        /// <summary>
        /// T8入库记录删除
        /// </summary>
        /// <param name="dt">提交数据</param>
        /// <returns></returns>
        [Route(template: "StorageRecordDelete")]
        [HttpPost]
        public JsonResult StorageRecordDelete(DataTable dt)
        {
            var token = HttpContext.Request.Headers["Token"].ToString();
            User us = JwtTools.Denocode(token.ToString());
            mes = ReportManagerBLL.StorageRecordDelete(dt, us);
            return Json(mes);
        }
        #endregion
 
        #region[入库记录删除]
        /// <summary>
        /// 入库记录删除
        /// </summary>
        /// <param name="json">提交数据</param>
        /// <returns></returns>
        [Route(template: "DeleteStorageRecord")]
        [HttpPost]
        [ApiExplorerSettings(IgnoreApi =true)] //隐藏接口
        public JsonResult DeleteStorageRecord(List<StorageRecord> json)
        {
            var token = HttpContext.Request.Headers["Token"].ToString();
            User us = JwtTools.Denocode(token.ToString());
            mes = ReportManagerBLL.DeleteStorageRecord(json, us);
            return Json(mes);
        }
        #endregion
 
        #region[入库记录导出]
        /// <summary>
        /// 入库记录导出
        /// </summary>
        /// <param name="hbillno">入库单号</param>
        /// <param name="sono">销售单号</param>
        /// <param name="mono">订单号</param>
        /// <param name="wocode">工单号</param>     
        /// <param name="partcode">产品编码</param>
        /// <param name="partname">产品名称</param>
        /// <param name="stockcode">仓库编码</param>
        /// <param name="responddate">单据日期</param>
        /// <returns></returns>
        [Route(template: "StorageRecordExcelSearch")]
        [HttpGet]
        [ApiExplorerSettings(IgnoreApi = true)] //隐藏接口
        public JsonResult StorageRecordExcelSearch(string hbillno = null, string sono = null, string mono = null, string wocode = null, string partcode = null,string partname=null, string stockcode = null, string responddate = null)
        {
            string respondopendate = "";     //单据开始时间
            string respondclosedate = "";    //单据结束时间
            if (responddate != "" && responddate != null)
            {
                respondopendate = responddate.Split('~')[0].ToString();
                respondclosedate = responddate.Split('~')[1].ToString();
            }
            mes = ReportManagerBLL.StorageRecordExcelSearch(hbillno, sono, mono, wocode, partcode, partname, stockcode, respondopendate, respondclosedate);
            return Json(mes);
        }
        #endregion
 
 
        #region[T+入库记录表头]
        /// <summary>
        /// T+入库记录表头
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">每页显示条数</param>
        /// <param name="prop">排序字段</param>
        /// <param name="order">排序规则</param>
        /// <param name="hbillno">入库单号</param>
        /// <param name="hbdate">单据日期</param>
        /// <param name="username">操作人员</param>
        /// <param name="userdate">操作时间</param>     
        /// <returns></returns>
        [Route(template: "InStorageRecordMainSearch")]
        [HttpGet]
        public JsonResult InStorageRecordMainSearch(int page, int rows, string prop, string order, string hbillno = null, string hbdate = null, string username = null, string userdate = null)
        {
            string hbdateopendate = "";     //单据开始时间
            string hbdateclosedate = "";    //单据结束时间
            string userdateopendate = "";     //操作开始时间
            string userdateclosedate = "";    //操作结束时间
            if (hbdate != "" && hbdate != null)
            {
                hbdateopendate = hbdate.Split('~')[0].ToString();
                hbdateclosedate = hbdate.Split('~')[1].ToString();
            }
            if (userdate != "" && userdate != null)
            {
                userdateopendate = userdate.Split('~')[0].ToString();
                userdateclosedate = userdate.Split('~')[1].ToString();
            }
            int startNum = rows * (page - 1) + 1;  //起始记录rowNum
            int endNum = rows * page;   //结束记录 rowNum
            mes = ReportManagerBLL.InStorageRecordMainSearch(hbillno, username, hbdateopendate, hbdateclosedate, userdateopendate, userdateclosedate, startNum, endNum, prop, order);
            return Json(mes);
        }
        #endregion
 
        #region[T+入库记录表体]
        /// <summary>
        /// T+入库记录表体
        /// </summary>
        /// <param name="hbillno">入库单号</param> 
        /// <returns></returns>
        [Route(template: "InStorageRecordSubSearch")]
        [HttpGet]
        public JsonResult InStorageRecordSubSearch(string hbillno = null)
        {
            mes = ReportManagerBLL.InStorageRecordSubSearch(hbillno);
            return Json(mes);
        }
        #endregion
 
        #region[T+入库记录删除]
        /// <summary>
        /// T+入库记录删除
        /// </summary>
        /// <param name="dt">提交数据</param>
        /// <returns></returns>
        [Route(template: "DeleteInStorageRecord")]
        [HttpPost]
        public JsonResult DeleteInStorageRecord(DataTable dt)
        {
            var token = HttpContext.Request.Headers["Token"].ToString();
            //var token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyY29kZSI6Ijk5OTkiLCJ1c2VybmFtZSI6Iuezu-e7n-euoeeQhuWRmCIsInN0b3JnX2NvZGUiOiIiLCJzdG9yZ19uYW1lIjoiIiwiaXNfc3lzdGVtX2FkbWluIjoiWSIsInJvbGVfY29kZSI6IiIsInJvbGVfZGF0YXBlcm1pc3Npb25zIjoiIiwidXNlcnR5cGUiOiJQQyIsInJlZGlza2V5IjoiTmV3TUVTTG9naW5Vc2VySURQQzk5OTkiLCJtZXNTZXR0aW5nIjoie1wicm91dGVcIjp0cnVlLFwiaXNPcmRlclwiOnRydWUsXCJkZXZpY2VcIjp0cnVlLFwidGVjaFwiOnRydWUsXCJ3b3JrT3JkZXJcIjp0cnVlLFwiZXZlcnlcIjpmYWxzZSxcImxhc3RcIjpmYWxzZX0iLCJ0aW1lb3V0IjoiMjAyNC0xMC0yNFQxMjozNTo1MC4zNDI1NzE2KzA4OjAwIn0.Nbc-1sXd4QLLsnj8wH9XC7iWEmP0wDG82gwLxIh94e4";
            User us = JwtTools.Denocode(token.ToString());
            mes = ReportManagerBLL.DeleteInStorageRecord(dt, us);
            return Json(mes);
        }
        #endregion
    }
}