duhongyu il y a 6 ans
Parent
commit
073f74e70b

+ 31 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -129,6 +129,37 @@ namespace CallCenterApi.Interface.Controllers.customer
129 129
 
130 130
         }
131 131
         /// <summary>
132
+        ///根据客户编码获取客户信息
133
+        /// </summary>
134
+        /// <returns></returns>
135
+        public ActionResult GetCodeCustomer(string  code)
136
+        {
137
+            var list = new List<Model.T_Cus_CustomerBaseNew>(); DataTable dt = new DataTable();
138
+            string sql = "  F_IsDelete=0";
139
+            if (!string.IsNullOrWhiteSpace(code))//客户编号
140
+            {
141
+                if (valcode(code))
142
+                    sql += " and F_CustomerCode=" + code.Trim() + " ";
143
+                list = cusbll.GetModelList(sql);
144
+                if (list.Count > 0)
145
+                {
146
+                    List<CustomerBaseNewInput> Input = modeltooip(list);
147
+                    if (Input != null)
148
+                        return Success("获取成功", Input.FirstOrDefault());
149
+                    else
150
+                        return Error("没有获取到客户信息,请检查客户编号");
151
+                }
152
+                else
153
+                {
154
+                    return Error("没有获取到客户信息,请检查客户编号");
155
+                }
156
+            }
157
+            else
158
+            {
159
+                return Error("参数传输失败");
160
+            }
161
+        }
162
+        /// <summary>
132 163
         /// 获取客户信息
133 164
         /// </summary>
134 165
         /// <returns></returns>

+ 28 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/MaterialManageController.cs

@@ -56,6 +56,34 @@ namespace CallCenterApi.Interface.Controllers.workorder
56 56
 
57 57
             return Content(obj.ToJson());
58 58
         }
59
+        //根据物料编码获取物料信息
60
+        public ActionResult GetCodeModel(string code)
61
+        {
62
+            if (code != null && code.Trim() != "")
63
+            {
64
+                Model.T_Wo_MaterialManage dModel = mmBLL.GetModel(code.Trim());
65
+                if (dModel != null)
66
+                {
67
+                    var dvList = dvBLL.GetModelList(" F_DictionaryFlag in ('WLPP','WLFHFFX','WLCPX') ");
68
+                    var createusername = userBLL.GetModel(dModel.F_CreateBy);
69
+                    var obj = new
70
+                    {
71
+                        model = dModel,
72
+                        CreateByName = createusername
73
+                    };
74
+
75
+                    return Success("获取物料信息成功", obj);
76
+                }
77
+                else
78
+                {
79
+                    return Error("获取物料信息失败");
80
+                }
81
+            }
82
+            else
83
+            {
84
+                return Error("获取参数失败");
85
+            }
86
+        }
59 87
 
60 88
         //获取物料
61 89
         public ActionResult GetModel(string id)

+ 79 - 38
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -32,7 +32,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
32 32
         /// 获取工单列表
33 33
         /// </summary>
34 34
         /// <returns></returns>
35
-        public ActionResult GetList(string code, string cusname, string cusphone, string companyname, string province, string city,
35
+        public ActionResult GetList(string code, string cusname, string cusphone,string keywords, string companyname, string province, string city,
36 36
             string country, string township, string touser, int source=0,int type = 0, int state=-1, int pageindex = 1,int pagesize = 10)
37 37
         {
38 38
            
@@ -48,6 +48,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
48 48
                     sql += $" and F_Source=" + source;
49 49
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
50 50
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
51
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
52
+                    sql += $"  and F_WorkOrderCode like '%" + keywords.Trim() + "%' or F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%'  ";
51 53
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
52 54
                     sql += $" and F_WorkOrderCode like '%" + code.Trim() + "%'";
53 55
                 if (!string.IsNullOrWhiteSpace(cusname))//客户姓名
@@ -286,12 +288,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
286 288
         public string GetDeptWorkOrderID(string user)
287 289
         {
288 290
             string str = string.Empty;
289
-
290
-            str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType in(" + (int)EnumItemType.deal + "," + (int)EnumItemType.urge +")"
291
-                + " and ("
292
-                    + "(F_WoState in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
293
-                (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")"
294
-                     + "(F_NextDept in(" + user+ ")"
291
+           
292
+            str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType in(" + (int)EnumItemType.deal + "," + (int)EnumItemType.urge + ")"
293
+                + " and "
294
+                    + "F_WoState in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
295
+                (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")"+ " and  "
296
+                     + "F_NextDept in(" + user+ ")"
295 297
                 + " and isnull(F_IsUsed,'0')='0' ";
296 298
 
297 299
             return str;
@@ -419,7 +421,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
419 421
         /// <summary>
420 422
         ///综合查询列表
421 423
         /// </summary>
422
-        public ActionResult GetComprehensive(string code, string cusname, string cusphone, string companyname, string province, string city,
424
+        public ActionResult GetComprehensive(string code, string cusname,string keywords, string cusphone, string companyname, string province, string city,
423 425
             string country, string township, string touser, int source = 0,int state=-1, int type = 0, int pageindex = 1, int pagesize = 10)
424 426
         {
425 427
             int userId = CurrentUser.UserData.F_UserId;
@@ -438,6 +440,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
438 440
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
439 441
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
440 442
                     sql += $" and F_WorkOrderCode like '%" + code.Trim() + "%'";
443
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
444
+                    sql += $"  and F_WorkOrderCode like '%" + keywords.Trim() + "%' or F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%'  ";
441 445
                 if (!string.IsNullOrWhiteSpace(cusname))//客户姓名
442 446
                     sql += $" and F_CusName like '%" + cusname.Trim() + "%'";
443 447
                 if (!string.IsNullOrWhiteSpace(cusphone))//客户电话
@@ -456,7 +460,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
456 460
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
457 461
                 if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY")
458 462
                 {
459
-                    sql += " and F_DealBy = '" + ua.F_UserCode + "' ";
463
+                    sql += $" and F_DealBy like '%" + ua.F_UserCode.Trim() + "%'";
460 464
                 }
461 465
                 else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "BLRY" || ro.F_RoleCode == "ZG")
462 466
                 {
@@ -476,6 +480,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
476 480
                                     {
477 481
                                         detpid += "," + it.F_DeptId;
478 482
                                     }
483
+                                    else
484
+                                    {
485
+                                        detpid="" + it.F_DeptId;
486
+                                    }
479 487
                                 }
480 488
                             }
481 489
                         }
@@ -483,8 +491,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
483 491
                         {
484 492
                             detpid = ua.F_DeptId.ToString();
485 493
                         }
486
-                        sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") ";
494
+                        if (GetDeptWorkOrderID(detpid) != "")
495
+                        {
496
+                            sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") ";
497
+                        }
498
+                        else
499
+                        {
487 500
 
501
+                            return Success("暂无工单"); ;
502
+                        }
488 503
                     }
489 504
                     else
490 505
                     {
@@ -534,7 +549,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
534 549
         /// <summary>
535 550
         /// 查询超时工单列表
536 551
         /// </summary>
537
-        public ActionResult GetOvertime(string code, string cusname, string cusphone, string companyname, string province, string city,
552
+        public ActionResult GetOvertime(string code,string keywords, string cusname, string cusphone, string companyname, string province, string city,
538 553
             string country, string township, string touser, int source = 0, int type = 0,int pageindex = 1, int pagesize = 10)
539 554
         {
540 555
             int userId = CurrentUser.UserData.F_UserId;
@@ -555,6 +570,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
555 570
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
556 571
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
557 572
                     sql += $" and F_WorkOrderCode like '%" + code.Trim() + "%'";
573
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
574
+                    sql += $"  and F_WorkOrderCode like '%" + keywords.Trim() + "%' or F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%'  ";
558 575
                 if (!string.IsNullOrWhiteSpace(cusname))//客户姓名
559 576
                     sql += $" and F_CusName like '%" + cusname.Trim() + "%'";
560 577
                 if (!string.IsNullOrWhiteSpace(cusphone))//客户电话
@@ -576,7 +593,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
576 593
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
577 594
                 if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY" || ro.F_RoleCode == "BLRY")
578 595
                 {
579
-                    sql += " and F_DealBy = '" + ua.F_UserCode;
596
+                    sql += $" and F_DealBy like '%" + ua.F_UserCode.Trim() + "%'";
580 597
                 }
581 598
                 else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
582 599
                 {
@@ -596,6 +613,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
596 613
                                     {
597 614
                                         detpid += "," + it.F_DeptId;
598 615
                                     }
616
+                                    else
617
+                                    {
618
+                                        detpid= ""+it.F_DeptId; ;
619
+                                    }
599 620
                                 }
600 621
                             }
601 622
                         }
@@ -603,7 +624,16 @@ namespace CallCenterApi.Interface.Controllers.workorder
603 624
                         {
604 625
                             detpid = ua.F_DeptId.ToString ();
605 626
                         }
606
-                        sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") ";
627
+                        if (GetDeptWorkOrderID(detpid) != "")
628
+                        {
629
+                            sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") "; ;
630
+                        }
631
+                        else
632
+                        {
633
+
634
+                            return Success("暂无工单"); ;
635
+                        }
636
+                       
607 637
                     }
608 638
                     else
609 639
                     {
@@ -926,8 +956,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
926 956
         /// 获取催办工单列表
927 957
         /// </summary>
928 958
         /// <returns></returns>
929
-        public ActionResult GetUrgeList(string code, string cusname, string cusphone, string companyname, string province, string city,
930
-            string country, string township, string touser,int source=0, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10)
959
+        public ActionResult GetUrgeList(string code, string cusname,string keywords, string cusphone, string companyname, string province, string city,
960
+            string country, string township, string touser,int source=-1, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10)
931 961
         {
932 962
            
933 963
             int userId = CurrentUser.UserData.F_UserId;
@@ -949,6 +979,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
949 979
                     sql += $" and F_WorkOrderCode like '%" + code.Trim() + "%'";
950 980
                 if (!string.IsNullOrWhiteSpace(cusname))//客户姓名
951 981
                     sql += $" and F_CusName like '%" + cusname.Trim() + "%'";
982
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
983
+                    sql += $"  and F_WorkOrderCode like '%" + keywords.Trim() + "%' or F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%'  ";
952 984
                 if (!string.IsNullOrWhiteSpace(cusphone))//客户电话
953 985
                     sql += $" and F_CusPhone like '%" + cusphone.Trim() + "%'";
954 986
                 if (!string.IsNullOrWhiteSpace(companyname))//公司名称
@@ -982,15 +1014,24 @@ namespace CallCenterApi.Interface.Controllers.workorder
982 1014
                         var list = itembll.GetList(" F_WoID ='" + dr["ID"].ToString() + "' and F_ItemType=" + (int)EnumItemType.urge).Tables[0];
983 1015
                         dr["CBCount"] = list.Rows.Count;
984 1016
                     }
985
-
986
-                    var obj = new
1017
+                    List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
1018
+                    List<WorkOrderNewInput> Input = modeltooip(modlelist);
1019
+                    if (Input != null )
987 1020
                     {
988
-                        state = "success",
989
-                        message = "成功",
990
-                        rows = dt,
991
-                        total = recordCount
992
-                    };
993
-                    return  Content(obj.ToJson());
1021
+                        var obj = new
1022
+                        {
1023
+                            state = "success",
1024
+                            message = "成功",
1025
+                            rows = Input,
1026
+                            total = recordCount
1027
+                        };
1028
+                        return Content(obj.ToJson());
1029
+                    }
1030
+                    else
1031
+                    {
1032
+                        return Success("暂无工单"); ;
1033
+                    }
1034
+
994 1035
                 }
995 1036
                 else
996 1037
                 {
@@ -1409,11 +1450,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
1409 1450
         /// </summary>
1410 1451
         /// <param name="id"></param>
1411 1452
         /// <returns></returns>
1412
-        private int  TimeToOver(int id)
1453
+        private float TimeToOver(int id)
1413 1454
         {
1414 1455
             var itemlasts = itembll.GetModelList("  F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID=" + id + " ");
1415 1456
             string time1 = "", time2 = ""; int x = 0, y = 0;
1416
-            int time = 0;
1457
+            float  time = 0;
1417 1458
             if (itemlasts.Count > 0)
1418 1459
             {
1419 1460
                 for (int i = 0; i < itemlasts.Count; i++)
@@ -1424,7 +1465,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1424 1465
                         {
1425 1466
                             x = i;
1426 1467
                             time1 = itemlasts[i].F_CreateTime.ToString();
1427
-                            time = int.Parse(itemlasts[i].F_LimitTime);
1468
+                            time = float .Parse(itemlasts[i].F_LimitTime);
1428 1469
                         }
1429 1470
                         if (itemlasts[i].F_WoState == 10)
1430 1471
                         {
@@ -1439,14 +1480,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
1439 1480
                     {
1440 1481
                         if (x > y)
1441 1482
                         {
1442
-                            int a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
1443
-                            int b = time - a;
1483
+                            float a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
1484
+                            float  b = time - a;
1444 1485
                             return b;
1445 1486
                         }
1446 1487
                         else
1447 1488
                         {
1448
-                            int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
1449
-                            int b = time - a;
1489
+                            float a = (DateTime.Now - DateTime.Parse(time1)).Hours;
1490
+                            float b = time - a;
1450 1491
                             return b;
1451 1492
                         }
1452 1493
                     }
@@ -1457,8 +1498,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
1457 1498
                 }
1458 1499
                 else if (time1 != "")
1459 1500
                 {
1460
-                    int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
1461
-                    int b = time - a;
1501
+                    float a = (DateTime.Now - DateTime.Parse(time1)).Hours;
1502
+                    float b = time - a;
1462 1503
                     return b;
1463 1504
                 }
1464 1505
                 else
@@ -1481,7 +1522,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1481 1522
         {
1482 1523
             var itemlasts = itembll.GetModelList("  F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID=" + id + " ");
1483 1524
             string  time1="", time2="" ;int x=0, y=0;
1484
-            int time = 0;
1525
+            float  time = 0;
1485 1526
             if (itemlasts.Count > 0)
1486 1527
             {
1487 1528
                 for (int i=0;i < itemlasts.Count;i++)
@@ -1492,7 +1533,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1492 1533
                         {
1493 1534
                             x = i;
1494 1535
                             time1 = itemlasts[i].F_CreateTime.ToString();
1495
-                            time = int.Parse(itemlasts[i].F_LimitTime);
1536
+                            time = float .Parse(itemlasts[i].F_LimitTime);
1496 1537
                         }
1497 1538
                         if (itemlasts[i].F_WoState == 10)
1498 1539
                         {
@@ -1919,7 +1960,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1919 1960
         /// </summary>
1920 1961
         /// <returns></returns>
1921 1962
         [Authority]
1922
-        public ActionResult DelayWorkOrder(long orderid, string cont, int limit = 0)
1963
+        public ActionResult DelayWorkOrder(long orderid, string cont, float  limit = 0)
1923 1964
         {
1924 1965
             //办理人员和监管可以延期工单
1925 1966
             int userId = CurrentUser.UserData.F_UserId;
@@ -2022,10 +2063,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
2022 2063
         /// <summary>
2023 2064
         /// 延期工单
2024 2065
         /// </summary>
2025
-        public bool DeWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont, int limit)
2066
+        public bool DeWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont, float  limit)
2026 2067
         {
2027 2068
             #region 工单处理
2028
-          int  sms = 0; int wostate = 0; int optbut = 0;int time = 0;
2069
+          int  sms = 0; int wostate = 0; int optbut = 0;float  time = 0;
2029 2070
             var itemlasts = itembll.GetModelList("  F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID=" + model.F_ID + " ");
2030 2071
             if (itemlasts.Count > 0)
2031 2072
             {
@@ -2034,7 +2075,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2034 2075
                     if (it.F_WoState == 1)
2035 2076
                     {
2036 2077
                         sms = int.Parse(it.F_IsSMS.ToString());
2037
-                        time = int.Parse(it.F_LimitTime);
2078
+                        time = float .Parse(it.F_LimitTime);
2038 2079
                     }
2039 2080
                     itembll.Update(it);
2040 2081
                     wostate = int.Parse(it.F_WoState.ToString());