提交试车代码
This commit is contained in:
@@ -43,7 +43,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
rootNode.ToolTip = "";
|
||||
rootNode.EnableClickEvent = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode);
|
||||
var decisions = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && (x.ProposeUser == this.CurrUser.UserId || x.GeneraUser == this.CurrUser.UserId || x.SupervisionUser == this.CurrUser.UserId || x.OwnerUser == this.CurrUser.UserId)).ToList();
|
||||
var decisions = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.ProposeConfirm == 2 && (x.GeneraUser == this.CurrUser.UserId || x.SupervisionUser == this.CurrUser.UserId || x.OwnerUser == this.CurrUser.UserId)).ToList();
|
||||
if (decisions.Count == 0) return;
|
||||
//获取子系统主键
|
||||
var subsystemids = decisions.ConvertAll(x => x.SubSystemId);
|
||||
@@ -113,10 +113,9 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string tcrSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.ProposeUser as ConfirmUser,cuser.UserName as ConfirmUserName,2 as ConfirmType,'提出人' as ConfirmTypeName,a.ProposeConfirm as ConfirmState,(case a.ProposeConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.ProposeConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime, '') when '' then 0 else DATEDIFF(DAY, GETDATE(), a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.ProposeUser = cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser = ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit = unit.UnitId where 1 = 1 and a.ResponsibilityConfirm = 3 and a.SubSystemId = @SubSystemId and a.ProjectId = @ProjectId ";
|
||||
string zbSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.GeneraUser as ConfirmUser,cuser.UserName as ConfirmUserName,3 as ConfirmType,'总包' as ConfirmTypeName,a.GeneraConfirm as ConfirmState,(case a.GeneraConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.GeneraConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.GeneraUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ResponsibilityConfirm=3 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
string jlSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.SupervisionUser as ConfirmUser,cuser.UserName as ConfirmUserName,4 as ConfirmType,'监理' as ConfirmTypeName,a.SupervisionConfirm as ConfirmState,(case a.SupervisionConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.SupervisionConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.SupervisionUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ResponsibilityConfirm=3 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
string yzSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.OwnerUser as ConfirmUser,cuser.UserName as ConfirmUserName,5 as ConfirmType,'业主' as ConfirmTypeName,a.OwnerConfirm as ConfirmState,(case a.OwnerConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.OwnerConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.OwnerUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ResponsibilityConfirm=3 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
string zbSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.GeneraUser as ConfirmUser,cuser.UserName as ConfirmUserName,4 as ConfirmType,'总包' as ConfirmTypeName,a.GeneraConfirm as ConfirmState,(case a.GeneraConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.GeneraConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.GeneraUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ProposeConfirm=2 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
string jlSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.SupervisionUser as ConfirmUser,cuser.UserName as ConfirmUserName,5 as ConfirmType,'监理' as ConfirmTypeName,a.SupervisionConfirm as ConfirmState,(case a.SupervisionConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.SupervisionConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.SupervisionUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ProposeConfirm=2 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
string yzSql = "select NewId() as Id,a.DecisionId,a.ProjectId,a.SubSystemId,a.ResponsibilityUser,ruser.UserName as ResponsibilityUserName,a.ResponsibilityUnit,unit.UnitName as ResponsibilityUnitName,a.QuestionDesc,a.Level,a.Speciality,a.AskDestructionTime,a.RealityDestructionTime,a.RestrictCondition,a.OwnerUser as ConfirmUser,cuser.UserName as ConfirmUserName,6 as ConfirmType,'业主' as ConfirmTypeName,a.OwnerConfirm as ConfirmState,(case a.OwnerConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ConfirmStateName,a.OwnerConfirmData as ConfirmData,a.DecisionIsClose,(case a.DecisionIsClose when 1 then '已关闭' else '未关闭' end) as DecisionIsCloseName,(case ISNULL(a.AskDestructionTime,'') when '' then 0 else DATEDIFF(DAY, GETDATE(),a.AskDestructionTime) end) as DestructionDiffDay,a.AddUser,a.AddTime,a.Sort from PreRun_SubThreeChecksFourDecision as a left join Sys_User as cuser on a.OwnerUser=cuser.UserId left join Sys_User as ruser on a.ResponsibilityUser=ruser.UserId left join Base_Unit as unit on a.ResponsibilityUnit=unit.UnitId where 1=1 and a.ProposeConfirm=2 and a.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@SubSystemId", this.SsubSystemId));
|
||||
@@ -133,7 +132,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
where += " and isnull(t.DecisionIsClose,0)=@DecisionIsClose";
|
||||
listStr.Add(new SqlParameter("@DecisionIsClose", ddlDecisionState.SelectedValue));
|
||||
}
|
||||
string strSql = $"select * from ({tcrSql} union all {zbSql} union all {jlSql} union all {yzSql} ) as t where 1=1 {where} order by t.ConfirmType,t.AddTime desc";
|
||||
string strSql = $"select * from ({zbSql} union all {jlSql} union all {yzSql} ) as t where 1=1 {where} order by t.ConfirmType,t.AddTime desc";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
|
||||
Reference in New Issue
Block a user