This commit is contained in:
geh
2026-03-23 15:22:29 +08:00
parent 94584d242b
commit c38590add8
173 changed files with 19679 additions and 4413 deletions
@@ -5,6 +5,7 @@ using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Threading;
using System.Web.UI;
namespace FineUIPro.Web.HSSE.SitePerson
@@ -31,6 +32,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
/// 错误集合
/// </summary>
public static string errorInfos = string.Empty;
public static Dictionary<string,int> percent { get; set; }
[System.Web.Services.WebMethod]
public static int getPercent(string id)
{
return percent[id];
}
/// <summary>
/// 项目ID
@@ -73,6 +80,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (!IsPostBack)
{
if (percent == null)
{
percent = new Dictionary<string, int>();
}
this.hdFileName.Text = string.Empty;
this.hdCheckResult.Text = string.Empty;
errorInfos = string.Empty;
@@ -260,10 +272,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
result += "第" + (i + 2).ToString() + "行," + "身份证号码" + "," + "[" + col4 + "]错误!" + "|";
}
if (PersonService.GetPersonCountByIdentityCard(col4, this.ProjectId) != null)
{
result += "第" + (i + 2).ToString() + "行," + "身份证号码" + "," + "[" + col4 + "]已存在!" + "|";
}
// if (PersonService.GetPersonCountByIdentityCard(col4, this.ProjectId) != null)
// {
// result += "第" + (i + 2).ToString() + "行," + "身份证号码" + "," + "[" + col4 + "]已存在!" + "|";
// }
if ( !string.IsNullOrEmpty(basicDictCode)&& basicDictCode== "SHENFEN_ZHENGJIAN")
{
if (!IDCardValid.CheckIDCard(col4))
@@ -654,8 +666,23 @@ namespace FineUIPro.Web.HSSE.SitePerson
if (!string.IsNullOrEmpty(this.hdFileName.Text))
{
string rootPath = Server.MapPath("~/");
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
Thread t = new Thread(new ThreadStart(() =>
{
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
}));
t.Start();
if (percent.ContainsKey(this.CurrUser.UserId))
{
percent[CurrUser.UserId] = 0;
}
else
{
percent.Add(CurrUser.UserId, 0);
}
PageContext.RegisterStartupScript("printX()");
}
else
{
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
@@ -1046,28 +1073,37 @@ namespace FineUIPro.Web.HSSE.SitePerson
personQualitys.Add(personQuality);
}
}
if (persons.Count > 0)
{
this.Grid1.Hidden = false;
this.Grid1.DataSource = persons;
this.Grid1.DataBind();
}
// if (persons.Count > 0)
// {
// this.Grid1.Hidden = false;
// this.Grid1.DataSource = persons;
// this.Grid1.DataBind();
// }
var personList = new List<Model.SitePerson_Person>();
if (string.IsNullOrEmpty(errorInfos))
{
int ii = 0;
int a = persons.Count();
for (int i = 0; i < a; i++)
{
var getPerson = PersonService.GetPersonCountByIdentityCard(persons[i].IdentityCard, Request.Params["ProjectId"]);
ii++;
percent[this.CurrUser.UserId] = (int)(100 * ii / a);
var isUser = persons[i].IsUsedName == "是" ? true : false;
if (isUser)
{
//先根据身份证号码把这个人在非当前项目上且状态为在岗的改为离岗
PersonService.UpdatePersonTypeByProjectIdAndIdentityCard(ProjectId,persons[i].IdentityCard);
}
var getPerson = PersonService.GetPersonCountByIdentityCard(persons[i].IdentityCard, ProjectId);
//!BLL.PersonService.IsExistPersonByUnit(persons[i].UnitId, persons[i].IdentityCard, Request.Params["ProjectId"]) &&
if (getPerson == null)
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person();
string newKeyID = SQLHelper.GetNewID();
newPerson.PersonId = newKeyID;
newPerson.ProjectId = Request.Params["ProjectId"];
newPerson.ProjectId = ProjectId;
newPerson.CardNo = persons[i].CardNo;
newPerson.PersonName = persons[i].PersonName;
newPerson.Sex = persons[i].SexName == "男" ? "1" : "2";
@@ -1160,7 +1196,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
System.IO.File.Delete(filePath);//删除上传的XLS文件
}
ShowNotify("导入成功!", MessageBoxIcon.Success);
// ShowNotify("导入成功!", MessageBoxIcon.Success);
var porject = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
{
@@ -1174,7 +1210,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
// PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
@@ -1190,6 +1226,11 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
#endregion
#endregion
protected void btnRefresh_Click(object sender, EventArgs e)
{
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#region
/// <summary>