Kaynağa Gözat

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

duhongyu 6 yıl önce
ebeveyn
işleme
1dd126ac7b

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

114
     <Compile Include="T_Sys_WorkTimes.cs" />
114
     <Compile Include="T_Sys_WorkTimes.cs" />
115
     <Compile Include="T_Wo_BusinessManage.cs" />
115
     <Compile Include="T_Wo_BusinessManage.cs" />
116
     <Compile Include="T_Wo_MaterialManage.cs" />
116
     <Compile Include="T_Wo_MaterialManage.cs" />
117
+    <Compile Include="T_Wo_QuestionManage.cs" />
117
     <Compile Include="T_Wo_WorkOrder.cs" />
118
     <Compile Include="T_Wo_WorkOrder.cs" />
118
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
119
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
119
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />
120
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

114
     <Compile Include="T_Sys_WorkTimes.cs" />
114
     <Compile Include="T_Sys_WorkTimes.cs" />
115
     <Compile Include="T_Wo_BusinessManage.cs" />
115
     <Compile Include="T_Wo_BusinessManage.cs" />
116
     <Compile Include="T_Wo_MaterialManage.cs" />
116
     <Compile Include="T_Wo_MaterialManage.cs" />
117
+    <Compile Include="T_Wo_QuestionManage.cs" />
117
     <Compile Include="T_Wo_WorkOrder.cs" />
118
     <Compile Include="T_Wo_WorkOrder.cs" />
118
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
119
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
119
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />
120
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />

+ 99 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
 using CallCenterApi.Interface.Models.Enum;
5
 using CallCenterApi.Interface.Models.Enum;
6
+using CallCenterApi.Model;
6
 using CallCenterAPI.WechatSDK;
7
 using CallCenterAPI.WechatSDK;
7
 using System;
8
 using System;
9
+using System.Collections.Generic;
8
 using System.Data;
10
 using System.Data;
9
 using System.Linq;
11
 using System.Linq;
10
 using System.Web;
12
 using System.Web;
21
         BLL.T_Sys_Department sysDeptBll = new BLL.T_Sys_Department();
23
         BLL.T_Sys_Department sysDeptBll = new BLL.T_Sys_Department();
22
         BLL.T_Sys_DictionaryValue dicvalueBll = new BLL.T_Sys_DictionaryValue();
24
         BLL.T_Sys_DictionaryValue dicvalueBll = new BLL.T_Sys_DictionaryValue();
23
 
25
 
26
+        BLL.T_Wo_QuestionManage quesBLL = new BLL.T_Wo_QuestionManage();
27
+
28
+        #region 质量管理部
29
+        //根据工单id获取工单类型 根据类型区别提交处理
30
+
31
+        #endregion
32
+
33
+        #region 市场管理科
34
+        #endregion
35
+        #region 
36
+        /// <summary>
37
+        /// 根据生产批次号获取超出质保期限
38
+        /// 质保期限以月为单位
39
+        /// </summary>
40
+        /// <param name="BatchNumber">生产批次号</param>
41
+        /// <param name="createtime">工单创建时间</param>
42
+        public int GetProTime(string BatchNumber,DateTime createtime)
43
+        {
44
+            //生产批次号截取前六位日期
45
+            var prono = BatchNumber.Substring(0, 6);
46
+            //转为生产日期格式
47
+            var pronos = DateTime.ParseExact(prono, "yyMMdd", null).ToString("yyyy-MM-dd");
48
+            var protime = Convert.ToDateTime(pronos);
49
+            TimeSpan ts = createtime - protime;
50
+            var days = ts.TotalDays;
51
+            var month = (int)Math.Ceiling((days / 30));//以30天为一月计算几个月并且有余数取整
52
+            return month;
53
+        }
54
+        #endregion
55
+        #region 读取问题类别
56
+        public ActionResult GetQuestionType(int type=0,int pid=0)
57
+        {
58
+            var sql = " F_IsDelete=0 and F_ParentId=" + pid;
59
+            if (type == (int)EnumWOType.Complaint)//投诉
60
+                sql += " and F_Type='"+ EnumWOType.Complaint.ToString()+ "'";
61
+            if (type == (int)EnumWOType.ConsultingNeeds)//咨询及需求
62
+                sql += " and F_Type='" + EnumWOType.ConsultingNeeds.ToString() + "'";
63
+            if (type == (int)EnumWOType.SpotCheck)//抽检
64
+                sql += " and F_Type='" + EnumWOType.SpotCheck.ToString() + "'";
65
+            DataTable dt = quesBLL.GetList(sql).Tables[0];
66
+            List<Model.TreeModel> modelList = BindTree(dt, "0");
67
+            if (modelList != null)
68
+            {
69
+                if (modelList.Count > 0)
70
+                    return Success("加载成功", modelList);
71
+            }
72
+            return Error("加载失败");
73
+        }
74
+        /// <summary>
75
+        /// tree  树形部门
76
+        /// </summary>
77
+        /// <param name="tab"></param>
78
+        /// <param name="parentid"></param>
79
+        /// <returns></returns>
80
+        private List<Model.TreeModel> BindTree(DataTable tab, string parentid)
81
+        {
82
+            DataTable tab2 = new DataTable();
83
+
84
+            if (tab != null && tab.Rows.Count > 0)
85
+            {
86
+                List<Model.T_Wo_QuestionManage> categorylist = quesBLL.DataTableToList(tab);
87
+                List<Model.TreeModel> modelList = new List<Model.TreeModel>(categorylist.Count);
88
+                for (int i = 0; i < categorylist.Count; i++)
89
+                {
90
+                    Model.TreeModel model = new Model.TreeModel();
91
+                    string currentID = categorylist[i].F_Id.ToString();//当前功能ID
92
+                    model.id = currentID;
93
+                    model.code = "";
94
+                    model.IconCls = "";//图标
95
+                    model.text = categorylist[i].F_QuestionName;
96
+                    model.headerid = categorylist[i].F_ParentId ?? 0;   
97
+                    tab2 = new BLL.T_Sys_Department().GetList("F_ParentId=" + currentID + " and F_IsDelete=0 ").Tables[0];
98
+                    if (tab2 != null && tab2.Rows.Count > 0)
99
+                    {
100
+                        model.children = BindTree(tab2, currentID);
101
+                    }
102
+                    modelList.Add(model);
103
+                }
104
+                return modelList;
105
+
106
+            }
107
+            else
108
+            {
109
+                return null;
110
+            }
111
+
112
+        }
113
+        #endregion
24
         //#region 工单状态
114
         //#region 工单状态
25
         //public ActionResult GetWorkState()
115
         //public ActionResult GetWorkState()
26
         //{
116
         //{
395
         //    }
485
         //    }
396
         //    return res;
486
         //    return res;
397
         //}
487
         //}
398
-        
488
+
399
         ///// <summary>
489
         ///// <summary>
400
         ///// 获取待接单的工单编号
490
         ///// 获取待接单的工单编号
401
         ///// </summary>
491
         ///// </summary>
406
         //    str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType=" + (int)EnumItemType.deal 
496
         //    str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType=" + (int)EnumItemType.deal 
407
         //        + " and F_WoState="+ (int)EnumWorkOrderState.assign
497
         //        + " and F_WoState="+ (int)EnumWorkOrderState.assign
408
         //        + " and isnull(F_IsUsed,'0')='0' and F_NextUser='" + user + "' ";
498
         //        + " and isnull(F_IsUsed,'0')='0' and F_NextUser='" + user + "' ";
409
-           
499
+
410
         //    return str;
500
         //    return str;
411
         //}
501
         //}
412
 
502
 
658
         //    }
748
         //    }
659
         //    return Error("无操作权限!");
749
         //    return Error("无操作权限!");
660
         //}
750
         //}
661
-        
751
+
662
         ///// <summary>
752
         ///// <summary>
663
         ///// 指派/转派工单
753
         ///// 指派/转派工单
664
         ///// </summary>
754
         ///// </summary>
690
         //    }
780
         //    }
691
         //    return Error("无操作权限!");
781
         //    return Error("无操作权限!");
692
         //}
782
         //}
693
-        
783
+
694
         ///// <summary>
784
         ///// <summary>
695
         ///// 接单 - 确认工单
785
         ///// 接单 - 确认工单
696
         ///// </summary>
786
         ///// </summary>
719
         //    }
809
         //    }
720
         //    return Error("无操作权限");
810
         //    return Error("无操作权限");
721
         //}
811
         //}
722
-        
812
+
723
         ///// <summary>
813
         ///// <summary>
724
         ///// 退回工单
814
         ///// 退回工单
725
         ///// </summary>
815
         ///// </summary>
749
         //    }
839
         //    }
750
         //    return Error("无操作权限");
840
         //    return Error("无操作权限");
751
         //}
841
         //}
752
-        
842
+
753
         ///// <summary>
843
         ///// <summary>
754
         ///// 催办工单
844
         ///// 催办工单
755
         ///// </summary>
845
         ///// </summary>
2171
         ////    model.IsReturn = 0;
2261
         ////    model.IsReturn = 0;
2172
         ////    model.IsReturnBak = 0;
2262
         ////    model.IsReturnBak = 0;
2173
         ////    model.Answer = "";
2263
         ////    model.Answer = "";
2174
-            
2264
+
2175
         ////    workorderid = bll.Add(model).ToString();
2265
         ////    workorderid = bll.Add(model).ToString();
2176
         ////    return workorderid;
2266
         ////    return workorderid;
2177
         ////}
2267
         ////}
2246
         ////                if (itemid > 0)
2336
         ////                if (itemid > 0)
2247
         ////                {
2337
         ////                {
2248
         ////                    #region
2338
         ////                    #region
2249
-                           
2339
+
2250
         ////                    //工单完结要更新工单的状态
2340
         ////                    //工单完结要更新工单的状态
2251
         ////                    if (isend == 0)
2341
         ////                    if (isend == 0)
2252
         ////                    {
2342
         ////                    {
2316
         ////                                    //WxHelper.SendWechatMsg1(model.WorkOrderID, "你有新的工单需要处理", wotype, model.State.ToString(), content, orderid.ToString(), modelUser2.F_WxOpenId);
2406
         ////                                    //WxHelper.SendWechatMsg1(model.WorkOrderID, "你有新的工单需要处理", wotype, model.State.ToString(), content, orderid.ToString(), modelUser2.F_WxOpenId);
2317
         ////                                    //WxHelper.SendWechatMsg1(model.WorkOrderID, "你有新的工单需要处理", wotype, content, orderid.ToString(), modelUser2.F_WxOpenId);
2407
         ////                                    //WxHelper.SendWechatMsg1(model.WorkOrderID, "你有新的工单需要处理", wotype, content, orderid.ToString(), modelUser2.F_WxOpenId);
2318
 
2408
 
2319
-                                            
2409
+
2320
         ////                                }
2410
         ////                                }
2321
         ////                            }
2411
         ////                            }
2322
         ////                        }
2412
         ////                        }

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

120
     <Compile Include="T_Sys_WorkTimes.cs" />
120
     <Compile Include="T_Sys_WorkTimes.cs" />
121
     <Compile Include="T_Wo_BusinessManage.cs" />
121
     <Compile Include="T_Wo_BusinessManage.cs" />
122
     <Compile Include="T_Wo_MaterialManage.cs" />
122
     <Compile Include="T_Wo_MaterialManage.cs" />
123
+    <Compile Include="T_Wo_QuestionManage.cs" />
123
     <Compile Include="T_Wo_WorkOrder.cs" />
124
     <Compile Include="T_Wo_WorkOrder.cs" />
124
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
125
     <Compile Include="T_Wo_WorkOrderItem_New.cs" />
125
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />
126
     <Compile Include="T_Wo_WorkOrderTimeOut.cs" />

+ 13 - 1
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

740
     /// </summary>
740
     /// </summary>
741
     public enum EnumWOType
741
     public enum EnumWOType
742
     {
742
     {
743
+        /// <summary>
744
+        /// 投诉
745
+        /// </summary>
743
         [Description("投诉")]
746
         [Description("投诉")]
744
-        Complaint,
747
+        Complaint=1,
748
+        /// <summary>
749
+        /// 抽检
750
+        /// </summary>
745
         [Description("抽检")]
751
         [Description("抽检")]
746
         SpotCheck,
752
         SpotCheck,
753
+        /// <summary>
754
+        /// 咨询及需求
755
+        /// </summary>
747
         [Description("咨询及需求")]
756
         [Description("咨询及需求")]
748
         ConsultingNeeds,
757
         ConsultingNeeds,
758
+        /// <summary>
759
+        /// 其他
760
+        /// </summary>
749
         [Description("其他")]
761
         [Description("其他")]
750
         Other
762
         Other
751
     }
763
     }