提交代码

This commit is contained in:
2024-01-05 09:40:50 +08:00
parent 97015c50ec
commit ba149177c6
65 changed files with 9695 additions and 244 deletions
@@ -49,8 +49,8 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:Label runat="server" ID="lblQuestionDesc" Label="整改问题描述" LabelAlign="Right"></f:Label>
<f:Label runat="server" ID="lblRestrictCondition" Label="整改方法/制约条件" LabelAlign="Right"></f:Label>
<f:Label runat="server" ID="lblQuestionDesc" LabelWidth="120px" Label="整改问题描述" LabelAlign="Right"></f:Label>
<f:Label runat="server" ID="lblRestrictCondition" LabelWidth="150px" Label="整改方法/制约条件" LabelAlign="Right"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
@@ -49,15 +49,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
set { ViewState["QuestionEditImg"] = value; }
}
///// <summary>
///// 整改图片是否可编辑
///// </summary>
//public int RectifyEditImg
//{
// get { return (int)ViewState["RectifyEditImg"]; }
// set { ViewState["RectifyEditImg"] = value; }
//}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
@@ -454,6 +445,9 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
{
Funs.DB.PreRun_InspectTailTerm.InsertOnSubmit(model);
}
//判断尾项是否保存
var itemModel = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.TermItemId == this.TermItemId);
if (itemModel != null) itemModel.InspectionResults = 0;
Funs.DB.SubmitChanges();
ShowNotify("操作成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@@ -18,8 +18,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
if (!IsPostBack)
{
InitTreeMenu();
//绑定数据
//BindGrid();
}
}
@@ -43,7 +43,7 @@
<f:FileUpload runat="server" ID="fileData" LabelAlign="Right" EmptyText="请选择Excel文件" Label="附件" Required="true" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnImport" runat="server" OnClick="btnImport_Click" Text="导入"></f:Button>
<f:ToolbarFill ID="ToolbarFill" runat="server"></f:ToolbarFill>
<f:Button ID="btnExport" runat="server" Icon="ApplicationGo" Text="导出" ToolTip="导出" OnClick="btnExport_Click"></f:Button>
<f:Button ID="btnExport" runat="server" Icon="ApplicationGo" Text="导出" ToolTip="导出" OnClick="btnExport_Click" EnableAjax="false"></f:Button>
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="FilmSave" runat="server" OnClick="btnSave_Click"></f:Button>
</Items>
</f:Toolbar>
@@ -56,7 +56,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
/// </summary>
private void BindGrid()
{
string strSql = @"select * from PreRun_PropertySysPiping where ProjectId=@ProjectId and SystemId=@SystemId ";
string strSql = @"select * from PreRun_PropertySysPiping where ProjectId=@ProjectId and SystemId=@SystemId and PropertyId not in (select PropertyId from PreRun_SubPropertySelect where SystemId=@SystemId) ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@SystemId", this.SystemId));
@@ -57,7 +57,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
/// </summary>
private void BindGrid()
{
string strSql = @"select * from PreRun_TechnologySysPiping where ProjectId=@ProjectId and SystemId=@SystemId ";
string strSql = @"select * from PreRun_TechnologySysPiping where ProjectId=@ProjectId and SystemId=@SystemId and TechnologyId not in (select TechnologyId from PreRun_SubTechnologySelect where SystemId=@SystemId) ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@SystemId", this.SystemId));
@@ -43,8 +43,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
join b in Funs.DB.PreRun_SubSysWorkPackage on a.PreRunId equals b.SubSystemId
join c in Funs.DB.PreRun_WorkPackage on b.WorkPackId equals c.WorkPackId
where a.ProjectId == this.CurrUser.LoginProjectId
orderby a.Sort, a.PreRunLevel ascending
select new { a.PreRunId, a.SystemId, a.PreRunCode, a.PreRunName, a.ProjectId, c.WorkPackId, c.WorkPackName, b.WorkPackCode };
orderby a.Sort, a.PreRunLevel
select new { a.PreRunId, a.SystemId, a.PreRunCode, a.PreRunName, a.ProjectId, c.WorkPackId, c.WorkPackName, b.WorkPackCode, a.Sort };
if (list.Count() > 0)
{
@@ -64,8 +64,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
rootFirstNode.EnableExpandEvent = false;
rootNode.Nodes.Add(rootFirstNode);
rootFirstNode.Expanded = true;
var subList = list.Where(g => g.SystemId == itemSys.PreRunId).GroupBy(x => new { x.PreRunId, x.SystemId, x.PreRunCode, x.PreRunName });
foreach (var item in subList)
var subList = list.Where(g => g.SystemId == itemSys.PreRunId).GroupBy(x => new { x.PreRunId, x.SystemId, x.PreRunCode, x.PreRunName, x.Sort });
foreach (var item in subList.OrderBy(o => o.Key.Sort))
{
TreeNode rootUnitNode = new TreeNode();//定义根节点
rootUnitNode.NodeID = item.Key.PreRunId;
@@ -827,7 +827,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
else
{
ddbSysPiping.Values = null;
ddbSysPiping.Values = null;
ddbSysPiping.Texts = null;
cbSysPiping.Items.Clear();
cbSysPiping.Items.Insert(0, new CheckItem("==无数据==", ""));
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -232,7 +233,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
if (!string.IsNullOrWhiteSpace(this.SsubSystemId))
{
var result = new List<WorkData>();
var data = from a in Funs.DB.PreRun_WorkPackage.Where(p => workPackIds.Contains(p.WorkPackId))
var queryData = from a in Funs.DB.PreRun_WorkPackage.Where(p => workPackIds.Contains(p.WorkPackId))
join b in Funs.DB.PreRun_SubSysWorkPackage.Where(p => p.SubSystemId == this.SsubSystemId) on a.WorkPackId equals b.WorkPackId into bb
from t in bb.DefaultIfEmpty()
select new WorkData()
@@ -244,10 +245,10 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
Sort = a.Sort,
Remark = t.Remark
};
if (data.Count() > 0)
if (queryData.Count() > 0)
{
int num = 1;
int i = 1;
var data = queryData.ToList();
foreach (var item in data.OrderBy(p => p.Sort))
{
var model = new WorkData();
@@ -256,14 +257,13 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
model.SystemId = item.SystemId;
if (string.IsNullOrWhiteSpace(item.WorkPackCode))
{
var workpackages = Funs.DB.TestRun_SubSysWorkPackage.Where(p => p.SystemId == this.SystemId).ToList();
if (workpackages.Count > 0)
var workpackages = data.Where(x => !string.IsNullOrWhiteSpace(x.WorkPackCode)).ToList();
if (num == 1)
{
num = workpackages.ConvertAll(x => int.Parse(x.WorkPackCode.Replace("WP", ""))).Max(m => m);
if (workpackages.Count > 0) num = workpackages.ConvertAll(x => int.Parse(x.WorkPackCode.Replace("WP", ""))).Max(m => m) + 1;
}
num = num + i;
model.WorkPackCode = $"WP{string.Format("{0:d3}", num)}";
i++;
num++;
}
else
{
@@ -273,7 +273,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
model.Remark = item.Remark;
result.Add(model);
}
result = result.OrderBy(p => p.Sort).ToList();
result = result.OrderBy(p => int.Parse(Regex.Replace(p.WorkPackCode, @"\D", ""))).ToList();
Grid1.DataSource = result;
Grid1.DataBind();
}
@@ -41,7 +41,7 @@
</f:Tree>
</Items>
</f:Panel>
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="三查四定检查记录" EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="DecisionId,DecisionIsClose" DataIDField="DecisionId" AllowSorting="true" SortField="Sort" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" AllowFilters="true" EnableTextSelection="True" EnableMultiSelect="false" EnableCheckBoxSelect="true" OnRowDataBound="Grid1_RowDataBound">
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="三查四定检查记录" EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="DecisionId,DecisionIsClose" DataIDField="DecisionId" AllowSorting="true" SortField="Sort" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" AllowFilters="true" EnableTextSelection="True" EnableMultiSelect="true" EnableCheckBoxSelect="true" OnRowDataBound="Grid1_RowDataBound">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
@@ -265,6 +265,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
if (Grid1.SelectedRowIndexArray.Length > 1)
{
Alert.ShowInTop("只能选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SubThreeChecksFourDecisionEdit.aspx?DecisionId={0}&IsView=true", Grid1.SelectedRowID, "查看 - ")));
}
@@ -286,17 +291,18 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
var model = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == Grid1.SelectedRowID);
if (model != null)
var ids = Grid1.SelectedRowIDArray.ToList();
var list = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => ids.Contains(x.DecisionId)).ToList();
if (list.Count > 0)
{
var states = new List<int>() { 0, 2 };
if (!states.Contains(model.ResponsibilityConfirm.Value))
var nodeletes = list.Where(x => !states.Contains(x.ResponsibilityProposeSatate.GetValueOrDefault())).ToList();
if (nodeletes.Count > 0)
{
Alert.ShowInTop("责任人“待提交”和“确认退回”才可进行删除操作!", MessageBoxIcon.Warning);
Alert.ShowInTop($"编号({string.Join(",", nodeletes.ConvertAll(x => x.FourDecisionCode))})状态不允许删除,仅“待提交”和“确认退回”才可进行删除操作!", MessageBoxIcon.Warning);
return;
}
Funs.DB.PreRun_SubThreeChecksFourDecision.DeleteOnSubmit(model);
Funs.DB.PreRun_SubThreeChecksFourDecision.DeleteAllOnSubmit(list);
Funs.DB.SubmitChanges();
BindGrid();
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
@@ -329,21 +335,67 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
var model = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == Grid1.SelectedRowID);
if (model != null)
var ids = Grid1.SelectedRowIDArray.ToList();
var list = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => ids.Contains(x.DecisionId)).ToList();
if (list.Count > 0)
{
int state = model.ResponsibilityProposeSatate == null ? 0 : model.ResponsibilityProposeSatate.Value;
int[] stateArr = { 0, 2 };
if (stateArr.Contains(state))
var states = new List<int>() { 0, 2 };
var nodeletes = list.Where(x => !states.Contains(x.ResponsibilityProposeSatate.GetValueOrDefault())).ToList();
if (nodeletes.Count > 0)
{
Alert.ShowInTop("仅“待提交”和“提出人处理退回”状态才可提交提出人处理!", MessageBoxIcon.Warning);
Alert.ShowInTop($"编号({string.Join(",", nodeletes.ConvertAll(x => x.FourDecisionCode))})状态不允许提交,仅“待提交”和“处理退回”状态才可提交提出人处理!", MessageBoxIcon.Warning);
return;
}
model.ResponsibilityProposeSatate = 1;
Funs.DB.SubmitChanges();
BindGrid();
Alert.ShowInTop("确认成功", MessageBoxIcon.Success);
var isNullResponsibilityUnit = list.Where(x => string.IsNullOrWhiteSpace(x.ResponsibilityUnit)).ToList();
if (isNullResponsibilityUnit.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullResponsibilityUnit.ConvertAll(x => x.FourDecisionCode))})责任单位为空", MessageBoxIcon.Warning);
return;
}
var isNullResponsibilityUser = list.Where(x => string.IsNullOrWhiteSpace(x.ResponsibilityUser)).ToList();
if (isNullResponsibilityUser.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullResponsibilityUser.ConvertAll(x => x.FourDecisionCode))})责任人为空!", MessageBoxIcon.Warning);
return;
}
var isNullProposeUser = list.Where(x => string.IsNullOrWhiteSpace(x.ProposeUser)).ToList();
if (isNullProposeUser.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullProposeUser.ConvertAll(x => x.FourDecisionCode))})提出人为空!", MessageBoxIcon.Warning);
return;
}
var isNullGeneraUser = list.Where(x => string.IsNullOrWhiteSpace(x.GeneraUser)).ToList();
if (isNullGeneraUser.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullGeneraUser.ConvertAll(x => x.FourDecisionCode))})总包为空!", MessageBoxIcon.Warning);
return;
}
var isNullSupervisionUser = list.Where(x => string.IsNullOrWhiteSpace(x.SupervisionUser)).ToList();
if (isNullSupervisionUser.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullSupervisionUser.ConvertAll(x => x.FourDecisionCode))})监理为空!", MessageBoxIcon.Warning);
return;
}
var isNullOwnerUser = list.Where(x => string.IsNullOrWhiteSpace(x.OwnerUser)).ToList();
if (isNullOwnerUser.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullOwnerUser.ConvertAll(x => x.FourDecisionCode))})业主为空!", MessageBoxIcon.Warning);
return;
}
var isNullAskDestructionTime = list.Where(x => x.AskDestructionTime == null).ToList();
if (isNullAskDestructionTime.Count > 0)
{
Alert.ShowInTop($"编号({string.Join(",", isNullAskDestructionTime.ConvertAll(x => x.FourDecisionCode))})要求销项时间为空!", MessageBoxIcon.Warning);
return;
}
foreach (var item in list)
{
item.ResponsibilityProposeSatate = 1;
Funs.DB.SubmitChanges();
}
}
BindGrid();
Alert.ShowInTop("提交成功!", MessageBoxIcon.Success);
}
/// <summary>
@@ -356,17 +408,23 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
var model = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == Grid1.SelectedRowID);
if (model != null)
var ids = Grid1.SelectedRowIDArray.ToList();
var list = Funs.DB.PreRun_SubThreeChecksFourDecision.Where(x => ids.Contains(x.DecisionId)).ToList();
if (list.Count > 0)
{
if (model.ResponsibilityProposeSatate == 1)
var nodeletes = list.Where(x => x.ResponsibilityProposeSatate.GetValueOrDefault() != 1).ToList();
if (nodeletes.Count > 0)
{
Alert.ShowInTop("仅提出人待处理状态才可撤回!", MessageBoxIcon.Warning);
Alert.ShowInTop($"编号({string.Join(",", nodeletes.ConvertAll(x => x.FourDecisionCode))})状态不允许撤回,仅提出人待处理状态才可撤回!", MessageBoxIcon.Warning);
return;
}
model.ProposeConfirm = 0;
model.ProposeConfirmData = null;
Funs.DB.SubmitChanges();
foreach (var item in list)
{
item.ResponsibilityProposeSatate = 0;
item.ProposeConfirm = 0;
item.ProposeConfirmData = null;
Funs.DB.SubmitChanges();
}
BindGrid();
Alert.ShowInTop("撤回成功!", MessageBoxIcon.Success);
}
@@ -477,7 +535,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
List<Sys_User> users = userNames.Count > 0 ? Funs.DB.Sys_User.Where(x => userNames.Contains(x.UserName)).ToList() : new List<Sys_User>();
var baseUserNames = users.ConvertAll(x => x.UserName);
//获取责任单位
List<Base_Unit> units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
List<Base_Unit> units = BLL.UnitService.GetUnitByProjectIdList(this.CurrUser.LoginProjectId);
#region
//验证责任人
@@ -50,7 +50,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
}
}
/// <summary>
/// 绑定数据
/// </summary>