20250325 工作台
This commit is contained in:
@@ -601,6 +601,7 @@
|
||||
<Compile Include="JDGL\Check\QuantityListService.cs" />
|
||||
<Compile Include="JDGL\Check\SteelStructureCompletionService.cs" />
|
||||
<Compile Include="JDGL\Check\UndergroundPipeCompletionService.cs" />
|
||||
<Compile Include="JDGL\Check\WeekItemService.cs" />
|
||||
<Compile Include="JDGL\Check\WeekPlanService.cs" />
|
||||
<Compile Include="JDGL\WBSCompleteAndReal\WBSReportService.cs" />
|
||||
<Compile Include="JDGL\WBS\CnProfessionInitService.cs" />
|
||||
|
||||
@@ -4806,6 +4806,14 @@ namespace BLL
|
||||
public const string WeekPlanOutTemplateUrl = "File\\Excel\\DataOut\\周进度计划.xlsx";
|
||||
#endregion
|
||||
|
||||
#region 关键事项
|
||||
|
||||
/// <summary>
|
||||
/// 关键事项模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string GJSXOutTemplateUrl = "File\\Excel\\DataOut\\关键事项.xlsx";
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 质量流程定义
|
||||
@@ -5942,7 +5950,7 @@ namespace BLL
|
||||
public const string RectificationMeasureMenuId = "0629BAB1-DB1C-42CE-A333-49F3813617D7";
|
||||
|
||||
/// <summary>
|
||||
/// 工程量完成情况
|
||||
/// 月进度计划
|
||||
/// </summary>
|
||||
public const string MonthPlanMenuId = "94287B92-7E96-4B90-BC6F-DAF30AE3B314";
|
||||
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 自定义周
|
||||
/// </summary>
|
||||
public class WeekItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取自定义周情况
|
||||
/// </summary>
|
||||
/// <param name="WeekId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.JDGL_WeekItem GetWeekItemById(string WeekId)
|
||||
{
|
||||
return db.JDGL_WeekItem.FirstOrDefault(e => e.WeekId == WeekId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目Id和周号查询
|
||||
/// </summary>
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <param name="WeekNo"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.JDGL_WeekItem GetWeekItemByProjectIdAndWeekNo(string ProjectId, int WeekNo)
|
||||
{
|
||||
return db.JDGL_WeekItem.FirstOrDefault(e => e.ProjectId == ProjectId && e.WeekNo == WeekNo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前时间获取所在周
|
||||
/// </summary>
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.JDGL_WeekItem GetWeekItemByDateNow(string ProjectId)
|
||||
{
|
||||
return db.JDGL_WeekItem.FirstOrDefault(e => e.ProjectId == ProjectId && e.StartDate < DateTime.Now && e.EndDate > DateTime.Now);
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加自定义周情况
|
||||
/// </summary>
|
||||
/// <param name="WeekItem"></param>
|
||||
public static void AddWeekItem(Model.JDGL_WeekItem WeekItem)
|
||||
{
|
||||
Model.JDGL_WeekItem newWeekItem = new Model.JDGL_WeekItem
|
||||
{
|
||||
WeekId = WeekItem.WeekId,
|
||||
ProjectId = WeekItem.ProjectId,
|
||||
WeekNo = WeekItem.WeekNo,
|
||||
StartDate = WeekItem.StartDate,
|
||||
EndDate = WeekItem.EndDate,
|
||||
CompileMan = WeekItem.CompileMan,
|
||||
CompileDate = WeekItem.CompileDate,
|
||||
};
|
||||
db.JDGL_WeekItem.InsertOnSubmit(newWeekItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改自定义周情况
|
||||
/// </summary>
|
||||
/// <param name="WeekItem"></param>
|
||||
public static void UpdateWeekItem(Model.JDGL_WeekItem WeekItem)
|
||||
{
|
||||
Model.JDGL_WeekItem newWeekItem = db.JDGL_WeekItem.FirstOrDefault(e => e.WeekId == WeekItem.WeekId);
|
||||
if (newWeekItem != null)
|
||||
{
|
||||
newWeekItem.WeekNo = WeekItem.WeekNo;
|
||||
newWeekItem.StartDate = WeekItem.StartDate;
|
||||
newWeekItem.EndDate = WeekItem.EndDate;
|
||||
newWeekItem.CompileMan = WeekItem.CompileMan;
|
||||
newWeekItem.CompileDate = WeekItem.CompileDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除自定义周情况
|
||||
/// </summary>
|
||||
/// <param name="WeekId"></param>
|
||||
public static void DeleteWeekItemById(string WeekId)
|
||||
{
|
||||
var q = (from x in db.JDGL_WeekItem where x.WeekId == WeekId select x).FirstOrDefault();
|
||||
if (q != null)
|
||||
{
|
||||
db.JDGL_WeekItem.DeleteOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有自定义周List
|
||||
/// </summary>
|
||||
/// <param name="WeekId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<JDGL_WeekItem> GetWeekItemList(string ProjectId)
|
||||
{
|
||||
return (from x in db.JDGL_WeekItem where x.ProjectId == ProjectId orderby x.WeekNo descending select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取自定义周下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitWeekItemDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "WeekNo";
|
||||
dropName.DataTextField = "WeekNo";
|
||||
dropName.DataSource = GetWeekItemList(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace BLL
|
||||
{
|
||||
foreach (var item in acceptanceItems)
|
||||
{
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人负责</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays : "半")}</td></tr>");
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人负责</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}</td></tr>");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace BLL
|
||||
{
|
||||
foreach (var item in userItems)
|
||||
{
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人发起</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays : "半")}</td></tr>");
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人发起</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}</td></tr>");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace BLL
|
||||
{
|
||||
foreach (var item in receiveItems)
|
||||
{
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人跟踪</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays : "半")}</td></tr>");
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>本人跟踪</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}</td></tr>");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ namespace BLL
|
||||
{
|
||||
foreach (var item in csUserItems)
|
||||
{
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>抄送本人</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays : "半")}</td></tr>");
|
||||
tbodyStr.Append($"<tr><td>{index}</td><td>抄送本人</td><td>{item.UnitName}</td><td>{item.Detail}</td><td>{item.GJSXTypeName}</td><td>{item.UserName}</td><td>{item.User_AcceptanceUserName}</td><td>{item.CompleteDate.ToShortDateString()}</td><td>{(item.DateDiffDays > 0 ? item.DateDiffDays.ToString() : "半")}</td></tr>");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace BLL
|
||||
{
|
||||
newGJSX.GJSXID = _GJSX.GJSXID;
|
||||
newGJSX.Detail = _GJSX.Detail;
|
||||
newGJSX.UserID = _GJSX.UserID;
|
||||
newGJSX.CreateDate = _GJSX.CreateDate;
|
||||
//newGJSX.UserID = _GJSX.UserID;
|
||||
//newGJSX.CreateDate = _GJSX.CreateDate;
|
||||
newGJSX.User_ReceiveID = _GJSX.User_ReceiveID;
|
||||
newGJSX.CNProfessional_ID = _GJSX.CNProfessional_ID;
|
||||
newGJSX.ProjectId = _GJSX.ProjectId;
|
||||
|
||||
@@ -67,5 +67,101 @@ namespace BLL
|
||||
select x.Action_By).Distinct().OrderBy(x => x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 责任人pic下拉框
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitPICDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "string";
|
||||
dropName.DataTextField = "string";
|
||||
dropName.DataSource = GetPICDropDownList(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取责任人pic下拉选项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetPICDropDownList(string projectId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Transfer_PunchlistFrom
|
||||
where x.ProjectId == projectId
|
||||
select x.PIC).Distinct().OrderBy(x => x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 责任人-五环/PIC-WUH下拉框
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitWUHPICDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "string";
|
||||
dropName.DataTextField = "string";
|
||||
dropName.DataSource = GetWUHPICDropDownList(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取责任人-五环/PIC-WUH下拉选项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetWUHPICDropDownList(string projectId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Transfer_PunchlistFrom
|
||||
where x.ProjectId == projectId
|
||||
select x.PIC_WUH).Distinct().OrderBy(x => x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// disc下拉框
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitDiscDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "string";
|
||||
dropName.DataTextField = "string";
|
||||
dropName.DataSource = GetDiscDropDownList(projectId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取disc下拉选项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetDiscDropDownList(string projectId)
|
||||
{
|
||||
var list = (from x in Funs.DB.Transfer_PunchlistFrom
|
||||
where x.ProjectId == projectId
|
||||
select x.Disc).Distinct().OrderBy(x => x).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1116,92 +1116,269 @@ namespace BLL
|
||||
/// <param name="identityCard"></param>
|
||||
/// <param name="isLog">是否写日志</param>
|
||||
/// <returns></returns>
|
||||
public static string PushPersonsByIdentityCard(string type, string proCode, string identityCard,bool isLog)
|
||||
//public static string PushPersonsByIdentityCard(string type, string proCode, string identityCard,bool isLog)
|
||||
//{
|
||||
// using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
// {
|
||||
// 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 db.SitePerson_Person
|
||||
// join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
||||
// join z in db.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
// join v in db.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
// join w in db.Base_WorkPost on x.WorkPostId equals w.WorkPostId
|
||||
// where x.IdentityCard == identityCard && y.JTProjectCode == 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) : null,
|
||||
// idcardForever = "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()))
|
||||
// {
|
||||
// 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;
|
||||
// }
|
||||
// getPerson.RealNameUpdateTime = DateTime.Now;
|
||||
// db.SubmitChanges();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (data.Contains("历史项目进退场时间重合") || data.Contains("已推送"))
|
||||
// {
|
||||
// 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 (data.Contains("人员不存在"))
|
||||
// {
|
||||
// SynchroSetService.PushPersonsByIdentityCard(Const.BtnAdd, proCode, identityCard, isLog);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (isLog)
|
||||
// {
|
||||
// InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (isLog)
|
||||
// {
|
||||
// InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (data.Contains("已存在") || mess.Contains("已存在"))
|
||||
// {
|
||||
// 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;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// ErrLogInfo.WriteLog(ex, "推送人员数据", "SynchroSetService.PushPersons");
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
public static string PushPersonsByIdentityCard(string type, string proCode, string identityCard, bool isLog)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
try
|
||||
{
|
||||
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 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 db.SitePerson_Person
|
||||
join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
||||
join z in db.RealName_Project on y.JTProjectCode equals z.ProCode
|
||||
join v in db.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
join w in db.Base_WorkPost on x.WorkPostId equals w.WorkPostId
|
||||
where x.IdentityCard == identityCard && y.JTProjectCode == proCode
|
||||
&& v.TeamId.HasValue && z.JTproCode != null
|
||||
&& ((type == Const.BtnAdd && x.HeadImage != null && x.HeadImage.Length > 0) || type == Const.BtnModify)
|
||||
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) : null,
|
||||
idcardForever = "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
|
||||
string returndata = string.Empty;
|
||||
Hashtable newToken = new Hashtable
|
||||
{
|
||||
{ "token", getaccess_token(proCode) }
|
||||
};
|
||||
if (type == Const.BtnModify)
|
||||
if (type == Const.BtnModify)
|
||||
{
|
||||
var updatelistObject = new
|
||||
{
|
||||
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
|
||||
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
|
||||
{
|
||||
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);
|
||||
}
|
||||
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))
|
||||
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()))
|
||||
{
|
||||
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()) && code == "200")
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in getData)
|
||||
{
|
||||
@@ -1212,54 +1389,28 @@ namespace BLL
|
||||
{
|
||||
getPerson.RealNameAddTime = DateTime.Now;
|
||||
}
|
||||
getPerson.RealNameUpdateTime = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.Contains("历史项目进退场时间重合") || data.Contains("已推送"))
|
||||
{
|
||||
foreach (var item in getData)
|
||||
{
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId);
|
||||
if (getPerson != null)
|
||||
if (type == Const.BtnModify)
|
||||
{
|
||||
if (!getPerson.RealNameAddTime.HasValue)
|
||||
{
|
||||
getPerson.RealNameAddTime = DateTime.Now;
|
||||
}
|
||||
if (type == Const.BtnModify)
|
||||
{
|
||||
getPerson.RealNameUpdateTime = DateTime.Now;
|
||||
}
|
||||
db.SubmitChanges();
|
||||
getPerson.RealNameUpdateTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (data.Contains("人员不存在"))
|
||||
{
|
||||
SynchroSetService.PushPersonsByIdentityCard(Const.BtnAdd, proCode, identityCard, isLog);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isLog)
|
||||
{
|
||||
InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isLog)
|
||||
if (mess.Contains("token无效"))
|
||||
{
|
||||
InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent);
|
||||
getaccess_token_New(proCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.Contains("已存在") || mess.Contains("已存在"))
|
||||
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)
|
||||
{
|
||||
@@ -1278,18 +1429,28 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mess = "没有符合条件的数据!";
|
||||
}
|
||||
|
||||
return mess;
|
||||
}
|
||||
catch (Exception ex)
|
||||
else
|
||||
{
|
||||
ErrLogInfo.WriteLog(ex, "推送人员数据", "SynchroSetService.PushPersons");
|
||||
return "";
|
||||
mess = "没有符合条件的数据!";
|
||||
}
|
||||
|
||||
return mess;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog(ex, "推送人员数据", "SynchroSetService.PushPersons");
|
||||
return "推送人员异常";
|
||||
}
|
||||
}
|
||||
|
||||
public static void getaccess_token_New(string proCode)
|
||||
{
|
||||
string access_token = string.Empty;
|
||||
var getToken = Funs.DB.RealName_SynchroSet.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getToken != null)
|
||||
{
|
||||
SaveToken(getToken);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user