jianghaiqing 2 years ago
commit 2b708197fb

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; }
}
foreach (var item in list.Items)
{
var sta = await _bookingremark.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
if (sta != null) { item.bookremark = 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");
}
}
return list;
}
@ -366,7 +366,7 @@ namespace Myshipping.Application
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
input.CNTRTOTAL = string.Join(" / ", groupList);
}
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID&&x.ParentId==0).FirstAsync();
if (et != null)
{
@ -481,7 +481,7 @@ namespace Myshipping.Application
}
var main = await _rep.AsQueryable().Where(x => x.Id == input.Id).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.Id != input.Id).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.Id != input.Id&&x.ParentId == 0).FirstAsync();
if (et != null)
{

@ -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>

@ -76,8 +76,8 @@ namespace Myshipping.Application
throw Oops.Oh(BookingErrorCode.BOOK111);
}
bt.Content = input.Content;
bt.Remark = input.Remark;
input.Adapt(bt);
await _rep.AsUpdateable(bt).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}

@ -41,7 +41,7 @@ namespace Myshipping.Application
/// <summary>
/// 订舱模板修改输入参数
/// </summary>
public class UpdateBookingTemplateInput
public class UpdateBookingTemplateInput: BookingTemplateInput
{
/// <summary>
/// 主键
@ -49,15 +49,6 @@ namespace Myshipping.Application
[Required(ErrorMessage = "主键不能为空")]
public long Id { get; set; }
/// <summary>
/// 模板内容
/// </summary>
public virtual string Content { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
/// <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,30 +118,30 @@ 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);
}
catch (System.Exception)
{
@ -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