diff --git a/ds-wms-service/DS.WMS.Core/Flow/Interface/IClientFlowInstanceService.cs b/ds-wms-service/DS.WMS.Core/Flow/Interface/IClientFlowInstanceService.cs
index 5a89d8bc..c5969f87 100644
--- a/ds-wms-service/DS.WMS.Core/Flow/Interface/IClientFlowInstanceService.cs
+++ b/ds-wms-service/DS.WMS.Core/Flow/Interface/IClientFlowInstanceService.cs
@@ -69,5 +69,10 @@ public interface IClientFlowInstanceService
///
DataResult> GetFlowInstanceHistoryList(string id);
- DataResult GetFlowInstance(long businessId, BusinessType? businessType, string type);
+ ///
+ /// 工作流审批
+ ///
+ /// 工作流实例
+ ///
+ DataResult> GetFlowInstances(long businessId, BusinessType? businessType);
}
\ No newline at end of file
diff --git a/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs b/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
index 7f2c2b07..e76490dc 100644
--- a/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
+++ b/ds-wms-service/DS.WMS.Core/Flow/Method/ClientFlowInstanceService.cs
@@ -72,21 +72,25 @@ public class ClientFlowInstanceService : FlowInstanceService, IClientFlowInstanc
}
///
- /// ȡָ͵Ĺʵ
+ /// ȡʵϢ
///
/// ҵID
/// ҵ
- /// ģ
///
- public DataResult GetFlowInstance(long businessId, BusinessType? businessType, string type)
+ public DataResult> GetFlowInstances(long businessId, BusinessType? businessType)
{
- var query = db.Queryable().Where(x => x.BusinessId == businessId && x.BusinessType == businessType && x.AuditType == type);
+ var query = db.Queryable().Where(x => x.BusinessId == businessId && x.BusinessType == businessType && x.FlowStatus != 1);
if (businessType.HasValue)
query = query.Where(x => x.BusinessType == businessType.Value);
- var entity = query.OrderByDescending(x => x.CreateTime).Take(1).First();
- var result = entity == null ? null : entity.Adapt();
- return DataResult.Success(result);
+ var list = query.OrderBy(x => x.CreateTime).Select(x => new FlowInstance
+ {
+ Content = x.Content,
+ AuditType = x.AuditType,
+ CreateBy = x.CreateBy,
+ CreateTime = x.CreateTime
+ }).ToList();
+ return DataResult>.Success(list.Select(x => x.Adapt()).ToList());
}
///
diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientFlowInstanceController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientFlowInstanceController.cs
index 05b5a8b7..2b3a11b2 100644
--- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientFlowInstanceController.cs
+++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientFlowInstanceController.cs
@@ -122,10 +122,9 @@ public class ClientFlowInstanceController : ApiController
/// 流程类型
///
[HttpGet, Route("GetFlowContent")]
- public DataResult GetFlowContent([FromQuery] long businessId, [FromQuery] BusinessType? businessType, [FromQuery] AuditType type)
+ public DataResult> GetFlowContent([FromQuery] long businessId, [FromQuery] BusinessType? businessType)
{
- var res = _invokeService.GetFlowInstance(businessId, businessType, type.ToString());
- string? content = res.Data?.Content;
- return DataResult.Success(content ?? string.Empty);
+ var result = _invokeService.GetFlowInstances(businessId, businessType);
+ return result;
}
}
\ No newline at end of file