20230630
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--获取当前人项目级待办事项
|
--获取当前人项目级待办事项
|
||||||
ALTER PROCEDURE [dbo].[Sp_Project_GetToDoItems]
|
ALTER PROCEDURE [dbo].[Sp_Project_GetToDoItems]
|
||||||
@projectId NVARCHAR(50)=NULL,
|
@projectId NVARCHAR(50)=NULL,
|
||||||
@@ -41,9 +38,17 @@ WHERE ActionPlan.ProjectId=@projectId and ActionPlan.ActionPlanListId in (select
|
|||||||
|
|
||||||
ORDER BY DataTime DESC
|
ORDER BY DataTime DESC
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE ProjectSupervision_CheckNotice ADD DepartId NVARCHAR(50) NULL
|
||||||
|
GO
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectSupervision_CheckNotice', @level2type=N'COLUMN',@level2name=N'DepartId'
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[ProjectSupervision_CheckNotice] WITH CHECK ADD CONSTRAINT [FK_ProjectSupervision_CheckNotice_Base_Depart] FOREIGN KEY([DepartId])
|
||||||
|
REFERENCES [dbo].[Base_Depart] ([DepartId])
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[ProjectSupervision_CheckNotice] CHECK CONSTRAINT [FK_ProjectSupervision_CheckNotice_Base_Depart]
|
||||||
|
GO
|
||||||
|
|
||||||
|
|||||||
@@ -191,42 +191,34 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||||||
projectId = str[1];
|
projectId = str[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
string strSql = @"SELECT SitePerson.ProjectId,SitePerson.SitePersonId,SitePerson.PersonId,SitePerson.PersonName,SitePerson.IdentityCard,SitePerson.CardNo,SitePerson.PersonName
|
string strSql = @"SELECT ProjectId,SitePersonId,PersonId,PersonName,IdentityCard,CardNo,PersonName
|
||||||
,SitePerson.WorkPostId,WorkPostName,SitePerson.UnitId,Unit.UnitName,SitePerson.TeamGroupId,TeamGroup.TeamGroupName,SitePerson.InTime,SitePerson.RealNameAddTime,SitePerson.States,
|
,WorkPostId,WorkPostName,UnitId,UnitName,TeamGroupId,TeamGroupName,InTime,RealNameAddTime,States, TrainCount,TrainCount1
|
||||||
(SELECT COUNT(*) FROM EduTrain_TrainRecordDetail T
|
FROM View_SitePerson_Person
|
||||||
LEFT JOIN EduTrain_TrainRecord AS E ON T.TrainingId=E.TrainingId
|
Where ProjectId=@ProjectId ";
|
||||||
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>
|
List<SqlParameter> listStr = new List<SqlParameter>
|
||||||
{
|
{
|
||||||
new SqlParameter("@ProjectId", this.ProjectId)
|
new SqlParameter("@ProjectId", this.ProjectId)
|
||||||
};
|
};
|
||||||
if (!string.IsNullOrEmpty(unitId) && unitId != "0")
|
if (!string.IsNullOrEmpty(unitId) && unitId != "0")
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.UnitId =@UnitId ";
|
strSql += " AND UnitId =@UnitId ";
|
||||||
listStr.Add(new SqlParameter("@UnitId", unitId));
|
listStr.Add(new SqlParameter("@UnitId", unitId));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.PersonName LIKE @PersonName";
|
strSql += " AND PersonName LIKE @PersonName";
|
||||||
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
|
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.IdentityCard LIKE @IdentityCard";
|
strSql += " AND IdentityCard LIKE @IdentityCard";
|
||||||
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
|
if (!string.IsNullOrEmpty(this.drpTreamGroup.SelectedValue) && this.drpTreamGroup.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.TeamGroupId = @TeamGroupId";
|
strSql += " AND TeamGroupId = @TeamGroupId";
|
||||||
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
|
listStr.Add(new SqlParameter("@TeamGroupId", this.drpTreamGroup.SelectedValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +230,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " OR SitePerson.WorkPostId = @WorkPostId" + i.ToString();
|
strSql += " OR WorkPostId = @WorkPostId" + i.ToString();
|
||||||
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
|
listStr.Add(new SqlParameter("@WorkPostId" + i.ToString(), item));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,19 +241,19 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||||||
}
|
}
|
||||||
if (this.ckTrain.Checked)
|
if (this.ckTrain.Checked)
|
||||||
{
|
{
|
||||||
strSql += " AND TrainCount =0";
|
strSql += " AND (TrainCount =0 AND TrainCount1 =0)";
|
||||||
}
|
}
|
||||||
if (this.ckIsUsed.Checked)
|
if (this.ckIsUsed.Checked)
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.States ='1'";
|
strSql += " AND States ='1'";
|
||||||
}
|
}
|
||||||
if (this.ckJT.Checked)
|
if (this.ckJT.Checked)
|
||||||
{
|
{
|
||||||
strSql += " AND SitePerson.RealNameAddTime IS NULL";
|
strSql += " AND RealNameAddTime IS NULL";
|
||||||
}
|
}
|
||||||
if (this.ckIdCardInfoNotOK.Checked)
|
if (this.ckIdCardInfoNotOK.Checked)
|
||||||
{
|
{
|
||||||
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)";
|
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)";
|
||||||
}
|
}
|
||||||
|
|
||||||
SqlParameter[] parameter = listStr.ToArray();
|
SqlParameter[] parameter = listStr.ToArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user