bug修复

usertest
嵇文龙 7 months ago
parent 768d48b56f
commit f09b649d37

@ -63,9 +63,9 @@ public interface IFeeRecordService
/// <summary> /// <summary>
/// 撤销审批 /// 撤销审批
/// </summary> /// </summary>
/// <param name="idArray">费用记录ID</param> /// <param name="ids">费用记录ID</param>
/// <returns></returns> /// <returns></returns>
DataResult Withdraw(params long[] idArray); DataResult Withdraw(params long[] ids);
/// <summary> /// <summary>
/// 根据审批结果更新审批状态 /// 根据审批结果更新审批状态

@ -254,16 +254,16 @@ namespace DS.WMS.Core.Fee.Method
/// 根据模板ID创建 /// 根据模板ID创建
/// </summary> /// </summary>
/// <param name="bid">业务ID</param> /// <param name="bid">业务ID</param>
/// <param name="type">业务类型</param> /// <param name="businessType">业务类型</param>
/// <param name="tidArray">模板ID</param> /// <param name="tidArray">模板ID</param>
/// <returns></returns> /// <returns></returns>
public DataResult CreateByTemplate(long bid, BusinessType type, params long[] tidArray) public DataResult CreateByTemplate(long bid, BusinessType businessType, params long[] tidArray)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
bool hasExists = tenantDb.Queryable<FeeRecord>().LeftJoin<FeeTemplateDetail>((x, y) => bool hasExists = tenantDb.Queryable<FeeRecord>().LeftJoin<FeeTemplateDetail>((x, y) =>
x.FeeId == y.FeeId && x.FeeType == y.FeeType).Any((x, y) => x.FeeId == y.FeeId && x.FeeType == y.FeeType).Any((x, y) =>
x.BusinessId == bid && tidArray.Contains(y.TemplateId) && !y.Deleted); x.BusinessId == bid && x.BusinessType == businessType && tidArray.Contains(y.TemplateId) && !y.Deleted);
if (hasExists) if (hasExists)
return DataResult.Failed("费用记录已存在", MultiLanguageConst.FeeRecordExist); return DataResult.Failed("费用记录已存在", MultiLanguageConst.FeeRecordExist);
@ -306,23 +306,11 @@ namespace DS.WMS.Core.Fee.Method
int result = tenantDb.Insertable(records).ExecuteCommand(); int result = tenantDb.Insertable(records).ExecuteCommand();
WriteBackStatus(tenantDb, bid, type); WriteBackStatus(tenantDb, bid, businessType);
return result > 0 ? DataResult.Successed("保存成功", records, MultiLanguageConst.DataCreateSuccess) : DataResult.Successed("操作失败!", MultiLanguageConst.Operation_Failed); return result > 0 ? DataResult.Successed("保存成功", records, MultiLanguageConst.DataCreateSuccess) : DataResult.Successed("操作失败!", MultiLanguageConst.Operation_Failed);
} }
/// <summary>
/// 根据费用明细转换为模板明细
/// </summary>
/// <param name="idArray">费用明细ID</param>
/// <returns></returns>
public DataResult<List<FeeTemplateDetailRes>> ReadAsTemplate(params long[] idArray)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select<FeeTemplateDetailRes>().ToList();
return new DataResult<List<FeeTemplateDetailRes>>(ResultCode.Success) { Data = list };
}
/// <summary> /// <summary>
/// 删除 /// 删除
/// </summary> /// </summary>
@ -355,14 +343,15 @@ namespace DS.WMS.Core.Fee.Method
public DataResult SubmitForApproval(FeeAuditType auditType, params long[] idArray) public DataResult SubmitForApproval(FeeAuditType auditType, params long[] idArray)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var fees = tenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(x => new FeeRecord var fees = tenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(
{ x => new FeeRecord
Id = x.Id, {
FeeName = x.FeeName, Id = x.Id,
FeeStatus = x.FeeStatus, FeeName = x.FeeName,
FlowId = x.FlowId, FeeStatus = x.FeeStatus,
BusinessId = x.BusinessId FlowId = x.FlowId,
}).ToList(); BusinessId = x.BusinessId
}).ToList();
if (fees.IsNullOrEmpty()) if (fees.IsNullOrEmpty())
return DataResult.Failed($"未能获取费用信息,提交失败", MultiLanguageConst.Operation_Failed); return DataResult.Failed($"未能获取费用信息,提交失败", MultiLanguageConst.Operation_Failed);
@ -511,9 +500,10 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns> /// <returns></returns>
public DataResult SubmitForModification(IEnumerable<FeeModification> items) public DataResult SubmitForModification(IEnumerable<FeeModification> items)
{ {
var bizType = items.FirstOrDefault()?.BusinessType;
var idList = items.Select(x => x.FeeRecordId).Distinct().ToList(); var idList = items.Select(x => x.FeeRecordId).Distinct().ToList();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var fees = tenantDb.Queryable<FeeRecord>().Where(x => idList.Contains(x.Id)).Select(x => new FeeRecord var fees = tenantDb.Queryable<FeeRecord>().Where(x => idList.Contains(x.Id) && x.BusinessType == bizType).Select(x => new FeeRecord
{ {
Id = x.Id, Id = x.Id,
FeeName = x.FeeName, FeeName = x.FeeName,
@ -589,14 +579,19 @@ namespace DS.WMS.Core.Fee.Method
BusinessFeeStatus businessFee = null; BusinessFeeStatus businessFee = null;
if (auditType == FeeAuditType.Business) if (auditType == FeeAuditType.Business)
{ {
businessFee = tenantDb.Queryable<BusinessFeeStatus>().Where(x => x.Id == callback.BusinessId).Select( businessFee = tenantDb.Queryable<BusinessFeeStatus>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType)
x => new BusinessFeeStatus { Id = x.Id, BusinessId = x.BusinessId, BillAuditStatus = x.BillAuditStatus }).First(); .Select(x => new BusinessFeeStatus
{
Id = x.Id,
BusinessId = x.BusinessId,
BillAuditStatus = x.BillAuditStatus
}).First();
if (businessFee == null) if (businessFee == null)
return DataResult.Failed("未能找到业务信息,更新状态失败", MultiLanguageConst.Operation_Failed); return DataResult.Failed("未能找到业务信息,更新状态失败", MultiLanguageConst.Operation_Failed);
} }
else else
{ {
fee = tenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId).Select( fee = tenantDb.Queryable<FeeRecord>().Where(x => x.Id == callback.BusinessId && x.BusinessType == callback.BusinessType).Select(
x => new FeeRecord { Id = x.Id, FeeStatus = x.FeeStatus }).First(); x => new FeeRecord { Id = x.Id, FeeStatus = x.FeeStatus }).First();
if (fee == null) if (fee == null)
return DataResult.Failed("未能找到费用记录,更新状态失败", MultiLanguageConst.Operation_Failed); return DataResult.Failed("未能找到费用记录,更新状态失败", MultiLanguageConst.Operation_Failed);
@ -636,9 +631,6 @@ namespace DS.WMS.Core.Fee.Method
//申请修改审核成功需要回填费用信息 //申请修改审核成功需要回填费用信息
if (callback.FlowStatus == FlowStatusEnum.Approve) if (callback.FlowStatus == FlowStatusEnum.Approve)
{ {
fee.FeeStatus = FeeStatus.AuditPassed;
fee.Reason = string.Empty;
var fm = tenantDb.Queryable<FeeModification>().Where(x => x.FeeRecordId == fee.Id).OrderByDescending(x => x.CreateTime).First(); var fm = tenantDb.Queryable<FeeModification>().Where(x => x.FeeRecordId == fee.Id).OrderByDescending(x => x.CreateTime).First();
if (fm == null) if (fm == null)
return DataResult.Failed("未找到费用修改信息,更新失败", MultiLanguageConst.Operation_Failed); return DataResult.Failed("未找到费用修改信息,更新失败", MultiLanguageConst.Operation_Failed);
@ -648,6 +640,10 @@ namespace DS.WMS.Core.Fee.Method
entity.Reason = callback.RejectReason; entity.Reason = callback.RejectReason;
fee = entity; fee = entity;
//全表更新
tenantDb.Updateable(fee).ExecuteCommand();
//逻辑删除暂存数据
fm.Deleted = true; fm.Deleted = true;
fm.DeleteTime = DateTime.Now; fm.DeleteTime = DateTime.Now;
fm.DeleteBy = long.Parse(user.UserId); fm.DeleteBy = long.Parse(user.UserId);
@ -660,15 +656,17 @@ namespace DS.WMS.Core.Fee.Method
}).ExecuteCommand(); }).ExecuteCommand();
} }
else if (callback.FlowStatus == FlowStatusEnum.Reject) else if (callback.FlowStatus == FlowStatusEnum.Reject)
{
fee.FeeStatus = FeeStatus.RejectApplication; fee.FeeStatus = FeeStatus.RejectApplication;
tenantDb.Updateable(fee).UpdateColumns(x => new
{
x.Id,
x.FeeStatus,
x.Reason,
x.FlowId
}).ExecuteCommand();
}
tenantDb.Updateable(fee).UpdateColumns(x => new
{
x.Id,
x.FeeStatus,
x.Reason,
x.FlowId
}).ExecuteCommand();
break; break;
case FeeAuditType.ApplyDeletion: case FeeAuditType.ApplyDeletion:
if (callback.FlowStatus == FlowStatusEnum.Approve) if (callback.FlowStatus == FlowStatusEnum.Approve)
@ -752,13 +750,14 @@ namespace DS.WMS.Core.Fee.Method
public DataResult Withdraw(params long[] idArray) public DataResult Withdraw(params long[] idArray)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var fees = tenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(x => new FeeRecord var fees = tenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(
{ x => new FeeRecord
Id = x.Id, {
FeeName = x.FeeName, Id = x.Id,
FeeStatus = x.FeeStatus, FeeName = x.FeeName,
FlowId = x.FlowId FeeStatus = x.FeeStatus,
}).ToList(); FlowId = x.FlowId
}).ToList();
if (fees.IsNullOrEmpty()) if (fees.IsNullOrEmpty())
return DataResult.Failed("未能找到费用记录", MultiLanguageConst.Operation_Failed); return DataResult.Failed("未能找到费用记录", MultiLanguageConst.Operation_Failed);

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl> <_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-05-29T07:44:18.4051203Z||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History> <History>True|2024-05-30T08:18:06.9957657Z||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\Main</_PublishTargetUrl> <_PublishTargetUrl>D:\Publish\DS8\Main</_PublishTargetUrl>
<History>True|2024-05-30T01:30:24.9756841Z||;True|2024-05-29T17:46:22.9869679+08:00||;True|2024-05-29T17:20:28.9621862+08:00||;True|2024-05-29T17:18:16.4688274+08:00||;True|2024-05-29T16:33:42.5152962+08:00||;False|2024-05-29T16:33:09.8393409+08:00||;False|2024-05-29T16:31:07.7569208+08:00||;True|2024-05-28T18:00:39.2399003+08:00||;True|2024-05-28T08:47:53.8630073+08:00||;True|2024-05-23T17:51:45.6784172+08:00||;True|2024-05-21T17:32:52.9294009+08:00||;</History> <History>True|2024-05-30T08:18:14.8047074Z||;True|2024-05-30T09:30:24.9756841+08:00||;True|2024-05-29T17:46:22.9869679+08:00||;True|2024-05-29T17:20:28.9621862+08:00||;True|2024-05-29T17:18:16.4688274+08:00||;True|2024-05-29T16:33:42.5152962+08:00||;False|2024-05-29T16:33:09.8393409+08:00||;False|2024-05-29T16:31:07.7569208+08:00||;True|2024-05-28T18:00:39.2399003+08:00||;True|2024-05-28T08:47:53.8630073+08:00||;True|2024-05-23T17:51:45.6784172+08:00||;True|2024-05-21T17:32:52.9294009+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save