diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs index 1ad71fbd..4a4386d3 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs @@ -724,9 +724,9 @@ namespace DS.WMS.Core.Fee.Method await TenantDb.Ado.BeginTranAsync(); try { - if (await taskService.HasAuthorizedAsync()) + if (await billService.Value.HasAuthorizedAsync()) { - result = await taskService.AuditAsync(request); + result = await billService.Value.AuditAsync(request); if (!result.Succeeded) return result; } diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs index fd34e74f..275de348 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs @@ -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().Where(x => x.BusinessId == entity.BusinessId && x.BusinessType == entity.BusinessType && + await TenantDb.Updateable().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().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; } diff --git a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs index 85e70b62..1d54bf71 100644 --- a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs +++ b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/BankStatementService.cs @@ -39,9 +39,9 @@ namespace DS.WMS.Core.QuarztJobs.Method return; } - var orgauthlist = db.Queryable().ClearFilter().Where(t => t.Deleted == false && t.Type == Module.Core.Enums.OrgAuthTypeEnum.BankStatement).ToList(); + var orgauthlist = db.Queryable().ClearFilter().Where(t => t.Deleted == false && t.Type == "BankStatement").ToList(); + - //遍历授权数据集 foreach (var item in orgauthlist) { diff --git a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs index 464660a9..83bd4349 100644 --- a/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs +++ b/ds-wms-service/DS.WMS.Core/QuarztJobs/Method/InInvoiceService.cs @@ -39,11 +39,11 @@ namespace DS.WMS.Core.QuarztJobs.Method return; } - var orgauthlist= db.Queryable().ClearFilter().Where(t => t.Deleted == false&&t.Type==OrgAuthTypeEnum.InInvoice).ToList(); + var orgauthlist= db.Queryable().ClearFilter().Where(t => t.Deleted == false&&t.Type== "InInvoice").ToList(); + + + - - - //遍历授权数据集 foreach (var item in orgauthlist) { @@ -62,7 +62,9 @@ namespace DS.WMS.Core.QuarztJobs.Method //处理返回结果 var info= JsonConvert.DeserializeObject(result); - + if (!info.success) + continue; + if (info!=null&&info.Data.data!=null) { var dbLink = await db.Queryable().ClearFilter().Where(t => t.TenantId == item.TenantId).FirstAsync(); @@ -197,7 +199,7 @@ namespace DS.WMS.Core.QuarztJobs.Method try { #region 同步发票到钉钉审批 - var dingconfig = db.Queryable().Where(t => t.Type == OrgAuthTypeEnum.DingConfig &&t.OrgId==item.OrgId).First(); + var dingconfig = db.Queryable().Where(t => t.Type == "DingConfig" &&t.OrgId==item.OrgId).First(); if (dingconfig!=null) { @@ -206,7 +208,7 @@ namespace DS.WMS.Core.QuarztJobs.Method //获取对应的组织机构的发票列表 var ininviceList = await tenantDb.Queryable().Where(x => x.ReimbursementType == ReimbursementTypeEnums.NotSubmitted && x.OrgId == item.OrgId).ToListAsync(); //将发票信息同步更新到钉钉 - var DingProcess = db.Queryable().Where(t => t.Type == OrgAuthTypeEnum.DingProcessCode && t.OrgId == item.OrgId).First(); + var DingProcess = db.Queryable().Where(t => t.Type == "DingProcessCode" && t.OrgId == item.OrgId).First(); DingDing.UpDingOAForm(token, DingProcess.Key, ininviceList); diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthReq.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthReq.cs index c479d490..11d34012 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthReq.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthReq.cs @@ -32,5 +32,20 @@ public class OrgAuthReq /// public string Secret { get; set; } + /// + /// 描述 + /// + public string Describe { get; set; } + + /// + /// 状态 + /// + public string Status { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthRes.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthRes.cs index afce302b..c2b148b2 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthRes.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/OrgAuthRes.cs @@ -27,4 +27,19 @@ public class OrgAuthRes /// 密钥 /// public string Secret { get; set; } + + /// + /// 描述 + /// + public string Describe { get; set; } + + /// + /// 状态 + /// + public string Status { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysOrgAuth.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysOrgAuth.cs index b3135a97..8af716e8 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysOrgAuth.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysOrgAuth.cs @@ -22,7 +22,7 @@ namespace DS.WMS.Core.Sys.Entity /// 类型 /// - public OrgAuthTypeEnum Type { get; set; } + public string Type { get; set; } /// /// 请求key @@ -32,5 +32,21 @@ namespace DS.WMS.Core.Sys.Entity /// 密钥 /// public string Secret { get; set; } + + + /// + /// 描述 + /// + public string Describe { get; set; } + + /// + /// 状态 + /// + public string Status { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/SysOrgAuthService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/SysOrgAuthService.cs index 8ab617a6..f54db76f 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/SysOrgAuthService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/SysOrgAuthService.cs @@ -43,13 +43,9 @@ public class SysOrgAuthService: IOrgAuthService public DataResult> GetListByPage(PageRequest request) { //序列化查询条件 - if (!string.IsNullOrWhiteSpace(request.QueryCondition)) - { - //var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); - } - + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var data = db.Queryable() - //.Where(whereList) + .Where(whereList) .Select().ToQueryPage(request.PageCondition); return data; } diff --git a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs index 5c1537ed..bb036678 100644 --- a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/FeeBillTaskService.cs @@ -42,10 +42,12 @@ namespace DS.WMS.Core.TaskInteraction.Method if (auditType != TaskBaseTypeEnum.BILL_RECV_AUDIT && auditType != TaskBaseTypeEnum.BILL_PAY_AUDIT) return; - var biz = await TenantDb.Queryable().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType) + var biz = await TenantDb.Queryable().Where(x => x.BusinessId == callback.BusinessId && x.BusinessType == callback.BusinessType) .Select(x => new BusinessFeeStatus { Id = x.Id, + BusinessId = x.BusinessId, + BusinessType = x.BusinessType, BillAuditStatus = x.BillAuditStatus, BillFeeStatusTime = x.BillFeeStatusTime, ARFeeStatus = x.ARFeeStatus, @@ -87,7 +89,7 @@ namespace DS.WMS.Core.TaskInteraction.Method .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) + .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeType == FeeType.Receivable && x.FeeStatus == FeeStatus.AuditSubmitted) .ExecuteCommandAsync(); } else if (auditType == TaskBaseTypeEnum.BILL_PAY_AUDIT) @@ -118,7 +120,7 @@ namespace DS.WMS.Core.TaskInteraction.Method .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) + .Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeType == FeeType.Payable && x.FeeStatus == FeeStatus.AuditSubmitted) .ExecuteCommandAsync(); }