|
|
|
@ -884,7 +884,9 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
IsFeeLocking = x.IsFeeLocking,
|
|
|
|
|
BillAuditStatus = x.BillAuditStatus
|
|
|
|
|
BillAuditStatus = x.BillAuditStatus,
|
|
|
|
|
ARFeeStatus = x.ARFeeStatus,
|
|
|
|
|
APFeeStatus = x.APFeeStatus
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (entity == null)
|
|
|
|
@ -954,19 +956,35 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
FeeType feeType = default;
|
|
|
|
|
//变更状态为提交审核
|
|
|
|
|
if (taskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
entity.BillAuditStatus = BillAuditStatus.RecvSubmitted;
|
|
|
|
|
entity.ARFeeStatus = BillFeeStatus.AuditSubmitted;
|
|
|
|
|
feeType = FeeType.Receivable;
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
x.ARFeeStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
entity.BillAuditStatus = BillAuditStatus.PaySubmitted;
|
|
|
|
|
entity.APFeeStatus = BillFeeStatus.AuditSubmitted;
|
|
|
|
|
feeType = FeeType.Payable;
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
x.APFeeStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改关联费用状态为提交审核
|
|
|
|
|
await TenantDb.Updateable<FeeRecord>().Where(x => x.BusinessId == entity.BusinessId && x.BusinessType == entity.BusinessType &&
|
|
|
|
|
await TenantDb.Updateable<FeeRecord>().Where(x => x.BusinessId == bid && x.BusinessType == type && x.FeeType == feeType &&
|
|
|
|
|
(x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.Withdraw || x.FeeStatus == FeeStatus.RejectSubmission))
|
|
|
|
|
.SetColumns(x => x.FeeStatus == FeeStatus.AuditSubmitted).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
@ -995,7 +1013,9 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
IsFeeLocking = x.IsFeeLocking,
|
|
|
|
|
BillAuditStatus = x.BillAuditStatus
|
|
|
|
|
BillAuditStatus = x.BillAuditStatus,
|
|
|
|
|
ARFeeStatus = x.ARFeeStatus,
|
|
|
|
|
APFeeStatus = x.APFeeStatus
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (entity == null)
|
|
|
|
@ -1006,12 +1026,14 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
if (taskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
if (entity.BillAuditStatus != BillAuditStatus.RecvSubmitted)
|
|
|
|
|
return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription()));
|
|
|
|
|
return DataResult.Failed(string.Format(
|
|
|
|
|
MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BusinessStatusError)), entity.BillAuditStatus.GetDescription()));
|
|
|
|
|
}
|
|
|
|
|
else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
if (entity.BillAuditStatus != BillAuditStatus.PaySubmitted)
|
|
|
|
|
return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription()));
|
|
|
|
|
return DataResult.Failed(string.Format(
|
|
|
|
|
MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BusinessStatusError)), entity.BillAuditStatus.GetDescription()));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1019,7 +1041,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.BeginTranAsync();
|
|
|
|
|
try
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DataResult result = DataResult.Success;
|
|
|
|
|
if (await billService.HasAuthorizedAsync())
|
|
|
|
@ -1042,16 +1064,37 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//变更状态为提交审核
|
|
|
|
|
FeeType feeType = default;
|
|
|
|
|
//变更状态为待提交
|
|
|
|
|
if (taskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
entity.BillAuditStatus = BillAuditStatus.Pending;
|
|
|
|
|
entity.ARFeeStatus = BillFeeStatus.Entering;
|
|
|
|
|
feeType = FeeType.Receivable;
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
x.ARFeeStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else if (taskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
{
|
|
|
|
|
entity.BillAuditStatus = BillAuditStatus.RecvPassed;
|
|
|
|
|
entity.APFeeStatus = BillFeeStatus.Entering;
|
|
|
|
|
feeType = FeeType.Payable;
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
x.APFeeStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改关联费用状态为录入状态
|
|
|
|
|
await TenantDb.Updateable<FeeRecord>().Where(x => x.BusinessId == bid && x.BusinessType == type && x.FeeType == feeType && x.FeeStatus == FeeStatus.AuditSubmitted)
|
|
|
|
|
.SetColumns(x => x.FeeStatus == FeeStatus.Entering).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.BillAuditStatus
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|