This commit is contained in:
2023-06-28 16:55:21 +08:00
13 changed files with 252 additions and 93 deletions
@@ -149,5 +149,46 @@ namespace BLL
{
return (from x in Funs.DB.EduTrain_TrainRecord where x.TrainStartDate < time && x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 获取培训结果
/// </summary>
/// <param name="WorkStage"></param>
/// <returns></returns>
public static string ConvertTrainResult(object sitepersonId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string result = string.Empty;
var getSiteperson = SitePerson_PersonService.GetSitePersonById(sitepersonId.ToString());
if (getSiteperson != null)
{
List<Model.Base_TrainType> trainTypeList = BLL.TrainTypeService.GetIsAboutSendCardTrainTypeList();
int i = 0; //培训合格次数
foreach (var item in trainTypeList)
{
var q = (from x in db.EduTrain_TrainRecord
join y in db.EduTrain_TrainRecordDetail
on x.TrainingId equals y.TrainingId
where x.TrainTypeId == item.TrainTypeId && y.PersonId == getSiteperson.PersonId
&& x.ProjectId == getSiteperson.ProjectId
&& y.CheckResult == true
select y);
i += q.Count();
}
if (i >= trainTypeList.Count)
{
result = "通过";
}
else
{
result = "未通过";
}
}
return result;
}
}
}
}
@@ -44,7 +44,7 @@ namespace BLL
/// <param name="states"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, string personType, Grid Grid1)
public static IEnumerable getListData(string projetcId, string unitId, string departId, string workPostId, string name, string idCard, string states, string personType, Grid Grid1)
{
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
@@ -55,6 +55,10 @@ namespace BLL
{
getDataList = getDataList.Where(e => e.UnitId == unitId);
}
if (!string.IsNullOrEmpty(departId) && departId != Const._Null)
{
getDataList = getDataList.Where(e => e.DepartId == departId);
}
if (!string.IsNullOrEmpty(workPostId) && workPostId != Const._Null)
{
getDataList = getDataList.Where(e => e.WorkPostId == workPostId);
@@ -696,33 +700,42 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == person.IdentityCard && x.ProjectId == person.ProjectId);
if (getPerson == null)
{
SitePersonId = person.SitePersonId,
PersonId = person.PersonId,
CardNo = person.CardNo,
PersonName = person.PersonName,
UnitId = person.UnitId,
IdentityCard = person.IdentityCard,
ProjectId = person.ProjectId,
TeamGroupId = person.TeamGroupId,
WorkAreaId = person.WorkAreaId,
WorkPostId = person.WorkPostId,
RoleIds = person.RoleIds,
OutTime = person.OutTime,
OutResult = person.OutResult,
AuditorId = person.AuditorId,
AuditorDate = person.AuditorDate,
InTime = person.InTime.HasValue ? person.InTime : DateTime.Now,
Isprint = "0",
States = person.States,
IsSafetyMonitoring=person.IsSafetyMonitoring,
};
Model.SitePerson_Person newPerson = new Model.SitePerson_Person
{
SitePersonId = person.SitePersonId,
PersonId = person.PersonId,
CardNo = person.CardNo,
PersonName = person.PersonName,
UnitId = person.UnitId,
IdentityCard = person.IdentityCard,
ProjectId = person.ProjectId,
TeamGroupId = person.TeamGroupId,
WorkAreaId = person.WorkAreaId,
WorkPostId = person.WorkPostId,
RoleIds = person.RoleIds,
OutTime = person.OutTime,
OutResult = person.OutResult,
AuditorId = person.AuditorId,
AuditorDate = person.AuditorDate,
InTime = person.InTime.HasValue ? person.InTime : DateTime.Now,
Isprint = "0",
States = person.States,
IsSafetyMonitoring = person.IsSafetyMonitoring,
};
////现场人员项目出入场记录
SitePerson_PersonItemService.SetPersonItemInOut(newPerson, null);
db.SitePerson_Person.InsertOnSubmit(newPerson);
db.SubmitChanges();
////现场人员项目出入场记录
SitePerson_PersonItemService.SetPersonItemInOut(newPerson, null);
db.SitePerson_Person.InsertOnSubmit(newPerson);
db.SubmitChanges();
}
else
{
person.SitePersonId = getPerson.SitePersonId;
UpdateSitePerson(person, null);
}
}
}
@@ -875,15 +888,22 @@ namespace BLL
/// <param name="sitePersonId">人员Id</param>
public static void DeleteSitePersonById(string sitePersonId)
{
var person = Funs.DB.SitePerson_Person.FirstOrDefault(e => e.SitePersonId == sitePersonId);
if (person != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
////现场人员项目出入场记录
person.States = Const.ProjectPersonStates_2;
SitePerson_PersonItemService.SetPersonItemInOut(person, null);
var person = db.SitePerson_Person.FirstOrDefault(e => e.SitePersonId == sitePersonId);
if (person != null)
{
var getSitePersons = db.SitePerson_Person.Where(x => x.IdentityCard == person.IdentityCard && x.ProjectId == person.ProjectId);
if (getSitePersons.Count() == 1)
{
////现场人员项目出入场记录
person.States = Const.ProjectPersonStates_2;
SitePerson_PersonItemService.SetPersonItemInOut(person, null);
}
Funs.DB.SitePerson_Person.DeleteOnSubmit(person);
Funs.DB.SubmitChanges();
db.SitePerson_Person.DeleteOnSubmit(person);
db.SubmitChanges();
}
}
}
@@ -3365,6 +3365,7 @@
</Compile>
<Compile Include="PHTGL\BiddingManagement\BidDocumentsReviewDetail.aspx.cs">
<DependentUpon>BidDocumentsReviewDetail.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PHTGL\BiddingManagement\BidDocumentsReviewDetail.aspx.designer.cs">
<DependentUpon>BidDocumentsReviewDetail.aspx</DependentUpon>
@@ -39,12 +39,12 @@
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="增加" Icon="Add" runat="server" Hidden="true" OnClick="btnNew_Click">
<f:Button ID="btnNew" Text="增加" Icon="Add" runat="server" Hidden="true" OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<f:Button ID="btnRefresh" ToolTip="刷明细" Icon="ArrowRefresh" runat="server" Hidden="true" OnClick="btnRefresh_Click">
<f:Button ID="btnRefresh" Text="刷明细" Icon="ArrowRefresh" runat="server" Hidden="true" OnClick="btnRefresh_Click">
</f:Button>
</Items>
</f:Toolbar>
@@ -191,34 +191,42 @@ namespace FineUIPro.Web.HSSE.SitePerson
projectId = str[1];
}
string strSql = @"SELECT ProjectId,SitePersonId,PersonId,PersonName,IdentityCard,CardNo,PersonName
,WorkPostId,WorkPostName,UnitId,UnitName,TeamGroupId,TeamGroupName,InTime,RealNameAddTime,States,TrainCount,TrainCount1
FROM View_SitePerson_Person
Where ProjectId=@ProjectId ";
string strSql = @"SELECT SitePerson.ProjectId,SitePerson.SitePersonId,SitePerson.PersonId,SitePerson.PersonName,SitePerson.IdentityCard,SitePerson.CardNo,SitePerson.PersonName
,SitePerson.WorkPostId,WorkPostName,SitePerson.UnitId,Unit.UnitName,SitePerson.TeamGroupId,TeamGroup.TeamGroupName,SitePerson.InTime,SitePerson.RealNameAddTime,SitePerson.States,
(SELECT COUNT(*) FROM EduTrain_TrainRecordDetail T
LEFT JOIN EduTrain_TrainRecord AS E ON T.TrainingId=E.TrainingId
WHERE T.PersonId=SitePerson.PersonId AND E.ProjectId=SitePerson.ProjectId AND T.CheckResult=1) AS TrainCount,
(SELECT COUNT(*) FROM Training_TestRecord R
WHERE R.TestManId=SitePerson.PersonId AND R.ProjectId=SitePerson.ProjectId and R.TestScores > ISNULL((SELECT TOP 1 PassingScore FROM Sys_TestRule),60)) AS TrainCount1
FROM SitePerson_Person AS SitePerson
LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = SitePerson.UnitId
LEFT JOIN Base_WorkPost AS Post ON Post.WorkPostId = SitePerson.WorkPostId
LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON TeamGroup.TeamGroupId=SitePerson.TeamGroupId
Where SitePerson.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ProjectId", this.ProjectId)
};
if (!string.IsNullOrEmpty(unitId) && unitId != "0")
{
strSql += " AND UnitId =@UnitId ";
strSql += " AND SitePerson.UnitId =@UnitId ";
listStr.Add(new SqlParameter("@UnitId", unitId));
}
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
{
strSql += " AND PersonName LIKE @PersonName";
strSql += " AND SitePerson.PersonName LIKE @PersonName";
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
{
strSql += " AND IdentityCard LIKE @IdentityCard";
strSql += " AND SitePerson.IdentityCard LIKE @IdentityCard";
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
{
strSql += " AND TeamGroupId = @TeamGroupId";
strSql += " AND SitePerson.TeamGroupId = @TeamGroupId";
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
}
@@ -230,7 +238,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
{
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
strSql += " OR SitePerson.WorkPostId = @WorkPostId" + i.ToString();
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
}
@@ -245,15 +253,15 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
if (this.ckIsUsed.Checked)
{
strSql += " AND States ='1'";
strSql += " AND SitePerson.States ='1'";
}
if (this.ckJT.Checked)
{
strSql += " AND RealNameAddTime IS NULL";
strSql += " AND SitePerson.RealNameAddTime IS NULL";
}
if (this.ckIdCardInfoNotOK.Checked)
{
strSql += " AND (IdcardType is null or IdentityCard is null or PhotoUrl is null or HeadImage IS NULL OR (LEN(IdentityCard) != 15 AND LEN(IdentityCard) != 18) or TeamGroupId is null or WorkPostId is null)";
strSql += " AND (SitePerson.IdcardType is null or SitePerson.IdentityCard is null or SitePerson.PhotoUrl is null or SitePerson.HeadImage IS NULL OR (LEN(SitePerson.IdentityCard) != 15 AND LEN(SitePersonIdentityCard) != 18) or SitePerson.TeamGroupId is null or SitePerson.WorkPostId is null)";
}
SqlParameter[] parameter = listStr.ToArray();
@@ -76,7 +76,7 @@
</f:RenderField>
<f:TemplateField ColumnID="tflTrainResult" Width="100px" HeaderText="培训结果" HeaderTextAlign="Center" TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTrainResult" runat="server" Text='<%# ConvertTrainResult(Eval("SitePersonId")) %>'></asp:Label>
<asp:Label ID="lblTrainResult" runat="server" Text='<%# BLL.EduTrain_TrainRecordService.ConvertTrainResult(Eval("SitePersonId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
@@ -190,7 +190,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
else
{
if (ConvertTrainResult(person.PersonId) == "通过")
if (EduTrain_TrainRecordService.ConvertTrainResult(person.PersonId) == "通过")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReadWriteCard.aspx?PersonId={0}", this.SitePersonId, "发卡 - ")));
}
@@ -225,49 +225,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
}
}
#endregion
#region
/// <summary>
/// 获取培训结果
/// </summary>
/// <param name="WorkStage"></param>
/// <returns></returns>
protected string ConvertTrainResult(object sitepersonId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string result = string.Empty;
var getSiteperson = SitePerson_PersonService.GetSitePersonById(sitepersonId.ToString());
if (getSiteperson != null)
{
List<Model.Base_TrainType> trainTypeList = BLL.TrainTypeService.GetIsAboutSendCardTrainTypeList();
int i = 0; //培训合格次数
foreach (var item in trainTypeList)
{
var q = (from x in db.EduTrain_TrainRecord
join y in db.EduTrain_TrainRecordDetail
on x.TrainingId equals y.TrainingId
where x.TrainTypeId == item.TrainTypeId && y.PersonId == getSiteperson.PersonId
&& x.ProjectId == getSiteperson.ProjectId
&& y.CheckResult == true
select y);
i += q.Count();
}
if (i >= trainTypeList.Count)
{
result = "通过";
}
else
{
result = "未通过";
}
}
return result;
}
}
#endregion
#endregion
#region
/// 导出按钮
@@ -33,6 +33,9 @@
</f:DropDownList>
<f:DropDownList runat="server" ID="drpUnit" EnableEdit="true" EnableAjax="false"
LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="btSearch_Click">
</f:DropDownList>
<f:DropDownList runat="server" ID="drpDepart" EnableEdit="true"
LabelAlign="Right" EmptyText="按部门" AutoPostBack="true" OnSelectedIndexChanged="btSearch_Click">
</f:DropDownList>
<f:DropDownList runat="server" ID="drpWorkPost" EnableEdit="true" EnableAjax="false" Width="150px"
LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="btSearch_Click">
@@ -25,6 +25,8 @@ namespace FineUIPro.Web.Person
Funs.FineUIPleaseSelect(drpProject, "按项目查询");
Funs.FineUIPleaseSelect(drpUnit, "按单位查询");
DepartService.InitDepartDropDownList(this.drpDepart, false);
Funs.FineUIPleaseSelect(drpDepart, "按部门查询");
WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false);
Funs.FineUIPleaseSelect(drpWorkPost, "按岗位查询");
DropListService.InitConstDropDownList(this.drpPersonType, DropListService.Group_PersonType, false);
@@ -94,7 +96,7 @@ namespace FineUIPro.Web.Person
/// </summary>
private void BindGrid()
{
var getData = SitePerson_PersonService.getListData(this.drpProject.SelectedValue, this.drpUnit.SelectedValue, this.drpWorkPost.SelectedValue,
var getData = SitePerson_PersonService.getListData(this.drpProject.SelectedValue, this.drpUnit.SelectedValue,this.drpDepart.SelectedValue, this.drpWorkPost.SelectedValue,
this.txtPersonName.Text.Trim(), this.txtIdCard.Text.Trim(), this.rbIsPostStates.SelectedValue, this.drpPersonType.SelectedValue, Grid1);
Grid1.RecordCount = SitePerson_PersonService.count;
Grid1.DataSource = getData;
@@ -77,6 +77,15 @@ namespace FineUIPro.Web.Person
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// drpDepart 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDepart;
/// <summary>
/// drpWorkPost 控件。
/// </summary>
+18
View File
@@ -283058,6 +283058,8 @@ namespace Model
private string _UnitId;
private string _DepartId;
private System.Nullable<System.DateTime> _Birthday;
private string _TeamGroupId;
@@ -283364,6 +283366,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DepartId", DbType="NVarChar(50)")]
public string DepartId
{
get
{
return this._DepartId;
}
set
{
if ((this._DepartId != value))
{
this._DepartId = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Birthday", DbType="DateTime")]
public System.Nullable<System.DateTime> Birthday
{