提交试车代码

This commit is contained in:
2023-12-25 14:19:31 +08:00
parent 1f08356eb1
commit 726c5116f4
51 changed files with 3545 additions and 599 deletions
@@ -44,7 +44,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
rootNode.ToolTip = "";
rootNode.EnableClickEvent = true;
this.tvControlItem.Nodes.Add(rootNode);
var decisions = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => x.ResponsibilityUser == this.CurrUser.UserId && x.ProjectId == this.CurrUser.LoginProjectId).ToList();
int[] state = { 3, 4, 5, 6 };
var decisions = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => x.ResponsibilityUser == this.CurrUser.UserId && state.Contains(x.ResponsibilityProposeSatate.Value) && x.ProjectId == this.CurrUser.LoginProjectId).ToList();
if (decisions.Count == 0) return;
//获取子系统主键
var subsystemids = decisions.ConvertAll(x => x.SubSystemId);
@@ -114,16 +115,16 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
/// </summary>
public void BindGrid()
{
string strSql = @"select a.DecisionId,a.ProjectId,a.SubSystemId,a.ProposeUser,puser.UserName as ProposeUserName,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.ResponsibilityConfirm,(case a.ResponsibilityConfirm when 0 then '待提交' when 1 then '未确认' when 2 then '确认退回' when 3 then '确认通过' else '待提交' end) as ResponsibilityConfirmName,a.ProposeConfirm,(case a.ProposeConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ProposeConfirmName,a.GeneraConfirm,(case a.GeneraConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as GeneraConfirmName,a.SupervisionConfirm,(case a.SupervisionConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as SupervisionConfirmName,a.OwnerConfirm,(case a.OwnerConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as OwnerConfirmName,a.ProposeConfirmData,a.ResponsibilityConfirmData,a.GeneraConfirmData,a.SupervisionConfirmData,a.OwnerConfirmData,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 puser on a.ProposeUser=puser.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.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId and a.ResponsibilityUser=@ResponsibilityUser and a.ResponsibilityConfirm>0 ";
string strSql = @"select a.DecisionId,a.ProjectId,a.SubSystemId,a.ProposeUser,puser.UserName as ProposeUserName,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.ResponsibilityProposeSatate,(case a.ResponsibilityProposeSatate when 0 then '待提交' when 1 then '提出人待处理' when 2 then '提出人处理退回' when 3 then '责任人待确认' when 4 then '责任人退回' when 5 then '责任人通过提出人待处理' when 6 then '提出人退回' when 7 then '提出人确认通过' else '' end) as ResponsibilityProposeSatateName,a.ProposeConfirm,(case a.ProposeConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ProposeConfirmName,a.ResponsibilityConfirm,(case a.ResponsibilityConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ResponsibilityConfirmName,a.ProposeConfirm,(case a.ProposeConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as ProposeConfirmName,a.GeneraConfirm,(case a.GeneraConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as GeneraConfirmName,a.SupervisionConfirm,(case a.SupervisionConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as SupervisionConfirmName,a.OwnerConfirm,(case a.OwnerConfirm when 1 then '未确认' when 2 then '确认通过' else '' end) as OwnerConfirmName,a.ProposeConfirmData,a.ResponsibilityConfirmData,a.GeneraConfirmData,a.SupervisionConfirmData,a.OwnerConfirmData,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 puser on a.ProposeUser=puser.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.SubSystemId=@SubSystemId and a.ProjectId=@ProjectId and a.ResponsibilityUser=@ResponsibilityUser and a.ResponsibilityProposeSatate in (3,4,5,6) ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@SubSystemId", this.SsubSystemId));
listStr.Add(new SqlParameter("@ResponsibilityUser", this.CurrUser.UserId));
//是否确认
if (!string.IsNullOrWhiteSpace(ddlResponsibilityConfirm.SelectedValue))
//提出人/责任人处理状态
if (!string.IsNullOrWhiteSpace(ddlResponsibilityProposeSatate.SelectedValue))
{
strSql += " and a.ResponsibilityConfirm=@ResponsibilityConfirm";
listStr.Add(new SqlParameter("@ResponsibilityConfirm", ddlResponsibilityConfirm.SelectedValue));
strSql += " and a.ResponsibilityProposeSatate=@ResponsibilityProposeSatate";
listStr.Add(new SqlParameter("@ResponsibilityProposeSatate", ddlResponsibilityProposeSatate.SelectedValue));
}
//是否关闭
if (!string.IsNullOrWhiteSpace(ddlDecisionState.Text))
@@ -216,9 +217,10 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
var model = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == Grid1.SelectedRowID);
if (model != null)
{
if (model.ResponsibilityConfirm != 1)
int[] arr = { 3, 6 };
if (!arr.Contains(model.ResponsibilityProposeSatate.Value))
{
Alert.ShowInTop("责任人“未确认”才可进行责任人确认操作", MessageBoxIcon.Warning);
Alert.ShowInTop("仅“责任人确认”和“提出人退回”状态才可进行责任人确认!", MessageBoxIcon.Warning);
return;
}
}