|
|
@@ -475,11 +475,10 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
475
|
475
|
var tb = ModelConvertHelper<T_Cus_VipInfo>.ConvertListToDataTable(dtNew);
|
|
476
|
476
|
//导出dtnew
|
|
477
|
477
|
NPOIHelper npoi = new NPOIHelper();
|
|
478
|
|
- //string[] cols = { "姓名", "电话", "出生日期", "性别", "标签", "推荐人", "地址", "鞋码", "创建人", "创建时间" };
|
|
479
|
|
- //string[] colname = { "F_Name", "F_Phone", "F_Birthday", "F_Sex", "F_Label", "F_Recommender", "F_Address", "F_ShoeSize", "F_CreateBy", "F_CreateOn" };
|
|
480
|
|
- string[] cols = { "姓名", "生日", "年龄", "性别", "鞋码", "手机号1", "手机号2", "固定电话", "推荐人", "标签", "备注", "昵称", "注册时间", "省份", "城市", "县区", "乡镇", "邮编", "地址", "备用省份", "备用城市", "备用县区", "备用乡镇", "备用邮编", "备用地址", "会员积分", "累计消费", "累计积分", "销售负责人", "最近联系时间", "会员类型" };
|
|
481
|
|
- string[] colname = { "F_Name", "F_Birthday", "F_Age", "F_Sex", "F_ShoeSize", "F_Mobile", "F_Mobile1", "F_Phone", "F_Recommender", "F_Label", "F_Note", "F_Nickname", "F_RegTime", "F_Province", "F_City", "F_Area", "F_Town", "F_Postcode", "F_Address", "F_Province", "F_City", "F_Area", "F_Town", "F_Postcode", "F_Address1", "F_Score", "F_Money", "F_TotalScore", "F_Saleperson", "F_Contact", "F_Type" };
|
|
482
|
|
-
|
|
|
478
|
+ string dbkeys = _configuration["Import:vipkey"].ToString();
|
|
|
479
|
+ string title = _configuration["Import:vipvalue"].ToString();
|
|
|
480
|
+ string[] cols = dbkeys.Split(",");
|
|
|
481
|
+ string[] colname = title.Split(",");
|
|
483
|
482
|
byte[] sm = npoi.ExportToExcel1(tb, cols, colname);
|
|
484
|
483
|
if (sm != null)
|
|
485
|
484
|
{
|
|
|
@@ -487,10 +486,10 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
487
|
486
|
}
|
|
488
|
487
|
else
|
|
489
|
488
|
{
|
|
490
|
|
- return Error("导出失败");
|
|
|
489
|
+ return Error("导出失败3");
|
|
491
|
490
|
}
|
|
492
|
491
|
}
|
|
493
|
|
- return Error("导出失败");
|
|
|
492
|
+ return Error("导出失败2");
|
|
494
|
493
|
|
|
495
|
494
|
//return Success("根据条件获取数据成功", tasklist);
|
|
496
|
495
|
|
|
|
@@ -498,7 +497,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
498
|
497
|
catch (Exception ex)
|
|
499
|
498
|
{
|
|
500
|
499
|
//_logger.LogError(ex, "导出异常");
|
|
501
|
|
- return Error("导出失败");
|
|
|
500
|
+ return Error("导出失败1");
|
|
502
|
501
|
}
|
|
503
|
502
|
//return Success("导出成功");
|
|
504
|
503
|
}
|
|
|
@@ -549,7 +548,28 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
549
|
548
|
{
|
|
550
|
549
|
if (dbcolslist.Contains(item.Name))
|
|
551
|
550
|
{
|
|
552
|
|
- object v = Convert.ChangeType(dr[titlelist[dbcolslist.IndexOf(item.Name)]].ToString(), item.PropertyType);
|
|
|
551
|
+ Type tType = null;
|
|
|
552
|
+ object o = dr[titlelist[dbcolslist.IndexOf(item.Name)]];
|
|
|
553
|
+ if (item.PropertyType.FullName.Contains(typeof(DateTime).FullName))
|
|
|
554
|
+ {
|
|
|
555
|
+ tType= typeof(DateTime);
|
|
|
556
|
+ }
|
|
|
557
|
+ else if (item.PropertyType.FullName.Contains(typeof(Int64).FullName))
|
|
|
558
|
+ {
|
|
|
559
|
+ tType = typeof(Int64);
|
|
|
560
|
+ }
|
|
|
561
|
+ else if (item.PropertyType.FullName.Contains(typeof(Int32).FullName))
|
|
|
562
|
+ {
|
|
|
563
|
+ tType = typeof(Int32);
|
|
|
564
|
+ }
|
|
|
565
|
+ else if (item.PropertyType.FullName.Contains(typeof(Decimal).FullName))
|
|
|
566
|
+ {
|
|
|
567
|
+ tType = typeof(Decimal);
|
|
|
568
|
+ }
|
|
|
569
|
+ else { tType = item.PropertyType; }
|
|
|
570
|
+ object v = null;
|
|
|
571
|
+ if (o!=null&&o!=DBNull.Value)
|
|
|
572
|
+ v = Convert.ChangeType(dr[titlelist[dbcolslist.IndexOf(item.Name)]].ToString(), tType);
|
|
553
|
573
|
item.SetValue(model, v, null);
|
|
554
|
574
|
}
|
|
555
|
575
|
}
|