|
|
|
@ -4246,6 +4246,65 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("当前模板未设置");
|
|
|
|
|
}
|
|
|
|
|
// 筛选出重复的行列
|
|
|
|
|
var groupList = entity.GroupBy(x => new { x.Row, x.Column }).Where(group => group.Count() > 1);
|
|
|
|
|
|
|
|
|
|
foreach (var group in groupList)
|
|
|
|
|
{
|
|
|
|
|
var orderbyGroup = group.OrderBy(x => x.Id);
|
|
|
|
|
foreach (var item in orderbyGroup)
|
|
|
|
|
{
|
|
|
|
|
string value = null;
|
|
|
|
|
|
|
|
|
|
var fieldType = item.Field.Split('.')[0].ToLower();
|
|
|
|
|
var fieldProperty = item.Field.Split('.')[1];
|
|
|
|
|
if (fieldType == "order")
|
|
|
|
|
{
|
|
|
|
|
if (order != null)
|
|
|
|
|
{
|
|
|
|
|
value = typeof(BookingOrder).GetProperty(fieldProperty).GetValue(order)?.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (fieldType == "edi")
|
|
|
|
|
{
|
|
|
|
|
if (edi != null)
|
|
|
|
|
{
|
|
|
|
|
value = typeof(BookingEDIExt).GetProperty(fieldProperty).GetValue(edi)?.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (fieldType == "userinfo")
|
|
|
|
|
{
|
|
|
|
|
var propertyLower = fieldProperty.ToLower();
|
|
|
|
|
switch (propertyLower)
|
|
|
|
|
{
|
|
|
|
|
case "username":
|
|
|
|
|
value = UserManager.Name; break;
|
|
|
|
|
case "usertel":
|
|
|
|
|
value = UserManager.TEl; break;
|
|
|
|
|
case "usermobile":
|
|
|
|
|
value = UserManager.Phone; break;
|
|
|
|
|
case "useremail":
|
|
|
|
|
value = UserManager.Email; break;
|
|
|
|
|
case "usertenant":
|
|
|
|
|
value = UserManager.TENANT_NAME; break;
|
|
|
|
|
default:
|
|
|
|
|
value = null; break;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(value))
|
|
|
|
|
{
|
|
|
|
|
foreach (var itemTemp in group)
|
|
|
|
|
{
|
|
|
|
|
if (itemTemp != item)
|
|
|
|
|
{
|
|
|
|
|
entity.Remove(itemTemp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int _row = 1; _row <= entity.Max(x => x.Row); _row++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|