瀏覽代碼

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
                 string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
22
                 string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
23
                 if (userseatgroupid != "" && userseatgroupid != "0")
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
                     if (smodel != null)
26
                     if (smodel != null)
27
                     {
27
                     {
28
                         zipcode = smodel.F_ZXAtt.Trim();
28
                         zipcode = smodel.F_ZXAtt.Trim();

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

382
             //    new BLL.T_Msg_List().Add(msg);
382
             //    new BLL.T_Msg_List().Add(msg);
383
             //}
383
             //}
384
             #endregion
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
             return Success("获取消息", msgListnew);
387
             return Success("获取消息", msgListnew);
387
         }
388
         }
388
 
389
 

+ 26 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

23
         #endregion
23
         #endregion
24
         public ActionResult SMSSend(string name,string phone,string cusphone)
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
             SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,感谢你的致电反馈,稍后会安排业务经理和你联系,请你保持电话畅通。业务经理姓名:"+ name+",电话:"+ phone+"。");
32
             SmsSingleSenderResult result = SMSSingleshot(cusphone, "您好,感谢你的致电反馈,稍后会安排业务经理和你联系,请你保持电话畅通。业务经理姓名:"+ name+",电话:"+ phone+"。");
28
             
33
             
29
             if (result != null)
34
             if (result != null)
37
                 return Error ("发送失败,请检查客户电话");
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
         /// <summary>
65
         /// <summary>
42
         /// 单发短信
66
         /// 单发短信
43
         /// </summary>
67
         /// </summary>

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

188
                 return Error("参数传输失败");
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
         /// <summary>
294
         /// <summary>
193
         /// 通过来电号码获取来电弹屏左侧客户信息
295
         /// 通过来电号码获取来电弹屏左侧客户信息
194
         /// </summary>
296
         /// </summary>
197
         {
299
         {
198
             if (!string.IsNullOrWhiteSpace(tel))
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
                 var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
303
                 var userModel = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_IsDelete = 0 " + sql);
202
                 if (userModel.Count() > 0)
304
                 if (userModel.Count() > 0)
203
                 {
305
                 {

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

56
             }
56
             }
57
             if (!string.IsNullOrEmpty(keywords.Trim()))
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
                 if (userModel != null)
60
                 if (userModel != null)
61
                 {
61
                 {
62
                     return Success("加载成功", userModel);
62
                     return Success("加载成功", userModel);
70
             F_Layer = F_Layer - 1;
70
             F_Layer = F_Layer - 1;
71
             if (!string.IsNullOrEmpty(F_RegionName.Trim()))
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
             var obj = new
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
                 {
198
                 {
199
                     Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
199
                     Model.T_Cus_CustomerBaseNew cus = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
200
          .FirstOrDefault();
200
          .FirstOrDefault();
201
+                    Model.T_Cus_CustomerBaseNew cusll = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='0" + tephone + "'  ")
202
+        .FirstOrDefault();
201
                     if (cus != null)
203
                     if (cus != null)
202
                     {
204
                     {
203
                         dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
205
                         dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList(" F_LegalPhone ='" + tephone + "'  ")
204
                .FirstOrDefault().F_Legal;
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
                 else
90
                 else
91
                     loginUser = loginwork;
91
                     loginUser = loginwork;
92
                 loginUser.F_WxOpenId = login.OpenId;
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
                     if (modelDep == null)
98
                     if (modelDep == null)
98
                         return Error("获取失败!");
99
                         return Error("获取失败!");
99
                     #region 读取角色code
100
                     #region 读取角色code
110
                 }
111
                 }
111
                     else
112
                     else
112
                     {
113
                     {
113
-                        if (loginUser.F_RoleId == 60 || loginUser.F_RoleId == 62)
114
+                        if (loginUser.F_RoleId == 60 )
114
                         {
115
                         {
115
                             UserType = 0;
116
                             UserType = 0;
116
-                        }
117
+                        rolename ="分公司经理";
118
+                       }
119
+                        else if (loginUser.F_RoleId == 62)
120
+                      {
121
+                        UserType = 0;
122
+                        rolename = "大区经理";
123
+                    }
117
                         else if (loginUser.F_RoleId == 61)
124
                         else if (loginUser.F_RoleId == 61)
118
                         {
125
                         {
119
                             UserType = 2;
126
                             UserType = 2;
120
-                        }
127
+                        rolename = "高层";
128
+                    }
121
                         else if (loginUser.F_RoleId == 58)
129
                         else if (loginUser.F_RoleId == 58)
122
                         {
130
                         {
123
                             UserType = 4;
131
                             UserType = 4;
124
-                        }
132
+                        rolename = "业务员";
133
+                    }
125
                         else if (loginUser.F_RoleId == 59)
134
                         else if (loginUser.F_RoleId == 59)
126
                         {
135
                         {
127
                             UserType = 3;
136
                             UserType = 3;
128
-                        }
137
+                        rolename = "办理人员";
138
+                    }
129
                         else
139
                         else
130
                         {
140
                         {
131
                         return Error("无操作权限");
141
                         return Error("无操作权限");
165
                         openid = login.OpenId,
175
                         openid = login.OpenId,
166
                         usercode = login.UserCode,
176
                         usercode = login.UserCode,
167
                         usertype = UserType,
177
                         usertype = UserType,
168
-                        rolecode=rolecode,
178
+                        UserName= UserName,
179
+                        rolename = rolename,
180
+                        rolecode =rolecode,
169
                     };
181
                     };
170
 
182
 
171
                      if (userAccountBLL.Update(loginUser))
183
                      if (userAccountBLL.Update(loginUser))
537
             {
549
             {
538
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
550
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
539
                 var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
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
                 //  Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
559
                 //  Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
545
                 string sql = $" and F_IsDelete=0";
560
                 string sql = $" and F_IsDelete=0";
838
         /// <summary>
853
         /// <summary>
839
         ///综合查询列表
854
         ///综合查询列表
840
         /// </summary>
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
             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)
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
             if (!string.IsNullOrEmpty(OpenId))
860
             if (!string.IsNullOrEmpty(OpenId))
845
             {
861
             {
846
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
862
                 //  Model.T_Sys_UserAccount ua = userAccountBLL.GetModel(userId);
858
                     sql += $" and F_State=" + state;
874
                     sql += $" and F_State=" + state;
859
                 if (source > 0)//工单来源
875
                 if (source > 0)//工单来源
860
                     sql += $" and F_Source=" + source;
876
                     sql += $" and F_Source=" + source;
877
+                if (!string.IsNullOrWhiteSpace(createby))//创建人
878
+                    sql += $" and F_CreateBy like '%" + createby.Trim() + "%'";
861
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
879
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
862
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
880
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
863
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
881
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
1235
                         {
1253
                         {
1236
                             opt = "同意上报";
1254
                             opt = "同意上报";
1237
                             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);
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
                             if (userid <= 0 || !res)
1257
                             if (userid <= 0 || !res)
1240
                                 res = false;
1258
                                 res = false;
1241
                             wostate = 1;
1259
                             wostate = 1;
1316
         /// <param name="ua"></param>
1334
         /// <param name="ua"></param>
1317
         /// <param name="time"></param>
1335
         /// <param name="time"></param>
1318
         /// <param name="id"></param>
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
             DateTime times = DateTime.Parse(time).AddHours(24);
1339
             DateTime times = DateTime.Parse(time).AddHours(24);
1322
             Model.T_Wo_WorkOrder model = woBLL.GetModel(id);
1340
             Model.T_Wo_WorkOrder model = woBLL.GetModel(id);
1324
             modeLlist.Add(model);
1342
             modeLlist.Add(model);
1325
             List<WorkOrderNewInput> Input = modeltooip(modeLlist,ua );
1343
             List<WorkOrderNewInput> Input = modeltooip(modeLlist,ua );
1326
             string cont = "";
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
         /// <summary>
1392
         /// <summary>
1341
         /// 查询工单详情
1393
         /// 查询工单详情
1345
         {
1397
         {
1346
             if (!string.IsNullOrEmpty(OpenId))
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
                 if (list.Count > 0)
1423
                 if (list.Count > 0)
1369
                 {
1424
                 {
1370
                     List<WorkOrderNewInput> Input = modeltooip(list,ua );
1425
                     List<WorkOrderNewInput> Input = modeltooip(list,ua );
1375
                             state = "success",
1430
                             state = "success",
1376
                             message = "成功",
1431
                             message = "成功",
1377
                             rows = Input,
1432
                             rows = Input,
1433
+                            FileUrl,
1378
                             total = itemlasts,
1434
                             total = itemlasts,
1379
                         };
1435
                         };
1380
 
1436
 
1460
                     {
1516
                     {
1461
                     if (hours>=24)
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
                     else
1521
                     else
1466
                     {
1522
                     {
1492
                     }
1548
                     }
1493
                     else if (hours >= 48)
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
                     else
1553
                     else
1498
                     {
1554
                     {
1538
                                 }
1594
                                 }
1539
                                 else
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
                     model.F_CJ_Tonnage = model1[i].F_CJ_Tonnage;//抽检-抽检吨数
1860
                     model.F_CJ_Tonnage = model1[i].F_CJ_Tonnage;//抽检-抽检吨数
1805
                     model.F_CJ_BagNo = model1[i].F_CJ_BagNo;//抽检-抽检袋数
1861
                     model.F_CJ_BagNo = model1[i].F_CJ_BagNo;//抽检-抽检袋数
1806
                     model.F_CJ_Outlay = model1[i].F_CJ_Outlay;//抽检-公关费用金额:单位元
1862
                     model.F_CJ_Outlay = model1[i].F_CJ_Outlay;//抽检-公关费用金额:单位元
1807
-
1863
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
1808
                     model.F_DealBy = model1[i].F_DealBy;//处理人
1864
                     model.F_DealBy = model1[i].F_DealBy;//处理人
1809
                     model.F_DealTime = model1[i].F_DealTime;//处理时间
1865
                     model.F_DealTime = model1[i].F_DealTime;//处理时间
1810
                     model.F_DealContent = model1[i].F_DealContent;//处理内容
1866
                     model.F_DealContent = model1[i].F_DealContent;//处理内容
1859
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1915
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1860
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1916
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1861
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
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
                     if (!string.IsNullOrEmpty(model1[i].F_CreateBy))
1919
                     if (!string.IsNullOrEmpty(model1[i].F_CreateBy))
1864
 
1920
 
1865
                     {
1921
                     {
1866
                         Model.T_Sys_UserAccount creatname = userAccountBLL .GetModel(model1[i].F_CreateBy);
1922
                         Model.T_Sys_UserAccount creatname = userAccountBLL .GetModel(model1[i].F_CreateBy);
1867
                         if (creatname != null)
1923
                         if (creatname != null)
1868
                         {
1924
                         {
1925
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
1869
                             model.F_CreateName = creatname.F_UserName; ;//添加人
1926
                             model.F_CreateName = creatname.F_UserName; ;//添加人
1870
                         }
1927
                         }
1871
 
1928
 
2442
             model.F_Description = input.F_Description;//问题描述
2499
             model.F_Description = input.F_Description;//问题描述
2443
             model.F_ZX_Area = input.F_ZX_Area;// 大区
2500
             model.F_ZX_Area = input.F_ZX_Area;// 大区
2444
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
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
             model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
2505
             model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
2448
             #endregion
2506
             #endregion
2449
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2507
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2450
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2508
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2451
                 model.F_MaterialID = input.F_MaterialID;//物料编码为11为纯数字
2509
                 model.F_MaterialID = input.F_MaterialID;//物料编码为11为纯数字
2510
+
2452
             #region 投诉类
2511
             #region 投诉类
2453
             model.F_BatchNumber = input.F_BatchNumber;//生产批次号
2512
             model.F_BatchNumber = input.F_BatchNumber;//生产批次号
2454
             model.F_TS_Formula = input.F_TS_Formula;// 投诉-配方
2513
             model.F_TS_Formula = input.F_TS_Formula;// 投诉-配方
2469
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
2528
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
2470
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
2529
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
2471
             model.F_CJ_Outlay = input.F_CJ_Outlay;//抽检-公关费用金额:单位元】
2530
             model.F_CJ_Outlay = input.F_CJ_Outlay;//抽检-公关费用金额:单位元】
2472
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2531
+     //     model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2473
             if (!string.IsNullOrEmpty(input.F_BatchNumber))
2532
             if (!string.IsNullOrEmpty(input.F_BatchNumber))
2474
             {
2533
             {
2475
                 if (type == 1)
2534
                 if (type == 1)
2656
                             else
2715
                             else
2657
                             {
2716
                             {
2658
                                 string deptname1 = "";
2717
                                 string deptname1 = "";
2718
+                               int  dapt = 0,nextda=0;
2719
+                               
2659
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
2720
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
2660
                                 if (deptmodel1 != null)
2721
                                 if (deptmodel1 != null)
2661
                                 {
2722
                                 {
2662
                                     deptname1 = deptmodel1.F_DeptName + "-";
2723
                                     deptname1 = deptmodel1.F_DeptName + "-";
2724
+                                    dapt =deptmodel1.F_ParentId ;
2663
                                 }
2725
                                 }
2664
                                 AddLog(modlelist.F_ID, 0, deptname1 + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "创建工单", (int)EnumWorkOrderState.neworder, (int)EnumItemOpt.create,"",0, ua, 0, 0);
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
                                 else
2759
                                 else
2669
-                                    return Error("市场管理科接收失败!");
2760
+                                {
2761
+                                    return Error("流转失败!");
2762
+                                }
2763
+                               
2670
                             }
2764
                             }
2671
                         }
2765
                         }
2672
                         else
2766
                         else
2759
         /// </summary>
2853
         /// </summary>
2760
         /// <returns></returns>
2854
         /// <returns></returns>
2761
         [WechatActionFilter]
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
             int  overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
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
 
2943
 
2850
                     if (model != null)
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
                         if (res)
2947
                         if (res)
2854
                             return Success("转派成功");
2948
                             return Success("转派成功");
2855
                         else
2949
                         else
2865
         /// <summary>
2959
         /// <summary>
2866
         /// 转派工单
2960
         /// 转派工单
2867
         /// </summary>
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
             string smscont = "";
2965
             string smscont = "";
2996
                 //   model.F_DealBy = touser;
3090
                 //   model.F_DealBy = touser;
2997
                 model.F_State = wostate;
3091
                 model.F_State = wostate;
2998
                 model.F_limit = overtime;
3092
                 model.F_limit = overtime;
3093
+                if (!string.IsNullOrEmpty(F_Files))
3094
+                    model.F_Files = F_Files;
2999
                 //处理内容
3095
                 //处理内容
3000
                 if (!string.IsNullOrEmpty(cont))
3096
                 if (!string.IsNullOrEmpty(cont))
3001
                     model.F_DealContent += cont + ";";
3097
                     model.F_DealContent += cont + ";";
3412
         /// <returns></returns>
3508
         /// <returns></returns>
3413
        
3509
        
3414
         [WechatActionFilter]
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
          string uncont = "",
3512
          string uncont = "",
3417
         int isvisit = 1, int isover = 0)
3513
         int isvisit = 1, int isover = 0)
3418
         {
3514
         {
3485
                     }
3581
                     }
3486
                     if (model != null)
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
                         if (res)
3585
                         if (res)
3490
                             return Success("处理成功");
3586
                             return Success("处理成功");
3491
                         else
3587
                         else
3723
         /// <summary>
3819
         /// <summary>
3724
         /// 处理工单
3820
         /// 处理工单
3725
         /// </summary>
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
             #region 工单处理
3824
             #region 工单处理
3729
             int sms = 0;
3825
             int sms = 0;
3773
             {
3869
             {
3774
                 #region 处理工单
3870
                 #region 处理工单
3775
                 model.F_State = wostate;
3871
                 model.F_State = wostate;
3776
-                model.F_DealType = dealType;
3777
                 //处理内容
3872
                 //处理内容
3778
                 if (!string.IsNullOrEmpty(cont))
3873
                 if (!string.IsNullOrEmpty(cont))
3779
                     model.F_DealContent += cont + ";";
3874
                     model.F_DealContent += cont + ";";
3924
                 var model = woBLL.GetModel(input.F_ID);
4019
                 var model = woBLL.GetModel(input.F_ID);
3925
                 if (model ==null )
4020
                 if (model ==null )
3926
                     return Error("查询不到此工单!");
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
                 #region 保存客户基本信息
4031
                 #region 保存客户基本信息
3942
                 model = inputtoobj(ua,model, input, 1);
4032
                 model = inputtoobj(ua,model, input, 1);
3970
                     }
4060
                     }
3971
                     else
4061
                     else
3972
                     {
4062
                     {
4063
+
3973
                         string deptname1 = "";
4064
                         string deptname1 = "";
4065
+                        int dapt = 0, nextda = 0; string opt = "";
3974
                         var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
4066
                         var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3975
                         if (deptmodel1 != null)
4067
                         if (deptmodel1 != null)
3976
                         {
4068
                         {
3977
                             deptname1 = deptmodel1.F_DeptName + "-";
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
                         else
4103
                         else
3983
-                            return Error("市场管理科接收失败!");
4104
+                        {
4105
+                            return Error("流转失败!");
4106
+                        }
4107
+
3984
                     }
4108
                     }
3985
-                return Success("保存成功!");
4109
+                    return Success("保存成功!");
3986
                 }
4110
                 }
3987
                 else
4111
                 else
3988
                     return Error("保存失败!");
4112
                     return Error("保存失败!");

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

173
                         sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
173
                         sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
174
                         break;
174
                         break;
175
                     case 3://我参与的
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
                         else
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
                         break;
194
                         break;
186
                     case 4://待回访
195
                     case 4://待回访
187
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
196
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
195
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
204
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
196
                         break;
205
                         break;
197
                     case 6://已回访
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
                             sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
209
                             sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
201
                             sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
210
                             sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
202
                         }
211
                         }
212
+                        else if (ro.F_RoleCode == "XTGLY")
213
+                        {
214
+                            uwhere = ""; ;
215
+                        }
203
                         else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
216
                         else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
204
                         {
217
                         {
205
                             string detpid = "";
218
                             string detpid = "";
561
                         case 3://客服已分配
574
                         case 3://客服已分配
562
                             sql = "";
575
                             sql = "";
563
                             sql += $"  F_IsDelete=0";
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
                             else
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
                              Allocated = new BLL.T_Wo_WorkOrder().GetModelList(sql).Count;//客服已分配
602
                              Allocated = new BLL.T_Wo_WorkOrder().GetModelList(sql).Count;//客服已分配
574
                        
603
                        
575
                             break;
604
                             break;
592
                         case 6://已回访
621
                         case 6://已回访
593
                             sql = "";
622
                             sql = "";
594
                             sql += $"  F_IsDelete=0";
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
                                 sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
626
                                 sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
598
                                 sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
627
                                 sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
599
                             }
628
                             }
629
+                            else if (ro.F_RoleCode == "XTGLY")
630
+                            {
631
+                                uwhere = ""; ;
632
+                            }
600
                             else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
633
                             else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
601
                             {
634
                             {
602
                                 string detpid = "";
635
                                 string detpid = "";
979
                         {
1012
                         {
980
                             opt = "同意上报";
1013
                             opt = "同意上报";
981
                             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);
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
                             if (userid <= 0 || !res)
1016
                             if (userid <= 0 || !res)
984
                                 res = false;
1017
                                 res = false;
985
                             wostate = 1;
1018
                             wostate = 1;
1092
         /// <param name="ua"></param>
1125
         /// <param name="ua"></param>
1093
         /// <param name="time"></param>
1126
         /// <param name="time"></param>
1094
         /// <param name="id"></param>
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
             DateTime times = DateTime.Parse(time).AddHours(24);
1130
             DateTime times = DateTime.Parse(time).AddHours(24);
1098
             Model.T_Wo_WorkOrder model = workOrder .GetModel(id);
1131
             Model.T_Wo_WorkOrder model = workOrder .GetModel(id);
1100
             modeLlist.Add(model);
1133
             modeLlist.Add(model);
1101
             List<WorkOrderNewInput> Input = modeltooip(modeLlist);
1134
             List<WorkOrderNewInput> Input = modeltooip(modeLlist);
1102
             string cont = "";
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
             if (istrue)
1165
             if (istrue)
1104
             {
1166
             {
1105
-                cont = "大区经理已审批流转市场管理科";
1167
+                cont = "大区经理已审批:"+ AuditCont+"," + opt;
1106
             }
1168
             }
1107
             else
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
         /// <summary>
1183
         /// <summary>
1117
         /// 获取待审批的工单
1184
         /// 获取待审批的工单
1134
                 {
1201
                 {
1135
                     if (hours >= 24)
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
                     else
1206
                     else
1140
                     {
1207
                     {
1166
                     }
1233
                     }
1167
                     else if (hours >= 48)
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
                     else
1238
                     else
1172
                     {
1239
                     {
1212
                                 }
1279
                                 }
1213
                                 else
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
              ;
1883
              ;
1817
             return str;
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
         /// <summary>
1894
         /// <summary>
1820
         /// 获取我参与的工单编号
1895
         /// 获取我参与的工单编号
1821
         /// </summary>
1896
         /// </summary>
1963
             }
2038
             }
1964
             return str;
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
         /// <summary>
2054
         /// <summary>
1967
         /// 查询工单详情
2055
         /// 查询工单详情
1968
         /// </summary>
2056
         /// </summary>
1971
             int userId = CurrentUser.UserData.F_UserId;
2059
             int userId = CurrentUser.UserData.F_UserId;
1972
             if (userId != 0)
2060
             if (userId != 0)
1973
             {
2061
             {
2062
+                DataTable FileUrl = new DataTable();
1974
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
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
                     return Error("请输入正确的id");
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
                  var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
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
                 if (list.Count > 0)
2076
                 if (list.Count > 0)
1991
                 {
2077
                 {
1992
                     List<WorkOrderNewInput> Input = modeltooip(list);
2078
                     List<WorkOrderNewInput> Input = modeltooip(list);
1997
                             state = "success",
2083
                             state = "success",
1998
                             message = "成功",
2084
                             message = "成功",
1999
                             rows = Input,
2085
                             rows = Input,
2000
-                            total= ItemList( itemlasts),
2086
+                            FileUrl,
2087
+                            total = ItemList( itemlasts),
2001
                         };
2088
                         };
2002
 
2089
 
2003
                         return Content(obj.ToJson()); 
2090
                         return Content(obj.ToJson()); 
2110
         /// <summary>
2197
         /// <summary>
2111
         ///综合查询列表
2198
         ///综合查询列表
2112
         /// </summary>
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
             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)
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
             int userId = CurrentUser.UserData.F_UserId;
2203
             int userId = CurrentUser.UserData.F_UserId;
2125
                    sql += $" and F_State=" + state;
2212
                    sql += $" and F_State=" + state;
2126
                 if (source > 0)//工单来源
2213
                 if (source > 0)//工单来源
2127
                     sql += $" and F_Source=" + source;
2214
                     sql += $" and F_Source=" + source;
2215
+                if (!string.IsNullOrWhiteSpace(createby))//创建人
2216
+                    sql += $" and F_CreateBy like '%" + createby.Trim() + "%'";
2128
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
2217
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
2129
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
2218
                     sql += $" and F_DealBy like '%" + touser.Trim() + "%'";
2130
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
2219
                 if (!string.IsNullOrWhiteSpace(code))//工单编号
3212
                             }
3301
                             }
3213
                             else
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
                                 if (res)
3339
                                 if (res)
3218
                                     return Success("添加成功");
3340
                                     return Success("添加成功");
3219
                                 else
3341
                                 else
3220
-                                    return Error("市场管理科接收失败!");
3342
+                                    return Error("流转失败!");
3343
+                            }
3344
+                            else
3345
+                            {
3346
+                                return Error("流转失败!");
3347
+                            }
3221
                             }
3348
                             }
3222
                         }
3349
                         }
3223
                         else
3350
                         else
3279
             #endregion
3406
             #endregion
3280
             return model;
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
         /// <summary>
3442
         /// <summary>
3284
         /// 删除工单
3443
         /// 删除工单
3285
         /// </summary>
3444
         /// </summary>
3290
             int userId = CurrentUser.UserData.F_UserId;
3449
             int userId = CurrentUser.UserData.F_UserId;
3291
             if (userId != 0)
3450
             if (userId != 0)
3292
             {
3451
             {
3452
+               
3293
                 if (ids != null && ids.Length > 0)
3453
                 if (ids != null && ids.Length > 0)
3294
                 {
3454
                 {
3295
                       bool res = true;
3455
                       bool res = true;
3346
             {
3506
             {
3347
                 string usercode = CurrentUser.UserData.F_UserCode;
3507
                 string usercode = CurrentUser.UserData.F_UserCode;
3348
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3508
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3509
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
3349
                 #region 添加验证判断
3510
                 #region 添加验证判断
3350
                 if (input.F_ID <= 0)
3511
                 if (input.F_ID <= 0)
3351
                     return Error("参数错误!");
3512
                     return Error("参数错误!");
3352
-                if (!(input.F_Type> 0 && input.F_Type < 5))
3513
+                if (!(input.F_Type > 0 && input.F_Type < 5))
3353
                     return Error("工单类型错误!");
3514
                     return Error("工单类型错误!");
3354
                 if (string.IsNullOrEmpty(input.F_CusName))
3515
                 if (string.IsNullOrEmpty(input.F_CusName))
3355
                     return Error("请输入客户姓名!");
3516
                     return Error("请输入客户姓名!");
3356
                 if (string.IsNullOrEmpty(input.F_CusPhone))
3517
                 if (string.IsNullOrEmpty(input.F_CusPhone))
3357
                     return Error("请输入客户电话!");
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
                     return Error("请输入正确的生产批次号!");
3521
                     return Error("请输入正确的生产批次号!");
3361
                 }
3522
                 }
3382
                 }
3543
                 }
3383
                 if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
3544
                 if (!string.IsNullOrEmpty(input.F_CustomerID) && !valcode(input.F_CustomerID.ToString(), 10))
3384
                     return Error("客户编号为10为纯数字!");
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
                     return Error("物料编码为11为纯数字!");
3547
                     return Error("物料编码为11为纯数字!");
3387
                 #endregion
3548
                 #endregion
3388
                 var model = workOrder.GetModel(input.F_ID);
3549
                 var model = workOrder.GetModel(input.F_ID);
3389
                 if (model == null)
3550
                 if (model == null)
3390
                     return Error("查询不到此工单!");
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
                 #region 保存客户基本信息
3572
                 #region 保存客户基本信息
3406
                 model = inputtoobj(model, input,1);
3573
                 model = inputtoobj(model, input,1);
3407
                 #endregion
3574
                 #endregion
3418
                     }
3585
                     }
3419
                     #endregion
3586
                     #endregion
3420
                     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);
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
                     if (ro !=null )
3588
                     if (ro !=null )
3423
                     {
3589
                     {
3424
                       if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL"|| ro.F_RoleCode == "YWY")
3590
                       if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL"|| ro.F_RoleCode == "YWY")
3439
                             else
3605
                             else
3440
                             {
3606
                             {
3441
                                 string deptname1 = "";
3607
                                 string deptname1 = "";
3608
+                                int dapt = 0, nextda = 0; string opt = "";
3442
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3609
                                 var deptmodel1 = departmentBLL.GetModel(ua.F_DeptId);
3443
                                 if (deptmodel1 != null)
3610
                                 if (deptmodel1 != null)
3444
                                 {
3611
                                 {
3445
                                     deptname1 = deptmodel1.F_DeptName + "-";
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
                                 else
3646
                                 else
3451
-                                    return Error("市场管理科接收失败!");
3647
+                                {
3648
+                                    return Error("流转失败!");
3649
+                                }
3452
                             }
3650
                             }
3453
                         }
3651
                         }
3454
                     }
3652
                     }
3696
                     model.F_Description = model1[i].F_Description;//问题描述
3894
                     model.F_Description = model1[i].F_Description;//问题描述
3697
                     model.F_Files = "0";//附件上传ids
3895
                     model.F_Files = "0";//附件上传ids
3698
                     model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3896
                     model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3897
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
3699
                     model.SuperiorOpinion = AssCont(model1[i].F_ID );//上级处理意见
3898
                     model.SuperiorOpinion = AssCont(model1[i].F_ID );//上级处理意见
3700
                     #endregion
3899
                     #endregion
3701
-
3702
-
3703
                     if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
3900
                     if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
3704
                     {
3901
                     {
3705
                         try
3902
                         try
3806
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
4003
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
3807
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
4004
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
3808
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
4005
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
3809
-                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
4006
+                 
3810
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
4007
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
3811
                     {
4008
                     {
3812
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
4009
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
3813
                         if (creatname!=null )
4010
                         if (creatname!=null )
3814
                         {
4011
                         {
4012
+                            model.F_CreateBy = creatname.F_WorkNumber; ;//添加人
3815
                             model.F_CreateName = creatname.F_UserName ; ;//添加人
4013
                             model.F_CreateName = creatname.F_UserName ; ;//添加人
3816
                         }
4014
                         }
3817
-                     
3818
                     }
4015
                     }
3819
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
4016
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
3820
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
4017
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
3843
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
4040
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
3844
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
4041
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
3845
                     model.DelayTimelimit = DelayTimelimit(model1[i].F_ID, model1[i].F_limit);//申请时限
4042
                     model.DelayTimelimit = DelayTimelimit(model1[i].F_ID, model1[i].F_limit);//申请时限
4043
+                    model.DelayTimename = DelayDeptid(model1[i].F_ID);//申请部门
3846
                     model.F_Reasontimeout= model1[i].F_Reasontimeout;//超时原因
4044
                     model.F_Reasontimeout= model1[i].F_Reasontimeout;//超时原因
3847
                     Model.T_Sys_UserAccount ua = new T_Sys_UserAccount();
4045
                     Model.T_Sys_UserAccount ua = new T_Sys_UserAccount();
3848
                     if (userId>0)
4046
                     if (userId>0)
3906
             var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay+ "and F_ItemType = " + (int)EnumItemType.Delay);
4104
             var itemlist = itembll.GetModelList("F_WoID="+ id + "and F_OptType="+ (int)EnumItemOpt.Delay+ "and F_ItemType = " + (int)EnumItemType.Delay);
3907
             foreach (var it in itemlist )
4105
             foreach (var it in itemlist )
3908
             {
4106
             {
4107
+               
3909
                 time = int.Parse(it.F_LimitTime) - limit;
4108
                 time = int.Parse(it.F_LimitTime) - limit;
3910
             }
4109
             }
3911
             return time;
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
         /// <summary>
4138
         /// <summary>
3914
         /// 是否超时
4139
         /// 是否超时
3915
         /// </summary>
4140
         /// </summary>
4109
             else
4334
             else
4110
             {
4335
             {
4111
                 model.F_WorkOrderCode = model.F_WorkOrderCode;//工单编号
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
                 #region 基本字段
4339
                 #region 基本字段
4115
                 if (type == 2)
4340
                 if (type == 2)
4181
             model.F_Description = input.F_Description;//问题描述
4406
             model.F_Description = input.F_Description;//问题描述
4182
             model.F_ZX_Area = input.F_ZX_Area;// 大区
4407
             model.F_ZX_Area = input.F_ZX_Area;// 大区
4183
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
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
             #endregion
4412
             #endregion
4187
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
4413
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
4188
             model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
4414
             model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
4209
             model.F_CJ_TestUnit = input.F_CJ_TestUnit;//抽检-化验单位
4435
             model.F_CJ_TestUnit = input.F_CJ_TestUnit;//抽检-化验单位
4210
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
4436
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
4211
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
4437
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
4212
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4438
+           // model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4213
             if (!string .IsNullOrEmpty (input.F_BatchNumber))
4439
             if (!string .IsNullOrEmpty (input.F_BatchNumber))
4214
             {
4440
             {
4215
                 if (type == 1)
4441
                 if (type == 1)
4314
         /// 创建工单时指派
4540
         /// 创建工单时指派
4315
         /// </summary>
4541
         /// </summary>
4316
         /// <returns></returns>
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
           int overtime = 0, int sms = 0, int clbm = 0, int clid = 0)
4544
           int overtime = 0, int sms = 0, int clbm = 0, int clid = 0)
4319
         {
4545
         {
4320
             int userId = CurrentUser.UserData.F_UserId;
4546
             int userId = CurrentUser.UserData.F_UserId;
4458
                         }
4684
                         }
4459
 
4685
 
4460
                         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);
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
                             if (res)
4688
                             if (res)
4463
                                 return Success("转派成功");
4689
                                 return Success("转派成功");
4464
                             else
4690
                             else
4564
                     modlelist.F_DealTime =DateTime .Now ;// 处理时间
4790
                     modlelist.F_DealTime =DateTime .Now ;// 处理时间
4565
                     modlelist.F_DealContent = input.F_DealContent;//完结内容
4791
                     modlelist.F_DealContent = input.F_DealContent;//完结内容
4566
                     modlelist.F_DealType = "当即办理";//处理方式:当即办理、电话转接、网络转办
4792
                     modlelist.F_DealType = "当即办理";//处理方式:当即办理、电话转接、网络转办
4793
+                    model.F_IsVisit = 0;
4567
                     bool f = workOrder  .Update(modlelist);
4794
                     bool f = workOrder  .Update(modlelist);
4568
                     if (!f )
4795
                     if (!f )
4569
                     {
4796
                     {
4577
                         {
4804
                         {
4578
                             deptname = deptmodel.F_DeptName + "-";
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
                         var res = Overorder(ua, modlelist, 1);
4808
                         var res = Overorder(ua, modlelist, 1);
4582
                         if (res)
4809
                         if (res)
4583
                             return Success("完结成功");
4810
                             return Success("完结成功");
4599
         /// </summary>
4826
         /// </summary>
4600
         /// <returns></returns>
4827
         /// <returns></returns>
4601
         [Authority]
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
             int  overtime =0,int sms=0,int clbm = 0, int clid = 0, int isApprovalp = 0, int hclbm = 0, int hclid = 0)
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
             int userId = CurrentUser.UserData.F_UserId;
4832
             int userId = CurrentUser.UserData.F_UserId;
4690
                    
4917
                    
4691
                     if (model != null)
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
                         if (res)
4921
                         if (res)
4695
                             return Success("转派成功");
4922
                             return Success("转派成功");
4696
                         else
4923
                         else
4790
         /// </summary>
5017
         /// </summary>
4791
         /// <returns></returns>
5018
         /// <returns></returns>
4792
         [Authority]
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
             string uncont="",
5021
             string uncont="",
4795
           int isvisit=1,  int isover = 0)
5022
           int isvisit=1,  int isover = 0)
4796
         {
5023
         {
4864
                     }
5091
                     }
4865
                     if (model != null)
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
                         if (res)
5095
                         if (res)
4869
                             return Success("处理成功");
5096
                             return Success("处理成功");
4870
                         else
5097
                         else
4968
                 if (ua != null)
5195
                 if (ua != null)
4969
                 {
5196
                 {
4970
                     Model.T_Wo_WorkOrder model = workOrder .GetModel(orderid);
5197
                     Model.T_Wo_WorkOrder model = workOrder .GetModel(orderid);
4971
-                    //验证信息
5198
+                    //验证信息 
4972
                     if (model != null)
5199
                     if (model != null)
4973
                     {
5200
                     {
4974
                         var res = BackWO(ua, model, cont, type);
5201
                         var res = BackWO(ua, model, cont, type);
4988
         /// <param name="input"></param>
5215
         /// <param name="input"></param>
4989
         /// <returns></returns>
5216
         /// <returns></returns>
4990
         [Authority]
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
             int userId = CurrentUser.UserData.F_UserId;
5220
             int userId = CurrentUser.UserData.F_UserId;
4994
             if (userId != 0)
5221
             if (userId != 0)
5000
                     //验证信息
5227
                     //验证信息
5001
                     if (model != null)
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
                         if (res)
5231
                         if (res)
5005
                             return Success("回访成功");
5232
                             return Success("回访成功");
5006
                         else
5233
                         else
5278
         /// <summary>
5505
         /// <summary>
5279
         /// 回访工单
5506
         /// 回访工单
5280
         /// </summary>
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
             #region 工单处理
5510
             #region 工单处理
5284
             int  sms = 0;
5511
             int  sms = 0;
5338
                 model.F_VisitReason = reason;
5565
                 model.F_VisitReason = reason;
5339
                 model.F_Callresults = call ;
5566
                 model.F_Callresults = call ;
5340
                 model.F_Sid  = sid;
5567
                 model.F_Sid  = sid;
5568
+                model.F_VisitRemarks = F_VisitRemarks;
5341
                 workOrder.Update(model);
5569
                 workOrder.Update(model);
5342
                 #endregion
5570
                 #endregion
5343
                 #region 推送消息
5571
                 #region 推送消息
5425
         /// <summary>
5653
         /// <summary>
5426
         /// 处理工单
5654
         /// 处理工单
5427
         /// </summary>
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
             #region 工单处理
5658
             #region 工单处理
5431
            int   sms = 0;
5659
            int   sms = 0;
5476
             {
5704
             {
5477
                 #region 处理工单
5705
                 #region 处理工单
5478
                 model.F_State  = wostate;
5706
                 model.F_State  = wostate;
5479
-                model.F_DealType  = dealType;
5480
                 //处理内容
5707
                 //处理内容
5481
                 if (!string.IsNullOrEmpty(cont))
5708
                 if (!string.IsNullOrEmpty(cont))
5482
                     model.F_DealContent += cont + ";";
5709
                     model.F_DealContent += cont + ";";
5665
         /// <summary>
5892
         /// <summary>
5666
         /// 转派工单
5893
         /// 转派工单
5667
         /// </summary>
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
             string smscont = "";
5897
             string smscont = "";
5671
             if (model.F_Type == "1")
5898
             if (model.F_Type == "1")
5800
                 if (!string.IsNullOrEmpty(cont))
6027
                 if (!string.IsNullOrEmpty(cont))
5801
                     model.F_DealContent += cont + ";";
6028
                     model.F_DealContent += cont + ";";
5802
                 InToworkModel(model, input);
6029
                 InToworkModel(model, input);
6030
+                if (!string.IsNullOrEmpty(F_Files))
6031
+                    model.F_Files = F_Files;
5803
                 workOrder.Update(model);
6032
                 workOrder.Update(model);
5804
                 #endregion
6033
                 #endregion
5805
                 #region 推送消息
6034
                 #region 推送消息
5845
             string strmsg = string.Empty;
6074
             string strmsg = string.Empty;
5846
             strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
6075
             strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
5847
             Model.T_Msg_List msg = new Model.T_Msg_List();
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
             msg.ToUser = touser;
6078
             msg.ToUser = touser;
5850
             msg.ToID = toid;
6079
             msg.ToID = toid;
5851
             msg.Detail = strmsg;
6080
             msg.Detail = strmsg;

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

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

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

149
         [Description("公告通知")]
149
         [Description("公告通知")]
150
         notice = 5,
150
         notice = 5,
151
         [Description("客户公告通知")]
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
         private int  _f_smsreply;
101
         private int  _f_smsreply;
102
         private string  _f_sid;
102
         private string  _f_sid;
103
         private string _f_visitremarks;
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
         /// <summary>
110
         /// <summary>
105
         /// 回访备注
111
         /// 回访备注
106
         /// </summary>
112
         /// </summary>