Compare commits

...

7 Commits

  1. 2343
      src/Shentun.Peis.Application/BeiJingMZAKExportDatas/BeiJingMZAKExportDataAppService.cs
  2. 12
      src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class1.cs
  3. 12
      src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class2.cs
  4. 76
      src/Shentun.Peis.Application/CustomerOrgs/CustomerOrgAppService.cs
  5. 2
      src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs
  6. 10
      src/Shentun.Peis.Domain/RegisterCheckAsbitems/RegisterCheckAsbitemManager.cs

2343
src/Shentun.Peis.Application/BeiJingMZAKExportDatas/BeiJingMZAKExportDataAppService.cs
File diff suppressed because it is too large
View File

12
src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class1.cs

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.Peis.BeiJingMZAKExportDatas
{
internal class Class1
{
}
}

12
src/Shentun.Peis.Application/BeiJingMZAKExportDatas/Class2.cs

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.Peis.BeiJingMZAKExportDatas
{
internal class Class2
{
}
}

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

@ -311,7 +311,9 @@ namespace Shentun.Peis.CustomerOrgs
}
}
var items = from p in dataList.Where(m => m.Id != GuidFlag.PersonCustomerOrgId).OrderByDescending(o => o.DisplayOrder)
var customerOrgList = dataList.ToList();
var items = from p in customerOrgList.Where(m => m.Id != GuidFlag.PersonCustomerOrgId).OrderByDescending(o => o.DisplayOrder).AsParallel()
select new CustomerOrgTreeChildDto()
{
Id = p.Id,
@ -320,28 +322,55 @@ namespace Shentun.Peis.CustomerOrgs
DisplayName = p.DisplayName,
SimpleCode = p.SimpleCode,
ShortName = p.ShortName,
CustomerOrgCode = p.CustomerOrgCode
CustomerOrgCode = p.CustomerOrgCode,
TreeChildren = new List<CustomerOrgTreeChildDto>()
};
var customerOrgTreeChildList = GetTree(items.ToList(), 0, "");
var customerOrgTreeChildList = GetTree(items.ToList(), null);
//var tree1 = items.Where(m => m.ParentId == null).ToList();
//foreach (var item1 in tree1)
//{
// item1.TreeChildren = items.Where(m => m.ParentId == item1.Id).ToList();
// foreach (var item2 in item1.TreeChildren)
// {
// item2.TreeChildren = items.Where(m => m.ParentId == item2.Id).ToList();
// foreach (var item3 in item2.TreeChildren)
// {
// item3.TreeChildren = items.Where(m => m.ParentId == item3.Id).ToList();
// foreach (var item4 in item3.TreeChildren)
// {
// item4.TreeChildren = items.Where(m => m.ParentId == item4.Id).ToList();
// }
// }
// }
//}
result.AddRange(customerOrgTreeChildList);
return result;
}
/// <summary>
/// 使用Code进行递归
/// 使用parentId进行递归
/// </summary>
/// <param name="items"></param>
/// <param name="deep"></param>
/// <param name="prefix"></param>
/// <param name="parentId"></param>
/// <returns></returns>
private List<CustomerOrgTreeChildDto> GetTree(List<CustomerOrgTreeChildDto> items, int deep, string prefix)
private List<CustomerOrgTreeChildDto> GetTree(List<CustomerOrgTreeChildDto> items, Guid? parentId)
{
return (from p in items
where p.Code.StartsWith(prefix) && p.Code.Count(a => a == '.') == deep
let subs = GetTree(items, deep + 1, p.Code)
return (from p in items.AsParallel()
where p.ParentId == parentId
let subs = GetTree(items, p.Id)
select new CustomerOrgTreeChildDto()
{
Id = p.Id,
@ -357,6 +386,33 @@ namespace Shentun.Peis.CustomerOrgs
}
///// <summary>
///// 使用Code进行递归
///// </summary>
///// <param name="items"></param>
///// <param name="deep"></param>
///// <param name="prefix"></param>
///// <returns></returns>
//private List<CustomerOrgTreeChildDto> GetTree(List<CustomerOrgTreeChildDto> items, int deep, string prefix)
//{
// return (from p in items
// where p.Code.StartsWith(prefix) && p.Code.Count(a => a == '.') == deep
// let subs = GetTree(items, deep + 1, p.Code)
// select new CustomerOrgTreeChildDto()
// {
// Id = p.Id,
// ParentId = p.ParentId,
// Code = p.Code,
// DisplayName = p.DisplayName,
// SimpleCode = p.SimpleCode,
// ShortName = p.ShortName,
// CustomerOrgCode = p.CustomerOrgCode,
// TreeChildren = subs.ToList()
// }
// ).ToList();
//}
/// <summary>
/// 获取顶级目录ID
/// </summary>

2
src/Shentun.Peis.Domain/CustomerOrgs/CustomerOrgManager.cs

@ -315,7 +315,7 @@ namespace Shentun.Peis.CustomerOrgs
.OrderByDescending(o =>
{
var sortCode = o.PathCode.Replace(".", "");
return Convert.ToInt32(sortCode);
return sortCode;
}).Select(s => s.PathCode).FirstOrDefault();
if (!string.IsNullOrEmpty(LastPathCode))

10
src/Shentun.Peis.Domain/RegisterCheckAsbitems/RegisterCheckAsbitemManager.cs

@ -466,11 +466,11 @@ namespace Shentun.Peis.RegisterAsbitems
throw new UserFriendlyException($"{asbitem.DisplayName}已收费不能修改");
}
if (existRegisterChecks.Where(o => o.Id == existRegisterAsbitem.RegisterCheckId).Single().CompleteFlag
== RegisterCheckCompleteFlag.Checked && isModified)
{
throw new UserFriendlyException($"{asbitem.DisplayName}已检查不能修改");
}
//if (existRegisterChecks.Where(o => o.Id == existRegisterAsbitem.RegisterCheckId).Single().CompleteFlag
// == RegisterCheckCompleteFlag.Checked && isModified)
//{
// throw new UserFriendlyException($"{asbitem.DisplayName}已检查不能修改");
//}
var registerCheck = existRegisterChecks.Where(o => o.Id == existRegisterAsbitem.RegisterCheckId).Single();
if (string.IsNullOrWhiteSpace(registerCheck.CheckRequestNo))
{

Loading…
Cancel
Save