duhongyu 6 gadi atpakaļ
vecāks
revīzija
e1fa418c0e

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Wo_QuestionManage.cs

@@ -64,7 +64,14 @@ namespace CallCenterApi.BLL
64 64
 
65 65
             return dal.GetModel(F_Id);
66 66
         }
67
+        /// <summary>
68
+        /// 得到一个对象实体
69
+        /// </summary>
70
+        public CallCenterApi.Model.T_Wo_QuestionManage GetModel(string F_QuestionName)
71
+        {
67 72
 
73
+            return dal.GetModel(F_QuestionName);
74
+        }
68 75
         /// <summary>
69 76
         /// 获得数据列表
70 77
         /// </summary>

+ 24 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_QuestionManage.cs

@@ -198,7 +198,31 @@ namespace CallCenterApi.DAL
198 198
             }
199 199
         }
200 200
 
201
+        /// <summary>
202
+        /// 得到一个对象实体
203
+        /// </summary>
204
+        public CallCenterApi.Model.T_Wo_QuestionManage GetModel(string F_QuestionName)
205
+        {
206
+
207
+            StringBuilder strSql = new StringBuilder();
208
+            strSql.Append("select  top 1 * from T_Wo_QuestionManage ");
209
+            strSql.Append(" where F_QuestionName=@F_QuestionName");
210
+            SqlParameter[] parameters = {
211
+                      new SqlParameter("@F_QuestionName",  SqlDbType.NVarChar,500)        
212
+        };
213
+            parameters[0].Value = F_QuestionName;
201 214
 
215
+            CallCenterApi.Model.T_Wo_QuestionManage model = new CallCenterApi.Model.T_Wo_QuestionManage();
216
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
217
+            if (ds.Tables[0].Rows.Count > 0)
218
+            {
219
+                return DataRowToModel(ds.Tables[0].Rows[0]);
220
+            }
221
+            else
222
+            {
223
+                return null;
224
+            }
225
+        }
202 226
         /// <summary>
203 227
         /// 得到一个对象实体
204 228
         /// </summary>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 914 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs


+ 224 - 87
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -98,39 +98,47 @@ namespace CallCenterApi.Interface.Controllers.weixin
98 98
                     #endregion
99 99
                         #region 部门角色
100 100
                         //部门角色(-1管理员,1接待部,2案场经理、项目负责人,3销售部总经理、物业部总经理、工程总经理、设计总经理,4区域客服,5业主(客户档案))
101
-                    if (user.F_RoleId == 17 || user.F_RoleId == 57)
101
+                    if (user.F_RoleId == 17 )
102 102
                     {
103 103
                         //-1管理员
104 104
                         UserType = -1;
105 105
                     }
106 106
                     else
107 107
                     {
108
-                        UserType = 0;
108
+                        if (user.F_RoleId == 58|| user.F_RoleId == 60 || user.F_RoleId == 62)
109
+                        {
110
+                            UserType = 0;
111
+                        }
112
+                        else
113
+                        {
114
+                            UserType = 1;
115
+                        }
116
+                       
109 117
                         #region
110 118
                         ////部门操作权限:1接待部,2办理人员,3区域客服,4监管
111
-                        //if (modelDep.F_Type == 1)
119
+                        //IF (MODELDEP.F_TYPE == 1)
112 120
                         //{
113 121
                         //    //1--接待部
114
-                        //    UserType = 1;
122
+                        //    USERTYPE = 1;
115 123
                         //}
116
-                        //else if (modelDep.F_Type == 2)
124
+                        //ELSE IF (MODELDEP.F_TYPE == 2)
117 125
                         //{
118 126
                         //    //2--办理人员
119
-                        //    UserType = 2;
127
+                        //    USERTYPE = 2;
120 128
                         //}
121
-                        //else if (modelDep.F_Type == 3)
129
+                        //ELSE IF (MODELDEP.F_TYPE == 3)
122 130
                         //{
123 131
                         //    //3--区域客服
124
-                        //    UserType = 3;
132
+                        //    USERTYPE = 3;
125 133
                         //}
126
-                        //else if (modelDep.F_Type == 4)
134
+                        //ELSE IF (MODELDEP.F_TYPE == 4)
127 135
                         //{
128 136
                         //    //4--监管
129
-                        //    UserType = 4;
137
+                        //    USERTYPE = 4;
130 138
                         //}
131
-                        //else
139
+                        //ELSE
132 140
                         //{
133
-                        //    UserType = 0;
141
+                        //    USERTYPE = 0;
134 142
                         //}
135 143
                         #endregion
136 144
                     }
@@ -143,7 +151,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
143 151
                         rolecode=rolecode,
144 152
                     };
145 153
 
146
-                    if (userAccountBLL.Update(user))
154
+                     if (userAccountBLL.Update(user))
147 155
                         return Success("绑定成功", obj);
148 156
                     else
149 157
                         return Error("绑定失败");
@@ -434,6 +442,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
434 442
         /// <summary>
435 443
         ///综合查询列表
436 444
         /// </summary>
445
+         [WechatActionFilter]
437 446
         public ActionResult GetList(string OpenId, string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
438 447
             string country, string township, string category, string salebase, string touser, int source = 0, int state = -1,int status=-1, int type = 0, int pageindex = 1, int pagesize = 10)
439 448
         {
@@ -448,8 +457,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
448 457
                 #region 筛选条件
449 458
                 if (type > 0 && type < 5)//工单类型
450 459
                     sql += $" and F_Type=" + type;
451
-                if (state >= 0)//工单状态
452
-                    sql += $" and F_State=" + state;
453 460
                 if (source > 0)//工单来源
454 461
                     sql += $" and F_Source=" + source;
455 462
                 if (!string.IsNullOrWhiteSpace(touser))//参与人
@@ -478,16 +485,23 @@ namespace CallCenterApi.Interface.Controllers.weixin
478 485
                     sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
479 486
                 if (!string.IsNullOrWhiteSpace(province))//乡
480 487
                     sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
481
-                sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
488
+             //   sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
482 489
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
483
-                switch (status)
490
+                switch (state)
484 491
                 {
485 492
                     case 0://待审批
486 493
                         string uwhere = "";
487 494
                        
488 495
                         if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL")
489 496
                         {
490
-                            sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetApprovalOrderID(ua,OpenId, ro.F_RoleCode) + ") "; ;
497
+                            if (GetApprovalOrderID(ua, OpenId, ro.F_RoleCode)!="")
498
+                            {
499
+                                sql += $"  and T_Wo_WorkOrder.F_ID in ( " + GetApprovalOrderID(ua, OpenId, ro.F_RoleCode) + ") "; ;
500
+                            }
501
+                            else
502
+                            {
503
+                                return Success("暂无工单"); ;
504
+                            }
491 505
                         }
492 506
                         else
493 507
                         {
@@ -530,7 +544,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
530 544
                         }
531 545
                         else
532 546
                         {
533
-
534 547
                             return Success("暂无工单"); ;
535 548
                         }
536 549
                         break;
@@ -541,7 +554,15 @@ namespace CallCenterApi.Interface.Controllers.weixin
541 554
                         sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
542 555
                         break;
543 556
                     case 3://我参与的
544
-                        sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
557
+                        if (GetCYWorkOrderID(ua.F_UserCode)!="")
558
+                        {
559
+                            sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
560
+                        }
561
+                        else
562
+                        {
563
+                            return Error("暂无工单");
564
+                        }
565
+                           
545 566
                         break;
546 567
                     case 6://待回访
547 568
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
@@ -557,7 +578,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
557 578
                     case 7://已回访
558 579
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
559 580
                         {
560
-                            sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
581
+                            if (GetCYWorkOrderID(ua.F_UserCode)!="")
582
+                            {
583
+                                sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
584
+                            }
585
+                            else
586
+                            {
587
+                                return Success("暂无工单"); ;
588
+                            }
561 589
                         }
562 590
                         else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
563 591
                         {
@@ -621,6 +649,17 @@ namespace CallCenterApi.Interface.Controllers.weixin
621 649
                         }
622 650
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" + "0" + "' "; ;
623 651
                         break;
652
+                    case 9://待接单
653
+                        if (GetDJDWorkOrderID(ua.F_UserCode) != "")
654
+                        {
655
+                            sql += $" and F_State=" + (int)EnumWorkOrderState.assign + $"  and T_Wo_WorkOrder.F_ID in ( " + GetDJDWorkOrderID(ua.F_UserCode) + ") "; ;
656
+                        }
657
+                        else
658
+                        {
659
+
660
+                            return Success("暂无工单"); ;
661
+                        }
662
+                        break;
624 663
                 }
625 664
                 #endregion
626 665
                 int recordCount = 0;
@@ -790,18 +829,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
790 829
             #region 获取接收人
791 830
             string deptname = "";
792 831
             string deptmodelsname = "";
793
-            var user = GetUser(OpenId);
794
-            var deptmodel = departmentBLL.GetModel(user.F_DeptId);
795
-            var deptmodels = departmentBLL.GetModel(nowUser.F_DeptId);
796
-            int wostate=0;
797
-            if (deptmodel != null)
798
-            {
799
-                deptname = deptmodel.F_DeptName + "-";
800
-            }
801
-            if (deptmodels != null)
802
-            {
803
-                deptmodelsname = deptmodels.F_DeptName + "-";
804
-            }
832
+            int wostate = 0;
805 833
             var toussers = "";
806 834
             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();
807 835
             if (itemlast != null)
@@ -811,6 +839,18 @@ namespace CallCenterApi.Interface.Controllers.weixin
811 839
             {
812 840
                 if (GetUser(OpenId) != null)
813 841
                 {
842
+                    var user = GetUser(OpenId);
843
+                    var deptmodel = departmentBLL.GetModel(user.F_DeptId);
844
+                    var deptmodels = departmentBLL.GetModel(nowUser.F_DeptId);
845
+                    if (deptmodel != null)
846
+                    {
847
+                        deptname = deptmodel.F_DeptName + "-";
848
+                    }
849
+                    if (deptmodels != null)
850
+                    {
851
+                        deptmodelsname = deptmodels.F_DeptName + "-";
852
+                    }
853
+
814 854
                     wostate = 0;
815 855
                     if (AuditState == 0)
816 856
                     {
@@ -939,7 +979,60 @@ namespace CallCenterApi.Interface.Controllers.weixin
939 979
             var res = AssignWO(ua, model, Input[0], "大区经理未审批流转市场管理科", 37, 0, 0, 0,0,0,0, time.ToString());
940 980
             return res;
941 981
         }
982
+        /// <summary>
983
+        /// 查询工单详情
984
+        /// </summary>
985
+        [WechatActionFilter]
986
+        public ActionResult GetDetails(string OpenId,int id)
987
+        {
988
+            if (!string.IsNullOrEmpty(OpenId))
989
+            {
990
+                var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + OpenId + "'").FirstOrDefault();
991
+               
992
+                string sql = "";
993
+                if (id > 0)
994
+                {
995
+                    sql += $" ( F_ID like '%" + id + "%' ) ";
996
+                }
997
+                else
998
+                    return Error("请输入正确的id");
999
+                var list = new List<Model.T_Wo_WorkOrder>();
1000
+                if (!string.IsNullOrWhiteSpace(sql))
1001
+                {
1002
+                    sql += " and F_IsDelete=0";
1003
+                    list = woBLL .GetModelList(sql);
1004
+                }
1005
+                var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
942 1006
 
1007
+                if (list.Count > 0)
1008
+                {
1009
+                    List<WorkOrderNewInput> Input = modeltooip(list,ua );
1010
+                    if (Input != null)
1011
+                    {
1012
+                        var obj = new
1013
+                        {
1014
+                            state = "success",
1015
+                            message = "成功",
1016
+                            rows = Input,
1017
+                            total = itemlasts,
1018
+                        };
1019
+
1020
+                        return Content(obj.ToJson());
1021
+                    }
1022
+                    else
1023
+                    {
1024
+                        return Error("没有查询到此工单");
1025
+                    }
1026
+                }
1027
+                else
1028
+                    return Error("没有查询到此工单");
1029
+
1030
+            }
1031
+            else
1032
+            {
1033
+                return Error("无操作权限!");
1034
+            }
1035
+        }
943 1036
         public string GetID(string str,long id)
944 1037
         {
945 1038
             if (str != "")
@@ -995,9 +1088,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
995 1088
 
996 1089
             string str = string.Empty;
997 1090
             #region 查询自己名下未审批的工单列表
998
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and ("
999
-                    + "(F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser='" + ua.F_UserCode  + "') "
1000
-                + ")" + " ");
1091
+            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
1092
+                    + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser='" + ua.F_UserCode  + "' "
1093
+                + "" + " ");
1001 1094
 
1002 1095
             foreach (var it in itemlast)
1003 1096
             {
@@ -1010,8 +1103,9 @@ namespace CallCenterApi.Interface.Controllers.weixin
1010 1103
                     }
1011 1104
                     else
1012 1105
                     {
1013
-                        GetID(str, it.F_WoID);
1106
+                        str = GetID(str, it.F_WoID);
1014 1107
                     }
1108
+                        
1015 1109
                  }
1016 1110
                else
1017 1111
                 {
@@ -1041,16 +1135,16 @@ namespace CallCenterApi.Interface.Controllers.weixin
1041 1135
                     }
1042 1136
                     else
1043 1137
                     {
1044
-                        GetID(str, it.F_WoID);
1138
+                        str = GetID(str, it.F_WoID);
1045 1139
                     }
1046 1140
                 }
1047 1141
             }
1048 1142
             #endregion
1049 1143
             if (F_RoleCode == "DQJL")
1050 1144
             {
1051
-                var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and ("
1052
-                  + "(F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
1053
-              + ")" + " ");
1145
+                var itemlasts = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_OptType=" + (int)EnumItemOpt.audit + " and "
1146
+                  + "F_WoState in(" + (int)EnumWorkOrderState.neworder + "," + (int)EnumWorkOrderState.reassign + ") and F_NextUser in ( " + GetDeptment(ua) + ") "
1147
+              + "" + " ");
1054 1148
                 foreach (var it in itemlasts)
1055 1149
                 {
1056 1150
                     float hours = (DateTime.Now - DateTime.Parse(it.F_CreateTime.ToString())).Hours;
@@ -1078,7 +1172,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1078 1172
                             AddLog(model.F_ID, model.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, ua.F_UserCode, ua.F_DeptId, ua, 0, 0);
1079 1173
                             if (hours < 48)
1080 1174
                             {
1081
-                                GetID(str, it.F_WoID);
1175
+                                str = GetID(str, it.F_WoID);
1082 1176
                             }
1083 1177
                             else
1084 1178
                             {
@@ -1148,7 +1242,21 @@ namespace CallCenterApi.Interface.Controllers.weixin
1148 1242
                             }
1149 1243
                             model.F_Salesman = cuModel.F_Salesman;
1150 1244
                             model.F_SalesPhone = cuModel.F_SalesPhone;
1245
+                            model.F_Legal = cuModel.F_Legal;
1246
+                            model.F_LegalPhone = cuModel.F_LegalPhone;
1247
+                            model.F_AddressProvince = cuModel.F_AddressProvince;
1248
+                            model.F_AddressCity = cuModel.F_AddressCity;
1249
+                            model.F_AddressCountry = cuModel.F_AddressCountry;
1250
+                            model.F_AddressTownship = cuModel.F_AddressTownship;
1251
+                            model.F_AddressFull = cuModel.F_AddressFull;
1151 1252
                             model.F_Brands = cuModel.F_Brands;
1253
+                            model.F_Channel = cuModel.F_Channel;
1254
+                            model.F_IsRunXLX = cuModel.F_IsRunXLX;
1255
+                            model.F_AnnualSales = cuModel.F_AnnualSales;
1256
+                            model.F_Formula = cuModel.F_Formula;
1257
+                            model.F_RaiseCrops = cuModel.F_RaiseCrops;
1258
+                            model.F_PlantingArea = cuModel.F_PlantingArea;
1259
+                            model.F_FertilizerBrand = cuModel.F_FertilizerBrand;
1152 1260
                         }
1153 1261
                     }
1154 1262
                     if (!valcode(model1[i].F_MaterialID.ToString(), 11))
@@ -1317,18 +1425,31 @@ namespace CallCenterApi.Interface.Controllers.weixin
1317 1425
                     model.F_IsVisit = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
1318 1426
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1319 1427
                     model.F_Highopinions = model1[i].F_Highopinions ;//高层处理意见
1320
-                    if (model1[i].F_AuditState == 0)
1321
-                    {
1322
-                        model.F_AuditState = "同意上报";
1323
-                    }
1324
-                    else if (model1[i].F_AuditState == 1)
1428
+                    model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
1429
+                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1430
+                    model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
1431
+                    model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
1432
+
1433
+                    if (model1[i].F_IsAudit==1)
1325 1434
                     {
1326
-                        model.F_AuditState = "驳回修订";
1435
+                        if (model1[i].F_AuditState == 0)
1436
+                        {
1437
+                            model.F_AuditState = "同意上报";
1438
+                        }
1439
+                        else if (model1[i].F_AuditState == 1)
1440
+                        {
1441
+                            model.F_AuditState = "驳回修订";
1442
+                        }
1443
+                        else
1444
+                        {
1445
+                            model.F_AuditState = "强制结案";
1446
+                        }
1327 1447
                     }
1328
-                   else
1448
+                    else
1329 1449
                     {
1330
-                        model.F_AuditState = "强制结案";
1450
+                        model.F_AuditState = "";
1331 1451
                     }
1452
+                   
1332 1453
                     model.F_AuditBy = model1[i].F_AuditBy;//审核人
1333 1454
                     model.F_AuditOn = model1[i].F_AuditOn;//审核时间
1334 1455
                     model.F_AuditCont = model1[i].F_AuditCont;//审核内容
@@ -1341,6 +1462,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1341 1462
                             model.F_DeptName = deptmodel.F_DeptName;
1342 1463
                         }
1343 1464
                     #endregion
1465
+                    Input.Add(model);
1344 1466
                 }
1345 1467
                 return Input;
1346 1468
             }
@@ -1497,6 +1619,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1497 1619
         /// </summary>
1498 1620
         /// <param name="OpenId"></param>
1499 1621
         /// <returns></returns>
1622
+        [WechatActionFilter]
1500 1623
         public ActionResult GetDpment(string OpenId)
1501 1624
         {
1502 1625
             if (!string.IsNullOrEmpty(OpenId))
@@ -1604,9 +1727,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
1604 1727
         /// <summary>
1605 1728
         /// 根据传入的对象和input的内容返回对象(添加修改使用)
1606 1729
         /// </summary>
1607
-        private Model.T_Wo_WorkOrder inputtoobj(Model.T_Wo_WorkOrder model, WorkOrderNewInput input, int type)
1730
+        private Model.T_Wo_WorkOrder inputtoobj(Model.T_Sys_UserAccount  ua ,Model.T_Wo_WorkOrder model, WorkOrderNewInput input, int type)
1608 1731
         {
1609
-            string usercode = CurrentUser.UserData.F_UserCode;
1732
+            string usercode = "";
1733
+            if (ua !=null )
1734
+            {
1735
+                usercode = ua.F_UserCode;
1736
+            }
1610 1737
             var newmodel = model;
1611 1738
             if (input.F_ID != 0)
1612 1739
                 model.F_ID = input.F_ID;
@@ -1715,6 +1842,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1715 1842
         /// 添加工单
1716 1843
         /// </summary>
1717 1844
         /// <returns></returns>
1845
+        [WechatActionFilter]
1718 1846
         public ActionResult Add(WorkOrderNewInput input,float overtime = 0, int sms = 0)                     
1719 1847
         {
1720 1848
           
@@ -1723,12 +1851,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
1723 1851
                 var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + input.F_WxOpenId + "'").FirstOrDefault();
1724 1852
                 //     string usercode = CurrentUser.UserData.F_UserCode;
1725 1853
                 //   Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
1726
-                if (ua != null)
1854
+                if (ua == null&&input .F_Source !=3)
1727 1855
                 {
1728
-                    #region 添加验证判断
1856
+                    return Error("无操作权限!");
1857
+                }
1729 1858
                     if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
1730 1859
                     {
1731
-                        return Error("请输入正确的工单批次号!");
1860
+                        return Error("请输入正确的生产批次号!");
1732 1861
                     }
1733 1862
                     else
1734 1863
                     {
@@ -1741,13 +1870,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
1741 1870
                                 var protime = Convert.ToDateTime(pronos);
1742 1871
                                 if (DateTime.Parse(pronos) > DateTime.Now)
1743 1872
                                 {
1744
-                                    return Error("工单批次号错误,生产日期不能大于当前时间!");
1873
+                                    return Error("生产批次号错误,生产日期不能大于当前时间!");
1745 1874
                                 }
1746 1875
 
1747 1876
                             }
1748 1877
                             catch
1749 1878
                             {
1750
-                                return Error("工单批次号错误,日期格式错误!");
1879
+                                return Error("生产批次号错误,日期格式错误!");
1751 1880
                             }
1752 1881
                         }
1753 1882
                     }
@@ -1755,10 +1884,10 @@ namespace CallCenterApi.Interface.Controllers.weixin
1755 1884
                         return Error("客户编号为10为纯数字!");
1756 1885
                     if (input.F_MaterialID > 0 && !valcode(input.F_CustomerID.ToString(), 11))
1757 1886
                         return Error("物料编码为11为纯数字!");
1758
-                    #endregion
1887
+                  
1759 1888
                     var model = new Model.T_Wo_WorkOrder();
1760 1889
                     #region 保存客户基本信息
1761
-                    model = inputtoobj(model, input, 2);
1890
+                    model = inputtoobj(ua,model, input, 2);
1762 1891
                   
1763 1892
                     #endregion
1764 1893
                     long n = woBLL.Add(model);
@@ -1770,44 +1899,40 @@ namespace CallCenterApi.Interface.Controllers.weixin
1770 1899
                         List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
1771 1900
                         if (modlelist!=null && modlelist.Count >0)
1772 1901
                         {
1773
-                            if (GetUser (input.F_WxOpenId)!=null )
1902
+                        if (ua !=null )
1903
+                        {
1904
+                            if (GetUser(input.F_WxOpenId) != null)
1774 1905
                             {
1775 1906
                                 var user = GetUser(input.F_WxOpenId);
1776 1907
                                 string deptname = "";
1777 1908
                                 var deptmodel = departmentBLL.GetModel(user.F_DeptId);
1778 1909
                                 if (deptmodel != null)
1779
-                                { 
1910
+                                {
1780 1911
                                     deptname = deptmodel.F_DeptName + "-";
1781 1912
                                 }
1782
-                                AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode , user.F_DeptId , user, 0, 0);
1913
+                                AddLog(modlelist[0].F_ID, modlelist[0].F_State.Value, deptname + user.F_UserName + "(" + user.F_UserCode + ")" + "待审批", (int)EnumItemType.audit, (int)EnumItemOpt.audit, user.F_UserCode, user.F_DeptId, user, 0, 0);
1783 1914
                             }
1784 1915
                             else
1785 1916
                             {
1786
-                                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
1787
-                                if (ro.F_RoleCode == "DQJL")
1788
-                                {
1789
-                                    var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, overtime, sms);
1790
-                                    if (res)
1791
-                                        return Success("添加成功");
1792
-                                    else
1793
-                                        return Error("市场管理科接收失败!");
1794
-                                }
1917
+                                var res = AssignWO(ua, model, input, "流转市场管理科", 37, 0, overtime, sms);
1918
+                                if (res)
1919
+                                    return Success("添加成功");
1795 1920
                                 else
1796
-                                {
1797
-                                    return Error("工单流转失败,请确认登录账号!");
1798
-                                }
1921
+                                    return Error("市场管理科接收失败!");
1799 1922
                             }
1800 1923
                         }
1924
+                        else
1925
+                        {
1926
+                            return Success("添加成功");
1927
+                        }
1928
+                            
1929
+                        }
1801 1930
                         #endregion
1802 1931
                         return Success("添加成功!");
1803 1932
                     }
1804 1933
                     else
1805 1934
                         return Error("添加失败!");
1806
-                }
1807
-                else
1808
-                {
1809
-                    return Error("无操作权限!");
1810
-                }
1935
+         
1811 1936
              
1812 1937
             }
1813 1938
             else
@@ -1877,6 +2002,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1877 2002
         /// </summary>
1878 2003
         /// <returns></returns>
1879 2004
         [Authority]
2005
+        [WechatActionFilter]
1880 2006
         public ActionResult AssignWorkOrder(string OpenId, long orderid, string cont, WorkOrdeDeptment deptment, int isvisit = 1,
1881 2007
             float overtime = 0, int sms = 0, int clbm = 0, int clid = 0,int isApprovalp=0, int hclbm = 0, int hclid = 0)
1882 2008
         {
@@ -2108,6 +2234,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2108 2234
         /// <summary>
2109 2235
         /// 查询超时工单列表
2110 2236
         /// </summary>
2237
+        [WechatActionFilter]
2111 2238
         public ActionResult GetOvertime(string OpenId, string code, string keywords, string cusname, string cusphone, string companyname, string province, string city,
2112 2239
             string country, string township, string touser, int source = 0, int type = 0, int pageindex = 1, int pagesize = 10)
2113 2240
         {
@@ -2245,6 +2372,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2245 2372
         /// 获取催办工单列表
2246 2373
         /// </summary>
2247 2374
         /// <returns></returns>
2375
+        [WechatActionFilter]
2248 2376
         public ActionResult GetUrgeList(string  OpenId,string code, string cusname, string keywords, string cusphone, string companyname, string province, string city,
2249 2377
             string country, string township, string touser, int source = -1, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10)
2250 2378
         {
@@ -2448,6 +2576,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2448 2576
         /// </summary>
2449 2577
         /// <returns></returns>
2450 2578
         [Authority]
2579
+        [WechatActionFilter]
2451 2580
         public ActionResult SureWorkOrder(long orderid, string OpenId)
2452 2581
         {
2453 2582
             if (!string.IsNullOrEmpty(OpenId))
@@ -2479,6 +2608,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2479 2608
         /// <param name="input"></param>
2480 2609
         /// <returns></returns>
2481 2610
         [Authority]
2611
+        [WechatActionFilter]
2482 2612
         public ActionResult HigApprovalOrder(string OpenId, long orderid,string cont)
2483 2613
         {
2484 2614
             if (!string.IsNullOrEmpty(OpenId))
@@ -2574,7 +2704,8 @@ namespace CallCenterApi.Interface.Controllers.weixin
2574 2704
         /// </summary>
2575 2705
         /// <returns></returns>
2576 2706
         [Authority]
2577
-        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment,
2707
+        [WechatActionFilter]
2708
+        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment, string dealType,
2578 2709
        string uncont = "",
2579 2710
      int isvisit = 1, int isover = 0)
2580 2711
         {
@@ -2647,7 +2778,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2647 2778
                     }
2648 2779
                     if (model != null)
2649 2780
                     {
2650
-                        var res = DealWO(ua, model, input, cont, isover, uncont);
2781
+                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
2651 2782
                         if (res)
2652 2783
                             return Success("处理成功");
2653 2784
                         else
@@ -2665,6 +2796,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2665 2796
         /// <param name="input"></param>
2666 2797
         /// <returns></returns>
2667 2798
         [Authority]
2799
+        [WechatActionFilter]
2668 2800
         public ActionResult BackWorkOrder(string OpenId,long orderid, string cont, int type = 0)
2669 2801
         {//办理人员和监管可以退回工单
2670 2802
             if (!string.IsNullOrEmpty(OpenId))
@@ -2695,6 +2827,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2695 2827
         /// <param name="input"></param>
2696 2828
         /// <returns></returns>
2697 2829
         [Authority]
2830
+        [WechatActionFilter]
2698 2831
         public ActionResult ReturnvisitOrder(string OpenId, long orderid, string cont, string reason, string call, int isover = 0)
2699 2832
         {
2700 2833
             if (!string.IsNullOrEmpty(OpenId))
@@ -2723,6 +2856,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2723 2856
         /// <param name="input"></param>
2724 2857
         /// <returns></returns>
2725 2858
         [Authority]
2859
+        [WechatActionFilter]
2726 2860
         public ActionResult EndOrder(string OpenId,long orderid, int isover = 0)
2727 2861
         {
2728 2862
             if (!string.IsNullOrEmpty(OpenId))
@@ -2750,6 +2884,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2750 2884
         /// </summary>
2751 2885
         /// <returns></returns>
2752 2886
         [Authority]
2887
+        [WechatActionFilter]
2753 2888
         public ActionResult DelayWorkOrder(string OpenId,long orderid, string cont, float limit = 0)
2754 2889
         {
2755 2890
             if (!string.IsNullOrEmpty(OpenId))
@@ -2777,6 +2912,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2777 2912
         /// 催办工单
2778 2913
         /// </summary>
2779 2914
         /// <returns></returns>
2915
+        [WechatActionFilter]
2780 2916
         public ActionResult AddWorkOrderRemind(string OpenId,long orderid, string cont)
2781 2917
         {
2782 2918
             if (!string.IsNullOrEmpty(OpenId))
@@ -3099,7 +3235,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3099 3235
         /// <summary>
3100 3236
         /// 处理工单
3101 3237
         /// </summary>
3102
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string uncont = "")
3238
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string dealType = "", string uncont = "")
3103 3239
         {
3104 3240
             #region 工单处理
3105 3241
             int overtime = 0, sms = 0;
@@ -3150,7 +3286,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3150 3286
             {
3151 3287
                 #region 处理工单
3152 3288
                 model.F_State = wostate;
3153
-
3289
+                model.F_DealType = dealType;
3154 3290
                 //处理内容
3155 3291
                 if (!string.IsNullOrEmpty(cont))
3156 3292
                     model.F_DealContent += cont + ";";
@@ -3251,6 +3387,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3251 3387
         /// 修改工单
3252 3388
         /// </summary>
3253 3389
         /// <returns></returns>
3390
+        [WechatActionFilter]
3254 3391
         public ActionResult Update(WorkOrderNewInput input)
3255 3392
         {
3256 3393
             var ua = userAccountBLL.GetModelList(" F_WxOpenId='" + input.F_WxOpenId + "'").FirstOrDefault();
@@ -3263,7 +3400,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3263 3400
                     return Error("工单类型错误!");
3264 3401
                 if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
3265 3402
                 {
3266
-                    return Error("请输入正确的工单批次号!");
3403
+                    return Error("请输入正确的生产批次号!");
3267 3404
                 }
3268 3405
                 else
3269 3406
                 {
@@ -3276,13 +3413,13 @@ namespace CallCenterApi.Interface.Controllers.weixin
3276 3413
                             var protime = Convert.ToDateTime(pronos);
3277 3414
                             if (DateTime.Parse(pronos) > DateTime.Now)
3278 3415
                             {
3279
-                                return Error("工单批次号错误,生产日期不能大于当前时间!");
3416
+                                return Error("生产批次号错误,生产日期不能大于当前时间!");
3280 3417
                             }
3281 3418
 
3282 3419
                         }
3283 3420
                         catch
3284 3421
                         {
3285
-                            return Error("工单批次号错误,日期格式错误!");
3422
+                            return Error("生产批次号错误,日期格式错误!");
3286 3423
                         }
3287 3424
                     }
3288 3425
                 }
@@ -3293,7 +3430,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3293 3430
                 #endregion
3294 3431
                 var model = woBLL.GetModel(input.F_ID);
3295 3432
                 #region 保存客户基本信息
3296
-                model = inputtoobj(model, input, 1);
3433
+                model = inputtoobj(ua,model, input, 1);
3297 3434
                 #endregion
3298 3435
                 bool n = woBLL.Update(model);
3299 3436
                 if (n)

+ 2 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -9,6 +9,7 @@ using System;
9 9
 using System.Collections.Generic;
10 10
 using System.Data;
11 11
 using System.Linq;
12
+using System.Text.RegularExpressions;
12 13
 using System.Web;
13 14
 using System.Web.Mvc;
14 15
 
@@ -161,6 +162,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
161 162
             }
162 163
             return Error("加载失败");
163 164
         }
165
+
164 166
         /// <summary>
165 167
         /// tree  树形部门
166 168
         /// </summary>

+ 38 - 13
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -158,7 +158,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
158 158
                         sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
159 159
                         break;
160 160
                     case 4://待回访
161
-                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
161
+                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
162 162
                         {
163 163
                             uwhere = "";
164 164
                         }
@@ -169,7 +169,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
169 169
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
170 170
                         break;
171 171
                     case 6://已回访
172
-                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
172
+                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
173 173
                         {
174 174
                             sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
175 175
                         }
@@ -225,7 +225,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
225 225
                         sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate ;
226 226
                         break;
227 227
                     case 7://待完结
228
-                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX")
228
+                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
229 229
                         {
230 230
                             uwhere = ""; ;
231 231
                         }
@@ -249,6 +249,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
249 249
                             return Success("暂无工单"); ;
250 250
                         }
251 251
                         break;
252
+                    case 9://微信工单
253
+                        sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ")) ";
254
+                        sql += $" and F_Source in(2,3)" + " " ;
255
+                        break;
252 256
                 }
253 257
                 #endregion
254 258
                 int recordCount = 0;
@@ -1206,7 +1210,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1206 1210
                     return Error("工单类型错误!");
1207 1211
                 if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
1208 1212
                 {
1209
-                    return Error("请输入正确的工单批次号!");
1213
+                    return Error("请输入正确的生产批次号!");
1210 1214
                 }
1211 1215
                 else
1212 1216
                 {
@@ -1219,13 +1223,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
1219 1223
                             var protime = Convert.ToDateTime(pronos);
1220 1224
                             if (DateTime.Parse(pronos) > DateTime.Now)
1221 1225
                             {
1222
-                                return Error("工单批次号错误,生产日期不能大于当前时间!");
1226
+                                return Error("生产批次号错误,生产日期不能大于当前时间!");
1223 1227
                             }
1224 1228
 
1225 1229
                         }
1226 1230
                         catch
1227 1231
                         {
1228
-                            return Error("工单批次号错误,日期格式错误!");
1232
+                            return Error("生产批次号错误,日期格式错误!");
1229 1233
                         }
1230 1234
                     }
1231 1235
                 }
@@ -1336,7 +1340,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
1336 1340
                     return Error("工单类型错误!");
1337 1341
                 if (!string.IsNullOrEmpty(input.F_BatchNumber) && !vaBatchNumber(input.F_BatchNumber))
1338 1342
                 {
1339
-                    return Error("请输入正确的工单批次号!");
1343
+                    return Error("请输入正确的生产批次号!");
1340 1344
                 }
1341 1345
                 else
1342 1346
                 {
@@ -1349,13 +1353,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
1349 1353
                             var protime = Convert.ToDateTime(pronos);
1350 1354
                             if (DateTime.Parse(pronos) > DateTime.Now)
1351 1355
                             {
1352
-                                return Error("工单批次号错误,生产日期不能大于当前时间!");
1356
+                                return Error("生产批次号错误,生产日期不能大于当前时间!");
1353 1357
                             }
1354 1358
 
1355 1359
                         }
1356 1360
                         catch
1357 1361
                         {
1358
-                            return Error("工单批次号错误,日期格式错误!");
1362
+                            return Error("生产批次号错误,日期格式错误!");
1359 1363
                         }
1360 1364
                     }
1361 1365
                 }
@@ -1461,7 +1465,21 @@ namespace CallCenterApi.Interface.Controllers.workorder
1461 1465
                             }
1462 1466
                             model.F_Salesman = cuModel.F_Salesman;
1463 1467
                             model.F_SalesPhone = cuModel.F_SalesPhone;
1468
+                            model.F_Legal = cuModel.F_Legal;
1469
+                            model.F_LegalPhone = cuModel.F_LegalPhone;
1470
+                            model.F_AddressProvince = cuModel.F_AddressProvince;
1471
+                            model.F_AddressCity = cuModel.F_AddressCity;
1472
+                            model.F_AddressCountry = cuModel.F_AddressCountry;
1473
+                            model.F_AddressTownship = cuModel.F_AddressTownship;
1474
+                            model.F_AddressFull = cuModel.F_AddressFull;
1464 1475
                             model.F_Brands = cuModel.F_Brands;
1476
+                            model.F_Channel = cuModel.F_Channel;
1477
+                            model.F_IsRunXLX = cuModel.F_IsRunXLX;
1478
+                            model.F_AnnualSales = cuModel.F_AnnualSales;
1479
+                            model.F_Formula = cuModel.F_Formula;
1480
+                            model.F_RaiseCrops = cuModel.F_RaiseCrops;
1481
+                            model.F_PlantingArea = cuModel.F_PlantingArea;
1482
+                            model.F_FertilizerBrand = cuModel.F_FertilizerBrand;
1465 1483
                         }
1466 1484
                     }
1467 1485
                     if (!valcode(model1[i].F_MaterialID.ToString(), 11))
@@ -1639,6 +1657,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
1639 1657
 
1640 1658
                     model.F_IsAudit = model1[i].F_IsAudit;//是否审核
1641 1659
                     model.F_Highopinions = model1[i].F_Highopinions;//高层处理意见
1660
+
1661
+                  
1662
+                    model.F_CreateOn = model1[i].F_CreateOn; ;//添加时间
1663
+                    model.F_CreateBy = model1[i].F_CreateBy; ;//添加人
1664
+                    model.F_UpdateBy = model1[i].F_UpdateBy;//修改人工号
1665
+                    model.F_UpdateOn = model1[i].F_UpdateOn; ;//修改人工号
1666
+                   
1642 1667
                     if (model1[i].F_AuditState == 0)
1643 1668
                     {
1644 1669
                         model.F_AuditState = "同意上报";
@@ -2245,7 +2270,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2245 2270
         /// </summary>
2246 2271
         /// <returns></returns>
2247 2272
         [Authority]
2248
-        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
2273
+        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,string dealType,
2249 2274
             string uncont="",
2250 2275
           int isvisit=1,  int isover = 0)
2251 2276
         {
@@ -2319,7 +2344,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2319 2344
                     }
2320 2345
                     if (model != null)
2321 2346
                     {
2322
-                        var res = DealWO(ua, model, input, cont, isover, uncont);
2347
+                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
2323 2348
                         if (res)
2324 2349
                             return Success("处理成功");
2325 2350
                         else
@@ -2807,7 +2832,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2807 2832
         /// <summary>
2808 2833
         /// 处理工单
2809 2834
         /// </summary>
2810
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont,int isover = 0,string uncont="")
2835
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input,string cont,int isover = 0,string dealType="",string uncont="")
2811 2836
         {
2812 2837
             #region 工单处理
2813 2838
             int overtime = 0, sms = 0;
@@ -2858,7 +2883,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2858 2883
             {
2859 2884
                 #region 处理工单
2860 2885
                 model.F_State  = wostate;
2861
-              
2886
+                model.F_DealType  = dealType;
2862 2887
                 //处理内容
2863 2888
                 if (!string.IsNullOrEmpty(cont))
2864 2889
                     model.F_DealContent += cont + ";";

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

@@ -186,6 +186,56 @@ namespace CallCenterApi.Interface.Models.Input
186 186
         /// 产品
187 187
         /// </summary>
188 188
         public string F_Brands { set; get; }
189
+
190
+        /// <summary>
191
+        /// 法人
192
+        /// </summary>
193
+        public string F_Legal { set; get; }
194
+        /// <summary>
195
+        /// 法人电话
196
+        /// </summary>
197
+        public string F_LegalPhone { set; get; }
198
+        /// <summary>
199
+        /// 省
200
+        /// </summary>
201
+        public string F_AddressProvince { set; get; }
202
+        /// <summary>
203
+        /// 市
204
+        /// </summary>
205
+        public string F_AddressCity { set; get; }
206
+        /// <summary>
207
+        /// 县
208
+        /// </summary>
209
+        public string F_AddressCountry { set; get; }
210
+        /// <summary>
211
+        /// 乡
212
+        /// </summary>
213
+        public string F_AddressTownship { set; get; }  /// <summary>
214
+        /// 详细地址
215
+        /// </summary>
216
+        public string F_AddressFull { set; get; }
217
+        /// <summary>
218
+        /// 渠道类型
219
+        /// </summary>
220
+        public string F_Channel { set; get; }
221
+        /// 是否经营心连心
222
+        /// </summary>
223
+        public string F_IsRunXLX { set; get; }
224
+        /// 年销量
225
+        /// </summary>
226
+        public string F_AnnualSales { set; get; }
227
+        /// 配方
228
+        /// </summary>
229
+        public string F_Formula { set; get; }
230
+        /// 种植作物
231
+        /// </summary>
232
+        public string F_RaiseCrops { set; get; }
233
+        /// 种植面积
234
+        /// </summary>
235
+        public string F_PlantingArea { set; get; }
236
+        /// 用肥品牌
237
+        /// </summary>
238
+        public string F_FertilizerBrand { set; get; }
189 239
         /// <summary>
190 240
         /// 物料id
191 241
         /// </summary>
@@ -684,3 +734,524 @@ namespace CallCenterApi.Interface.Models.Input
684 734
         }
685 735
     }
686 736
 }
737
+public class Questions
738
+{
739
+    /// <summary>
740
+    /// 创建时间
741
+    /// </summary>
742
+    public string CreatOn { get; set; }
743
+    /// <summary>
744
+    /// 销售基地
745
+    /// </summary>
746
+    public string SalesBase { get; set; }
747
+    /// <summary>
748
+    /// 渠道类型
749
+    /// </summary>
750
+    public string Channel { get; set; }
751
+    /// <summary>
752
+    /// 反馈类型
753
+    /// </summary>
754
+    public string Type { get; set; }
755
+
756
+    /// <summary>
757
+    /// 费用
758
+    /// </summary>
759
+    public string Money { get; set; }
760
+
761
+    /// <summary>
762
+    /// 大区名称
763
+    /// </summary>
764
+    public string AreaName { set; get; }
765
+    /// <summary>
766
+    /// 分公司名称
767
+    /// </summary>
768
+    public string BranchName { set; get; }
769
+    /// <summary>
770
+    /// 业务员
771
+    /// </summary>
772
+    public string Salesman { set; get; }
773
+    /// <summary>
774
+    /// 品牌
775
+    /// </summary>
776
+    public string Brands { set; get; }
777
+    /// <summary>
778
+    /// 产品
779
+    /// </summary>
780
+    public string Category { set; get; }
781
+    /// <summary>
782
+    /// 超时时限
783
+    /// </summary>
784
+    public string Overtime { set; get; }
785
+    /// <summary>
786
+    /// 回访与否
787
+    /// </summary>
788
+    public string Isvisit { set; get; }
789
+    /// <summary>
790
+    /// 关闭与否
791
+    /// </summary>
792
+    public string IsClose { set; get; }
793
+}
794
+public class WorkOrderComplaint
795
+{
796
+    /// <summary>
797
+    /// 客户姓名
798
+    /// </summary>
799
+    public string F_CusName
800
+    {
801
+        get; set;
802
+    }
803
+    /// <summary>
804
+    /// 客户电话
805
+    /// </summary>
806
+    public string F_CusPhone
807
+    {
808
+        get; set;
809
+    }
810
+    /// <summary>
811
+    /// 公司名称
812
+    /// </summary>
813
+    public string F_CompanyName
814
+    {
815
+        get; set;
816
+    }
817
+    /// <summary>
818
+    /// 事发地-省
819
+    /// </summary>
820
+    public string F_IncidentProvince
821
+    {
822
+        get; set;
823
+    }
824
+    /// <summary>
825
+    /// 事发地-市
826
+    /// </summary>
827
+    public string F_IncidentCity
828
+    {
829
+        get; set;
830
+    }
831
+    /// <summary>
832
+    /// 事发地-县
833
+    /// </summary>
834
+    public string F_IncidentCountry
835
+    {
836
+        get; set;
837
+    }
838
+    /// <summary>
839
+    /// 事发地-乡
840
+    /// </summary>
841
+    public string F_IncidentTownship
842
+    {
843
+        get; set;
844
+    }
845
+    /// <summary>
846
+    /// 事发地-详细
847
+    /// </summary>
848
+    public string F_IncidentDetailed
849
+    {
850
+        get; set;
851
+    }
852
+    /// <summary>
853
+    /// 销售基地:新乡、新疆、九江、东北、其他
854
+    /// </summary>
855
+    public string F_SalesBase
856
+    {
857
+        get; set;
858
+    }
859
+    /// <summary>
860
+    /// 大区名称
861
+    /// </summary>
862
+    public string F_AreaName { set; get; }
863
+    /// <summary>
864
+    /// 分公司名称
865
+    /// </summary>
866
+    public string F_BranchName { set; get; }
867
+    /// <summary>
868
+    /// 业务员
869
+    /// </summary>
870
+    public string F_Salesman { set; get; }
871
+
872
+    /// <summary>
873
+    /// 问题描述
874
+    /// </summary>
875
+    public string F_Description
876
+    {
877
+        get; set;
878
+    }
879
+    /// <summary>
880
+    /// 问题类别1
881
+    /// </summary>
882
+    public string F_QuestionTypeone
883
+    {
884
+        get; set;
885
+    }
886
+    /// <summary>
887
+    /// 问题类别2
888
+    /// </summary>
889
+    public string F_QuestionTypetwo
890
+    {
891
+        get; set;
892
+    }
893
+    /// <summary>
894
+    /// 问题类别3
895
+    /// </summary>
896
+    public string F_QuestionTypethree
897
+    {
898
+        get; set;
899
+    }
900
+    /// <summary>
901
+    /// 客户编号
902
+    /// </summary>
903
+    public int? F_CustomerID
904
+    {
905
+        get; set;
906
+    }
907
+    /// <summary>
908
+    /// 物料编码
909
+    /// </summary>
910
+    public int F_MaterialID
911
+    {
912
+        get; set;
913
+    }
914
+    /// <summary>
915
+    /// 物料名称
916
+    /// </summary>
917
+    public string F_MaterialName { get; set; }
918
+    /// <summary>
919
+    /// 型号
920
+    /// </summary>
921
+    public string F_Model { get; set; }
922
+    /// <summary>
923
+    /// 规格
924
+    /// </summary>
925
+    public string F_Specs { get; set; }
926
+    /// <summary>
927
+    /// 一级分类
928
+    /// </summary>
929
+    public string F_Level1 { get; set; }
930
+    /// <summary>
931
+    /// 二级分类
932
+    /// </summary>
933
+    public string F_Level2 { get; set; }
934
+    /// <summary>
935
+    /// 三级分类
936
+    /// </summary>
937
+    public string F_Level3 { get; set; }
938
+    /// <summary>
939
+    /// 品牌
940
+    /// </summary>
941
+    public string F_Brand { get; set; }
942
+    /// <summary>
943
+    /// 复合肥肥效
944
+    /// </summary>
945
+    public string F_MaterialEffect { get; set; }
946
+    /// <summary>
947
+    /// 产品线
948
+    /// </summary>
949
+    public string F_Pipeline { get; set; }
950
+    /// <summary>
951
+    /// 工艺
952
+    /// </summary>
953
+    public string F_Craft { get; set; }
954
+
955
+    /// <summary>
956
+    /// 生产批次号
957
+    /// </summary>
958
+    public string F_BatchNumber
959
+    {
960
+        get; set;
961
+    }
962
+    /// <summary>
963
+    /// 投诉-问题数量(吨)
964
+    /// </summary>
965
+    public string F_TS_Quantity
966
+    {
967
+        get; set;
968
+    }
969
+    /// <summary>
970
+    /// 市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
971
+    /// </summary>
972
+    public string F_SC_ProductBase
973
+    {
974
+        get; set;
975
+    }
976
+    /// <summary>
977
+    /// 市场管理科-初审意见:退货、换货、补偿、自行处理
978
+    /// </summary>
979
+    public string F_SC_PreliminaryOpinion
980
+    {
981
+        get; set;
982
+    }
983
+    /// <summary>
984
+    /// 市场管理科-超出质保期限(算法:工单创建日期-生产日期,生产日期根据生产批次号获取,单位:月)
985
+    /// </summary>
986
+    public string F_SC_QualityMonth
987
+    {
988
+        get; set;
989
+    }
990
+    /// <summary>
991
+    /// 质量管理科-质量事件等级(未遂、一般、较大、重大)
992
+    /// </summary>
993
+    public string F_ZL_QualityEventLevel
994
+    {
995
+        get; set;
996
+    }
997
+    /// <summary>
998
+    /// 质量管理科-索赔金额(单位元,对应责任单位)
999
+    /// </summary>
1000
+    public string F_ZL_ClaimAmount
1001
+    {
1002
+        get; set;
1003
+    }
1004
+    /// <summary>
1005
+    /// 质量管理科-责任单位(需列出,可选多个)
1006
+    /// </summary>
1007
+    public string F_ZL_ResponsibleUnit
1008
+    {
1009
+        get; set;
1010
+    }
1011
+    /// <summary>
1012
+    /// 质量管理科-审批意见(同意、不同意,若选择不同意,增加输入框输入补充内容)
1013
+    /// </summary>
1014
+    public string F_ZL_ApprovalOpinions
1015
+    {
1016
+        get; set;
1017
+    }
1018
+    /// <summary>
1019
+    /// 质量管理科-审批不同意意见
1020
+    /// </summary>
1021
+    public string F_ZL_ApprovalDisagree
1022
+    {
1023
+        get; set;
1024
+    }
1025
+    /// <summary>
1026
+    /// 质量管理科-补偿方式(实物、钱款【单位元】,若选择钱款,增加输入框输入补充内容)
1027
+    /// </summary>
1028
+    public string F_ZL_CompensationMethod
1029
+    {
1030
+        get; set;
1031
+    }
1032
+    /// <summary>
1033
+    /// 质量管理科-补偿钱款
1034
+    /// </summary>
1035
+    public string F_ZL_CompensationMoney
1036
+    {
1037
+        get; set;
1038
+    }
1039
+    /// <summary>
1040
+    /// 质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
1041
+    /// </summary>
1042
+    public string F_ZL_CResponsibleUnits
1043
+    {
1044
+        get; set;
1045
+    }
1046
+    /// <summary>
1047
+    /// 质量管理科-确认实收数量(吨)
1048
+    /// </summary>
1049
+    public string F_ZL_Fquantity
1050
+    {
1051
+        get; set;
1052
+    }
1053
+    /// <summary>
1054
+    /// 质量管理科-改进要求
1055
+    /// </summary>
1056
+    public string F_ZL_ImprovementRequirements
1057
+    {
1058
+        get; set;
1059
+    }
1060
+    /// <summary>
1061
+    /// 质量管理科-对应审批工作流单号
1062
+    /// </summary>
1063
+    public string F_ZL_CApprovalNo
1064
+    {
1065
+        get; set;
1066
+    }
1067
+    /// <summary>
1068
+    /// 处理方式:当即办理、电话转接、网络转办
1069
+    /// </summary>
1070
+    public string F_DealType
1071
+    {
1072
+        get; set;
1073
+    }
1074
+    /// <summary>
1075
+    /// 处理人
1076
+    /// </summary>
1077
+    public string F_DealBy
1078
+    {
1079
+        get; set;
1080
+    }
1081
+    /// <summary>
1082
+    /// 处理时间
1083
+    /// </summary>
1084
+    public DateTime? F_DealTime
1085
+    {
1086
+        get; set;
1087
+    }
1088
+    /// <summary>
1089
+    /// 处理内容
1090
+    /// </summary>
1091
+    public string F_DealContent
1092
+    {
1093
+        get; set;
1094
+    }
1095
+    /// <summary>
1096
+    /// 处理结果:已处理,未处理
1097
+    /// </summary>
1098
+    public string F_DealResult
1099
+    {
1100
+        get; set;
1101
+    }
1102
+    /// <summary>
1103
+    /// 未处理原因:资金、技术、人员、其他(若选其他,则手输)
1104
+    /// </summary>
1105
+    public string F_DealReasons
1106
+    {
1107
+        get; set;
1108
+    }
1109
+    /// <summary>
1110
+    /// 添加时间
1111
+    /// </summary>
1112
+    public DateTime? F_CreateOn
1113
+    {
1114
+        get; set;
1115
+    }
1116
+}
1117
+public class Prescription
1118
+{
1119
+    /// <summary>
1120
+    /// 时间
1121
+    /// </summary>
1122
+    public string CreatOn { get; set; }
1123
+    /// <summary>
1124
+    /// 销售基地
1125
+    /// </summary>
1126
+    public string SalesBase { get; set; }
1127
+
1128
+    /// <summary>
1129
+    /// 大区名称
1130
+    /// </summary>
1131
+    public string AreaName { set; get; }
1132
+    /// <summary>
1133
+    /// 分公司名称
1134
+    /// </summary>
1135
+    public string BranchName { set; get; }
1136
+    /// <summary>
1137
+    /// 产品
1138
+    /// </summary>
1139
+    public string Category { set; get; }
1140
+    /// <summary>
1141
+    /// 品牌
1142
+    /// </summary>
1143
+    public string Brands { set; get; }
1144
+  
1145
+    /// <summary>
1146
+    /// 问题类别1
1147
+    /// </summary>
1148
+    public string QuestionTypeone
1149
+    {
1150
+        get; set;
1151
+    }
1152
+    /// <summary>
1153
+    /// 问题类别2
1154
+    /// </summary>
1155
+    public string QuestionTypetwo
1156
+    {
1157
+        get; set;
1158
+    }
1159
+    /// <summary>
1160
+    /// 问题类别3
1161
+    /// </summary>
1162
+    public string QuestionTypethree
1163
+    {
1164
+        get; set;
1165
+    }
1166
+    /// <summary>
1167
+    /// 问题描述
1168
+    /// </summary>
1169
+    public string Description
1170
+    {
1171
+        get; set;
1172
+    }
1173
+    /// <summary>
1174
+    /// 市场管理科-生产基地(新乡、新疆、九江、东北、贴牌、无法确定)
1175
+    /// </summary>
1176
+    public string ProductBase
1177
+    {
1178
+        get; set;
1179
+    }
1180
+    /// <summary>
1181
+    /// 质量管理科-对应责任单位(生产、研发、农化、物流、质量管理科,销售内勤)
1182
+    /// </summary>
1183
+    public string CResponsibleUnits
1184
+    {
1185
+        get; set;
1186
+    }
1187
+}
1188
+public class Product
1189
+{
1190
+    /// <summary>
1191
+    /// 化工产品名称
1192
+    /// </summary>
1193
+    public string Category { get; set; }
1194
+    /// <summary>
1195
+    /// 客户单位
1196
+    /// </summary>
1197
+    public string Company { get; set; }
1198
+
1199
+    /// <summary>
1200
+    /// 生产日期
1201
+    /// </summary>
1202
+    public string ProductionTime
1203
+    {
1204
+        get; set;
1205
+    }
1206
+    /// <summary>
1207
+    /// 反馈日期
1208
+    /// </summary>
1209
+    public string CreatOn
1210
+    {
1211
+        get; set;
1212
+    }
1213
+    /// <summary>
1214
+    /// 喷码
1215
+    /// </summary>
1216
+    public string Spurtcode
1217
+    {
1218
+        get; set;
1219
+    }
1220
+    /// <summary>
1221
+    /// 问题分类
1222
+    /// </summary>
1223
+    public string QuestionType
1224
+    {
1225
+        get; set;
1226
+    }
1227
+    /// <summary>
1228
+    /// 问题描述
1229
+    /// </summary>
1230
+    public string Description
1231
+    {
1232
+        get; set;
1233
+    }
1234
+    /// <summary>
1235
+    ///处理方法
1236
+    /// </summary>
1237
+    public string DealType
1238
+    {
1239
+        get; set;
1240
+    }
1241
+    /// <summary>
1242
+    /// 责任部门
1243
+    /// </summary>
1244
+    public string CResponsibleUnits
1245
+    {
1246
+        get; set;
1247
+    }
1248
+    /// <summary>
1249
+    /// 销售基地
1250
+    /// </summary>
1251
+    public string SalesBase { get; set; }
1252
+    /// <summary>
1253
+    /// 业务员
1254
+    /// </summary>
1255
+    public string F_Salesman { set; get; }
1256
+}
1257
+