20221119优化出入经历

This commit is contained in:
2022-11-19 16:17:11 +08:00
parent 940df6ea3d
commit db59f0641b
3 changed files with 35 additions and 80 deletions
+29 -29
View File
@@ -273,37 +273,37 @@ namespace FineUIPro.Web.Person
}
info = "操作完成,共处理人员按身份证设置年龄" + countRecod.ToString() + "条。";
var getPPersons = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null
select x).Take(1000);
foreach (var pitem in getPPersons)
{
SitePerson_PersonItemService.SetPersonItemInOut(pitem);
pCountRecod++;
}
//var getPPersons = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
// where x.States == Const.ProjectPersonStates_1 && y.CurrentProjectId == null
// select x).Take(1000);
//foreach (var pitem in getPPersons)
//{
// SitePerson_PersonItemService.SetPersonItemInOut(pitem);
// pCountRecod++;
//}
if (pCountRecod == 0)
{
var getPPersons2 = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
where x.States == Const.ProjectPersonStates_0 && y.CurrentProjectId == null
select x).Take(1000);
foreach (var pitem2 in getPPersons2)
{
var getPersons = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == pitem2.PersonId);
if (getPersons != null)
{
getPersons.CurrentProjectId = pitem2.ProjectId;
getPersons.CurrentProjectRoleId = pitem2.RoleIds;
getPersons.CurrentProjectWorkPostId = pitem2.WorkPostId;
Funs.DB.SubmitChanges();
}
pCountRecod++;
}
}
//if (pCountRecod == 0)
//{
// var getPPersons2 = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
// where x.States == Const.ProjectPersonStates_0 && y.CurrentProjectId == null
// select x).Take(1000);
// foreach (var pitem2 in getPPersons2)
// {
// var getPersons = Funs.DB.Person_Persons.FirstOrDefault(x => x.PersonId == pitem2.PersonId);
// if (getPersons != null)
// {
// getPersons.CurrentProjectId = pitem2.ProjectId;
// getPersons.CurrentProjectRoleId = pitem2.RoleIds;
// getPersons.CurrentProjectWorkPostId = pitem2.WorkPostId;
// Funs.DB.SubmitChanges();
// }
// pCountRecod++;
// }
//}
info += "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。";
//info += "共处理人员所在当前项目取值" + pCountRecod.ToString() + "条。";
Alert.ShowInParent(info, MessageBoxIcon.Information);
}
}