From 7c301ceb729518717e3779bb86ed7f308213f690 Mon Sep 17 00:00:00 2001
From: geh <1923421292@qq.com>
Date: Thu, 17 Apr 2025 11:38:17 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DataBase/版本日志/SGGLDB_2025-04-16-geh.sql | 109 ++++++++
SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs | 2 +
.../FineUIPro.Web/Controls/SeeQRImage.aspx.cs | 4 +
.../HSSE/SitePerson/PersonIn.aspx.cs | 2 +
.../HSSE/SitePerson/PersonList.aspx | 21 +-
.../HSSE/SitePerson/PersonList.aspx.cs | 70 +++--
.../SitePerson/PersonList.aspx.designer.cs | 13 +-
.../HSSE/SitePerson/PersonListEdit.aspx | 14 +-
.../HSSE/SitePerson/PersonListEdit.aspx.cs | 18 +-
.../PersonListEdit.aspx.designer.cs | 4 +-
.../ProjectData/ProjectUnit.aspx | 3 +
.../ProjectData/ProjectUnit.aspx.cs | 15 +
.../ProjectData/ProjectUnit.aspx.designer.cs | 9 +
SUBQHSE/Model/Model.cs | 60 ++++
.../ProjectUnitPenetrateController.cs | 46 +++
.../HSSE/InformedConsentFormController.cs | 2 +-
.../WebAPI/Controllers/PersonController.cs | 261 ++++++++++++++++++
.../WebAPI/Filter/TestPermissionAttribute.cs | 12 +-
18 files changed, 622 insertions(+), 43 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_2025-04-16-geh.sql
diff --git a/DataBase/版本日志/SGGLDB_2025-04-16-geh.sql b/DataBase/版本日志/SGGLDB_2025-04-16-geh.sql
new file mode 100644
index 0000000..864f771
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_2025-04-16-geh.sql
@@ -0,0 +1,109 @@
+SELECT Person.PersonId,
+ Person.CardNo,
+ Person.PersonName,
+ Person.Sex,
+ (Case Person.Sex WHEN '1' THEN '男' WHEN '2' THEN '女' ELSE '' END) AS SexName,
+ Person.IdentityCard,
+ Person.Address,
+ Person.ProjectId,
+ Person.UnitId,
+ Person.Birthday,
+ Person.TeamGroupId,
+ Person.WorkAreaId,
+ Person.WorkPostId,
+ Person.InTime,
+ Person.OutTime,
+ Person.OutResult,
+ Person.Telephone,
+ Person.PositionId,
+ Person.PostTitleId,
+ Person.PhotoUrl,
+ Person.IsUsed,
+ (CASE Person.IsUsed WHEN 1 THEN '是' ELSE '否' END) AS IsUsedName,
+ Person.IsUsedType,
+ (CASE Person.IsUsedType WHEN '1' THEN '在岗' WHEN '0' THEN '离岗' ELSE '待审核' END) AS IsUsedTypeName,
+ Person.IsCardUsed,
+ (CASE Person.IsCardUsed WHEN 'TRUE' THEN '是' ELSE '否' END) AS IsCardUsedName,
+ Person.PersonIndex,
+ Project.ProjectCode,
+ Project.ProjectName,
+ Unit.UnitCode,
+ Unit.UnitName,
+ TeamGroup.TeamGroupName,
+ --WorkArea.UnitWorkCode AS WorkAreaCode,
+ WorkAreaCode= STUFF((SELECT ',' + UnitWorkCode FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +Person.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''),
+ --WorkArea.UnitWorkName AS WorkAreaName
+ WorkAreaName= STUFF((SELECT ',' + UnitWorkName FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +Person.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''),
+ Post.WorkPostName,
+ Position.PositionName,
+ Title.PostTitleName,
+ Depart.DepartName,
+ Depart.DepartId,
+ Post.PostType,
+ Post.IsHsse,
+ (SELECT COUNT(*) FROM EduTrain_TrainRecordDetail T WHERE T.PersonId=Person.PersonId) AS TrainCount,
+ Person.AuditorId,
+ sysUser.UserName AS AuditorName,
+ Person.AuditorDate,
+ Person.IDCardUrl,
+ Person.IsForeign,
+ case when Person.IsForeign=1 then '是' else '否' end as IsForeignStr,
+ Person.IdcardType,
+ BasicData1.dictName as IdcardTypeName,
+ Person.IdcardStartDate,
+ Person.IdcardEndDate,
+ Person.IdcardForever,
+ case when Person.IdcardForever='Y' then '是' else '否' end as IdcardForeverStr,
+ Person.PoliticsStatus,
+ BasicData2.dictName as PoliticsStatusName,
+ Person.IdcardAddress,
+ Person.Nation,
+ BasicData3.dictName as NationName,
+ Person.EduLevel,
+ BasicData4.dictName as EduLevelName,
+ Person.MaritalStatus,
+ BasicData5.dictName as MaritalStatusName,
+ Person.CountryCode,
+ Country.cname as CountryName,
+ Person.ProvinceCode,
+ City.cname as ProvinceName,
+ Person.MainCNProfessionalId,
+ CNProfessional.ProfessionalName as MainCNProfessionalName,
+ Person.ViceCNProfessionalId,
+ '' as ViceCNProfessionalName,
+ Person.IsOutside,
+ case when Person.IsOutside=1 then '是' else '否' end as IsOutsideStr
+FROM SitePerson_Person AS Person
+LEFT JOIN Base_Project AS Project ON Project.ProjectId=Person.ProjectId
+LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = Person.UnitId
+LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON TeamGroup.TeamGroupId=Person.TeamGroupId
+--LEFT JOIN WBS_UnitWork AS WorkArea ON WorkArea.UnitWorkId = Person.WorkAreaId
+LEFT JOIN Base_WorkPost AS Post ON Post.WorkPostId = Person.WorkPostId
+LEFT JOIN Base_Position AS Position ON Position.PositionId = Person.PositionId
+Left JOIN Base_PostTitle AS Title ON Title.PostTitleId = Person.PostTitleId
+Left JOIN Base_Depart AS Depart ON Depart.DepartId = Person.DepartId
+Left JOIN Sys_User AS sysUser ON sysUser.UserId = Person.AuditorId
+Left JOIN RealName_BasicData AS BasicData1 ON BasicData1.dictCode = Person.IdcardType
+Left JOIN RealName_BasicData AS BasicData2 ON BasicData2.dictCode = Person.PoliticsStatus
+Left JOIN RealName_BasicData AS BasicData3 ON BasicData3.dictCode = Person.Nation
+Left JOIN RealName_BasicData AS BasicData4 ON BasicData4.dictCode = Person.EduLevel
+Left JOIN RealName_BasicData AS BasicData5 ON BasicData5.dictCode = Person.MaritalStatus
+Left JOIN RealName_Country AS Country ON Country.CountryId = Person.CountryCode
+Left JOIN RealName_City AS City ON City.provinceCode = Person.ProvinceCode
+Left JOIN Base_CNProfessional AS CNProfessional ON CNProfessional.CNProfessionalId = Person.MainCNProfessionalId
+
+
+
+
+
+ALTER TABLE SitePerson_Person
+ADD IsUsedType char(1) COLLATE Chinese_PRC_CI_AS NULL
+go
+
+EXEC sp_addextendedproperty
+'MS_Description', N'人员状态',
+'SCHEMA', N'dbo',
+'TABLE', N'SitePerson_Person',
+'COLUMN', N'IsUsedType'
+GO
+
diff --git a/SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs b/SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs
index b7748f9..fa69586 100644
--- a/SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs
+++ b/SUBQHSE/BLL/HSSE/SitePerson/PersonService.cs
@@ -591,6 +591,7 @@ namespace BLL
Major = person.Major,
Languages = person.Languages,
PersonStates = person.PersonStates,
+ IsUsedType = person.IsUsedType,
};
if (person.InTime.HasValue)
@@ -655,6 +656,7 @@ namespace BLL
newPerson.MaritalStatus = person.MaritalStatus;
newPerson.DepartId = person.DepartId;
newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl;
+ newPerson.IsUsedType = person.IsUsedType;
newPerson.Password = GetPersonPassWord(person.IdentityCard);
if (!newPerson.OutTime.HasValue)
{
diff --git a/SUBQHSE/FineUIPro.Web/Controls/SeeQRImage.aspx.cs b/SUBQHSE/FineUIPro.Web/Controls/SeeQRImage.aspx.cs
index a76c357..8475ef9 100644
--- a/SUBQHSE/FineUIPro.Web/Controls/SeeQRImage.aspx.cs
+++ b/SUBQHSE/FineUIPro.Web/Controls/SeeQRImage.aspx.cs
@@ -219,6 +219,10 @@ namespace FineUIPro.Web.Controls
}
}
}
+ else if (!string.IsNullOrEmpty(Request.Params["ProjectUnitId"]))
+ {
+ this.CreateCode_Simple(Request.Params["strCode"]);
+ }
this.Image1.ImageUrl = "~/" + this.QRCodeAttachUrl;
}
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs
index 795f1f3..0a78588 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs
@@ -1099,6 +1099,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
newPerson.IsForeign = persons[i].IsForeign;
newPerson.IsOutside = persons[i].IsOutside;
newPerson.IsUsed = persons[i].IsUsedName == "是" ? true : false;
+ newPerson.IsUsedType = persons[i].IsUsedName == "是" ? "1" : "0";
newPerson.IsCardUsed = persons[i].IsCardUsedName == "是" ? true : false;
BLL.PersonService.AddPerson(newPerson);
@@ -1142,6 +1143,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
getPerson.OutResult = persons[i].OutResult;
getPerson.Telephone = persons[i].Telephone;
getPerson.IsUsed = persons[i].IsUsedName == "是" ? true : false;
+ getPerson.IsUsedType = persons[i].IsUsedName == "是" ? "1" : "0";
getPerson.IsCardUsed = persons[i].IsCardUsedName == "是" ? true : false;
Funs.DB.SubmitChanges();
}
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
index a7a53b8..f5329db 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx
@@ -8,12 +8,9 @@
人员信息
@@ -83,10 +80,12 @@
-
-
-
+
+
+
+
+
@@ -96,6 +95,8 @@
+
+
--%>
-
+ /// 批量审核
+ ///
+ ///
+ ///
+ protected void btnApprove_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+ var ids = Grid1.SelectedRowIDArray;
+ foreach (var id in ids)
+ {
+ var person = PersonService.GetPersonById(id);
+ if (person.IsUsedType == "2")
+ {
+ person.IsUsedType = "1";
+ PersonService.UpdatePerson(person);
+ }
+ }
+ ShowNotify("操作完成!", MessageBoxIcon.Success);
+ }
+ #endregion
+
#region 查询
///
/// 查询
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
index 5ff2808..a9a9a6e 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs
@@ -186,13 +186,13 @@ namespace FineUIPro.Web.HSSE.SitePerson
protected global::FineUIPro.Toolbar Toolbar1;
///
- /// drpIsUsedName 控件。
+ /// drpIsUsedTypeName 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.DropDownList drpIsUsedName;
+ protected global::FineUIPro.DropDownList drpIsUsedTypeName;
///
/// ckIdCardInfoNotOK 控件。
@@ -239,6 +239,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
///
protected global::FineUIPro.Button btnNew;
+ ///
+ /// btnApprove 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Button btnApprove;
+
///
/// btnPersonOut 控件。
///
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx
index ec095f8..0a80028 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx
@@ -141,10 +141,16 @@
-
-
-
-
+ <%-- --%>
+ <%-- --%>
+ <%-- --%>
+ <%-- --%>
+
+
+
+
+
+
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
index 77955ff..f9ec3cf 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs
@@ -169,8 +169,12 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
this.drpMaritalStatus.SelectedValue = person.MaritalStatus;
}
+ if (!string.IsNullOrEmpty(person.IsUsedType))
+ {
+ this.drpIsUsedType.SelectedValue = person.IsUsedType;
+ }
this.txtIdcardAddress.Text = person.IdcardAddress;
- this.rblIsUsed.SelectedValue = person.IsUsed ? "True" : "False";
+ // this.rblIsUsed.SelectedValue = person.IsUsed ? "True" : "False";
this.rblIsCardUsed.SelectedValue = person.IsCardUsed ? "True" : "False";
this.txtCardNo.Text = person.CardNo;
this.txtPersonName.Text = person.PersonName;
@@ -270,7 +274,8 @@ namespace FineUIPro.Web.HSSE.SitePerson
this.txtCardNo.Text = string.Empty;
}
this.txtInTime.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
- this.rblIsUsed.SelectedValue = "True";
+ // this.rblIsUsed.SelectedValue = "True";
+ this.drpIsUsedType.SelectedValue = "在岗";
this.rblIsCardUsed.SelectedValue = "True";
}
}
@@ -421,9 +426,14 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
person.PostTitleId = this.drpTitle.SelectedValue;
}
- if (!string.IsNullOrEmpty(this.rblIsUsed.SelectedValue))
+ // if (!string.IsNullOrEmpty(this.rblIsUsed.SelectedValue))
+ // {
+ // person.IsUsed = Convert.ToBoolean(this.rblIsUsed.SelectedValue);
+ // }
+ person.IsUsed = true;
+ if (!string.IsNullOrEmpty(this.drpIsUsedType.SelectedValue))
{
- person.IsUsed = Convert.ToBoolean(this.rblIsUsed.SelectedValue);
+ person.IsUsedType = this.drpIsUsedType.SelectedValue;
}
if (!string.IsNullOrEmpty(this.rblIsCardUsed.SelectedValue))
{
diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs
index 8d6aedf..97c503b 100644
--- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs
+++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs
@@ -402,13 +402,13 @@ namespace FineUIPro.Web.HSSE.SitePerson
protected global::FineUIPro.TextBox txtTelephone;
///
- /// rblIsUsed 控件。
+ /// drpIsUsedType 控件。
///
///
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
///
- protected global::FineUIPro.RadioButtonList rblIsUsed;
+ protected global::FineUIPro.DropDownList drpIsUsedType;
///
/// Panel5 控件。
diff --git a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx
index 4c45186..0b264cc 100644
--- a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx
+++ b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx
@@ -122,6 +122,9 @@
+
+
diff --git a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.cs b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.cs
index 93ceac9..83ef05b 100644
--- a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.cs
+++ b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.cs
@@ -333,6 +333,7 @@ namespace FineUIPro.Web.ProjectData
this.btnMenuEdit.Hidden = true;
this.btnMenuDelete.Hidden = true;
}
+ this.btnORCode.Hidden = false;
}
#endregion
@@ -406,5 +407,19 @@ namespace FineUIPro.Web.ProjectData
return sb.ToString();
}
#endregion
+
+
+ //二维码生成
+ protected void btnQR_Click(object sender, EventArgs e)
+ {
+ if (Grid1.SelectedRowIndexArray.Length == 0)
+ {
+ Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
+ return;
+ }
+
+ string strCode = "https://lygcgs.com.cn/JT/web/index.html?ProjectUnitId=" + Grid1.SelectedRowID;
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/Controls/SeeQRImage.aspx?ProjectUnitId={0}&strCode={1}", Grid1.SelectedRowID, strCode), "二维码查看", 400, 400));
+ }
}
}
\ No newline at end of file
diff --git a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.designer.cs
index 96529cd..a08b7e2 100644
--- a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.designer.cs
+++ b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectUnit.aspx.designer.cs
@@ -194,6 +194,15 @@ namespace FineUIPro.Web.ProjectData
///
protected global::FineUIPro.MenuButton btnMenuEdit;
+ ///
+ /// btnORCode 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.MenuButton btnORCode;
+
///
/// btnMenuDelete 控件。
///
diff --git a/SUBQHSE/Model/Model.cs b/SUBQHSE/Model/Model.cs
index f4004d7..7af1061 100644
--- a/SUBQHSE/Model/Model.cs
+++ b/SUBQHSE/Model/Model.cs
@@ -363517,6 +363517,8 @@ namespace Model
private System.Nullable _SignTime;
+ private string _IsUsedType;
+
private EntitySet _Accident_AccidentPersonRecord;
private EntitySet _Accident_AccidentReportOtherItem;
@@ -363721,6 +363723,8 @@ namespace Model
partial void OnPersonStatesChanged();
partial void OnSignTimeChanging(System.Nullable value);
partial void OnSignTimeChanged();
+ partial void OnIsUsedTypeChanging(string value);
+ partial void OnIsUsedTypeChanged();
#endregion
public SitePerson_Person()
@@ -365171,6 +365175,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUsedType", DbType="Char(1)")]
+ public string IsUsedType
+ {
+ get
+ {
+ return this._IsUsedType;
+ }
+ set
+ {
+ if ((this._IsUsedType != value))
+ {
+ this.OnIsUsedTypeChanging(value);
+ this.SendPropertyChanging();
+ this._IsUsedType = value;
+ this.SendPropertyChanged("IsUsedType");
+ this.OnIsUsedTypeChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentPersonRecord_SitePerson_Person", Storage="_Accident_AccidentPersonRecord", ThisKey="PersonId", OtherKey="PersonId", DeleteRule="NO ACTION")]
public EntitySet Accident_AccidentPersonRecord
{
@@ -486246,6 +486270,10 @@ namespace Model
private string _IsUsedName;
+ private string _IsUsedType;
+
+ private string _IsUsedTypeName;
+
private bool _IsCardUsed;
private string _IsCardUsedName;
@@ -486700,6 +486728,38 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUsedType", DbType="Char(1)")]
+ public string IsUsedType
+ {
+ get
+ {
+ return this._IsUsedType;
+ }
+ set
+ {
+ if ((this._IsUsedType != value))
+ {
+ this._IsUsedType = value;
+ }
+ }
+ }
+
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUsedTypeName", DbType="VarChar(6) NOT NULL", CanBeNull=false)]
+ public string IsUsedTypeName
+ {
+ get
+ {
+ return this._IsUsedTypeName;
+ }
+ set
+ {
+ if ((this._IsUsedTypeName != value))
+ {
+ this._IsUsedTypeName = value;
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsCardUsed", DbType="Bit NOT NULL")]
public bool IsCardUsed
{
diff --git a/SUBQHSE/WebAPI/Controllers/DataPenetrate/ProjectUnitPenetrateController.cs b/SUBQHSE/WebAPI/Controllers/DataPenetrate/ProjectUnitPenetrateController.cs
index 1dcb289..312cfe5 100644
--- a/SUBQHSE/WebAPI/Controllers/DataPenetrate/ProjectUnitPenetrateController.cs
+++ b/SUBQHSE/WebAPI/Controllers/DataPenetrate/ProjectUnitPenetrateController.cs
@@ -156,5 +156,51 @@ namespace WebAPI.Controllers.DataPenetrate
return responeData;
}
#endregion
+
+ #region 根据ProjectUnitId获取信息
+ ///
+ /// 根据ProjectUnitId获取信息
+ ///
+ ///
+ ///
+ [HttpGet]
+ public Model.ResponeData getDataByProjectUnitId(string ProjectUnitId)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var query = (from projectUnit in Funs.DB.Project_ProjectUnit
+ join project in Funs.DB.Base_Project
+ on projectUnit.ProjectId equals project.ProjectId into projectGroup
+ from project in projectGroup.DefaultIfEmpty()
+ join unit in Funs.DB.Base_Unit
+ on projectUnit.UnitId equals unit.UnitId into unitGroup
+ from unit in unitGroup.DefaultIfEmpty()
+ join sysConst in Funs.DB.Sys_Const
+ on new { GroupId = BLL.ConstValue.Group_ProjectUnitType, ConstValue = projectUnit.UnitType }
+ equals new { GroupId = sysConst.GroupId, ConstValue = sysConst.ConstValue } into sysConstGroup
+ from sysConst in sysConstGroup.DefaultIfEmpty()
+ where projectUnit.ProjectUnitId == ProjectUnitId
+ select new
+ {
+ ProjectUnitId = projectUnit.ProjectUnitId,
+ ProjectId = projectUnit.ProjectId,
+ ProjectName = project.ProjectName,
+ UnitId = projectUnit.UnitId,
+ UnitName = unit.UnitName,
+ }).FirstOrDefault();
+ responeData.data = new { query };
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+
+ #endregion
}
}
\ No newline at end of file
diff --git a/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs b/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs
index 9dd1fec..ef2f606 100644
--- a/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs
+++ b/SUBQHSE/WebAPI/Controllers/HSSE/InformedConsentFormController.cs
@@ -51,7 +51,7 @@ namespace WebAPI.Controllers.HSSE
}
}
- responeData.data = new { getData };
+ responeData.data = new { getData = getData, person = person };
}
catch (Exception ex)
{
diff --git a/SUBQHSE/WebAPI/Controllers/PersonController.cs b/SUBQHSE/WebAPI/Controllers/PersonController.cs
index ca76c9c..5340c0c 100644
--- a/SUBQHSE/WebAPI/Controllers/PersonController.cs
+++ b/SUBQHSE/WebAPI/Controllers/PersonController.cs
@@ -7,6 +7,10 @@ using SgManager.AI;
using System.Configuration;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
+using System.Drawing;
+using System.IO;
+using System.Text;
+using System.Web;
namespace WebAPI.Controllers
{
@@ -1005,5 +1009,262 @@ namespace WebAPI.Controllers
// return responeData;
//}
#endregion
+
+ #region 身份证上传+读取
+ ///
+ /// 身份证上传+读取
+ ///
+ ///
+ public Model.ResponeData PostAddUrl()
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ HttpFileCollection files = HttpContext.Current.Request.Files;
+ string typeName = HttpContext.Current.Request["typeName"];
+ if (string.IsNullOrEmpty(typeName))
+ {
+ typeName = "WebApi";
+ }
+
+ // 定义允许上传的文件类型列表
+ List allowExtensions = BLL.Funs.AllowExtensions;
+ string reUrl = string.Empty;
+ if (files != null && files.Count > 0)
+ {
+ string folderUrl = "FileUpLoad/" + typeName + "/" + DateTime.Now.ToString("yyyy-MM") + "/";
+ string localRoot = ConfigurationManager.AppSettings["localRoot"] + folderUrl; //物理路径
+ if (!Directory.Exists(localRoot))
+ {
+ Directory.CreateDirectory(localRoot);
+ }
+
+ foreach (string key in files.AllKeys)
+ {
+ string rootUrl = string.Empty;
+ string fileName = string.Empty;
+ string extensionstr = string.Empty;
+ HttpPostedFile file = files[key]; //file.ContentLength文件长度
+ if (!allowExtensions.Contains(Path.GetExtension(file.FileName)))
+ {
+ responeData.data = BadRequest($"Invalid file extension: {file.FileName}");
+ return responeData;
+ }
+
+ if (!string.IsNullOrEmpty(file.FileName))
+ {
+ extensionstr = Path.GetExtension(file.FileName).ToLower();
+ fileName = SQLHelper.GetNewID() + extensionstr;
+ rootUrl = localRoot + fileName;
+ file.SaveAs(localRoot + fileName);
+ }
+
+ if (extensionstr == ".jpg" || extensionstr == ".gif" || extensionstr == ".bmp" ||
+ extensionstr == ".png")
+ {
+ string TakePicDateTime = string.Empty;
+ System.Drawing.Image image = System.Drawing.Image.FromStream(file.InputStream, true, false);
+ Encoding ascii = Encoding.ASCII;
+ //遍历图像文件元数据,检索所有属性
+ foreach (System.Drawing.Imaging.PropertyItem p in image.PropertyItems)
+ {
+ //如果是PropertyTagDateTime,则返回该属性所对应的值
+ if (p.Id == 0x0132)
+ {
+ TakePicDateTime = ascii.GetString(p.Value);
+ }
+ }
+
+ TakePicDateTime = string.IsNullOrEmpty(TakePicDateTime)
+ ? string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now)
+ : TakePicDateTime;
+ if (!string.IsNullOrEmpty(TakePicDateTime))
+ {
+ ////获取元数据中的拍照日期时间,以字符串形式保存
+ //TakePicDateTime = GetTakePicDateTime(pi);
+ //分析字符串分别保存拍照日期和时间的标准格式
+ var SpaceLocation = TakePicDateTime.IndexOf(" ");
+ var dt = TakePicDateTime.Substring(0, SpaceLocation);
+ dt = dt.Replace(":", "-");
+ var tm = TakePicDateTime.Substring(SpaceLocation + 1,
+ TakePicDateTime.Length - SpaceLocation - 2);
+ TakePicDateTime = dt + " " + tm;
+ //由列表中的文件创建内存位图对象
+ var Pic = new Bitmap(rootUrl);
+ //由位图对象创建Graphics对象的实例
+ var g = Graphics.FromImage(Pic);
+ Font ft = new Font("宋体", 20, FontStyle.Regular, GraphicsUnit.Point,
+ ((byte)(134))); //定义字体
+ //在Graphics表面绘制数码照片的日期/时间戳
+ g.DrawString(TakePicDateTime, ft, Brushes.Gold, 0, Pic.Height - 100);
+ // - 50);
+ string newRoot = localRoot + "newfile/";
+ if (!Directory.Exists(newRoot))
+ {
+ Directory.CreateDirectory(newRoot);
+ }
+
+ //将添加日期/时间戳后的图像进行保存
+ Pic.Save(newRoot + fileName);
+ fileName = "newfile/" + fileName;
+ //释放内存位图对象
+ Pic.Dispose();
+ }
+ }
+
+ if (!string.IsNullOrEmpty(fileName))
+ {
+ if (string.IsNullOrEmpty(reUrl))
+ {
+ reUrl += folderUrl + fileName;
+ }
+ else
+ {
+ reUrl += "," + folderUrl + fileName;
+ }
+ }
+ }
+ }
+
+ string url = Request.RequestUri.Scheme + "://" + Request.RequestUri.Host + ":" +
+ Request.RequestUri.Port +
+ "/JT/" + reUrl;
+
+ responeData.data = new {IDCard = APIIDCardInfoService.ReadIDCardInfo(url), IDCardUrl = reUrl,URL=url};
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+ #endregion
+
+ #region 小程序保存人员信息
+ ///
+ /// 小程序保存人员信息
+ ///
+ /// 人员信息
+ ///
+ [HttpPost]
+ public Model.ResponeData SavePerson([FromBody] Model.PersonItem person)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
+ {
+ if (person != null && !string.IsNullOrEmpty(person.IdentityCard))
+ {
+ var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == person.IdentityCard.Trim() && x.ProjectId == person.ProjectId);
+ if (getPerson != null)
+ {
+ responeData.code = -1;
+ responeData.message = "该身份证号码已存在两条记录,请联系管理员处理!";
+ }
+ else
+ {
+
+ Model.SitePerson_Person newPerson = new Model.SitePerson_Person
+ {
+ PersonId = SQLHelper.GetNewID(),
+ ProjectId = person.ProjectId,
+ UnitId = person.UnitId,
+ PersonName = person.PersonName,
+ Sex = person.Sex ,
+ IdentityCard = person.IdentityCard,
+ Telephone = person.Telephone,
+ WorkPostId = person.WorkPostId,
+ IsUsedType = "2",
+ IsUsed = true,
+ IsCardUsed = false,
+
+ // IdcardType = "SHENFEN_ZHENGJIAN",
+ // IdcardAddress = person.IdcardAddress,
+ // IdcardForever = "N",
+ // IdcardStartDate = Funs.GetNewDateTime(person.IdcardStartDate),
+ // IdcardEndDate = Funs.GetNewDateTime(person.IdcardEndDate),
+ // Address = person.Address,
+ // OutResult = person.OutResult,
+ // Birthday = person.Birthday,
+ // InTime = Funs.GetNewDateTimeOrNow(person.InTime),
+ // Password = BLL.PersonService.GetPersonPassWord(person.IdentityCard),
+ // Isprint = "0",
+ };
+ PersonService.AddPerson(newPerson);
+
+ Model.ToDoItem toDoItem = new Model.ToDoItem
+ {
+ MenuId = Const.PersonListMenuId,
+ DataId = newPerson.PersonId + "#1",
+ UrlStr = person.AttachUrl1,
+ };
+ if (!string.IsNullOrEmpty(person.AttachUrl1))
+ {
+ APIUpLoadFileService.SaveAttachUrl(toDoItem);
+ }
+
+ toDoItem.DataId = newPerson.PersonId + "#5";
+ toDoItem.UrlStr = person.AttachUrl5;
+ if (!string.IsNullOrEmpty(person.AttachUrl5))
+ {
+ APIUpLoadFileService.SaveAttachUrl(toDoItem);
+ }
+
+ responeData.code = 1;
+ responeData.message = "新增人员成功!";
+ }
+ }
+ else
+ {
+ responeData.code = -1;
+ responeData.message = "人员信息有误!";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
+ #region 岗位列表
+
+ public Model.ResponeData getWorkPostList(string WorkPostName)
+ {
+ var responeData = new Model.ResponeData();
+ try
+ {
+ var list = (from x in Funs.DB.Base_WorkPost
+ orderby x.WorkPostCode
+ select new
+ {
+ x.WorkPostId,
+ x.WorkPostName
+ }).ToList();
+ if (!string.IsNullOrEmpty(WorkPostName))
+ {
+ list = list.Where(x => x.WorkPostName.Contains(WorkPostName)).ToList();
+ }
+ responeData.data = new { list };
+ }
+ catch (Exception ex)
+ {
+ responeData.code = 0;
+ responeData.message = ex.Message;
+ }
+
+ return responeData;
+ }
+
+ #endregion
+
}
}
\ No newline at end of file
diff --git a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
index 490bf3c..07add15 100644
--- a/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
+++ b/SUBQHSE/WebAPI/Filter/TestPermissionAttribute.cs
@@ -142,7 +142,17 @@ namespace WebAPI.Filter
///
///
///
- public static List lists = new List { "User*postLoginOn", "HazardRealTime*SaveHazardRealTime", "Api_14HJSync*OrganizationSync", "Api_14HJSync*UserSync", "HazardRegister*getHazardRegisterTotalCount", "HazardRegister*getHazardRegisterByProjectIdStates", "Project*pushProject" };
+ public static List lists = new List
+ {
+ "User*postLoginOn", "HazardRealTime*SaveHazardRealTime", "Api_14HJSync*OrganizationSync", "Api_14HJSync*UserSync", "HazardRegister*getHazardRegisterTotalCount", "HazardRegister*getHazardRegisterByProjectIdStates", "Project*pushProject"
+ , "IDCard*getIDCardInfo"
+ , "Person*SavePerson"
+ , "InformedConsentForm*updateSignTime"
+ , "InformedConsentForm*getFormByWorkPostName"
+ , "Person*PostAddUrl"
+ , "Person*getWorkPostList"
+ , "ProjectUnitPenetrate*getDataByProjectUnitId"
+ };
///
///