using Hotline.Share.Dtos.File; using Hotline.Share.Dtos.FlowEngine; using Hotline.Share.Enums.Order; using Hotline.Share.Requests; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XF.Utility.EnumExtensions; namespace Hotline.Share.Dtos.Order { public class AuditSendBackDto { public string Id { get; set; } /// /// 审核结果 /// public ESendBackAuditState State { get; set; } /// /// 审核意见 /// public string? AuditContent { get; set; } /// /// 是否允许再次退回 /// public bool? IsReturnAgain { get; set; } } public class BatchAuditSendBackDto : AuditSendBackDto { public List Ids { get; set; } } public class SendBackDto : SendBackBaseDto { /// /// 工单ID /// public string OrderId { get; set; } /// /// 退回原因 /// public string? Content { get; set; } /// /// 审批意见 /// public string? AuditContent { get; set; } /// /// 工单 /// public OrderDto Order { get; set; } /// /// 退回数据 /// public PreviousWorkflowDto SendBackData { get; set; } /// /// 审批人ID /// public string? AuditId { get; set; } public string? AuditUser { get; set; } /// /// 申请部门ID /// public string ApplyOrgId { get; set; } /// /// 申请部门名称 /// public string ApplyOrgName { get; set; } /// /// 退回部门ID /// public string SendBackOrgId { get; set; } /// /// 退回部门名称 /// public string SendBackOrgName { get; set; } /// /// 审核结果 0 待审核 1 审核通过 2 审核不通过 /// public ESendBackAuditState State { get; set; } public string StateText => State.GetDescription(); /// /// 退回节点名称 /// public string? SendBackStepName { get; set; } /// /// 退回节点创建时间 /// public DateTime? WorkflowStepSendBackCrTime { get; set; } /// /// 退回时差 /// public double SendBackTimeDifference => GetSendBackTimeDifference(); public double GetSendBackTimeDifference() { if (WorkflowStepSendBackCrTime.HasValue) { TimeSpan? timeDifference = CreationTime - WorkflowStepSendBackCrTime; return Math.Round(timeDifference.Value.TotalMinutes / 60, 1); } return 0; } public bool IsReturnAgainShow => ApplyOrgId != "001" && SendBackOrgId == "001"; /// /// 附件列表 /// public List Files { get; set; } = new(); } public class SendBackBaseDto { public DateTime? LastModificationTime { get; set; } public bool IsDeleted { get; set; } /// /// 删除时间 /// public DateTime? DeletionTime { get; set; } /// /// 创建时间 /// public DateTime CreationTime { get; set; } public string Id { get; set; } /// /// 组织Id /// public string? CreatorOrgId { get; set; } public string? CreatorOrgName { get; set; } /// /// 创建人 /// public string? CreatorId { get; set; } public string? CreatorName { get; set; } } public record SendBackListDto : PagedKeywordRequest { /// /// public ESendBackAuditState? State { get; set; } /// /// 1 待办 2 已办 3全部 /// public int AuditState { get; set; } /// /// 0 全部 1 我的 /// public int? DataScope { get; set; } /// /// 工单标题 /// public string Title { get; set; } /// /// 工单编号 /// public string No { get; set; } /// /// 受理类型 /// public string? AcceptTypeCode { get; set; } /// /// 申请部门 /// public string? OrgName { get; set; } } }