|
|
|
@ -72,21 +72,25 @@ public class ClientFlowInstanceService : FlowInstanceService, IClientFlowInstanc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取指定类型的工作流实例
|
|
|
|
|
/// »ñÈ¡¹¤×÷Á÷ʵÀýÐÅÏ¢
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="businessId">业务ID</param>
|
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
|
/// <param name="type">模板类型</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult<FlowInstanceRes> GetFlowInstance(long businessId, BusinessType? businessType, string type)
|
|
|
|
|
public DataResult<List<FlowInstanceRes>> GetFlowInstances(long businessId, BusinessType? businessType)
|
|
|
|
|
{
|
|
|
|
|
var query = db.Queryable<FlowInstance>().Where(x => x.BusinessId == businessId && x.BusinessType == businessType && x.AuditType == type);
|
|
|
|
|
var query = db.Queryable<FlowInstance>().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<FlowInstanceRes>();
|
|
|
|
|
return DataResult<FlowInstanceRes>.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<List<FlowInstanceRes>>.Success(list.Select(x => x.Adapt<FlowInstanceRes>()).ToList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|