Просмотр исходного кода

字典项分组,新增跟进记录

zhoufan лет назад: 7
Родитель
Сommit
6ceecd3304
20 измененных файлов с 1216 добавлено и 295 удалено
  1. 1 0
      codegit/CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj
  2. 145 0
      codegit/CallCenterApi/CallCenterApi.BLL/T_Bus_Follow.cs
  3. 25 21
      codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_DictionaryBase.cs
  4. 1 0
      codegit/CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj
  5. 380 0
      codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_Follow.cs
  6. 90 81
      codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs
  7. 22 14
      codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_Department.cs
  8. 98 52
      codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_DictionaryBase.cs
  9. 61 23
      codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_DictionaryValue.cs
  10. 16 4
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/AreaController.cs
  11. 25 4
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs
  12. 74 59
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs
  13. 88 8
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs
  14. 1 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/DictionaryInput.cs
  15. 1 0
      codegit/CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj
  16. 125 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Bus_Follow.cs
  17. 12 3
      codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs
  18. 17 11
      codegit/CallCenterApi/CallCenterApi.Model/T_Sys_Department.cs
  19. 23 8
      codegit/CallCenterApi/CallCenterApi.Model/T_Sys_DictionaryBase.cs
  20. 11 5
      codegit/CallCenterApi/CallCenterApi.Model/T_Sys_DictionaryValue.cs

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

@@ -47,6 +47,7 @@
47 47
     <Compile Include="PagerBLL.cs" />
48 48
     <Compile Include="Properties\AssemblyInfo.cs" />
49 49
     <Compile Include="telloc_users.cs" />
50
+    <Compile Include="T_Bus_Follow.cs" />
50 51
     <Compile Include="T_Bus_Operation.cs" />
51 52
     <Compile Include="T_Bus_RemindRecord.cs" />
52 53
     <Compile Include="T_Bus_WorkOrder.cs" />

+ 145 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Bus_Follow.cs

@@ -0,0 +1,145 @@
1
+using System;
2
+using System.Data;
3
+using System.Collections.Generic;
4
+using CallCenterApi.Model;
5
+namespace CallCenterApi.BLL
6
+{
7
+    /// <summary>
8
+    /// T_Bus_Follow
9
+    /// </summary>
10
+    public partial class T_Bus_Follow
11
+    {
12
+        private readonly CallCenterApi.DAL.T_Bus_Follow dal = new CallCenterApi.DAL.T_Bus_Follow();
13
+        public T_Bus_Follow()
14
+        { }
15
+        #region  BasicMethod
16
+        /// <summary>
17
+        /// 是否存在该记录
18
+        /// </summary>
19
+        public bool Exists(int F_Id)
20
+        {
21
+            return dal.Exists(F_Id);
22
+        }
23
+
24
+        /// <summary>
25
+        /// 增加一条数据
26
+        /// </summary>
27
+        public int Add(CallCenterApi.Model.T_Bus_Follow model)
28
+        {
29
+            return dal.Add(model);
30
+        }
31
+
32
+        /// <summary>
33
+        /// 更新一条数据
34
+        /// </summary>
35
+        public bool Update(CallCenterApi.Model.T_Bus_Follow model)
36
+        {
37
+            return dal.Update(model);
38
+        }
39
+
40
+        /// <summary>
41
+        /// 删除一条数据
42
+        /// </summary>
43
+        public bool Delete(int F_Id)
44
+        {
45
+
46
+            return dal.Delete(F_Id);
47
+        }
48
+        /// <summary>
49
+        /// 删除一条数据
50
+        /// </summary>
51
+        public bool DeleteList(string F_Idlist)
52
+        {
53
+            return dal.DeleteList(F_Idlist);
54
+        }
55
+
56
+        /// <summary>
57
+        /// 得到一个对象实体
58
+        /// </summary>
59
+        public CallCenterApi.Model.T_Bus_Follow GetModel(int F_Id)
60
+        {
61
+
62
+            return dal.GetModel(F_Id);
63
+        }
64
+
65
+        /// <summary>
66
+        /// 获得数据列表
67
+        /// </summary>
68
+        public DataSet GetList(string strWhere)
69
+        {
70
+            return dal.GetList(strWhere);
71
+        }
72
+        /// <summary>
73
+        /// 获得前几行数据
74
+        /// </summary>
75
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
76
+        {
77
+            return dal.GetList(Top, strWhere, filedOrder);
78
+        }
79
+        /// <summary>
80
+        /// 获得数据列表
81
+        /// </summary>
82
+        public List<CallCenterApi.Model.T_Bus_Follow> GetModelList(string strWhere)
83
+        {
84
+            DataSet ds = dal.GetList(strWhere);
85
+            return DataTableToList(ds.Tables[0]);
86
+        }
87
+        /// <summary>
88
+        /// 获得数据列表
89
+        /// </summary>
90
+        public List<CallCenterApi.Model.T_Bus_Follow> DataTableToList(DataTable dt)
91
+        {
92
+            List<CallCenterApi.Model.T_Bus_Follow> modelList = new List<CallCenterApi.Model.T_Bus_Follow>();
93
+            int rowsCount = dt.Rows.Count;
94
+            if (rowsCount > 0)
95
+            {
96
+                CallCenterApi.Model.T_Bus_Follow model;
97
+                for (int n = 0; n < rowsCount; n++)
98
+                {
99
+                    model = dal.DataRowToModel(dt.Rows[n]);
100
+                    if (model != null)
101
+                    {
102
+                        modelList.Add(model);
103
+                    }
104
+                }
105
+            }
106
+            return modelList;
107
+        }
108
+
109
+        /// <summary>
110
+        /// 获得数据列表
111
+        /// </summary>
112
+        public DataSet GetAllList()
113
+        {
114
+            return GetList("");
115
+        }
116
+
117
+        /// <summary>
118
+        /// 分页获取数据列表
119
+        /// </summary>
120
+        public int GetRecordCount(string strWhere)
121
+        {
122
+            return dal.GetRecordCount(strWhere);
123
+        }
124
+        /// <summary>
125
+        /// 分页获取数据列表
126
+        /// </summary>
127
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
128
+        {
129
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
130
+        }
131
+        /// <summary>
132
+        /// 分页获取数据列表
133
+        /// </summary>
134
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
135
+        //{
136
+        //return dal.GetList(PageSize,PageIndex,strWhere);
137
+        //}
138
+
139
+        #endregion  BasicMethod
140
+        #region  ExtensionMethod
141
+
142
+        #endregion  ExtensionMethod
143
+    }
144
+}
145
+

+ 25 - 21
codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_DictionaryBase.cs

@@ -1,10 +1,7 @@
1 1
 using System;
2
-using System.Collections.Generic;
3 2
 using System.Data;
4
-using System.Linq;
5
-using System.Text;
6
-using System.Threading.Tasks;
7
-
3
+using System.Collections.Generic;
4
+using CallCenterApi.Model;
8 5
 namespace CallCenterApi.BLL
9 6
 {
10 7
     /// <summary>
@@ -12,22 +9,22 @@ namespace CallCenterApi.BLL
12 9
     /// </summary>
13 10
     public partial class T_Sys_DictionaryBase
14 11
     {
15
-        private readonly DAL.T_Sys_DictionaryBase dal = new DAL.T_Sys_DictionaryBase();
12
+        private readonly CallCenterApi.DAL.T_Sys_DictionaryBase dal = new CallCenterApi.DAL.T_Sys_DictionaryBase();
16 13
         public T_Sys_DictionaryBase()
17 14
         { }
18 15
         #region  BasicMethod
19 16
         /// <summary>
20 17
         /// 是否存在该记录
21 18
         /// </summary>
22
-        public bool Exists(string F_DictionaryFlag)
19
+        public bool Exists(int F_Id)
23 20
         {
24
-            return dal.Exists(F_DictionaryFlag);
21
+            return dal.Exists(F_Id);
25 22
         }
26 23
 
27 24
         /// <summary>
28 25
         /// 增加一条数据
29 26
         /// </summary>
30
-        public bool Add(Model.T_Sys_DictionaryBase model)
27
+        public int Add(CallCenterApi.Model.T_Sys_DictionaryBase model)
31 28
         {
32 29
             return dal.Add(model);
33 30
         }
@@ -35,7 +32,7 @@ namespace CallCenterApi.BLL
35 32
         /// <summary>
36 33
         /// 更新一条数据
37 34
         /// </summary>
38
-        public bool Update(Model.T_Sys_DictionaryBase model)
35
+        public bool Update(CallCenterApi.Model.T_Sys_DictionaryBase model)
39 36
         {
40 37
             return dal.Update(model);
41 38
         }
@@ -43,26 +40,26 @@ namespace CallCenterApi.BLL
43 40
         /// <summary>
44 41
         /// 删除一条数据
45 42
         /// </summary>
46
-        public bool Delete(string F_DictionaryFlag)
43
+        public bool Delete(int F_Id)
47 44
         {
48 45
 
49
-            return dal.Delete(F_DictionaryFlag);
46
+            return dal.Delete(F_Id);
50 47
         }
51 48
         /// <summary>
52 49
         /// 删除一条数据
53 50
         /// </summary>
54
-        public bool DeleteList(string F_DictionaryFlaglist)
51
+        public bool DeleteList(string F_Idlist)
55 52
         {
56
-            return dal.DeleteList(F_DictionaryFlaglist);
53
+            return dal.DeleteList(F_Idlist);
57 54
         }
58 55
 
59 56
         /// <summary>
60 57
         /// 得到一个对象实体
61 58
         /// </summary>
62
-        public Model.T_Sys_DictionaryBase GetModel(string F_DictionaryFlag)
59
+        public CallCenterApi.Model.T_Sys_DictionaryBase GetModel(int F_Id)
63 60
         {
64 61
 
65
-            return dal.GetModel(F_DictionaryFlag);
62
+            return dal.GetModel(F_Id);
66 63
         }
67 64
 
68 65
         /// <summary>
@@ -82,7 +79,7 @@ namespace CallCenterApi.BLL
82 79
         /// <summary>
83 80
         /// 获得数据列表
84 81
         /// </summary>
85
-        public List<Model.T_Sys_DictionaryBase> GetModelList(string strWhere)
82
+        public List<CallCenterApi.Model.T_Sys_DictionaryBase> GetModelList(string strWhere)
86 83
         {
87 84
             DataSet ds = dal.GetList(strWhere);
88 85
             return DataTableToList(ds.Tables[0]);
@@ -90,13 +87,13 @@ namespace CallCenterApi.BLL
90 87
         /// <summary>
91 88
         /// 获得数据列表
92 89
         /// </summary>
93
-        public List<Model.T_Sys_DictionaryBase> DataTableToList(DataTable dt)
90
+        public List<CallCenterApi.Model.T_Sys_DictionaryBase> DataTableToList(DataTable dt)
94 91
         {
95
-            List<Model.T_Sys_DictionaryBase> modelList = new List<Model.T_Sys_DictionaryBase>();
92
+            List<CallCenterApi.Model.T_Sys_DictionaryBase> modelList = new List<CallCenterApi.Model.T_Sys_DictionaryBase>();
96 93
             int rowsCount = dt.Rows.Count;
97 94
             if (rowsCount > 0)
98 95
             {
99
-                Model.T_Sys_DictionaryBase model;
96
+                CallCenterApi.Model.T_Sys_DictionaryBase model;
100 97
                 for (int n = 0; n < rowsCount; n++)
101 98
                 {
102 99
                     model = dal.DataRowToModel(dt.Rows[n]);
@@ -131,7 +128,13 @@ namespace CallCenterApi.BLL
131 128
         {
132 129
             return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
133 130
         }
134
-
131
+        /// <summary>
132
+        /// 分页获取数据列表
133
+        /// </summary>
134
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
135
+        //{
136
+        //return dal.GetList(PageSize,PageIndex,strWhere);
137
+        //}
135 138
 
136 139
         #endregion  BasicMethod
137 140
         #region  ExtensionMethod
@@ -139,3 +142,4 @@ namespace CallCenterApi.BLL
139 142
         #endregion  ExtensionMethod
140 143
     }
141 144
 }
145
+

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

@@ -47,6 +47,7 @@
47 47
     <Compile Include="PagerDAL.cs" />
48 48
     <Compile Include="Properties\AssemblyInfo.cs" />
49 49
     <Compile Include="telloc_users.cs" />
50
+    <Compile Include="T_Bus_Follow.cs" />
50 51
     <Compile Include="T_Bus_Operation.cs" />
51 52
     <Compile Include="T_Bus_RemindRecord.cs" />
52 53
     <Compile Include="T_Bus_WorkOrder.cs" />

+ 380 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_Follow.cs

@@ -0,0 +1,380 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
6
+
7
+namespace CallCenterApi.DAL
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_Bus_Follow
11
+    /// </summary>
12
+    public partial class T_Bus_Follow
13
+    {
14
+        public T_Bus_Follow()
15
+        { }
16
+        #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_Id)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_Bus_Follow");
24
+            strSql.Append(" where F_Id=@F_Id");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
33
+
34
+        /// <summary>
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(CallCenterApi.Model.T_Bus_Follow model)
38
+        {
39
+            StringBuilder strSql = new StringBuilder();
40
+            strSql.Append("insert into T_Bus_Follow(");
41
+            strSql.Append("F_WorkOrderId,F_Title,F_Content,F_Remark,F_File,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime)");
42
+            strSql.Append(" values (");
43
+            strSql.Append("@F_WorkOrderId,@F_Title,@F_Content,@F_Remark,@F_File,@F_State,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime)");
44
+            strSql.Append(";select @@IDENTITY");
45
+            SqlParameter[] parameters = {
46
+                    new SqlParameter("@F_WorkOrderId", SqlDbType.VarChar,50),
47
+                    new SqlParameter("@F_Title", SqlDbType.NVarChar,500),
48
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,-1),
49
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,-1),
50
+                    new SqlParameter("@F_File", SqlDbType.VarChar,500),
51
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
53
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
54
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
55
+                    new SqlParameter("@F_DeleteUser", SqlDbType.VarChar,50),
56
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime)};
57
+            parameters[0].Value = model.F_WorkOrderId;
58
+            parameters[1].Value = model.F_Title;
59
+            parameters[2].Value = model.F_Content;
60
+            parameters[3].Value = model.F_Remark;
61
+            parameters[4].Value = model.F_File;
62
+            parameters[5].Value = model.F_State;
63
+            parameters[6].Value = model.F_CreateUser;
64
+            parameters[7].Value = model.F_CreateTime;
65
+            parameters[8].Value = model.F_IsDelete;
66
+            parameters[9].Value = model.F_DeleteUser;
67
+            parameters[10].Value = model.F_DeleteTime;
68
+
69
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
70
+            if (obj == null)
71
+            {
72
+                return 0;
73
+            }
74
+            else
75
+            {
76
+                return Convert.ToInt32(obj);
77
+            }
78
+        }
79
+        /// <summary>
80
+        /// 更新一条数据
81
+        /// </summary>
82
+        public bool Update(CallCenterApi.Model.T_Bus_Follow model)
83
+        {
84
+            StringBuilder strSql = new StringBuilder();
85
+            strSql.Append("update T_Bus_Follow set ");
86
+            strSql.Append("F_WorkOrderId=@F_WorkOrderId,");
87
+            strSql.Append("F_Title=@F_Title,");
88
+            strSql.Append("F_Content=@F_Content,");
89
+            strSql.Append("F_Remark=@F_Remark,");
90
+            strSql.Append("F_File=@F_File,");
91
+            strSql.Append("F_State=@F_State,");
92
+            strSql.Append("F_CreateUser=@F_CreateUser,");
93
+            strSql.Append("F_CreateTime=@F_CreateTime,");
94
+            strSql.Append("F_IsDelete=@F_IsDelete,");
95
+            strSql.Append("F_DeleteUser=@F_DeleteUser,");
96
+            strSql.Append("F_DeleteTime=@F_DeleteTime");
97
+            strSql.Append(" where F_Id=@F_Id");
98
+            SqlParameter[] parameters = {
99
+                    new SqlParameter("@F_WorkOrderId", SqlDbType.VarChar,50),
100
+                    new SqlParameter("@F_Title", SqlDbType.NVarChar,500),
101
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,-1),
102
+                    new SqlParameter("@F_Remark", SqlDbType.NVarChar,-1),
103
+                    new SqlParameter("@F_File", SqlDbType.VarChar,500),
104
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
105
+                    new SqlParameter("@F_CreateUser", SqlDbType.VarChar,50),
106
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
107
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
108
+                    new SqlParameter("@F_DeleteUser", SqlDbType.VarChar,50),
109
+                    new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
110
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
111
+            parameters[0].Value = model.F_WorkOrderId;
112
+            parameters[1].Value = model.F_Title;
113
+            parameters[2].Value = model.F_Content;
114
+            parameters[3].Value = model.F_Remark;
115
+            parameters[4].Value = model.F_File;
116
+            parameters[5].Value = model.F_State;
117
+            parameters[6].Value = model.F_CreateUser;
118
+            parameters[7].Value = model.F_CreateTime;
119
+            parameters[8].Value = model.F_IsDelete;
120
+            parameters[9].Value = model.F_DeleteUser;
121
+            parameters[10].Value = model.F_DeleteTime;
122
+            parameters[11].Value = model.F_Id;
123
+
124
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
125
+            if (rows > 0)
126
+            {
127
+                return true;
128
+            }
129
+            else
130
+            {
131
+                return false;
132
+            }
133
+        }
134
+
135
+        /// <summary>
136
+        /// 删除一条数据
137
+        /// </summary>
138
+        public bool Delete(int F_Id)
139
+        {
140
+
141
+            StringBuilder strSql = new StringBuilder();
142
+            strSql.Append("delete from T_Bus_Follow ");
143
+            strSql.Append(" where F_Id=@F_Id");
144
+            SqlParameter[] parameters = {
145
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
146
+            };
147
+            parameters[0].Value = F_Id;
148
+
149
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
150
+            if (rows > 0)
151
+            {
152
+                return true;
153
+            }
154
+            else
155
+            {
156
+                return false;
157
+            }
158
+        }
159
+        /// <summary>
160
+        /// 批量删除数据
161
+        /// </summary>
162
+        public bool DeleteList(string F_Idlist)
163
+        {
164
+            StringBuilder strSql = new StringBuilder();
165
+            strSql.Append("delete from T_Bus_Follow ");
166
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
167
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
168
+            if (rows > 0)
169
+            {
170
+                return true;
171
+            }
172
+            else
173
+            {
174
+                return false;
175
+            }
176
+        }
177
+
178
+
179
+        /// <summary>
180
+        /// 得到一个对象实体
181
+        /// </summary>
182
+        public CallCenterApi.Model.T_Bus_Follow GetModel(int F_Id)
183
+        {
184
+
185
+            StringBuilder strSql = new StringBuilder();
186
+            strSql.Append("select  top 1 F_Id,F_WorkOrderId,F_Title,F_Content,F_Remark,F_File,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Bus_Follow ");
187
+            strSql.Append(" where F_Id=@F_Id");
188
+            SqlParameter[] parameters = {
189
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
190
+            };
191
+            parameters[0].Value = F_Id;
192
+
193
+            CallCenterApi.Model.T_Bus_Follow model = new CallCenterApi.Model.T_Bus_Follow();
194
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
195
+            if (ds.Tables[0].Rows.Count > 0)
196
+            {
197
+                return DataRowToModel(ds.Tables[0].Rows[0]);
198
+            }
199
+            else
200
+            {
201
+                return null;
202
+            }
203
+        }
204
+
205
+
206
+        /// <summary>
207
+        /// 得到一个对象实体
208
+        /// </summary>
209
+        public CallCenterApi.Model.T_Bus_Follow DataRowToModel(DataRow row)
210
+        {
211
+            CallCenterApi.Model.T_Bus_Follow model = new CallCenterApi.Model.T_Bus_Follow();
212
+            if (row != null)
213
+            {
214
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
215
+                {
216
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
217
+                }
218
+                if (row["F_WorkOrderId"] != null)
219
+                {
220
+                    model.F_WorkOrderId = row["F_WorkOrderId"].ToString();
221
+                }
222
+                if (row["F_Title"] != null)
223
+                {
224
+                    model.F_Title = row["F_Title"].ToString();
225
+                }
226
+                if (row["F_Content"] != null)
227
+                {
228
+                    model.F_Content = row["F_Content"].ToString();
229
+                }
230
+                if (row["F_Remark"] != null)
231
+                {
232
+                    model.F_Remark = row["F_Remark"].ToString();
233
+                }
234
+                if (row["F_File"] != null)
235
+                {
236
+                    model.F_File = row["F_File"].ToString();
237
+                }
238
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
239
+                {
240
+                    model.F_State = int.Parse(row["F_State"].ToString());
241
+                }
242
+                if (row["F_CreateUser"] != null)
243
+                {
244
+                    model.F_CreateUser = row["F_CreateUser"].ToString();
245
+                }
246
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
247
+                {
248
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
249
+                }
250
+                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
251
+                {
252
+                    model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
253
+                }
254
+                if (row["F_DeleteUser"] != null)
255
+                {
256
+                    model.F_DeleteUser = row["F_DeleteUser"].ToString();
257
+                }
258
+                if (row["F_DeleteTime"] != null && row["F_DeleteTime"].ToString() != "")
259
+                {
260
+                    model.F_DeleteTime = DateTime.Parse(row["F_DeleteTime"].ToString());
261
+                }
262
+            }
263
+            return model;
264
+        }
265
+
266
+        /// <summary>
267
+        /// 获得数据列表
268
+        /// </summary>
269
+        public DataSet GetList(string strWhere)
270
+        {
271
+            StringBuilder strSql = new StringBuilder();
272
+            strSql.Append("select F_Id,F_WorkOrderId,F_Title,F_Content,F_Remark,F_File,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ");
273
+            strSql.Append(" FROM T_Bus_Follow ");
274
+            if (strWhere.Trim() != "")
275
+            {
276
+                strSql.Append(" where " + strWhere);
277
+            }
278
+            return DbHelperSQL.Query(strSql.ToString());
279
+        }
280
+
281
+        /// <summary>
282
+        /// 获得前几行数据
283
+        /// </summary>
284
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
285
+        {
286
+            StringBuilder strSql = new StringBuilder();
287
+            strSql.Append("select ");
288
+            if (Top > 0)
289
+            {
290
+                strSql.Append(" top " + Top.ToString());
291
+            }
292
+            strSql.Append(" F_Id,F_WorkOrderId,F_Title,F_Content,F_Remark,F_File,F_State,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime ");
293
+            strSql.Append(" FROM T_Bus_Follow ");
294
+            if (strWhere.Trim() != "")
295
+            {
296
+                strSql.Append(" where " + strWhere);
297
+            }
298
+            strSql.Append(" order by " + filedOrder);
299
+            return DbHelperSQL.Query(strSql.ToString());
300
+        }
301
+
302
+        /// <summary>
303
+        /// 获取记录总数
304
+        /// </summary>
305
+        public int GetRecordCount(string strWhere)
306
+        {
307
+            StringBuilder strSql = new StringBuilder();
308
+            strSql.Append("select count(1) FROM T_Bus_Follow ");
309
+            if (strWhere.Trim() != "")
310
+            {
311
+                strSql.Append(" where " + strWhere);
312
+            }
313
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
314
+            if (obj == null)
315
+            {
316
+                return 0;
317
+            }
318
+            else
319
+            {
320
+                return Convert.ToInt32(obj);
321
+            }
322
+        }
323
+        /// <summary>
324
+        /// 分页获取数据列表
325
+        /// </summary>
326
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
327
+        {
328
+            StringBuilder strSql = new StringBuilder();
329
+            strSql.Append("SELECT * FROM ( ");
330
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
331
+            if (!string.IsNullOrEmpty(orderby.Trim()))
332
+            {
333
+                strSql.Append("order by T." + orderby);
334
+            }
335
+            else
336
+            {
337
+                strSql.Append("order by T.F_Id desc");
338
+            }
339
+            strSql.Append(")AS Row, T.*  from T_Bus_Follow T ");
340
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
341
+            {
342
+                strSql.Append(" WHERE " + strWhere);
343
+            }
344
+            strSql.Append(" ) TT");
345
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
346
+            return DbHelperSQL.Query(strSql.ToString());
347
+        }
348
+
349
+        /*
350
+		/// <summary>
351
+		/// 分页获取数据列表
352
+		/// </summary>
353
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
354
+		{
355
+			SqlParameter[] parameters = {
356
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
357
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
358
+					new SqlParameter("@PageSize", SqlDbType.Int),
359
+					new SqlParameter("@PageIndex", SqlDbType.Int),
360
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
361
+					new SqlParameter("@OrderType", SqlDbType.Bit),
362
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
363
+					};
364
+			parameters[0].Value = "T_Bus_Follow";
365
+			parameters[1].Value = "F_Id";
366
+			parameters[2].Value = PageSize;
367
+			parameters[3].Value = PageIndex;
368
+			parameters[4].Value = 0;
369
+			parameters[5].Value = 0;
370
+			parameters[6].Value = strWhere;	
371
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
372
+		}*/
373
+
374
+        #endregion  BasicMethod
375
+        #region  ExtensionMethod
376
+
377
+        #endregion  ExtensionMethod
378
+    }
379
+}
380
+

Разница между файлами не показана из-за своего большого размера
+ 90 - 81
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs


+ 22 - 14
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_Department.cs

@@ -35,15 +35,15 @@ namespace CallCenterApi.DAL
35 35
 
36 36
 
37 37
         /// <summary>
38
-        /// 增加一条数据
39
-        /// </summary>
40
-        public int Add(Model.T_Sys_Department model)
38
+		/// 增加一条数据
39
+		/// </summary>
40
+		public int Add(CallCenterApi.Model.T_Sys_Department model)
41 41
         {
42 42
             StringBuilder strSql = new StringBuilder();
43 43
             strSql.Append("insert into T_Sys_Department(");
44
-            strSql.Append("F_DeptCode,F_ParentName,F_ParentId,F_ParentCode,F_DeptName,F_State,F_Layer,F_Type,F_Sort,F_Remark,F_Telephone,F_Mobile,F_OtherPhone,F_Email,F_Header)");
44
+            strSql.Append("F_DeptCode,F_ParentName,F_ParentId,F_ParentCode,F_DeptName,F_State,F_Layer,F_Type,F_Sort,F_Remark,F_Telephone,F_Mobile,F_OtherPhone,F_Email,F_Header,F_GroupCode)");
45 45
             strSql.Append(" values (");
46
-            strSql.Append("@F_DeptCode,@F_ParentName,@F_ParentId,@F_ParentCode,@F_DeptName,@F_State,@F_Layer,@F_Type,@F_Sort,@F_Remark,@F_Telephone,@F_Mobile,@F_OtherPhone,@F_Email,@F_Header)");
46
+            strSql.Append("@F_DeptCode,@F_ParentName,@F_ParentId,@F_ParentCode,@F_DeptName,@F_State,@F_Layer,@F_Type,@F_Sort,@F_Remark,@F_Telephone,@F_Mobile,@F_OtherPhone,@F_Email,@F_Header,@F_GroupCode)");
47 47
             strSql.Append(";select @@IDENTITY");
48 48
             SqlParameter[] parameters = {
49 49
                     new SqlParameter("@F_DeptCode", SqlDbType.VarChar,50),
@@ -60,7 +60,8 @@ namespace CallCenterApi.DAL
60 60
                     new SqlParameter("@F_Mobile", SqlDbType.VarChar,50),
61 61
                     new SqlParameter("@F_OtherPhone", SqlDbType.VarChar,50),
62 62
                     new SqlParameter("@F_Email", SqlDbType.VarChar,50),
63
-                    new SqlParameter("@F_Header", SqlDbType.Int,4)};
63
+                    new SqlParameter("@F_Header", SqlDbType.Int,4),
64
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50)};
64 65
             parameters[0].Value = model.F_DeptCode;
65 66
             parameters[1].Value = model.F_ParentName;
66 67
             parameters[2].Value = model.F_ParentId;
@@ -76,6 +77,7 @@ namespace CallCenterApi.DAL
76 77
             parameters[12].Value = model.F_OtherPhone;
77 78
             parameters[13].Value = model.F_Email;
78 79
             parameters[14].Value = model.F_Header;
80
+            parameters[15].Value = model.F_GroupCode;
79 81
 
80 82
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
81 83
             if (obj == null)
@@ -90,7 +92,7 @@ namespace CallCenterApi.DAL
90 92
         /// <summary>
91 93
         /// 更新一条数据
92 94
         /// </summary>
93
-        public bool Update(Model.T_Sys_Department model)
95
+        public bool Update(CallCenterApi.Model.T_Sys_Department model)
94 96
         {
95 97
             StringBuilder strSql = new StringBuilder();
96 98
             strSql.Append("update T_Sys_Department set ");
@@ -108,7 +110,8 @@ namespace CallCenterApi.DAL
108 110
             strSql.Append("F_Mobile=@F_Mobile,");
109 111
             strSql.Append("F_OtherPhone=@F_OtherPhone,");
110 112
             strSql.Append("F_Email=@F_Email,");
111
-            strSql.Append("F_Header=@F_Header");
113
+            strSql.Append("F_Header=@F_Header,");
114
+            strSql.Append("F_GroupCode=@F_GroupCode");
112 115
             strSql.Append(" where F_DeptId=@F_DeptId");
113 116
             SqlParameter[] parameters = {
114 117
                     new SqlParameter("@F_DeptCode", SqlDbType.VarChar,50),
@@ -126,6 +129,7 @@ namespace CallCenterApi.DAL
126 129
                     new SqlParameter("@F_OtherPhone", SqlDbType.VarChar,50),
127 130
                     new SqlParameter("@F_Email", SqlDbType.VarChar,50),
128 131
                     new SqlParameter("@F_Header", SqlDbType.Int,4),
132
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
129 133
                     new SqlParameter("@F_DeptId", SqlDbType.Int,4)};
130 134
             parameters[0].Value = model.F_DeptCode;
131 135
             parameters[1].Value = model.F_ParentName;
@@ -142,7 +146,8 @@ namespace CallCenterApi.DAL
142 146
             parameters[12].Value = model.F_OtherPhone;
143 147
             parameters[13].Value = model.F_Email;
144 148
             parameters[14].Value = model.F_Header;
145
-            parameters[15].Value = model.F_DeptId;
149
+            parameters[15].Value = model.F_GroupCode;
150
+            parameters[16].Value = model.F_DeptId;
146 151
 
147 152
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
148 153
             if (rows > 0)
@@ -206,7 +211,7 @@ namespace CallCenterApi.DAL
206 211
         {
207 212
 
208 213
             StringBuilder strSql = new StringBuilder();
209
-            strSql.Append("select TOP 1 F_DeptId,F_DeptCode,(SELECT B.F_DeptName FROM T_Sys_Department B WHERE B.F_DeptId=A.F_ParentId) AS F_ParentName,F_ParentId,F_ParentCode,F_DeptName,F_State,F_Layer,F_Type,F_Sort,F_Remark,F_Telephone,F_Mobile,F_OtherPhone,F_Email,F_Header from T_Sys_Department  A");
214
+            strSql.Append("select TOP 1 *,(SELECT B.F_DeptName FROM T_Sys_Department B WHERE B.F_DeptId=A.F_ParentId) AS F_ParentName from T_Sys_Department  A");
210 215
             strSql.Append(" where F_DeptId=@F_DeptId");
211 216
             SqlParameter[] parameters = {
212 217
                     new SqlParameter("@F_DeptId", SqlDbType.Int,4)
@@ -298,6 +303,10 @@ namespace CallCenterApi.DAL
298 303
                 {
299 304
                     model.F_Header = int.Parse(row["F_Header"].ToString());
300 305
                 }
306
+                if (row["F_GroupCode"] != null)
307
+                {
308
+                    model.F_GroupCode = row["F_GroupCode"].ToString();
309
+                }
301 310
             }
302 311
             return model;
303 312
         }
@@ -308,8 +317,7 @@ namespace CallCenterApi.DAL
308 317
         public DataSet GetList(string strWhere)
309 318
         {
310 319
             StringBuilder strSql = new StringBuilder();
311
-            strSql.Append("select F_DeptId,F_DeptCode,F_ParentName,F_ParentId,F_ParentCode,F_DeptName,F_State,F_Layer,F_Type,F_Sort,F_Remark,F_Telephone,F_Mobile,F_OtherPhone,F_Email,F_Header ");
312
-            strSql.Append(" FROM T_Sys_Department ");
320
+            strSql.Append("select * FROM T_Sys_Department ");
313 321
             if (strWhere.Trim() != "")
314 322
             {
315 323
                 strSql.Append(" where " + strWhere);
@@ -328,8 +336,8 @@ namespace CallCenterApi.DAL
328 336
             {
329 337
                 strSql.Append(" top " + Top.ToString());
330 338
             }
331
-            strSql.Append(" F_DeptId,F_DeptCode,F_ParentName,F_ParentId,F_ParentCode,F_DeptName,F_State,F_Layer,F_Type,F_Sort,F_Remark,F_Telephone,F_Mobile,F_OtherPhone,F_Email,F_Header ");
332
-            strSql.Append(" FROM T_Sys_Department ");
339
+            
340
+            strSql.Append(" * FROM T_Sys_Department ");
333 341
             if (strWhere.Trim() != "")
334 342
             {
335 343
                 strSql.Append(" where " + strWhere);

+ 98 - 52
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_DictionaryBase.cs

@@ -1,15 +1,12 @@
1
-using CallCenterApi.DB;
2
-using System;
3
-using System.Collections.Generic;
1
+using System;
4 2
 using System.Data;
5
-using System.Data.SqlClient;
6
-using System.Linq;
7 3
 using System.Text;
8
-using System.Threading.Tasks;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
9 6
 
10 7
 namespace CallCenterApi.DAL
11 8
 {
12
-    // <summary>
9
+    /// <summary>
13 10
     /// 数据访问类:T_Sys_DictionaryBase
14 11
     /// </summary>
15 12
     public partial class T_Sys_DictionaryBase
@@ -17,18 +14,18 @@ namespace CallCenterApi.DAL
17 14
         public T_Sys_DictionaryBase()
18 15
         { }
19 16
         #region  BasicMethod
20
-
21 17
         /// <summary>
22 18
         /// 是否存在该记录
23 19
         /// </summary>
24
-        public bool Exists(string F_DictionaryFlag)
20
+        public bool Exists(int F_Id)
25 21
         {
26 22
             StringBuilder strSql = new StringBuilder();
27 23
             strSql.Append("select count(1) from T_Sys_DictionaryBase");
28
-            strSql.Append(" where F_DictionaryFlag=@F_DictionaryFlag ");
24
+            strSql.Append(" where F_Id=@F_Id");
29 25
             SqlParameter[] parameters = {
30
-                    new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50)         };
31
-            parameters[0].Value = F_DictionaryFlag;
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
32 29
 
33 30
             return DbHelperSQL.Exists(strSql.ToString(), parameters);
34 31
         }
@@ -37,58 +34,67 @@ namespace CallCenterApi.DAL
37 34
         /// <summary>
38 35
         /// 增加一条数据
39 36
         /// </summary>
40
-        public bool Add(Model.T_Sys_DictionaryBase model)
37
+        public int Add(CallCenterApi.Model.T_Sys_DictionaryBase model)
41 38
         {
42 39
             StringBuilder strSql = new StringBuilder();
43 40
             strSql.Append("insert into T_Sys_DictionaryBase(");
44
-            strSql.Append("F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State)");
41
+            strSql.Append("F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State,F_GroupCode)");
45 42
             strSql.Append(" values (");
46
-            strSql.Append("@F_DictionaryFlag,@F_DictionaryName,@F_Sort,@F_Describe,@F_State)");
43
+            strSql.Append("@F_DictionaryFlag,@F_DictionaryName,@F_Sort,@F_Describe,@F_State,@F_GroupCode)");
44
+            strSql.Append(";select @@IDENTITY");
47 45
             SqlParameter[] parameters = {
48 46
                     new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50),
49 47
                     new SqlParameter("@F_DictionaryName", SqlDbType.VarChar,50),
50 48
                     new SqlParameter("@F_Sort", SqlDbType.Int,4),
51 49
                     new SqlParameter("@F_Describe", SqlDbType.VarChar,100),
52
-                    new SqlParameter("@F_State", SqlDbType.VarChar,20)};
50
+                    new SqlParameter("@F_State", SqlDbType.Bit,1),
51
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50)};
53 52
             parameters[0].Value = model.F_DictionaryFlag;
54 53
             parameters[1].Value = model.F_DictionaryName;
55 54
             parameters[2].Value = model.F_Sort;
56 55
             parameters[3].Value = model.F_Describe;
57 56
             parameters[4].Value = model.F_State;
57
+            parameters[5].Value = model.F_GroupCode;
58 58
 
59
-            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
60
-            if (rows > 0)
59
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
60
+            if (obj == null)
61 61
             {
62
-                return true;
62
+                return 0;
63 63
             }
64 64
             else
65 65
             {
66
-                return false;
66
+                return Convert.ToInt32(obj);
67 67
             }
68 68
         }
69 69
         /// <summary>
70 70
         /// 更新一条数据
71 71
         /// </summary>
72
-        public bool Update(Model.T_Sys_DictionaryBase model)
72
+        public bool Update(CallCenterApi.Model.T_Sys_DictionaryBase model)
73 73
         {
74 74
             StringBuilder strSql = new StringBuilder();
75 75
             strSql.Append("update T_Sys_DictionaryBase set ");
76
+            strSql.Append("F_DictionaryFlag=@F_DictionaryFlag,");
76 77
             strSql.Append("F_DictionaryName=@F_DictionaryName,");
77 78
             strSql.Append("F_Sort=@F_Sort,");
78 79
             strSql.Append("F_Describe=@F_Describe,");
79
-            strSql.Append("F_State=@F_State");
80
-            strSql.Append(" where F_DictionaryFlag=@F_DictionaryFlag ");
80
+            strSql.Append("F_State=@F_State,");
81
+            strSql.Append("F_GroupCode=@F_GroupCode");
82
+            strSql.Append(" where F_Id=@F_Id");
81 83
             SqlParameter[] parameters = {
84
+                    new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50),
82 85
                     new SqlParameter("@F_DictionaryName", SqlDbType.VarChar,50),
83 86
                     new SqlParameter("@F_Sort", SqlDbType.Int,4),
84 87
                     new SqlParameter("@F_Describe", SqlDbType.VarChar,100),
85
-                    new SqlParameter("@F_State", SqlDbType.VarChar,20),
86
-                    new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50)};
87
-            parameters[0].Value = model.F_DictionaryName;
88
-            parameters[1].Value = model.F_Sort;
89
-            parameters[2].Value = model.F_Describe;
90
-            parameters[3].Value = model.F_State;
91
-            parameters[4].Value = model.F_DictionaryFlag;
88
+                    new SqlParameter("@F_State", SqlDbType.Bit,1),
89
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
90
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
91
+            parameters[0].Value = model.F_DictionaryFlag;
92
+            parameters[1].Value = model.F_DictionaryName;
93
+            parameters[2].Value = model.F_Sort;
94
+            parameters[3].Value = model.F_Describe;
95
+            parameters[4].Value = model.F_State;
96
+            parameters[5].Value = model.F_GroupCode;
97
+            parameters[6].Value = model.F_Id;
92 98
 
93 99
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
94 100
             if (rows > 0)
@@ -104,15 +110,16 @@ namespace CallCenterApi.DAL
104 110
         /// <summary>
105 111
         /// 删除一条数据
106 112
         /// </summary>
107
-        public bool Delete(string F_DictionaryFlag)
113
+        public bool Delete(int F_Id)
108 114
         {
109 115
 
110 116
             StringBuilder strSql = new StringBuilder();
111 117
             strSql.Append("delete from T_Sys_DictionaryBase ");
112
-            strSql.Append(" where F_DictionaryFlag=@F_DictionaryFlag ");
118
+            strSql.Append(" where F_Id=@F_Id");
113 119
             SqlParameter[] parameters = {
114
-                    new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50)         };
115
-            parameters[0].Value = F_DictionaryFlag;
120
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
121
+            };
122
+            parameters[0].Value = F_Id;
116 123
 
117 124
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
118 125
             if (rows > 0)
@@ -127,11 +134,11 @@ namespace CallCenterApi.DAL
127 134
         /// <summary>
128 135
         /// 批量删除数据
129 136
         /// </summary>
130
-        public bool DeleteList(string F_DictionaryFlaglist)
137
+        public bool DeleteList(string F_Idlist)
131 138
         {
132 139
             StringBuilder strSql = new StringBuilder();
133 140
             strSql.Append("delete from T_Sys_DictionaryBase ");
134
-            strSql.Append(" where F_DictionaryFlag in (" + F_DictionaryFlaglist + ")  ");
141
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
135 142
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
136 143
             if (rows > 0)
137 144
             {
@@ -147,17 +154,18 @@ namespace CallCenterApi.DAL
147 154
         /// <summary>
148 155
         /// 得到一个对象实体
149 156
         /// </summary>
150
-        public Model.T_Sys_DictionaryBase GetModel(string F_DictionaryFlag)
157
+        public CallCenterApi.Model.T_Sys_DictionaryBase GetModel(int F_Id)
151 158
         {
152 159
 
153 160
             StringBuilder strSql = new StringBuilder();
154
-            strSql.Append("select  top 1 F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State from T_Sys_DictionaryBase ");
155
-            strSql.Append(" where F_DictionaryFlag=@F_DictionaryFlag ");
161
+            strSql.Append("select  top 1 F_Id,F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State,F_GroupCode from T_Sys_DictionaryBase ");
162
+            strSql.Append(" where F_Id=@F_Id");
156 163
             SqlParameter[] parameters = {
157
-                    new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50)         };
158
-            parameters[0].Value = F_DictionaryFlag;
164
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
165
+            };
166
+            parameters[0].Value = F_Id;
159 167
 
160
-            Model.T_Sys_DictionaryBase model = new Model.T_Sys_DictionaryBase();
168
+            CallCenterApi.Model.T_Sys_DictionaryBase model = new CallCenterApi.Model.T_Sys_DictionaryBase();
161 169
             DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
162 170
             if (ds.Tables[0].Rows.Count > 0)
163 171
             {
@@ -173,11 +181,15 @@ namespace CallCenterApi.DAL
173 181
         /// <summary>
174 182
         /// 得到一个对象实体
175 183
         /// </summary>
176
-        public Model.T_Sys_DictionaryBase DataRowToModel(DataRow row)
184
+        public CallCenterApi.Model.T_Sys_DictionaryBase DataRowToModel(DataRow row)
177 185
         {
178
-            Model.T_Sys_DictionaryBase model = new Model.T_Sys_DictionaryBase();
186
+            CallCenterApi.Model.T_Sys_DictionaryBase model = new CallCenterApi.Model.T_Sys_DictionaryBase();
179 187
             if (row != null)
180 188
             {
189
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
190
+                {
191
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
192
+                }
181 193
                 if (row["F_DictionaryFlag"] != null)
182 194
                 {
183 195
                     model.F_DictionaryFlag = row["F_DictionaryFlag"].ToString();
@@ -190,15 +202,25 @@ namespace CallCenterApi.DAL
190 202
                 {
191 203
                     model.F_Sort = int.Parse(row["F_Sort"].ToString());
192 204
                 }
193
-                if (row["F_Describe"] != null)  
205
+                if (row["F_Describe"] != null)
194 206
                 {
195 207
                     model.F_Describe = row["F_Describe"].ToString();
196 208
                 }
197
-                if (row["F_State"] != null && row["F_State"] != DBNull.Value)
209
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
210
+                {
211
+                    if ((row["F_State"].ToString() == "1") || (row["F_State"].ToString().ToLower() == "true"))
212
+                    {
213
+                        model.F_State = true;
214
+                    }
215
+                    else
216
+                    {
217
+                        model.F_State = false;
218
+                    }
219
+                }
220
+                if (row["F_GroupCode"] != null)
198 221
                 {
199
-                    model.F_State = Convert.ToBoolean(row["F_State"]);
222
+                    model.F_GroupCode = row["F_GroupCode"].ToString();
200 223
                 }
201
-                else { model.F_State = false; }
202 224
             }
203 225
             return model;
204 226
         }
@@ -209,7 +231,7 @@ namespace CallCenterApi.DAL
209 231
         public DataSet GetList(string strWhere)
210 232
         {
211 233
             StringBuilder strSql = new StringBuilder();
212
-            strSql.Append("select F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State ");
234
+            strSql.Append("select F_Id,F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State,F_GroupCode ");
213 235
             strSql.Append(" FROM T_Sys_DictionaryBase ");
214 236
             if (strWhere.Trim() != "")
215 237
             {
@@ -229,7 +251,7 @@ namespace CallCenterApi.DAL
229 251
             {
230 252
                 strSql.Append(" top " + Top.ToString());
231 253
             }
232
-            strSql.Append(" F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State ");
254
+            strSql.Append(" F_Id,F_DictionaryFlag,F_DictionaryName,F_Sort,F_Describe,F_State,F_GroupCode ");
233 255
             strSql.Append(" FROM T_Sys_DictionaryBase ");
234 256
             if (strWhere.Trim() != "")
235 257
             {
@@ -274,7 +296,7 @@ namespace CallCenterApi.DAL
274 296
             }
275 297
             else
276 298
             {
277
-                strSql.Append("order by T.F_DictionaryFlag desc");
299
+                strSql.Append("order by T.F_Id desc");
278 300
             }
279 301
             strSql.Append(")AS Row, T.*  from T_Sys_DictionaryBase T ");
280 302
             if (!string.IsNullOrEmpty(strWhere.Trim()))
@@ -286,7 +308,30 @@ namespace CallCenterApi.DAL
286 308
             return DbHelperSQL.Query(strSql.ToString());
287 309
         }
288 310
 
289
-
311
+        /*
312
+		/// <summary>
313
+		/// 分页获取数据列表
314
+		/// </summary>
315
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
316
+		{
317
+			SqlParameter[] parameters = {
318
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
319
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
320
+					new SqlParameter("@PageSize", SqlDbType.Int),
321
+					new SqlParameter("@PageIndex", SqlDbType.Int),
322
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
323
+					new SqlParameter("@OrderType", SqlDbType.Bit),
324
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
325
+					};
326
+			parameters[0].Value = "T_Sys_DictionaryBase";
327
+			parameters[1].Value = "F_Id";
328
+			parameters[2].Value = PageSize;
329
+			parameters[3].Value = PageIndex;
330
+			parameters[4].Value = 0;
331
+			parameters[5].Value = 0;
332
+			parameters[6].Value = strWhere;	
333
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
334
+		}*/
290 335
 
291 336
         #endregion  BasicMethod
292 337
         #region  ExtensionMethod
@@ -294,3 +339,4 @@ namespace CallCenterApi.DAL
294 339
         #endregion  ExtensionMethod
295 340
     }
296 341
 }
342
+

+ 61 - 23
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_DictionaryValue.cs

@@ -1,11 +1,8 @@
1
-using CallCenterApi.DB;
2
-using System;
3
-using System.Collections.Generic;
1
+using System;
4 2
 using System.Data;
5
-using System.Data.SqlClient;
6
-using System.Linq;
7 3
 using System.Text;
8
-using System.Threading.Tasks;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
9 6
 
10 7
 namespace CallCenterApi.DAL
11 8
 {
@@ -37,13 +34,13 @@ namespace CallCenterApi.DAL
37 34
         /// <summary>
38 35
         /// 增加一条数据
39 36
         /// </summary>
40
-        public int Add(Model.T_Sys_DictionaryValue model)
37
+        public int Add(CallCenterApi.Model.T_Sys_DictionaryValue model)
41 38
         {
42 39
             StringBuilder strSql = new StringBuilder();
43 40
             strSql.Append("insert into T_Sys_DictionaryValue(");
44
-            strSql.Append("F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State)");
41
+            strSql.Append("F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State,F_GroupCode)");
45 42
             strSql.Append(" values (");
46
-            strSql.Append("@F_DictionaryFlag,@F_ValueCode,@F_Name,@F_Sort,@F_Describe,@F_State)");
43
+            strSql.Append("@F_DictionaryFlag,@F_ValueCode,@F_Name,@F_Sort,@F_Describe,@F_State,@F_GroupCode)");
47 44
             strSql.Append(";select @@IDENTITY");
48 45
             SqlParameter[] parameters = {
49 46
                     new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50),
@@ -51,13 +48,15 @@ namespace CallCenterApi.DAL
51 48
                     new SqlParameter("@F_Name", SqlDbType.VarChar,50),
52 49
                     new SqlParameter("@F_Sort", SqlDbType.Int,4),
53 50
                     new SqlParameter("@F_Describe", SqlDbType.VarChar,-1),
54
-                    new SqlParameter("@F_State", SqlDbType.VarChar,50)};
51
+                    new SqlParameter("@F_State", SqlDbType.Bit,1),
52
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50)};
55 53
             parameters[0].Value = model.F_DictionaryFlag;
56 54
             parameters[1].Value = model.F_ValueCode;
57 55
             parameters[2].Value = model.F_Name;
58 56
             parameters[3].Value = model.F_Sort;
59 57
             parameters[4].Value = model.F_Describe;
60 58
             parameters[5].Value = model.F_State;
59
+            parameters[6].Value = model.F_GroupCode;
61 60
 
62 61
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
63 62
             if (obj == null)
@@ -72,7 +71,7 @@ namespace CallCenterApi.DAL
72 71
         /// <summary>
73 72
         /// 更新一条数据
74 73
         /// </summary>
75
-        public bool Update(Model.T_Sys_DictionaryValue model)
74
+        public bool Update(CallCenterApi.Model.T_Sys_DictionaryValue model)
76 75
         {
77 76
             StringBuilder strSql = new StringBuilder();
78 77
             strSql.Append("update T_Sys_DictionaryValue set ");
@@ -81,7 +80,8 @@ namespace CallCenterApi.DAL
81 80
             strSql.Append("F_Name=@F_Name,");
82 81
             strSql.Append("F_Sort=@F_Sort,");
83 82
             strSql.Append("F_Describe=@F_Describe,");
84
-            strSql.Append("F_State=@F_State");
83
+            strSql.Append("F_State=@F_State,");
84
+            strSql.Append("F_GroupCode=@F_GroupCode");
85 85
             strSql.Append(" where F_DictionaryValueId=@F_DictionaryValueId");
86 86
             SqlParameter[] parameters = {
87 87
                     new SqlParameter("@F_DictionaryFlag", SqlDbType.VarChar,50),
@@ -89,7 +89,8 @@ namespace CallCenterApi.DAL
89 89
                     new SqlParameter("@F_Name", SqlDbType.VarChar,50),
90 90
                     new SqlParameter("@F_Sort", SqlDbType.Int,4),
91 91
                     new SqlParameter("@F_Describe", SqlDbType.VarChar,-1),
92
-                    new SqlParameter("@F_State", SqlDbType.VarChar,50),
92
+                    new SqlParameter("@F_State", SqlDbType.Bit,1),
93
+                    new SqlParameter("@F_GroupCode", SqlDbType.VarChar,50),
93 94
                     new SqlParameter("@F_DictionaryValueId", SqlDbType.Int,4)};
94 95
             parameters[0].Value = model.F_DictionaryFlag;
95 96
             parameters[1].Value = model.F_ValueCode;
@@ -97,7 +98,8 @@ namespace CallCenterApi.DAL
97 98
             parameters[3].Value = model.F_Sort;
98 99
             parameters[4].Value = model.F_Describe;
99 100
             parameters[5].Value = model.F_State;
100
-            parameters[6].Value = model.F_DictionaryValueId;
101
+            parameters[6].Value = model.F_GroupCode;
102
+            parameters[7].Value = model.F_DictionaryValueId;
101 103
 
102 104
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
103 105
             if (rows > 0)
@@ -157,18 +159,18 @@ namespace CallCenterApi.DAL
157 159
         /// <summary>
158 160
         /// 得到一个对象实体
159 161
         /// </summary>
160
-        public Model.T_Sys_DictionaryValue GetModel(int F_DictionaryValueId)
162
+        public CallCenterApi.Model.T_Sys_DictionaryValue GetModel(int F_DictionaryValueId)
161 163
         {
162 164
 
163 165
             StringBuilder strSql = new StringBuilder();
164
-            strSql.Append("select  top 1 F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State from T_Sys_DictionaryValue ");
166
+            strSql.Append("select  top 1 F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State,F_GroupCode from T_Sys_DictionaryValue ");
165 167
             strSql.Append(" where F_DictionaryValueId=@F_DictionaryValueId");
166 168
             SqlParameter[] parameters = {
167 169
                     new SqlParameter("@F_DictionaryValueId", SqlDbType.Int,4)
168 170
             };
169 171
             parameters[0].Value = F_DictionaryValueId;
170 172
 
171
-            Model.T_Sys_DictionaryValue model = new Model.T_Sys_DictionaryValue();
173
+            CallCenterApi.Model.T_Sys_DictionaryValue model = new CallCenterApi.Model.T_Sys_DictionaryValue();
172 174
             DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
173 175
             if (ds.Tables[0].Rows.Count > 0)
174 176
             {
@@ -184,9 +186,9 @@ namespace CallCenterApi.DAL
184 186
         /// <summary>
185 187
         /// 得到一个对象实体
186 188
         /// </summary>
187
-        public Model.T_Sys_DictionaryValue DataRowToModel(DataRow row)
189
+        public CallCenterApi.Model.T_Sys_DictionaryValue DataRowToModel(DataRow row)
188 190
         {
189
-            Model.T_Sys_DictionaryValue model = new Model.T_Sys_DictionaryValue();
191
+            CallCenterApi.Model.T_Sys_DictionaryValue model = new CallCenterApi.Model.T_Sys_DictionaryValue();
190 192
             if (row != null)
191 193
             {
192 194
                 if (row["F_DictionaryValueId"] != null && row["F_DictionaryValueId"].ToString() != "")
@@ -213,9 +215,20 @@ namespace CallCenterApi.DAL
213 215
                 {
214 216
                     model.F_Describe = row["F_Describe"].ToString();
215 217
                 }
216
-                if (row["F_State"] != null && row["F_State"] != DBNull.Value)
218
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
217 219
                 {
218
-                    model.F_State = Convert.ToBoolean(row["F_State"]);
220
+                    if ((row["F_State"].ToString() == "1") || (row["F_State"].ToString().ToLower() == "true"))
221
+                    {
222
+                        model.F_State = true;
223
+                    }
224
+                    else
225
+                    {
226
+                        model.F_State = false;
227
+                    }
228
+                }
229
+                if (row["F_GroupCode"] != null)
230
+                {
231
+                    model.F_GroupCode = row["F_GroupCode"].ToString();
219 232
                 }
220 233
             }
221 234
             return model;
@@ -227,7 +240,7 @@ namespace CallCenterApi.DAL
227 240
         public DataSet GetList(string strWhere)
228 241
         {
229 242
             StringBuilder strSql = new StringBuilder();
230
-            strSql.Append("select F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State ");
243
+            strSql.Append("select F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State,F_GroupCode ");
231 244
             strSql.Append(" FROM T_Sys_DictionaryValue ");
232 245
             if (strWhere.Trim() != "")
233 246
             {
@@ -247,7 +260,7 @@ namespace CallCenterApi.DAL
247 260
             {
248 261
                 strSql.Append(" top " + Top.ToString());
249 262
             }
250
-            strSql.Append(" F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State ");
263
+            strSql.Append(" F_DictionaryValueId,F_DictionaryFlag,F_ValueCode,F_Name,F_Sort,F_Describe,F_State,F_GroupCode ");
251 264
             strSql.Append(" FROM T_Sys_DictionaryValue ");
252 265
             if (strWhere.Trim() != "")
253 266
             {
@@ -304,6 +317,30 @@ namespace CallCenterApi.DAL
304 317
             return DbHelperSQL.Query(strSql.ToString());
305 318
         }
306 319
 
320
+        /*
321
+		/// <summary>
322
+		/// 分页获取数据列表
323
+		/// </summary>
324
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
325
+		{
326
+			SqlParameter[] parameters = {
327
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
328
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
329
+					new SqlParameter("@PageSize", SqlDbType.Int),
330
+					new SqlParameter("@PageIndex", SqlDbType.Int),
331
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
332
+					new SqlParameter("@OrderType", SqlDbType.Bit),
333
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
334
+					};
335
+			parameters[0].Value = "T_Sys_DictionaryValue";
336
+			parameters[1].Value = "F_DictionaryValueId";
337
+			parameters[2].Value = PageSize;
338
+			parameters[3].Value = PageIndex;
339
+			parameters[4].Value = 0;
340
+			parameters[5].Value = 0;
341
+			parameters[6].Value = strWhere;	
342
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
343
+		}*/
307 344
 
308 345
         #endregion  BasicMethod
309 346
         #region  ExtensionMethod
@@ -311,3 +348,4 @@ namespace CallCenterApi.DAL
311 348
         #endregion  ExtensionMethod
312 349
     }
313 350
 }
351
+

+ 16 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/AreaController.cs

@@ -25,7 +25,13 @@ namespace CallCenterApi.Interface.Controllers
25 25
             int userId = CurrentUser.UserData.F_UserId;
26 26
             Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
27 27
 
28
-            DataTable dt = areaBLL.GetList(0, "F_GroupCode = '" + userModel.groupcode + "'", " F_Sort").Tables[0];
28
+            string where = " F_IsDelete=0 ";
29
+            if (!string.IsNullOrEmpty(userModel.groupcode))
30
+            {
31
+                where += " and F_GroupCode = '" + userModel.groupcode + "'";
32
+            }
33
+
34
+            DataTable dt = areaBLL.GetList(0, where, " F_Sort asc").Tables[0];
29 35
             return Success("加载成功", dt);
30 36
         }
31 37
 
@@ -38,7 +44,13 @@ namespace CallCenterApi.Interface.Controllers
38 44
             int userId = CurrentUser.UserData.F_UserId;
39 45
             Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
40 46
 
41
-            DataTable dt = areaBLL.GetList(" isnull(F_ParentId,0)='" + id + "' and F_GroupCode = '" + userModel.groupcode + "' and F_State=0 ").Tables[0];
47
+            string where = " isnull(F_ParentId,0)='" + id + "' and F_IsDelete=0 ";
48
+            if (!string.IsNullOrEmpty(userModel.groupcode))
49
+            {
50
+                where += " and F_GroupCode = '" + userModel.groupcode + "'";
51
+            }
52
+
53
+            DataTable dt = areaBLL.GetList(0, where, " F_Sort asc").Tables[0];
42 54
             return Success("列表加载成功", dt);
43 55
         }
44 56
 
@@ -77,7 +89,7 @@ namespace CallCenterApi.Interface.Controllers
77 89
             Model.T_Sys_Area dModel = new Model.T_Sys_Area();
78 90
             if (id == 0)
79 91
             {
80
-                var list = areaBLL.GetModelList(" F_Id='" + id + "' and F_AreaName='" + name + "' ");
92
+                var list = areaBLL.GetModelList(" F_Id='" + id + "' and F_AreaName='" + name + "' and F_IsDelete=0 ");
81 93
                 if (list.Count > 0)
82 94
                 {
83 95
                     return Error("已经存在此区域");
@@ -104,7 +116,7 @@ namespace CallCenterApi.Interface.Controllers
104 116
                 dModel = areaBLL.GetModel(id);
105 117
                 if (dModel != null)
106 118
                 {
107
-                    var list = areaBLL.GetModelList(" F_Id='" + id + "' and F_AreaName='" + name + "' and F_Id!='" + id + "' ");
119
+                    var list = areaBLL.GetModelList(" F_Id='" + id + "' and F_AreaName='" + name + "' and F_Id!='" + id + "' and F_IsDelete=0 ");
108 120
                     if (list.Count > 0)
109 121
                     {
110 122
                         return Error("已经存在此区域");

+ 25 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs

@@ -11,7 +11,7 @@ using System.Web.Mvc;
11 11
 
12 12
 namespace CallCenterApi.Interface.Controllers
13 13
 {
14
-    //[Authority]
14
+    [Authority]
15 15
     public class DepartmentController : BaseController
16 16
     {
17 17
         private BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
@@ -24,8 +24,15 @@ namespace CallCenterApi.Interface.Controllers
24 24
         {
25 25
             if (Request.IsAuthenticated)
26 26
             {
27
-                DataTable dt = new DataTable();
28
-                dt = new BLL.T_Sys_Department().GetList(" F_State=1 ").Tables[0];
27
+                //int userId = CurrentUser.UserData.F_UserId;
28
+                //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
29
+                string where = "F_State='1'";
30
+                //if (!string.IsNullOrEmpty(userModel.groupcode))
31
+                //{
32
+                //    where += " and F_GroupCode = '" + userModel.groupcode + "'";
33
+                //}
34
+
35
+                DataTable dt = departmentBLL.GetList(0, where, " F_Sort asc").Tables[0];
29 36
                 return Success("加载成功", dt);
30 37
             }
31 38
             return NoToken("未知错误,请重新登录");
@@ -67,6 +74,9 @@ namespace CallCenterApi.Interface.Controllers
67 74
             ActionResult res = NoToken("未知错误,请重新登录");
68 75
             if (Request.IsAuthenticated)
69 76
             {
77
+                //int userId = CurrentUser.UserData.F_UserId;
78
+                //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
79
+
70 80
                 string pcode = "";
71 81
                 Model.T_Sys_Department dModel = new Model.T_Sys_Department();
72 82
                 dModel.F_ParentId = input.PId;
@@ -81,6 +91,7 @@ namespace CallCenterApi.Interface.Controllers
81 91
                 dModel.F_Sort = input.Sort;
82 92
                 dModel.F_DeptName = input.DeptName;
83 93
                 dModel.F_State = 1;
94
+                //dModel.F_GroupCode = userModel.groupcode;
84 95
                 int id = departmentBLL.Add(dModel);
85 96
                 if (id> 0)
86 97
                 {
@@ -109,6 +120,7 @@ namespace CallCenterApi.Interface.Controllers
109 120
                 Model.T_Sys_Department dModel = dBLL.GetModel(input.DeptId);
110 121
                 if (dModel == null)
111 122
                     return Error("获取信息失败");
123
+
112 124
                 dModel.F_ParentId = input.PId;
113 125
                 if (input.PId != 0)
114 126
                 {
@@ -159,8 +171,17 @@ namespace CallCenterApi.Interface.Controllers
159 171
         {
160 172
             if (Request.IsAuthenticated)
161 173
             {
174
+                //int userId = CurrentUser.UserData.F_UserId;
175
+                //Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
176
+
162 177
                 DataTable dt = new DataTable();
163
-                dt = new BLL.T_Sys_Department().GetList(" F_State=1 and F_ParentId=" + pId).Tables[0];
178
+                string where = " isnull(F_ParentId,0)='" + pId + "' and F_State=1 ";
179
+                //if (!string.IsNullOrEmpty(userModel.groupcode))
180
+                //{
181
+                //    where += " and F_GroupCode = '" + userModel.groupcode + "'";
182
+                //}
183
+                dt = new BLL.T_Sys_Department().GetList(0, where, " F_Sort asc").Tables[0];
184
+
164 185
                 List<Model.TreeModel> modelList = BindTree(dt, "0");
165 186
 
166 187
                 if (modelList != null) {

+ 74 - 59
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DictionaryController.cs

@@ -12,7 +12,7 @@ using System.Web.Mvc;
12 12
 
13 13
 namespace CallCenterApi.Interface.Controllers
14 14
 {
15
-    
15
+    [Authority]
16 16
     public class DictionaryController : BaseController
17 17
     {
18 18
         private BLL.T_Sys_DictionaryBase dictionaryBaseBLL = new BLL.T_Sys_DictionaryBase();
@@ -26,14 +26,21 @@ namespace CallCenterApi.Interface.Controllers
26 26
         /// <returns></returns>
27 27
         public ActionResult GetList(FilterDictionary filter)
28 28
         {
29
-            ActionResult res = NoToken("未知错误,请重新登录");
30 29
             if (Request.IsAuthenticated)
31 30
             {
32 31
                 var sql = " and F_State=1 ";
32
+                int userId = CurrentUser.UserData.F_UserId;
33
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
34
+
35
+                if (!string.IsNullOrEmpty(userModel.groupcode))
36
+                {
37
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "'";
38
+                }
39
+
33 40
                 var recordCount = 0;
34 41
                 var dt = BLL.PagerBLL.GetListPager(
35 42
                   "T_Sys_DictionaryBase",
36
-                  "F_DictionaryFlag",
43
+                  "F_Id",
37 44
                   "*",
38 45
                   sql,
39 46
                   "ORDER BY F_Sort ",
@@ -46,39 +53,40 @@ namespace CallCenterApi.Interface.Controllers
46 53
                 {
47 54
                     rows = modelList.Select(x => new
48 55
                     {
56
+                        id = x.F_Id,
49 57
                         name = x.F_DictionaryName,
50 58
                         flag = x.F_DictionaryFlag,
51 59
                         sort = x.F_Sort
52 60
                     }),
53 61
                     total = recordCount
54 62
                 };
55
-                res = Content(obj.ToJson());
63
+                return Content(obj.ToJson());
56 64
             }
57
-            return res;
65
+            return NoToken("未知错误,请重新登录");
58 66
         }
59 67
 
60 68
         /// <summary>
61 69
         /// 获取字典
62 70
         /// </summary>
63
-        /// <param name="dicFlag"></param>
71
+        /// <param name="id"></param>
64 72
         /// <returns></returns>
65
-        public ActionResult GetDic(string dicFlag)
73
+        public ActionResult GetDic(int id)
66 74
         {
67
-            ActionResult res = NoToken("未知错误,请重新登录");
68 75
             if (Request.IsAuthenticated)
69 76
             {
70
-                Model.T_Sys_DictionaryBase baseModel = dictionaryBaseBLL.GetModel(dicFlag);
77
+                Model.T_Sys_DictionaryBase baseModel = dictionaryBaseBLL.GetModel(id);
71 78
                 if (baseModel != null)
72
-                    res = Success("加载字典成功", new
79
+                    return Success("加载字典成功", new
73 80
                     {
81
+                        id = baseModel.F_Id,
74 82
                         name = baseModel.F_DictionaryName,
75 83
                         flag = baseModel.F_DictionaryFlag,
76 84
                         sort = baseModel.F_Sort
77 85
                     });
78 86
                 else
79
-                    res = Error("加载字典失败");
87
+                    return Error("加载字典失败");
80 88
             }
81
-            return res;
89
+            return NoToken("未知错误,请重新登录");
82 90
         }
83 91
         //[Authority]
84 92
         /// <summary>
@@ -88,26 +96,29 @@ namespace CallCenterApi.Interface.Controllers
88 96
         /// <returns></returns>
89 97
         public ActionResult AddDic(DictionaryBaseInput input)
90 98
         {
91
-            ActionResult res = NoToken("未知错误,请重新登录");
92 99
             if (Request.IsAuthenticated)
93 100
             {
101
+                int userId = CurrentUser.UserData.F_UserId;
102
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
103
+
94 104
                 Model.T_Sys_DictionaryBase orderModel = new Model.T_Sys_DictionaryBase();
95 105
                 BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
96
-                var model = orderBll.GetModel(input.DicFlag.Trim());
97
-                if (model != null)
106
+                var list = orderBll.GetList(" F_DictionaryFlag='" + input.DicFlag.Trim() + "' and F_GroupCode='" + userModel.groupcode + "'").Tables[0];
107
+                if (list.Rows.Count >0)
98 108
                     return Error("字典标志已存在");
99 109
                 orderModel.F_DictionaryFlag = input.DicFlag;
100 110
                 orderModel.F_DictionaryName = input.Name;
101 111
                 orderModel.F_Describe = input.Remark;
102 112
                 orderModel.F_State = true;
103 113
                 orderModel.F_Sort = input.Sort;
114
+                orderModel.F_GroupCode = userModel.groupcode;
104 115
 
105
-                if (orderBll.Add(orderModel))
106
-                    res = Success("字典添加成功");
116
+                if (orderBll.Add(orderModel)>0)
117
+                    return Success("字典添加成功");
107 118
                 else
108
-                    res = Error("字典添加失败");
119
+                    return Error("字典添加失败");
109 120
             }
110
-            return res;
121
+            return NoToken("未知错误,请重新登录");
111 122
         }
112 123
 
113 124
         //[Authority]
@@ -118,11 +129,10 @@ namespace CallCenterApi.Interface.Controllers
118 129
         /// <returns></returns>
119 130
         public ActionResult EditDic(DictionaryBaseInput input)
120 131
         {
121
-            ActionResult res = NoToken("未知错误,请重新登录");
122 132
             if (Request.IsAuthenticated)
123 133
             {
124 134
                 BLL.T_Sys_DictionaryBase orderBll = new BLL.T_Sys_DictionaryBase();
125
-                Model.T_Sys_DictionaryBase orderModel = orderBll.GetModel(input.DicFlag.Trim());
135
+                Model.T_Sys_DictionaryBase orderModel = orderBll.GetModel(input.DicId);
126 136
                 if (orderModel == null)
127 137
                     return Error("字典对象不存在");
128 138
                 orderModel.F_DictionaryFlag = input.DicFlag;
@@ -130,11 +140,11 @@ namespace CallCenterApi.Interface.Controllers
130 140
                 orderModel.F_Describe = input.Remark;
131 141
                 orderModel.F_Sort = input.Sort;
132 142
                 if (orderBll.Update(orderModel))
133
-                    res = Success("字典添加成功");
143
+                    return Success("字典添加成功");
134 144
                 else
135
-                    res = Error("字典添加失败");
145
+                    return Error("字典添加失败");
136 146
             }
137
-            return res;
147
+            return NoToken("未知错误,请重新登录");
138 148
         }
139 149
 
140 150
         //[Authority]
@@ -145,7 +155,6 @@ namespace CallCenterApi.Interface.Controllers
145 155
         /// <returns></returns>
146 156
         public ActionResult DelDic(string[] ids)
147 157
         {
148
-            ActionResult res = NoToken("未知错误,请重新登录");
149 158
             if (Request.IsAuthenticated)
150 159
             {
151 160
                 if (ids == null || ids.Length <= 0)
@@ -156,11 +165,11 @@ namespace CallCenterApi.Interface.Controllers
156 165
                     sb.Append("'" + item + "',");
157 166
                 }
158 167
                 if (new BLL.T_Sys_DictionaryBase().DeleteList(sb.ToString().Trim(',')))
159
-                    res = Success("删除成功");
168
+                    return Success("删除成功");
160 169
                 else
161
-                    res = Error("删除失败");
170
+                    return Error("删除失败");
162 171
             }
163
-            return res;
172
+            return NoToken("未知错误,请重新登录");
164 173
         }
165 174
         #endregion
166 175
 
@@ -169,13 +178,18 @@ namespace CallCenterApi.Interface.Controllers
169 178
         //获取字典值列表
170 179
         public ActionResult GetDicValueList(FilterDictionary filter)
171 180
         {
172
-             ActionResult res = NoToken("未知错误,请重新登录");
173 181
             if (Request.IsAuthenticated)
174 182
             {
175
-                string sql = "";
176
-                DataTable dt = new DataTable();
183
+                var sql = " and F_State=1 ";
184
+                int userId = CurrentUser.UserData.F_UserId;
185
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
177 186
 
187
+                if (!string.IsNullOrEmpty(userModel.groupcode))
188
+                {
189
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "'";
190
+                }
178 191
 
192
+                DataTable dt = new DataTable();
179 193
 
180 194
                 if (!string.IsNullOrWhiteSpace(filter.Id))
181 195
                 {
@@ -210,38 +224,42 @@ namespace CallCenterApi.Interface.Controllers
210 224
                     total = recordCount
211 225
                 };
212 226
 
213
-                res = Content(obj.ToJson());
227
+                return Content(obj.ToJson());
214 228
             }
215
-            return res;
229
+            return NoToken("未知错误,请重新登录");
216 230
         }
217 231
 
218 232
         //获取字典值列表
219 233
         public ActionResult GetDicValueListByFlag(string flag)
220 234
         {
221
-            ActionResult res = NoToken("未知错误,请重新登录");
222 235
             if (Request.IsAuthenticated)
223 236
             {
237
+                var sql = "  F_DictionaryFlag='" + flag + "' and F_State=1 ";
238
+                int userId = CurrentUser.UserData.F_UserId;
239
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
224 240
 
225
-                DataTable dt = new DataTable();
241
+                if (!string.IsNullOrEmpty(userModel.groupcode))
242
+                {
243
+                    sql += " and F_GroupCode = '" + userModel.groupcode + "'";
244
+                }
226 245
 
227
-                dt = new BLL.T_Sys_DictionaryValue().GetList(" F_DictionaryFlag='" + flag + "' and F_State=1 ").Tables[0];
246
+                DataTable dt = new BLL.T_Sys_DictionaryValue().GetList(0, sql, " F_Sort asc").Tables[0];
228 247
 
229
-                res = Success("列表加载成功", dt);
248
+                return Success("列表加载成功", dt);
230 249
             }
231
-            return res;
250
+            return NoToken("未知错误,请重新登录");
232 251
         }
233 252
 
234 253
         //加载字典值
235 254
         public ActionResult GetDicValue(int dicValueId = 0)
236 255
         {
237
-            ActionResult res = NoToken("未知错误,请重新登录");
238 256
             if (Request.IsAuthenticated)
239 257
             {
240 258
                 if (dicValueId <= 0)
241 259
                     return Error("字典值标识传输失败");
242 260
                 Model.T_Sys_DictionaryValue valueModel = dictionaryValueBLL.GetModel(dicValueId);
243 261
                 if (valueModel != null)
244
-                    res = Success("加载字典值成功", new
262
+                    return Success("加载字典值成功", new
245 263
                     {
246 264
                         id = valueModel.F_DictionaryValueId,
247 265
                         dicflag = valueModel.F_DictionaryFlag,
@@ -250,18 +268,21 @@ namespace CallCenterApi.Interface.Controllers
250 268
                         sort = valueModel.F_Sort,
251 269
                     });
252 270
                 else
253
-                    res = Error("加载字典值失败");
271
+                    return Error("加载字典值失败");
254 272
             }
255
-            return res;
273
+            return NoToken("未知错误,请重新登录");
256 274
         }
257 275
 
258 276
         //[Authority]
259 277
         //添加字典值
260 278
         public ActionResult AddDicValue(DictionaryValueInput input)
261 279
         {
262
-            ActionResult res = NoToken("未知错误,请重新登录");
263 280
             if (Request.IsAuthenticated)
264 281
             {
282
+
283
+                int userId = CurrentUser.UserData.F_UserId;
284
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
285
+
265 286
                 Model.T_Sys_DictionaryValue orderModel = new Model.T_Sys_DictionaryValue();
266 287
                 BLL.T_Sys_DictionaryValue orderBll = new BLL.T_Sys_DictionaryValue();
267 288
 
@@ -271,20 +292,19 @@ namespace CallCenterApi.Interface.Controllers
271 292
                 orderModel.F_ValueCode = "";
272 293
                 orderModel.F_DictionaryFlag = input.DicFlag;
273 294
                 orderModel.F_Sort = input.Sort;
274
-
295
+                orderModel.F_GroupCode = userModel.groupcode;
275 296
 
276 297
                 if (orderBll.Add(orderModel) > 0)
277
-                    res = Success("字典值添加成功");
298
+                    return Success("字典值添加成功");
278 299
                 else
279
-                    res = Error("字典值添加失败");
300
+                    return Error("字典值添加失败");
280 301
             }
281
-            return res;
302
+            return NoToken("未知错误,请重新登录");
282 303
         }
283 304
         ////[Authority]
284 305
         //编辑字典值
285 306
         public ActionResult EditDicValue(DictionaryValueInput input)
286 307
         {
287
-            ActionResult res = NoToken("未知错误,请重新登录");
288 308
             if (Request.IsAuthenticated)
289 309
             {
290 310
                 if (input.DicVid <= 0)
@@ -299,33 +319,28 @@ namespace CallCenterApi.Interface.Controllers
299 319
                 orderModel.F_DictionaryFlag = input.DicFlag;
300 320
                 orderModel.F_Sort = input.Sort;
301 321
                 if (orderBll.Update(orderModel))
302
-                    res = Success("字典值编辑成功");
322
+                    return Success("字典值编辑成功");
303 323
                 else
304
-                    res = Error("字典值编辑失败");
324
+                    return Error("字典值编辑失败");
305 325
             }
306
-            return res;
326
+            return NoToken("未知错误,请重新登录");
307 327
         }
308 328
         //[Authority]
309 329
         //删除字典值
310 330
         public ActionResult DelDicValue(string[] ids)
311 331
         {
312
-            ActionResult res = NoToken("未知错误,请重新登录");
313 332
             if (Request.IsAuthenticated)
314 333
             {
315 334
                 if (ids == null || ids.Length <= 0)
316 335
                     return Error("获取参数失败");
317 336
                 var idStr = string.Join(",", ids);
318 337
                 if (new BLL.T_Sys_DictionaryValue().DeleteList(idStr))
319
-                    res = Success("删除成功");
338
+                    return Success("删除成功");
320 339
                 else
321
-                    res = Error("删除失败");
340
+                    return Error("删除失败");
322 341
             }
323
-            return res;
342
+            return NoToken("未知错误,请重新登录");
324 343
         }
325 344
         #endregion
326
-
327
-
328
-
329
-
330 345
     }
331 346
 }

+ 88 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -152,7 +152,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
152 152
                 }
153 153
                 if (strkey.Trim() != "" && strkey != "undefined")
154 154
                 {
155
-                    sql += " and F_Content like '%" + strkey + "%' ";
155
+                    sql += " and (F_Content like '%" + strkey + "%' or F_Name like '%" + strkey + "%' or F_Province like '%" + strkey + "%' or F_City like '%" 
156
+                        + strkey + "%' or F_CreateUser like '%" + strkey + "%' or F_VIPPhone like '%" + strkey + "%') ";
156 157
                 }
157 158
                 if (strworkid.Trim() != "" && strworkid != "undefined")
158 159
                 {
@@ -198,7 +199,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
198 199
                     pagesize = Convert.ToInt32(strpagesize);
199 200
                 }
200 201
 
201
-                string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_Source) as SourceName";
202
+                string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,dbo.GetDictionaryName(F_Source) as SourceName";
202 203
 
203 204
                 if (isdc > 0)
204 205
                 {
@@ -271,7 +272,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
271 272
 
272 273
             if (!string.IsNullOrEmpty(strworkorderid))
273 274
             {
274
-                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,"
275
+                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,"
275 276
                     + "dbo.GetDictionaryName(F_Source) as SourceName  from T_Bus_WorkOrder where F_WorkOrderId ='" + strworkorderid + "'";
276 277
                 var dt = DbHelperSQL.Query(sql).Tables[0];
277 278
                 if (dt.Rows.Count > 0)
@@ -311,6 +312,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
311 312
                     }
312 313
                     #endregion
313 314
 
315
+                    #region 跟进信息
316
+                    string gjsql = "select *,dbo.GetUserName(F_CreateUser) as UserName from T_Bus_Follow "
317
+                        + "where F_State=1 and F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
318
+
319
+                    var gjdt = DbHelperSQL.Query(gjsql).Tables[0];
320
+                    if (configfj != null)
321
+                    {
322
+                        gjdt = BindFileData(gjdt, configfj.F_ParamValue);
323
+                    }
324
+                    #endregion
325
+
314 326
                     #region 办理过程
315 327
                     string gcsql = "select *,dbo.GetUserName(F_CreateUser) as UserName "
316 328
                                     + "from T_Bus_Operation where F_IsDelete=0 and F_WorkOrderId ='" + strworkorderid + "'";
@@ -342,7 +354,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
342 354
                     {
343 355
                         data = dt,
344 356
                         cbdata = cbdt,
345
-                        gcdata = gcdt
357
+                        gcdata = gcdt,
358
+                        gjdata = gjdt
346 359
                     };
347 360
                     return Success("获取成功", obj);
348 361
                 }
@@ -385,8 +398,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
385 398
             string buydate = RequestString.GetFormString("buydate");
386 399
             //购买地点
387 400
             string buyaddress = RequestString.GetFormString("buyaddress");
388
-            //产品类别
389
-            string producttype = RequestString.GetFormString("producttype");
401
+            ////产品类别
402
+            //string producttype = RequestString.GetFormString("producttype");
390 403
             //生产日期
391 404
             string productdate = RequestString.GetFormString("productdate");
392 405
             //生产批号
@@ -405,6 +418,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
405 418
             string files = RequestString.GetFormString("files");
406 419
             //类型
407 420
             int type = RequestString.GetInt("type", 0);
421
+            //子类型
422
+            int smalltype = RequestString.GetInt("smalltype", 0);
423
+            //产品类别
424
+            int producttype = RequestString.GetInt("producttype", 0);
408 425
             //来源
409 426
             int source = RequestString.GetInt("source", 0);
410 427
             //是否寄回
@@ -431,6 +448,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
431 448
 
432 449
                 modelT_Bus_WorkOrder.F_Source = source;//信息来源
433 450
                 modelT_Bus_WorkOrder.F_Type = type;//信息类别
451
+                modelT_Bus_WorkOrder.F_SmallType = smalltype;//信息子类别
434 452
                 modelT_Bus_WorkOrder.F_CusName = cusname;//投诉人姓名
435 453
                 modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
436 454
                 modelT_Bus_WorkOrder.F_CusPhone = cusphone;//来电号码
@@ -535,8 +553,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
535 553
             string buydate = RequestString.GetFormString("buydate");
536 554
             //购买地点
537 555
             string buyaddress = RequestString.GetFormString("buyaddress");
538
-            //产品类别
539
-            string producttype = RequestString.GetFormString("producttype");
556
+            ////产品类别
557
+            //string producttype = RequestString.GetFormString("producttype");
540 558
             //生产批号
541 559
             string batchnumber = RequestString.GetFormString("batchnumber");
542 560
             //使用日期
@@ -553,6 +571,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
553 571
             string files = RequestString.GetFormString("files");
554 572
             //类型
555 573
             int type = RequestString.GetInt("type", 0);
574
+            //子类型
575
+            int smalltype = RequestString.GetInt("smalltype", 0);
576
+            //产品类别
577
+            int producttype = RequestString.GetInt("producttype", 0);
556 578
             //来源
557 579
             int source = RequestString.GetInt("source", 0);
558 580
             //是否寄回
@@ -583,6 +605,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
583 605
 
584 606
                     modelT_Bus_WorkOrder.F_Source = source;//信息来源
585 607
                     modelT_Bus_WorkOrder.F_Type = type;//信息类别
608
+                    modelT_Bus_WorkOrder.F_SmallType = smalltype;//信息子类别
586 609
                     modelT_Bus_WorkOrder.F_CusName = cusname;//投诉人姓名
587 610
                     modelT_Bus_WorkOrder.F_CusSex = cussex;//性别
588 611
                     modelT_Bus_WorkOrder.F_CusPhone = cusphone;//来电号码
@@ -723,6 +746,63 @@ namespace CallCenterApi.Interface.Controllers.workorder
723 746
         }
724 747
 
725 748
         /// <summary>
749
+        /// 跟进工单
750
+        /// </summary>
751
+        /// <returns></returns>
752
+        public ActionResult FllowWorkOrder()
753
+        {
754
+            int userId = CurrentUser.UserData.F_UserId;
755
+            Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
756
+
757
+            string workorderid = RequestString.GetFormString("workid");
758
+            string title = RequestString.GetFormString("title");
759
+            string content = RequestString.GetFormString("content");
760
+            string files = RequestString.GetFormString("files");
761
+
762
+            Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
763
+            if (modelT_Bus_WorkOrder != null)
764
+            {
765
+                using (TransactionScope trans = new TransactionScope())
766
+                {
767
+                    #region 插入督办记录
768
+                    Model.T_Bus_Follow modelT_Bus_Follow = new Model.T_Bus_Follow();
769
+                    modelT_Bus_Follow.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
770
+                    modelT_Bus_Follow.F_Title = title;
771
+                    modelT_Bus_Follow.F_Content = content;
772
+                    modelT_Bus_Follow.F_File = files;
773
+                    modelT_Bus_Follow.F_State = 1;
774
+                    modelT_Bus_Follow.F_IsDelete = 0;
775
+                    modelT_Bus_Follow.F_CreateUser = userModel.F_UserCode;
776
+                    modelT_Bus_Follow.F_CreateTime = DateTime.Now;
777
+
778
+                    new BLL.T_Bus_Follow().Add(modelT_Bus_Follow);
779
+                    #endregion
780
+
781
+                    #region 插入操作记录
782
+                    Model.T_Bus_Operation oper = new Model.T_Bus_Operation();
783
+                    oper.F_WorkOrderId = modelT_Bus_WorkOrder.F_WorkOrderId;
784
+                    oper.F_State = modelT_Bus_WorkOrder.F_State;
785
+
786
+                    string userinfo = userModel.F_UserName + "(" + userModel.F_UserCode + ")";
787
+                    oper.F_Message = userinfo + " 跟进了工单";
788
+                    oper.F_CreateUser = userModel.F_UserCode;
789
+                    oper.F_CreateTime = DateTime.Now;
790
+                    oper.F_IsDelete = 0;
791
+
792
+                    new BLL.T_Bus_Operation().Add(oper);
793
+                    #endregion
794
+
795
+                    trans.Complete();
796
+                }
797
+                return Success("操作成功");
798
+            }
799
+            else
800
+            {
801
+                return Error("操作失败");
802
+            }
803
+        }
804
+
805
+        /// <summary>
726 806
         /// 处理工单
727 807
         /// </summary>
728 808
         /// <returns></returns>

+ 1 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/DictionaryInput.cs

@@ -7,6 +7,7 @@ namespace CallCenterApi.Interface.Models.Input
7 7
 {
8 8
     public class DictionaryBaseInput
9 9
     {
10
+        public int DicId { get; set; }
10 11
         public string DicFlag { get; set; }
11 12
         public string Name { get; set; }
12 13
         public int Sort { get; set; } = 0;
@@ -21,7 +22,5 @@ namespace CallCenterApi.Interface.Models.Input
21 22
         public string DicvName { get; set; }
22 23
         public int Sort { get; set; } = 0;
23 24
         public string DicDes { get; set; }
24
-
25
-
26 25
     }
27 26
 }

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

@@ -51,6 +51,7 @@
51 51
     <Compile Include="QCModel.cs" />
52 52
     <Compile Include="telloc_users.cs" />
53 53
     <Compile Include="TreeModel.cs" />
54
+    <Compile Include="T_Bus_Follow.cs" />
54 55
     <Compile Include="T_Bus_Operation.cs" />
55 56
     <Compile Include="T_Bus_RemindRecord.cs" />
56 57
     <Compile Include="T_Bus_WorkOrder.cs" />

+ 125 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_Follow.cs

@@ -0,0 +1,125 @@
1
+using System;
2
+namespace CallCenterApi.Model
3
+{
4
+    /// <summary>
5
+    /// T_Bus_Follow:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Bus_Follow
9
+    {
10
+        public T_Bus_Follow()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_workorderid;
15
+        private string _f_title;
16
+        private string _f_content;
17
+        private string _f_remark;
18
+        private string _f_file;
19
+        private int? _f_state;
20
+        private string _f_createuser;
21
+        private DateTime? _f_createtime;
22
+        private int? _f_isdelete;
23
+        private string _f_deleteuser;
24
+        private DateTime? _f_deletetime;
25
+        /// <summary>
26
+        /// 
27
+        /// </summary>
28
+        public int F_Id
29
+        {
30
+            set { _f_id = value; }
31
+            get { return _f_id; }
32
+        }
33
+        /// <summary>
34
+        /// 
35
+        /// </summary>
36
+        public string F_WorkOrderId
37
+        {
38
+            set { _f_workorderid = value; }
39
+            get { return _f_workorderid; }
40
+        }
41
+        /// <summary>
42
+        /// 
43
+        /// </summary>
44
+        public string F_Title
45
+        {
46
+            set { _f_title = value; }
47
+            get { return _f_title; }
48
+        }
49
+        /// <summary>
50
+        /// 
51
+        /// </summary>
52
+        public string F_Content
53
+        {
54
+            set { _f_content = value; }
55
+            get { return _f_content; }
56
+        }
57
+        /// <summary>
58
+        /// 
59
+        /// </summary>
60
+        public string F_Remark
61
+        {
62
+            set { _f_remark = value; }
63
+            get { return _f_remark; }
64
+        }
65
+        /// <summary>
66
+        /// 
67
+        /// </summary>
68
+        public string F_File
69
+        {
70
+            set { _f_file = value; }
71
+            get { return _f_file; }
72
+        }
73
+        /// <summary>
74
+        /// 
75
+        /// </summary>
76
+        public int? F_State
77
+        {
78
+            set { _f_state = value; }
79
+            get { return _f_state; }
80
+        }
81
+        /// <summary>
82
+        /// 
83
+        /// </summary>
84
+        public string F_CreateUser
85
+        {
86
+            set { _f_createuser = value; }
87
+            get { return _f_createuser; }
88
+        }
89
+        /// <summary>
90
+        /// 
91
+        /// </summary>
92
+        public DateTime? F_CreateTime
93
+        {
94
+            set { _f_createtime = value; }
95
+            get { return _f_createtime; }
96
+        }
97
+        /// <summary>
98
+        /// 
99
+        /// </summary>
100
+        public int? F_IsDelete
101
+        {
102
+            set { _f_isdelete = value; }
103
+            get { return _f_isdelete; }
104
+        }
105
+        /// <summary>
106
+        /// 
107
+        /// </summary>
108
+        public string F_DeleteUser
109
+        {
110
+            set { _f_deleteuser = value; }
111
+            get { return _f_deleteuser; }
112
+        }
113
+        /// <summary>
114
+        /// 
115
+        /// </summary>
116
+        public DateTime? F_DeleteTime
117
+        {
118
+            set { _f_deletetime = value; }
119
+            get { return _f_deletetime; }
120
+        }
121
+        #endregion Model
122
+
123
+    }
124
+}
125
+

+ 12 - 3
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -16,6 +16,7 @@ namespace CallCenterApi.Model
16 16
         private string _f_cusname;
17 17
         private string _f_cussex;
18 18
         private int? _f_type;
19
+        private int? _f_smalltype;
19 20
         private string _f_content;
20 21
         private string _f_file;
21 22
         private int? _f_source;
@@ -23,7 +24,7 @@ namespace CallCenterApi.Model
23 24
         private string _f_productdate;
24 25
         private string _f_buydate;
25 26
         private string _f_buyaddress;
26
-        private string _f_producttype;
27
+        private int? _f_producttype;
27 28
         private string _f_batchnumber;
28 29
         private string _f_userdate;
29 30
         private int? _f_isback;
@@ -94,7 +95,7 @@ namespace CallCenterApi.Model
94 95
             get { return _f_cussex; }
95 96
         }
96 97
         /// <summary>
97
-        /// 原因
98
+        /// 工单类型
98 99
         /// </summary>
99 100
         public int? F_Type
100 101
         {
@@ -102,6 +103,14 @@ namespace CallCenterApi.Model
102 103
             get { return _f_type; }
103 104
         }
104 105
         /// <summary>
106
+        /// 工单类型子类型
107
+        /// </summary>
108
+        public int? F_SmallType
109
+        {
110
+            set { _f_smalltype = value; }
111
+            get { return _f_smalltype; }
112
+        }
113
+        /// <summary>
105 114
         /// 事件描述
106 115
         /// </summary>
107 116
         public string F_Content
@@ -160,7 +169,7 @@ namespace CallCenterApi.Model
160 169
         /// <summary>
161 170
         /// 产品类别
162 171
         /// </summary>
163
-        public string F_ProductType
172
+        public int? F_ProductType
164 173
         {
165 174
             set { _f_producttype = value; }
166 175
             get { return _f_producttype; }

+ 17 - 11
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_Department.cs

@@ -1,9 +1,4 @@
1 1
 using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Threading.Tasks;
6
-
7 2
 namespace CallCenterApi.Model
8 3
 {
9 4
     /// <summary>
@@ -31,8 +26,9 @@ namespace CallCenterApi.Model
31 26
         private string _f_otherphone;
32 27
         private string _f_email;
33 28
         private int? _f_header;
29
+        private string _f_groupcode;
34 30
         /// <summary>
35
-        /// 
31
+        /// 部门自增ID
36 32
         /// </summary>
37 33
         public int F_DeptId
38 34
         {
@@ -40,7 +36,7 @@ namespace CallCenterApi.Model
40 36
             get { return _f_deptid; }
41 37
         }
42 38
         /// <summary>
43
-        /// 
39
+        /// 对接系统的ID
44 40
         /// </summary>
45 41
         public string F_DeptCode
46 42
         {
@@ -56,7 +52,7 @@ namespace CallCenterApi.Model
56 52
             get { return _f_parentname; }
57 53
         }
58 54
         /// <summary>
59
-        /// 
55
+        /// 父节点ID
60 56
         /// </summary>
61 57
         public int F_ParentId
62 58
         {
@@ -72,7 +68,7 @@ namespace CallCenterApi.Model
72 68
             get { return _f_parentcode; }
73 69
         }
74 70
         /// <summary>
75
-        /// 
71
+        /// 部门名称
76 72
         /// </summary>
77 73
         public string F_DeptName
78 74
         {
@@ -80,7 +76,7 @@ namespace CallCenterApi.Model
80 76
             get { return _f_deptname; }
81 77
         }
82 78
         /// <summary>
83
-        /// 
79
+        /// 状态
84 80
         /// </summary>
85 81
         public int? F_State
86 82
         {
@@ -104,7 +100,7 @@ namespace CallCenterApi.Model
104 100
             get { return _f_type; }
105 101
         }
106 102
         /// <summary>
107
-        /// 
103
+        /// 排序编号
108 104
         /// </summary>
109 105
         public int? F_Sort
110 106
         {
@@ -159,6 +155,16 @@ namespace CallCenterApi.Model
159 155
             set { _f_header = value; }
160 156
             get { return _f_header; }
161 157
         }
158
+        /// <summary>
159
+        /// 
160
+        /// </summary>
161
+        public string F_GroupCode
162
+        {
163
+            set { _f_groupcode = value; }
164
+            get { return _f_groupcode; }
165
+        }
162 166
         #endregion Model
167
+
163 168
     }
164 169
 }
170
+

+ 23 - 8
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_DictionaryBase.cs

@@ -1,25 +1,30 @@
1 1
 using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Threading.Tasks;
6
-
7 2
 namespace CallCenterApi.Model
8 3
 {
9 4
     /// <summary>
10
-	/// T_Sys_DictionaryBase:实体类(属性说明自动提取数据库字段的描述信息)
11
-	/// </summary>
12
-	[Serializable]
5
+    /// T_Sys_DictionaryBase:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
13 8
     public partial class T_Sys_DictionaryBase
14 9
     {
15 10
         public T_Sys_DictionaryBase()
16 11
         { }
17 12
         #region Model
13
+        private int _f_id;
18 14
         private string _f_dictionaryflag;
19 15
         private string _f_dictionaryname;
20 16
         private int? _f_sort;
21 17
         private string _f_describe;
22 18
         private bool _f_state;
19
+        private string _f_groupcode;
20
+        /// <summary>
21
+        /// 
22
+        /// </summary>
23
+        public int F_Id
24
+        {
25
+            set { _f_id = value; }
26
+            get { return _f_id; }
27
+        }
23 28
         /// <summary>
24 29
         /// 
25 30
         /// </summary>
@@ -60,6 +65,16 @@ namespace CallCenterApi.Model
60 65
             set { _f_state = value; }
61 66
             get { return _f_state; }
62 67
         }
68
+        /// <summary>
69
+        /// 
70
+        /// </summary>
71
+        public string F_GroupCode
72
+        {
73
+            set { _f_groupcode = value; }
74
+            get { return _f_groupcode; }
75
+        }
63 76
         #endregion Model
77
+
64 78
     }
65 79
 }
80
+

+ 11 - 5
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_DictionaryValue.cs

@@ -1,9 +1,4 @@
1 1
 using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Threading.Tasks;
6
-
7 2
 namespace CallCenterApi.Model
8 3
 {
9 4
     /// <summary>
@@ -22,6 +17,7 @@ namespace CallCenterApi.Model
22 17
         private int? _f_sort;
23 18
         private string _f_describe;
24 19
         private bool _f_state;
20
+        private string _f_groupcode;
25 21
         /// <summary>
26 22
         /// 
27 23
         /// </summary>
@@ -78,6 +74,16 @@ namespace CallCenterApi.Model
78 74
             set { _f_state = value; }
79 75
             get { return _f_state; }
80 76
         }
77
+        /// <summary>
78
+        /// 
79
+        /// </summary>
80
+        public string F_GroupCode
81
+        {
82
+            set { _f_groupcode = value; }
83
+            get { return _f_groupcode; }
84
+        }
81 85
         #endregion Model
86
+
82 87
     }
83 88
 }
89
+