|
@@ -122,6 +122,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
//公司信息
|
|
//公司信息
|
|
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 = await _sqlSugar.SqlQueryable<CustomerCompanyCiew>(clientCompanySql).ToListAsync();
|
|
var clientCompanyData = await _sqlSugar.SqlQueryable<CustomerCompanyCiew>(clientCompanySql).ToListAsync();
|
|
|
|
+ clientCompanyData = clientCompanyData.DistinctBy(it => it.CompanyFullName).ToList();
|
|
|
|
|
|
var _view = new {
|
|
var _view = new {
|
|
ShippingSpaceTypeData = _ShippingSpaceTypeData,
|
|
ShippingSpaceTypeData = _ShippingSpaceTypeData,
|
|
@@ -268,7 +269,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
else
|
|
else
|
|
{
|
|
{
|
|
var companyInfo = await _sqlSugar.Queryable<Crm_CustomerCompany>().Where(it => it.IsDel == 0 &&
|
|
var companyInfo = await _sqlSugar.Queryable<Crm_CustomerCompany>().Where(it => it.IsDel == 0 &&
|
|
- it.Id == clientInfo.CrmCompanyId
|
|
|
|
|
|
+ it.CompanyFullName.Equals(dto.CompanyFullName)
|
|
).FirstAsync();
|
|
).FirstAsync();
|
|
if (companyInfo != null)
|
|
if (companyInfo != null)
|
|
{
|
|
{
|
|
@@ -294,6 +295,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+
|
|
var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnIdentityAsync();
|
|
var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnIdentityAsync();
|
|
if (companyAdd < 0)
|
|
if (companyAdd < 0)
|
|
{
|
|
{
|
|
@@ -302,6 +304,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
crmCompanyId = companyAdd;
|
|
crmCompanyId = companyAdd;
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -315,6 +319,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
|
|
var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
|
|
new
|
|
new
|
|
{
|
|
{
|
|
|
|
+ it.CrmCompanyId,
|
|
it.LastName,
|
|
it.LastName,
|
|
it.FirstName,
|
|
it.FirstName,
|
|
it.Pinyin,
|
|
it.Pinyin,
|