权限修改

usertest
cjy 4 months ago
parent 956f843e58
commit cab17ae534

@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.Core.Constants
{
/// <summary>
/// 租户参数Code常量
/// </summary>
public class TenantParamCode
{
/// <summary>
/// 是否启用舱位相关功能
/// </summary>
public const string ENABLE_SLOT_ABILITY = "ENABLE_SLOT_ABILITY";
/// <summary>
/// 是否启用费用相关功能
/// </summary>
public const string ENABLE_FEE_ABILITY = "ENABLE_FEE_ABILITY";
/// <summary>
/// 是否必须使用船期表录入船期参数
/// </summary>
public const string VESSEL_FROM_CONFIG_ONLY = "VESSEL_FROM_CONFIG_ONLY";
/// <summary>
/// 通过运踪更新船舶动态开关
/// </summary>
public const string ENABLE_STATUS_TO_SAILING_DATE = "EnableStatusToSailingDate";
/// <summary>
/// 删除订舱前是否先询问东胜
/// </summary>
public const string ASK_DS_BEFORE_DELETE_BOOKING_ORDER = "AskDsBeforeDeleteBookingOrder";
/// <summary>
/// 是否启用委托单位权限显示控制
/// </summary>
/// <remarks>开启此参数后,在部分接口查询数据时会根据当前登陆人的权限范围来决定返回哪些委托单位,如委托单位管理台账查询接口、委托单位下拉查询接口、舱位管理台账查询接口、舱位管理详情查询接口等</remarks>
public const string IS_ENABLE_CUSTOMER_AUTHORITY = "IS_ENABLE_CUSTOMER_AUTHORITY";
/// <summary>
/// 订舱途径选择
/// </summary>
public const string BOOKING_CHANNEL_SELECT_SHOW = "BOOKING_CHANNEL_SELECT_SHOW";
/// <summary>
/// BC任务生成默认选项
/// </summary>
public const string BC_TASK_CREATE_ORDER = "BC_TASK_CREATE_ORDER";
/// <summary>
/// 订舱分公司信息
/// </summary>
public const string BOOKING_SUB_TENANT = "BOOKING_SUB_TENANT";
}
}

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.Core.Enums
{
/// <summary>
/// 对账状态枚举
/// </summary>
public enum BillCheckStatusEnum
{
/// <summary>
/// 未对账
/// </summary>
[Description("未对账")]
NotChecked = 0,
/// <summary>
/// 已对账
/// </summary>
[Description("已对账")]
Checked = 1,
/// <summary>
/// 部分对账
/// </summary>
[Description("部分对账")]
PartiallyChecked = 2
}
}

@ -233,7 +233,7 @@ public static class SqlsugarInstall
Sql = it.Sql, Sql = it.Sql,
Param = JsonConvert.SerializeObject(it.Parameters), Param = JsonConvert.SerializeObject(it.Parameters),
OperateType = diffType.ToString(), OperateType = diffType.ToString(),
OldValue = JsonConvert.SerializeObject(editAfterData), OldValue = JsonConvert.SerializeObject(editBeforeData),
NewValue = JsonConvert.SerializeObject(editAfterData), NewValue = JsonConvert.SerializeObject(editAfterData),
DiffData = diffData.DiffData, DiffData = diffData.DiffData,
AopData = JsonConvert.SerializeObject(it.BusinessData), AopData = JsonConvert.SerializeObject(it.BusinessData),

@ -1,6 +1,7 @@
using System.ComponentModel; using System.ComponentModel;
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.Module.Core.Enums;
using SqlSugar; using SqlSugar;
namespace DS.WMS.Core.Op.Entity namespace DS.WMS.Core.Op.Entity
@ -53,7 +54,7 @@ namespace DS.WMS.Core.Op.Entity
/// 应收对账状态 /// 应收对账状态
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "应收对账状态", IsNullable = false, DefaultValue = "0")] [SqlSugar.SugarColumn(ColumnDescription = "应收对账状态", IsNullable = false, DefaultValue = "0")]
public int ARCheckStatus { get; set; } = 0; public BillCheckStatusEnum ARCheckStatus { get; set; } = BillCheckStatusEnum.NotChecked;
/// <summary> /// <summary>
@ -161,9 +162,9 @@ namespace DS.WMS.Core.Op.Entity
BusinessId = businessId, BusinessId = businessId,
ARFeeStatus = BillFeeStatus.Entering, ARFeeStatus = BillFeeStatus.Entering,
APFeeStatus = BillFeeStatus.Entering, APFeeStatus = BillFeeStatus.Entering,
ARInvoiceStatus = 0, ARInvoiceStatus = BillInvoiceStatus.NotIssued,
APInvoiceStatus = 0, APInvoiceStatus = BillInvoiceStatus.NotIssued,
ARCheckStatus = 0, ARCheckStatus = BillCheckStatusEnum.NotChecked,
IsBusinessLocking = false, IsBusinessLocking = false,
IsFeeLocking = false, IsFeeLocking = false,
BillAuditStatus = BillAuditStatus.Pending, BillAuditStatus = BillAuditStatus.Pending,

@ -13,6 +13,8 @@ using NLog.Web;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using Logger = NLog.Logger; using Logger = NLog.Logger;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Identity;
using DS.Module.Core.Constants;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -317,6 +319,123 @@ namespace DS.WMS.Core.Op.Method
} }
#endregion #endregion
#endregion #endregion
#region 船舶动态ATD ETD ATA ETA MDGETA MDGATA
if (item.Status == "ATD" || item.Status == "ETD" || item.Status == "ATA" || item.Status == "ETA" || item.Status == "MDGETA" || item.Status == "MDGATA")
{
var config = await tenantDb.Queryable<SysConfig>().FirstAsync(x => x.Code == TenantParamCode.ENABLE_STATUS_TO_SAILING_DATE);
if (config.IsNotNull() && config.Value == "YES")
{
var order = await tenantDb.Queryable<SeaExport>().Where(x => x.Id == businessId && x.MBLNO == item.MBLNO).FirstAsync();
if (item.Status == "ATD")
{
//2023-8-31排查单号为177GZHZHQ5711V的数据原来录入的船已开船运踪港前不再查询而因订阅港后数据会继续回推数据所以导致ATD被改
//因此暂时取消运踪回推时写入ATD还是以船期表查询为准
// 2024-4-8 因为港捷需要,重新开启,并通过租户参数判断
//变更ATD
if (order != null && item.OpTime != null && order.ATD != item.OpTime)
{
order.ATD = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.ATD
}).EnableDiffLogEvent().ExecuteCommandAsync();
//sendDsList.Add(item.BookingId);
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
/*
* 2023824ATD
*
*
*/
////批量变更相同船期
//if (!string.IsNullOrEmpty(o.VESSEL) && !string.IsNullOrEmpty(o.VOYNO) && !string.IsNullOrEmpty(o.CARRIERID))
//{
// var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VOYNO == o.VOYNO && x.VESSEL == o.VESSEL && x.CARRIERID == o.CARRIERID && x.TenantId == o.TenantId && x.IsDeleted == false && x.Id != item.BookingId).ToListAsync();
// foreach (var it in order)
// {
// var _oldorder = it;
// var _oldatd = it.ATD;
// if (_oldatd != item.OpTime)
// {
// it.ATD = item.OpTime;
// await _rep.UpdateAsync(it);
// await _bookingorderservice.SaveLog(it, _oldorder);
// await _bookingorderservice.SendBookingOrder(new long[] { it.Id });
// }
// }
//}
}
//else if (item.Status == "ETD")
//{
// if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
// {
// order.YgtETD = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.YgtETD
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
//else if (item.Status == "ATA")
//{
// if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
// {
// order.StartATA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.StartATA
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
//else if (item.Status == "ETA")
//{
// if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
// {
// order.StartETA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new
// {
// x.StartETA
// }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// }
//}
else if (item.Status == "MDGETA")
{
if (order != null && item.OpTime != null && order.ETA != item.OpTime)
{
order.ETA = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.ETA
}).EnableDiffLogEvent().ExecuteCommandAsync();
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
else if (item.Status == "MDGATA")
{
if (order != null && item.OpTime != null && order.ATA != item.OpTime)
{
order.ATA = item.OpTime;
await tenantDb.Updateable(order).UpdateColumns(x => new
{
x.ATA
}).EnableDiffLogEvent().ExecuteCommandAsync();
//await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
}
}
}
}
#endregion
} }
} }

@ -651,7 +651,7 @@ public class CommonService : ICommonService
.Select(a => new RouteItem .Select(a => new RouteItem
{ {
Id = a.Id, Id = a.Id,
ParentId = a.ParentId, ParentId = a.PermissionId,
Path = a.Url, Path = a.Url,
Name = a.PermissionName, Name = a.PermissionName,
EnName = a.PermissionEnName, EnName = a.PermissionEnName,
@ -671,14 +671,14 @@ public class CommonService : ICommonService
foreach (var child in childs) foreach (var child in childs)
{ {
var grandsons = db.Queryable<SysPermission>().Where(x => var grandsons = db.Queryable<SysPermissionTenant>().Where(x =>
x.MenuType == 2 && x.ParentId == child.Id && x.IsHidden == false && x.MenuType == 2 && x.ParentId == child.ParentId && x.IsHidden == false &&
permissions.Contains(x.Id)) //获取第三层路由 permissions.Contains(x.PermissionId)) //获取第三层路由
.OrderBy(x => x.SortCode) .OrderBy(x => x.SortCode)
.Select(a => new RouteItem .Select(a => new RouteItem
{ {
Id = a.Id, Id = a.Id,
ParentId = a.ParentId, ParentId = a.PermissionId,
Path = a.Url, Path = a.Url,
Name = a.PermissionName, Name = a.PermissionName,
EnName = a.PermissionEnName, EnName = a.PermissionEnName,

Loading…
Cancel
Save