wanghaomei 2 years ago
commit c01c2d45b1

@ -217,6 +217,10 @@ namespace Myshipping.Application.EDI.YT
#region 格式化每行 #region 格式化每行
public static List<System.String> formatlengthStr(string str, int length, bool formatstr = false, bool nodelsp = false) public static List<System.String> formatlengthStr(string str, int length, bool formatstr = false, bool nodelsp = false)
{ {
//2022-12-28 JHQ 传的字段是null会导致报错这里改为如果是NULL则默认赋空字符串。
if (str == null)
str = "";
str = str.Replace("\r\n", "\\"); str = str.Replace("\r\n", "\\");
str = str.Replace("\n", "\\"); str = str.Replace("\n", "\\");
str = str.Replace("\r", " "); str = str.Replace("\r", " ");
@ -708,7 +712,7 @@ namespace Myshipping.Application.EDI.YT
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M + ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C + ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M + ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "))//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C + ":" + formatEdiStr("txt", !string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "):"")//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M + ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C + ":"//7 ISSUE PARTY 签单人说明 X(35)   C
+ ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C + ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C
@ -735,7 +739,7 @@ namespace Myshipping.Application.EDI.YT
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M + ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C + ":" + bill.MBLNO//3 B\L NO. 提单号 X(20) 船公司的提单号 C
+ ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M + ":" + bill.SERVICE//4 DELIVERY TERM 交货条款 X(9) CY-CY(pier-pier/port):30CY-CFS(pier/port-door):29CFS-CY(door-pier/port):28CFS-CFS(door-door):27 M
+ ":" + formatEdiStr("txt", InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "))//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C + ":" + formatEdiStr("txt", !string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Replace("\n", " ").Replace("\r", " "):"")//5 BOOKING PARTY 订舱人说明 X(70) 货代方企业名称或代码 C
+ ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M + ":" + InttrEdi.RECEIVECODE//6 ISSUE PARTY CODE 签单人代码 X(13) 即接受订舱的人的代码 M
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C + ":"//7 ISSUE PARTY 签单人说明 X(35)   C
+ ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C + ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C
@ -818,7 +822,7 @@ namespace Myshipping.Application.EDI.YT
List<System.String> ShippingList = formatlengthStr(Shipping, 70); List<System.String> ShippingList = formatlengthStr(Shipping, 70);
if (Shipping != "") if (!string.IsNullOrWhiteSpace(Shipping))
{ {
r.WriteLine("17:" + formatListStr(ShippingList, 5) + "'"); r.WriteLine("17:" + formatListStr(ShippingList, 5) + "'");
icount++; icount++;
@ -865,10 +869,10 @@ namespace Myshipping.Application.EDI.YT
} }
Shipping = formatEdiStr("txt", bill.NOTIFYPARTY2); Shipping = formatEdiStr("txt", !string.IsNullOrWhiteSpace(bill.NOTIFYPARTY2) ? bill.NOTIFYPARTY2 : "");
ShippingList = formatlengthStr(Shipping, 35); ShippingList = formatlengthStr(Shipping, 35);
if (Shipping != "") if (!string.IsNullOrWhiteSpace(Shipping))
{ {
r.WriteLine("23::" + formatListStr(ShippingList, 6) + "'"); r.WriteLine("23::" + formatListStr(ShippingList, 6) + "'");
@ -881,7 +885,7 @@ namespace Myshipping.Application.EDI.YT
Shipping = bill.AMSCONSIGNEE; Shipping = bill.AMSCONSIGNEE;
ShippingList = formatlengthStr(Shipping, 35); ShippingList = formatlengthStr(Shipping, 35);
if (Shipping != "") if (!string.IsNullOrWhiteSpace(Shipping))
{ {
r.WriteLine("24::" + formatListStr(ShippingList, 6, true) + "'"); r.WriteLine("24::" + formatListStr(ShippingList, 6, true) + "'");
icount = icount + 1; icount = icount + 1;
@ -892,7 +896,7 @@ namespace Myshipping.Application.EDI.YT
Shipping = bill.AMSNOTIFYPARTY; Shipping = bill.AMSNOTIFYPARTY;
ShippingList = formatlengthStr(Shipping, 35); ShippingList = formatlengthStr(Shipping, 35);
if (Shipping != "") if (!string.IsNullOrWhiteSpace(Shipping))
{ {
r.WriteLine("25::" + formatListStr(ShippingList, 6, true) + "'"); r.WriteLine("25::" + formatListStr(ShippingList, 6, true) + "'");
icount = icount + 1; icount = icount + 1;
@ -973,7 +977,7 @@ namespace Myshipping.Application.EDI.YT
} }
} }
} }
if (strtemp != "") if (!string.IsNullOrWhiteSpace(strtemp))
{ {
r.WriteLine(strtemp + "'"); r.WriteLine(strtemp + "'");
icount = icount + 1; icount = icount + 1;
@ -1069,7 +1073,7 @@ namespace Myshipping.Application.EDI.YT
for (var i = 0; i < ShippingList.Count; i++) for (var i = 0; i < ShippingList.Count; i++)
{ {
if (ShippingList[i] != "") if (!string.IsNullOrWhiteSpace(ShippingList[i]))
{ {
if (m <= 5) if (m <= 5)
{ {
@ -1093,7 +1097,7 @@ namespace Myshipping.Application.EDI.YT
} }
} }
} }
if (strtemp != "") if (!string.IsNullOrWhiteSpace(strtemp))
{ {
r.WriteLine(strtemp + "'"); r.WriteLine(strtemp + "'");
icount = icount + 1; icount = icount + 1;

File diff suppressed because it is too large Load Diff

@ -284,25 +284,25 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE) .WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE)
.WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME)) .WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
.WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER)) .WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER))
.Where(u => userlist.Contains((long)u.CreatedUserId)) .WhereIF(userlist!=null&&userlist.Count()>0, u => userlist.Contains((long)u.CreatedUserId))
.OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort)) .OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort))
.ToPagedListAsync(input.PageNo, input.PageSize); .ToPagedListAsync(input.PageNo, input.PageSize);
var list = entities.Adapt<SqlSugarPagedList<PageBookingOrder>>(); var list = entities.Adapt<SqlSugarPagedList<PageBookingOrder>>();
foreach (var item in list.Items) foreach (var item in list.Items)
{ {
var sta = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == item.Id).ToListAsync(); var sta = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == item.Id).ToListAsync();
if (sta != null) { item.bookstatus = sta; } if (sta != null) { item.bookstatus = sta; }
var st = await _bookingremark.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
if (st != null) { item.bookremark = st; }
if (!string.IsNullOrWhiteSpace( item.ETD)) {
item.ETD = Convert.ToDateTime(item.ETD).ToString("yyyy-MM-dd");
} }
foreach (var item in list.Items)
{
var sta = await _bookingremark.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
if (sta != null) { item.bookremark = sta; }
} }
return list; return list;
} }

@ -11,6 +11,8 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
{ {
public class PageBookingOrder : DBEntityTenant public class PageBookingOrder : DBEntityTenant
{ {
/// <summary> /// <summary>
/// 业务编号 /// 业务编号
/// </summary> /// </summary>
@ -125,7 +127,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// 开船日期 /// 开船日期
/// </summary> /// </summary>
[Description("开船日期")] [Description("开船日期")]
public DateTime? ETD { get; set; } public string ETD { get; set; }
/// <summary> /// <summary>
/// 实际开船日期 /// 实际开船日期
/// </summary> /// </summary>

@ -20,7 +20,7 @@ namespace Myshipping.Core.Service;
/// 用户数据范围 /// 用户数据范围
/// </summary> /// </summary>
[ApiDescriptionSettings(Name = "SysDataUserMenu", Order = 150)] [ApiDescriptionSettings(Name = "SysDataUserMenu", Order = 150)]
public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,ITransient public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController, ITransient
{ {
private readonly SqlSugarRepository<SysDataUserMenu> _rep; // 用户数据范围表仓储 private readonly SqlSugarRepository<SysDataUserMenu> _rep; // 用户数据范围表仓储
private readonly ISysCacheService _sysCache;//缓存 private readonly ISysCacheService _sysCache;//缓存
@ -33,9 +33,9 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
_rep = rep; _rep = rep;
_sysCache = sysCache; _sysCache = sysCache;
_sysuser = sysuser; _sysuser = sysuser;
_sysUserDataScopeRep=sysUserDataScopeRep; _sysUserDataScopeRep = sysUserDataScopeRep;
_sysEmpRep = sysEmpRep; _sysEmpRep = sysEmpRep;
_sysOrgRep= sysOrgRep; _sysOrgRep = sysOrgRep;
} }
/// <summary> /// <summary>
@ -44,7 +44,8 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
/// <param name="userid"></param> /// <param name="userid"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("/SysDataUserMenu/GetGrantData")] [HttpGet("/SysDataUserMenu/GetGrantData")]
public async Task<dynamic> GetGrantData(long userid) { public async Task<dynamic> GetGrantData(long userid)
{
return await _rep.AsQueryable().Where(x => x.SysUserId == userid).ToListAsync(); return await _rep.AsQueryable().Where(x => x.SysUserId == userid).ToListAsync();
} }
@ -117,7 +118,7 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
{ {
try try
{ {
if (input== null) if (input == null)
{ {
throw Oops.Bah("请上传正确数据!"); throw Oops.Bah("请上传正确数据!");
} }
@ -131,8 +132,8 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
new SysUserDataScope new SysUserDataScope
{ {
SysUserId = input.UserId, SysUserId = input.UserId,
SysMenuId=u.MenuId, SysMenuId = u.MenuId,
SysOrgId=u.OrgId SysOrgId = u.OrgId
}); });
}); });
await _sysUserDataScopeRep.InsertAsync(list); await _sysUserDataScopeRep.InsertAsync(list);
@ -172,32 +173,34 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
DataScopeType _dataScopeType = list.Where(x => x.SysMenuId == menuid && x.SysUserId == UserManager.UserId).Select(x => x.DataScopeType).FirstOrDefault(); DataScopeType _dataScopeType = list.Where(x => x.SysMenuId == menuid && x.SysUserId == UserManager.UserId).Select(x => x.DataScopeType).FirstOrDefault();
if (_dataScopeType == DataScopeType.ALL) if (_dataScopeType == DataScopeType.ALL)
{ {
datascope = _sysuser.AsQueryable().Where(x => x.TenantId == UserManager.TENANT_ID).Select(x => x.Id).ToList(); datascope = null;
} }
if (_dataScopeType==DataScopeType.SELF) { else if (_dataScopeType == DataScopeType.SELF)
{
datascope.Add(UserManager.UserId); datascope.Add(UserManager.UserId);
} }
if (_dataScopeType==DataScopeType.DEPT) { else if (_dataScopeType == DataScopeType.DEPT)
datascope=await _sysEmpRep.AsQueryable().InnerJoin<SysEmp>((d, t) => d.OrgId == t.OrgId && d.Id == UserManager.UserId).Select(d => d.Id).ToListAsync(); {
datascope = await _sysEmpRep.AsQueryable().InnerJoin<SysEmp>((d, t) => d.OrgId == t.OrgId && d.Id == UserManager.UserId).Select(d => d.Id).ToListAsync();
} }
if (_dataScopeType == DataScopeType.DEPT_WITH_CHILD) else if (_dataScopeType == DataScopeType.DEPT_WITH_CHILD)
{ {
//获取本部门 //获取本部门
long orgid= _sysEmpRep.Where(x=>x.Id==UserManager.UserId).Select(x=>x.OrgId).First(); long orgid = _sysEmpRep.Where(x => x.Id == UserManager.UserId).Select(x => x.OrgId).First();
//获取下属部门及下属部门 //获取下属部门及下属部门
var orglist = await _sysOrgRep.Where(x => x.TenantId == UserManager.TENANT_ID && x.Pids.Contains(orgid.ToString())).Select(x => x.Id).ToListAsync(); var orglist = await _sysOrgRep.Where(x => x.TenantId == UserManager.TENANT_ID && x.Pids.Contains(orgid.ToString())).Select(x => x.Id).ToListAsync();
orglist.Add(orgid); orglist.Add(orgid);
datascope = await _sysEmpRep.Where(x => orglist.Contains(x.OrgId)).Select(x => x.Id).ToListAsync(); datascope = await _sysEmpRep.Where(x => orglist.Contains(x.OrgId)).Select(x => x.Id).ToListAsync();
} }
if (_dataScopeType == DataScopeType.DEFINE) else if (_dataScopeType == DataScopeType.DEFINE)
{ {
datascope=await _sysUserDataScopeRep.AsQueryable().InnerJoin<SysEmp>((d, t) => d.SysOrgId == t.OrgId && d.SysMenuId == menuid && d.SysUserId == UserManager.UserId).Select((d, t) => t.Id).ToListAsync(); datascope = await _sysUserDataScopeRep.AsQueryable().InnerJoin<SysEmp>((d, t) => d.SysOrgId == t.OrgId && d.SysMenuId == menuid && d.SysUserId == UserManager.UserId).Select((d, t) => t.Id).ToListAsync();
} }
else {
datascope.Add(UserManager.UserId);
}
return datascope; return datascope;
} }

Loading…
Cancel
Save