|
|
|
@ -1765,6 +1765,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var order = await _rep.FirstOrDefaultAsync(x => x.Id == bookingId);
|
|
|
|
|
var edi = await _bookingEDIExt.FirstOrDefaultAsync(x => x.BookingId == bookingId);
|
|
|
|
|
if (order == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(BookingErrorCode.BOOK001);
|
|
|
|
@ -1847,27 +1848,96 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
if (entity.Where(x => x.Row == _row && x.Column == _cellNum).Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
{
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name == _name)
|
|
|
|
|
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(order).ToString();
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
|
{
|
|
|
|
|
value = value != null ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : "";
|
|
|
|
|
}
|
|
|
|
|
if (cell != null)
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order" && name.Split('.')[1].ToLower() == _name)
|
|
|
|
|
{
|
|
|
|
|
row.Cells[_cellNum - 1].SetCellValue(value);
|
|
|
|
|
var value = descriptor.GetValue(order).ToString();
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
|
{
|
|
|
|
|
value = value != null ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : "";
|
|
|
|
|
}
|
|
|
|
|
if (cell != null)
|
|
|
|
|
{
|
|
|
|
|
row.Cells[_cellNum - 1].SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "edi")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi))
|
|
|
|
|
{
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "edi" && name.Split('.')[1].ToLower() == _name)
|
|
|
|
|
{
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
var value = descriptor.GetValue(edi).ToString();
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
|
{
|
|
|
|
|
value = value != null ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : "";
|
|
|
|
|
}
|
|
|
|
|
if (cell != null)
|
|
|
|
|
{
|
|
|
|
|
row.Cells[_cellNum - 1].SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() != "order" && name.Split('.')[0].ToLower() != "edi" && name.Split('.')[0].ToLower() != "ctn")
|
|
|
|
|
{
|
|
|
|
|
ICell cell = row.GetCell(_cellNum - 1);
|
|
|
|
|
var value = string.Empty;
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "username")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Name;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usertel")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.TEl;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usermobile")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Phone;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "useremail")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Email;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usertenant")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.TENANT_NAME;
|
|
|
|
|
}
|
|
|
|
|
if (cell != null)
|
|
|
|
|
{
|
|
|
|
|
row.Cells[_cellNum - 1].SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
row.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1881,16 +1951,69 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
if (entity.Where(x => x.Row == _row && x.Column == _cellNum).Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
{
|
|
|
|
|
var name = entity.Where(x => x.Row == _row && x.Column == _cellNum).Select(x => x.Field).FirstOrDefault();
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name == _name)
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(order).ToString();
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[1].ToLower() == _name && name.Split('.')[0].ToLower() == "order")
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(order).ToString();
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
|
{
|
|
|
|
|
value = value != null ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : "";
|
|
|
|
|
}
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "edi")
|
|
|
|
|
{
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(edi))
|
|
|
|
|
{
|
|
|
|
|
var _name = descriptor.Name.ToLower();
|
|
|
|
|
if (name.Split('.')[1].ToLower() == _name && name.Split('.')[0].ToLower() == "edi")
|
|
|
|
|
{
|
|
|
|
|
var value = descriptor.GetValue(edi).ToString();
|
|
|
|
|
if (descriptor.PropertyType.FullName.Contains("DateTime"))
|
|
|
|
|
{
|
|
|
|
|
value = value != null ? Convert.ToDateTime(value).ToString("yyyy-MM-dd") : "";
|
|
|
|
|
}
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.Split('.')[0].ToLower() != "order" && name.Split('.')[0].ToLower() != "edi" && name.Split('.')[0].ToLower() != "ctn")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var value = string.Empty;
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "username")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Name;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usertel")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.TEl;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usermobile")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Phone;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "useremail")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.Email;
|
|
|
|
|
}
|
|
|
|
|
if (name.Split('.')[0].ToLower() == "usertenant")
|
|
|
|
|
{
|
|
|
|
|
value = UserManager.TENANT_NAME;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
srow.CreateCell(_cellNum - 1).SetCellValue(value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3709,9 +3832,6 @@ namespace Myshipping.Application
|
|
|
|
|
BookingOrder order = new BookingOrder();
|
|
|
|
|
BookingCtn ctn = new BookingCtn();
|
|
|
|
|
BookingEDIExt ext = new BookingEDIExt();
|
|
|
|
|
List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
|
|
|
|
|
|
|
|
|
|
////bookingorder
|
|
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
|
|
|
|
|
{
|
|
|
|
@ -3725,7 +3845,7 @@ namespace Myshipping.Application
|
|
|
|
|
dic.Add(descriptor.Name, descriptor.Description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(dic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, string> dic1 = new Dictionary<string, string>();
|
|
|
|
@ -3741,7 +3861,7 @@ namespace Myshipping.Application
|
|
|
|
|
dic1.Add(descriptor.Name, descriptor.Description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(dic1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, string> dic2 = new Dictionary<string, string>();
|
|
|
|
@ -3757,9 +3877,22 @@ namespace Myshipping.Application
|
|
|
|
|
dic2.Add(descriptor.Name, descriptor.Description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.Add(dic2);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
Dictionary<string, string> dic3 = new Dictionary<string, string>();
|
|
|
|
|
dic3.Add("username", "当前登录人");
|
|
|
|
|
dic3.Add("usertel", "当前登录人电话");
|
|
|
|
|
dic3.Add("usermobile", "当前登录人手机");
|
|
|
|
|
dic3.Add("useremail", "当前登录人邮箱");
|
|
|
|
|
dic3.Add("usertenant", "当前登录人所在公司");
|
|
|
|
|
|
|
|
|
|
var dynamic = new
|
|
|
|
|
{
|
|
|
|
|
order = dic,
|
|
|
|
|
ctn = dic1,
|
|
|
|
|
edi = dic2,
|
|
|
|
|
userinfo = dic3
|
|
|
|
|
};
|
|
|
|
|
return dynamic;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|