Browse Source

单位

master
wxd 4 weeks ago
parent
commit
76c2ad8cc5
  1. 12
      src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs
  2. 6
      src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs
  3. 4
      src/Shentun.Peis.Domain/CacheService.cs

12
src/Shentun.Peis.Application/CCTJExportDatas/CCTJLMPAppService.cs

@ -473,7 +473,7 @@ namespace Shentun.Peis.CCTJExportDatas
Address = row["address"].ToString(),
Bank = row["bank"].ToString(),
DisplayName = row["org_name"].ToString(),
DisplayOrder = oldCustomerOrgList.Rows.IndexOf(row) + 1,
DisplayOrder = Convert.ToInt32(row["display_order"].ToString()),
Fax = row["fax"].ToString(),
InvoiceName = row["org_name"].ToString(),
IsActive = 'Y',
@ -481,7 +481,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = null,
PathCode = (oldCustomerOrgList.Rows.IndexOf(row) + 1).ToString().PadLeft(5, '0'),
PathCode = _customerOrgManager.CreatePathCode(null).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),
@ -575,7 +575,7 @@ namespace Shentun.Peis.CCTJExportDatas
Address = row["address"].ToString(),
Bank = row["bank"].ToString(),
DisplayName = row["org_name"].ToString(),
DisplayOrder = oldCustomerOrgList.Rows.IndexOf(row) + 1,
DisplayOrder = Convert.ToInt32(row["display_order"].ToString()),
Fax = row["fax"].ToString(),
InvoiceName = row["org_name"].ToString(),
IsActive = 'Y',
@ -583,7 +583,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = parentId,
PathCode = _customerOrgManager.CreatePathCode(parentId).Result,
PathCode = _customerOrgManager.CreatePathCode(parentId).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),
@ -677,7 +677,7 @@ namespace Shentun.Peis.CCTJExportDatas
Address = row["address"].ToString(),
Bank = row["bank"].ToString(),
DisplayName = row["org_name"].ToString(),
DisplayOrder = oldCustomerOrgList.Rows.IndexOf(row) + 1,
DisplayOrder = Convert.ToInt32(row["display_order"].ToString()),
Fax = row["fax"].ToString(),
InvoiceName = row["org_name"].ToString(),
IsActive = 'Y',
@ -685,7 +685,7 @@ namespace Shentun.Peis.CCTJExportDatas
MedicalCenterId = defaultMedicalCenterId,
OrgTypeId = defaultOrgTypeId, //默认为私营
ParentId = parentId,
PathCode = _customerOrgManager.CreatePathCode(parentId).Result,
PathCode = _customerOrgManager.CreatePathCode(parentId).GetAwaiter().GetResult(),
PostalCode = row["postalcode"].ToString(),
Remark = remark,
ShortName = row["short_name"].ToString(),

6
src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs

@ -657,10 +657,8 @@ namespace Shentun.Peis.CustomerOrgs
/// <returns></returns>
public async Task<Guid> GetParent(Guid CustomerOrgId)
{
var entity = await GetAsync(CustomerOrgId);
var parentEntity = (await Repository.GetQueryableAsync()).Where(o => o.PathCode == entity.PathCode.Substring(0, 5)).Single();
return parentEntity.Id;
//return EntityHelper.GetParentNoSql(await Repository.GetListAsync(), CustomerOrgId);
var topCustomerOrgId = await _cacheService.GetTopCustomerOrgIdAsync(CustomerOrgId);
return topCustomerOrgId;
}

4
src/Shentun.Peis.Domain/CacheService.cs

@ -703,7 +703,7 @@ namespace Shentun.Peis
if (customerOrgDisplayMode == "0")
{
entity = await _customerOrgRepository.GetAsync(o => o.PathCode == entity.PathCode.Substring(0, 5));
entity = await _customerOrgRepository.FirstOrDefaultAsync(o => o.PathCode == entity.PathCode.Substring(0, 5));
}
else
{
@ -731,7 +731,7 @@ namespace Shentun.Peis
if (entity.PathCode.Length > 5)
{
entity = await _customerOrgRepository.GetAsync(o => o.PathCode == entity.PathCode.Substring(0, 5));
entity = await _customerOrgRepository.FirstOrDefaultAsync(o => o.PathCode == entity.PathCode.Substring(0, 5));
topCustomerOrgId = entity.Id;
}

Loading…
Cancel
Save