Ver Código Fonte

Merge branch 'master' of http://192.168.1.222:3000/zhoufan/XYX12345_Api

duhongyu 6 anos atrás
pai
commit
183e2ff9bc

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

@@ -104,6 +104,7 @@
104 104
     <Compile Include="T_SMS_SentSMS.cs" />
105 105
     <Compile Include="T_Sms_SmsModel.cs" />
106 106
     <Compile Include="T_Sys_Accessories.cs" />
107
+    <Compile Include="T_Sys_Address.cs" />
107 108
     <Compile Include="T_Sys_Area.cs" />
108 109
     <Compile Include="T_Sys_Class.cs" />
109 110
     <Compile Include="T_Sys_Department.cs" />

+ 170 - 0
CallCenterApi/CallCenterApi.BLL/T_Sys_Address.cs

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

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

@@ -104,6 +104,7 @@
104 104
     <Compile Include="T_SMS_SentSMS.cs" />
105 105
     <Compile Include="T_Sms_SmsModel.cs" />
106 106
     <Compile Include="T_Sys_Accessories.cs" />
107
+    <Compile Include="T_Sys_Address.cs" />
107 108
     <Compile Include="T_Sys_Area.cs" />
108 109
     <Compile Include="T_Sys_Class.cs" />
109 110
     <Compile Include="T_Sys_Department.cs" />

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


+ 337 - 0
CallCenterApi/CallCenterApi.DAL/T_Sys_Address.cs

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

+ 3 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -163,6 +163,7 @@
163 163
     <Compile Include="App_Start\ErrorAttribute.cs" />
164 164
     <Compile Include="App_Start\RouteConfig.cs" />
165 165
     <Compile Include="App_Start\WechatActionFilter.cs" />
166
+    <Compile Include="Controllers\AddressManageController.cs" />
166 167
     <Compile Include="Controllers\APPController.cs" />
167 168
     <Compile Include="Controllers\AreaController.cs" />
168 169
     <Compile Include="Controllers\Base\BaseController.cs" />
@@ -275,6 +276,7 @@
275 276
     </Content>
276 277
     <Content Include="Configs\log4net.config" />
277 278
     <Content Include="Configs\system.config" />
279
+    <None Include="Properties\PublishProfiles\xyx新野县12345.pubxml" />
278 280
     <None Include="Web.Debug.config">
279 281
       <DependentUpon>Web.config</DependentUpon>
280 282
     </None>
@@ -284,6 +286,7 @@
284 286
   </ItemGroup>
285 287
   <ItemGroup>
286 288
     <Folder Include="App_Data\" />
289
+    <Folder Include="Views\AddressManage\" />
287 290
     <Folder Include="Views\DemandsType\" />
288 291
   </ItemGroup>
289 292
   <ItemGroup>

+ 70 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/AddressManageController.cs

@@ -0,0 +1,70 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Data;
6
+using System.Linq;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+
10
+namespace CallCenterApi.Interface.Controllers
11
+{
12
+    /// <summary>
13
+    /// 地址 - 省市县乡
14
+    /// </summary>
15
+    public class AddressManageController : BaseController
16
+    {
17
+        private BLL.T_Sys_Address bll = new BLL.T_Sys_Address();
18
+
19
+        /// <summary>
20
+        /// 获取地址信息(省市县乡)
21
+        /// </summary>
22
+        /// <param name="parentcode">默认是空(省)</param>
23
+        /// <returns></returns>
24
+        [Authority]
25
+        public ActionResult GetAddressList(string parentcode = "")
26
+        {
27
+            string sql = "";
28
+             sql += " and ISNULL(Parent_Code,'') = '" + parentcode.Trim() + "' ";
29
+            DataTable dt = bll.GetList(0, $" 1=1 {sql}", " Sort").Tables[0];
30
+            return Success("加载成功", dt);
31
+        }
32
+
33
+        /// <summary>
34
+        /// 获取地址名称和编号
35
+        /// </summary>
36
+        /// <param name="codes">编码组合(例如:111|222|333|444)</param>
37
+        /// <returns></returns>
38
+        public ActionResult GetAddressNamesByCodes(string codes = "")
39
+        {
40
+            // 省 市 县 乡镇 名称
41
+            // 省 市 县 乡镇 编码
42
+            string address_Name = "";
43
+            string address_code = "";
44
+            var list = bll.DataTableToList(bll.GetAllList().Tables[0]);
45
+            if (!string.IsNullOrEmpty(codes))
46
+            {
47
+                for (int i = 0; i < codes.Length; i++)
48
+                {
49
+                    if (!string.IsNullOrEmpty(codes[i].ToString()))
50
+                    {
51
+                        var model = list.FirstOrDefault(x => x.Code == codes[i].ToString());
52
+                        if (model != null)
53
+                        {
54
+                            address_Name += model.Code + "|";
55
+                            address_code += model.Name + " ";
56
+                        }
57
+                    }
58
+                }
59
+            }
60
+            var obj = new
61
+            {
62
+                state = "success",
63
+                message = "成功",
64
+                names = address_Name,
65
+                codes = address_code
66
+            };
67
+            return Content(obj.ToJson());
68
+        }
69
+    }
70
+}

+ 23 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/DepartmentController.cs

@@ -29,6 +29,29 @@ namespace CallCenterApi.Interface.Controllers
29 29
         }
30 30
 
31 31
         /// <summary>
32
+        /// 获取部门列表 - 树形下拉
33
+        /// </summary>
34
+        /// <param name="dept"></param>
35
+        /// <param name="iscbdw"></param>
36
+        /// <returns></returns>
37
+        public ActionResult GetDeptListByDept(string dept, int iscbdw = 0)
38
+        {
39
+            string depts = RequestString.FilterSql(dept, 1);
40
+            DataTable dt = new DataTable();
41
+            var sql = " F_State=0   and F_PartentId>0 "
42
+                    + "and F_PartentId not in (select F_DeptId from T_Sys_Department where F_PartentId = 0)";
43
+            if (iscbdw == 0)
44
+                sql += " and  ISNULL(F_IsDealDept, '0') ='1' ";
45
+            if (!string.IsNullOrEmpty(depts))
46
+            {
47
+                sql += " and F_DeptName like '%" + depts.Trim() + "%'";
48
+
49
+                dt = departmentBLL.GetList(0, sql, "F_Sort").Tables[0];
50
+            }
51
+            return Success("加载成功", dt);
52
+        }
53
+
54
+        /// <summary>
32 55
         /// 获取二级部门列表
33 56
         /// </summary>
34 57
         /// <returns></returns>

+ 40 - 26
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -156,8 +156,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
156 156
                 pagesize = Convert.ToInt32(strpagesize);
157 157
             }
158 158
 
159
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
160
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
159
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
160
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
161
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
161 162
 
162 163
             if (isdc > 0)
163 164
             {
@@ -421,8 +422,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
421 422
             {
422 423
                 pagesize = Convert.ToInt32(strpagesize);
423 424
             }
424
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
425
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
425
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
426
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
427
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
426 428
 
427 429
             if (isdc > 0)
428 430
             {
@@ -767,8 +769,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
767 769
                 pagesize = Convert.ToInt32(strpagesize);
768 770
             }
769 771
 
770
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
771
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
772
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
773
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
774
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
772 775
 
773 776
             if (isdc > 0)
774 777
             {
@@ -1094,8 +1097,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
1094 1097
             {
1095 1098
                 pagesize = Convert.ToInt32(strpagesize);
1096 1099
             }
1097
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
1098
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
1100
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
1101
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
1102
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
1099 1103
 
1100 1104
             if (isdc > 0)
1101 1105
             {
@@ -1350,8 +1354,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
1350 1354
             {
1351 1355
                 pagesize = Convert.ToInt32(strpagesize);
1352 1356
             }
1353
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
1354
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
1357
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
1358
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
1359
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
1355 1360
 
1356 1361
             if (isdc > 0)
1357 1362
             {
@@ -1604,8 +1609,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
1604 1609
                 pagesize = Convert.ToInt32(strpagesize);
1605 1610
             }
1606 1611
 
1607
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
1608
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
1612
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
1613
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
1614
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
1609 1615
 
1610 1616
             if (isdc > 0)
1611 1617
             {
@@ -1851,8 +1857,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
1851 1857
                 pagesize = Convert.ToInt32(strpagesize);
1852 1858
             }
1853 1859
 
1854
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
1855
-                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
1860
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
1861
+                + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
1862
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
1856 1863
 
1857 1864
             if (isdc > 0)
1858 1865
             {
@@ -2059,8 +2066,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
2059 2066
                 pagesize = Convert.ToInt32(strpagesize);
2060 2067
             }
2061 2068
 
2062
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
2063
-                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit";
2069
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
2070
+                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
2071
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName";
2064 2072
 
2065 2073
             if (isdc > 0)
2066 2074
             {
@@ -2224,7 +2232,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2224 2232
         //        pagesize = Convert.ToInt32(strpagesize);
2225 2233
         //    }
2226 2234
 
2227
-        //    string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName";
2235
+        //    string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName";
2228 2236
 
2229 2237
         //    if (isdc > 0)
2230 2238
         //    {
@@ -2464,9 +2472,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
2464 2472
                 pagesize = Convert.ToInt32(strpagesize);
2465 2473
             }
2466 2474
 
2467
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
2468
-                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit"
2469
-                 + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName";
2475
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
2476
+                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
2477
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1))) AS AddressName"
2478
+            + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName";
2470 2479
 
2471 2480
             if (isdc > 0)
2472 2481
             {
@@ -2650,9 +2659,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
2650 2659
                 pagesize = Convert.ToInt32(strpagesize);
2651 2660
             }
2652 2661
 
2653
-            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName"
2654
-                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit"
2655
-                 + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName";
2662
+            string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
2663
+                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
2664
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1))) AS AddressName"
2665
+            + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName";
2656 2666
 
2657 2667
             if (isdc > 0)
2658 2668
             {
@@ -2737,9 +2747,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
2737 2747
             //int type = RequestString.GetInt("type", 0);//0基本信息1监察意见2领导批示3办理情况4回访信息5督办信息6办理过程
2738 2748
             if (!string.IsNullOrEmpty(strworkorderid))
2739 2749
             {
2740
-                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName1,dbo.GetDictionaryName(F_InfoSource) as SourceName"
2741
-                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDictionaryName(F_ComplainedUnitID) as ComplainedUnit"
2742
-                 + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName,dbo.GetAreaName(F_SourceArea) as AreaName "
2750
+                string sql = "select *,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName1,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) as KeyName"
2751
+                 + ",dbo.GetDeptNames(F_MainDeptId) as DeptName,dbo.GetDeptNames(F_OtherDeptIds) as OtherDeptName,dbo.GetDeptNames(F_DealDeptId) as DealDeptName,dbo.GetDemandsTypeName(F_DemandsTypeID) as DemandsTypeName,dbo.GetDeptNames(F_ComplainedUnitID) as ComplainedUnit"
2752
+                + ",((SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',1)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',2)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',3)) +' '+(SELECT Name FROM dbo.T_Sys_Address WHERE Code = dbo.Get_StrArrayStrOfIndex(F_AddressCodes,'|',4))) AS AddressName"
2753
+                + ",dbo.GetDeptNames(F_NoticeDeptIds) as NoticeDeptName,dbo.GetAreaName(F_SourceArea) as AreaName "
2743 2754
                 + " from T_Bus_WorkOrder where F_WorkOrderId ='" + strworkorderid + "'";
2744 2755
                 var dt = DbHelperSQL.Query(sql).Tables[0];
2745 2756
                 if (dt.Rows.Count > 0)
@@ -3371,6 +3382,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3371 3382
                 string callid = RequestString.GetFormString("callid");
3372 3383
                 int demandstype = RequestString.GetInt("demandstype",0);//诉求分类编号
3373 3384
                 int complainedunitid = RequestString.GetInt("complainedunitid", 0);//被投诉单位
3385
+                string addresscodes = RequestString.GetFormString("addresscodes"); //F_AddressCodes 地址 省市县乡编号 例如:1111|2222|3333|4444
3374 3386
 
3375 3387
 
3376 3388
                 using (TransactionScope trans = new TransactionScope())
@@ -3427,6 +3439,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
3427 3439
                     //20200109 lihai 新增 被投诉单位
3428 3440
                     if (complainedunitid > 0)
3429 3441
                         modelT_Bus_WorkOrder.F_ComplainedUnitID = complainedunitid;
3442
+                    if(!string.IsNullOrEmpty(addresscodes))
3443
+                    modelT_Bus_WorkOrder.F_AddressCodes = addresscodes;
3430 3444
 
3431 3445
                     //如果选择即刻答复:是,即为直办,工单结束
3432 3446
                     if (isresult == 1)

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

@@ -66,6 +66,7 @@
66 66
     <Compile Include="T_Material_Info.cs" />
67 67
     <Compile Include="T_Sina_Msg.cs" />
68 68
     <Compile Include="T_SMS_Msg.cs" />
69
+    <Compile Include="T_Sys_Address.cs" />
69 70
     <Compile Include="T_Sys_Class.cs" />
70 71
     <Compile Include="T_Msg_Chat.cs" />
71 72
     <Compile Include="T_Msg_Chat_Map.cs" />

+ 9 - 0
CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -71,6 +71,7 @@ namespace CallCenterApi.Model
71 71
         private string _f_demandstypeid;
72 72
         private string _f_demandstype;
73 73
         private int? _f_complainedunitid = 0;
74
+        private string _f_addresscodes;
74 75
         /// <summary>
75 76
         /// 
76 77
         /// </summary>
@@ -559,6 +560,14 @@ namespace CallCenterApi.Model
559 560
             set { _f_complainedunitid = value; }
560 561
             get { return _f_complainedunitid; }
561 562
         }
563
+        /// <summary>
564
+        /// 地址 省市县乡编号
565
+        /// </summary>
566
+        public string F_AddressCodes
567
+        {
568
+            set { _f_addresscodes = value; }
569
+            get { return _f_addresscodes; }
570
+        }
562 571
         #endregion Model
563 572
 
564 573
     }

+ 88 - 0
CallCenterApi/CallCenterApi.Model/T_Sys_Address.cs

@@ -0,0 +1,88 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    public partial class T_Sys_Address
10
+    {
11
+        public T_Sys_Address()
12
+        { }
13
+        #region Model
14
+        private int _id;
15
+        private string _code;
16
+        private string _parent_code;
17
+        private string _name;
18
+        private string _short_name;
19
+        private string _lng;
20
+        private string _lat;
21
+        private int? _sort;
22
+        /// <summary>
23
+        /// Id
24
+        /// </summary>
25
+        public int ID
26
+        {
27
+            set { _id = value; }
28
+            get { return _id; }
29
+        }
30
+        /// <summary>
31
+        /// 省份代码
32
+        /// </summary>
33
+        public string Code
34
+        {
35
+            set { _code = value; }
36
+            get { return _code; }
37
+        }
38
+        /// <summary>
39
+        /// 省市县代码
40
+        /// </summary>
41
+        public string Parent_Code
42
+        {
43
+            set { _parent_code = value; }
44
+            get { return _parent_code; }
45
+        }
46
+        /// <summary>
47
+        /// 省份名称
48
+        /// </summary>
49
+        public string Name
50
+        {
51
+            set { _name = value; }
52
+            get { return _name; }
53
+        }
54
+        /// <summary>
55
+        /// 简称
56
+        /// </summary>
57
+        public string Short_Name
58
+        {
59
+            set { _short_name = value; }
60
+            get { return _short_name; }
61
+        }
62
+        /// <summary>
63
+        /// 经度
64
+        /// </summary>
65
+        public string Lng
66
+        {
67
+            set { _lng = value; }
68
+            get { return _lng; }
69
+        }
70
+        /// <summary>
71
+        /// 纬度
72
+        /// </summary>
73
+        public string Lat
74
+        {
75
+            set { _lat = value; }
76
+            get { return _lat; }
77
+        }
78
+        /// <summary>
79
+        /// 排序
80
+        /// </summary>
81
+        public int? Sort
82
+        {
83
+            set { _sort = value; }
84
+            get { return _sort; }
85
+        }
86
+        #endregion Model
87
+    }
88
+}

BIN
sql/字符串分割函数.sql


+ 7 - 2
sql/工单添加字段.sql

@@ -1,8 +1,13 @@
1 1
 
2
+--ALTER TABLE T_Bus_WorkOrder ADD [F_DemandsTypeID] VARCHAR(200) NULL
3
+--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'诉求分类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Bus_WorkOrder', @level2type=N'COLUMN',@level2name=N'F_DemandsTypeID'
4
+--GO
5
+
2 6
 ALTER TABLE T_Bus_WorkOrder ADD [F_ComplainedUnitID] INT DEFAULT(0)
3 7
 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'被投诉单位id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Bus_WorkOrder', @level2type=N'COLUMN',@level2name=N'F_ComplainedUnitID'
4 8
 GO
5 9
 
6
-ALTER TABLE T_Bus_WorkOrder ADD [F_DemandsTypeID] VARCHAR(200) NULL
7
-EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'诉求分类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Bus_WorkOrder', @level2type=N'COLUMN',@level2name=N'F_DemandsTypeID'
10
+
11
+ALTER TABLE T_Bus_WorkOrder ADD [F_AddressCodes] VARCHAR(50) NULL
12
+EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'地址(省市县乡)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_Bus_WorkOrder', @level2type=N'COLUMN',@level2name=N'F_AddressCodes'
8 13
 GO

BIN
sql/省市县乡创建及数据.sql