This commit is contained in:
@@ -198,22 +198,29 @@ namespace BLL
|
||||
{
|
||||
for (int i = 0; i < j2.data.Count; i++)
|
||||
{
|
||||
var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
|
||||
if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
|
||||
try
|
||||
{
|
||||
string deviceSerial = Convert.ToString(msg.deviceSerial);
|
||||
string employeeNo = Convert.ToString(msg.employeeNo);
|
||||
DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
|
||||
var devices = db.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
|
||||
Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
|
||||
var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
|
||||
if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
|
||||
{
|
||||
ProjectId = devices.ProjectId,
|
||||
IdentityCard = employeeNo,
|
||||
IsIn = true,
|
||||
ChangeTime = dateTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
};
|
||||
InsertInOut(newInOut);
|
||||
string deviceSerial = Convert.ToString(msg.deviceSerial);
|
||||
string employeeNo = Convert.ToString(msg.employeeNo);
|
||||
DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
|
||||
var devices = db.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
|
||||
Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
|
||||
{
|
||||
ProjectId = devices.ProjectId,
|
||||
IdentityCard = employeeNo,
|
||||
IsIn = true,
|
||||
ChangeTime = dateTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
};
|
||||
InsertInOut(newInOut);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ErrLogInfo.WriteLog(e.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -235,29 +242,36 @@ namespace BLL
|
||||
{
|
||||
for (int i = 0; i < j2.data.Count; i++)
|
||||
{
|
||||
var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
|
||||
if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
|
||||
try
|
||||
{
|
||||
string deviceSerial = Convert.ToString(msg.deviceSerial);
|
||||
string employeeNo = Convert.ToString(msg.employeeNo);
|
||||
DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
|
||||
|
||||
var devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
|
||||
//身份证号时
|
||||
if (employeeNo.Length == 18)
|
||||
var msg = JsonConvert.DeserializeObject(j2.data[i]["content"].ToString());
|
||||
if (!string.IsNullOrEmpty(Convert.ToString(msg.employeeNo)))
|
||||
{
|
||||
Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
|
||||
{
|
||||
ProjectId = devices.ProjectId,
|
||||
IdentityCard = employeeNo,
|
||||
IsIn = true,
|
||||
ChangeTime = dateTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
};
|
||||
InsertInOut(newInOut);
|
||||
string deviceSerial = Convert.ToString(msg.deviceSerial);
|
||||
string employeeNo = Convert.ToString(msg.employeeNo);
|
||||
DateTime dateTime = Convert.ToDateTime(Convert.ToString(msg.dateTime));
|
||||
|
||||
var devices = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceSerial == deviceSerial);
|
||||
//身份证号时
|
||||
// if (employeeNo.Length == 18)
|
||||
{
|
||||
Model.SitePerson_PersonInOut newInOut = new Model.SitePerson_PersonInOut
|
||||
{
|
||||
ProjectId = devices.ProjectId,
|
||||
IdentityCard = employeeNo,
|
||||
IsIn = true,
|
||||
ChangeTime = dateTime,
|
||||
InOutWay = Const.InOutWay_1,
|
||||
};
|
||||
InsertInOut(newInOut);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ErrLogInfo.WriteLog(e.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
//提交偏移量
|
||||
|
||||
Reference in New Issue
Block a user