数据同步

This commit is contained in:
李超 2025-04-11 18:49:24 +08:00
parent 62b9d1d0c0
commit c59285dd94
1 changed files with 21 additions and 13 deletions

View File

@ -878,8 +878,9 @@ namespace BLL
foreach (var item in getUnit) foreach (var item in getUnit)
{ {
item.RealNamePushTime = DateTime.Now; item.RealNamePushTime = DateTime.Now;
db.SubmitChanges();
} }
db.SubmitChanges();
} }
} }
InsertRealNamePushLog(null, null, "推送参建企业数据", sucess, code, mess, data, pushContent); InsertRealNamePushLog(null, null, "推送参建企业数据", sucess, code, mess, data, pushContent);
@ -1759,18 +1760,18 @@ namespace BLL
{ {
{ "token", getaccess_token(proCode) } { "token", getaccess_token(proCode) }
}; };
if (count == 200) //if (count == 200)
{ //{
addTeam(getData.Select(x => x.TeamGroupId).Distinct().ToList(), newToken); // addTeam(getData.Select(x => x.TeamGroupId).Distinct().ToList(), newToken);
getTeam(proCode, newToken); // getTeam(proCode, newToken);
var getPersonS = getData.Select(x => x.idcardNumber).Distinct().ToList(); // var getPersonS = getData.Select(x => x.idcardNumber).Distinct().ToList();
foreach (var pitem in getPersonS) // foreach (var pitem in getPersonS)
{ // {
PushPersonsByIdentityCard(Const.BtnAdd, proCode, pitem, false); // PushPersonsByIdentityCard(Const.BtnAdd, proCode, pitem, false);
PushPersonsByIdentityCard(Const.BtnModify, proCode, pitem, false); // PushPersonsByIdentityCard(Const.BtnModify, proCode, pitem, false);
} // }
} //}
pushContent = JsonConvert.SerializeObject(listObject); pushContent = JsonConvert.SerializeObject(listObject);
var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, newToken, pushContent); var returndata = BLL.APIGetHttpService.OutsideHttp(url, "POST", null, newToken, pushContent);
@ -1794,6 +1795,13 @@ namespace BLL
} }
} }
} }
else
{
if (mess.Contains("token无效"))
{
getaccess_token_New(proCode);
}
}
} }
InsertRealNamePushLog(null, proCode, "推送考勤数据", sucess, code, mess, data, pushContent); InsertRealNamePushLog(null, proCode, "推送考勤数据", sucess, code, mess, data, pushContent);
if (data.Contains("无法入场") || mess.Contains("班组")) if (data.Contains("无法入场") || mess.Contains("班组"))