duhongyu 4 anos atrás
pai
commit
603854c184

+ 58 - 4
codegit/CallCenterApi/CallCenterApi.DAL/Rotation.cs

@@ -4,12 +4,13 @@ using System.Collections.Generic;
4 4
 using System.Data;
5 5
 using System.Data.SqlClient;
6 6
 using System.Linq;
7
+using System.Reflection;
7 8
 using System.Text;
8 9
 using System.Threading.Tasks;
9 10
 
10 11
 namespace CallCenterApi.DAL
11 12
 {
12
-   public   class Rotation
13
+    public class Rotation
13 14
     {
14 15
         /// <summary>
15 16
         /// 增加一条图片
@@ -49,12 +50,16 @@ namespace CallCenterApi.DAL
49 50
         /// 查询图片信息
50 51
         /// </summary>
51 52
         /// <returns></returns>
52
-        public DataSet GetList()
53
+        public DataSet GetList(string name)
53 54
         {
54 55
             StringBuilder strSql = new StringBuilder();
55 56
             strSql.Append("select ");
56 57
             strSql.Append(" * ");
57 58
             strSql.Append(" FROM Rotation ");
59
+            if (name != "")
60
+            {
61
+                strSql.Append(" where roname like '%" + name + "%' ");
62
+            }
58 63
 
59 64
             var ds = DbHelperSQL.Query(strSql.ToString());
60 65
 
@@ -65,7 +70,7 @@ namespace CallCenterApi.DAL
65 70
         /// </summary>
66 71
         /// <param name="id"></param>
67 72
         /// <returns></returns>
68
-        public bool delrotation(string  id)
73
+        public bool delrotation(string id)
69 74
         {
70 75
             StringBuilder strSql = new StringBuilder();
71 76
             strSql.Append("update Rotation set isEnable=1 ");
@@ -80,7 +85,7 @@ namespace CallCenterApi.DAL
80 85
                 return false;
81 86
             }
82 87
 
83
-          
88
+
84 89
         }
85 90
         /// <summary>
86 91
         /// 启用图片信息
@@ -104,5 +109,54 @@ namespace CallCenterApi.DAL
104 109
 
105 110
 
106 111
         }
112
+        /// <summary>
113
+        /// 删除图片
114
+        /// </summary>
115
+        /// <param name="id"></param>
116
+        /// <returns></returns>
117
+        public bool SCRotion(string id)
118
+        {
119
+            StringBuilder strSql = new StringBuilder();
120
+            strSql.Append("delete  from  Rotation");
121
+            strSql.Append(" where id  in (" + id + ") ");
122
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
123
+            if (rows > 0)
124
+            {
125
+                return true;
126
+            }
127
+            else
128
+            {
129
+                return false;
130
+            }
131
+
132
+
133
+        }
134
+        /// <summary>
135
+        /// 得到一个对象实体
136
+        /// </summary>
137
+        public CallCenterApi.Model.Rotation DataRowToModel(DataRow row)
138
+        {
139
+            #region 之前的 
140
+
141
+            #endregion
142
+            Model.Rotation model = new Model.Rotation();//主表字段
143
+            if (row != null)
144
+            {
145
+                #region 主表信息======================
146
+                //利用反射获得属性的所有公共属性
147
+                Type modelType = model.GetType();
148
+                for (int i = 0; i < row.Table.Columns.Count; i++)
149
+                {
150
+                    PropertyInfo proInfo = modelType.GetProperty(row.Table.Columns[i].ColumnName);
151
+                    if (proInfo != null && row[i] != DBNull.Value)
152
+                    {
153
+                        //用索引值设置属性值
154
+                        proInfo.SetValue(model, row[i], null);
155
+                    }
156
+                }
157
+                #endregion
158
+            }
159
+            return model;
160
+        }
107 161
     }
108 162
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 11 - 11
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


+ 1 - 1
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -875,7 +875,7 @@ namespace CallCenterApi.DAL
875 875
         public bool UpdateCallInHookTelRecord(string p_CallId)
876 876
         {
877 877
             StringBuilder strSql = new StringBuilder();
878
-            strSql.Append("update T_Call_CallRecords SET DealType=(case CallState when 1 then 6 else DealType end)");
878
+            strSql.Append("update T_Call_CallRecords  SET DealType=(case CallState when 1 then 6 else DealType end)");
879 879
             strSql.Append(" where CallId=@CallId");
880 880
             SqlParameter[] parameters = {
881 881
                     new SqlParameter("@CallId", SqlDbType.VarChar,50)};

+ 6 - 46
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -72,7 +72,6 @@ namespace CallCenterApi.Interface.Controllers.report
72 72
 
73 73
             }
74 74
         }
75
-
76 75
         public ActionResult AreaComplaint(string stime="", string endtime = "", int isdc=0)
77 76
         {
78 77
           List <Complaint>   complaintlist = new List<Complaint>();
@@ -246,6 +245,8 @@ namespace CallCenterApi.Interface.Controllers.report
246 245
             }
247 246
 
248 247
         }
248
+
249
+
249 250
         public ActionResult Afterprogress(string stime = "", string endtime = "", int isdc = 0)
250 251
         {
251 252
             List<Aftersale> aftersalelist = new List<Aftersale>();
@@ -275,14 +276,16 @@ namespace CallCenterApi.Interface.Controllers.report
275 276
             var Area = new BLL.T_Sys_Department().GetModelList("isnull(F_ParentId, 1) = 1 and F_State = 1 and F_Layer = 1");
276 277
             float max = 0; float min = 0;
277 278
             string maxarea = "", minarea = "";
279
+            int Tobeassignment = 0;
278 280
             Aftersale complaints = new Aftersale();
279 281
             complaints.serialnumbe = "合计";
280 282
             complaints.receiving = 0;
281 283
             complaints.assignmentnumber = 0;
282
-          //  float Distributionrate = 0; float Receiving = 0;
283 284
             complaints.area = "";
285
+         
284 286
             if (workoeder != null)
285 287
             {
288
+                Tobeassignment = workoeder.Where(x => x.F_State == 1 || x.F_State == 5).Count();
286 289
                 for (int i = 0; i < Area.Count; i++)
287 290
                 {
288 291
                     Aftersale aftersale = new Aftersale();
@@ -290,20 +293,9 @@ namespace CallCenterApi.Interface.Controllers.report
290 293
                     aftersale.area = Area[i].F_DeptName;//大区
291 294
                     var group = workoeder.Where(p => p.F_Area == Area[i].F_DeptId.ToString());//投诉总量
292 295
                     aftersale.total = group.Count();
293
-
294
-                 
295
-                  
296 296
                     float a = 0; float b = 0; int assignment=0, receivingorders=0;
297 297
                     for (DateTime dt = strattime; dt <= enddatetime; dt = dt.AddDays(1))
298 298
                     {
299
-                     //   c++;
300
-                     //   var daycount = group.Where(p => (p.F_TobeallocatedTime < dt.AddDays(1) && (p.F_TransferTime >= dt || p.F_TransferTime == null))
301
-                           //   ).Count();
302
-
303
-                      //  var jiedancount = group.Where(p => ((p.F_TransferTime < dt.AddDays(1) && p.F_Receiving >= dt) ||(p.F_TransferTime < dt.AddDays(1)&& p.F_Receiving == null))
304
-                         //    ).Count();
305
-
306
-
307 299
                          assignment+= group.Where(p => (p.F_TobeallocatedTime < dt.AddDays(1) && p.F_TobeallocatedTime >= dt
308 300
                          && p.F_TransferTime < dt.AddDays(1) && p.F_TransferTime >= dt
309 301
                                )
@@ -312,22 +304,6 @@ namespace CallCenterApi.Interface.Controllers.report
312 304
                  && p.F_Receiving < dt.AddDays(1) && p.F_Receiving >= dt
313 305
                        )
314 306
                     ).Count();
315
-
316
-                      //  var tojiedan = group.Where(p => p.F_Receiving >= dt && p.F_Receiving < dt.AddDays(1)
317
-                     //   ).Count();
318
-                      //  var today = group.Where(p => p.F_TransferTime >= dt && p.F_TransferTime < dt.AddDays(1)
319
-                          //  ).Count();
320
-
321
-                     //   if (jiedancount > 0)
322
-                         //   b +=(float ) tojiedan / jiedancount;//当日
323
-                     //   else
324
-                          //  b += 1;
325
-
326
-
327
-                    //    if (daycount > 0)
328
-                         //   a += (float)today / daycount;//当日
329
-                     //   else
330
-                          //  a += 1;
331 307
                     }
332 308
                     complaints.receiving += receivingorders;//接单条数
333 309
                     aftersale.receiving = receivingorders;//接单条数
@@ -337,20 +313,10 @@ namespace CallCenterApi.Interface.Controllers.report
337 313
                         aftersale.assignmentrate = string.Format("{0:f2}%", (float)assignment / aftersale.total * 100);
338 314
                     else
339 315
                         aftersale.assignmentrate = "100%";
340
-                    //分派率
341
-                    // Distributionrate += (float)assignment / c;
342
-                    //   Receiving += (float)receivingorders / c;
343 316
                     if (aftersale.total > 0)
344 317
                         aftersale.receivingrate = string.Format("{0:f2}%", (float)receivingorders / aftersale.total * 100);//接单率
345 318
                     else
346 319
                         aftersale.receivingrate = "100%";
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354 320
                     aftersale.processingnumber = group.Where( p => p.F_State == 4).Count();//处理中投诉
355 321
                     aftersale.processednumber = group.Where( p => p.F_State == 10).Count();//已处理投诉
356 322
                     float d = 0;
@@ -360,7 +326,6 @@ namespace CallCenterApi.Interface.Controllers.report
360 326
                         aftersale.processed = d;
361 327
                         aftersale.processedrate = string.Format("{0:f2}%", (float)aftersale.processednumber / aftersale.total * 100);//完结率
362 328
                     }
363
-                       
364 329
                     else
365 330
                     {
366 331
                         d = 1;
@@ -396,7 +361,6 @@ namespace CallCenterApi.Interface.Controllers.report
396 361
                     aftersalelist.Add(aftersale);
397 362
                 }
398 363
                 complaints.total = workoeder.Count();
399
-              
400 364
                 if (complaints.total > 0)
401 365
                     complaints.assignmentrate = string.Format("{0:f2}%",(float ) complaints.assignmentnumber / complaints.total * 100); //当日分派率
402 366
                 else
@@ -406,10 +370,6 @@ namespace CallCenterApi.Interface.Controllers.report
406 370
                     complaints.receivingrate = string.Format("{0:f2}%", (float)complaints.receiving / complaints.total * 100); //当日分派率
407 371
                 else
408 372
                     complaints.receivingrate = "100%";
409
-
410
-
411
-               
412
-              
413 373
                 complaints.processingnumber = workoeder.Where(p => p.F_State == 4).Count();//处理中投诉
414 374
                 complaints.processednumber = workoeder.Where(p => p.F_State == 10).Count();//已处理投诉
415 375
                 if (complaints.total > 0)
@@ -432,7 +392,7 @@ namespace CallCenterApi.Interface.Controllers.report
432 392
                 if (isdc > 0)
433 393
                 {
434 394
                     NPOIHelper npoi = new NPOIHelper();
435
-                    if (npoi.AftersaleToExcel(strattime, enddatetime, aftersalelist, maxarea, minarea, pendingnumber) == "")
395
+                    if (npoi.AftersaleToExcel(strattime, enddatetime, aftersalelist, maxarea, minarea, pendingnumber, Tobeassignment) == "")
436 396
                     {
437 397
                         return Success("导出成功");
438 398
                     }

+ 11 - 11
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -527,17 +527,17 @@ namespace CallCenterApi.Interface.Controllers.tel
527 527
             
528 528
             if (Request.IsAuthenticated)
529 529
             {
530
-
531
-                string strid = RequestString.GetFormString("callid");
532
-                bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);
533
-                if (bl)
534
-                {
535
-                    return Success("更新挂机状态成功");
536
-                }
537
-                else
538
-                {
539
-                    return Success("更新挂机状态失败");
540
-                }
530
+                return Success("更新挂机状态成功");
531
+                //string strid = RequestString.GetFormString("callid");
532
+                //bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);
533
+                //if (bl)
534
+                //{
535
+                //    return Success("更新挂机状态成功");
536
+                //}
537
+                //else
538
+                //{
539
+                //    return Success("更新挂机状态失败");
540
+                //}
541 541
 
542 542
             }
543 543
             return NoToken("未知错误,请重新登录");

+ 211 - 160
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -1348,11 +1348,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
1348 1348
                                                 bool n = true;
1349 1349
                                                 if (model.F_State==10)
1350 1350
                                                 {
1351
-                                                    n = new WorkTypeController().SendReminderSMS("完善工单提醒:", user.F_Mobile, count);
1351
+                                                   n = new WorkTypeController().SendReminderSMS("完善工单提醒:", user.F_Mobile, count);
1352 1352
                                                 }
1353 1353
                                                 else
1354 1354
                                                 {
1355
-                                                    n = new WorkTypeController().SendReminderSMS("工单催单提醒:", user.F_Mobile, count);
1355
+                                                   n = new WorkTypeController().SendReminderSMS("工单催单提醒:", user.F_Mobile, count);
1356 1356
                                                 }
1357 1357
                                               
1358 1358
                                                 //   string msg = new PushMessageController().Push(Title, count, user.F_UserCode);
@@ -1658,164 +1658,179 @@ namespace CallCenterApi.Interface.Controllers.workorder
1658 1658
             }
1659 1659
 
1660 1660
         }
1661
+        private readonly static object _MyLock = new object();
1661 1662
         /// 添加工单信息
1662 1663
         /// </summary>
1663 1664
         /// <returns></returns>
1665
+        [Authority]
1664 1666
         public ActionResult AddWorkOrder(WorkOrderInput input,int isover=0, int IsAssign = 0, int clid = 0, string cont = "")
1665 1667
         {
1666 1668
             if (Request.IsAuthenticated)
1667 1669
             {
1668
-                int userId = CurrentUser.UserData.F_UserId;
1669
-                Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
1670
-                Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
1671
-                if (!(input.F_Type > 0 && input.F_Type < 5))
1672
-                    return Error("工单类型错误!");
1673
-              
1674
-                if (IsAssign > 0)
1670
+                lock (_MyLock)
1675 1671
                 {
1676
-                    if (clid == 0)
1677
-                        return Error("请选择提交人!");
1678
-                }
1679
-                if (input.F_Type == 4)
1680
-                {
1681
-                    if (ro .F_RoleCode != "CJZY"&& ro.F_RoleCode != "XTGLY")
1672
+                    #region 
1673
+                    int userId = CurrentUser.UserData.F_UserId;
1674
+                    Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
1675
+                    if (userModel == null)
1676
+                        return Error("未知错误,请重新登录");
1677
+                        Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
1678
+                    if (ro == null)
1679
+                        return Error("获取权限失败,请重新登录");
1680
+                    if (input .F_Type==null )
1681
+                        return Error("工单类型错误!");
1682
+                    if (!(input.F_Type > 0 && input.F_Type < 5))
1683
+                        return Error("工单类型错误!");
1684
+
1685
+                    if (IsAssign > 0)
1682 1686
                     {
1683
-                        return Error("非抽检人员不可添加抽检工单!");
1687
+                        if (clid == 0)
1688
+                            return Error("请选择提交人!");
1684 1689
                     }
1685
-                    if (string.IsNullOrEmpty(input.F_Company))
1686
-                        return Error("抽检单位不能为空!");
1687
-                    if (string.IsNullOrEmpty(input.F_Samplingtype))
1688
-                        return Error("抽检类型不能为空!");
1689
-                    if (string.IsNullOrEmpty(input.F_Salesroom))
1690
-                        return Error("抽样客户/门店不能为空!");
1691
-                    if (string.IsNullOrEmpty(input.F_Samplingproducts))
1692
-                        return Error("抽检产品不能为空!");
1693
-                    if (string.IsNullOrEmpty(input.F_ProductDate))
1694
-                        return Error("生产日期不能为空!");
1695
-                    if (string.IsNullOrEmpty(input.F_Factories))
1696
-                        return Error("涉及工厂不能为空!");
1697
-                    if (string.IsNullOrEmpty(input.F_CusPhone))
1698
-                        return Error("电话不能为空!");
1699
-                    if (string.IsNullOrEmpty(input.F_Remark ))
1700
-                        return Error("备注不能为空!");
1701
-                    if (string.IsNullOrEmpty(input.F_Datecheck))
1702
-                        return Error("抽检日期不能为空!");
1703
-                    
1704
-                }
1705
-                else
1706
-                {
1707
-                    if (string.IsNullOrEmpty(input.F_CusName))
1708
-                        return Error("请输入来电人姓名!");
1709
-                    if (string.IsNullOrEmpty(input.F_CusPhone))
1710
-                        return Error("请输入来电人电话!");
1711
-                    if (input.F_Type == 2)
1690
+                    if (input.F_Type == 4)
1712 1691
                     {
1713
-
1692
+                        if (ro.F_RoleCode != "CJZY" && ro.F_RoleCode != "XTGLY")
1693
+                        {
1694
+                            return Error("非抽检人员不可添加抽检工单!");
1695
+                        }
1696
+                        if (string.IsNullOrEmpty(input.F_Company))
1697
+                            return Error("抽检单位不能为空!");
1698
+                        if (string.IsNullOrEmpty(input.F_Samplingtype))
1699
+                            return Error("抽检类型不能为空!");
1700
+                        if (string.IsNullOrEmpty(input.F_Salesroom))
1701
+                            return Error("抽样客户/门店不能为空!");
1702
+                        if (string.IsNullOrEmpty(input.F_Samplingproducts))
1703
+                            return Error("抽检产品不能为空!");
1714 1704
                         if (string.IsNullOrEmpty(input.F_ProductDate))
1715
-                            return Error("请输入生产日期!");
1716
-                        if (string.IsNullOrEmpty(input.F_ProductType))
1717
-                            return Error("产品代码不能为空!");
1718
-                        if (string.IsNullOrEmpty(input.F_ProductName))
1719
-                            return Error("产品名称不能为空!");
1720
-                        if (string.IsNullOrEmpty(input.F_Specifications))
1721
-                            return Error("规格不能为空!");
1722
-                        if (string.IsNullOrEmpty(input.F_Manufacturer))
1723
-                            return Error("生产厂家不能为空!");
1724
-                        if (string.IsNullOrEmpty(input.F_ProblemCode))
1725
-                            return Error("问题代码不能为空!");
1726
-                        if (string.IsNullOrEmpty(input.F_QualityProblem))
1727
-                            return Error("质量问题不能为空!");
1705
+                            return Error("生产日期不能为空!");
1706
+                        if (string.IsNullOrEmpty(input.F_Factories))
1707
+                            return Error("涉及工厂不能为空!");
1708
+                        if (string.IsNullOrEmpty(input.F_CusPhone))
1709
+                            return Error("电话不能为空!");
1710
+                        if (string.IsNullOrEmpty(input.F_Remark))
1711
+                            return Error("备注不能为空!");
1712
+                        if (string.IsNullOrEmpty(input.F_Datecheck))
1713
+                            return Error("抽检日期不能为空!");
1714
+
1728 1715
                     }
1729
-                
1730
-                }
1731
-              
1732
-             if (!string.IsNullOrEmpty(input.F_ProductDate))
1733
-                {
1734
-                    if (input.F_ProductDate!="不清")
1716
+                    else
1735 1717
                     {
1736
-                        try
1718
+                        if (string.IsNullOrEmpty(input.F_CusName))
1719
+                            return Error("请输入来电人姓名!");
1720
+                        if (string.IsNullOrEmpty(input.F_CusPhone))
1721
+                            return Error("请输入来电人电话!");
1722
+                        if (input.F_Type == 2)
1737 1723
                         {
1738
-                            string result = input.F_ProductDate.Replace(".", "");
1739
-                            var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
1740
-                            var protime = Convert.ToDateTime(pronos);
1741
-                            if (DateTime.Parse(pronos) > DateTime.Now)
1742
-                            {
1743
-                                return Error("生产日期不能大于当前时间!");
1744
-                            }
1745
-                        }
1746
-                        catch
1747
-                        {
1748
-                            return Error("生产日期格式错误!");
1724
+
1725
+                            if (string.IsNullOrEmpty(input.F_ProductDate))
1726
+                                return Error("请输入生产日期!");
1727
+                            if (string.IsNullOrEmpty(input.F_ProductType))
1728
+                                return Error("产品代码不能为空!");
1729
+                            if (string.IsNullOrEmpty(input.F_ProductName))
1730
+                                return Error("产品名称不能为空!");
1731
+                            if (string.IsNullOrEmpty(input.F_Specifications))
1732
+                                return Error("规格不能为空!");
1733
+                            if (string.IsNullOrEmpty(input.F_Manufacturer))
1734
+                                return Error("生产厂家不能为空!");
1735
+                            if (string.IsNullOrEmpty(input.F_ProblemCode))
1736
+                                return Error("问题代码不能为空!");
1737
+                            if (string.IsNullOrEmpty(input.F_QualityProblem))
1738
+                                return Error("质量问题不能为空!");
1749 1739
                         }
1740
+
1750 1741
                     }
1751
-                 
1752
-                }
1753
-                if (!string.IsNullOrEmpty(input.F_Datecheck))
1754
-                {
1755
-                    if (input.F_Datecheck != "不清")
1742
+
1743
+                    if (!string.IsNullOrEmpty(input.F_ProductDate))
1756 1744
                     {
1757
-                        try
1745
+                        if (input.F_ProductDate != "不清")
1758 1746
                         {
1759
-                            string result = input.F_Datecheck.Replace(".", "");
1760
-                            var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
1747
+                            try
1748
+                            {
1749
+                                string result = input.F_ProductDate.Replace(".", "");
1750
+                                var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
1751
+                                var protime = Convert.ToDateTime(pronos);
1752
+                                if (DateTime.Parse(pronos) > DateTime.Now)
1753
+                                {
1754
+                                    return Error("生产日期不能大于当前时间!");
1755
+                                }
1756
+                            }
1757
+                            catch
1758
+                            {
1759
+                                return Error("生产日期格式错误!");
1760
+                            }
1761 1761
                         }
1762
-                        catch
1762
+
1763
+                    }
1764
+                    if (!string.IsNullOrEmpty(input.F_Datecheck))
1765
+                    {
1766
+                        if (input.F_Datecheck != "不清")
1763 1767
                         {
1764
-                            return Error("抽检日期格式错误!");
1768
+                            try
1769
+                            {
1770
+                                string result = input.F_Datecheck.Replace(".", "");
1771
+                                var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
1772
+                            }
1773
+                            catch
1774
+                            {
1775
+                                return Error("抽检日期格式错误!");
1776
+                            }
1765 1777
                         }
1778
+
1766 1779
                     }
1780
+                    var model = new Model.T_Bus_WorkOrder();
1781
+                    model = inputtoobj(model, input, 0);
1767 1782
 
1768
-                }
1769
-                var model = new Model.T_Bus_WorkOrder();
1770
-                model = inputtoobj(model, input, 0);
1771
-            
1772
-                int n = workorderBLL.Add(model);
1773
-                if (n > 0)
1774
-                {
1775
-                    Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
1776
-                    var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
1777
-                    string deptname = "";
1778
-                    if (deptmodel != null)
1779
-                        deptname = deptmodel.F_DeptName;
1780
-                    AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
1781
-                    if (isover >0)
1783
+                    int n = workorderBLL.Add(model);
1784
+                    if (n > 0)
1782 1785
                     {
1786
+                        Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
1783 1787
                        
1784
-                        if (userModel != null)
1788
+                     var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
1789
+                        string deptname = "";
1790
+                        if (deptmodel != null)
1791
+                            deptname = deptmodel.F_DeptName;
1792
+                        AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
1793
+                        if (isover > 0)
1785 1794
                         {
1786
-                          
1787
-                            if (model != null)
1795
+
1796
+                            if (userModel != null)
1788 1797
                             {
1789
-                                var res = DealWO(userModel, modlelist, cont, "", isover);
1790
-                                if (res)
1791
-                                    return Success("处理成功");
1798
+
1799
+                                if (model != null)
1800
+                                {
1801
+                                    var res = DealWO(userModel, modlelist, cont, "", isover);
1802
+                                    if (res)
1803
+                                        return Success("处理成功");
1804
+                                    else
1805
+                                        return Error("处理失败!");
1806
+                                }
1792 1807
                                 else
1793
-                                    return Error("处理失败!");
1808
+                                    return Error("工单不存在!");
1794 1809
                             }
1795
-                            else
1796
-                                return Error("工单不存在!");
1797 1810
                         }
1798
-                    }
1799
-                   else  if (IsAssign > 0)
1800
-                    {
1801
-                        if (clid == 0)
1802
-                            return Error("请选择提交人!");
1803
-                        bool t = AssignWO(userModel, modlelist, cont, 1, clid);
1804
-                        if (t)
1811
+                        else if (IsAssign > 0)
1805 1812
                         {
1806
-                     
1807
-                            return Success("提交成功!");
1813
+                            if (clid == 0)
1814
+                                return Error("请选择提交人!");
1815
+                            bool t = AssignWO(userModel, modlelist, cont, 1, clid);
1816
+                            if (t)
1817
+                            {
1818
+
1819
+                                return Success("提交成功!");
1820
+                            }
1821
+
1822
+                            else
1823
+                                return Error("提交失败!");
1808 1824
                         }
1809
-                           
1810
-                        else
1811
-                            return Error("提交失败!");
1812
-                    }
1813
-                    return Success("添加成功!");
1825
+                        return Success("添加成功!");
1814 1826
 
1827
+                    }
1828
+                    else
1829
+                        return Error("添加失败!");
1815 1830
                 }
1816
-                else
1817
-                    return Error("添加失败!");
1831
+                #endregion
1818 1832
             }
1833
+
1819 1834
             return NoToken("未知错误,请重新登录");
1820 1835
         }
1821 1836
       
@@ -2410,6 +2425,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
2410 2425
                     if (ua != null)
2411 2426
                     {
2412 2427
                         Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
2428
+                        if (model.F_State == 0)
2429
+                        {
2430
+                            return Error("工单未提交");
2431
+                        }
2432
+                        else if (model.F_State == 6)
2433
+                        {
2434
+                            return Error("工单已退回,请勿重复提交");
2435
+                        }
2413 2436
                         //验证信息 
2414 2437
                         if (model != null)
2415 2438
                         {
@@ -2433,37 +2456,61 @@ namespace CallCenterApi.Interface.Controllers.workorder
2433 2456
         {
2434 2457
             #region 工单处理
2435 2458
             int sms = 0;
2436
-            var itemlasts = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + " ");
2437
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + " ").FirstOrDefault(); ;
2438 2459
             string creatuser = "";
2439 2460
             int wostate = 5;
2440
-            if (itemlasts.Count > 0)
2461
+            if (model.F_State == 1)
2441 2462
             {
2442
-                foreach (var it in itemlasts)
2463
+                wostate = 6;
2464
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=1  order by F_ID desc ").FirstOrDefault(); ;
2465
+                if (itemlast != null)
2443 2466
                 {
2444
-                    if (itemlast.F_WoState > 1)
2445
-                    {
2446
-                        if (it.F_WoState == 3)
2447
-                        {
2448
-                            creatuser = it.F_CreateUser;
2449
-                            wostate = 5;
2450
-                        }
2451
-                        else if (it.F_WoState == 5)
2452
-                        {
2453
-                            creatuser = it.F_CreateUser;
2454
-                            wostate = 6;
2455
-                        }
2456
-                       
2457
-
2458
-                    }
2459
-                    else
2460
-                    {
2461
-                        if (it.F_WoState == 1 )
2462
-                        {
2463
-                            creatuser = it.F_CreateUser;
2464
-                            wostate = 6;
2465
-                        }
2466
-                    }
2467
+                    creatuser = itemlast.F_CreateUser;
2468
+                }
2469
+            }
2470
+            else if (model.F_State == 2)
2471
+            {
2472
+                wostate = 5;
2473
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=2  order by F_ID desc ").FirstOrDefault(); ;
2474
+                if (itemlast != null)
2475
+                {
2476
+                    creatuser = itemlast.F_CreateUser;
2477
+                }
2478
+            }
2479
+            else if (model.F_State == 3)
2480
+            {
2481
+                wostate = 5;
2482
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2483
+                if (itemlast != null)
2484
+                {
2485
+                    creatuser = itemlast.F_CreateUser;
2486
+                }
2487
+            }
2488
+            else if (model.F_State == 4)
2489
+            {
2490
+                wostate = 5;
2491
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2492
+                if (itemlast != null)
2493
+                {
2494
+                    creatuser = itemlast.F_CreateUser;
2495
+                }
2496
+            }
2497
+            else if (model.F_State == 5)
2498
+            {
2499
+                wostate = 6;
2500
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2501
+                if (itemlast != null)
2502
+                {
2503
+                    creatuser = itemlast.F_CreateUser;
2504
+                }
2505
+                
2506
+            }
2507
+            else if (model.F_State == 10)
2508
+            {
2509
+                wostate = 5;
2510
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2511
+                if (itemlast != null)
2512
+                {
2513
+                    creatuser = itemlast.F_CreateUser;
2467 2514
                 }
2468 2515
             }
2469 2516
             var opt = "退回";
@@ -2479,21 +2526,25 @@ namespace CallCenterApi.Interface.Controllers.workorder
2479 2526
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode  + ")" + opt + "工单,退回说明:" + cont;
2480 2527
             //获取上一级处理人员
2481 2528
             int deptid = 0;
2482
-            var touser = new BLL.T_Sys_UserAccount().GetModel(creatuser);
2483
-            if (touser != null)
2529
+            if (creatuser!="")
2484 2530
             {
2485
-                deptid = touser.F_DeptId;
2486
-                var deptm = departmentBLL.GetModel(touser.F_DeptId);
2487
-                if (deptm != null)
2531
+                var touser = new BLL.T_Sys_UserAccount().GetModel(creatuser);
2532
+                if (touser != null)
2488 2533
                 {
2489
-                    if (deptm.F_Layer == 2)
2534
+                    deptid = touser.F_DeptId;
2535
+                    var deptm = departmentBLL.GetModel(touser.F_DeptId);
2536
+                    if (deptm != null)
2490 2537
                     {
2491
-                        F_Officeid = deptm.F_DeptId;
2492
-                        F_Largeareaid = deptm.F_ParentId;
2538
+                        if (deptm.F_Layer == 2)
2539
+                        {
2540
+                            F_Officeid = deptm.F_DeptId;
2541
+                            F_Largeareaid = deptm.F_ParentId;
2542
+                        }
2493 2543
                     }
2494
-                }
2495 2544
 
2545
+                }
2496 2546
             }
2547
+          
2497 2548
             var itemid = AddLog(model.F_Id, wostate, content, 1, wostate, creatuser, deptid, nowUser);
2498 2549
             if (itemid > 0)
2499 2550
             {

+ 63 - 27
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs

@@ -1659,8 +1659,16 @@ namespace CallCenterApi.Interface.Controllers.workorder
1659 1659
                 if (ua != null)
1660 1660
                 {
1661 1661
                     Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
1662
-                    //验证信息 
1663
-                    if (model != null)
1662
+                       if(model .F_State ==0)
1663
+                        {
1664
+                            return Error("工单未提交");
1665
+                        }
1666
+                       else if (model.F_State ==6)
1667
+                        {
1668
+                            return Error("工单已退回,请勿重复提交");
1669
+                        }
1670
+                        //验证信息 
1671
+                        if (model != null)
1664 1672
                     {
1665 1673
                         var res = BackWO(ua, model, cont);
1666 1674
                         if (res)
@@ -1682,35 +1690,63 @@ namespace CallCenterApi.Interface.Controllers.workorder
1682 1690
         {
1683 1691
             #region 工单处理
1684 1692
             int sms = 0;
1685
-            var itemlasts = itembll.GetModelList("  F_ItemType=" +1 + " and  F_WoID=" + model.F_Id  + " ");
1686
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + " ").FirstOrDefault(); ;
1693
+           // var itemlasts = itembll.GetModelList("  F_ItemType=" +1 + " and  F_WoID=" + model.F_Id  + " ");
1694
+          //  var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "order by F_ID desc ").FirstOrDefault(); ;
1687 1695
             string creatuser = "";
1688 1696
             int wostate = 5;
1689
-            if (itemlasts.Count > 0)
1697
+
1698
+            if (model .F_State ==1)
1690 1699
             {
1691
-                foreach (var it in itemlasts)
1700
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=1  order by F_ID desc ").FirstOrDefault(); ;
1701
+                if (itemlast!=null )
1692 1702
                 {
1693
-                    if (itemlast.F_WoState >1)
1694
-                    {
1695
-                        if (it.F_WoState == 3 )
1696
-                        {
1697
-                            creatuser = it.F_CreateUser;
1698
-                            wostate = 5;
1699
-                        }
1700
-                        else if (it.F_WoState == 5)
1701
-                        {
1702
-                            creatuser = it.F_CreateUser;
1703
-                            wostate = 6;
1704
-                        }
1705
-                    }
1706
-                    else
1707
-                    {
1708
-                        if (it.F_WoState == 1 )
1709
-                        {
1710
-                            creatuser = it.F_CreateUser;
1711
-                            wostate = 6;
1712
-                        }
1713
-                    }
1703
+                    creatuser = itemlast.F_CreateUser;
1704
+                    wostate = 6;
1705
+                }
1706
+            }
1707
+            else if (model.F_State == 2)
1708
+            {
1709
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=2  order by F_ID desc ").FirstOrDefault(); ;
1710
+                if (itemlast != null)
1711
+                {
1712
+                    creatuser = itemlast.F_CreateUser;
1713
+                    wostate = 5;
1714
+                }
1715
+            }
1716
+            else if (model.F_State == 3)
1717
+            {
1718
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
1719
+                if (itemlast != null)
1720
+                {
1721
+                    creatuser = itemlast.F_CreateUser;
1722
+                    wostate = 5;
1723
+                }
1724
+            }
1725
+            else if (model.F_State == 4)
1726
+            {
1727
+                var itemlast = itembll.GetModelList("  F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
1728
+                if (itemlast != null)
1729
+                {
1730
+                    creatuser = itemlast.F_CreateUser;
1731
+                    wostate = 5;
1732
+                }
1733
+            }
1734
+            else if (model.F_State ==5)
1735
+            {
1736
+                var itemlast = itembll.GetModelList("F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=1  order by F_ID desc ").FirstOrDefault(); ;
1737
+                if (itemlast != null)
1738
+                {
1739
+                    creatuser = itemlast.F_CreateUser;
1740
+                    wostate = 6;
1741
+                }
1742
+            }
1743
+            else if (model.F_State == 10)
1744
+            {
1745
+                var itemlast = itembll.GetModelList("   F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
1746
+                if (itemlast != null)
1747
+                {
1748
+                    creatuser = itemlast.F_CreateUser;
1749
+                    wostate = 5;
1714 1750
                 }
1715 1751
             }
1716 1752
             var opt = "退回";

+ 2 - 5
codegit/CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

@@ -831,9 +831,6 @@ namespace CallCenter.Utility
831 831
                 style13.BorderDiagonal = BorderDiagonal.Backward;
832 832
                 style13.BorderDiagonalColor = IndexedColors.Black .Index;
833 833
                 string sb = "                  数量\n日期";
834
-              //  StringBuilder sb = new StringBuilder();
835
-              //  sb.AppendLine("数量".PadLeft(15));//该行不足长度10在左侧填空格
836
-              //  sb.AppendLine("日期".PadRight(15));//该行不足长度10在右侧填空格
837 834
                 cell2.SetCellValue(sb);
838 835
                 cell2.CellStyle = cellStylebt;
839 836
                 style13.WrapText = true;
@@ -1625,7 +1622,7 @@ namespace CallCenter.Utility
1625 1622
             }
1626 1623
         }
1627 1624
 
1628
-        public string AftersaleToExcel(DateTime stime, DateTime etime, List<Aftersale> complaints, string maxarea, string minarea,int pendingnumber)
1625
+        public string AftersaleToExcel(DateTime stime, DateTime etime, List<Aftersale> complaints, string maxarea, string minarea,int pendingnumber,int Tobeassignment)
1629 1626
         {
1630 1627
             try
1631 1628
             {
@@ -1670,7 +1667,7 @@ namespace CallCenter.Utility
1670 1667
                 ICell cell2 = irow2.CreateCell(0);
1671 1668
 
1672 1669
                 cell2.SetCellValue("   "+ stime.Year +"年" + stime.Month + "月" + stime.Day + "日-" + etime.Month + "月" + +etime.Day + "日共有售后APP工单" + complaints[complaints.Count - 1].total  + "条," +
1673
-                    "已完结工单" + complaints[complaints.Count - 1].processednumber + "条,完结率" + complaints[complaints.Count - 1].processedrate + ",待分派工单" + complaints[complaints.Count - 1].assignmentnumber + "条,待处理工单" + pendingnumber + "条。19个大区中," + maxarea + "大区处理率最高," + minarea + "大区处理率最低。");
1670
+                    "已完结工单" + complaints[complaints.Count - 1].processednumber + "条,完结率" + complaints[complaints.Count - 1].processedrate + ",待分派工单" + complaints[complaints.Count - 1].assignmentnumber + "条,待处理工单" + pendingnumber + "条。19个大区中," + maxarea + "大区处理率最高," + minarea + "大区处理率最低。目前待分派"+ Tobeassignment+"条");
1674 1671
                 cell2.CellStyle = cellStylebt2;
1675 1672
                 sheet.AddMergedRegion(new CellRangeAddress(1, 5, 0, 11));
1676 1673
                 #endregion

+ 2 - 5
codegit/PushMessage/Program.cs

@@ -26,8 +26,8 @@ namespace Push
26 26
         {
27 27
             Console.OutputEncoding = System.Text.Encoding.UTF8;
28 28
             Environment.SetEnvironmentVariable("needDetails", "true");
29
-            Console.OutputEncoding = System.Text.Encoding.UTF8;
30
-            Environment.SetEnvironmentVariable("needDetails", "true");
29
+          //  Console.OutputEncoding = System.Text.Encoding.UTF8;
30
+          //  Environment.SetEnvironmentVariable("needDetails", "true");
31 31
             
32 32
             
33 33
             System.Console.WriteLine("Hello Push!");
@@ -44,8 +44,6 @@ namespace Push
44 44
        
45 45
        public static void Push(PushTime time)
46 46
         {
47
-          
48
-         
49 47
             FileStream fs = null;
50 48
             try
51 49
             {
@@ -71,7 +69,6 @@ namespace Push
71 69
                     fs.Close();
72 70
                 }
73 71
             }
74
-
75 72
         }
76 73
         //http://oa.shuanghui.net:8046/
77 74
         private static void SetCensusURL()