wanghaomei 2 years ago
commit c01c2d45b1

@ -217,6 +217,10 @@ namespace Myshipping.Application.EDI.YT
#region 格式化每行
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("\n", "\\");
str = str.Replace("\r", " ");
@ -708,7 +712,7 @@ namespace Myshipping.Application.EDI.YT
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + 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
+ ":" + 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
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
+ ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C
@ -735,7 +739,7 @@ namespace Myshipping.Application.EDI.YT
+ ":" + bill.ORDERNO//2 REFERENCE NO. 运编号 X(35) 一般为流水号 M
+ ":" + 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
+ ":" + 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
+ ":"//7 ISSUE PARTY 签单人说明 X(35)   C
+ ":"//8 APPLICANT 询价单位 X(13) 向船公司询价的单位代码 C
@ -818,7 +822,7 @@ namespace Myshipping.Application.EDI.YT
List<System.String> ShippingList = formatlengthStr(Shipping, 70);
if (Shipping != "")
if (!string.IsNullOrWhiteSpace(Shipping))
{
r.WriteLine("17:" + formatListStr(ShippingList, 5) + "'");
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);
if (Shipping != "")
if (!string.IsNullOrWhiteSpace(Shipping))
{
r.WriteLine("23::" + formatListStr(ShippingList, 6) + "'");
@ -881,7 +885,7 @@ namespace Myshipping.Application.EDI.YT
Shipping = bill.AMSCONSIGNEE;
ShippingList = formatlengthStr(Shipping, 35);
if (Shipping != "")
if (!string.IsNullOrWhiteSpace(Shipping))
{
r.WriteLine("24::" + formatListStr(ShippingList, 6, true) + "'");
icount = icount + 1;
@ -892,7 +896,7 @@ namespace Myshipping.Application.EDI.YT
Shipping = bill.AMSNOTIFYPARTY;
ShippingList = formatlengthStr(Shipping, 35);
if (Shipping != "")
if (!string.IsNullOrWhiteSpace(Shipping))
{
r.WriteLine("25::" + formatListStr(ShippingList, 6, true) + "'");
icount = icount + 1;
@ -973,7 +977,7 @@ namespace Myshipping.Application.EDI.YT
}
}
}
if (strtemp != "")
if (!string.IsNullOrWhiteSpace(strtemp))
{
r.WriteLine(strtemp + "'");
icount = icount + 1;
@ -1069,7 +1073,7 @@ namespace Myshipping.Application.EDI.YT
for (var i = 0; i < ShippingList.Count; i++)
{
if (ShippingList[i] != "")
if (!string.IsNullOrWhiteSpace(ShippingList[i]))
{
if (m <= 5)
{
@ -1093,7 +1097,7 @@ namespace Myshipping.Application.EDI.YT
}
}
}
if (strtemp != "")
if (!string.IsNullOrWhiteSpace(strtemp))
{
r.WriteLine(strtemp + "'");
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.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
.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))
.ToPagedListAsync(input.PageNo, input.PageSize);
var list = entities.Adapt<SqlSugarPagedList<PageBookingOrder>>();
foreach (var item in list.Items)
{
var sta = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == item.Id).ToListAsync();
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;
}

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

@ -20,7 +20,7 @@ namespace Myshipping.Core.Service;
/// 用户数据范围
/// </summary>
[ApiDescriptionSettings(Name = "SysDataUserMenu", Order = 150)]
public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,ITransient
public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<SysDataUserMenu> _rep; // 用户数据范围表仓储
private readonly ISysCacheService _sysCache;//缓存
@ -33,9 +33,9 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
_rep = rep;
_sysCache = sysCache;
_sysuser = sysuser;
_sysUserDataScopeRep=sysUserDataScopeRep;
_sysUserDataScopeRep = sysUserDataScopeRep;
_sysEmpRep = sysEmpRep;
_sysOrgRep= sysOrgRep;
_sysOrgRep = sysOrgRep;
}
/// <summary>
@ -44,7 +44,8 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
/// <param name="userid"></param>
/// <returns></returns>
[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();
}
@ -117,28 +118,28 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
{
try
{
if (input== null)
if (input == null)
{
throw Oops.Bah("请上传正确数据!");
}
await _sysUserDataScopeRep.DeleteAsync(x => x.SysUserId == input.UserId);
var list = new List<SysUserDataScope>();
input.childrens.ForEach(u =>
var list = new List<SysUserDataScope>();
input.childrens.ForEach(u =>
{
list.Add(
new SysUserDataScope
{
list.Add(
new SysUserDataScope
{
SysUserId = input.UserId,
SysMenuId=u.MenuId,
SysOrgId=u.OrgId
});
SysUserId = input.UserId,
SysMenuId = u.MenuId,
SysOrgId = u.OrgId
});
await _sysUserDataScopeRep.InsertAsync(list);
});
await _sysUserDataScopeRep.InsertAsync(list);
//var userdatalist = _rep.AsQueryable().ToListAsync();
//_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, userdatalist);
//var userdatalist = _rep.AsQueryable().ToListAsync();
//_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, userdatalist);
}
@ -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();
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);
}
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();
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();
}
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();
orglist.Add(orgid);
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;
}

Loading…
Cancel
Save