Bladeren bron

短信修改,通话记录客户姓名没有带出修改,修改工单权限修改,流程添加审核内容

duhongyu 6 jaren geleden
bovenliggende
commit
234f3c1d4d

+ 2 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MsgController.cs

@@ -382,7 +382,8 @@ namespace CallCenterApi.Interface.Controllers
382 382
             //    new BLL.T_Msg_List().Add(msg);
383 383
             //}
384 384
             #endregion
385
-            var msgListnew = new BLL.T_Msg_List().GetModelList(" ToUser='" + usercode + "' and Type in (2,4,5) and State=0 and IsDel=0 order by CreateDate desc");
385
+            
386
+            var msgListnew = new BLL.T_Msg_List().GetModelList(" ToUser='" + usercode + "' and Type in (2) and State=0 and IsDel=0 order by CreateDate desc");
386 387
             return Success("获取消息", msgListnew);
387 388
         }
388 389
 

+ 13 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -23,7 +23,12 @@ namespace CallCenterApi.Interface.Controllers
23 23
         #endregion
24 24
         public ActionResult SMSSend(string name,string phone,string cusphone)
25 25
         {
26
-
26
+            if (string .IsNullOrEmpty (name))
27
+                return Error("请输入联系人姓名");
28
+            if (string.IsNullOrEmpty(phone))
29
+                return Error("请输入联系人电话");
30
+            if (string.IsNullOrEmpty(cusphone))
31
+                return Error("请输入发送号码");
27 32
             SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,感谢你的致电反馈,稍后会安排业务经理和你联系,请你保持电话畅通。业务经理姓名:"+ name+",电话:"+ phone+"。");
28 33
             
29 34
             if (result != null)
@@ -39,7 +44,12 @@ namespace CallCenterApi.Interface.Controllers
39 44
         }
40 45
         public ActionResult SMSSendSalesman(string name, string phone, string cusphone)
41 46
         {
42
-
47
+            if (string.IsNullOrEmpty(name))
48
+                return Error("请输入联系人姓名");
49
+            if (string.IsNullOrEmpty(phone))
50
+                return Error("请输入联系人电话");
51
+            if (string.IsNullOrEmpty(cusphone))
52
+                return Error("请输入发送号码");
43 53
             SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,刚有客户反馈有关市场业务/产品/农化问题,请你及时联系提供服务。姓名:"+ name + ",电话:"+ phone + "。");
44 54
 
45 55
             if (result != null)
@@ -48,7 +58,7 @@ namespace CallCenterApi.Interface.Controllers
48 58
             }
49 59
             else
50 60
             {
51
-                return Error("发送失败,请检查客户电话");
61
+                return Error("发送失败,请检查电话");
52 62
             }
53 63
         }
54 64
 

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -198,11 +198,18 @@ namespace CallCenterApi.Interface.Controllers.tel
198 198
                 {
199 199
                     Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
200 200
          .FirstOrDefault();
201
+                    Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='0" + tephone + "'  ")
202
+        .FirstOrDefault();
201 203
                     if (cus != null)
202 204
                     {
203 205
                         dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
204 206
                .FirstOrDefault().F_Legal;
205 207
                     }
208
+                    else if (cusll!=null )
209
+                    {
210
+                        dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='0" + tephone + "'  ")
211
+               .FirstOrDefault().F_Legal;
212
+                    }
206 213
                 }
207 214
 
208 215
             }

+ 156 - 46
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -90,10 +90,11 @@ namespace CallCenterApi.Interface.Controllers.weixin
90 90
                 else
91 91
                     loginUser = loginwork;
92 92
                 loginUser.F_WxOpenId = login.OpenId;
93
-                    int UserType = 0;string rolecode = "";
94
-
95
-                    //部门
96
-                    Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(loginUser.F_DeptId);
93
+                    int UserType = 0;string rolecode = "";string UserName = "";string rolename = "";
94
+                UserName = loginUser.F_UserName;
95
+               
96
+                //部门
97
+                Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(loginUser.F_DeptId);
97 98
                     if (modelDep == null)
98 99
                         return Error("获取失败!");
99 100
                     #region 读取角色code
@@ -110,22 +111,31 @@ namespace CallCenterApi.Interface.Controllers.weixin
110 111
                 }
111 112
                     else
112 113
                     {
113
-                        if (loginUser.F_RoleId == 60 || loginUser.F_RoleId == 62)
114
+                        if (loginUser.F_RoleId == 60 )
114 115
                         {
115 116
                             UserType = 0;
116
-                        }
117
+                        rolename ="分公司经理";
118
+                       }
119
+                        else if (loginUser.F_RoleId == 62)
120
+                      {
121
+                        UserType = 0;
122
+                        rolename = "大区经理";
123
+                    }
117 124
                         else if (loginUser.F_RoleId == 61)
118 125
                         {
119 126
                             UserType = 2;
120
-                        }
127
+                        rolename = "高层";
128
+                    }
121 129
                         else if (loginUser.F_RoleId == 58)
122 130
                         {
123 131
                             UserType = 4;
124
-                        }
132
+                        rolename = "业务员";
133
+                    }
125 134
                         else if (loginUser.F_RoleId == 59)
126 135
                         {
127 136
                             UserType = 3;
128
-                        }
137
+                        rolename = "办理人员";
138
+                    }
129 139
                         else
130 140
                         {
131 141
                         return Error("无操作权限");
@@ -165,7 +175,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
165 175
                         openid = login.OpenId,
166 176
                         usercode = login.UserCode,
167 177
                         usertype = UserType,
168
-                        rolecode=rolecode,
178
+                        UserName= UserName,
179
+                        rolename = rolename,
180
+                        rolecode =rolecode,
169 181
                     };
170 182
 
171 183
                      if (userAccountBLL.Update(loginUser))
@@ -1241,7 +1253,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1241 1253
                         {
1242 1254
                             opt = "同意上报";
1243 1255
                             var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ")" + "工单审批:同意上报" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reaudit, "", 0, nowUser, overtime, sms);
1244
-                            res = GetDaQucirCulation(nowUser, DateTime.Now.ToString(), model.F_ID,true );
1256
+                            res = GetDaQucirCulation(AuditCont,nowUser, DateTime.Now.ToString(), model.F_ID,true );
1245 1257
                             if (userid <= 0 || !res)
1246 1258
                                 res = false;
1247 1259
                             wostate = 1;
@@ -1322,7 +1334,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1322 1334
         /// <param name="ua"></param>
1323 1335
         /// <param name="time"></param>
1324 1336
         /// <param name="id"></param>
1325
-        public bool  GetDaQucirCulation(Model.T_Sys_UserAccount ua,string  time,long id,bool istrue)
1337
+        public bool  GetDaQucirCulation(string AuditCont,Model.T_Sys_UserAccount ua,string  time,long id,bool istrue)
1326 1338
         {
1327 1339
             DateTime times = DateTime.Parse(time).AddHours(24);
1328 1340
             Model.T_Wo_WorkOrder model = woBLL.GetModel(id);
@@ -1330,18 +1342,52 @@ namespace CallCenterApi.Interface.Controllers.weixin
1330 1342
             modeLlist.Add(model);
1331 1343
             List<WorkOrderNewInput> Input = modeltooip(modeLlist,ua );
1332 1344
             string cont = "";
1333
-           if (istrue)
1345
+            int dapt = 0, nextda = 0; string opt = "";
1346
+            var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
1347
+            if (deptmodel1 != null)
1334 1348
             {
1335
-                cont = "大区经理已审批流转市场管理科";
1349
+                dapt = deptmodel1.F_ParentId;
1336 1350
             }
1337
-           else
1351
+            if (dapt != 0)
1338 1352
             {
1339
-                cont = "大区经理未审批流转市场管理科";
1353
+                if (dapt == 11)
1354
+                {
1355
+                    nextda = 37;
1356
+                    opt = "流转市场管理科";
1357
+                }
1358
+                else if (dapt == 14)
1359
+                {
1360
+                    nextda = 57;
1361
+                    opt = "流转营销管理处";
1362
+                }
1363
+                else if (dapt == 15)
1364
+                {
1365
+                    nextda = 74;
1366
+                    opt = "流转策划推广";
1367
+                }
1368
+                else if (dapt == 16)
1369
+                {
1370
+                    nextda = 88;
1371
+                    opt = "流转销售部";
1372
+                }
1373
+            }
1374
+            if (istrue)
1375
+            {
1376
+                cont = "大区经理已审批:"+ AuditCont+","+ opt;
1377
+            }
1378
+            else
1379
+            {
1380
+                cont = "大区经理未审批"+ opt;
1381
+            }
1382
+            if (nextda != 0)
1383
+            {
1384
+                var res = AssignWO(ua, model, Input[0], cont, "", nextda, 0, 0, 0, 0, 0, 0, time.ToString());
1385
+                return res;
1386
+            }
1387
+            else
1388
+            {
1389
+                return false ;
1340 1390
             }
1341
-             var res = AssignWO(ua, model, Input[0], cont,"", 37, 0, 0, 0, 0, 0, 0, time.ToString());
1342
-            
1343
-          
1344
-            return res;
1345 1391
         }
1346 1392
         /// <summary>
1347 1393
         /// 查询工单详情
@@ -1470,7 +1516,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1470 1516
                     {
1471 1517
                     if (hours>=24)
1472 1518
                     {
1473
-                        GetDaQucirCulation(ua, it.F_CreateTime.ToString (), it.F_WoID,false );
1519
+                        GetDaQucirCulation("",ua, it.F_CreateTime.ToString (), it.F_WoID,false );
1474 1520
                     }
1475 1521
                     else
1476 1522
                     {
@@ -1502,7 +1548,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1502 1548
                     }
1503 1549
                     else if (hours >= 48)
1504 1550
                     {
1505
-                        GetDaQucirCulation(user, it.F_CreateTime.ToString(), it.F_WoID,false );
1551
+                        GetDaQucirCulation("",user, it.F_CreateTime.ToString(), it.F_WoID,false );
1506 1552
                     }
1507 1553
                     else
1508 1554
                     {
@@ -1548,7 +1594,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1548 1594
                                 }
1549 1595
                                 else
1550 1596
                                 {
1551
-                                    GetDaQucirCulation(ua, time.ToString(), it.F_WoID,false );
1597
+                                    GetDaQucirCulation("",ua, time.ToString(), it.F_WoID,false );
1552 1598
                                 }
1553 1599
                             }
1554 1600
                         }
@@ -1869,13 +1915,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
1869 1915
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1870 1916
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1871 1917
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
1872
-                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1918
+                  //  model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1873 1919
                     if (!string.IsNullOrEmpty(model1[i].F_CreateBy))
1874 1920
 
1875 1921
                     {
1876 1922
                         Model.T_Sys_UserAccount creatname = userAccountBLL .GetModel(model1[i].F_CreateBy);
1877 1923
                         if (creatname != null)
1878 1924
                         {
1925
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
1879 1926
                             model.F_CreateName = creatname.F_UserName; ;//添加人
1880 1927
                         }
1881 1928
 
@@ -2668,17 +2715,52 @@ namespace CallCenterApi.Interface.Controllers.weixin
2668 2715
                             else
2669 2716
                             {
2670 2717
                                 string deptname1 = "";
2718
+                               int  dapt = 0,nextda=0;
2719
+                               
2671 2720
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
2672 2721
                                 if (deptmodel1 != null)
2673 2722
                                 {
2674 2723
                                     deptname1 = deptmodel1.F_DeptName + "-";
2724
+                                    dapt =deptmodel1.F_ParentId ;
2675 2725
                                 }
2676 2726
                                 AddLog(modlelist.F_ID, 0, deptname1 + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create,"",0, ua, 0, 0);
2677
-                                var res = AssignWO(ua, modlelist, input, "流转市场管理科", "", 37, 0, overtime, sms);
2678
-                                if (res)
2679
-                                return Success("添加成功");
2727
+                                string opt = "";
2728
+                                if (dapt !=0)
2729
+                                {
2730
+                                    if (dapt==11)
2731
+                                    {
2732
+                                        nextda = 37;
2733
+                                        opt = "流转市场管理科";
2734
+                                    }
2735
+                                    else if (dapt == 14)
2736
+                                    {
2737
+                                        nextda = 57;
2738
+                                        opt = "流转营销管理处";
2739
+                                    }
2740
+                                    else if (dapt == 15)
2741
+                                    {
2742
+                                        nextda = 74;
2743
+                                        opt = "流转策划推广";
2744
+                                    }
2745
+                                    else if (dapt == 16)
2746
+                                    {
2747
+                                        nextda = 88;
2748
+                                        opt = "流转销售部";
2749
+                                    }
2750
+                                }
2751
+                                if (nextda!=0)
2752
+                                {
2753
+                                    var res = AssignWO(ua, modlelist, input, opt, "", nextda, 0, overtime, sms);
2754
+                                    if (res)
2755
+                                        return Success("添加成功");
2756
+                                    else
2757
+                                        return Error("流转失败!");
2758
+                                }
2680 2759
                                 else
2681
-                                    return Error("市场管理科接收失败!");
2760
+                                {
2761
+                                    return Error("流转失败!");
2762
+                                }
2763
+                               
2682 2764
                             }
2683 2765
                         }
2684 2766
                         else
@@ -3937,20 +4019,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
3937 4019
                 var model = woBLL.GetModel(input.F_ID);
3938 4020
                 if (model ==null )
3939 4021
                     return Error("查询不到此工单!");
3940
-               
3941
-                if(model .F_State !=3&& model.F_State != 12)
4022
+
4023
+                if (model.F_State == 2)
3942 4024
                 {
3943
-                    var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3944
-                    if (itemlast .Count >0)
3945
-                    {
3946
-                        foreach (var it in itemlast)
3947
-                        {
3948
-                            if (it .F_WoState ==2)
3949
-                            {
3950
-                                return Error("此工单已进入处理流程不能修改!");
3951
-                            }
3952
-                        }
3953
-                    }
4025
+                    return Error("此工单已接单不能修改!");
4026
+                }
4027
+                else if (model.F_State == 11 || model.F_State == 10)
4028
+                {
4029
+                    return Error("此工单已处理不能修改!");
3954 4030
                 }
3955 4031
                 #region 保存客户基本信息
3956 4032
                 model = inputtoobj(ua,model, input, 1);
@@ -3984,19 +4060,53 @@ namespace CallCenterApi.Interface.Controllers.weixin
3984 4060
                     }
3985 4061
                     else
3986 4062
                     {
4063
+
3987 4064
                         string deptname1 = "";
4065
+                        int dapt = 0, nextda = 0; string opt = "";
3988 4066
                         var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3989 4067
                         if (deptmodel1 != null)
3990 4068
                         {
3991 4069
                             deptname1 = deptmodel1.F_DeptName + "-";
4070
+                            dapt = deptmodel1.F_ParentId;
4071
+                        }
4072
+                        if (dapt != 0)
4073
+                        {
4074
+                            if (dapt == 11)
4075
+                            {
4076
+                                nextda = 37;
4077
+                                opt = "流转市场管理科";
4078
+                            }
4079
+                            else if (dapt == 14)
4080
+                            {
4081
+                                nextda = 57;
4082
+                                opt = "流转营销管理处";
4083
+                            }
4084
+                            else if (dapt == 15)
4085
+                            {
4086
+                                nextda = 74;
4087
+                                opt = "流转策划推广";
4088
+                            }
4089
+                            else if (dapt == 16)
4090
+                            {
4091
+                                nextda = 88;
4092
+                                opt = "流转销售部";
4093
+                            }
4094
+                        }
4095
+                        if (nextda != 0)
4096
+                        {
4097
+                            var res = AssignWO(ua, model, input, opt, "", nextda, 0, model.F_limit, 0);
4098
+                            if (res)
4099
+                                return Success("保存成功");
4100
+                            else
4101
+                                return Error("流转失败!");
3992 4102
                         }
3993
-                        var res = AssignWO(ua, model, input, "流转市场管理科","", 37, 0, model.F_limit, 0);
3994
-                        if (res)
3995
-                            return Success("保存成功");
3996 4103
                         else
3997
-                            return Error("市场管理科接收失败!");
4104
+                        {
4105
+                            return Error("流转失败!");
4106
+                        }
4107
+
3998 4108
                     }
3999
-                return Success("保存成功!");
4109
+                    return Success("保存成功!");
4000 4110
                 }
4001 4111
                 else
4002 4112
                     return Error("保存失败!");

+ 140 - 41
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -1012,7 +1012,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1012 1012
                         {
1013 1013
                             opt = "同意上报";
1014 1014
                             var userid = AddLog(model.F_ID, model.F_State.Value, deptmodelsname + nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ")" + "工单审批:同意上报" + AuditCont, (int)EnumItemType.audit, (int)EnumItemOpt.reaudit, "", 0, nowUser, overtime, sms);
1015
-                            res = GetDaQucirCulation(nowUser, DateTime.Now.ToString(), model.F_ID, true);
1015
+                            res = GetDaQucirCulation(AuditCont,nowUser, DateTime.Now.ToString(), model.F_ID, true);
1016 1016
                             if (userid <= 0 || !res)
1017 1017
                                 res = false;
1018 1018
                             wostate = 1;
@@ -1125,7 +1125,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1125 1125
         /// <param name="ua"></param>
1126 1126
         /// <param name="time"></param>
1127 1127
         /// <param name="id"></param>
1128
-        public bool GetDaQucirCulation(Model.T_Sys_UserAccount ua, string time, long id, bool istrue)
1128
+        public bool GetDaQucirCulation(string AuditCont, Model.T_Sys_UserAccount ua, string time, long id, bool istrue)
1129 1129
         {
1130 1130
             DateTime times = DateTime.Parse(time).AddHours(24);
1131 1131
             Model.T_Wo_WorkOrder model = workOrder .GetModel(id);
@@ -1133,18 +1133,52 @@ namespace CallCenterApi.Interface.Controllers.workorder
1133 1133
             modeLlist.Add(model);
1134 1134
             List<WorkOrderNewInput> Input = modeltooip(modeLlist);
1135 1135
             string cont = "";
1136
+            int dapt = 0, nextda = 0; string opt = "";
1137
+            var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
1138
+            if (deptmodel1 != null)
1139
+            {
1140
+                dapt = deptmodel1.F_ParentId;
1141
+            }
1142
+            if (dapt != 0)
1143
+            {
1144
+                if (dapt == 11)
1145
+                {
1146
+                    nextda = 37;
1147
+                    opt = "流转市场管理科";
1148
+                }
1149
+                else if (dapt == 14)
1150
+                {
1151
+                    nextda = 57;
1152
+                    opt = "流转营销管理处";
1153
+                }
1154
+                else if (dapt == 15)
1155
+                {
1156
+                    nextda = 74;
1157
+                    opt = "流转策划推广";
1158
+                }
1159
+                else if (dapt == 16)
1160
+                {
1161
+                    nextda = 88;
1162
+                    opt = "流转销售部";
1163
+                }
1164
+            }
1136 1165
             if (istrue)
1137 1166
             {
1138
-                cont = "大区经理已审批流转市场管理科";
1167
+                cont = "大区经理已审批:"+ AuditCont+"," + opt;
1139 1168
             }
1140 1169
             else
1141 1170
             {
1142
-                cont = "大区经理未审批流转市场管理科";
1171
+                cont = "大区经理未审批" + opt;
1172
+            }
1173
+            if (nextda != 0)
1174
+            {
1175
+                var res = AssignWO(ua, model, Input[0], cont, "", nextda, 0, 0, 0, 0, 0, 0, time.ToString());
1176
+                return res;
1177
+            }
1178
+            else
1179
+            {
1180
+                return false;
1143 1181
             }
1144
-            var res = AssignWO(ua, model, Input[0], cont,"", 37, 0, 0, 0, 0, 0, 0, time.ToString());
1145
-
1146
-
1147
-            return res;
1148 1182
         }
1149 1183
         /// <summary>
1150 1184
         /// 获取待审批的工单
@@ -1167,7 +1201,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1167 1201
                 {
1168 1202
                     if (hours >= 24)
1169 1203
                     {
1170
-                        GetDaQucirCulation(ua, it.F_CreateTime.ToString(), it.F_WoID, false);
1204
+                        GetDaQucirCulation("",ua, it.F_CreateTime.ToString(), it.F_WoID, false);
1171 1205
                     }
1172 1206
                     else
1173 1207
                     {
@@ -1199,7 +1233,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1199 1233
                     }
1200 1234
                     else if (hours >= 48)
1201 1235
                     {
1202
-                        GetDaQucirCulation(user, it.F_CreateTime.ToString(), it.F_WoID, false);
1236
+                        GetDaQucirCulation("",user, it.F_CreateTime.ToString(), it.F_WoID, false);
1203 1237
                     }
1204 1238
                     else
1205 1239
                     {
@@ -1245,7 +1279,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1245 1279
                                 }
1246 1280
                                 else
1247 1281
                                 {
1248
-                                    GetDaQucirCulation(ua, time.ToString(), it.F_WoID, false);
1282
+                                    GetDaQucirCulation("",ua, time.ToString(), it.F_WoID, false);
1249 1283
                                 }
1250 1284
                             }
1251 1285
                         }
@@ -3267,12 +3301,50 @@ namespace CallCenterApi.Interface.Controllers.workorder
3267 3301
                             }
3268 3302
                             else
3269 3303
                             {
3270
-                                AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
3271
-                                var res = AssignWO(ua, modlelist, input, "流转市场管理科","", 37, 0, 0, 0);
3304
+                          
3305
+                            int dapt = 0, nextda = 0;
3306
+                            var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3307
+                            if (deptmodel1 != null)
3308
+                            {
3309
+                                dapt = deptmodel1.F_ParentId;
3310
+                            }
3311
+                            AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
3312
+                            string opt = "";
3313
+                            if (dapt != 0)
3314
+                            {
3315
+                                if (dapt == 11)
3316
+                                {
3317
+                                    nextda = 37;
3318
+                                    opt = "流转市场管理科";
3319
+                                }
3320
+                                else if (dapt == 14)
3321
+                                {
3322
+                                    nextda = 57;
3323
+                                    opt = "流转营销管理处";
3324
+                                }
3325
+                                else if (dapt == 15)
3326
+                                {
3327
+                                    nextda = 74;
3328
+                                    opt = "流转策划推广";
3329
+                                }
3330
+                                else if (dapt == 16)
3331
+                                {
3332
+                                    nextda = 88;
3333
+                                    opt = "流转销售部";
3334
+                                }
3335
+                            }
3336
+                            if (nextda != 0)
3337
+                            {
3338
+                                var res = AssignWO(ua, modlelist, input, opt, "", nextda, 0, 0, 0);
3272 3339
                                 if (res)
3273 3340
                                     return Success("添加成功");
3274 3341
                                 else
3275
-                                    return Error("市场管理科接收失败!");
3342
+                                    return Error("流转失败!");
3343
+                            }
3344
+                            else
3345
+                            {
3346
+                                return Error("流转失败!");
3347
+                            }
3276 3348
                             }
3277 3349
                         }
3278 3350
                         else
@@ -3438,13 +3510,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
3438 3510
                 #region 添加验证判断
3439 3511
                 if (input.F_ID <= 0)
3440 3512
                     return Error("参数错误!");
3441
-                if (!(input.F_Type> 0 && input.F_Type < 5))
3513
+                if (!(input.F_Type > 0 && input.F_Type < 5))
3442 3514
                     return Error("工单类型错误!");
3443 3515
                 if (string.IsNullOrEmpty(input.F_CusName))
3444 3516
                     return Error("请输入客户姓名!");
3445 3517
                 if (string.IsNullOrEmpty(input.F_CusPhone))
3446 3518
                     return Error("请输入客户电话!");
3447
-                if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim ()))
3519
+                if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim()))
3448 3520
                 {
3449 3521
                     return Error("请输入正确的生产批次号!");
3450 3522
                 }
@@ -3471,37 +3543,32 @@ namespace CallCenterApi.Interface.Controllers.workorder
3471 3543
                 }
3472 3544
                 if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
3473 3545
                     return Error("客户编号为10为纯数字!");
3474
-                if (!string.IsNullOrEmpty (input.F_MaterialID)  && !valcode(input.F_MaterialID, 11))
3546
+                if (!string.IsNullOrEmpty(input.F_MaterialID) && !valcode(input.F_MaterialID, 11))
3475 3547
                     return Error("物料编码为11为纯数字!");
3476 3548
                 #endregion
3477 3549
                 var model = workOrder.GetModel(input.F_ID);
3478 3550
                 if (model == null)
3479 3551
                     return Error("查询不到此工单!");
3480
-                if(ro !=null )
3552
+                if (ro != null)
3481 3553
                 {
3482
-                    if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
3554
+                    if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
3483 3555
                     {
3484
-                        if (model .F_CreateBy !=ua.F_UserCode )
3556
+                        if (model.F_CreateBy != ua.F_UserCode)
3485 3557
                         {
3486 3558
                             return Error("非创建人不能修改工单!");
3487 3559
                         }
3488
-                           
3560
+
3489 3561
                     }
3490 3562
                 }
3491
-                if (model.F_State != 3 && model.F_State != 12)
3563
+                if (model.F_State == 2)
3492 3564
                 {
3493
-                    var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3494
-                    if (itemlast.Count > 0)
3495
-                    {
3496
-                        foreach (var it in itemlast)
3497
-                        {
3498
-                            if (it.F_WoState == 2)
3499
-                            {
3500
-                                return Error("此工单已进入处理流程不能修改!");
3501
-                            }
3502
-                        }
3503
-                    }
3565
+                    return Error("此工单已接单不能修改!");
3504 3566
                 }
3567
+                else if (model.F_State == 11|| model.F_State == 10)
3568
+                {
3569
+                    return Error("此工单已处理不能修改!");
3570
+                }
3571
+
3505 3572
                 #region 保存客户基本信息
3506 3573
                 model = inputtoobj(model, input,1);
3507 3574
                 #endregion
@@ -3538,16 +3605,48 @@ namespace CallCenterApi.Interface.Controllers.workorder
3538 3605
                             else
3539 3606
                             {
3540 3607
                                 string deptname1 = "";
3608
+                                int dapt = 0, nextda = 0; string opt = "";
3541 3609
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3542 3610
                                 if (deptmodel1 != null)
3543 3611
                                 {
3544 3612
                                     deptname1 = deptmodel1.F_DeptName + "-";
3613
+                                    dapt = deptmodel1.F_ParentId;
3614
+                                }
3615
+                                if (dapt != 0)
3616
+                                {
3617
+                                    if (dapt == 11)
3618
+                                    {
3619
+                                        nextda = 37;
3620
+                                        opt = "流转市场管理科";
3621
+                                    }
3622
+                                    else if (dapt == 14)
3623
+                                    {
3624
+                                        nextda = 57;
3625
+                                        opt = "流转营销管理处";
3626
+                                    }
3627
+                                    else if (dapt == 15)
3628
+                                    {
3629
+                                        nextda = 74;
3630
+                                        opt = "流转策划推广";
3631
+                                    }
3632
+                                    else if (dapt == 16)
3633
+                                    {
3634
+                                        nextda = 88;
3635
+                                        opt = "流转销售部";
3636
+                                    }
3637
+                                }
3638
+                                if (nextda != 0)
3639
+                                {
3640
+                                    var res = AssignWO(ua, model, input, opt, "", nextda, 0, model.F_limit, 0);
3641
+                                    if (res)
3642
+                                        return Success("保存成功");
3643
+                                    else
3644
+                                        return Error("流转失败!");
3545 3645
                                 }
3546
-                                var res = AssignWO(ua, model, input, "流转市场管理科","", 37, 0, model.F_limit, 0);
3547
-                                if (res)
3548
-                                    return Success("保存成功");
3549 3646
                                 else
3550
-                                    return Error("市场管理科接收失败!");
3647
+                                {
3648
+                                    return Error("流转失败!");
3649
+                                }
3551 3650
                             }
3552 3651
                         }
3553 3652
                     }
@@ -3904,15 +4003,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
3904 4003
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
3905 4004
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
3906 4005
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
3907
-                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
4006
+                 
3908 4007
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
3909 4008
                     {
3910 4009
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
3911 4010
                         if (creatname!=null )
3912 4011
                         {
4012
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
3913 4013
                             model.F_CreateName = creatname.F_UserName ; ;//添加人
3914 4014
                         }
3915
-                     
3916 4015
                     }
3917 4016
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
3918 4017
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
@@ -5096,7 +5195,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5096 5195
                 if (ua != null)
5097 5196
                 {
5098 5197
                     Model.T_Wo_WorkOrder model = workOrder .GetModel(orderid);
5099
-                    //验证信息
5198
+                    //验证信息 
5100 5199
                     if (model != null)
5101 5200
                     {
5102 5201
                         var res = BackWO(ua, model, cont, type);
@@ -5975,7 +6074,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5975 6074
             string strmsg = string.Empty;
5976 6075
             strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
5977 6076
             Model.T_Msg_List msg = new Model.T_Msg_List();
5978
-            msg.Type = (int)Model.MSGType.workorder;//处理
6077
+            msg.Type = (int)Model.MSGType.Handle;//处理
5979 6078
             msg.ToUser = touser;
5980 6079
             msg.ToID = toid;
5981 6080
             msg.Detail = strmsg;

+ 3 - 1
codegit/CallCenterApi/CallCenterApi.Model/T_Msg_List.cs

@@ -149,7 +149,9 @@ namespace CallCenterApi.Model
149 149
         [Description("公告通知")]
150 150
         notice = 5,
151 151
         [Description("客户公告通知")]
152
-        cusnotice = 6
152
+        cusnotice = 6,
153
+        [Description("工单处理")]
154
+        Handle = 7,
153 155
     }
154 156
 }
155 157