|
|
@ -727,7 +727,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
if (await taskService.HasAuthorizedAsync())
|
|
|
|
if (await taskService.HasAuthorizedAsync())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result = await taskService.AuditAsync(request);
|
|
|
|
result = await taskService.AuditAsync(request);
|
|
|
|
|
|
|
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
if (!result.Succeeded)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -751,28 +750,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//long userId = long.Parse(User.UserId);
|
|
|
|
|
|
|
|
//entity.BillFeeStatusTime = DateTime.Now;
|
|
|
|
|
|
|
|
////变更状态为提交审核
|
|
|
|
|
|
|
|
//if (request.TaskType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
|
|
|
|
|
|
|
|
// entity.BillAuditStatus = BillAuditStatus.RecvPassed;
|
|
|
|
|
|
|
|
//else if (request.TaskType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
|
|
|
// entity.BillAuditStatus = BillAuditStatus.PayPassed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//await TenantDb.Updateable(entity).UpdateColumns(x => new
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// x.BillAuditStatus,
|
|
|
|
|
|
|
|
// x.BillFeeStatusTime
|
|
|
|
|
|
|
|
//}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////修改关联费用状态为审核完成
|
|
|
|
|
|
|
|
//await TenantDb.Updateable<FeeRecord>().Where(x => x.BusinessId == entity.BusinessId && x.BusinessType == entity.BusinessType && x.FeeStatus == FeeStatus.AuditSubmitted)
|
|
|
|
|
|
|
|
//.SetColumns(x => x.FeeStatus == FeeStatus.AuditPassed)
|
|
|
|
|
|
|
|
//.SetColumns(x => x.AuditBy == userId)
|
|
|
|
|
|
|
|
//.SetColumns(x => x.AuditOperator == User.UserName)
|
|
|
|
|
|
|
|
//.SetColumns(x => x.AuditDate == entity.BillFeeStatusTime)
|
|
|
|
|
|
|
|
//.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -807,25 +784,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
public async Task<DataResult> UpdateStatusAsync(FlowCallback callback)
|
|
|
|
public async Task<DataResult> UpdateStatusAsync(FlowCallback callback)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var auditType = callback.AuditType;
|
|
|
|
var auditType = callback.AuditType;
|
|
|
|
FeeRecord? fee = null;
|
|
|
|
FeeRecord? fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId).Select(
|
|
|
|
BusinessFeeStatus? biz = null;
|
|
|
|
|
|
|
|
if (auditType == TaskBaseTypeEnum.BILL_RECV_AUDIT || auditType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
biz = await TenantDb.Queryable<BusinessFeeStatus>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType)
|
|
|
|
|
|
|
|
.Select(x => new BusinessFeeStatus
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
|
|
|
BillAuditStatus = x.BillAuditStatus,
|
|
|
|
|
|
|
|
BillFeeStatusTime = x.BillFeeStatusTime,
|
|
|
|
|
|
|
|
ARFeeStatus = x.ARFeeStatus,
|
|
|
|
|
|
|
|
APFeeStatus = x.APFeeStatus
|
|
|
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
|
|
|
if (biz == null)
|
|
|
|
|
|
|
|
return DataResult.Failed(MultiLanguageConst.EmptyData);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fee = await TenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId).Select(
|
|
|
|
|
|
|
|
x => new FeeRecord
|
|
|
|
x => new FeeRecord
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = x.Id,
|
|
|
|
Id = x.Id,
|
|
|
@ -837,8 +796,6 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
return DataResult.Failed(MultiLanguageConst.EmptyData);
|
|
|
|
return DataResult.Failed(MultiLanguageConst.EmptyData);
|
|
|
|
|
|
|
|
|
|
|
|
fee.Reason = callback.RejectReason;
|
|
|
|
fee.Reason = callback.RejectReason;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
DateTime dtNow = DateTime.Now;
|
|
|
|
DateTime dtNow = DateTime.Now;
|
|
|
|
await TenantDb.Ado.BeginTranAsync();
|
|
|
|
await TenantDb.Ado.BeginTranAsync();
|
|
|
@ -940,78 +897,8 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (auditType == TaskBaseTypeEnum.BILL_RECV_AUDIT)
|
|
|
|
await feeService.WriteBackStatusAsync(fee.BusinessId, fee.BusinessType);
|
|
|
|
{
|
|
|
|
|
|
|
|
FeeStatus status = FeeStatus.RejectSubmission;
|
|
|
|
|
|
|
|
if (callback.FlowStatus == FlowStatusEnum.Approve)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
biz.BillAuditStatus = BillAuditStatus.RecvPassed;
|
|
|
|
|
|
|
|
biz.ARFeeStatus = BillFeeStatus.AuditPassed;
|
|
|
|
|
|
|
|
status = FeeStatus.AuditPassed;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (callback.FlowStatus == FlowStatusEnum.Reject)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
biz.BillAuditStatus = BillAuditStatus.RecvRejected;
|
|
|
|
|
|
|
|
biz.ARFeeStatus = BillFeeStatus.RejectSubmission;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
biz.BillFeeStatusTime = dtNow;
|
|
|
|
|
|
|
|
await TenantDb.Updateable(biz).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
|
|
|
x.BillFeeStatusTime,
|
|
|
|
|
|
|
|
x.ARFeeStatus
|
|
|
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable<FeeRecord>()
|
|
|
|
|
|
|
|
.SetColumns(x => x.FeeStatus == status)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditBy == userId)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditOperator == User.UserName)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditDate == dtNow)
|
|
|
|
|
|
|
|
.Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeStatus == FeeStatus.AuditSubmitted)
|
|
|
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (auditType == TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FeeStatus status = FeeStatus.RejectSubmission;
|
|
|
|
|
|
|
|
if (callback.FlowStatus == FlowStatusEnum.Approve)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
biz.BillAuditStatus = BillAuditStatus.PayPassed;
|
|
|
|
|
|
|
|
biz.APFeeStatus = BillFeeStatus.AuditPassed;
|
|
|
|
|
|
|
|
status = FeeStatus.AuditPassed;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (callback.FlowStatus == FlowStatusEnum.Reject)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
biz.BillAuditStatus = BillAuditStatus.PayRejected;
|
|
|
|
|
|
|
|
biz.APFeeStatus = BillFeeStatus.RejectSubmission;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
biz.BillFeeStatusTime = dtNow;
|
|
|
|
|
|
|
|
await TenantDb.Updateable(biz).UpdateColumns(x => new
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
x.BillAuditStatus,
|
|
|
|
|
|
|
|
x.BillFeeStatusTime,
|
|
|
|
|
|
|
|
x.APFeeStatus
|
|
|
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable<FeeRecord>()
|
|
|
|
|
|
|
|
.SetColumns(x => x.FeeStatus == status)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditBy == userId)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditOperator == User.UserName)
|
|
|
|
|
|
|
|
.SetColumns(x => x.AuditDate == dtNow)
|
|
|
|
|
|
|
|
.Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeStatus == FeeStatus.AuditSubmitted)
|
|
|
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
|
|
|
|
|
|
|
|
if (auditType != TaskBaseTypeEnum.BILL_RECV_AUDIT && auditType != TaskBaseTypeEnum.BILL_PAY_AUDIT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await feeService.WriteBackStatusAsync(
|
|
|
|
|
|
|
|
biz != null ? biz.BusinessId : fee.BusinessId,
|
|
|
|
|
|
|
|
biz != null ? biz.BusinessType : fee.BusinessType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Success;
|
|
|
|
return DataResult.Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|