费用模板dto修改

usertest
嵇文龙 6 months ago
parent 2c53f58aa5
commit ab08ceba84

@ -712,3 +712,10 @@
2024-05-24 15:37:13.1685 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-05-24 15:37:13.1790 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 15:37:13.1790 Info Configuration initialized.
2024-05-24 17:08:49.9919 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-24 17:08:50.0274 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-24 17:08:50.0274 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-24 17:08:50.0497 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-24 17:08:50.0582 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.AdminApi\bin\Debug\net8.0\nlog.config
2024-05-24 17:08:50.0582 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 17:08:50.0712 Info Configuration initialized.

@ -40,7 +40,7 @@ public class FeeTemplateDetailReq
/// <summary>
/// 结算对象类型
/// </summary>
public CustomerTypeEnum? CustomerType { get; set; }
public string CustomerType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>

@ -1,6 +1,4 @@
using DS.Module.Core;
using Masuit.Tools.Systems;
using SqlSugar;
namespace DS.WMS.Core.Fee.Dtos;
@ -41,9 +39,8 @@ public class FeeTemplateDetailRes
/// <summary>
/// 客户类型
/// </summary>
public CustomerTypeEnum? CustomerType { get; set; }
public string CustomerTypeText { get { return CustomerType.HasValue ? CustomerType.Value.GetDescription() : string.Empty; } }
public string CustomerType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>

@ -43,8 +43,8 @@ namespace DS.WMS.Core.Fee.Entity
/// <summary>
/// 客户类型
/// </summary>
[SugarColumn(ColumnDescription = "客户类型", IsNullable = true)]
public CustomerTypeEnum? CustomerType { get; set; }
[SugarColumn(ColumnDescription = "客户类型", IsNullable = true, Length = 50)]
public string CustomerType { get; set; }
/// <summary>
/// 收付类型(收、付)
/// </summary>

@ -9,6 +9,7 @@ using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Entity;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
@ -87,6 +88,18 @@ namespace DS.WMS.Core.Fee.Method
return new DataResult<List<FeeRecord>>(ResultCode.Success) { Data = data };
}
/// <summary>
/// 检查业务是否已费用锁定
/// </summary>
/// <param name="bid">业务ID</param>
/// <returns></returns>
bool IsFeeLocked(long bid)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var entity = tenantDb.Queryable<SeaExport>().Where(x => x.Id == bid).Select(x => new { x.IsFeeLocking }).First();
return entity == null ? false : entity.IsFeeLocking.GetValueOrDefault();
}
/// <summary>
/// 提交
/// </summary>
@ -96,6 +109,10 @@ namespace DS.WMS.Core.Fee.Method
public DataResult InsertOrUpdate(long bid, IEnumerable<FeeRecord> items)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (IsFeeLocked(bid))
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
try
{
tenantDb.Ado.BeginTran();
@ -264,6 +281,10 @@ namespace DS.WMS.Core.Fee.Method
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var bid = tenantDb.Queryable<FeeRecord>().Where(x => ids.Contains(x.Id)).Select(x => x.BusinessId).First();
if (IsFeeLocked(bid))
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
if (tenantDb.Queryable<FeeRecord>().Any(x => ids.Contains(x.Id) && (x.FeeStatus != FeeStatus.Entering || x.FeeStatus != FeeStatus.AuditPassed)))
return DataResult.Failed("只能删除状态为‘录入’或‘审核通过’的费用", MultiLanguageConst.FeeRecordDelete);
@ -285,11 +306,15 @@ namespace DS.WMS.Core.Fee.Method
Id = x.Id,
FeeName = x.FeeName,
FeeStatus = x.FeeStatus,
FlowId = x.FlowId
FlowId = x.FlowId,
BusinessId = x.BusinessId
}).ToList();
if (fees.IsNullOrEmpty())
return DataResult.Failed($"未能获取费用信息,提交失败", MultiLanguageConst.Operation_Failed);
if (IsFeeLocked(fees[0].BusinessId))
return DataResult.Failed("当前业务已费用锁定,禁止修改", MultiLanguageConst.Operation_Failed);
if (fees.Any(x => x.FlowId.HasValue))
return DataResult.Failed($"当前费用包含正在审批中的费用,无法提交", MultiLanguageConst.Operation_Failed);
@ -506,7 +531,7 @@ namespace DS.WMS.Core.Fee.Method
/// </summary>
/// <param name="auditType">审批类型</param>
/// <returns></returns>
public FlowTemplateTenant FindTemplate(string auditType)
FlowTemplateTenant FindTemplate(string auditType)
{
return db.Queryable<FlowTemplateTenant>().Where(x =>
x.Status == StatusEnum.Enable &&

@ -16,7 +16,6 @@ namespace DS.WMS.FeeApi.Controllers
/// </summary>
public class FeeRecordController : ApiController
{
readonly IFeeRecordService _feeService;
readonly IClientFlowInstanceService _flowService;

@ -404,3 +404,24 @@
2024-05-24 15:37:13.5670 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-05-24 15:37:13.5670 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 15:37:13.5670 Info Configuration initialized.
2024-05-24 17:08:50.3229 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-24 17:08:50.3535 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-24 17:08:50.3535 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-24 17:08:50.3749 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-24 17:08:50.3841 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-05-24 17:08:50.3841 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 17:08:50.3977 Info Configuration initialized.
2024-05-24 17:48:39.5150 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-24 17:48:39.5301 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-24 17:48:39.5301 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-24 17:48:39.5470 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-24 17:48:39.5531 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-05-24 17:48:39.5531 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 17:48:39.5531 Info Configuration initialized.
2024-05-24 17:54:30.1932 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-24 17:54:30.1932 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-24 17:54:30.2068 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-24 17:54:30.2068 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-05-24 17:54:30.2256 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-05-24 17:54:30.2256 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-24 17:54:30.2256 Info Configuration initialized.

Loading…
Cancel
Save