20221119优化出入经历
This commit is contained in:
parent
940df6ea3d
commit
db59f0641b
|
|
@ -192,17 +192,12 @@ namespace BLL
|
|||
newitem.PersonName = getPerson.PersonName;
|
||||
newitem.IdentityCard = getPerson.IdentityCard;
|
||||
}
|
||||
var getPersonItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.PersonId == getPerson.PersonId && x.InTime <= newitem.InTime && x.OutTime > newitem.InTime);
|
||||
var getPersonItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.PersonId == getPerson.PersonId
|
||||
&& x.InTime <= newitem.InTime && (x.OutTime > newitem.InTime || !x.OutTime.HasValue));
|
||||
if (getPersonItem != null)
|
||||
{
|
||||
if (newitem.OutTime.HasValue)
|
||||
{
|
||||
if ((getPersonItem.OutTime.HasValue && newitem.OutTime > getPersonItem.OutTime) || !getPersonItem.OutTime.HasValue)
|
||||
{
|
||||
getPersonItem.OutTime = newitem.OutTime.Value;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
getPersonItem.OutTime = null;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -213,8 +208,8 @@ namespace BLL
|
|||
PersonName = newitem.PersonName,
|
||||
IdentityCard = newitem.IdentityCard,
|
||||
InTime = newitem.InTime,
|
||||
OutTime = newitem.OutTime,
|
||||
OutResult = newitem.OutResult,
|
||||
// OutTime = newitem.OutTime,
|
||||
// OutResult = newitem.OutResult,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(newitem.ProjectId))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
错误信息开始=====>
|
||||
错误类型:NullReferenceException
|
||||
错误信息:未将对象引用设置到对象的实例。
|
||||
错误堆栈:
|
||||
在 FineUIPro.Web.HJGL.WeldingManage.WeldingPlan.Page_Load(Object sender, EventArgs e) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\WeldingPlan.aspx.cs:行号 18
|
||||
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
|
||||
在 System.EventHandler.Invoke(Object sender, EventArgs e)
|
||||
在 System.Web.UI.Control.OnLoad(EventArgs e)
|
||||
在 System.Web.UI.Control.LoadRecursive()
|
||||
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
||||
出错时间:11/16/2022 19:30:50
|
||||
出错文件:http://localhost:14901/HJGL/WeldingManage/WeldingPlan.aspx
|
||||
IP地址:::1
|
||||
|
||||
出错时间:11/16/2022 19:30:50
|
||||
|
||||
|
||||
|
||||
错误信息开始=====>
|
||||
错误类型:FormatException
|
||||
错误信息:该字符串未被识别为有效的 DateTime。
|
||||
错误堆栈:
|
||||
在 System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
|
||||
在 System.Convert.ToDateTime(String value)
|
||||
在 BLL.PipelineService.GetStateByPipelineId(String pipelineId) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\WeldingManage\PipelineService.cs:行号 75
|
||||
在 FineUIPro.Web.HJGL.WeldingManage.WeldingPlan.btnUpDateState_Click(Object sender, EventArgs e)
|
||||
在 FineUIPro.Button.OnClick(EventArgs e)
|
||||
在 (Button , EventArgs )
|
||||
在 FineUIPro.Button.RaisePostBackEvent(String eventArgument)
|
||||
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
|
||||
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
|
||||
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
||||
出错时间:11/16/2022 19:35:57
|
||||
出错文件:http://localhost:14901/HJGL/WeldingManage/WeldingPlan.aspx
|
||||
IP地址:::1
|
||||
操作人员:JT
|
||||
|
||||
出错时间:11/16/2022 19:35:57
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue