|
@@ -1,26 +1,11 @@
|
|
using AutoMapper;
|
|
using AutoMapper;
|
|
-using MathNet.Numerics.Distributions;
|
|
|
|
-using NPOI.SS.Formula.PTG;
|
|
|
|
-using NPOI.Util;
|
|
|
|
using OASystem.Domain;
|
|
using OASystem.Domain;
|
|
using OASystem.Domain.AesEncryption;
|
|
using OASystem.Domain.AesEncryption;
|
|
-using OASystem.Domain.Dtos.CRM;
|
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
using OASystem.Domain.Dtos.Groups;
|
|
using OASystem.Domain.Entities.Customer;
|
|
using OASystem.Domain.Entities.Customer;
|
|
using OASystem.Domain.Entities.Groups;
|
|
using OASystem.Domain.Entities.Groups;
|
|
-using OASystem.Domain.ViewModels.Financial;
|
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Infrastructure.Tools;
|
|
using OASystem.Infrastructure.Tools;
|
|
-using Org.BouncyCastle.Utilities.Encoders;
|
|
|
|
-using StackExchange.Redis;
|
|
|
|
-using System;
|
|
|
|
-using System.Collections;
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
-using System.Diagnostics;
|
|
|
|
-using System.Globalization;
|
|
|
|
-using System.Linq;
|
|
|
|
-using System.Text;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace OASystem.Infrastructure.Repositories.Groups
|
|
namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
@@ -28,7 +13,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// 接团客户名单
|
|
/// 接团客户名单
|
|
/// 仓库
|
|
/// 仓库
|
|
/// </summary>
|
|
/// </summary>
|
|
- public class TourClientListRepository :BaseRepository<Grp_TourClientList,TourClientListView>
|
|
|
|
|
|
+ public class TourClientListRepository : BaseRepository<Grp_TourClientList, TourClientListView>
|
|
{
|
|
{
|
|
private readonly Result _result;
|
|
private readonly Result _result;
|
|
private readonly IMapper _mapper;
|
|
private readonly IMapper _mapper;
|
|
@@ -75,7 +60,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<Result> _ItemByDiId(int portId, int diId)
|
|
public async Task<Result> _ItemByDiId(int portId, int diId)
|
|
{
|
|
{
|
|
- if (portId == 1 || portId == 2 || portId == 3 ) // 1 web 2 Android 3 ios
|
|
|
|
|
|
+ if (portId == 1 || portId == 2 || portId == 3) // 1 web 2 Android 3 ios
|
|
{
|
|
{
|
|
string sql = string.Format(@"
|
|
string sql = string.Format(@"
|
|
SELECT
|
|
SELECT
|
|
@@ -140,8 +125,8 @@ WHERE
|
|
var view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
|
|
var view = new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "操作失败!" };
|
|
if (portId == 1 || portId == 2 || portId == 3) // 1 web 2 Android 3 ios
|
|
if (portId == 1 || portId == 2 || portId == 3) // 1 web 2 Android 3 ios
|
|
{
|
|
{
|
|
-
|
|
|
|
- var setData = await _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0) .ToListAsync();
|
|
|
|
|
|
+
|
|
|
|
+ var setData = await _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToListAsync();
|
|
|
|
|
|
var shippingSpaceTypeData = setData.Where(it => it.STid == 44).ToList(); //舱位类型
|
|
var shippingSpaceTypeData = setData.Where(it => it.STid == 44).ToList(); //舱位类型
|
|
var shippingSpaceTypeData1 = _mapper.Map<List<SetDataInfoView>>(shippingSpaceTypeData);
|
|
var shippingSpaceTypeData1 = _mapper.Map<List<SetDataInfoView>>(shippingSpaceTypeData);
|
|
@@ -160,10 +145,10 @@ WHERE
|
|
|
|
|
|
//公司信息
|
|
//公司信息
|
|
var clientCompanySql = string.Format(@"Select Id,CompanyFullName From Crm_CustomerCompany Where IsDel = 0");
|
|
var clientCompanySql = string.Format(@"Select Id,CompanyFullName From Crm_CustomerCompany Where IsDel = 0");
|
|
- var clientCompanyData = _sqlSugar.SqlQueryable<CustomerCompanyCiew>(clientCompanySql).ToList();
|
|
|
|
|
|
+ var clientCompanyData = _sqlSugar.SqlQueryable<CustomerCompanyCiew>(clientCompanySql).ToList();
|
|
clientCompanyData = clientCompanyData.DistinctBy(it => it.CompanyFullName).ToList();
|
|
clientCompanyData = clientCompanyData.DistinctBy(it => it.CompanyFullName).ToList();
|
|
|
|
|
|
- foreach ( var item in clientData)
|
|
|
|
|
|
+ foreach (var item in clientData)
|
|
{
|
|
{
|
|
if (item.FirstName.Length > 5 && item.LastName.Length > 5)
|
|
if (item.FirstName.Length > 5 && item.LastName.Length > 5)
|
|
{
|
|
{
|
|
@@ -180,7 +165,8 @@ WHERE
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- var _view = new {
|
|
|
|
|
|
+ var _view = new
|
|
|
|
+ {
|
|
ShippingSpaceTypeData = shippingSpaceTypeData1,
|
|
ShippingSpaceTypeData = shippingSpaceTypeData1,
|
|
ClientData = clientData,
|
|
ClientData = clientData,
|
|
ClientCompanyData = clientCompanyData
|
|
ClientCompanyData = clientCompanyData
|
|
@@ -254,7 +240,7 @@ WHERE
|
|
tcl.IsDel = 0
|
|
tcl.IsDel = 0
|
|
AND tcl.Id = {0}", id);
|
|
AND tcl.Id = {0}", id);
|
|
var data = await _sqlSugar.SqlQueryable<TourClientListDetailsView>(sql).FirstAsync();
|
|
var data = await _sqlSugar.SqlQueryable<TourClientListDetailsView>(sql).FirstAsync();
|
|
- if (data != null)
|
|
|
|
|
|
+ if (data != null)
|
|
{
|
|
{
|
|
EncryptionProcessor.DecryptProperties(data);
|
|
EncryptionProcessor.DecryptProperties(data);
|
|
data.BirthDay = data.BirthDay?.DateFormat("yyyy-MM-dd") ?? "";
|
|
data.BirthDay = data.BirthDay?.DateFormat("yyyy-MM-dd") ?? "";
|
|
@@ -295,7 +281,7 @@ WHERE
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
|
|
|
|
- if (dto.Id >= 0)
|
|
|
|
|
|
+ if (dto.Id >= 0)
|
|
{
|
|
{
|
|
|
|
|
|
#region 参数处理
|
|
#region 参数处理
|
|
@@ -338,12 +324,12 @@ WHERE
|
|
|
|
|
|
EncryptionProcessor.EncryptProperties(dto);
|
|
EncryptionProcessor.EncryptProperties(dto);
|
|
|
|
|
|
- var clientInfo = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0
|
|
|
|
- && it.LastName.Equals(dto.LastName)
|
|
|
|
- && it.FirstName.Equals(dto.FirstName)
|
|
|
|
- //&& it.Phone.Equals(dto.Phone)
|
|
|
|
|
|
+ var clientInfo = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0
|
|
|
|
+ && it.LastName.Equals(dto.LastName)
|
|
|
|
+ && it.FirstName.Equals(dto.FirstName)
|
|
|
|
+ //&& it.Phone.Equals(dto.Phone)
|
|
).FirstAsync();
|
|
).FirstAsync();
|
|
-
|
|
|
|
|
|
+
|
|
Crm_CustomerCompany _CustomerCompany = new Crm_CustomerCompany()
|
|
Crm_CustomerCompany _CustomerCompany = new Crm_CustomerCompany()
|
|
{
|
|
{
|
|
CompanyFullName = dto.CompanyFullName,
|
|
CompanyFullName = dto.CompanyFullName,
|
|
@@ -428,8 +414,8 @@ WHERE
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
crmCompanyId = companyAdd;
|
|
crmCompanyId = companyAdd;
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -582,7 +568,7 @@ WHERE
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
_result.Code = 0;
|
|
_result.Code = 0;
|
|
_sqlSugar.CommitTran();
|
|
_sqlSugar.CommitTran();
|
|
|
|
|
|
@@ -661,7 +647,7 @@ WHERE
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- _DeleClientInfo = new Crm_DeleClient()
|
|
|
|
|
|
+ _DeleClientInfo = new Crm_DeleClient()
|
|
{
|
|
{
|
|
LastName = item.LastName,
|
|
LastName = item.LastName,
|
|
FirstName = item.FirstName,
|
|
FirstName = item.FirstName,
|
|
@@ -690,7 +676,7 @@ WHERE
|
|
Crm_CustomerCert _CustomerCert = _CustomerCerts.Where(it => it.DcId == clientId && it.CertNo.Equals(item.IDCardNo)).FirstOrDefault();
|
|
Crm_CustomerCert _CustomerCert = _CustomerCerts.Where(it => it.DcId == clientId && it.CertNo.Equals(item.IDCardNo)).FirstOrDefault();
|
|
if (_CustomerCert == null)
|
|
if (_CustomerCert == null)
|
|
{
|
|
{
|
|
- _CustomerCert = new Crm_CustomerCert()
|
|
|
|
|
|
+ _CustomerCert = new Crm_CustomerCert()
|
|
{
|
|
{
|
|
DcId = clientId,
|
|
DcId = clientId,
|
|
SdId = 773,
|
|
SdId = 773,
|
|
@@ -732,7 +718,8 @@ WHERE
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- Crm_DeleClient _DeleClient = new Crm_DeleClient() {
|
|
|
|
|
|
+ Crm_DeleClient _DeleClient = new Crm_DeleClient()
|
|
|
|
+ {
|
|
CrmCompanyId = companyId,
|
|
CrmCompanyId = companyId,
|
|
LastName = item.LastName,
|
|
LastName = item.LastName,
|
|
FirstName = item.FirstName,
|
|
FirstName = item.FirstName,
|
|
@@ -788,7 +775,7 @@ WHERE
|
|
QuerFirstClient.IsDel = 1;
|
|
QuerFirstClient.IsDel = 1;
|
|
QuerFirstClient.DeleteUserId = dto.UserId;
|
|
QuerFirstClient.DeleteUserId = dto.UserId;
|
|
QuerFirstClient.DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
QuerFirstClient.DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
- var UpdateTrue = _sqlSugar.Updateable(QuerFirstClient).UpdateColumns(x => new { x.IsDel,x.DeleteUserId,x.DeleteTime}).ExecuteCommand() > 0;
|
|
|
|
|
|
+ var UpdateTrue = _sqlSugar.Updateable(QuerFirstClient).UpdateColumns(x => new { x.IsDel, x.DeleteUserId, x.DeleteTime }).ExecuteCommand() > 0;
|
|
}
|
|
}
|
|
|
|
|
|
var tourClientAdd = await _sqlSugar.Insertable(_TourClientList).ExecuteReturnIdentityAsync();
|
|
var tourClientAdd = await _sqlSugar.Insertable(_TourClientList).ExecuteReturnIdentityAsync();
|
|
@@ -811,7 +798,7 @@ WHERE
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public async Task<Result> OperMultiple(List<TourClientListProcessInfo> _TourClientListInfos , int diid,int userId)
|
|
|
|
|
|
+ public async Task<Result> OperMultiple(List<TourClientListProcessInfo> _TourClientListInfos, int diid, int userId)
|
|
{
|
|
{
|
|
if (diid < 0)
|
|
if (diid < 0)
|
|
{
|
|
{
|
|
@@ -827,7 +814,7 @@ WHERE
|
|
_sqlSugar.BeginTran();
|
|
_sqlSugar.BeginTran();
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- _sqlSugar.Updateable<Grp_TourClientList>().SetColumns(x=> new Grp_TourClientList { IsDel = 1 } ).Where(x=>x.DiId == diid).ExecuteCommand();
|
|
|
|
|
|
+ _sqlSugar.Updateable<Grp_TourClientList>().SetColumns(x => new Grp_TourClientList { IsDel = 1 }).Where(x => x.DiId == diid).ExecuteCommand();
|
|
|
|
|
|
foreach (var item in _TourClientListInfos)
|
|
foreach (var item in _TourClientListInfos)
|
|
{
|
|
{
|
|
@@ -861,7 +848,7 @@ WHERE
|
|
Pinyin = item.Pinyin,
|
|
Pinyin = item.Pinyin,
|
|
Phone = item.Phone,
|
|
Phone = item.Phone,
|
|
Sex = item.Sex,
|
|
Sex = item.Sex,
|
|
- BirthDay = string.IsNullOrEmpty(item.BirthDay) ? null : Convert.ToDateTime(item.BirthDay),
|
|
|
|
|
|
+ BirthDay = string.IsNullOrEmpty(item.BirthDay) ? null : Convert.ToDateTime(item.BirthDay),
|
|
Job = item.Job,
|
|
Job = item.Job,
|
|
CreateUserId = userId
|
|
CreateUserId = userId
|
|
};
|
|
};
|
|
@@ -1047,7 +1034,7 @@ WHERE
|
|
_sqlSugar.RollbackTran();
|
|
_sqlSugar.RollbackTran();
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
_result.Code = 0;
|
|
_result.Code = 0;
|
|
@@ -1071,7 +1058,7 @@ WHERE
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public async Task<Result> _Del(int id, int userId)
|
|
public async Task<Result> _Del(int id, int userId)
|
|
{
|
|
{
|
|
- if (id > 0)
|
|
|
|
|
|
+ if (id > 0)
|
|
{
|
|
{
|
|
var _tourClientList = new Grp_TourClientList()
|
|
var _tourClientList = new Grp_TourClientList()
|
|
{
|
|
{
|
|
@@ -1142,7 +1129,8 @@ WHERE
|
|
if (infos.Count > 0)
|
|
if (infos.Count > 0)
|
|
{
|
|
{
|
|
//解密
|
|
//解密
|
|
- infos.ForEach(x => {
|
|
|
|
|
|
+ infos.ForEach(x =>
|
|
|
|
+ {
|
|
x.FirstName = AesEncryptionHelper.Decrypt(x.FirstName);
|
|
x.FirstName = AesEncryptionHelper.Decrypt(x.FirstName);
|
|
x.LastName = AesEncryptionHelper.Decrypt(x.LastName);
|
|
x.LastName = AesEncryptionHelper.Decrypt(x.LastName);
|
|
});
|
|
});
|
|
@@ -1157,7 +1145,7 @@ WHERE
|
|
{
|
|
{
|
|
public int Id { get; set; }
|
|
public int Id { get; set; }
|
|
|
|
|
|
- public string Name { get; set; }
|
|
|
|
|
|
+ public string Name { get; set; }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|