20241029 配置文件调整

This commit is contained in:
liuhui11 2024-10-29 10:58:09 +08:00
commit 77d232b24e
9 changed files with 385 additions and 176 deletions

View File

@ -0,0 +1,5 @@
update ProcessControl_InspectionManagement set CNProfessionalId='10487C07-DE54-4ED6-BBDF-2C7988A44665' where CNProfessionalId='D03E079B-8B97-4C5A-BF1C-782887548B92'--¹ÜµÀ
update ProcessControl_InspectionManagement set CNProfessionalId='DEB367FF-AD35-41A0-B68E-FA8E68737B93' where CNProfessionalId='445B1EE6-901E-4A07-A4AB-4EE1066E742F'--µçÆø
update ProcessControl_InspectionManagement set CNProfessionalId='F41C5022-F499-4BD7-84B6-E87E4CE53CAC' where CNProfessionalId='E9AC9563-E338-48B7-867D-488222AD0557'--ÍÁ½¨
go

View File

@ -25,14 +25,18 @@ namespace FineUIPro.Web.CQMS.ProcessControl
if (!IsPostBack)
{
GetButtonPower();
//BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业
//专业
this.drpCNProfessional.DataTextField = "DetectionItems";
this.drpCNProfessional.DataValueField = "ControlId";
this.drpCNProfessional.DataSource = BLL.CNProfessionalService.GetCnProList();
this.drpCNProfessional.DataBind();
Funs.FineUIPleaseSelect(this.drpCNProfessional);
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
this.drpCNProfessional.DataTextField = "DetectionItems";
this.drpCNProfessional.DataValueField = "ControlId";
this.drpCNProfessional.DataSource = BLL.CNProfessionalService.GetCnProList();
this.drpCNProfessional.DataBind();
Funs.FineUIPleaseSelect(this.drpCNProfessional);
}
else
{
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业
}
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);//施工分包商
BindGrid();
}
@ -43,7 +47,10 @@ namespace FineUIPro.Web.CQMS.ProcessControl
/// </summary>
public void BindGrid()
{
string strSql = @"SELECT P.InspectionId,
if (this.CurrUser.UserId==BLL.Const.hfnbdId)
{
string strSql = @"SELECT P.InspectionId,
P.ProjectId,
P.UnitId,
P.CNProfessionalId,
@ -57,42 +64,96 @@ namespace FineUIPro.Web.CQMS.ProcessControl
BP.Class,
P.AcceptanceSite,
P.AcceptanceCheckMan"
+ @" FROM ProcessControl_InspectionManagement AS P"
+ @" LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId"
+ @" LEFT JOIN Control_PointCropping C ON C.ControlId = P.CNProfessionalId"
+ @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId"
+ @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch"
+ @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType"
+ @" WHERE P.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpUnit.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.UnitId=@UnitId";
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
+ @" FROM ProcessControl_InspectionManagement AS P"
+ @" LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId"
+ @" LEFT JOIN Control_PointCropping C ON C.ControlId = P.CNProfessionalId"
+ @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId"
+ @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch"
+ @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType"
+ @" WHERE P.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpUnit.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.UnitId=@UnitId";
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
}
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND P.InspectionDate >= @startTime";
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND P.InspectionDate <= @endTime";
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
else
{
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
string strSql = @"SELECT P.InspectionId,
P.ProjectId,
P.UnitId,
P.CNProfessionalId,
P.UnitWorkId,
U.UnitName,
C.ProfessionalName as ProfessionalName,
P.NoticeCode,
UnitWork.UnitWorkName,
DP.DivisionName AS Branch,
BP.BreakdownName AS ControlPointType,
BP.Class,
P.AcceptanceSite,
P.AcceptanceCheckMan"
+ @" FROM ProcessControl_InspectionManagement AS P"
+ @" LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId"
+ @" left join Base_CNProfessional c on c.CNProfessionalId = P.CNProfessionalId"
+ @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId"
+ @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch"
+ @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType"
+ @" WHERE P.ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpUnit.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.UnitId=@UnitId";
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
}
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
{
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND P.InspectionDate >= @startTime";
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND P.InspectionDate <= @endTime";
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND P.InspectionDate >= @startTime";
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND P.InspectionDate <= @endTime";
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion

View File

@ -27,15 +27,22 @@ namespace FineUIPro.Web.CQMS.ProcessControl
}
GetButtonPower();
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);//施工分包商
//BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);//专业
UserService.InitUserProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//UserService.InitUserNameProjectIdUnitTypeDropDownList(this.drpAcceptanceCheckMan, this.CurrUser.LoginProjectId, string.Empty, false);
//专业
this.drpCNProfessionalId.DataTextField = "DetectionItems";
this.drpCNProfessionalId.DataValueField = "ControlId";
this.drpCNProfessionalId.DataSource = BLL.CNProfessionalService.GetCnProList();
this.drpCNProfessionalId.DataBind();
Funs.FineUIPleaseSelect(this.drpCNProfessionalId);
if (this.CurrUser.UserId == BLL.Const.hfnbdId)//测试阶段仅hfnbd账号使用
{
//专业
this.drpCNProfessionalId.DataTextField = "DetectionItems";
this.drpCNProfessionalId.DataValueField = "ControlId";
this.drpCNProfessionalId.DataSource = BLL.CNProfessionalService.GetCnProList();
this.drpCNProfessionalId.DataBind();
Funs.FineUIPleaseSelect(this.drpCNProfessionalId);
}
else
{
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true);//专业
}
//单位工程
var q = (from x in Funs.DB.WBS_DivisionDivide

View File

@ -18,7 +18,7 @@
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程名称" LabelWidth="120px" LabelAlign="Right" EnableEdit="true"></f:DropDownList>
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程名称" LabelWidth="120px" LabelAlign="Right" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpUnitWork_SelectedIndexChanged"></f:DropDownList>
<f:DropDownList ID="drpBranchEngineering" runat="server" Label="分部工程名称" LabelWidth="120px" LabelAlign="Right" EnableEdit="true"></f:DropDownList>
<f:Button ID="btnSearch" runat="server" Text="查询" Icon="SystemSearch" OnClick="btnSearch_Click"></f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>

View File

@ -25,11 +25,11 @@ namespace FineUIPro.Web.CQMS.WBS.Control
{
BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWork, this.CurrUser.LoginProjectId, true);
var subProjectLists = from x in Funs.DB.Division_SubProjects where x.ProjectId==this.CurrUser.LoginProjectId && x.ParentId==null select x;
this.drpBranchEngineering.DataTextField = "BranchEngineeringName";
this.drpBranchEngineering.DataValueField = "DivisionId";
this.drpBranchEngineering.DataSource = subProjectLists;
this.drpBranchEngineering.DataBind();
//var subProjectLists = from x in Funs.DB.Division_SubProjects where x.ProjectId==this.CurrUser.LoginProjectId && x.ParentId==null select x;
//this.drpBranchEngineering.DataTextField = "BranchEngineeringName";
//this.drpBranchEngineering.DataValueField = "DivisionId";
//this.drpBranchEngineering.DataSource = subProjectLists;
//this.drpBranchEngineering.DataBind();
Funs.FineUIPleaseSelect(this.drpBranchEngineering);
BindGrid();
@ -49,7 +49,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
strSql += " AND (UnitWorkId =@unitWorkId or SuperUnitWork=@unitWorkId) ";
listStr.Add(new SqlParameter("@unitWorkId", this.drpUnitWork.SelectedValue));
}
if (this.drpBranchEngineering.SelectedValue!=BLL.Const._Null)
if (this.drpBranchEngineering.SelectedValue != BLL.Const._Null)
{
strSql += " AND (DivisionId = @divisionId or ParentId=@divisionId) ";
listStr.Add(new SqlParameter("@divisionId", this.drpBranchEngineering.SelectedValue));
@ -57,7 +57,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
strSql += " ORDER BY SupUnitWorkCode,ChildUnitWorkCode,Sort,DivisionLevel ";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
//var table = this.GetPagedDataTable(Grid1, tb);
@ -100,7 +100,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
}
if (this.drpBranchEngineering.SelectedValue != BLL.Const._Null)
{
lists = lists.Where(x => x.DivisionId == this.drpBranchEngineering.SelectedValue || x.ParentId==this.drpBranchEngineering.SelectedValue);
lists = lists.Where(x => x.DivisionId == this.drpBranchEngineering.SelectedValue || x.ParentId == this.drpBranchEngineering.SelectedValue);
}
lists = lists.OrderBy(x => x.SupUnitWorkCode).ThenBy(x => x.ChildUnitWorkCode).ThenBy(x => x.Sort).ThenBy(x => x.DivisionLevel);
@ -139,7 +139,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
row = sheet.CreateRow(i);
// 添加数据
cell = row.CreateCell(0);
cell.CellStyle = cellStyle;
cell.CellStyle = cellStyle;
cell.SetCellValue(item.SupUnitWorkCode);//单位工程编码
cell = row.CreateCell(1);
@ -208,5 +208,33 @@ namespace FineUIPro.Web.CQMS.WBS.Control
}
}
#endregion
/// <summary>
/// 单位工程下拉选择
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpUnitWork_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBranchEngineering.Items.Clear();
if (this.drpUnitWork.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpUnitWork.SelectedValue))
{
var q = (from x in Funs.DB.View_WBS_DivisionDivide
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitWorkId == this.drpUnitWork.SelectedValue
&& x.ParentId==null
select new
{
x.DivisionId,
x.BranchEngineeringName
}).Distinct().ToList();
this.drpBranchEngineering.DataTextField = "BranchEngineeringName";
this.drpBranchEngineering.DataValueField = "DivisionId";
this.drpBranchEngineering.DataSource = q;
this.drpBranchEngineering.DataBind();
Funs.FineUIPleaseSelect(this.drpBranchEngineering);
this.drpBranchEngineering.SelectedIndex = 0;
}
}
}
}

View File

@ -235,11 +235,11 @@ namespace FineUIPro.Web.CQMS.WBS.Control
}
else
{
var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId);
if (sub.DivisionLevel == 1)
{
//var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId);
//if (sub.DivisionLevel == 1)
//{
newSubProjects.DivisionLevel = 2;
}
//}
newSubProjects.ProEngineeringName = this.txtProEngineeringName.Text.Trim();
newSubProjects.DivisionId = SQLHelper.GetNewID(typeof(Model.Division_SubProjects));
this.DivisionId = newSubProjects.DivisionId;
@ -264,15 +264,15 @@ namespace FineUIPro.Web.CQMS.WBS.Control
}
else
{
var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId);
if (sub.DivisionLevel == 1)
{
newSubProjects.DivisionLevel = 2;
}
else if (sub.DivisionLevel==2)
{
//var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId);
//if (sub.DivisionLevel == 1)
//{
// newSubProjects.DivisionLevel = 2;
//}
//else if (sub.DivisionLevel==2)
//{
newSubProjects.DivisionLevel = 3;
}
//}
newSubProjects.DivisionId = SQLHelper.GetNewID(typeof(Model.Division_SubProjects));
this.DivisionId = newSubProjects.DivisionId;
BLL.SubProjectsService.AddSubProjects(newSubProjects);

View File

@ -8,9 +8,10 @@
<TreeNode id="6769098A-53D7-4585-87CC-2DADBCBC2C74" Text="类似项目施工经验总结清单" NavigateUrl="CQMS/QualityPlanning/ConExperienceSummary.aspx"></TreeNode>
</TreeNode>
<TreeNode id="3B322232-38A1-4291-9832-CD4A01C2A975" Text="检验试验计划/单位分部分项工程划分" NavigateUrl=""><TreeNode id="1025D812-2325-4FE9-A1E9-D53F2CAACDC6" Text="现场控制点裁剪(新)" NavigateUrl="CQMS/WBS/Control/PointCropping.aspx"></TreeNode>
<TreeNode id="17E206A1-E06B-40C0-8DCB-E3AAA2E3B339" Text="分部分项工程(新)" NavigateUrl="CQMS/WBS/Control/DivisionSubProjects.aspx"></TreeNode>
<TreeNode id="0E1CCE60-6F9D-419D-B763-E9E0AF5621E6" Text="单位分部分项工程划分、裁剪" NavigateUrl=""><TreeNode id="17E206A1-E06B-40C0-8DCB-E3AAA2E3B339" Text="分部分项工程数据库" NavigateUrl="CQMS/WBS/Control/DivisionSubProjectsNew.aspx"></TreeNode>
<TreeNode id="FB94A120-921B-4AAB-B54F-EC11B6F561FD" Text="单位分部分项工程划分、裁剪" NavigateUrl="CQMS/WBS/Control/DivisionDivideAndCrop.aspx"></TreeNode>
<TreeNode id="BA250432-492B-49A3-8BB6-D04BF74D2EDD" Text="单位分部分项工程划分表" NavigateUrl="CQMS/WBS/Control/DivisionDivideList.aspx"></TreeNode>
</TreeNode>
<TreeNode id="5AA08233-9E04-4808-AC43-DD411C5F9D31" Text="现场控制点裁剪" NavigateUrl="CQMS/WBS/ProjectControlPoint.aspx"></TreeNode>
<TreeNode id="88F115C3-D193-4455-8E8D-76F2EAF56291" Text="现场控制点资料柜" NavigateUrl="CQMS/WBS/ProjectControlPointFile.aspx"></TreeNode>
</TreeNode>

View File

@ -333,50 +333,100 @@ namespace FineUIPro.Web
Model.BusinessColumn businessColumn = new Model.BusinessColumn();
List<string> listCategories = new List<string>();
businessColumn.title = "质量一次合格率";
var cns = BLL.CNProfessionalService.GetCnProList();
Model.SGGLDB db = Funs.DB;
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
select x).ToList();
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId
select x).ToList();
Model.SingleSerie s = new Model.SingleSerie();
Model.SingleSerie s2 = new Model.SingleSerie();
List<double> listdata = new List<double>();
List<double> listdata2 = new List<double>();
double result = 0, result2 = 0;
foreach (var cn in cns)
//专业测试阶段仅hfnbd使用
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
listCategories.Add(cn.DetectionItems);
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
if (okChecks.Count > 0 && totalChecks.Count > 0)
var cns = BLL.CNProfessionalService.GetCnProList();
Model.SGGLDB db = Funs.DB;
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
select x).ToList();
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId
select x).ToList();
Model.SingleSerie s = new Model.SingleSerie();
Model.SingleSerie s2 = new Model.SingleSerie();
List<double> listdata = new List<double>();
List<double> listdata2 = new List<double>();
double result = 0, result2 = 0;
foreach (var cn in cns)
{
var a = Convert.ToDouble(okChecks.Count);
var b = Convert.ToDouble(totalChecks.Count);
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
}
if (cn.DetectionItems.Contains("管道"))
{
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
listCategories.Add(cn.DetectionItems);
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.ControlId).ToList();
if (okChecks.Count > 0 && totalChecks.Count > 0)
{
result2 = Convert.ToDouble(ndtList.TotalRate);
var a = Convert.ToDouble(okChecks.Count);
var b = Convert.ToDouble(totalChecks.Count);
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
}
if (cn.DetectionItems.Contains("管道"))
{
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
{
result2 = Convert.ToDouble(ndtList.TotalRate);
}
}
listdata.Add(result);
listdata2.Add(result2);
result = 0;
result2 = 0;
}
listdata.Add(result);
listdata2.Add(result2);
result = 0;
result2 = 0;
s.data = listdata;
s2.data = listdata2;
series.Add(s);
series.Add(s2);
}
else
{
var cns = BLL.CNProfessionalService.GetList();
Model.SGGLDB db = Funs.DB;
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailOKLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsOnceQualified == true
select x).ToList();
List<Model.ProcessControl_InspectionManagement> TotalCheckDetailLists = (from x in db.ProcessControl_InspectionManagement
where x.ProjectId == this.CurrUser.LoginProjectId
select x).ToList();
Model.SingleSerie s = new Model.SingleSerie();
Model.SingleSerie s2 = new Model.SingleSerie();
List<double> listdata = new List<double>();
List<double> listdata2 = new List<double>();
double result = 0, result2 = 0;
foreach (var cn in cns)
{
listCategories.Add(cn.ProfessionalName);
var okChecks = TotalCheckDetailOKLists.Where(x => x.CNProfessionalId == cn.CNProfessionalId).ToList();
var totalChecks = TotalCheckDetailLists.Where(x => x.CNProfessionalId == cn.CNProfessionalId).ToList();
if (okChecks.Count > 0 && totalChecks.Count > 0)
{
var a = Convert.ToDouble(okChecks.Count);
var b = Convert.ToDouble(totalChecks.Count);
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 1));
}
if (cn.ProfessionalName.Contains("管道"))
{
var ndtList = (from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && x.ProjectId == this.CurrUser.LoginProjectId orderby x.CreateDate descending select x).FirstOrDefault();
if (ndtList != null && !string.IsNullOrEmpty(ndtList.TotalRate))
{
result2 = Convert.ToDouble(ndtList.TotalRate);
}
}
listdata.Add(result);
listdata2.Add(result2);
result = 0;
result2 = 0;
}
s.data = listdata;
s2.data = listdata2;
series.Add(s);
series.Add(s2);
}
s.data = listdata;
s2.data = listdata2;
series.Add(s);
series.Add(s2);
businessColumn.categories = listCategories;
businessColumn.series = series;
return JsonConvert.SerializeObject(businessColumn);
}
}

View File

@ -141,7 +141,7 @@ namespace FineUIPro.Web.common
/// 获取项目部人数
/// </summary>
/// <returns></returns>
public int GetProjectPersonNum()
public int GetProjectPersonNum()
{
if (pids == null)
{
@ -154,18 +154,18 @@ namespace FineUIPro.Web.common
else {
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where y.IsCQMS == true && x.IsUsed == true && pids.Contains(x.ProjectId)
where y.IsCQMS == true && x.IsUsed == true && pids.Contains(x.ProjectId)
select x).Count();
return result;
}
}
/// <summary>
/// 获取在用计量器具数
/// </summary>
/// <returns></returns>
public int GetUseNum()
public int GetUseNum()
{
if (pids == null)
{
@ -180,13 +180,13 @@ namespace FineUIPro.Web.common
select x).Count();
return result;
}
}
/// <summary>
/// 获取校准合格数
/// </summary>
/// <returns></returns>
public int GetOKNum()
public int GetOKNum()
{
if (pids == null)
{
@ -207,7 +207,7 @@ namespace FineUIPro.Web.common
/// 机械预警
/// </summary>
/// <returns></returns>
public int GetJxyjNum()
public int GetJxyjNum()
{
if (pids == null)
{
@ -237,7 +237,7 @@ namespace FineUIPro.Web.common
/// 获取质量培训人次数
/// </summary>
/// <returns></returns>
public int GetTrainPersonNum()
public int GetTrainPersonNum()
{
if (pids == null)
{
@ -258,7 +258,7 @@ namespace FineUIPro.Web.common
/// 获取技术交底人次数
/// </summary>
/// <returns></returns>
public int GetTechnicalDisclosePersonNum()
public int GetTechnicalDisclosePersonNum()
{
if (pids == null)
{
@ -269,7 +269,7 @@ namespace FineUIPro.Web.common
}
else {
var result = (from x in Funs.DB.Comprehensive_DesignDetails
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x.JoinPersonNum ?? 0).ToList().Sum();
var q = Funs.GetNewIntOrZero(result.ToString());
return q;
@ -308,7 +308,7 @@ namespace FineUIPro.Web.common
/// 共检总数
/// </summary>
/// <returns></returns>
public int getAllInspectionManagement()
public int getAllInspectionManagement()
{
if (pids == null)
{
@ -328,10 +328,10 @@ namespace FineUIPro.Web.common
else {
int result = 0;
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x).Count();
result = num1;
return result;
}
}
@ -339,7 +339,7 @@ namespace FineUIPro.Web.common
/// 次合格数量
/// </summary>
/// <returns></returns>
public int getIsOnceInspectionManagement()
public int getIsOnceInspectionManagement()
{
if (pids == null)
{
@ -360,13 +360,13 @@ namespace FineUIPro.Web.common
}
else {
int result = 0;
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
result = num2;
return result;
}
}
@ -374,7 +374,7 @@ namespace FineUIPro.Web.common
/// 整改率
/// </summary>
/// <returns></returns>
public string GetInspectionManagementZgl()
public string GetInspectionManagementZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * getIsOnceInspectionManagement() / getAllInspectionManagement());
return zgl + "%";
@ -388,7 +388,7 @@ namespace FineUIPro.Web.common
/// 获取整改完成数
/// </summary>
/// <returns></returns>
public int GetProblemCompletedNum()
public int GetProblemCompletedNum()
{
if (pids == null)
{
@ -408,7 +408,7 @@ namespace FineUIPro.Web.common
/// 获取未整改数
/// </summary>
/// <returns></returns>
public int GetProblemNotCompletedNum()
public int GetProblemNotCompletedNum()
{
if (pids == null)
{
@ -429,7 +429,7 @@ namespace FineUIPro.Web.common
/// 整改率
/// </summary>
/// <returns></returns>
public string GetProblemZgl()
public string GetProblemZgl()
{
string zgl = String.Format("{0:N2}", 100.0 * GetProblemCompletedNum() / (GetProblemCompletedNum() + GetProblemNotCompletedNum()));
return zgl + "%";
@ -453,7 +453,7 @@ namespace FineUIPro.Web.common
/// 获取问题个数
/// </summary>
/// <returns></returns>
public int GetProblemNum()
public int GetProblemNum()
{
if (pids == null)
{
@ -475,7 +475,7 @@ namespace FineUIPro.Web.common
/// 获取焊工总数
/// </summary>
/// <returns></returns>
public int GetWelderNum()
public int GetWelderNum()
{
if (pids == null)
{
@ -496,7 +496,7 @@ namespace FineUIPro.Web.common
/// 获取总达因数
/// </summary>
/// <returns></returns>
public int GetTotalDineNum()
public int GetTotalDineNum()
{
if (pids == null)
{
@ -553,7 +553,7 @@ namespace FineUIPro.Web.common
/// 获取完成达因数
/// </summary>
/// <returns></returns>
public int GetCompleteDineNum()
public int GetCompleteDineNum()
{
if (pids == null)
{
@ -651,7 +651,7 @@ namespace FineUIPro.Web.common
/// 获取合格片数
/// </summary>
/// <returns></returns>
public int GetOKFilmNum()
public int GetOKFilmNum()
{
if (pids == null)
{
@ -684,7 +684,7 @@ namespace FineUIPro.Web.common
/// 一次拍片合格率
/// </summary>
/// <returns></returns>
public string GetOKFilmHgl()
public string GetOKFilmHgl()
{
string zgl = "0";
if (GetOKFilmNum() > 0)
@ -707,57 +707,114 @@ namespace FineUIPro.Web.common
private void getInspectionManagementInfo()
{
//var q=(from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
var q = (from x in Funs.DB.Control_PointCropping where x.ParentId == null || x.ParentId == "" orderby x.OperateTime select x).ToList();
foreach (var item in q)
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
//获取专业
InspectionManagementZy += "'" + item.DetectionItems + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = 0;
var num2 = 0;
if (pids == null)
//var q=(from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
var q = (from x in Funs.DB.Control_PointCropping where x.ParentId == null || x.ParentId == "" orderby x.OperateTime select x).ToList();
foreach (var item in q)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
//获取专业
InspectionManagementZy += "'" + item.DetectionItems + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = 0;
var num2 = 0;
if (pids == null)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true
select x).Count();
}
else {
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
InspectionManagementSumCount += "'" + num1 + "',";
}
else
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.ControlId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
// select x).ToList().Count;
InspectionManagementSumCount += "'" + num1 + "',";
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
// select x).ToList().Count;
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
}
else
{
var q = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.CNProfessionalHSEId orderby x.SortIndex select x).ToList();
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
foreach (var item in q)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
//获取专业
InspectionManagementZy += "'" + item.ProfessionalName + "',";
//根据专业获取总计
//var num1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId
// select x).ToList().Count;
var num1 = 0;
var num2 = 0;
if (pids == null)
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true
select x).Count();
}
else
{
num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && pids.Contains(x.ProjectId)
select x).Count();
num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
where x.CNProfessionalId == item.CNProfessionalId && x.IsOnceQualified == true && pids.Contains(x.ProjectId)
select x).Count();
}
InspectionManagementSumCount += "'" + num1 + "',";
//根据专业获取合格数
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
// join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
// where y.CNProfessionalId == item.CNProfessionalId && y.IsOnceQualified==true
// select x).ToList().Count;
InspectionManagementOkCount += "'" + num2 + "',";
//一次验收合格率
var hgl = "0";
if (num1 > 0)
{
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
InspectionManagementOneOkCount += "'" + hgl + "',";
}
InspectionManagementZy = InspectionManagementZy.TrimEnd(',');
InspectionManagementSumCount = InspectionManagementSumCount.TrimEnd(',');