Przeglądaj źródła

微信高层审批修改,值班电话修改,增加客户渠道,短信sdk,通话记录,历史记录增加客户姓名,编号登录

duhongyu 6 lat temu
rodzic
commit
63c072e9f1

+ 14 - 1
codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_UserAccount.cs

89
             return dal.GetModel(F_UserCode);
89
             return dal.GetModel(F_UserCode);
90
         }
90
         }
91
         /// <summary>
91
         /// <summary>
92
+        /// 得到一个对象实体
93
+        /// </summary>
94
+        public Model.T_Sys_UserAccount GetworkModel(string F_WorkNumber)
95
+        {
96
+            return dal.GetworkModel(F_WorkNumber);
97
+        }
98
+        /// <summary>
92
         /// 根据Openid 获取用户
99
         /// 根据Openid 获取用户
93
         /// </summary>
100
         /// </summary>
94
         /// <param name="openid"></param>
101
         /// <param name="openid"></param>
101
         /// <summary>
108
         /// <summary>
102
         /// 登录得到一个对象实体
109
         /// 登录得到一个对象实体
103
         /// </summary>
110
         /// </summary>
111
+        public Model.T_Sys_UserAccount LogworkGetModel(string F_WorkNumber, string F_Password)
112
+        {
113
+            return dal.LogworkGetModel(F_WorkNumber, F_Password);
114
+        }
115
+        /// <summary>
116
+        /// 登录得到一个对象实体
117
+        /// </summary>
104
         public Model.T_Sys_UserAccount LoginGetModel(string F_UserCode, string F_Password)
118
         public Model.T_Sys_UserAccount LoginGetModel(string F_UserCode, string F_Password)
105
         {
119
         {
106
             return dal.LoginGetModel(F_UserCode, F_Password);
120
             return dal.LoginGetModel(F_UserCode, F_Password);
107
         }
121
         }
108
-
109
         ///// <summary>
122
         ///// <summary>
110
         ///// 得到一个对象实体,从缓存中
123
         ///// 得到一个对象实体,从缓存中
111
         ///// </summary>
124
         ///// </summary>

+ 50 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_UserAccount.cs

314
                 return false;
314
                 return false;
315
             }
315
             }
316
         }
316
         }
317
+        /// <summary>
318
+        /// 登录得到一个对象实体
319
+        /// </summary>
320
+        public Model.T_Sys_UserAccount LogworkGetModel(string F_WorkNumber, string F_Password)
321
+        {
322
+
323
+            StringBuilder strSql = new StringBuilder();
324
+            strSql.Append("select  top 1 F_UserId,F_UserCode,F_Password,F_ExtensionNumber,F_UserName,F_DeptId,F_RoleId,F_GroupId,F_SeatFlag,F_SeatRight,F_SeatLevel,F_SexFlag,F_RemindFlag,F_Remark,F_Telephone,F_Mobile,F_HomePhone,F_Birthday,F_CreateOn,F_CancelOn,F_DeleteFlag,F_APPOnFlag,F_LastActiveTime,F_See,F_HJType,F_PId,F_TmId,F_WorkNumber,F_DeptCode,F_WXNo,F_SeartGroupID,F_SeartGroup,F_WxOpenId,RegionId from T_Sys_UserAccount ");
325
+            strSql.Append(" where F_WorkNumber=@F_WorkNumber and F_Password=@F_Password and  F_DeleteFlag=0");
326
+            SqlParameter[] parameters = {
327
+                    new SqlParameter("@F_WorkNumber", SqlDbType.VarChar,50),
328
+                    new SqlParameter("@F_Password", SqlDbType.VarChar,50)
329
+            };
330
+            parameters[0].Value = F_WorkNumber;
331
+            parameters[1].Value = F_Password;
317
 
332
 
333
+            Model.T_Sys_UserAccount model = new Model.T_Sys_UserAccount();
334
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
335
+            if (ds.Tables[0].Rows.Count > 0)
336
+            {
337
+                return DataRowToModel(ds.Tables[0].Rows[0]);
338
+            }
339
+            else
340
+            {
341
+                return null;
342
+            }
343
+        }
318
         /// <summary>
344
         /// <summary>
319
         /// 登录得到一个对象实体
345
         /// 登录得到一个对象实体
320
         /// </summary>
346
         /// </summary>
342
                 return null;
368
                 return null;
343
             }
369
             }
344
         }
370
         }
371
+        /// <summary>
372
+        /// 得到一个对象实体
373
+        /// </summary>
374
+        public Model.T_Sys_UserAccount GetworkModel(string F_WorkNumber)
375
+        {
345
 
376
 
377
+            StringBuilder strSql = new StringBuilder();
378
+            strSql.Append("select  top 1 F_UserId,F_UserCode,F_Password,F_ExtensionNumber,F_UserName,F_DeptId,F_RoleId,F_GroupId,F_SeatFlag,F_SeatRight,F_SeatLevel,F_SexFlag,F_RemindFlag,F_Remark,F_Telephone,F_Mobile,F_HomePhone,F_Birthday,F_CreateOn,F_CancelOn,F_DeleteFlag,F_APPOnFlag,F_LastActiveTime,F_See,F_HJType,F_PId,F_TmId,F_WorkNumber,F_DeptCode,F_WXNo,F_SeartGroupID,F_SeartGroup,F_WxOpenId,RegionId from T_Sys_UserAccount ");
379
+            strSql.Append(" where F_WorkNumber=@F_WorkNumber");
380
+            SqlParameter[] parameters = {
381
+                    new SqlParameter("@F_WorkNumber", SqlDbType.VarChar,50)
382
+            };
383
+            parameters[0].Value = F_WorkNumber;
384
+
385
+            Model.T_Sys_UserAccount model = new Model.T_Sys_UserAccount();
386
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
387
+            if (ds.Tables[0].Rows.Count > 0)
388
+            {
389
+                return DataRowToModel(ds.Tables[0].Rows[0]);
390
+            }
391
+            else
392
+            {
393
+                return null;
394
+            }
395
+        }
346
         /// <summary>
396
         /// <summary>
347
         /// 得到一个对象实体
397
         /// 得到一个对象实体
348
         /// </summary>
398
         /// </summary>

Plik diff jest za duży
+ 14 - 5
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs


+ 8 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/LoginController.cs

34
                     return Error("账号不能为空!");
34
                     return Error("账号不能为空!");
35
                 if (string.IsNullOrEmpty(login.Password))
35
                 if (string.IsNullOrEmpty(login.Password))
36
                     return Error("密码不能为空!");
36
                     return Error("密码不能为空!");
37
-                Model.T_Sys_UserAccount loginUser = new BLL.T_Sys_UserAccount().LoginGetModel(login.Username, login.Password);
38
-
39
-                if (loginUser != null)
37
+                Model.T_Sys_UserAccount loginCode = new BLL.T_Sys_UserAccount().LoginGetModel(login.Username, login.Password);
38
+                Model.T_Sys_UserAccount loginwork = new BLL.T_Sys_UserAccount().LogworkGetModel(login.Username, login.Password);
39
+                if (loginCode != null|| loginwork != null )
40
                 {
40
                 {
41
+                    Model.T_Sys_UserAccount loginUser = null;
41
                     string deptcode = "";
42
                     string deptcode = "";
43
+                    if (loginCode != null)
44
+                     loginUser = loginCode;
45
+                    else
46
+                        loginUser = loginwork;
42
                     Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(loginUser.F_DeptId);
47
                     Model.T_Sys_Department deptModel = new BLL.T_Sys_Department().GetModel(loginUser.F_DeptId);
43
                     if (deptModel != null)
48
                     if (deptModel != null)
44
                     {
49
                     {
77
                     {
82
                     {
78
                         token = token
83
                         token = token
79
                     });
84
                     });
80
-
81
-
82
-
83
-
84
                 }
85
                 }
85
                 else
86
                 else
86
                 {
87
                 {

Plik diff jest za duży
+ 1026 - 886
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs


+ 27 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

164
             }
164
             }
165
             return res;
165
             return res;
166
         }
166
         }
167
+        public int   Getcode()
168
+        {
169
+         
170
+                int UserCode = 0;
171
+                string strSql = "select Max(F_UserCode) F_UserCode from T_Sys_UserAccount ";
172
+                object ob = DbHelperSQL.GetSingle(strSql.ToString());
173
+                if (ob == null)
174
+                {
175
+                    UserCode = 0;
176
+                }
177
+                else
178
+                {
179
+                    UserCode = Convert.ToInt32(ob);
180
+                }
181
+            return UserCode + 1;
182
+               
183
+        }
167
         //[Authority]
184
         //[Authority]
168
         //获取用户信息
185
         //获取用户信息
169
         public ActionResult GetUser(int userId = 0, string userCode = "")
186
         public ActionResult GetUser(int userId = 0, string userCode = "")
237
 
254
 
238
                 Model.T_Sys_UserAccount userAccountModel = new Model.T_Sys_UserAccount();
255
                 Model.T_Sys_UserAccount userAccountModel = new Model.T_Sys_UserAccount();
239
                 //员工工号不能重复
256
                 //员工工号不能重复
240
-                string ucode = input.Usercode.Trim();
257
+                string ucode = input.WorkNumber.Trim();
241
                 if (!string.IsNullOrEmpty(ucode))
258
                 if (!string.IsNullOrEmpty(ucode))
242
                 {
259
                 {
243
-                    Model.T_Sys_UserAccount uModel = new BLL.T_Sys_UserAccount().GetModel(ucode);
260
+                    Model.T_Sys_UserAccount uModel = new BLL.T_Sys_UserAccount().GetworkModel(ucode);
244
                     if (uModel != null)
261
                     if (uModel != null)
245
                     {
262
                     {
246
-                        return Error("不能重复添加号");
263
+                        return Error("不能重复添加号");
247
                     }
264
                     }
248
                     else
265
                     else
249
                     {
266
                     {
250
-                        userAccountModel.F_UserCode = ucode;
267
+                      userAccountModel.F_UserCode = Getcode().ToString ();
251
                         userAccountModel.F_WorkNumber = ucode;
268
                         userAccountModel.F_WorkNumber = ucode;
252
                     }
269
                     }
253
                 }
270
                 }
342
                 string ucode = input.Usercode.Trim();
359
                 string ucode = input.Usercode.Trim();
343
                 if (!string.IsNullOrEmpty(ucode))
360
                 if (!string.IsNullOrEmpty(ucode))
344
                 {
361
                 {
345
-                    var uModels = new BLL.T_Sys_UserAccount().GetModelList(" F_UserCode='" + ucode + "'");
346
-                    if (uModels.Count() > 1)
362
+                    Model.T_Sys_UserAccount uModel = new BLL.T_Sys_UserAccount().GetModel(ucode);
363
+                    if (uModel==null )
347
                     {
364
                     {
348
-                        return Error("不能重复添加工号");
365
+                        return Error("查找不到该用户");
349
                     }
366
                     }
350
                     else
367
                     else
351
                     {
368
                     {
352
-                        userAccountModel.F_UserCode = ucode;
353
-                        userAccountModel.F_WorkNumber = ucode;
369
+                       userAccountModel.F_UserCode  = ucode;
354
                     }
370
                     }
355
                 }
371
                 }
372
+                if (!string .IsNullOrEmpty (input.WorkNumber))
373
+                    userAccountModel.F_WorkNumber  = input.WorkNumber.Trim ();
356
                 if (input.Username != null)
374
                 if (input.Username != null)
357
                     userAccountModel.F_UserName = input.Username.Trim();
375
                     userAccountModel.F_UserName = input.Username.Trim();
358
                 if (input.Password != null)
376
                 if (input.Password != null)

+ 3 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

324
                             pageindex,
324
                             pageindex,
325
                             true,
325
                             true,
326
                             out recordCount);
326
                             out recordCount);
327
+                        dt.Columns.Add("CusName");
327
                         var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
328
                         var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
328
                         foreach (DataRow dr in dt.Rows)
329
                         foreach (DataRow dr in dt.Rows)
329
                         {
330
                         {
337
                                 }
338
                                 }
338
                                 dr["FilePath"] = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
339
                                 dr["FilePath"] = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
339
                             }
340
                             }
341
+                            dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList($" ( F_CompanyName like '%" + dr["CallNumber"] + "%' or F_CustomerCode like '%" + dr["CallNumber"] + "%' ) ");
340
                         }
342
                         }
341
 
343
 
342
                         int hrcount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=0 " + sqlcount);
344
                         int hrcount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=0 " + sqlcount);
343
                         int hccount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=1 " + sqlcount);
345
                         int hccount = new BLL.T_Call_CallRecords().GetRecordCount(" calltype=1 " + sqlcount);
344
-
346
+                        
345
                         var obj = new
347
                         var obj = new
346
                         {
348
                         {
347
                             state = "success",
349
                             state = "success",

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallOutScreenController.cs

27
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
27
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
28
                     if (ua != null)
28
                     if (ua != null)
29
                     {
29
                     {
30
-                        string sql = " and UserCode='" + ua.F_WorkNumber + "'";
30
+                        string sql = " and UserCode='" + ua.F_UserCode  + "'";
31
                         DataTable dt = new DataTable();
31
                         DataTable dt = new DataTable();
32
 
32
 
33
                         string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
33
                         string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

193
                             dr["UserName"] = uu.F_UserName;
193
                             dr["UserName"] = uu.F_UserName;
194
                     }
194
                     }
195
                 }
195
                 }
196
-
197
-                //dr["CusName"] = new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "' and F_DeleteFlag=0").FirstOrDefault() == null ? "" : new BLL.T_Cus_CustomerBase().GetModelList("F_Telephone='" + dr["CallNumber"] + "'").FirstOrDefault().F_CustomerName;
196
+                dr["CusName"] = new BLL.T_Cus_CustomerBaseNew().GetModelList($" ( F_CompanyName like '%" + dr["CallNumber"] + "%' or F_CustomerCode like '%" + dr["CallNumber"] + "%' ) ")
197
+                  .FirstOrDefault().F_Legal;
198
             }
198
             }
199
 
199
 
200
             var obj = new
200
             var obj = new

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/DutyPhoneController.cs

130
                         dModel.F_Remark = des.Trim();
130
                         dModel.F_Remark = des.Trim();
131
                         var gid = int.Parse(groupid.Trim());
131
                         var gid = int.Parse(groupid.Trim());
132
                         dModel.F_Groupid = gid;
132
                         dModel.F_Groupid = gid;
133
-                        var gname = new BLL.T_Sys_SeatGroup().GetModel(gid) == null ? "" : new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZName;
133
+                        var gname = new BLL.T_Sys_SeatGroup().GetModel(gid) == null ? "" : new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZCode ;
134
                         dModel.F_GroupName = gname;
134
                         dModel.F_GroupName = gname;
135
 
135
 
136
                         bool b = dBLL.Update(dModel);
136
                         bool b = dBLL.Update(dModel);
155
                     dModel.F_CreateTime = DateTime.Now;
155
                     dModel.F_CreateTime = DateTime.Now;
156
                     var gid = int.Parse(groupid.Trim());
156
                     var gid = int.Parse(groupid.Trim());
157
                     dModel.F_Groupid = gid;
157
                     dModel.F_Groupid = gid;
158
-                    var gname = new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZName;
158
+                    var gname = new BLL.T_Sys_SeatGroup().GetModel(gid).F_ZXZCode;
159
                     dModel.F_GroupName = gname;
159
                     dModel.F_GroupName = gname;
160
 
160
 
161
                     int b = new BLL.T_Call_ZBDH().Add(dModel);
161
                     int b = new BLL.T_Call_ZBDH().Add(dModel);

+ 65 - 38
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

73
                 customerBaseBLL.Update(modelcustomer);
73
                 customerBaseBLL.Update(modelcustomer);
74
             }
74
             }
75
             #endregion
75
             #endregion
76
-          
77
-                Dictionary<string, string> paras = new Dictionary<string, string>();
78
-                string sql = " select * from T_Sys_UserAccount (NOLOCK) where F_UserCode=@F_UserCode and F_PassWord=@F_PassWord and F_DeleteFlag = 0 ";
79
-                paras.Add("@F_UserCode", login.UserCode);
80
-                paras.Add("@F_PassWord", login.Password);
81
-                var dt = DbHelperSQL.Query(sql, paras).Tables[0];
82
 
76
 
83
-                if (dt != null && dt.Rows.Count > 0)
84
-                {
85
-                    //var user = userAccountBLL.GetModel(login.UserCode);   //20180926 次方法查询有漏洞
86
-                    var user = userAccountBLL.DataTableToList(dt).ToList().FirstOrDefault();
87
-                    user.F_WxOpenId = login.OpenId;
77
+            if (string.IsNullOrEmpty(login.UserCode))
78
+                return Error("账号不能为空!");
79
+            if (string.IsNullOrEmpty(login.Password))
80
+                return Error("密码不能为空!");
81
+            Model.T_Sys_UserAccount loginCode = new BLL.T_Sys_UserAccount().LoginGetModel(login.UserCode, login.Password);
82
+            Model.T_Sys_UserAccount loginwork = new BLL.T_Sys_UserAccount().LogworkGetModel(login.UserCode, login.Password);
83
+            if (loginCode != null || loginwork != null)
84
+            {
85
+                Model.T_Sys_UserAccount loginUser = null;
86
+                string deptcode = "";
87
+                if (loginCode != null)
88
+                    loginUser = loginCode;
89
+                else
90
+                    loginUser = loginwork;
91
+                loginUser.F_WxOpenId = login.OpenId;
88
                     int UserType = 0;string rolecode = "";
92
                     int UserType = 0;string rolecode = "";
89
 
93
 
90
                     //部门
94
                     //部门
91
-                    Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(user.F_DeptId);
95
+                    Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(loginUser.F_DeptId);
92
                     if (modelDep == null)
96
                     if (modelDep == null)
93
                         return Error("获取失败!");
97
                         return Error("获取失败!");
94
                     #region 读取角色code
98
                     #region 读取角色code
95
-                    var rolemodel = roleBLL.GetModel(user.F_RoleId);
99
+                    var rolemodel = roleBLL.GetModel(loginUser.F_RoleId);
96
                     if (rolemodel != null)
100
                     if (rolemodel != null)
97
                         rolecode = rolemodel.F_RoleCode;
101
                         rolecode = rolemodel.F_RoleCode;
98
                     #endregion
102
                     #endregion
99
                         #region 部门角色
103
                         #region 部门角色
100
                         //部门角色(-1管理员,1接待部,2案场经理、项目负责人,3销售部总经理、物业部总经理、工程总经理、设计总经理,4区域客服,5业主(客户档案))
104
                         //部门角色(-1管理员,1接待部,2案场经理、项目负责人,3销售部总经理、物业部总经理、工程总经理、设计总经理,4区域客服,5业主(客户档案))
101
-                    if (user.F_RoleId == 17 )
105
+                    if (loginUser.F_RoleId == 17 )
102
                     {
106
                     {
103
                     //-1管理员
107
                     //-1管理员
104
                     return Error("无操作权限");
108
                     return Error("无操作权限");
105
                 }
109
                 }
106
                     else
110
                     else
107
                     {
111
                     {
108
-                        if ( user.F_RoleId == 60 || user.F_RoleId == 62)
112
+                        if (loginUser.F_RoleId == 60 || loginUser.F_RoleId == 62)
109
                         {
113
                         {
110
                             UserType = 0;
114
                             UserType = 0;
111
                         }
115
                         }
112
-                        else if (user.F_RoleId == 61)
116
+                        else if (loginUser.F_RoleId == 61)
113
                         {
117
                         {
114
                             UserType = 2;
118
                             UserType = 2;
115
                         }
119
                         }
116
-                        else if (user.F_RoleId == 58)
120
+                        else if (loginUser.F_RoleId == 58)
117
                         {
121
                         {
118
                             UserType = 4;
122
                             UserType = 4;
119
                         }
123
                         }
120
-                        else if (user.F_RoleId == 59)
124
+                        else if (loginUser.F_RoleId == 59)
121
                         {
125
                         {
122
                             UserType = 3;
126
                             UserType = 3;
123
                         }
127
                         }
163
                         rolecode=rolecode,
167
                         rolecode=rolecode,
164
                     };
168
                     };
165
 
169
 
166
-                     if (userAccountBLL.Update(user))
170
+                     if (userAccountBLL.Update(loginUser))
167
                         return Success("绑定成功", obj);
171
                         return Success("绑定成功", obj);
168
                     else
172
                     else
169
                         return Error("绑定失败");
173
                         return Error("绑定失败");
566
                     sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
570
                     sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
567
                 if (!string.IsNullOrWhiteSpace(province))//乡
571
                 if (!string.IsNullOrWhiteSpace(province))//乡
568
                     sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
572
                     sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
573
+             
569
              //   sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
574
              //   sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
570
              if (ua !=null )
575
              if (ua !=null )
571
                 {
576
                 {
572
                     Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
577
                     Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
573
-                    switch (state)
578
+                    if (source==3)
579
+                    {
580
+                        sql += $" and F_WxOpenId ='" + OpenId + "'";
581
+                    }
582
+                        switch (state)
574
                     {
583
                     {
575
                         case 0://待审批
584
                         case 0://待审批
576
                             string uwhere = "";
585
                             string uwhere = "";
651
                         case 4://待完成的(待处理)
660
                         case 4://待完成的(待处理)
652
                             if (GetDWCWorkOrderID(ua.F_UserCode) != null)
661
                             if (GetDWCWorkOrderID(ua.F_UserCode) != null)
653
                             {
662
                             {
654
-                                sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
663
+                                sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.reassign + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
655
                             }
664
                             }
656
                             else
665
                             else
657
                             {
666
                             {
1048
         public string GetHApproval(string user)
1057
         public string GetHApproval(string user)
1049
         {
1058
         {
1050
             string str = string.Empty;
1059
             string str = string.Empty;
1051
-            str = "select F_WoID from T_Wo_WorkOrderItem_New where isnull(F_IsUsed,'0')='0' and F_ItemType=" + (int)EnumItemType.audit + " and  F_OptType=" + (int)EnumItemOpt.audit + "and F_NextUser= '" + user + "'"+ "and F_IsUsed=2"; ;
1060
+            str = "select F_WoID from T_Wo_WorkOrderItem_New where   F_ItemType=" + (int)EnumItemType.audit + " and  F_OptType=" + (int)EnumItemOpt.audit + "and F_NextUser= '" + user + "'" + "and F_IsUsed=2";
1052
             return str;
1061
             return str;
1053
         }
1062
         }
1054
         /// <summary>
1063
         /// <summary>
1428
 
1437
 
1429
             string str = string.Empty;
1438
             string str = string.Empty;
1430
             #region 查询自己名下未审批的工单列表
1439
             #region 查询自己名下未审批的工单列表
1431
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit +","+(int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback + ")"+ " and "
1432
-                    + "F_WoState in("  + (int)EnumWorkOrderState.audit + ","+(int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser='" + ua.F_UserCode  + "' "
1440
+            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + ")"+ " and "
1441
+                    + "F_WoState in("  + (int)EnumWorkOrderState.audit + ") and F_NextUser='" + ua.F_UserCode  + "' "
1433
                 + "" + " ");
1442
                 + "" + " ");
1434
 
1443
 
1435
             foreach (var it in itemlast)
1444
             foreach (var it in itemlast)
1484
             {
1493
             {
1485
                 if (!string .IsNullOrEmpty (GetDeptment(ua)))
1494
                 if (!string .IsNullOrEmpty (GetDeptment(ua)))
1486
                 {
1495
                 {
1487
-                    var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + "," + (int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback + ")" + " and "
1488
-                                      + "F_WoState in(" + (int)EnumWorkOrderState.audit + "," + (int)EnumWorkOrderState.neworder + (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser in ( " + GetDeptment(ua) + ") ");
1496
+                    var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit+ ")" + " and "
1497
+                                      + "F_WoState in(" + (int)EnumWorkOrderState.audit + ") and F_NextUser in ( " + GetDeptment(ua) + ") ");
1489
                                        foreach (var it in itemlasts)
1498
                                        foreach (var it in itemlasts)
1490
                     {
1499
                     {
1491
                         float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
1500
                         float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
1592
                                     model.F_BranchName = pdModel1.F_DeptName;
1601
                                     model.F_BranchName = pdModel1.F_DeptName;
1593
                                 }
1602
                                 }
1594
                             }
1603
                             }
1604
+                            model.F_CompanyName = cuModel.F_CompanyName;//公司名称
1595
                             model.F_CustomerID = cuModel.F_CustomerCode;//客户编码
1605
                             model.F_CustomerID = cuModel.F_CustomerCode;//客户编码
1596
                             model.F_Salesman = cuModel.F_Salesman;
1606
                             model.F_Salesman = cuModel.F_Salesman;
1597
                             model.F_SalesPhone = cuModel.F_SalesPhone;
1607
                             model.F_SalesPhone = cuModel.F_SalesPhone;
1720
                     }
1730
                     }
1721
                     else if (model1[i].F_State == 14)
1731
                     else if (model1[i].F_State == 14)
1722
                     {
1732
                     {
1723
-                        model.F_StateName = "待审批";
1733
+                        model.F_StateName = "待办理";
1724
                     }
1734
                     }
1725
                     else if (model1[i].F_State == 15)
1735
                     else if (model1[i].F_State == 15)
1726
                     {
1736
                     {
1728
                     }
1738
                     }
1729
                     else if (model1[i].F_State == 16)
1739
                     else if (model1[i].F_State == 16)
1730
                     {
1740
                     {
1731
-                        model.F_StateName = "待审批";
1741
+                        model.F_StateName = "待办理";
1732
                     }
1742
                     }
1733
                     #endregion
1743
                     #endregion
1734
                     model.F_CusName = model1[i].F_CusName;//客户姓名
1744
                     model.F_CusName = model1[i].F_CusName;//客户姓名
1735
                     model.F_CusPhone = model1[i].F_CusPhone;//客户电话
1745
                     model.F_CusPhone = model1[i].F_CusPhone;//客户电话
1736
-                    model.F_CompanyName = model1[i].F_CompanyName;//公司名称
1746
+                    model.F_Canal = model1[i].F_Canal;//
1737
                     model.F_IncidentProvince = model1[i].F_IncidentProvince;//事发地-省
1747
                     model.F_IncidentProvince = model1[i].F_IncidentProvince;//事发地-省
1738
                     model.F_IncidentCity = model1[i].F_IncidentCity;//事发地-市
1748
                     model.F_IncidentCity = model1[i].F_IncidentCity;//事发地-市
1739
                     model.F_IncidentCountry = model1[i].F_IncidentCountry;//事发地-县
1749
                     model.F_IncidentCountry = model1[i].F_IncidentCountry;//事发地-县
1807
                     model.F_ZL_ImprovementRequirements = model1[i].F_ZL_ImprovementRequirements;//质量管理科-改进要求
1817
                     model.F_ZL_ImprovementRequirements = model1[i].F_ZL_ImprovementRequirements;//质量管理科-改进要求
1808
                     model.F_ZL_CApprovalNo = model1[i].F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
1818
                     model.F_ZL_CApprovalNo = model1[i].F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
1809
                     model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
1819
                     model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
1810
-                    model.F_IsVisit = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
1820
+                    if (model1[i].F_IsVisit!=0)
1821
+                    {
1822
+                        model.F_IsVisit = "是";//是否回访
1823
+                    }
1824
+                    else
1825
+                    {
1826
+                        model.F_IsVisit = "否";//是否回访
1827
+                    }
1828
+                 
1811
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1829
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1812
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1830
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1813
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
1831
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
2386
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
2404
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
2387
             model.F_Files = "0";//附件上传ids
2405
             model.F_Files = "0";//附件上传ids
2388
             model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2406
             model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2407
+            model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
2389
             #endregion
2408
             #endregion
2390
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2409
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2391
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2410
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2678
                 model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
2697
                 model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
2679
             if (input.F_IsVisit != null)
2698
             if (input.F_IsVisit != null)
2680
             {
2699
             {
2681
-                model.F_IsVisit = input.F_IsVisit;
2700
+                try
2701
+                {
2702
+                    model.F_IsVisit = int.Parse(input.F_IsVisit);
2703
+                }
2704
+                catch
2705
+                {
2706
+                    model.F_IsVisit =1;
2707
+                }
2708
+               
2682
             }
2709
             }
2683
             return model;
2710
             return model;
2684
         }
2711
         }
2727
                                     }
2754
                                     }
2728
                                     else if (deptmodel.F_DeptId == 12)
2755
                                     else if (deptmodel.F_DeptId == 12)
2729
                                     {
2756
                                     {
2730
-                                        input.F_IsVisit = isvisit;
2757
+                                        input.F_IsVisit = isvisit.ToString ();
2731
                                         input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
2758
                                         input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
2732
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2759
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2733
                                         input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
2760
                                         input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
2755
                                     }
2782
                                     }
2756
                                     else if (deptmodel.F_DeptId == 12)
2783
                                     else if (deptmodel.F_DeptId == 12)
2757
                                     {
2784
                                     {
2758
-                                        input.F_IsVisit = isvisit;
2785
+                                        input.F_IsVisit = isvisit.ToString ();
2759
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2786
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
2760
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2787
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
2761
                                     }
2788
                                     }
3323
                                 }
3350
                                 }
3324
                                 else if (deptmodel.F_DeptId == 12)
3351
                                 else if (deptmodel.F_DeptId == 12)
3325
                                 {
3352
                                 {
3326
-                                    input.F_IsVisit = isvisit;
3353
+                                    input.F_IsVisit = isvisit.ToString ();
3327
                                     input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
3354
                                     input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
3328
                                     input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
3355
                                     input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
3329
                                     input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
3356
                                     input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
3346
                                 }
3373
                                 }
3347
                                 else if (deptmodel.F_DeptId == 12)
3374
                                 else if (deptmodel.F_DeptId == 12)
3348
                                 {
3375
                                 {
3349
-                                    input.F_IsVisit = isvisit;
3376
+                                    input.F_IsVisit = isvisit.ToString ();
3350
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
3377
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
3351
                                 }
3378
                                 }
3352
                             }
3379
                             }
3513
             var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
3540
             var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.F_ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
3514
             if (itemlast != null)
3541
             if (itemlast != null)
3515
                 touser = itemlast.F_CreateUser;
3542
                 touser = itemlast.F_CreateUser;
3516
-            var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.deal, optbut, touser, 0, nowUser, limit + model .F_limit , sms);
3543
+            var itemid = AddLog((int)model.F_ID, wostate, content, (int)EnumItemType.Delay, optbut, touser, 0, nowUser, limit + model .F_limit , sms,"", 1);
3517
 
3544
 
3518
             #endregion
3545
             #endregion
3519
 
3546
 
3624
             }
3651
             }
3625
             var opt = "处理";
3652
             var opt = "处理";
3626
             int optbut = (int)EnumItemOpt.deal;
3653
             int optbut = (int)EnumItemOpt.deal;
3627
-            int wostate = (int)EnumWorkOrderState.dealing;
3654
+            int wostate = (int)EnumWorkOrderState.receive;
3628
 
3655
 
3629
             if (isover == 1)
3656
             if (isover == 1)
3630
             {
3657
             {
3808
                 var model = woBLL.GetModel(input.F_ID);
3835
                 var model = woBLL.GetModel(input.F_ID);
3809
                 if (model ==null )
3836
                 if (model ==null )
3810
                     return Error("查询不到此工单!");
3837
                     return Error("查询不到此工单!");
3811
-                if(model .F_State !=3)
3838
+                if(model .F_State !=3&& model.F_State != 12)
3812
                 {
3839
                 {
3813
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3840
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3814
                     if (itemlast .Count >0)
3841
                     if (itemlast .Count >0)

+ 42 - 31
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

161
                     case 2://待完成的(待处理)
161
                     case 2://待完成的(待处理)
162
                         if(GetDWCWorkOrderID(ua.F_UserCode)!=null )
162
                         if(GetDWCWorkOrderID(ua.F_UserCode)!=null )
163
                         {
163
                         {
164
-                            sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
164
+                            sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
165
                         }
165
                         }
166
                         else
166
                         else
167
                         {
167
                         {
540
                             sql += $"  F_IsDelete=0";
540
                             sql += $"  F_IsDelete=0";
541
                             if (GetDWCWorkOrderID(ua.F_UserCode) != null)
541
                             if (GetDWCWorkOrderID(ua.F_UserCode) != null)
542
                             {
542
                             {
543
-                                sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
543
+                                sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + ") and T_Wo_WorkOrder.F_ID in ( " + GetDWCWorkOrderID(ua.F_UserCode) + ") ";
544
                             }
544
                             }
545
                             else
545
                             else
546
                             {
546
                             {
1122
 
1122
 
1123
             string str = string.Empty;
1123
             string str = string.Empty;
1124
             #region 查询自己名下未审批的工单列表
1124
             #region 查询自己名下未审批的工单列表
1125
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + "," + (int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback + ")" + " and "
1126
-                    + "F_WoState in(" + (int)EnumWorkOrderState.audit + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser='" + ua.F_UserCode + "' "
1125
+            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + ")" + " and "
1126
+                    + "F_WoState in(" + (int)EnumWorkOrderState.audit + ") and F_NextUser='" + ua.F_UserCode + "' "
1127
                 + "" + " ");
1127
                 + "" + " ");
1128
 
1128
 
1129
             foreach (var it in itemlast)
1129
             foreach (var it in itemlast)
1178
             {
1178
             {
1179
                 if (!string.IsNullOrEmpty(GetDeptment(ua)))
1179
                 if (!string.IsNullOrEmpty(GetDeptment(ua)))
1180
                 {
1180
                 {
1181
-                    var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit + "," + (int)EnumItemOpt.reback + "," + (int)EnumItemOpt.abreback + ")" + " and "
1182
-                                      + "F_WoState in(" + (int)EnumWorkOrderState.audit  + "," + (int)EnumWorkOrderState.reassign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and F_NextUser in ( " + GetDeptment(ua) + ") ");
1181
+                    var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType in(" + (int)EnumItemOpt.audit  + ")" + " and "
1182
+                                      + "F_WoState in(" + (int)EnumWorkOrderState.audit   + ") and F_NextUser in ( " + GetDeptment(ua) + ") ");
1183
                     foreach (var it in itemlasts)
1183
                     foreach (var it in itemlasts)
1184
                     {
1184
                     {
1185
                         float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
1185
                         float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
1566
                             drNew["详细地址"] = cuModel.F_AddressFull;
1566
                             drNew["详细地址"] = cuModel.F_AddressFull;
1567
                             drNew["产品"] = cuModel.F_Brands;
1567
                             drNew["产品"] = cuModel.F_Brands;
1568
                             drNew["渠道类型"] = cuModel.F_Channel;
1568
                             drNew["渠道类型"] = cuModel.F_Channel;
1569
+                            drNew["公司名称"] = cuModel.F_CompanyName ;
1569
                             drNew["是否经营心连心"] = cuModel.F_IsRunXLX;
1570
                             drNew["是否经营心连心"] = cuModel.F_IsRunXLX;
1570
                             drNew["年销量"] = cuModel.F_AnnualSales;
1571
                             drNew["年销量"] = cuModel.F_AnnualSales;
1571
                             drNew["配方"] = cuModel.F_Formula;
1572
                             drNew["配方"] = cuModel.F_Formula;
1677
                     #endregion
1678
                     #endregion
1678
                     drNew["客户姓名"] = it.F_CusName;//
1679
                     drNew["客户姓名"] = it.F_CusName;//
1679
                     drNew["客户电话"] = it.F_CusPhone;//
1680
                     drNew["客户电话"] = it.F_CusPhone;//
1680
-                    drNew["公司名称"] = it.F_CompanyName;//
1681
                     drNew["事发地-省"] = it.F_IncidentProvince;//
1681
                     drNew["事发地-省"] = it.F_IncidentProvince;//
1682
                     drNew["事发地-市"] = it.F_IncidentCity;//
1682
                     drNew["事发地-市"] = it.F_IncidentCity;//
1683
                     drNew["事发地-县"] = it.F_IncidentCountry;//
1683
                     drNew["事发地-县"] = it.F_IncidentCountry;//
3388
                 var model = workOrder.GetModel(input.F_ID);
3388
                 var model = workOrder.GetModel(input.F_ID);
3389
                 if (model == null)
3389
                 if (model == null)
3390
                     return Error("查询不到此工单!");
3390
                     return Error("查询不到此工单!");
3391
-                if (model.F_State != 3)
3391
+                if (model.F_State != 3 && model.F_State != 12)
3392
                 {
3392
                 {
3393
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3393
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
3394
                     if (itemlast.Count > 0)
3394
                     if (itemlast.Count > 0)
3546
                                 model.F_AddressTownship = cuModel.F_AddressTownship;
3546
                                 model.F_AddressTownship = cuModel.F_AddressTownship;
3547
                                 model.F_AddressFull = cuModel.F_AddressFull;
3547
                                 model.F_AddressFull = cuModel.F_AddressFull;
3548
                                 model.F_Brands = cuModel.F_Brands;
3548
                                 model.F_Brands = cuModel.F_Brands;
3549
-                                model.F_Channel = cuModel.F_Channel;
3550
-                                model.F_IsRunXLX = cuModel.F_IsRunXLX;
3549
+                                model.F_Channel = cuModel.F_Channel; 
3550
+                            model.F_Channel = cuModel.F_CompanyName ;
3551
+                            model.F_IsRunXLX = cuModel.F_IsRunXLX;
3551
                                 model.F_AnnualSales = cuModel.F_AnnualSales;
3552
                                 model.F_AnnualSales = cuModel.F_AnnualSales;
3552
                                 model.F_Formula = cuModel.F_Formula;
3553
                                 model.F_Formula = cuModel.F_Formula;
3553
                                 model.F_RaiseCrops = cuModel.F_RaiseCrops;
3554
                                 model.F_RaiseCrops = cuModel.F_RaiseCrops;
3672
                     }
3673
                     }
3673
                     else if (model1[i].F_State == 14)
3674
                     else if (model1[i].F_State == 14)
3674
                     {
3675
                     {
3675
-                        model.F_StateName = "待审批";
3676
+                        model.F_StateName = "待办理";
3676
                     }
3677
                     }
3677
                     else if (model1[i].F_State == 15)
3678
                     else if (model1[i].F_State == 15)
3678
                     {
3679
                     {
3680
                     }
3681
                     }
3681
                     else if (model1[i].F_State == 16)
3682
                     else if (model1[i].F_State == 16)
3682
                     {
3683
                     {
3683
-                        model.F_StateName = "待审批";
3684
+                        model.F_StateName = "待办理";
3684
                     }
3685
                     }
3685
                     #endregion
3686
                     #endregion
3686
                     model.F_CusName = model1[i].F_CusName;//客户姓名
3687
                     model.F_CusName = model1[i].F_CusName;//客户姓名
3687
                     model.F_CusPhone = model1[i].F_CusPhone;//客户电话
3688
                     model.F_CusPhone = model1[i].F_CusPhone;//客户电话
3688
-                    model.F_CompanyName = model1[i].F_CompanyName;//公司名称
3689
+               //     model.F_CompanyName = model1[i].F_CompanyName;//公司名称
3689
                     model.F_IncidentProvince = model1[i].F_IncidentProvince;//事发地-省
3690
                     model.F_IncidentProvince = model1[i].F_IncidentProvince;//事发地-省
3690
                     model.F_IncidentCity = model1[i].F_IncidentCity;//事发地-市
3691
                     model.F_IncidentCity = model1[i].F_IncidentCity;//事发地-市
3691
                     model.F_IncidentCountry = model1[i].F_IncidentCountry;//事发地-县
3692
                     model.F_IncidentCountry = model1[i].F_IncidentCountry;//事发地-县
3769
                     model.F_ZL_ImprovementRequirements = model1[i].F_ZL_ImprovementRequirements;//质量管理科-改进要求
3770
                     model.F_ZL_ImprovementRequirements = model1[i].F_ZL_ImprovementRequirements;//质量管理科-改进要求
3770
                     model.F_ZL_CApprovalNo = model1[i].F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
3771
                     model.F_ZL_CApprovalNo = model1[i].F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
3771
                     model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
3772
                     model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
3772
-                    model.F_IsVisit  = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
3773
+                    if (model1[i].F_IsVisit==1)
3774
+                    {
3775
+                        model.F_IsVisit ="是";//
3776
+                    }
3777
+                    else
3778
+                    {
3779
+                        model.F_IsVisit ="否";//
3780
+                    }
3773
                     model.RemainingTime = TimeToOver(model1[i].F_ID, model1[i].F_limit );
3781
                     model.RemainingTime = TimeToOver(model1[i].F_ID, model1[i].F_limit );
3774
-
3775
                     model.F_VisitOn = model1[i].F_VisitOn;//回访时间
3782
                     model.F_VisitOn = model1[i].F_VisitOn;//回访时间
3776
                     model.F_VisitBy = model1[i].F_VisitBy;//回访人
3783
                     model.F_VisitBy = model1[i].F_VisitBy;//回访人
3777
                     model.F_VisitResult = model1[i].F_VisitResult;//回访结果:非常满意、满意、一般、不满意
3784
                     model.F_VisitResult = model1[i].F_VisitResult;//回访结果:非常满意、满意、一般、不满意
3778
                     model.F_VisitReason = model1[i].F_VisitReason;// 回访不满意原因
3785
                     model.F_VisitReason = model1[i].F_VisitReason;// 回访不满意原因
3779
                     model.F_Callresults = model1[i].F_Callresults;//呼叫结果
3786
                     model.F_Callresults = model1[i].F_Callresults;//呼叫结果
3780
-
3781
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
3787
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
3782
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
3788
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
3783
-
3784
-                  
3785
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
3789
                     model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
3786
                     model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
3790
                     model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
3787
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
3791
                     if (!string .IsNullOrEmpty (model1[i].F_CreateBy))
3788
-
3789
                     {
3792
                     {
3790
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
3793
                         Model.T_Sys_UserAccount creatname = sysUserAccountBll.GetModel(model1[i].F_CreateBy);
3791
                         if (creatname!=null )
3794
                         if (creatname!=null )
3794
                         }
3797
                         }
3795
                      
3798
                      
3796
                     }
3799
                     }
3797
-                   
3798
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
3800
                     model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
3799
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
3801
                     model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
3800
                     if (model1[i].F_IsAudit!=0&& model1[i].F_IsAudit!=null )
3802
                     if (model1[i].F_IsAudit!=0&& model1[i].F_IsAudit!=null )
3816
                     {
3818
                     {
3817
                         model.F_AuditState = "";
3819
                         model.F_AuditState = "";
3818
                     }
3820
                     }
3819
-                  model .F_limit = model1[i].F_limit ;
3821
+                    model .F_Canal = model1[i].F_Canal;
3822
+                    model .F_limit = model1[i].F_limit ;
3820
                     model.F_AuditBy = model1[i].F_AuditBy;//审核人
3823
                     model.F_AuditBy = model1[i].F_AuditBy;//审核人
3821
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
3824
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
3822
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
3825
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
4135
                 }
4138
                 }
4136
             }
4139
             }
4137
             #endregion
4140
             #endregion
4138
-           
4141
+            model.F_Canal = input.F_Canal;//生产批次号
4139
             model.F_Type = input.F_Type.ToString();//工单类型:咨询及需求、投诉、抽检、其他(其它手动输入别的点选)
4142
             model.F_Type = input.F_Type.ToString();//工单类型:咨询及需求、投诉、抽检、其他(其它手动输入别的点选)
4140
             model.F_CusName = input.F_CusName;//客户姓名
4143
             model.F_CusName = input.F_CusName;//客户姓名
4141
             model.F_CusPhone = input.F_CusPhone;//客户电话
4144
             model.F_CusPhone = input.F_CusPhone;//客户电话
4366
                                         }
4369
                                         }
4367
                                         else if (deptmodel.F_DeptId == 12)
4370
                                         else if (deptmodel.F_DeptId == 12)
4368
                                         {
4371
                                         {
4369
-                                        inputs.F_IsVisit = isvisit;
4372
+                                        inputs.F_IsVisit = isvisit.ToString ();
4370
                                         inputs.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4373
                                         inputs.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4371
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4374
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4372
                                         inputs.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4375
                                         inputs.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4392
                                         }
4395
                                         }
4393
                                         else if (deptmodel.F_DeptId == 12)
4396
                                         else if (deptmodel.F_DeptId == 12)
4394
                                         {
4397
                                         {
4395
-                                        inputs.F_IsVisit = isvisit;
4396
-                                        inputs.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4398
+                                        inputs.F_IsVisit = isvisit.ToString();
4399
+                                    inputs.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4397
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4400
                                         inputs.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4398
                                         }
4401
                                         }
4399
                                     }
4402
                                     }
4604
                                     }
4607
                                     }
4605
                                     else if (deptmodel.F_DeptId  == 12)
4608
                                     else if (deptmodel.F_DeptId  == 12)
4606
                                     {
4609
                                     {
4607
-                                        input.F_IsVisit = isvisit;
4610
+                                        input.F_IsVisit = isvisit.ToString();
4608
                                         input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4611
                                         input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4609
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4612
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4610
                                         input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4613
                                         input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4632
                                     }
4635
                                     }
4633
                                     else if (deptmodel.F_DeptId == 12)
4636
                                     else if (deptmodel.F_DeptId == 12)
4634
                                     {
4637
                                     {
4635
-                                        input.F_IsVisit = isvisit;
4638
+                                        input.F_IsVisit = isvisit.ToString();
4636
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4639
                                         input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4637
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4640
                                         input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4638
                                     }
4641
                                     }
4786
                                 }
4789
                                 }
4787
                                 else if (deptmodel.F_DeptId ==12)
4790
                                 else if (deptmodel.F_DeptId ==12)
4788
                                 {
4791
                                 {
4789
-                                    input.F_IsVisit = isvisit;
4792
+                                    input.F_IsVisit = isvisit.ToString();
4790
                                     input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4793
                                     input.F_ZL_QualityEventLevel = deptment.QualityEventLevel;//质量管理科-质量事件等级(未遂、一般、较大、重大)
4791
                                     input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4794
                                     input.F_ZL_ClaimAmount = deptment.ClaimAmount;// 质量管理科-索赔金额(单位元,对应责任单位)
4792
                                     input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4795
                                     input.F_ZL_ResponsibleUnit = deptment.ResponsibleUnit;// 质量管理科-责任单位(需列出,可选多个)
4809
                                 }
4812
                                 }
4810
                                 else if (deptmodel.F_DeptId == 12)
4813
                                 else if (deptmodel.F_DeptId == 12)
4811
                                 {
4814
                                 {
4812
-                                    input.F_IsVisit = isvisit;
4815
+                                    input.F_IsVisit = isvisit.ToString();
4813
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4816
                                     input.F_ZL_CJ_IsRecord = deptment.IsRecord;//质量管理科-抽检-未备案、已备案
4814
                                 }
4817
                                 }
4815
                             }
4818
                             }
5389
             }
5392
             }
5390
             var opt = "处理";
5393
             var opt = "处理";
5391
             int optbut = (int)EnumItemOpt.deal;
5394
             int optbut = (int)EnumItemOpt.deal;
5392
-            int wostate = (int)EnumWorkOrderState.dealing;
5395
+            int wostate = (int)EnumWorkOrderState.receive;
5393
            
5396
            
5394
             if (isover == 1)
5397
             if (isover == 1)
5395
             {
5398
             {
5596
                 model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
5599
                 model.F_ZL_CJ_IsRecord = input.F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
5597
             if (input .F_IsVisit !=null )
5600
             if (input .F_IsVisit !=null )
5598
             {
5601
             {
5599
-                model.F_IsVisit = input.F_IsVisit;
5602
+                try
5603
+                {
5604
+                    model.F_IsVisit = int .Parse (input.F_IsVisit);
5605
+                }
5606
+                catch
5607
+                {
5608
+                    model.F_IsVisit =1;
5609
+                }
5610
+               
5600
             }
5611
             }
5601
             return model;
5612
             return model;
5602
         }
5613
         }

+ 8 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

648
         /// <summary>
648
         /// <summary>
649
         /// 是否建议回访(是,否)此项若选是,则流转到客服-待回访工单,若选否,则流转至客服待完结工单
649
         /// 是否建议回访(是,否)此项若选是,则流转到客服-待回访工单,若选否,则流转至客服待完结工单
650
         /// </summary>
650
         /// </summary>
651
-        public int? F_IsVisit
651
+        public string  F_IsVisit
652
         {
652
         {
653
             get; set;
653
             get; set;
654
         }
654
         }
793
         {
793
         {
794
             get; set;
794
             get; set;
795
         }
795
         }
796
+        ///// <summary>
797
+        ///// 客户渠道类型
798
+        ///// </summary>
799
+        public string  F_Canal
800
+        {
801
+            get; set;
802
+        }
796
     }
803
     }
797
 }
804
 }
798
 public class Questions
805
 public class Questions