ソースを参照

借阅归还出库入库做成可多选档案信息状态不允许修改

zhaozhiqiang 5 年 前
コミット
1e7f1334dd
共有1 個のファイルを変更した210 個の追加1 個の削除を含む
  1. 210 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/archives/archivesController.cs

+ 210 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/archives/archivesController.cs

@@ -168,7 +168,7 @@ namespace CallCenterApi.Interface.Controllers.archives
168 168
                  //model.F_SortModel = input.F_SortModel;
169 169
                  model.A_archiveCode = archive.A_archiveCode;
170 170
                  model.A_archiveName = archive.A_archiveName;
171
-                 model.A_archiveState = archive.A_archiveState;
171
+                 //model.A_archiveState = archive.A_archiveState;
172 172
                  var uarchiveid = archive.id;
173 173
                 //model.A_archiveRecord = archive.A_archiveRecord;
174 174
                 model.A_archivePeople = CurrentUser.UserData.F_UserCode;// CurrentUser.UserData.F_UserCode;//操作人archive.A_archivePeople
@@ -411,6 +411,126 @@ namespace CallCenterApi.Interface.Controllers.archives
411 411
 
412 412
         }
413 413
         /// <summary>
414
+        /// 外部客户借阅
415
+        /// </summary>
416
+        /// <param name="archive"></param>
417
+        /// <returns></returns>
418
+        public ActionResult CustomerBorrowJY(string archivesids,string openid)
419
+        {
420
+            var model = new CallCenterApi.Model.customerBorrow();
421
+           
422
+                ///修改物资状态为借阅中
423
+                 //根据状态名称获取状态id
424
+               
425
+                var stateid = 1;
426
+                
427
+                stateid = archivesbll.GetStateid("借阅中");
428
+
429
+            //获取用户名称
430
+            var customername = "";
431
+            if (archivesbll.GetCustomerName(openid) != "")
432
+            {
433
+                customername = archivesbll.GetCustomerName(openid);
434
+            }
435
+
436
+            //将多个物品id数据转成数据格式
437
+            string[] arrStr = archivesids.Split(',');
438
+            foreach (var item in arrStr)
439
+            {
440
+               
441
+
442
+               Model.archives  arc=   archivesbll.GetModel(Convert.ToInt32(item));
443
+                if (arc.stateName == "已出库" || arc.stateName == "借阅中" || arc.stateName == "丢失")
444
+                {
445
+                    //根据获取到的状态id修改物资状态
446
+                    var upstate = archivesbll.updateState(Convert.ToInt32(item), stateid);
447
+                    ///添加客户操作信息
448
+                    model.archivesid = Convert.ToInt32(item);//物品编号
449
+                    model.BorrowOreturn = "借阅";//区分借阅还是归还
450
+                    model.BorrowDate = DateTime.Now;//客户操作时间
451
+                    model.BorrowPeople = customername;// CurrentUser.UserData.F_UserCode ; //操作人customerBorrow.BorrowPeople
452
+                    var archivesid = Convert.ToInt32(item);
453
+                    if (archivesbll.AddCustomerBorrow(model) > 0)
454
+                    {
455
+                        var Operationlogmodel = new CallCenterApi.Interface.Models.Input.OperationlogInput();
456
+                        Operationlogmodel.Operator = customername;// CurrentUser.UserData.F_UserCode;
457
+                        Operationlogmodel.OperationDate = DateTime.Now;
458
+                        Operationlogmodel.OperationContent = "添加了一条借阅信息";
459
+                        Operationlogmodel.archivesid = archivesid;
460
+                        AddorUpdOperationlog(Operationlogmodel);
461
+
462
+                    }
463
+                    else
464
+                    {
465
+                        return Error("失败" + ",操作人:" + customername);
466
+                    }
467
+                }
468
+                else
469
+                {
470
+                    return Success("借阅失败档案已出库或已被借阅或丢失" + ",操作人:" + customername);
471
+                }
472
+
473
+
474
+            }
475
+            return Success("添加成功" + ",操作人:" + customername);
476
+
477
+        }
478
+        /// <summary>
479
+        /// 外部客户归还
480
+        /// </summary>
481
+        /// <param name="archive"></param>
482
+        /// <returns></returns>
483
+        public ActionResult CustomerBorrowGH(string archivesids, string openid)
484
+        {
485
+            var model = new CallCenterApi.Model.customerBorrow();
486
+
487
+            ///修改物资状态为借阅中
488
+            //根据状态名称获取状态id
489
+
490
+            var stateid = 1;
491
+
492
+            stateid = archivesbll.GetStateid("在库");
493
+
494
+            //获取用户名称
495
+            var customername = "";
496
+            if (archivesbll.GetCustomerName(openid) != "")
497
+            {
498
+                customername = archivesbll.GetCustomerName(openid);
499
+            }
500
+
501
+            //将多个物品id数据转成数据格式
502
+            string[] arrStr = archivesids.Split(',');
503
+            foreach (var item in arrStr)
504
+            {
505
+                //根据获取到的状态id修改物资状态
506
+                var upstate = archivesbll.updateState(Convert.ToInt32(item), stateid);
507
+
508
+
509
+                ///添加客户操作信息
510
+                model.archivesid = Convert.ToInt32(item);//物品编号
511
+                model.BorrowOreturn = "归还";//区分借阅还是归还
512
+                model.BorrowDate = DateTime.Now;//客户操作时间
513
+                model.BorrowPeople = customername;// CurrentUser.UserData.F_UserCode ; //操作人customerBorrow.BorrowPeople
514
+                var archivesid = Convert.ToInt32(item);
515
+                if (archivesbll.AddCustomerBorrow(model) > 0)
516
+                {
517
+                    var Operationlogmodel = new CallCenterApi.Interface.Models.Input.OperationlogInput();
518
+                    Operationlogmodel.Operator = customername;// CurrentUser.UserData.F_UserCode;
519
+                    Operationlogmodel.OperationDate = DateTime.Now;
520
+                    Operationlogmodel.OperationContent = "添加了一条归还信息";
521
+                    Operationlogmodel.archivesid = archivesid;
522
+                    AddorUpdOperationlog(Operationlogmodel);
523
+
524
+                }
525
+                else
526
+                {
527
+                    return Error("失败" + ",操作人:" + customername);
528
+                }
529
+            }
530
+            return Success("添加成功" + ",操作人:" + customername);
531
+
532
+        }
533
+        /// <summary>
414 534
         /// 删除一条客户操作的数据信息
415 535
         /// </summary>
416 536
         /// <param name="id"></param>
@@ -572,6 +692,95 @@ namespace CallCenterApi.Interface.Controllers.archives
572 692
             
573 693
         }
574 694
         /// <summary>
695
+        /// 内部员工入库
696
+        /// </summary>
697
+        /// <param name="archive"></param>
698
+        /// <returns></returns>
699
+        public ActionResult insideOperationRK(string archivesids)
700
+        {
701
+            var model = new CallCenterApi.Model.insideOperation();
702
+
703
+            ///修改物资状态为已出库
704
+            //根据状态名称 已出库 获取状态id
705
+            var stateid = 1;
706
+            if (archivesbll.GetStateid("在库") != 0)
707
+            {
708
+                stateid = archivesbll.GetStateid("在库");
709
+            }
710
+            //将多个物品id数据转成数据格式
711
+            string[] arrStr = archivesids.Split(',');
712
+            foreach (var item in arrStr)
713
+            {
714
+                //根据获取到的状态id修改物资状态
715
+                var upstate = archivesbll.updateState(Convert.ToInt32(item), stateid);
716
+                //员工操作记录表中添加数据
717
+                model.archivesid = Convert.ToInt32(item);//物品编号
718
+                model.Warehousing = "入库";//区分入库还是出库
719
+                model.WarehousingDate = DateTime.Now;//操作时间
720
+                model.Operator = CurrentUser.UserData.F_UserCode;// CurrentUser.UserData.F_UserCode; //操作人insideOperation.Operator
721
+                var arvichid = Convert.ToInt32(item);
722
+                if (archivesbll.AddinsideOperation(model) > 0)
723
+                {
724
+                    var Operationlogmodel = new CallCenterApi.Interface.Models.Input.OperationlogInput();
725
+                    Operationlogmodel.Operator = CurrentUser.UserData.F_UserCode;
726
+                    Operationlogmodel.OperationDate = DateTime.Now;
727
+                    Operationlogmodel.OperationContent = "添加了一条入库信息";
728
+                    Operationlogmodel.archivesid = arvichid;
729
+                    AddorUpdOperationlog(Operationlogmodel);
730
+                }
731
+                else
732
+                {
733
+                    return Error("失败" + ",操作人:" + CurrentUser.UserData.F_UserCode);
734
+                }
735
+
736
+            }
737
+            return Success("入库成功" + ",操作人:" + CurrentUser.UserData.F_UserCode);
738
+        }
739
+        /// <summary>
740
+        /// 内部员工出库
741
+        /// </summary>
742
+        /// <param name="archive"></param>
743
+        /// <returns></returns>
744
+        public ActionResult insideOperationCk(string archivesids)
745
+        {
746
+            var model = new CallCenterApi.Model.insideOperation();
747
+            
748
+             ///修改物资状态为已出库
749
+             //根据状态名称 已出库 获取状态id
750
+             var stateid = 1;
751
+            if (archivesbll.GetStateid("已出库") !=0)
752
+            {
753
+                stateid = archivesbll.GetStateid("已出库");
754
+            }
755
+            //将多个物品id数据转成数据格式
756
+            string[] arrStr = archivesids.Split(',');
757
+            foreach (var item in arrStr)
758
+            {
759
+                //根据获取到的状态id修改物资状态
760
+                var upstate = archivesbll.updateState(Convert.ToInt32(item), stateid);
761
+                model.archivesid = Convert.ToInt32(item);//物品编号
762
+                model.Warehousing = "出库";//区分入库还是出库
763
+                model.WarehousingDate = DateTime.Now;//操作时间
764
+                model.Operator = CurrentUser.UserData.F_UserCode;// CurrentUser.UserData.F_UserCode; //操作人insideOperation.Operator
765
+                var arvichid = Convert.ToInt32(item);
766
+                if (archivesbll.AddinsideOperation(model) > 0)
767
+                {
768
+                    var Operationlogmodel = new CallCenterApi.Interface.Models.Input.OperationlogInput();
769
+                    Operationlogmodel.Operator = CurrentUser.UserData.F_UserCode;
770
+                    Operationlogmodel.OperationDate = DateTime.Now;
771
+                    Operationlogmodel.OperationContent = "添加了一条出库信息";
772
+                    Operationlogmodel.archivesid = arvichid;
773
+                    AddorUpdOperationlog(Operationlogmodel);
774
+
775
+                }
776
+                else
777
+                {
778
+                    return Error("失败" + ",操作人:" + CurrentUser.UserData.F_UserCode);
779
+                }
780
+            }
781
+            return Success("出库成功" + ",操作人:" + CurrentUser.UserData.F_UserCode);
782
+        }
783
+        /// <summary>
575 784
         /// 删除一条内部员工出入库信息
576 785
         /// </summary>
577 786
         /// <param name="id"></param>