Parcourir la Source

调整客户资料

zhengbingbing il y a 7 ans
Parent
commit
beadba35b7

+ 49 - 41
codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBaseNew.cs

@@ -39,13 +39,14 @@ namespace CallCenterApi.DAL
39 39
         {
40 40
             StringBuilder strSql = new StringBuilder();
41 41
             strSql.Append("insert into T_Cus_CustomerBaseNew(");
42
-            strSql.Append("F_CustomerCode,F_CompanyName,F_CompanyAddress,F_LegalName,F_LegalTel,F_SubTrade,F_TaxCategory,F_TaxPointDes,F_InvoiceRange,F_Layer,F_BeDept,F_BeRelatedAcc,F_BeAuditAcc,F_BeMakeAcc,F_WxPassword,F_WxOpenId,F_CreateBy,F_CreatedOn,F_DeleteFlag)");
42
+            strSql.Append("F_CustomerCode,F_CompanyName,F_KeyWords,F_CompanyAddress,F_LegalName,F_LegalTel,F_SubTrade,F_TaxCategory,F_TaxPointDes,F_InvoiceRange,F_Layer,F_BeDept,F_BeRelatedAcc,F_BeAuditAcc,F_BeMakeAcc,F_WxPassword,F_WxOpenId,F_CreateBy,F_CreatedOn,F_DeleteFlag)");
43 43
             strSql.Append(" values (");
44
-            strSql.Append("@F_CustomerCode,@F_CompanyName,@F_CompanyAddress,@F_LegalName,@F_LegalTel,@F_SubTrade,@F_TaxCategory,@F_TaxPointDes,@F_InvoiceRange,@F_Layer,@F_BeDept,@F_BeRelatedAcc,@F_BeAuditAcc,@F_BeMakeAcc,@F_WxPassword,@F_WxOpenId,@F_CreateBy,@F_CreatedOn,@F_DeleteFlag)");
44
+            strSql.Append("@F_CustomerCode,@F_CompanyName,@F_KeyWords,@F_CompanyAddress,@F_LegalName,@F_LegalTel,@F_SubTrade,@F_TaxCategory,@F_TaxPointDes,@F_InvoiceRange,@F_Layer,@F_BeDept,@F_BeRelatedAcc,@F_BeAuditAcc,@F_BeMakeAcc,@F_WxPassword,@F_WxOpenId,@F_CreateBy,@F_CreatedOn,@F_DeleteFlag)");
45 45
             strSql.Append(";select @@IDENTITY");
46 46
             SqlParameter[] parameters = {
47 47
                     new SqlParameter("@F_CustomerCode", SqlDbType.NVarChar,100),
48 48
                     new SqlParameter("@F_CompanyName", SqlDbType.NVarChar,200),
49
+                    new SqlParameter("@F_KeyWords", SqlDbType.NVarChar,2000),
49 50
                     new SqlParameter("@F_CompanyAddress", SqlDbType.NVarChar,300),
50 51
                     new SqlParameter("@F_LegalName", SqlDbType.NVarChar,100),
51 52
                     new SqlParameter("@F_LegalTel", SqlDbType.NVarChar,200),
@@ -65,23 +66,24 @@ namespace CallCenterApi.DAL
65 66
                     new SqlParameter("@F_DeleteFlag", SqlDbType.SmallInt,2)};
66 67
             parameters[0].Value = model.F_CustomerCode;
67 68
             parameters[1].Value = model.F_CompanyName;
68
-            parameters[2].Value = model.F_CompanyAddress;
69
-            parameters[3].Value = model.F_LegalName;
70
-            parameters[4].Value = model.F_LegalTel;
71
-            parameters[5].Value = model.F_SubTrade;
72
-            parameters[6].Value = model.F_TaxCategory;
73
-            parameters[7].Value = model.F_TaxPointDes;
74
-            parameters[8].Value = model.F_InvoiceRange;
75
-            parameters[9].Value = model.F_Layer;
76
-            parameters[10].Value = model.F_BeDept;
77
-            parameters[11].Value = model.F_BeRelatedAcc;
78
-            parameters[12].Value = model.F_BeAuditAcc;
79
-            parameters[13].Value = model.F_BeMakeAcc;
80
-            parameters[14].Value = model.F_WxPassword;
81
-            parameters[15].Value = model.F_WxOpenId;
82
-            parameters[16].Value = model.F_CreateBy;
83
-            parameters[17].Value = model.F_CreatedOn;
84
-            parameters[18].Value = model.F_DeleteFlag;
69
+            parameters[2].Value = model.F_KeyWords;
70
+            parameters[3].Value = model.F_CompanyAddress;
71
+            parameters[4].Value = model.F_LegalName;
72
+            parameters[5].Value = model.F_LegalTel;
73
+            parameters[6].Value = model.F_SubTrade;
74
+            parameters[7].Value = model.F_TaxCategory;
75
+            parameters[8].Value = model.F_TaxPointDes;
76
+            parameters[9].Value = model.F_InvoiceRange;
77
+            parameters[10].Value = model.F_Layer;
78
+            parameters[11].Value = model.F_BeDept;
79
+            parameters[12].Value = model.F_BeRelatedAcc;
80
+            parameters[13].Value = model.F_BeAuditAcc;
81
+            parameters[14].Value = model.F_BeMakeAcc;
82
+            parameters[15].Value = model.F_WxPassword;
83
+            parameters[16].Value = model.F_WxOpenId;
84
+            parameters[17].Value = model.F_CreateBy;
85
+            parameters[18].Value = model.F_CreatedOn;
86
+            parameters[19].Value = model.F_DeleteFlag;
85 87
 
86 88
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
87 89
             if (obj == null)
@@ -102,6 +104,7 @@ namespace CallCenterApi.DAL
102 104
             strSql.Append("update T_Cus_CustomerBaseNew set ");
103 105
             strSql.Append("F_CustomerCode=@F_CustomerCode,");
104 106
             strSql.Append("F_CompanyName=@F_CompanyName,");
107
+            strSql.Append("F_KeyWords=@F_KeyWords,");
105 108
             strSql.Append("F_CompanyAddress=@F_CompanyAddress,");
106 109
             strSql.Append("F_LegalName=@F_LegalName,");
107 110
             strSql.Append("F_LegalTel=@F_LegalTel,");
@@ -123,6 +126,7 @@ namespace CallCenterApi.DAL
123 126
             SqlParameter[] parameters = {
124 127
                     new SqlParameter("@F_CustomerCode", SqlDbType.NVarChar,100),
125 128
                     new SqlParameter("@F_CompanyName", SqlDbType.NVarChar,200),
129
+                    new SqlParameter("@F_KeyWords", SqlDbType.NVarChar,2000),
126 130
                     new SqlParameter("@F_CompanyAddress", SqlDbType.NVarChar,300),
127 131
                     new SqlParameter("@F_LegalName", SqlDbType.NVarChar,100),
128 132
                     new SqlParameter("@F_LegalTel", SqlDbType.NVarChar,200),
@@ -143,24 +147,25 @@ namespace CallCenterApi.DAL
143 147
                     new SqlParameter("@F_CustomerId", SqlDbType.Int,4)};
144 148
             parameters[0].Value = model.F_CustomerCode;
145 149
             parameters[1].Value = model.F_CompanyName;
146
-            parameters[2].Value = model.F_CompanyAddress;
147
-            parameters[3].Value = model.F_LegalName;
148
-            parameters[4].Value = model.F_LegalTel;
149
-            parameters[5].Value = model.F_SubTrade;
150
-            parameters[6].Value = model.F_TaxCategory;
151
-            parameters[7].Value = model.F_TaxPointDes;
152
-            parameters[8].Value = model.F_InvoiceRange;
153
-            parameters[9].Value = model.F_Layer;
154
-            parameters[10].Value = model.F_BeDept;
155
-            parameters[11].Value = model.F_BeRelatedAcc;
156
-            parameters[12].Value = model.F_BeAuditAcc;
157
-            parameters[13].Value = model.F_BeMakeAcc;
158
-            parameters[14].Value = model.F_WxPassword;
159
-            parameters[15].Value = model.F_WxOpenId;
160
-            parameters[16].Value = model.F_CreateBy;
161
-            parameters[17].Value = model.F_CreatedOn;
162
-            parameters[18].Value = model.F_DeleteFlag;
163
-            parameters[19].Value = model.F_CustomerId;
150
+            parameters[2].Value = model.F_KeyWords;
151
+            parameters[3].Value = model.F_CompanyAddress;
152
+            parameters[4].Value = model.F_LegalName;
153
+            parameters[5].Value = model.F_LegalTel;
154
+            parameters[6].Value = model.F_SubTrade;
155
+            parameters[7].Value = model.F_TaxCategory;
156
+            parameters[8].Value = model.F_TaxPointDes;
157
+            parameters[9].Value = model.F_InvoiceRange;
158
+            parameters[10].Value = model.F_Layer;
159
+            parameters[11].Value = model.F_BeDept;
160
+            parameters[12].Value = model.F_BeRelatedAcc;
161
+            parameters[13].Value = model.F_BeAuditAcc;
162
+            parameters[14].Value = model.F_BeMakeAcc;
163
+            parameters[15].Value = model.F_WxPassword;
164
+            parameters[16].Value = model.F_WxOpenId;
165
+            parameters[17].Value = model.F_CreateBy;
166
+            parameters[18].Value = model.F_CreatedOn;
167
+            parameters[19].Value = model.F_DeleteFlag;
168
+            parameters[20].Value = model.F_CustomerId;
164 169
 
165 170
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
166 171
             if (rows > 0)
@@ -172,7 +177,6 @@ namespace CallCenterApi.DAL
172 177
                 return false;
173 178
             }
174 179
         }
175
-
176 180
         /// <summary>
177 181
         /// 删除一条数据
178 182
         /// </summary>
@@ -247,9 +251,9 @@ namespace CallCenterApi.DAL
247 251
 
248 252
 
249 253
         /// <summary>
250
-        /// 得到一个对象实体
251
-        /// </summary>
252
-        public CallCenterApi.Model.T_Cus_CustomerBaseNew DataRowToModel(DataRow row)
254
+		/// 得到一个对象实体
255
+		/// </summary>
256
+		public CallCenterApi.Model.T_Cus_CustomerBaseNew DataRowToModel(DataRow row)
253 257
         {
254 258
             CallCenterApi.Model.T_Cus_CustomerBaseNew model = new CallCenterApi.Model.T_Cus_CustomerBaseNew();
255 259
             if (row != null)
@@ -266,6 +270,10 @@ namespace CallCenterApi.DAL
266 270
                 {
267 271
                     model.F_CompanyName = row["F_CompanyName"].ToString();
268 272
                 }
273
+                if (row["F_KeyWords"] != null)
274
+                {
275
+                    model.F_KeyWords = row["F_KeyWords"].ToString();
276
+                }
269 277
                 if (row["F_CompanyAddress"] != null)
270 278
                 {
271 279
                     model.F_CompanyAddress = row["F_CompanyAddress"].ToString();

+ 23 - 9
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -32,7 +32,7 @@ namespace CallCenterApi.Interface.Controllers.customer
32 32
         /// <param name="conname">联系人姓名</param>
33 33
         /// <param name="contel">联系人电话</param>
34 34
         /// <returns></returns>
35
-        public ActionResult GetList(string code,string cmpname,string cmpaddress,
35
+        public ActionResult GetList(string keywords,string code,string cmpname,string cmpaddress,
36 36
             string legname,string legtel,string subtrade,string layer,string bedept,
37 37
             string berelacc,string beaudacc,string bemakeacc,string conname,string contel,
38 38
             int pageindex = 1, int pagesize = 10)
@@ -43,6 +43,8 @@ namespace CallCenterApi.Interface.Controllers.customer
43 43
                 string sql = " and F_DeleteFlag=0";
44 44
                 DataTable dt = new DataTable();
45 45
                 #region 筛选条件
46
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
47
+                    sql += $" and F_KeyWords like '%" + keywords.Trim() + "%'";
46 48
                 if (!string.IsNullOrWhiteSpace(code))//客户编号
47 49
                     sql += $" and F_CustomerCode like '%" + code.Trim() + "%'";
48 50
                 if (!string.IsNullOrWhiteSpace(cmpname))//公司名称
@@ -80,29 +82,39 @@ namespace CallCenterApi.Interface.Controllers.customer
80 82
                 dt = BLL.PagerBLL.GetListPager(
81 83
                     "T_Cus_CustomerBaseNew",
82 84
                     "F_CustomerId",
83
-                    "*",
85
+                    "*,dbo.GetDictionaryName(F_Layer) as F_LayerName,dbo.GetDictionaryName(F_SubTrade) as F_SubTradeName,dbo.GetDictionaryName(F_TaxCategory) as F_TaxCategoryName",
84 86
                     sql,
85 87
                     "ORDER BY F_CustomerId desc",
86 88
                     pagesize,
87 89
                     pageindex,
88 90
                     true,
89 91
                     out recordCount);
90
-                #region 绑定联系人信息
92
+                #region
91 93
                 dt.Columns.Add("F_Contact");
94
+                var dicvalue = new BLL.T_Sys_DictionaryValue().GetModelList("");
92 95
                 foreach (DataRow dr in dt.Rows)
93 96
                 {
97
+                    #region 绑定联系人信息
94 98
                     var contact = "";
95
-                    string cusid = dr["F_CustomerId"].ToString();
96
-                    var conlist = conbll.GetModelList(" F_CustomerId=" + cusid);
97
-                    if(conlist.Count>0)
99
+                    string cusid = dr["F_CustomerId"] != null ? dr["F_CustomerId"].ToString() : "";
100
+                    if (cusid != "")
98 101
                     {
99
-                        foreach (var item in conlist)
102
+                        var conlist = conbll.GetModelList(" F_CustomerId=" + cusid);
103
+                        if (conlist.Count > 0)
100 104
                         {
101
-                            contact += item.F_Name + "(" + item.F_Telephone + "),";
105
+                            foreach (var item in conlist)
106
+                            {
107
+                                contact += item.F_Name + "(" + item.F_Telephone + "),";
108
+                            }
102 109
                         }
110
+                        dr["CusName"] = contact.TrimEnd(',');
103 111
                     }
104
-                    dr["CusName"] = contact.TrimEnd(',');
112
+                    #endregion
113
+                    #region 客户归属部门
114
+                    //F_BeDept
115
+                    #endregion
105 116
                 }
117
+
106 118
                 #endregion
107 119
                 var obj = new
108 120
                 {
@@ -196,6 +208,7 @@ namespace CallCenterApi.Interface.Controllers.customer
196 208
             #region 保存客户基本信息
197 209
             model.F_CustomerCode = input.F_CustomerCode;
198 210
             model.F_CompanyName = input.F_CompanyName;
211
+            model.F_KeyWords = input.F_KeyWords;
199 212
             model.F_CompanyAddress = input.F_CompanyAddress;
200 213
             model.F_LegalName = input.F_LegalName;
201 214
             model.F_LegalTel = input.F_LegalTel;
@@ -259,6 +272,7 @@ namespace CallCenterApi.Interface.Controllers.customer
259 272
             #region 保存客户基本信息
260 273
             model.F_CustomerCode = input.F_CustomerCode;
261 274
             model.F_CompanyName = input.F_CompanyName;
275
+            model.F_KeyWords = input.F_KeyWords;
262 276
             model.F_CompanyAddress = input.F_CompanyAddress;
263 277
             model.F_LegalName = input.F_LegalName;
264 278
             model.F_LegalTel = input.F_LegalTel;

+ 7 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/CustomerBaseNewInput.cs

@@ -21,6 +21,10 @@ namespace CallCenterApi.Interface.Models.Input
21 21
         /// </summary>
22 22
         public string F_CompanyName { set; get; }
23 23
         /// <summary>
24
+        /// 关键字
25
+        /// </summary>
26
+        public string F_KeyWords { set; get; }
27
+        /// <summary>
24 28
         /// 公司地址
25 29
         /// </summary>
26 30
         public string F_CompanyAddress { set; get; }
@@ -33,11 +37,11 @@ namespace CallCenterApi.Interface.Models.Input
33 37
         /// </summary>
34 38
         public string F_LegalTel { set; get; }
35 39
         /// <summary>
36
-        /// 所属行业
40
+        /// 所属行业 KHSSHY
37 41
         /// </summary>
38 42
         public int? F_SubTrade { set; get; }
39 43
         /// <summary>
40
-        /// 税务类别
44
+        /// 税务类别 SWLB
41 45
         /// </summary>
42 46
         public int? F_TaxCategory { set; get; }
43 47
         /// <summary>
@@ -49,7 +53,7 @@ namespace CallCenterApi.Interface.Models.Input
49 53
         /// </summary>
50 54
         public string F_InvoiceRange { set; get; }
51 55
         /// <summary>
52
-        /// 客户信誉等级
56
+        /// 客户信誉等级 KHLayer
53 57
         /// </summary>
54 58
         public int? F_Layer { set; get; }
55 59
         /// <summary>

+ 9 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Cus_CustomerBaseNew.cs

@@ -18,6 +18,7 @@ namespace CallCenterApi.Model
18 18
         private int _f_customerid;
19 19
         private string _f_customercode;
20 20
         private string _f_companyname;
21
+        private string _f_keywords;
21 22
         private string _f_companyaddress;
22 23
         private string _f_legalname;
23 24
         private string _f_legaltel;
@@ -60,6 +61,14 @@ namespace CallCenterApi.Model
60 61
             get { return _f_companyname; }
61 62
         }
62 63
         /// <summary>
64
+        /// 关键字
65
+        /// </summary>
66
+        public string F_KeyWords
67
+        {
68
+            set { _f_keywords = value; }
69
+            get { return _f_keywords; }
70
+        }
71
+        /// <summary>
63 72
         /// 公司地址
64 73
         /// </summary>
65 74
         public string F_CompanyAddress