工作票外包

This commit is contained in:
何美荣 2024-04-10 10:20:49 +08:00
parent 62b8ea8da7
commit c2aa7deb79

View File

@ -320,21 +320,32 @@ namespace APT.FO.WebApi.Controllers
if (appdetails != null && appdetails.Any())//curentApprove == null if (appdetails != null && appdetails.Any())//curentApprove == null
{ {
var sendUserIds = new List<Guid>(); var sendUserIds = new List<Guid>();
//var curentApprove = appdetails.FirstOrDefault(i => i.NUM == appdetails.Min(x => x.NUM) && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing); var curentApprove = appdetails.FirstOrDefault(i => i.APPROVE_USER_ID == applyUserId);
if (curentApprove != null)
{
var removeApprove = appdetails.Where(i => i.NUM < curentApprove.NUM && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing);
if (removeApprove != null && removeApprove.Any())
{
foreach (var item in removeApprove)
{
appdetails.Remove(item);
}
}
}
var detailTemps = appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ToList(); var detailTemps = appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ToList();
if (detailTemps != null && detailTemps.Any()) if (detailTemps != null && detailTemps.Any())
{ {
appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ForEach(i => i.IS_CURRENT = true); appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ForEach(i => i.IS_CURRENT = true);
sendUserIds = appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId).Select(t => (Guid)t.APPROVE_USER_ID).ToList(); sendUserIds = appdetails.Where(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID != applyUserId).Select(t => (Guid)t.APPROVE_USER_ID).ToList();
} }
else //else
{ //{
var appdetailsAll = appdetails; // var appdetailsAll = appdetails;
var removeTemps = appdetailsAll.FirstOrDefault(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID == applyUserId); // var removeTemps = appdetailsAll.FirstOrDefault(i => i.NUM == appdetails.Min(x => x.NUM) && i.APPROVE_USER_ID == applyUserId);
appdetailsAll.Remove(removeTemps); // appdetailsAll.Remove(removeTemps);
appdetails.Where(i => i.NUM == appdetailsAll.Min(x => x.NUM) && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ForEach(i => i.IS_CURRENT = true); // appdetails.Where(i => i.NUM == appdetailsAll.Min(x => x.NUM) && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).ForEach(i => i.IS_CURRENT = true);
sendUserIds = appdetails.Where(i => i.NUM == appdetailsAll.Min(x => x.NUM) && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).Select(t => (Guid)t.APPROVE_USER_ID).ToList(); // sendUserIds = appdetails.Where(i => i.NUM == appdetailsAll.Min(x => x.NUM) && i.NODE_APPROVE_STATUS == (int)NodeApproveStatus.Doing).Select(t => (Guid)t.APPROVE_USER_ID).ToList();
} //}
if (sendUserIds != null && sendUserIds.Any()) if (sendUserIds != null && sendUserIds.Any())
{ {
var sendUserNames = new List<string>(); var sendUserNames = new List<string>();