cjy 4 weeks ago
commit 1e1837b9ed

@ -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;
}

@ -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;
}

@ -39,9 +39,9 @@ namespace DS.WMS.Core.QuarztJobs.Method
return;
}
var orgauthlist = db.Queryable<SysOrgAuth>().ClearFilter().Where(t => t.Deleted == false && t.Type == Module.Core.Enums.OrgAuthTypeEnum.BankStatement).ToList();
var orgauthlist = db.Queryable<SysOrgAuth>().ClearFilter().Where(t => t.Deleted == false && t.Type == "BankStatement").ToList();
//遍历授权数据集
foreach (var item in orgauthlist)
{

@ -39,11 +39,11 @@ namespace DS.WMS.Core.QuarztJobs.Method
return;
}
var orgauthlist= db.Queryable<SysOrgAuth>().ClearFilter().Where(t => t.Deleted == false&&t.Type==OrgAuthTypeEnum.InInvoice).ToList();
var orgauthlist= db.Queryable<SysOrgAuth>().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<InInvoicePostOutput>(result);
if (!info.success)
continue;
if (info!=null&&info.Data.data!=null)
{
var dbLink = await db.Queryable<Module.SqlSugar.SysTenantLink>().ClearFilter().Where(t => t.TenantId == item.TenantId).FirstAsync();
@ -197,7 +199,7 @@ namespace DS.WMS.Core.QuarztJobs.Method
try
{
#region 同步发票到钉钉审批
var dingconfig = db.Queryable<SysOrgAuth>().Where(t => t.Type == OrgAuthTypeEnum.DingConfig &&t.OrgId==item.OrgId).First();
var dingconfig = db.Queryable<SysOrgAuth>().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<InInvoice>().Where(x => x.ReimbursementType == ReimbursementTypeEnums.NotSubmitted && x.OrgId == item.OrgId).ToListAsync();
//将发票信息同步更新到钉钉
var DingProcess = db.Queryable<SysOrgAuth>().Where(t => t.Type == OrgAuthTypeEnum.DingProcessCode && t.OrgId == item.OrgId).First();
var DingProcess = db.Queryable<SysOrgAuth>().Where(t => t.Type == "DingProcessCode" && t.OrgId == item.OrgId).First();
DingDing.UpDingOAForm(token, DingProcess.Key, ininviceList);

@ -32,5 +32,20 @@ public class OrgAuthReq
/// </summary>
public string Secret { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Describe { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}

@ -27,4 +27,19 @@ public class OrgAuthRes
/// 密钥
/// </summary>
public string Secret { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Describe { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}

@ -22,7 +22,7 @@ namespace DS.WMS.Core.Sys.Entity
/// 类型
/// </summary>
public OrgAuthTypeEnum Type { get; set; }
public string Type { get; set; }
/// <summary>
/// 请求key
@ -32,5 +32,21 @@ namespace DS.WMS.Core.Sys.Entity
/// 密钥
/// </summary>
public string Secret { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Describe { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -43,13 +43,9 @@ public class SysOrgAuthService: IOrgAuthService
public DataResult<List<OrgAuthRes>> 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<SysOrgAuth>()
//.Where(whereList)
.Where(whereList)
.Select<OrgAuthRes>().ToQueryPage(request.PageCondition);
return data;
}

@ -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<BusinessFeeStatus>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType)
var biz = await TenantDb.Queryable<BusinessFeeStatus>().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();
}

Loading…
Cancel
Save