ソースを参照

Merge branch 'master' of http://192.168.1.222:3000/zhengbingbing/XinXiangXLX_API

lihai 6 年 前
コミット
b3badc95e3

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs

@@ -22,7 +22,7 @@ namespace CallCenterApi.Interface.Controllers
22 22
                 string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
23 23
                 if (userseatgroupid != "" && userseatgroupid != "0")
24 24
                 {
25
-                    Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(userseatgroupid));
25
+                    Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(12);
26 26
                     if (smodel != null)
27 27
                     {
28 28
                         zipcode = smodel.F_ZXAtt.Trim();

+ 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
 

+ 26 - 2
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)
@@ -37,7 +42,26 @@ namespace CallCenterApi.Interface.Controllers
37 42
                 return Error ("发送失败,请检查客户电话");
38 43
             }
39 44
         }
40
-      
45
+        public ActionResult SMSSendSalesman(string name, string phone, string cusphone)
46
+        {
47
+            if (string.IsNullOrEmpty(name))
48
+                return Error("请输入联系人姓名");
49
+            if (string.IsNullOrEmpty(phone))
50
+                return Error("请输入联系人电话");
51
+            if (string.IsNullOrEmpty(cusphone))
52
+                return Error("请输入发送号码");
53
+            SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,刚有客户反馈有关市场业务/产品/农化问题,请你及时联系提供服务。姓名:"+ name + ",电话:"+ phone + "。");
54
+
55
+            if (result != null)
56
+            {
57
+                return Success("发送短信", result);
58
+            }
59
+            else
60
+            {
61
+                return Error("发送失败,请检查电话");
62
+            }
63
+        }
64
+
41 65
         /// <summary>
42 66
         /// 单发短信
43 67
         /// </summary>

+ 103 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -188,7 +188,109 @@ namespace CallCenterApi.Interface.Controllers.customer
188 188
                 return Error("参数传输失败");
189 189
             }
190 190
         }
191
+        public class Sales
192
+        {
193
+            public string name;
194
+        }
195
+        public class Salesman
196
+        {
197
+            public string name;
198
+            public string phone;
199
+            public int  areaid;
200
+            public string area;
201
+            public int branchid;
202
+            public string branch;
203
+            public List<Salesmanproduct> product;
204
+        }
205
+        public class Salesmanproduct
206
+        {
207
+            public string product;
208
+        }
209
+        public ActionResult GetSalesman(string Salesman)
210
+        {
211
+            string sql = " F_IsDelete = 0 ";
191 212
 
213
+            if (!string.IsNullOrEmpty(Salesman))
214
+            {
215
+                sql += $" and  F_Salesman  = '" + Salesman.Trim() + "'";
216
+            }
217
+            var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(sql);
218
+            
219
+            Salesman salesmen = new Salesman();
220
+            salesmen.product  = new List<Salesmanproduct>();
221
+            foreach (var it in userModel)
222
+            {
223
+                 salesmen.name = it.F_Salesman;
224
+                if (string.IsNullOrEmpty (salesmen.phone))
225
+                {
226
+                    if (!string.IsNullOrEmpty(it.F_SalesPhone))
227
+                    {
228
+                        salesmen.phone = it.F_SalesPhone;
229
+                    }
230
+                }
231
+                if (string.IsNullOrEmpty(salesmen.area))
232
+                {
233
+                    if (!string.IsNullOrEmpty(it.F_AreaID))
234
+                    {
235
+                        var area = deptbll.GetModel(it.F_AreaID);
236
+                        if (area !=null )
237
+                        {
238
+                            salesmen.areaid = area.F_DeptId ;
239
+                            salesmen.area = area.F_DeptName;
240
+                        }
241
+                       
242
+                    }
243
+                }
244
+                if (string.IsNullOrEmpty(salesmen.branch))
245
+                {
246
+                    if (!string.IsNullOrEmpty(it.F_BranchID))
247
+                    {
248
+                        var branch = deptbll.GetModel(it.F_BranchID);
249
+                        if (branch != null)
250
+                        {
251
+                            salesmen.branchid = branch.F_DeptId;
252
+                            salesmen.branch = branch.F_DeptName;
253
+                        }
254
+                    }
255
+                }
256
+                if (salesmen.product.Exists(x => x.product == it.F_Product) == false && !string.IsNullOrEmpty(it.F_Product))
257
+                {
258
+                    Salesmanproduct model = new Salesmanproduct();
259
+                    model.product = it.F_Product;
260
+                    salesmen.product.Add(model);
261
+                }
262
+            }
263
+            return Success("获取成功", salesmen);
264
+        }
265
+        public ActionResult GetSales(string Province, string City, string Country)
266
+        {
267
+            string sql = " F_IsDelete = 0 ";
268
+
269
+            if (!string .IsNullOrEmpty (Province))
270
+            {
271
+                sql += $" and  F_AddressProvince  = '" + Province.Trim() + "'";
272
+            }
273
+            if (!string.IsNullOrEmpty(City))
274
+            {
275
+                sql += $" and  F_AddressCity  = '" + City.Trim() + "'";
276
+            }
277
+            if (!string.IsNullOrEmpty(Country))
278
+            {
279
+                sql += $" and  F_AddressCountry  = '" + Country.Trim() + "'"; ;
280
+            }
281
+                var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList( sql);
282
+                List<Sales> salesmen = new List<Sales>();
283
+                foreach (var  it  in userModel)
284
+                {
285
+                    if (salesmen.Exists(x => x.name == it.F_Salesman) == false&&!string .IsNullOrEmpty (it.F_Salesman))
286
+                    {
287
+                      Sales model = new Sales();
288
+                        model.name = it.F_Salesman;
289
+                        salesmen.Add(model);
290
+                    }
291
+                }
292
+                return Success("获取成功", salesmen);
293
+        }
192 294
         /// <summary>
193 295
         /// 通过来电号码获取来电弹屏左侧客户信息
194 296
         /// </summary>
@@ -197,7 +299,7 @@ namespace CallCenterApi.Interface.Controllers.customer
197 299
         {
198 300
             if (!string.IsNullOrWhiteSpace(tel))
199 301
             {
200
-                var sql = $" and (F_SalesPhone like '%" + tel.Trim() + "%' or F_LegalPhone like '%" + tel.Trim() + "%')";
302
+                var sql = $" and  F_LegalPhone  = '" + tel.Trim() + "'";
201 303
                 var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
202 304
                 if (userModel.Count() > 0)
203 305
                 {

+ 17 - 14
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController.cs

@@ -56,7 +56,7 @@ namespace CallCenterApi.Interface.Controllers.customer
56 56
             }
57 57
             if (!string.IsNullOrEmpty(keywords.Trim()))
58 58
             {
59
-                List<Model.T_RegionCategory> userModel = regionBLL.GetModelList(" F_RegionName like '%" + keywords.Trim() + "%'");
59
+                List<Model.T_RegionCategory> userModel = regionBLL.GetModelList(" F_RegionName like '%" + keywords.Trim() + "%'"+ "and F_Layer = " + F_Layer);
60 60
                 if (userModel != null)
61 61
                 {
62 62
                     return Success("加载成功", userModel);
@@ -70,20 +70,23 @@ namespace CallCenterApi.Interface.Controllers.customer
70 70
             F_Layer = F_Layer - 1;
71 71
             if (!string.IsNullOrEmpty(F_RegionName.Trim()))
72 72
             {
73
-                if (F_Layer == 2)
73
+                if (F_ParentId>0)
74 74
                 {
75
-                    entityJson1 = regionBLL.GetModel(F_ParentId);
76
-                }
77
-                else if (F_Layer == 3)
78
-                {
79
-                    entityJson2 = regionBLL.GetModel(F_ParentId);
80
-                    entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
81
-                }
82
-                else if (F_Layer == 4)
83
-                {
84
-                    entityJson3 = regionBLL.GetModel(F_ParentId);
85
-                    entityJson2 = regionBLL.GetModel(int.Parse(entityJson3.F_ParentId.ToString()));
86
-                    entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
75
+                    if (F_Layer == 2)
76
+                    {
77
+                        entityJson1 = regionBLL.GetModel(F_ParentId);
78
+                    }
79
+                    else if (F_Layer == 3)
80
+                    {
81
+                        entityJson2 = regionBLL.GetModel(F_ParentId);
82
+                        entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
83
+                    }
84
+                    else if (F_Layer == 4)
85
+                    {
86
+                        entityJson3 = regionBLL.GetModel(F_ParentId);
87
+                        entityJson2 = regionBLL.GetModel(int.Parse(entityJson3.F_ParentId.ToString()));
88
+                        entityJson1 = regionBLL.GetModel(int.Parse(entityJson2.F_ParentId.ToString()));
89
+                    }
87 90
                 }
88 91
             }
89 92
             var obj = new

File diff suppressed because it is too large
+ 1220 - 94
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs


+ 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
             }

+ 197 - 73
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))
@@ -537,9 +549,12 @@ namespace CallCenterApi.Interface.Controllers.weixin
537 549
             {
538 550
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
539 551
                 var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
540
-                if (ua == null)
552
+                if (source !=3)
541 553
                 {
542
-                    return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
554
+                    if (ua == null)
555
+                    {
556
+                        return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
557
+                    }
543 558
                 }
544 559
                 //  Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
545 560
                 string sql = $" and F_IsDelete=0";
@@ -838,9 +853,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
838 853
         /// <summary>
839 854
         ///综合查询列表
840 855
         /// </summary>
841
-        public ActionResult GetComprehensive(string OpenId,string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
856
+        public ActionResult GetComprehensive(string OpenId,string code, string createby,string cusname, string keywords, string cusphone, string companyname, string province, string city,
842 857
             string country, string township, string category, string salebase, string touser, int source = 0, int state = -1, int type = 0, int pageindex = 1, int pagesize = 10)
843 858
         {
859
+            
844 860
             if (!string.IsNullOrEmpty(OpenId))
845 861
             {
846 862
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
@@ -858,6 +874,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
858 874
                     sql += $" and F_State=" + state;
859 875
                 if (source > 0)//工单来源
860 876
                     sql += $" and F_Source=" + source;
877
+                if (!string.IsNullOrWhiteSpace(createby))//创建人
878
+                    sql += $" and F_CreateBy like '%" + createby.Trim() + "%'";
861 879
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
862 880
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
863 881
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
@@ -1235,7 +1253,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1235 1253
                         {
1236 1254
                             opt = "同意上报";
1237 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);
1238
-                            res = GetDaQucirCulation(nowUser, DateTime.Now.ToString(), model.F_ID,true );
1256
+                            res = GetDaQucirCulation(AuditCont,nowUser, DateTime.Now.ToString(), model.F_ID,true );
1239 1257
                             if (userid <= 0 || !res)
1240 1258
                                 res = false;
1241 1259
                             wostate = 1;
@@ -1316,7 +1334,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1316 1334
         /// <param name="ua"></param>
1317 1335
         /// <param name="time"></param>
1318 1336
         /// <param name="id"></param>
1319
-        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)
1320 1338
         {
1321 1339
             DateTime times = DateTime.Parse(time).AddHours(24);
1322 1340
             Model.T_Wo_WorkOrder model = woBLL.GetModel(id);
@@ -1324,18 +1342,52 @@ namespace CallCenterApi.Interface.Controllers.weixin
1324 1342
             modeLlist.Add(model);
1325 1343
             List<WorkOrderNewInput> Input = modeltooip(modeLlist,ua );
1326 1344
             string cont = "";
1327
-           if (istrue)
1345
+            int dapt = 0, nextda = 0; string opt = "";
1346
+            var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
1347
+            if (deptmodel1 != null)
1328 1348
             {
1329
-                cont = "大区经理已审批流转市场管理科";
1349
+                dapt = deptmodel1.F_ParentId;
1330 1350
             }
1331
-           else
1351
+            if (dapt != 0)
1332 1352
             {
1333
-                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 ;
1334 1390
             }
1335
-             var res = AssignWO(ua, model, Input[0], cont, 37, 0, 0, 0, 0, 0, 0, time.ToString());
1336
-            
1337
-          
1338
-            return res;
1339 1391
         }
1340 1392
         /// <summary>
1341 1393
         /// 查询工单详情
@@ -1345,26 +1397,29 @@ namespace CallCenterApi.Interface.Controllers.weixin
1345 1397
         {
1346 1398
             if (!string.IsNullOrEmpty(OpenId))
1347 1399
             {
1348
-                var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
1349
-                if (ua == null)
1400
+                if (id <= 0)
1350 1401
                 {
1351
-                    return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
1402
+                    return Error("请输入正确的id");
1352 1403
                 }
1353
-                string sql = "";
1354
-                if (id > 0)
1404
+                DataTable FileUrl = new DataTable();
1405
+                var list = new List<Model.T_Wo_WorkOrder>();
1406
+                var model = woBLL .GetModel(id);
1407
+                if (model != null)
1408
+                    list.Add(model);
1409
+                var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
1410
+                ; var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
1411
+                if (!string .IsNullOrEmpty (model.F_Files))
1355 1412
                 {
1356
-                    sql += $" ( F_ID like '%" + id + "%' ) ";
1413
+                    FileUrl = GetFileData(model.F_Files, configfj.F_ParamValue);
1357 1414
                 }
1358
-                else
1359
-                    return Error("请输入正确的id");
1360
-                var list = new List<Model.T_Wo_WorkOrder>();
1361
-                if (!string.IsNullOrWhiteSpace(sql))
1415
+                var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
1416
+                if (model .F_Source !="3")
1362 1417
                 {
1363
-                    sql += " and F_IsDelete=0";
1364
-                    list = woBLL .GetModelList(sql);
1418
+                    if (ua == null)
1419
+                    {
1420
+                        return Error("该账号已在别的设备登录,请及时修改密码重新登录。");
1421
+                    }
1365 1422
                 }
1366
-                var itemlasts = itembll.GetModelList("  F_WoID="  +id + " ");
1367
-
1368 1423
                 if (list.Count > 0)
1369 1424
                 {
1370 1425
                     List<WorkOrderNewInput> Input = modeltooip(list,ua );
@@ -1375,6 +1430,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1375 1430
                             state = "success",
1376 1431
                             message = "成功",
1377 1432
                             rows = Input,
1433
+                            FileUrl,
1378 1434
                             total = itemlasts,
1379 1435
                         };
1380 1436
 
@@ -1460,7 +1516,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1460 1516
                     {
1461 1517
                     if (hours>=24)
1462 1518
                     {
1463
-                        GetDaQucirCulation(ua, it.F_CreateTime.ToString (), it.F_WoID,false );
1519
+                        GetDaQucirCulation("",ua, it.F_CreateTime.ToString (), it.F_WoID,false );
1464 1520
                     }
1465 1521
                     else
1466 1522
                     {
@@ -1492,7 +1548,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1492 1548
                     }
1493 1549
                     else if (hours >= 48)
1494 1550
                     {
1495
-                        GetDaQucirCulation(user, it.F_CreateTime.ToString(), it.F_WoID,false );
1551
+                        GetDaQucirCulation("",user, it.F_CreateTime.ToString(), it.F_WoID,false );
1496 1552
                     }
1497 1553
                     else
1498 1554
                     {
@@ -1538,7 +1594,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1538 1594
                                 }
1539 1595
                                 else
1540 1596
                                 {
1541
-                                    GetDaQucirCulation(ua, time.ToString(), it.F_WoID,false );
1597
+                                    GetDaQucirCulation("",ua, time.ToString(), it.F_WoID,false );
1542 1598
                                 }
1543 1599
                             }
1544 1600
                         }
@@ -1804,7 +1860,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1804 1860
                     model.F_CJ_Tonnage = model1[i].F_CJ_Tonnage;//抽检-抽检吨数
1805 1861
                     model.F_CJ_BagNo = model1[i].F_CJ_BagNo;//抽检-抽检袋数
1806 1862
                     model.F_CJ_Outlay = model1[i].F_CJ_Outlay;//抽检-公关费用金额:单位元
1807
-
1863
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
1808 1864
                     model.F_DealBy = model1[i].F_DealBy;//处理人
1809 1865
                     model.F_DealTime = model1[i].F_DealTime;//处理时间
1810 1866
                     model.F_DealContent = model1[i].F_DealContent;//处理内容
@@ -1859,13 +1915,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
1859 1915
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1860 1916
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1861 1917
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
1862
-                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1918
+                  //  model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1863 1919
                     if (!string.IsNullOrEmpty(model1[i].F_CreateBy))
1864 1920
 
1865 1921
                     {
1866 1922
                         Model.T_Sys_UserAccount creatname = userAccountBLL .GetModel(model1[i].F_CreateBy);
1867 1923
                         if (creatname != null)
1868 1924
                         {
1925
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
1869 1926
                             model.F_CreateName = creatname.F_UserName; ;//添加人
1870 1927
                         }
1871 1928
 
@@ -2442,13 +2499,15 @@ namespace CallCenterApi.Interface.Controllers.weixin
2442 2499
             model.F_Description = input.F_Description;//问题描述
2443 2500
             model.F_ZX_Area = input.F_ZX_Area;// 大区
2444 2501
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
2445
-            model.F_Files = "0";//附件上传ids
2446
-            model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2502
+            model.F_Files =model .F_Files;//附件上传ids
2503
+            model.F_Brand = input.F_WorkerBrand;//分公司
2504
+            model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2447 2505
             model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
2448 2506
             #endregion
2449 2507
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2450 2508
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2451 2509
                 model.F_MaterialID = input.F_MaterialID;//物料编码为11为纯数字
2510
+
2452 2511
             #region 投诉类
2453 2512
             model.F_BatchNumber = input.F_BatchNumber;//生产批次号
2454 2513
             model.F_TS_Formula = input.F_TS_Formula;// 投诉-配方
@@ -2469,7 +2528,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2469 2528
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
2470 2529
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
2471 2530
             model.F_CJ_Outlay = input.F_CJ_Outlay;//抽检-公关费用金额:单位元】
2472
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2531
+     //     model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2473 2532
             if (!string.IsNullOrEmpty(input.F_BatchNumber))
2474 2533
             {
2475 2534
                 if (type == 1)
@@ -2656,17 +2715,52 @@ namespace CallCenterApi.Interface.Controllers.weixin
2656 2715
                             else
2657 2716
                             {
2658 2717
                                 string deptname1 = "";
2718
+                               int  dapt = 0,nextda=0;
2719
+                               
2659 2720
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
2660 2721
                                 if (deptmodel1 != null)
2661 2722
                                 {
2662 2723
                                     deptname1 = deptmodel1.F_DeptName + "-";
2724
+                                    dapt =deptmodel1.F_ParentId ;
2663 2725
                                 }
2664 2726
                                 AddLog(modlelist.F_ID, 0, deptname1 + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create,"",0, ua, 0, 0);
2665
-                                var res = AssignWO(ua, modlelist, input, "流转市场管理科", 37, 0, overtime, sms);
2666
-                                if (res)
2667
-                                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
+                                }
2668 2759
                                 else
2669
-                                    return Error("市场管理科接收失败!");
2760
+                                {
2761
+                                    return Error("流转失败!");
2762
+                                }
2763
+                               
2670 2764
                             }
2671 2765
                         }
2672 2766
                         else
@@ -2759,7 +2853,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2759 2853
         /// </summary>
2760 2854
         /// <returns></returns>
2761 2855
         [WechatActionFilter]
2762
-        public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
2856
+        public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, string F_Files, int isvisit = 1,
2763 2857
             int  overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
2764 2858
         {
2765 2859
 
@@ -2849,7 +2943,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2849 2943
 
2850 2944
                     if (model != null)
2851 2945
                     {
2852
-                        var res = AssignWO(ua, model, input, cont, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
2946
+                        var res = AssignWO(ua, model, input, cont, F_Files, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
2853 2947
                         if (res)
2854 2948
                             return Success("转派成功");
2855 2949
                         else
@@ -2865,7 +2959,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2865 2959
         /// <summary>
2866 2960
         /// 转派工单
2867 2961
         /// </summary>
2868
-        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, int  overtime = 0, int sms = 0, int isApprovalp = 0,int hclbm = 0, int hclid = 0, string creat = "")
2962
+        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, string F_Files, int clbm = 0, int clid = 0, int  overtime = 0, int sms = 0, int isApprovalp = 0,int hclbm = 0, int hclid = 0, string creat = "")
2869 2963
         {
2870 2964
            
2871 2965
             string smscont = "";
@@ -2996,6 +3090,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
2996 3090
                 //   model.F_DealBy = touser;
2997 3091
                 model.F_State = wostate;
2998 3092
                 model.F_limit = overtime;
3093
+                if (!string.IsNullOrEmpty(F_Files))
3094
+                    model.F_Files = F_Files;
2999 3095
                 //处理内容
3000 3096
                 if (!string.IsNullOrEmpty(cont))
3001 3097
                     model.F_DealContent += cont + ";";
@@ -3412,7 +3508,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3412 3508
         /// <returns></returns>
3413 3509
        
3414 3510
         [WechatActionFilter]
3415
-        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment, string dealType,
3511
+        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment,
3416 3512
          string uncont = "",
3417 3513
         int isvisit = 1, int isover = 0)
3418 3514
         {
@@ -3485,7 +3581,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3485 3581
                     }
3486 3582
                     if (model != null)
3487 3583
                     {
3488
-                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
3584
+                        var res = DealWO(ua, model, input, cont, isover, uncont);
3489 3585
                         if (res)
3490 3586
                             return Success("处理成功");
3491 3587
                         else
@@ -3723,7 +3819,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3723 3819
         /// <summary>
3724 3820
         /// 处理工单
3725 3821
         /// </summary>
3726
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string dealType = "", string uncont = "")
3822
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0,  string uncont = "")
3727 3823
         {
3728 3824
             #region 工单处理
3729 3825
             int sms = 0;
@@ -3773,7 +3869,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
3773 3869
             {
3774 3870
                 #region 处理工单
3775 3871
                 model.F_State = wostate;
3776
-                model.F_DealType = dealType;
3777 3872
                 //处理内容
3778 3873
                 if (!string.IsNullOrEmpty(cont))
3779 3874
                     model.F_DealContent += cont + ";";
@@ -3924,19 +4019,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
3924 4019
                 var model = woBLL.GetModel(input.F_ID);
3925 4020
                 if (model ==null )
3926 4021
                     return Error("查询不到此工单!");
3927
-                if(model .F_State !=3&& model.F_State != 12)
4022
+
4023
+                if (model.F_State == 2)
3928 4024
                 {
3929
-                    var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3930
-                    if (itemlast .Count >0)
3931
-                    {
3932
-                        foreach (var it in itemlast)
3933
-                        {
3934
-                            if (it .F_WoState ==2)
3935
-                            {
3936
-                                return Error("此工单已进入处理流程不能修改!");
3937
-                            }
3938
-                        }
3939
-                    }
4025
+                    return Error("此工单已接单不能修改!");
4026
+                }
4027
+                else if (model.F_State == 11 || model.F_State == 10)
4028
+                {
4029
+                    return Error("此工单已处理不能修改!");
3940 4030
                 }
3941 4031
                 #region 保存客户基本信息
3942 4032
                 model = inputtoobj(ua,model, input, 1);
@@ -3970,19 +4060,53 @@ namespace CallCenterApi.Interface.Controllers.weixin
3970 4060
                     }
3971 4061
                     else
3972 4062
                     {
4063
+
3973 4064
                         string deptname1 = "";
4065
+                        int dapt = 0, nextda = 0; string opt = "";
3974 4066
                         var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3975 4067
                         if (deptmodel1 != null)
3976 4068
                         {
3977 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("流转失败!");
3978 4102
                         }
3979
-                        var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, model.F_limit, 0);
3980
-                        if (res)
3981
-                            return Success("保存成功");
3982 4103
                         else
3983
-                            return Error("市场管理科接收失败!");
4104
+                        {
4105
+                            return Error("流转失败!");
4106
+                        }
4107
+
3984 4108
                     }
3985
-                return Success("保存成功!");
4109
+                    return Success("保存成功!");
3986 4110
                 }
3987 4111
                 else
3988 4112
                     return Error("保存失败!");

+ 306 - 77
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -173,15 +173,24 @@ namespace CallCenterApi.Interface.Controllers.workorder
173 173
                         sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
174 174
                         break;
175 175
                     case 3://我参与的
176
-                        if (GetParticipateID(ua.F_UserCode) != "")
176
+                        if (ro.F_RoleCode == "XTGLY")
177 177
                         {
178
-                            sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
178
+                            if (GetParticipateID() != "")
179
+                            {
180
+                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID() + ") ";
181
+                            }
179 182
                         }
180 183
                         else
181 184
                         {
182
-                            return Error("暂无工单");
185
+                            if (GetParticipateID(ua.F_UserCode) != "")
186
+                            {
187
+                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
188
+                            }
189
+                            else
190
+                            {
191
+                                return Error("暂无工单");
192
+                            }
183 193
                         }
184
-
185 194
                         break;
186 195
                     case 4://待回访
187 196
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
@@ -195,11 +204,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
195 204
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
196 205
                         break;
197 206
                     case 6://已回访
198
-                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
207
+                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
199 208
                         {
200 209
                             sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
201 210
                             sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
202 211
                         }
212
+                        else if (ro.F_RoleCode == "XTGLY")
213
+                        {
214
+                            uwhere = ""; ;
215
+                        }
203 216
                         else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
204 217
                         {
205 218
                             string detpid = "";
@@ -561,15 +574,31 @@ namespace CallCenterApi.Interface.Controllers.workorder
561 574
                         case 3://客服已分配
562 575
                             sql = "";
563 576
                             sql += $"  F_IsDelete=0";
564
-                            if (GetParticipateID(ua.F_UserCode) != "")
577
+                            if (ro.F_RoleCode == "XTGLY")
565 578
                             {
566
-                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
579
+                                if (GetParticipateID() != "")
580
+                                {
581
+                                    sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID() + ") ";
582
+                                }
583
+                                else
584
+                                {
585
+                                    Allocated = 0;
586
+                                    break;
587
+                                }
567 588
                             }
568 589
                             else
569 590
                             {
570
-                                Allocated = 0;
571
-                                break;
591
+                                if (GetParticipateID(ua.F_UserCode) != "")
592
+                                {
593
+                                    sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
594
+                                }
595
+                                else
596
+                                {
597
+                                    Allocated = 0;
598
+                                    break;
599
+                                }
572 600
                             }
601
+                            
573 602
                              Allocated = new BLL.T_Wo_WorkOrder().GetModelList(sql).Count;//客服已分配
574 603
                        
575 604
                             break;
@@ -592,11 +621,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
592 621
                         case 6://已回访
593 622
                             sql = "";
594 623
                             sql += $"  F_IsDelete=0";
595
-                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
624
+                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
596 625
                             {
597 626
                                 sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
598 627
                                 sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
599 628
                             }
629
+                            else if (ro.F_RoleCode == "XTGLY")
630
+                            {
631
+                                uwhere = ""; ;
632
+                            }
600 633
                             else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
601 634
                             {
602 635
                                 string detpid = "";
@@ -979,7 +1012,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
979 1012
                         {
980 1013
                             opt = "同意上报";
981 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);
982
-                            res = GetDaQucirCulation(nowUser, DateTime.Now.ToString(), model.F_ID, true);
1015
+                            res = GetDaQucirCulation(AuditCont,nowUser, DateTime.Now.ToString(), model.F_ID, true);
983 1016
                             if (userid <= 0 || !res)
984 1017
                                 res = false;
985 1018
                             wostate = 1;
@@ -1092,7 +1125,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1092 1125
         /// <param name="ua"></param>
1093 1126
         /// <param name="time"></param>
1094 1127
         /// <param name="id"></param>
1095
-        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)
1096 1129
         {
1097 1130
             DateTime times = DateTime.Parse(time).AddHours(24);
1098 1131
             Model.T_Wo_WorkOrder model = workOrder .GetModel(id);
@@ -1100,18 +1133,52 @@ namespace CallCenterApi.Interface.Controllers.workorder
1100 1133
             modeLlist.Add(model);
1101 1134
             List<WorkOrderNewInput> Input = modeltooip(modeLlist);
1102 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
+            }
1103 1165
             if (istrue)
1104 1166
             {
1105
-                cont = "大区经理已审批流转市场管理科";
1167
+                cont = "大区经理已审批:"+ AuditCont+"," + opt;
1106 1168
             }
1107 1169
             else
1108 1170
             {
1109
-                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;
1110 1181
             }
1111
-            var res = AssignWO(ua, model, Input[0], cont, 37, 0, 0, 0, 0, 0, 0, time.ToString());
1112
-
1113
-
1114
-            return res;
1115 1182
         }
1116 1183
         /// <summary>
1117 1184
         /// 获取待审批的工单
@@ -1134,7 +1201,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1134 1201
                 {
1135 1202
                     if (hours >= 24)
1136 1203
                     {
1137
-                        GetDaQucirCulation(ua, it.F_CreateTime.ToString(), it.F_WoID, false);
1204
+                        GetDaQucirCulation("",ua, it.F_CreateTime.ToString(), it.F_WoID, false);
1138 1205
                     }
1139 1206
                     else
1140 1207
                     {
@@ -1166,7 +1233,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1166 1233
                     }
1167 1234
                     else if (hours >= 48)
1168 1235
                     {
1169
-                        GetDaQucirCulation(user, it.F_CreateTime.ToString(), it.F_WoID, false);
1236
+                        GetDaQucirCulation("",user, it.F_CreateTime.ToString(), it.F_WoID, false);
1170 1237
                     }
1171 1238
                     else
1172 1239
                     {
@@ -1212,7 +1279,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1212 1279
                                 }
1213 1280
                                 else
1214 1281
                                 {
1215
-                                    GetDaQucirCulation(ua, time.ToString(), it.F_WoID, false);
1282
+                                    GetDaQucirCulation("",ua, time.ToString(), it.F_WoID, false);
1216 1283
                                 }
1217 1284
                             }
1218 1285
                         }
@@ -1816,6 +1883,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
1816 1883
              ;
1817 1884
             return str;
1818 1885
         }
1886
+        public string GetParticipateID()
1887
+        {
1888
+            string str = string.Empty;
1889
+            str = "select F_WoID from T_Wo_WorkOrderItem_New where  F_OptType in( 1,7)";
1890
+
1891
+            ;
1892
+            return str;
1893
+        }
1819 1894
         /// <summary>
1820 1895
         /// 获取我参与的工单编号
1821 1896
         /// </summary>
@@ -1963,6 +2038,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
1963 2038
             }
1964 2039
             return str;
1965 2040
         }
2041
+        public DataTable GetFileData(string ids, string prefix)
2042
+        {
2043
+            DataTable dt = new DataTable();
2044
+            if (!string.IsNullOrEmpty(ids))
2045
+            {
2046
+                dt = DbHelperSQL.Query("select * from T_Sys_Accessories where F_FileId in (" + ids + ")").Tables[0];
2047
+                foreach (DataRow dr in dt.Rows)
2048
+                {
2049
+                    dr["F_FileUrl"] = prefix + dr["F_FileUrl"].ToString();
2050
+                }
2051
+            }
2052
+            return dt;
2053
+        }
1966 2054
         /// <summary>
1967 2055
         /// 查询工单详情
1968 2056
         /// </summary>
@@ -1971,22 +2059,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
1971 2059
             int userId = CurrentUser.UserData.F_UserId;
1972 2060
             if (userId != 0)
1973 2061
             {
2062
+                DataTable FileUrl = new DataTable();
1974 2063
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
1975
-                string sql = "";
1976
-                if (id > 0)
2064
+             
2065
+                if (id <= 0)
1977 2066
                 {
1978
-                    sql += $" ( F_ID like '%" + id + "%' ) ";
1979
-                }
1980
-                else
1981 2067
                     return Error("请输入正确的id");
1982
-                var list = new List<Model.T_Wo_WorkOrder>();
1983
-                if (!string.IsNullOrWhiteSpace(sql))
1984
-                {
1985
-                    sql += " and F_IsDelete=0";
1986
-                    list = workOrder.GetModelList(sql);
1987 2068
                 }
2069
+                var list = new List<Model.T_Wo_WorkOrder>();
2070
+                 var   model = workOrder.GetModel(id);
2071
+                if (model != null)
2072
+                    list.Add(model);
1988 2073
                  var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
1989
-                 
2074
+;                var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
2075
+                FileUrl = GetFileData(model.F_Files , configfj.F_ParamValue);
1990 2076
                 if (list.Count > 0)
1991 2077
                 {
1992 2078
                     List<WorkOrderNewInput> Input = modeltooip(list);
@@ -1997,7 +2083,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
1997 2083
                             state = "success",
1998 2084
                             message = "成功",
1999 2085
                             rows = Input,
2000
-                            total= ItemList( itemlasts),
2086
+                            FileUrl,
2087
+                            total = ItemList( itemlasts),
2001 2088
                         };
2002 2089
 
2003 2090
                         return Content(obj.ToJson()); 
@@ -2110,7 +2197,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2110 2197
         /// <summary>
2111 2198
         ///综合查询列表
2112 2199
         /// </summary>
2113
-        public ActionResult GetComprehensive(string code, string cusname,string keywords, string cusphone, string companyname, string province, string city,
2200
+        public ActionResult GetComprehensive(string code, string cusname,string createby,string keywords, string cusphone, string companyname, string province, string city,
2114 2201
             string country, string township,string category,string salebase, string touser, int source = 0,int state=-1, int type = 0, int pageindex = 1, int pagesize = 10)
2115 2202
         {
2116 2203
             int userId = CurrentUser.UserData.F_UserId;
@@ -2125,6 +2212,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
2125 2212
                    sql += $" and F_State=" + state;
2126 2213
                 if (source > 0)//工单来源
2127 2214
                     sql += $" and F_Source=" + source;
2215
+                if (!string.IsNullOrWhiteSpace(createby))//创建人
2216
+                    sql += $" and F_CreateBy like '%" + createby.Trim() + "%'";
2128 2217
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
2129 2218
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
2130 2219
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
@@ -3212,12 +3301,50 @@ namespace CallCenterApi.Interface.Controllers.workorder
3212 3301
                             }
3213 3302
                             else
3214 3303
                             {
3215
-                                AddLog(modlelist.F_ID, 0, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
3216
-                                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);
3217 3339
                                 if (res)
3218 3340
                                     return Success("添加成功");
3219 3341
                                 else
3220
-                                    return Error("市场管理科接收失败!");
3342
+                                    return Error("流转失败!");
3343
+                            }
3344
+                            else
3345
+                            {
3346
+                                return Error("流转失败!");
3347
+                            }
3221 3348
                             }
3222 3349
                         }
3223 3350
                         else
@@ -3279,7 +3406,39 @@ namespace CallCenterApi.Interface.Controllers.workorder
3279 3406
             #endregion
3280 3407
             return model;
3281 3408
         }
3282
-   
3409
+      public ActionResult DeleteWorkOrder(int  id)
3410
+        {
3411
+            int userId = CurrentUser.UserData.F_UserId;
3412
+            if (userId != 0)
3413
+            {
3414
+                if (id <= 0)
3415
+                    return Error("参数错误!");
3416
+                var model = workOrder.GetModel(id);
3417
+                if (model == null)
3418
+                    return Error("查询不到此工单!");
3419
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3420
+                if (ua ==null )
3421
+                {
3422
+                    return Error("无操作权限!");
3423
+                }
3424
+                if (model.F_CreateBy != ua.F_UserCode)
3425
+                {
3426
+                    return Error("非创建人不能删除工单!");
3427
+                }
3428
+                if (workOrder.DeleteList(id.ToString ()))
3429
+                {
3430
+                    return Success("设置成功");
3431
+                }
3432
+                else
3433
+                {
3434
+                    return Error("设置失败");
3435
+                }
3436
+            }
3437
+            else
3438
+            {
3439
+                return Error("无操作权限!");
3440
+            }
3441
+        }
3283 3442
         /// <summary>
3284 3443
         /// 删除工单
3285 3444
         /// </summary>
@@ -3290,6 +3449,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3290 3449
             int userId = CurrentUser.UserData.F_UserId;
3291 3450
             if (userId != 0)
3292 3451
             {
3452
+               
3293 3453
                 if (ids != null && ids.Length > 0)
3294 3454
                 {
3295 3455
                       bool res = true;
@@ -3346,16 +3506,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
3346 3506
             {
3347 3507
                 string usercode = CurrentUser.UserData.F_UserCode;
3348 3508
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3509
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
3349 3510
                 #region 添加验证判断
3350 3511
                 if (input.F_ID <= 0)
3351 3512
                     return Error("参数错误!");
3352
-                if (!(input.F_Type> 0 && input.F_Type < 5))
3513
+                if (!(input.F_Type > 0 && input.F_Type < 5))
3353 3514
                     return Error("工单类型错误!");
3354 3515
                 if (string.IsNullOrEmpty(input.F_CusName))
3355 3516
                     return Error("请输入客户姓名!");
3356 3517
                 if (string.IsNullOrEmpty(input.F_CusPhone))
3357 3518
                     return Error("请输入客户电话!");
3358
-                if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim ()))
3519
+                if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber.Trim()))
3359 3520
                 {
3360 3521
                     return Error("请输入正确的生产批次号!");
3361 3522
                 }
@@ -3382,26 +3543,32 @@ namespace CallCenterApi.Interface.Controllers.workorder
3382 3543
                 }
3383 3544
                 if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
3384 3545
                     return Error("客户编号为10为纯数字!");
3385
-                if (!string.IsNullOrEmpty (input.F_MaterialID)  && !valcode(input.F_MaterialID, 11))
3546
+                if (!string.IsNullOrEmpty(input.F_MaterialID) && !valcode(input.F_MaterialID, 11))
3386 3547
                     return Error("物料编码为11为纯数字!");
3387 3548
                 #endregion
3388 3549
                 var model = workOrder.GetModel(input.F_ID);
3389 3550
                 if (model == null)
3390 3551
                     return Error("查询不到此工单!");
3391
-                if (model.F_State != 3 && model.F_State != 12)
3552
+                if (ro != null)
3392 3553
                 {
3393
-                    var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3394
-                    if (itemlast.Count > 0)
3554
+                    if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
3395 3555
                     {
3396
-                        foreach (var it in itemlast)
3556
+                        if (model.F_CreateBy != ua.F_UserCode)
3397 3557
                         {
3398
-                            if (it.F_WoState == 2)
3399
-                            {
3400
-                                return Error("此工单已进入处理流程不能修改!");
3401
-                            }
3558
+                            return Error("非创建人不能修改工单!");
3402 3559
                         }
3560
+
3403 3561
                     }
3404 3562
                 }
3563
+                if (model.F_State == 2)
3564
+                {
3565
+                    return Error("此工单已接单不能修改!");
3566
+                }
3567
+                else if (model.F_State == 11|| model.F_State == 10)
3568
+                {
3569
+                    return Error("此工单已处理不能修改!");
3570
+                }
3571
+
3405 3572
                 #region 保存客户基本信息
3406 3573
                 model = inputtoobj(model, input,1);
3407 3574
                 #endregion
@@ -3418,7 +3585,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
3418 3585
                     }
3419 3586
                     #endregion
3420 3587
                     AddLog(input.F_ID, model.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "修改工单", (int)EnumItemType.update, (int)EnumItemOpt.update, "", 0, ua,0,0);
3421
-                    Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
3422 3588
                     if (ro !=null )
3423 3589
                     {
3424 3590
                       if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL"|| ro.F_RoleCode == "YWY")
@@ -3439,16 +3605,48 @@ namespace CallCenterApi.Interface.Controllers.workorder
3439 3605
                             else
3440 3606
                             {
3441 3607
                                 string deptname1 = "";
3608
+                                int dapt = 0, nextda = 0; string opt = "";
3442 3609
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3443 3610
                                 if (deptmodel1 != null)
3444 3611
                                 {
3445 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("流转失败!");
3446 3645
                                 }
3447
-                                var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, model.F_limit, 0);
3448
-                                if (res)
3449
-                                    return Success("保存成功");
3450 3646
                                 else
3451
-                                    return Error("市场管理科接收失败!");
3647
+                                {
3648
+                                    return Error("流转失败!");
3649
+                                }
3452 3650
                             }
3453 3651
                         }
3454 3652
                     }
@@ -3696,10 +3894,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
3696 3894
                     model.F_Description = model1[i].F_Description;//问题描述
3697 3895
                     model.F_Files = "0";//附件上传ids
3698 3896
                     model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3897
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
3699 3898
                     model.SuperiorOpinion = AssCont(model1[i].F_ID );//上级处理意见
3700 3899
                     #endregion
3701
-
3702
-
3703 3900
                     if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
3704 3901
                     {
3705 3902
                         try
@@ -3806,15 +4003,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
3806 4003
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
3807 4004
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
3808 4005
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
3809
-                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
4006
+                 
3810 4007
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
3811 4008
                     {
3812 4009
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
3813 4010
                         if (creatname!=null )
3814 4011
                         {
4012
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
3815 4013
                             model.F_CreateName = creatname.F_UserName ; ;//添加人
3816 4014
                         }
3817
-                     
3818 4015
                     }
3819 4016
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
3820 4017
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
@@ -3843,6 +4040,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3843 4040
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
3844 4041
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
3845 4042
                     model.DelayTimelimit = DelayTimelimit(model1[i].F_ID, model1[i].F_limit);//申请时限
4043
+                    model.DelayTimename = DelayDeptid(model1[i].F_ID);//申请部门
3846 4044
                     model.F_Reasontimeout= model1[i].F_Reasontimeout;//超时原因
3847 4045
                     Model.T_Sys_UserAccount ua = new T_Sys_UserAccount();
3848 4046
                     if (userId>0)
@@ -3906,10 +4104,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
3906 4104
             var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay+ "and F_ItemType = " + (int)EnumItemType.Delay);
3907 4105
             foreach (var it in itemlist )
3908 4106
             {
4107
+               
3909 4108
                 time = int.Parse(it.F_LimitTime) - limit;
3910 4109
             }
3911 4110
             return time;
3912 4111
         }
4112
+        private string DelayDeptid(int id)
4113
+        {
4114
+            string str = "";
4115
+           
4116
+            var itemlist = itembll.GetModelList("F_WoID=" + id + "and F_OptType=" + (int)EnumItemOpt.Delay + "and F_ItemType = " + (int)EnumItemType.Delay);
4117
+            string usercode="";
4118
+            foreach (var it in itemlist)
4119
+            {
4120
+                usercode = it.F_CreateUser;
4121
+            }
4122
+            
4123
+            if (usercode!="")
4124
+            {
4125
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(usercode);
4126
+                if (ua!=null )
4127
+                {
4128
+                    Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
4129
+                    if (dModel!=null )
4130
+                    {
4131
+                        str = dModel.F_DeptName;
4132
+                    }
4133
+                    }
4134
+                }
4135
+            
4136
+            return str;
4137
+        }
3913 4138
         /// <summary>
3914 4139
         /// 是否超时
3915 4140
         /// </summary>
@@ -4109,7 +4334,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4109 4334
             else
4110 4335
             {
4111 4336
                 model.F_WorkOrderCode = model.F_WorkOrderCode;//工单编号
4112
-                model.F_Source = input .F_Source.ToString();//工单来源
4337
+                model.F_Source = model.F_Source.ToString();//工单来源
4113 4338
             }
4114 4339
                 #region 基本字段
4115 4340
                 if (type == 2)
@@ -4181,8 +4406,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
4181 4406
             model.F_Description = input.F_Description;//问题描述
4182 4407
             model.F_ZX_Area = input.F_ZX_Area;// 大区
4183 4408
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
4184
-            model.F_Files = "0";//附件上传ids
4185
-            model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
4409
+            model.F_Files = model.F_Files;//附件上传ids
4410
+            model.F_Brand = input.F_WorkerBrand;//工单品牌
4411
+            model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
4186 4412
             #endregion
4187 4413
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
4188 4414
             model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
@@ -4209,7 +4435,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4209 4435
             model.F_CJ_TestUnit = input.F_CJ_TestUnit;//抽检-化验单位
4210 4436
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
4211 4437
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
4212
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4438
+           // model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4213 4439
             if (!string .IsNullOrEmpty (input.F_BatchNumber))
4214 4440
             {
4215 4441
                 if (type == 1)
@@ -4314,7 +4540,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4314 4540
         /// 创建工单时指派
4315 4541
         /// </summary>
4316 4542
         /// <returns></returns>
4317
-        public ActionResult Createass(WorkOrderNewInput input, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
4543
+        public ActionResult Createass(WorkOrderNewInput input, string cont, WorkOrdeDeptment deptment,string F_Files, int isvisit = 1,
4318 4544
           int overtime = 0, int sms = 0, int clbm = 0, int clid = 0)
4319 4545
         {
4320 4546
             int userId = CurrentUser.UserData.F_UserId;
@@ -4458,7 +4684,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4458 4684
                         }
4459 4685
 
4460 4686
                         AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
4461
-                        var res = AssignWO(ua, modlelist, inputs, cont, clbm, clid, overtime, sms);
4687
+                        var res = AssignWO(ua, modlelist, inputs, cont, F_Files, clbm, clid, overtime, sms);
4462 4688
                             if (res)
4463 4689
                                 return Success("转派成功");
4464 4690
                             else
@@ -4564,6 +4790,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4564 4790
                     modlelist.F_DealTime =DateTime .Now ;// 处理时间
4565 4791
                     modlelist.F_DealContent = input.F_DealContent;//完结内容
4566 4792
                     modlelist.F_DealType = "当即办理";//处理方式:当即办理、电话转接、网络转办
4793
+                    model.F_IsVisit = 0;
4567 4794
                     bool f = workOrder  .Update(modlelist);
4568 4795
                     if (!f )
4569 4796
                     {
@@ -4577,7 +4804,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4577 4804
                         {
4578 4805
                             deptname = deptmodel.F_DeptName + "-";
4579 4806
                         }
4580
-                        AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.end, "", 0, ua, 0, 0);
4807
+                        AddLog(modlelist.F_ID, modlelist.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "添加工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create, "", 0, ua, 0, 0);
4581 4808
                         var res = Overorder(ua, modlelist, 1);
4582 4809
                         if (res)
4583 4810
                             return Success("完结成功");
@@ -4599,7 +4826,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4599 4826
         /// </summary>
4600 4827
         /// <returns></returns>
4601 4828
         [Authority]
4602
-        public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment, int isvisit=1,
4829
+        public ActionResult AssignWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,string F_Files, int isvisit=1,
4603 4830
             int  overtime =0,int sms=0,int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
4604 4831
         {
4605 4832
             int userId = CurrentUser.UserData.F_UserId;
@@ -4690,7 +4917,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4690 4917
                    
4691 4918
                     if (model != null)
4692 4919
                     {
4693
-                        var res = AssignWO(ua, model, input,cont, clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
4920
+                        var res = AssignWO(ua, model, input,cont, F_Files,clbm, clid, overtime, sms, isApprovalp, hclbm, hclid);
4694 4921
                         if (res)
4695 4922
                             return Success("转派成功");
4696 4923
                         else
@@ -4790,7 +5017,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4790 5017
         /// </summary>
4791 5018
         /// <returns></returns>
4792 5019
         [Authority]
4793
-        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,string dealType,
5020
+        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
4794 5021
             string uncont="",
4795 5022
           int isvisit=1,  int isover = 0)
4796 5023
         {
@@ -4864,7 +5091,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4864 5091
                     }
4865 5092
                     if (model != null)
4866 5093
                     {
4867
-                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
5094
+                        var res = DealWO(ua, model, input, cont, isover, uncont);
4868 5095
                         if (res)
4869 5096
                             return Success("处理成功");
4870 5097
                         else
@@ -4968,7 +5195,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4968 5195
                 if (ua != null)
4969 5196
                 {
4970 5197
                     Model.T_Wo_WorkOrder model = workOrder .GetModel(orderid);
4971
-                    //验证信息
5198
+                    //验证信息 
4972 5199
                     if (model != null)
4973 5200
                     {
4974 5201
                         var res = BackWO(ua, model, cont, type);
@@ -4988,7 +5215,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4988 5215
         /// <param name="input"></param>
4989 5216
         /// <returns></returns>
4990 5217
         [Authority]
4991
-        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call ,int  isOver=0)
5218
+        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call ,string F_VisitRemarks,int  isOver=0)
4992 5219
         {
4993 5220
             int userId = CurrentUser.UserData.F_UserId;
4994 5221
             if (userId != 0)
@@ -5000,7 +5227,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5000 5227
                     //验证信息
5001 5228
                     if (model != null)
5002 5229
                     {
5003
-                        var res = Retu(ua, model, cont, reason, call, isOver);
5230
+                        var res = Retu(ua, model, cont, reason, F_VisitRemarks, call, isOver);
5004 5231
                         if (res)
5005 5232
                             return Success("回访成功");
5006 5233
                         else
@@ -5278,7 +5505,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5278 5505
         /// <summary>
5279 5506
         /// 回访工单
5280 5507
         /// </summary>
5281
-        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason, string call, int isOver = 0)
5508
+        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason,string F_VisitRemarks, string call, int isOver = 0)
5282 5509
         {
5283 5510
             #region 工单处理
5284 5511
             int  sms = 0;
@@ -5338,6 +5565,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5338 5565
                 model.F_VisitReason = reason;
5339 5566
                 model.F_Callresults = call ;
5340 5567
                 model.F_Sid  = sid;
5568
+                model.F_VisitRemarks = F_VisitRemarks;
5341 5569
                 workOrder.Update(model);
5342 5570
                 #endregion
5343 5571
                 #region 推送消息
@@ -5425,7 +5653,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5425 5653
         /// <summary>
5426 5654
         /// 处理工单
5427 5655
         /// </summary>
5428
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input,string cont,int isover = 0,string dealType="",string uncont="")
5656
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input,string cont,int isover = 0,string uncont="")
5429 5657
         {
5430 5658
             #region 工单处理
5431 5659
            int   sms = 0;
@@ -5476,7 +5704,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
5476 5704
             {
5477 5705
                 #region 处理工单
5478 5706
                 model.F_State  = wostate;
5479
-                model.F_DealType  = dealType;
5480 5707
                 //处理内容
5481 5708
                 if (!string.IsNullOrEmpty(cont))
5482 5709
                     model.F_DealContent += cont + ";";
@@ -5665,7 +5892,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5665 5892
         /// <summary>
5666 5893
         /// 转派工单
5667 5894
         /// </summary>
5668
-        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int clbm = 0, int clid = 0, int  overtime = 0, int sms = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0, string creat = "")
5895
+        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, string F_Files, int clbm = 0, int clid = 0, int  overtime = 0, int sms = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0, string creat = "")
5669 5896
         {
5670 5897
             string smscont = "";
5671 5898
             if (model.F_Type == "1")
@@ -5800,6 +6027,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
5800 6027
                 if (!string.IsNullOrEmpty(cont))
5801 6028
                     model.F_DealContent += cont + ";";
5802 6029
                 InToworkModel(model, input);
6030
+                if (!string.IsNullOrEmpty(F_Files))
6031
+                    model.F_Files = F_Files;
5803 6032
                 workOrder.Update(model);
5804 6033
                 #endregion
5805 6034
                 #region 推送消息
@@ -5845,7 +6074,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5845 6074
             string strmsg = string.Empty;
5846 6075
             strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
5847 6076
             Model.T_Msg_List msg = new Model.T_Msg_List();
5848
-            msg.Type = (int)Model.MSGType.workorder;//处理
6077
+            msg.Type = (int)Model.MSGType.Handle;//处理
5849 6078
             msg.ToUser = touser;
5850 6079
             msg.ToID = toid;
5851 6080
             msg.Detail = strmsg;

+ 11 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

@@ -279,6 +279,10 @@ namespace CallCenterApi.Interface.Models.Input
279 279
         /// </summary>
280 280
         public string F_Brand { get; set; }
281 281
         /// <summary>
282
+        /// 品牌
283
+        /// </summary>
284
+        public string F_WorkerBrand { get; set; }
285
+        /// <summary>
282 286
         /// 复合肥肥效
283 287
         /// </summary>
284 288
         public string F_MaterialEffect { get; set; }
@@ -773,6 +777,13 @@ namespace CallCenterApi.Interface.Models.Input
773 777
             get; set;
774 778
         }
775 779
         ///// <summary>
780
+        ///// 延期时限
781
+        ///// </summary>
782
+        public string  DelayTimename
783
+        {
784
+            get; set;
785
+        }
786
+        ///// <summary>
776 787
         ///// 超时原因
777 788
         ///// </summary>
778 789
         public string F_Reasontimeout

+ 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
 

+ 6 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

@@ -101,6 +101,12 @@ namespace CallCenterApi.Model
101 101
         private int  _f_smsreply;
102 102
         private string  _f_sid;
103 103
         private string _f_visitremarks;
104
+        private string _f_brand;
105
+        public string F_Brand
106
+        {
107
+            set { _f_brand = value; }
108
+            get { return _f_brand; }
109
+        }
104 110
         /// <summary>
105 111
         /// 回访备注
106 112
         /// </summary>