提交代码

This commit is contained in:
2025-03-26 09:53:22 +08:00
parent 23fd25bb60
commit fee5161f3a
7 changed files with 516 additions and 7 deletions
+139
View File
@@ -1297,6 +1297,145 @@ namespace BLL
{
try
{
//string mess = string.Empty;
//string sucess = string.Empty;
//string code = string.Empty;
//string data = string.Empty;
//string pushContent = string.Empty;
//string contenttype = "application/json;charset=unicode";
//var getData = (from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
// join z in Funs.DB.RealName_Project on y.ContractNo equals z.ProCode
// join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
// join w in Funs.DB.Base_WorkPost on x.WorkPostId equals w.WorkPostId
// where x.IdentityCard == identityCard && y.ContractNo == proCode
// && v.TeamId.HasValue && z.JTproCode != null
// && ((type == Const.BtnAdd && x.HeadImage != null && x.HeadImage.Length > 0) || (type == Const.BtnModify && x.RealNameAddTime.HasValue))
// select new
// {
// name = x.PersonName,
// idcardType = "SHENFEN_ZHENGJIAN",
// idcardNumber = x.IdentityCard,
// idcardStartDate = x.IdcardStartDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate) : null,
// idcardEndDate = x.IdcardEndDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardEndDate) : (x.IdcardStartDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate.Value.AddYears(30)) : null),
// idcardForever = x.IdcardStartDate.HasValue ? "N" : "Y",
// politicsStatus = x.PoliticsStatus,
// eduLevel = x.EduLevel,
// maritalStatus = x.MaritalStatus,
// sex = (x.Sex == "2" ? "F" : "M"),
// idcardAddress = x.IdcardAddress,
// homeAddress = x.Address,
// birthday = x.Birthday.HasValue ? string.Format("{0:yyyy-MM-dd}", x.Birthday) : null,
// nation = x.Nation,
// countryCode = x.CountryCode,
// provinceCode = x.ProvinceCode,
// headImage = x.HeadImage,
// proCode = z.JTproCode,
// teamId = v.TeamId,
// mobile = x.Telephone,
// teamLeaderFlag = (v.GroupLeaderId == x.PersonId ? "Y" : "N"),
// userType = ((w.PostType == "1" || w.PostType == "4") ? "LAB_USER_MANAGE" : "LAB_USER_BULIDER"),
// workType = w.WorkPostCode,
// isLeave = x.OutTime.HasValue ? "Y" : "N",
// entryTime = x.InTime.HasValue ? string.Format("{0:yyyy-MM-dd}", x.InTime) : null,
// exitTime = x.OutTime.HasValue ? string.Format("{0:yyyy-MM-dd}", x.OutTime) : null,
// x.RealNameAddTime,
// x.RealNameUpdateTime,
// x.PersonId,
// }).ToList();
//if (getData.Count() > 0)
//{
// string returndata = string.Empty;
// Hashtable newToken = new Hashtable
// {
// { "token", getaccess_token(proCode) }
// };
// if (type == Const.BtnModify)
// {
// var updatelistObject = new
// {
// list = getData.Select(x => new { x.name, x.idcardType, x.idcardNumber, x.idcardStartDate, x.idcardEndDate, x.idcardForever, x.politicsStatus, x.eduLevel, x.maritalStatus, x.sex, x.idcardAddress, x.homeAddress, x.birthday, x.nation, x.countryCode, x.provinceCode, x.proCode, x.teamId, x.mobile, x.teamLeaderFlag, x.userType, x.workType, x.isLeave, x.entryTime, x.exitTime })
// };
// pushContent = JsonConvert.SerializeObject(updatelistObject);
// returndata = BLL.APIGetHttpService.OutsideHttp(Funs.RealNameApiUrl + "/foreignApi/accept/updatePersons", "POST", contenttype, newToken, pushContent);
// }
// else
// {
// var addlistObject = new
// {
// list = getData.Select(x => new { x.name, x.idcardType, x.idcardNumber, x.idcardStartDate, x.idcardEndDate, x.idcardForever, x.politicsStatus, x.eduLevel, x.maritalStatus, x.sex, x.idcardAddress, x.homeAddress, x.birthday, x.nation, x.countryCode, x.provinceCode, x.headImage, x.proCode, x.teamId, x.mobile, x.teamLeaderFlag, x.userType, x.workType, x.isLeave, x.entryTime, x.exitTime })
// };
// pushContent = JsonConvert.SerializeObject(addlistObject);
// returndata = BLL.APIGetHttpService.OutsideHttp(Funs.RealNameApiUrl + "/foreignApi/accept/persons", "POST", contenttype, newToken, pushContent);
// }
// if (!string.IsNullOrEmpty(returndata))
// {
// JObject obj = JObject.Parse(returndata);
// mess = obj["message"].ToString();
// code = obj["code"].ToString();
// sucess = obj["success"].ToString();
// data = obj["data"].ToString();
// if (obj["success"] != null && Convert.ToBoolean(obj["success"].ToString()))
// {
// using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
// {
// foreach (var item in getData)
// {
// var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId);
// if (getPerson != null)
// {
// if (!getPerson.RealNameAddTime.HasValue)
// {
// getPerson.RealNameAddTime = DateTime.Now;
// }
// if (type == Const.BtnModify)
// {
// getPerson.RealNameUpdateTime = DateTime.Now;
// }
// db.SubmitChanges();
// }
// }
// }
// }
// else
// {
// if (mess.Contains("token无效"))
// {
// getaccess_token_New(proCode);
// }
// }
// }
// InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent);
// if (data.Contains("已存在") || mess.Contains("已存在"))
// {
// using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
// {
// foreach (var item in getData)
// {
// if (data.Contains(item.idcardNumber) || mess.Contains(item.idcardNumber))
// {
// var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId);
// if (getPerson != null)
// {
// if (!getPerson.RealNameAddTime.HasValue)
// {
// getPerson.RealNameAddTime = DateTime.Now;
// }
// db.SubmitChanges();
// }
// }
// }
// }
// }
//}
//else
//{
// mess = "没有符合条件的数据!";
//}
//return mess;
string mess = string.Empty;
string sucess = string.Empty;
string code = string.Empty;