zhupei 3 years ago
parent
commit
4964fbe4e2

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

@@ -52,7 +52,7 @@ namespace CallCenterApi.DAL
52 52
             strSql.Append("insert into T_Sys_UserAccount(");
53 53
             strSql.Append("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,F_Origdepts,F_Flag)");
54 54
             strSql.Append(" values (");
55
-            strSql.Append("@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,@F_Origdepts,F_Flag)");
55
+            strSql.Append("@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,@F_Origdepts,@F_Flag)");
56 56
             strSql.Append(";select @@IDENTITY");
57 57
             SqlParameter[] parameters = {
58 58
                     new SqlParameter("@F_UserCode", SqlDbType.VarChar,50),

File diff suppressed because it is too large
+ 156 - 107
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs


+ 103 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -1228,6 +1228,109 @@ namespace CallCenterApi.Interface.Controllers.report
1228 1228
            );
1229 1229
 
1230 1230
         }
1231
+        /// <summary>
1232
+        /// 工单满意度打分统计报表(工单回访)
1233
+        /// </summary>
1234
+        /// <param name="stime"></param>
1235
+        /// <param name="endtime"></param>
1236
+        /// <param name="type"></param>
1237
+        /// <returns></returns>
1238
+        public ActionResult GetVisiteSatisfiedReport(string stime, string endtime,int type=0)
1239
+        {
1240
+            string sql = $" and F_IsDelete=0";
1241
+            DataTable dt = new DataTable();
1242
+            #region 筛选条件
1243
+            if (stime != null && stime.Trim() != "")
1244
+            {
1245
+                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
1246
+            }
1247
+            if (endtime != null && endtime.Trim() != "")
1248
+            {
1249
+                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
1250
+            }
1251
+            if (type > 0 && type < 6)//工单类型
1252
+            { sql += $" and F_Type=" + type; }
1253
+            #endregion
1254
+            dt.Columns.Add("评分维度");
1255
+            dt.Columns.Add("不满意(5分以下)");
1256
+            dt.Columns.Add("一般(5-6)");
1257
+            dt.Columns.Add("满意(7-8)");
1258
+            dt.Columns.Add("非常满意(9-10)");
1259
+            List<string> scorename = new List<string>();
1260
+            scorename.Add("F_NPS");
1261
+            scorename.Add("F_VisitResultScore");
1262
+            scorename.Add("F_EffectiveScore");
1263
+            scorename.Add("F_ServiceAttitude");
1264
+            scorename.Add("F_ProductQuality");
1265
+            scorename.Add("F_EvaluationResult");
1266
+            int resultscore = 0, effectscore = 0, servicescore = 0, qualityscore = 0, npscore = 0, evaluatscore = 0;
1267
+            for (int i = 0; i < scorename.Count; i++)
1268
+            {
1269
+                DataRow drNew = dt.NewRow();
1270
+                switch (i)
1271
+                {
1272
+                    case 0:
1273
+                        drNew["评分维度"] = "NPS得分";
1274
+                        break;
1275
+                    case 1:
1276
+                        drNew["评分维度"] = "处理结果得分";
1277
+                        break;
1278
+                    case 2:
1279
+                        drNew["评分维度"] = "处理时效得分";
1280
+                        break;
1281
+                    case 3:
1282
+                        drNew["评分维度"] = "服务态度得分";
1283
+                        break;
1284
+                    case 4:
1285
+                        drNew["评分维度"] = "产品质量得分";
1286
+                        break;
1287
+                    case 5:
1288
+                        drNew["评分维度"] = "评价结果得分";
1289
+                        break;
1290
+                }
1291
+                for (int j = 1; j < dt.Columns.Count; j++)
1292
+                {
1293
+                    string sqlstr = "";
1294
+                    var modellist = new List<Model.T_Wo_WorkOrder>();
1295
+                    switch (j)
1296
+                    {
1297
+                        case 1:
1298
+                            sqlstr = $"{scorename[i]}<5";
1299
+                            modellist = woBLL.GetModelList(" " + sqlstr + sql + " ");
1300
+                            drNew["不满意(5分以下)"] = modellist.Count;
1301
+                            break;
1302
+                        case 2:
1303
+                            sqlstr = $"{scorename[i]} in (5,6)";
1304
+                            modellist = woBLL.GetModelList(" " + sqlstr + sql + " ");
1305
+                            drNew["一般(5-6)"] = modellist.Count;
1306
+                            break;
1307
+                        case 3:
1308
+                            sqlstr = $"{scorename[i]} in (7,8)";
1309
+                            modellist = woBLL.GetModelList(" " + sqlstr + sql + " ");
1310
+                            drNew["满意(7-8)"] = modellist.Count;
1311
+                            break;
1312
+                        case 4:
1313
+                            sqlstr = $"{scorename[i]} in (9,10)";
1314
+                            modellist = woBLL.GetModelList(" " + sqlstr + sql + " ");
1315
+                            drNew["非常满意(9-10)"] = modellist.Count;
1316
+                            break;
1317
+                    }
1318
+                }
1319
+
1320
+                dt.Rows.Add(drNew);
1321
+            }
1322
+            return Content(dt.ToJson());
1323
+            //NPOIHelper npoi = new NPOIHelper();
1324
+            //if (npoi.ExportToExcel("回访评价打分明细表", dt) == "")
1325
+            //{
1326
+            //    return Success("导出成功");
1327
+            //}
1328
+            //else
1329
+            //{
1330
+            //    return Error("导出失败");
1331
+
1332
+            //}
1333
+        }
1231 1334
 
1232 1335
 
1233 1336
 

File diff suppressed because it is too large
+ 1006 - 335
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs


+ 180 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/MaterialItemsController.cs

@@ -1,17 +1,193 @@
1
-using System;
1
+using CallCenter.Utility;
2
+using CallCenterApi.DB;
3
+using CallCenterApi.Interface.Controllers.Base;
4
+using System;
2 5
 using System.Collections.Generic;
6
+using System.Data;
3 7
 using System.Linq;
4 8
 using System.Web;
5 9
 using System.Web.Mvc;
6 10
 
7 11
 namespace CallCenterApi.Interface.Controllers.workorder
8 12
 {
9
-    public class MaterialItemsController : Controller
13
+    public class MaterialItemsController : BaseController
10 14
     {
11 15
         // GET: MaterialItems
12
-        public ActionResult Index()
16
+        public ActionResult GetList()
13 17
         {
14
-            return View();
18
+            ActionResult res = NoToken("未知错误,请重新登录");
19
+            string sql = " ";
20
+            DataTable dt = new DataTable();
21
+
22
+            string code = HttpUtility.UrlDecode(RequestString.GetQueryString("code"));
23
+            string strpageindex = RequestString.GetQueryString("page");
24
+            int pageindex = 1;
25
+            string strpagesize = RequestString.GetQueryString("pagesize");
26
+            int pagesize = 10;
27
+            if (code.Trim() != "")
28
+            {
29
+                sql += " and F_MaterialCode="+ code;
30
+            }
31
+            if (strpageindex.Trim() != "")
32
+            {
33
+                pageindex = Convert.ToInt32(strpageindex);
34
+            }
35
+
36
+            if (strpagesize.Trim() != "")
37
+            {
38
+                pagesize = Convert.ToInt32(strpagesize);
39
+            }
40
+            int recordCount = 0;
41
+            dt = BLL.PagerBLL.GetListPager(
42
+                "T_Wo_MaterialItems",
43
+                "F_Id",
44
+                "*",
45
+                sql,
46
+                "ORDER BY F_Id desc",
47
+                pagesize,
48
+                pageindex,
49
+                true,
50
+                out recordCount);
51
+
52
+            var obj = new
53
+            {
54
+                state = "success",
55
+                message = "成功",
56
+                rows = dt,
57
+                total = recordCount
58
+            };
59
+
60
+            res = Content(obj.ToJson());
61
+
62
+            return res;
63
+        }
64
+
65
+        /// <summary>
66
+        ///修改
67
+        /// </summary>
68
+        /// <returns></returns>
69
+        public ActionResult AddMaterialItem()
70
+        {
71
+            ActionResult res = NoToken("未知错误,请重新登录");
72
+            if (Request.IsAuthenticated)
73
+            {
74
+                int userId = CurrentUser.UserData.F_UserId;
75
+                if (userId != 0)
76
+                {
77
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
78
+                    if (ua != null)
79
+                    {
80
+                        int id = RequestString.GetInt("id", 0);
81
+                        string code = RequestString.GetFormString("code");
82
+                        string name = RequestString.GetFormString("name");
83
+                        string formula = RequestString.GetFormString("formula");
84
+                        int number = RequestString.GetInt("number", 0);
85
+                        int woid = RequestString.GetInt("woid", 0);
86
+                      
87
+
88
+                        Model.T_Wo_MaterialItems model = new Model.T_Wo_MaterialItems();
89
+
90
+                        if (id == 0)
91
+                        {
92
+                            model.F_MaterialCode = code;
93
+                            model.F_MaterialName = name;
94
+                            model.F_Formula = formula;
95
+                            model.F_ReturnQuantity = number;
96
+                            model.F_WoID = woid;                      
97
+                            model.F_CreateBy = ua.F_UserCode;
98
+                            model.F_CreateOn = DateTime.Now;
99
+
100
+                            if (new BLL.T_Wo_MaterialItems().Add(model) > 0)
101
+                            {
102
+                                res = Success("新增成功!");
103
+                            }
104
+                            else
105
+                            {
106
+                                res = Error("新增失败!");
107
+                            }
108
+                        }
109
+                        else
110
+                        {
111
+                            model = new BLL.T_Wo_MaterialItems().GetModel(id);
112
+                            if (model != null)
113
+                            {
114
+                                model.F_MaterialCode = code;
115
+                                model.F_MaterialName = name;
116
+                                model.F_Formula = formula;
117
+                                model.F_ReturnQuantity = number;
118
+                                model.F_WoID = woid;
119
+                                if (new BLL.T_Wo_MaterialItems().Update(model))
120
+                                {
121
+                                    res = Success("修改成功!");
122
+                                }
123
+                                else
124
+                                {
125
+                                    res = Error("修改失败!");
126
+                                }
127
+                            }
128
+                            else
129
+                            {
130
+                                res = Error("修改失败!");
131
+                            }
132
+                        }
133
+                    }
134
+                }
135
+
136
+            }
137
+            return res;
15 138
         }
139
+
140
+
141
+        /// <summary>
142
+        /// 删除
143
+        /// </summary>
144
+        /// <param name="ids"></param>
145
+        /// <returns></returns>
146
+        public ActionResult Delete(string[] ids)
147
+        {
148
+            ActionResult res = NoToken("未知错误,请重新登录");
149
+            if (Request.IsAuthenticated)
150
+            {
151
+
152
+                int userId = CurrentUser.UserData.F_UserId;
153
+                if (userId != 0)
154
+                {
155
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
156
+                    if (ua != null)
157
+                    {
158
+                        if (ids != null && ids.Length > 0)
159
+                        {
160
+                            string idd = " ";
161
+                            foreach (string str in ids)
162
+                            {
163
+                                idd += str + ",";
164
+                            }
165
+                            string sql = "delete from  T_Wo_MaterialItems  where F_Id in(" + idd.TrimEnd(',') + ")";
166
+                            if (!string.IsNullOrEmpty(idd.Trim()))
167
+                            {
168
+                                if (DbHelperSQL.ExecuteSql(sql) > 0)
169
+                                {
170
+                                    res = Success("删除成功");
171
+                                }
172
+                                else
173
+                                {
174
+                                    res = Error("删除失败");
175
+                                }
176
+                            }
177
+                            else
178
+                            {
179
+                                res = Error("请选择记录");
180
+                            }
181
+                        }
182
+                        else
183
+                        {
184
+                            res = Error("获取参数失败");
185
+                        }
186
+                    }
187
+                }
188
+            }
189
+            return res;
190
+        }
191
+
16 192
     }
17 193
 }

File diff suppressed because it is too large
+ 489 - 196
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs


+ 63 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

@@ -1,4 +1,5 @@
1
-using System;
1
+using CallCenterApi.Model;
2
+using System;
2 3
 using System.Collections.Generic;
3 4
 using System.Linq;
4 5
 using System.Web;
@@ -926,6 +927,65 @@ namespace CallCenterApi.Interface.Models.Input
926 927
         /// 投诉- 肥效类增加作物字段
927 928
         /// </summary>
928 929
         public string F_Crops { get; set; }
930
+
931
+        /// <summary>
932
+        /// 返厂车牌号
933
+        /// </summary>
934
+        public string F_CarNumber { get; set; }
935
+        /// <summary>
936
+        /// 装车费
937
+        /// </summary>
938
+        public decimal? F_LoadingFee { get; set; }
939
+        /// <summary>
940
+        /// 卸车费
941
+        /// </summary>
942
+        public decimal? F_UnLoadingFee { get; set; }
943
+        /// <summary>
944
+        /// 返料费
945
+        /// </summary>
946
+        public decimal? F_MaterialFee { get; set; }
947
+        /// <summary>
948
+        /// 事件原因
949
+        /// </summary>
950
+        public string F_EventReason { get; set; }
951
+
952
+        /// <summary>
953
+        /// 处理结果打分
954
+        /// </summary>
955
+        public int? F_VisitResultScore { get; set; }
956
+        /// <summary>
957
+        /// 处理时效得分
958
+        /// </summary>
959
+        public int? F_EffectiveScore { get; set; }
960
+        /// <summary>
961
+        /// 服务态度
962
+        /// </summary>
963
+        public int? F_ServiceAttitude { get; set; }
964
+        /// <summary>
965
+        /// 产品质量分数
966
+        /// </summary>
967
+        public int? F_ProductQuality { get; set; }
968
+        /// <summary>
969
+        /// NPS得分
970
+        /// </summary>
971
+        public int? F_NPS { get; set; }
972
+        /// <summary>
973
+        /// 评价结果
974
+        /// </summary>
975
+        public int? F_EvaluationResult { get; set; }
976
+
977
+        /// <summary>
978
+        /// 抽检类-样品邮寄单号
979
+        /// </summary>
980
+        public string F_MailingNumber { get; set; }
981
+        /// <summary>
982
+        /// 快递名称
983
+        /// </summary>
984
+        public string F_ExpressName { get; set; }
985
+
986
+        #region 多物料
987
+        public List<T_Wo_MaterialItems> MaterialItems { get; set; }
988
+        #endregion
929 989
     }
930 990
 }
931 991
 public class Questions
@@ -1451,7 +1511,7 @@ public class Product
1451 1511
     /// <summary>
1452 1512
     /// 业务员
1453 1513
     /// </summary>
1454
-    public string F_Salesman { set; get; }
1455
-   
1514
+    public string F_Salesman { set; get; }  
1515
+
1456 1516
 }
1457 1517
 

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

@@ -1,4 +1,5 @@
1 1
 using System;
2
+using System.Collections.Generic;
2 3
 using System.ComponentModel;
3 4
 
4 5
 namespace CallCenterApi.Model
@@ -117,6 +118,12 @@ namespace CallCenterApi.Model
117 118
         private string _f_dealcontent2;
118 119
         private int? _f_state2;
119 120
         private string _f_annotation2;
121
+        private int? _f_visitresultscore;
122
+        private int? _f_effectivescore;
123
+        private int? _f_serviceattitude;
124
+        private int? _f_productquality;
125
+        private int? _f_nps;
126
+        private int? _f_evaluationresult;
120 127
         public string F_Annotation
121 128
         {
122 129
             set { _f_annotation = value; }
@@ -953,7 +960,61 @@ namespace CallCenterApi.Model
953 960
             set { _f_annotation2 = value; }
954 961
             get { return _f_annotation2; }
955 962
         }
963
+
964
+        /// <summary>
965
+		/// 处理结果打分
966
+		/// </summary>
967
+		public int? F_VisitResultScore
968
+        {
969
+            set { _f_visitresultscore = value; }
970
+            get { return _f_visitresultscore; }
971
+        }
972
+        /// <summary>
973
+        /// 处理时效得分
974
+        /// </summary>
975
+        public int? F_EffectiveScore
976
+        {
977
+            set { _f_effectivescore = value; }
978
+            get { return _f_effectivescore; }
979
+        }
980
+        /// <summary>
981
+        /// 服务态度
982
+        /// </summary>
983
+        public int? F_ServiceAttitude
984
+        {
985
+            set { _f_serviceattitude = value; }
986
+            get { return _f_serviceattitude; }
987
+        }
988
+        /// <summary>
989
+        /// 产品质量分数
990
+        /// </summary>
991
+        public int? F_ProductQuality
992
+        {
993
+            set { _f_productquality = value; }
994
+            get { return _f_productquality; }
995
+        }
996
+        /// <summary>
997
+        /// NPS得分
998
+        /// </summary>
999
+        public int? F_NPS
1000
+        {
1001
+            set { _f_nps = value; }
1002
+            get { return _f_nps; }
1003
+        }
1004
+        /// <summary>
1005
+        /// 评价结果
1006
+        /// </summary>
1007
+        public int? F_EvaluationResult
1008
+        {
1009
+            set { _f_evaluationresult = value; }
1010
+            get { return _f_evaluationresult; }
1011
+        }
956 1012
         #endregion Model
1013
+
1014
+        #region 多物料
1015
+        public List<T_Wo_MaterialItems> MaterialItems { get; set; }
1016
+        #endregion
1017
+
957 1018
     }
958 1019
 
959 1020
     /// <summary>