This commit is contained in:
parent
1d2aee2c7c
commit
1773ec1dde
|
@ -546,7 +546,7 @@ namespace BLL
|
|||
/// <summary>
|
||||
/// 木工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_Carpentry = "4ACC633F-BD81-4CBB-9058-A4E4DFFE7881";
|
||||
public static string WorkPost_Carpentry = "e72ce3da-c3e3-45cc-9575-a82dbb2ca2aa";
|
||||
|
||||
/// <summary>
|
||||
/// 钢筋工岗位Id
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,6 +25,11 @@
|
|||
<f:DropDownList ID="sdrpUnitId" runat="server" Label="报验单位" LabelAlign="Right">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpCNPr" runat="server" Label="专业" LabelAlign="Right" LabelWidth="60px"></f:DropDownList>
|
||||
<f:DropDownList ID="drpSchemeType" runat="server" Label="方案类型" LabelAlign="Right" LabelWidth="100px">
|
||||
<f:ListItem Text="- 请选择 -" Value="" />
|
||||
<f:ListItem Text="危大工程" Value="危大工程" />
|
||||
<f:ListItem Text="超危大工程" Value="超危大工程" />
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" ID="txtPlanName" Label="方案名称" LabelAlign="Right"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Icon="SystemSearch"
|
||||
EnablePostBack="true" runat="server" ToolTip="查询" OnClick="btnSearch_Click">
|
||||
|
@ -51,10 +56,10 @@
|
|||
HeaderTextAlign="Center" Width="200px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="SchemeType" DataField="SchemeType" FieldType="String" HeaderText="方案类型" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="200px">
|
||||
HeaderTextAlign="Center" Width="200px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="TypeName" DataField="TypeName" FieldType="String" HeaderText="类型" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="200px">
|
||||
HeaderTextAlign="Center" Width="200px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="ProfessionalName" DataField="ProfessionalName" FieldType="String" HeaderText="专业" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="150px">
|
||||
|
@ -82,10 +87,10 @@
|
|||
<f:RenderField ColumnID="ApprovalMan" DataField="ApprovalMan" FieldType="String" HeaderText="批准人" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="IsReview" DataField="IsReview" FieldType="String" HeaderText="是否通过专家评审" TextAlign="Center"
|
||||
<f:RenderField ColumnID="IsReview" DataField="IsReview" FieldType="String" HeaderText="是否通过专家评审" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="150px">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField ColumnID="ImplementationDeviation" DataField="ImplementationDeviation" FieldType="String" HeaderText="施工总结" TextAlign="Center"
|
||||
<%-- <f:RenderField ColumnID="ImplementationDeviation" DataField="ImplementationDeviation" FieldType="String" HeaderText="施工总结" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="220px">
|
||||
</f:RenderField>--%>
|
||||
<%-- <f:TemplateField ColumnID="AttachFile" Width="150px" HeaderText="附件" HeaderTextAlign="Center" TextAlign="Left" > --%>
|
||||
|
@ -97,7 +102,7 @@
|
|||
<f:TemplateField ColumnID="AttachFile" Width="150px" HeaderText="附件" HeaderTextAlign="Center" TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtnFileUrl" runat="server" CssClass="ItemLink" OnClick="attchUrl_Click"
|
||||
Text='查看' ToolTip="附件查看">
|
||||
Text='查看' ToolTip="附件查看">
|
||||
</asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
@ -128,8 +133,8 @@
|
|||
Width="1200px" Height="660px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
|
|
|
@ -54,6 +54,11 @@ namespace FineUIPro.Web.Comprehensive
|
|||
strSql += " AND C.CNProfessionalId=@CNProfessionalId";
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNPr.SelectedValue));
|
||||
}
|
||||
if (drpSchemeType.SelectedValue != BLL.Const._Null && !string.IsNullOrWhiteSpace(drpSchemeType.SelectedValue))
|
||||
{
|
||||
strSql += " AND C.SchemeType=@SchemeType";
|
||||
listStr.Add(new SqlParameter("@SchemeType", drpSchemeType.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPlanName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND C.PlanName like @PlanName";
|
||||
|
@ -433,7 +438,7 @@ namespace FineUIPro.Web.Comprehensive
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
protected void attchUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
Debug.WriteLine("attchUrl_Click");
|
||||
|
|
|
@ -77,6 +77,15 @@ namespace FineUIPro.Web.Comprehensive
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCNPr;
|
||||
|
||||
/// <summary>
|
||||
/// drpSchemeType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpSchemeType;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanName 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
this.AttachUrl4.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_4"));
|
||||
this.AttachUrl5.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_5"));
|
||||
this.AttachUrl6.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../../", getUrl(this.MajorPlanApprovalId + "_6"));
|
||||
|
||||
|
||||
this.txtTrainPersonNum.Text = majorPlanApproval.TrainPersonNum.HasValue ? majorPlanApproval.TrainPersonNum.ToString() : "";
|
||||
this.txtAuditMan.Text = majorPlanApproval.AuditMan;
|
||||
this.txtApprovalMan.Text = majorPlanApproval.ApprovalMan;
|
||||
|
@ -130,7 +130,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
Alert.ShowInTop("请选择类型!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtExpectedTime.Text))
|
||||
{
|
||||
majorPlanApproval.ExpectedTime = Convert.ToDateTime(this.txtExpectedTime.Text);
|
||||
|
@ -157,7 +157,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
majorPlanApproval.TrainPersonNum = Funs.GetNewInt(this.txtTrainPersonNum.Text.Trim());
|
||||
|
||||
|
||||
if (this.drpStates.SelectedValue != "1")
|
||||
if (this.drpSchemeType.SelectedValue == "超危大工程" && this.drpStates.SelectedValue != "1")
|
||||
{
|
||||
//判断附件是否必传
|
||||
if (!returnFj(this.hdAttachUrl.Text + "_1"))
|
||||
|
@ -196,8 +196,8 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
majorPlanApproval.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_1", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_1", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click2(object sender, EventArgs e)
|
||||
|
@ -291,7 +291,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_2", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_2", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click3(object sender, EventArgs e)
|
||||
|
@ -303,7 +303,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_3", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_3", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click4(object sender, EventArgs e)
|
||||
|
@ -315,7 +315,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_4", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_4", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click5(object sender, EventArgs e)
|
||||
|
@ -327,7 +327,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_5", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_5", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
protected void btnAttach_Click6(object sender, EventArgs e)
|
||||
|
@ -339,13 +339,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
|||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/MajorPlanApproval&menuId={1}",
|
||||
this.hdAttachUrl.Text+"_6", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
this.hdAttachUrl.Text + "_6", BLL.Const.MajorPlanApprovalMenuId)));
|
||||
}
|
||||
|
||||
private bool returnFj(string id) {
|
||||
|
||||
private bool returnFj(string id)
|
||||
{
|
||||
bool isT = true;
|
||||
var model = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == id);
|
||||
if (model==null)
|
||||
if (model == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,54 +33,40 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT P.InspectionId,
|
||||
P.ProjectId,
|
||||
P.UnitId,
|
||||
P.CNProfessionalId,
|
||||
P.UnitWorkId,
|
||||
U.UnitName,
|
||||
C.ProfessionalName,
|
||||
P.NoticeCode,
|
||||
UnitWork.UnitWorkName,
|
||||
DP.DivisionName AS Branch,
|
||||
BP.BreakdownName AS ControlPointType,
|
||||
BP.Class,
|
||||
P.AcceptanceSite,
|
||||
P.AcceptanceCheckMan,
|
||||
(CASE WHEN IsOnceQualified='False' THEN '否' ELSE '是' END)AS IsOnceQualified,
|
||||
P.InspectionCode,
|
||||
P.InspectionDate"
|
||||
+ @" 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 ";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT P.InspectionId,P.ProjectId,P.UnitId,P.CNProfessionalId,P.UnitWorkId,U.UnitName,C.ProfessionalName,P.NoticeCode,UnitWork.UnitWorkName,DP.DivisionName AS Branch,BP.BreakdownName AS ControlPointType,BP.Class,P.AcceptanceSite,P.AcceptanceCheckMan,(CASE WHEN IsOnceQualified='False' THEN '否' ELSE '是' END)AS IsOnceQualified,P.InspectionCode,P.InspectionDate ");
|
||||
sb.Append("FROM ProcessControl_InspectionManagement AS P ");
|
||||
sb.Append("LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId ");
|
||||
sb.Append("LEFT JOIN Base_CNProfessional C ON C.CNProfessionalId = P.CNProfessionalId ");
|
||||
sb.Append("LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId ");
|
||||
sb.Append("LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch ");
|
||||
sb.Append("LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType ");
|
||||
sb.Append("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";
|
||||
sb.Append("AND P.UnitId=@UnitId ");
|
||||
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
|
||||
}
|
||||
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
|
||||
sb.Append("AND P.CNProfessionalId=@CNProfessionalId ");
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text))
|
||||
{
|
||||
strSql += " AND P.InspectionDate >= @startTime";
|
||||
sb.Append("AND P.InspectionDate >= @startTime ");
|
||||
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text)));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndTime.Text))
|
||||
{
|
||||
strSql += " AND P.InspectionDate <= @endTime";
|
||||
sb.Append("AND P.InspectionDate <= @endTim ");
|
||||
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text)));
|
||||
}
|
||||
sb.Append("ORDER BY P.NoticeCode DESC ");
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
@ -246,11 +232,38 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
|
||||
var lists = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement
|
||||
on x.InspectionId equals y.InspectionId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select y);
|
||||
//var lists = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
// join y in Funs.DB.ProcessControl_InspectionManagement
|
||||
// on x.InspectionId equals y.InspectionId
|
||||
// where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
// select y);
|
||||
var db = Funs.DB;
|
||||
var lists = (from x in db.ProcessControl_InspectionManagement
|
||||
join bu in db.Base_Unit on x.UnitId equals bu.UnitId into buGroup
|
||||
from bu in buGroup.DefaultIfEmpty()
|
||||
join bcn in db.Base_CNProfessional on x.CNProfessionalId equals bcn.CNProfessionalId into bcnGroup
|
||||
from bcn in bcnGroup.DefaultIfEmpty()
|
||||
//join wbsuw in db.WBS_UnitWork on x.UnitWorkId equals wbsuw.UnitWorkId into wbsuwGroup
|
||||
//from wbsuw in wbsuwGroup.DefaultIfEmpty()
|
||||
//join wbsd in db.WBS_DivisionProject on x.Branch equals wbsd.DivisionProjectId into wbsdGroup
|
||||
//from wbsd in wbsdGroup.DefaultIfEmpty()
|
||||
//join wbsbp in db.WBS_BreakdownProject on x.ControlPointType equals wbsbp.BreakdownProjectId into wbsbpGroup
|
||||
//from wbsbp in wbsbpGroup.DefaultIfEmpty()
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
orderby x.NoticeCode descending
|
||||
select new
|
||||
{
|
||||
UnitId = x.UnitId,
|
||||
UnitName = bu.UnitName,
|
||||
CNProfessionalId = x.CNProfessionalId,
|
||||
ProfessionalName = bcn.ProfessionalName,
|
||||
NoticeCode = x.NoticeCode,
|
||||
AcceptanceSite = x.AcceptanceSite,
|
||||
AcceptanceCheckMan = x.AcceptanceCheckMan,
|
||||
InspectionDate = x.InspectionDate,
|
||||
IsOnceQualified = x.IsOnceQualified,
|
||||
InspectionCode = x.InspectionCode
|
||||
});
|
||||
if (drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
lists = lists.Where(x => x.UnitId == drpUnit.SelectedValue);
|
||||
|
@ -307,22 +320,11 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
// 添加数据
|
||||
cell = row.CreateCell(0);
|
||||
cell.CellStyle = cellStyle;
|
||||
string unitName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(item.UnitId))
|
||||
{
|
||||
unitName = BLL.UnitService.GetUnitNameByUnitId(item.UnitId);
|
||||
}
|
||||
cell.SetCellValue(unitName);//施工分包商
|
||||
cell.SetCellValue(item.UnitName);//施工分包商
|
||||
|
||||
cell = row.CreateCell(1);
|
||||
cell.CellStyle = cellStyle;
|
||||
string proName = string.Empty;
|
||||
var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId);
|
||||
if (cnp != null)
|
||||
{
|
||||
proName = cnp.ProfessionalName;
|
||||
}
|
||||
cell.SetCellValue(proName);//专业
|
||||
cell.SetCellValue(item.ProfessionalName);//专业
|
||||
|
||||
cell = row.CreateCell(2);
|
||||
cell.CellStyle = cellStyle;
|
||||
|
@ -343,7 +345,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
|
||||
cell = row.CreateCell(5);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.IsOnceQualified == true ? "是" : "否");//是否一次合格
|
||||
cell.SetCellValue(item.IsOnceQualified == false ? "否" : "是");//是否一次合格
|
||||
|
||||
cell = row.CreateCell(6);
|
||||
cell.CellStyle = cellStyle;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using Aspose.Words;
|
||||
using Aspose.Words.Tables;
|
||||
using BLL;
|
||||
using FineUIPro.Web.BaseInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
@ -9,6 +10,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
|
@ -47,113 +49,149 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
if (this.CurrUser.UserId==BLL.Const.hfnbdId)
|
||||
{
|
||||
DataTable tb = BindData();
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
//if (this.CurrUser.UserId == BLL.Const.hfnbdId)
|
||||
//{
|
||||
// string strSql = @"SELECT P.InspectionId,P.ProjectId,P.UnitId,
|
||||
// P.CNProfessionalId,
|
||||
// P.UnitWorkId,U.UnitName,
|
||||
// C.DetectionItems 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 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();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// 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();
|
||||
//}
|
||||
}
|
||||
|
||||
string strSql = @"SELECT P.InspectionId,
|
||||
P.ProjectId,
|
||||
P.UnitId,
|
||||
P.CNProfessionalId,
|
||||
P.UnitWorkId,
|
||||
U.UnitName,
|
||||
C.DetectionItems 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 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();
|
||||
}
|
||||
else
|
||||
/// <summary>
|
||||
/// 查询数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DataTable BindData()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("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 ");
|
||||
sb.Append("FROM ProcessControl_InspectionManagement AS P ");
|
||||
sb.Append("LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId ");
|
||||
sb.Append("LEFT JOIN Base_CNProfessional AS C on c.CNProfessionalId = P.CNProfessionalId ");
|
||||
sb.Append("LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId ");
|
||||
sb.Append("LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch ");
|
||||
sb.Append("LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType ");
|
||||
sb.Append("WHERE P.ProjectId=@ProjectId ");
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
if (drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
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();
|
||||
sb.Append("AND P.UnitId=@UnitId ");
|
||||
listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue));
|
||||
}
|
||||
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
sb.Append("AND P.CNProfessionalId=@CNProfessionalId ");
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND P.InspectionDate >= @startTime ");
|
||||
listStr.Add(new SqlParameter("@startTime", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND P.InspectionDate <= @endTime ");
|
||||
listStr.Add(new SqlParameter("@endTime", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
|
||||
}
|
||||
sb.Append("ORDER BY P.NoticeCode DESC ");
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
|
||||
return tb;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -342,6 +380,142 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
|
||||
var db = Funs.DB;
|
||||
var lists = (from x in db.ProcessControl_InspectionManagement
|
||||
join bu in db.Base_Unit on x.UnitId equals bu.UnitId into buGroup
|
||||
from bu in buGroup.DefaultIfEmpty()
|
||||
join bcn in db.Base_CNProfessional on x.CNProfessionalId equals bcn.CNProfessionalId into bcnGroup
|
||||
from bcn in bcnGroup.DefaultIfEmpty()
|
||||
//join wbsuw in db.WBS_UnitWork on x.UnitWorkId equals wbsuw.UnitWorkId into wbsuwGroup
|
||||
//from wbsuw in wbsuwGroup.DefaultIfEmpty()
|
||||
//join wbsd in db.WBS_DivisionProject on x.Branch equals wbsd.DivisionProjectId into wbsdGroup
|
||||
//from wbsd in wbsdGroup.DefaultIfEmpty()
|
||||
//join wbsbp in db.WBS_BreakdownProject on x.ControlPointType equals wbsbp.BreakdownProjectId into wbsbpGroup
|
||||
//from wbsbp in wbsbpGroup.DefaultIfEmpty()
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
orderby x.NoticeCode descending
|
||||
select new
|
||||
{
|
||||
UnitId = x.UnitId,
|
||||
UnitName = bu.UnitName,
|
||||
CNProfessionalId = x.CNProfessionalId,
|
||||
ProfessionalName = bcn.ProfessionalName,
|
||||
NoticeCode = x.NoticeCode,
|
||||
AcceptanceSite = x.AcceptanceSite,
|
||||
AcceptanceCheckMan = x.AcceptanceCheckMan,
|
||||
InspectionDate = x.InspectionDate
|
||||
});
|
||||
if (drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
lists = lists.Where(x => x.UnitId == drpUnit.SelectedValue);
|
||||
}
|
||||
if (drpCNProfessional.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
lists = lists.Where(x => x.CNProfessionalId == drpCNProfessional.SelectedValue);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
{
|
||||
lists = lists.Where(x => x.InspectionDate >= Funs.GetNewDateTime(txtStarTime.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
|
||||
{
|
||||
lists = lists.Where(x => x.InspectionDate <= Funs.GetNewDateTime(txtEndTime.Text.Trim()));
|
||||
}
|
||||
if (lists != null)
|
||||
{
|
||||
string projectName = BLL.ProjectService.GetShortNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
newUrl = uploadfilepath.Replace("共检通知单模板", "共检通知单(" + projectName + DateTime.Now.ToString("yyyyMMdd") + ")");
|
||||
if (File.Exists(newUrl))
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
// 第一步:读取文件流
|
||||
NPOI.SS.UserModel.IWorkbook workbook;
|
||||
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
//workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
|
||||
workbook = new NPOI.HSSF.UserModel.HSSFWorkbook(stream);
|
||||
}
|
||||
// 创建单元格样式
|
||||
NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle();
|
||||
cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
|
||||
cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
|
||||
cellStyle.WrapText = true;//自动换行
|
||||
var font = workbook.CreateFont();
|
||||
font.FontHeightInPoints = 11;
|
||||
cellStyle.SetFont(font);
|
||||
// 第二步:创建新数据行
|
||||
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
|
||||
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
|
||||
NPOI.SS.UserModel.ICell cell;
|
||||
int i = 2;
|
||||
foreach (var item in lists)
|
||||
{
|
||||
// 第二步:创建新数据行
|
||||
row = sheet.CreateRow(i);
|
||||
// 添加数据
|
||||
cell = row.CreateCell(0);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.UnitName);//施工分包商
|
||||
|
||||
cell = row.CreateCell(1);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.ProfessionalName);//专业
|
||||
|
||||
cell = row.CreateCell(2);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.NoticeCode);//共检通知单编号
|
||||
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.AcceptanceSite);//验收部位
|
||||
|
||||
cell = row.CreateCell(4);
|
||||
cell.CellStyle = cellStyle;
|
||||
string userName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(item.AcceptanceCheckMan))
|
||||
{
|
||||
userName = ConvertCheckMan(item.AcceptanceCheckMan);
|
||||
}
|
||||
cell.SetCellValue(userName);//检查人
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
workbook.Write(stream);
|
||||
workbook.Close();
|
||||
}
|
||||
string fileName = Path.GetFileName(newUrl);
|
||||
FileInfo info = new FileInfo(newUrl);
|
||||
long fileSize = info.Length;
|
||||
Response.Clear();
|
||||
Response.ContentType = "application/x-zip-compressed";
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
Response.TransmitFile(newUrl, 0, fileSize);
|
||||
Response.Flush();
|
||||
Response.Close();
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
protected void btnOut_Click2(object sender, EventArgs e)
|
||||
{
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = Const.InspectionNoticesTempUrl;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
|
||||
var lists = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.ProcessControl_InspectionManagement
|
||||
on x.InspectionId equals y.InspectionId
|
||||
|
@ -1082,7 +1256,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
newInspection.UnqualifiedReason = inspection.UnqualifiedReason;
|
||||
|
||||
//通知单编号后有字母递增,无则加“a”
|
||||
string fisrtE = inspection.NoticeCode.Substring(0,inspection.NoticeCode.Length - 1);
|
||||
string fisrtE = inspection.NoticeCode.Substring(0, inspection.NoticeCode.Length - 1);
|
||||
string lastE = inspection.NoticeCode.Substring(inspection.NoticeCode.Length - 1, 1);
|
||||
bool b = Regex.IsMatch(lastE, "[a-zA-Z]");
|
||||
if (b)
|
||||
|
@ -1093,7 +1267,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
else
|
||||
{
|
||||
newInspection.NoticeCode = inspection.NoticeCode + "a";
|
||||
}
|
||||
}
|
||||
|
||||
newInspection.AcceptanceCheckMan = inspection.AcceptanceCheckMan;
|
||||
newInspection.ParentDivisionProjectId = inspection.ParentDivisionProjectId;
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
<f:RenderField ColumnID="TotalRate" DataField="TotalRate" FieldType="String" HeaderText="累计一次合格率(%)" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="160px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="CreateDate" DataField="CreateDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="创建日期" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
<f:RenderField ColumnID="CreateDate" DataField="CreateDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm:ss" HeaderText="创建日期" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="160px">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="AttachFile" Width="150px" HeaderText="附件" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
<ItemTemplate>
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
|||
|
||||
cell = row.CreateCell(6);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(item.CreateDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.CreateDate) : "");//创建日期
|
||||
cell.SetCellValue(item.CreateDate.HasValue ? string.Format("{0:yyyy-MM-dd HH:mm:ss}", item.CreateDate) : "");//创建日期
|
||||
|
||||
i++;
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
Binary file not shown.
After Width: | Height: | Size: 274 KiB |
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
|
@ -73,7 +73,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
+ @" LEFT JOIN QualityAudit_SafePersonQuality AS PersonQuality ON Person.PersonId = PersonQuality.PersonId "
|
||||
+ @" LEFT JOIN Base_WorkPost AS WorkPost ON WorkPost.WorkPostId = Person.WorkPostId "
|
||||
+ @" LEFT JOIN Sys_User AS Users ON PersonQuality.CompileMan = Users.UserId "
|
||||
+ @" WHERE WorkPost.IsHsse =1";
|
||||
+ @" WHERE WorkPost.IsHsse =1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND Person.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
|
@ -102,11 +102,11 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
{
|
||||
if (this.rblIsPost.SelectedValue == "1")
|
||||
{
|
||||
strSql += " AND Person.OutTime is null ";
|
||||
strSql += " AND Person.IsUsed ='1' AND (Person.OutTime is null OR Person.OutTime > getdate()) ";
|
||||
}
|
||||
else if (this.rblIsPost.SelectedValue == "0")
|
||||
{
|
||||
strSql += " AND Person.OutTime is not null ";
|
||||
strSql += " AND Person.OutTime is not null AND Person.OutTime < getdate() ";
|
||||
}
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
|
|
@ -8,75 +8,86 @@
|
|||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="现场人员统计" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Number" DataIDField="Number" AllowSorting="true" ForceFit="true"
|
||||
SortField="Number" SortDirection="ASC" EnableColumnLines="true" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="drpUnit" Label="单位"
|
||||
Width="300px" LabelAlign="Right" LabelWidth="50px"></f:DropDownList>
|
||||
<f:DropDownList runat="server" ID="drpWorkPost" Label="岗位"
|
||||
Width="220px" LabelAlign="Right" LabelWidth="50px"></f:DropDownList>
|
||||
<f:DatePicker ID="txtStartDate" runat="server" Label="开始日期" LabelWidth="80px" Width="220px">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="txtEndDate" runat="server" Label="结束日期" LabelWidth="80px" Width="220px">
|
||||
</f:DatePicker>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rblIsUsed" runat="server" Label="进出场" LabelAlign="Right" Width="300px">
|
||||
<f:RadioItem Value="0" Text="全部" Selected="true"/>
|
||||
<f:RadioItem Value="True" Text="进场" />
|
||||
<f:RadioItem Value="False" Text="出场" />
|
||||
</f:RadioButtonList>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" runat="server" Icon="BrickMagnify" ToolTip="查询" OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="现场人员统计" EnableCollapse="true" AllowPaging="true" IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Number" DataIDField="Number" AllowSorting="true" ForceFit="true"
|
||||
SortField="UnitName,WorkPostName" SortDirection="ASC" EnableColumnLines="true" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="drpUnit" Label="单位"
|
||||
Width="300px" LabelAlign="Right" LabelWidth="50px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList runat="server" ID="drpWorkPost" Label="岗位"
|
||||
Width="220px" LabelAlign="Right" LabelWidth="50px">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker ID="txtStartDate" runat="server" Label="开始日期" LabelWidth="80px" Width="220px">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="txtEndDate" runat="server" Label="结束日期" LabelWidth="80px" Width="220px">
|
||||
</f:DatePicker>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName"
|
||||
SortField="UnitName" FieldType="String" HeaderText="单位名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="WorkAreaName" DataField="WorkAreaName"
|
||||
SortField="WorkAreaName" FieldType="String" HeaderText="区域名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="WorkPostName" DataField="WorkPostName"
|
||||
SortField="WorkPostName" FieldType="String" HeaderText="岗位名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PersonCount" DataField="PersonCount"
|
||||
SortField="PersonCount" FieldType="Int" HeaderText="出入人次" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:TemplateField Width="120px" HeaderText="总人数" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rblIsUsed" runat="server" Label="进出场" LabelAlign="Right" Width="300px">
|
||||
<f:RadioItem Value="0" Text="全部" Selected="true" />
|
||||
<f:RadioItem Value="True" Text="进场" />
|
||||
<f:RadioItem Value="False" Text="出场" />
|
||||
</f:RadioButtonList>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" runat="server" Icon="BrickMagnify" ToolTip="查询" OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="240px" ColumnID="UnitName" DataField="UnitName"
|
||||
SortField="UnitName" FieldType="String" HeaderText="单位名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="WorkAreaName" DataField="WorkAreaName"
|
||||
SortField="WorkAreaName" FieldType="String" HeaderText="区域名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="WorkPostName" DataField="WorkPostName"
|
||||
SortField="WorkPostName" FieldType="String" HeaderText="岗位名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PersonCount" DataField="PersonCount"
|
||||
SortField="PersonCount" FieldType="Int" HeaderText="出入人次" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:TemplateField Width="120px" HeaderText="总人数" HeaderTextAlign="Center" TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label6" runat="server" Text='<%# Bind("PersonCount") %>' ToolTip='<%#Bind("PersonCount") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>--%>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId)
|
||||
{
|
||||
|
@ -44,7 +45,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
|
||||
if (project != null)
|
||||
{
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", project.StartDate);
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);//project.StartDate
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
|
||||
GetPersonStatistic();
|
||||
}
|
||||
|
@ -126,6 +127,32 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
GetPersonStatistic();
|
||||
}
|
||||
|
||||
#region 页索引改变事件
|
||||
/// <summary>
|
||||
/// 页索引改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
GetPersonStatistic();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页选择下拉改变事件
|
||||
/// <summary>
|
||||
/// 分页选择下拉改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
GetPersonStatistic();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.SitePerson {
|
||||
|
||||
|
||||
public partial class PersonStatistic {
|
||||
|
||||
namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
|
||||
|
||||
public partial class PersonStatistic
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
|
@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
|
@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
|
@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
|
@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
|
@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpWorkPost 控件。
|
||||
/// </summary>
|
||||
|
@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWorkPost;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtStartDate 控件。
|
||||
/// </summary>
|
||||
|
@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtStartDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtEndDate 控件。
|
||||
/// </summary>
|
||||
|
@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// rblIsUsed 控件。
|
||||
/// </summary>
|
||||
|
@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsUsed;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
|
@ -119,7 +121,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
@ -128,7 +130,7 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// labNumber 控件。
|
||||
/// </summary>
|
||||
|
@ -137,5 +139,32 @@ namespace FineUIPro.Web.HSSE.SitePerson {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label labNumber;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,18 +43,23 @@
|
|||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
|
||||
LabelAlign="right" Width="150px">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpIsSuperLargerHazard" runat="server" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:ListItem Text="- 请选择 -" Value="" />
|
||||
<f:ListItem Text="危大工程" Value="0" />
|
||||
<f:ListItem Text="超危大工程" Value="1" />
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" ID="txtTypeName" EmptyText="按类型查询"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="150px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" ID="txtAddress" EmptyText="按地点查询"
|
||||
<f:TextBox runat="server" ID="txtAddress" EmptyText="按地点查询"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="150px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DatePicker runat="server" ID="txtStartDate" AutoPostBack="true" Width="150px"
|
||||
<f:DatePicker runat="server" ID="txtStartDate" AutoPostBack="true" Width="150px"
|
||||
OnTextChanged="TextBox_TextChanged" LabelAlign="right" EmptyText="预计开始时间">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker runat="server" ID="txtEndDate" EmptyText="结束时间" AutoPostBack="true" Width="150px"
|
||||
<f:DatePicker runat="server" ID="txtEndDate" EmptyText="结束时间" AutoPostBack="true" Width="150px"
|
||||
OnTextChanged="TextBox_TextChanged" LabelAlign="right">
|
||||
</f:DatePicker>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
|
@ -81,6 +86,10 @@
|
|||
SortField="HazardCode" FieldType="String" HeaderText="文件编号" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="IsSuperLargerHazard" DataField="IsSuperLargerHazard"
|
||||
SortField="IsSuperLargerHazard" FieldType="String" HeaderText="方案类型" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="TypeName" DataField="TypeName"
|
||||
SortField="TypeName" FieldType="String" HeaderText="类型" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace FineUIPro.Web.HSSE.Solution
|
|||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
|
||||
|
||||
btnNew.OnClientClick = Window1.GetShowReference("LargerHazardEdit.aspx") + "return false;";
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
|
@ -78,6 +78,7 @@ namespace FineUIPro.Web.HSSE.Solution
|
|||
when '0' then '已取消'
|
||||
else '' end as StatesStr"
|
||||
+ @", case when LargerHazard.IsArgument=1 then '是' else '否' end as IsArgumentStr,Const.ConstText as TypeName,Project.ProjectName"
|
||||
+ @", case when LargerHazard.IsSuperLargerHazard=1 then '超危大工程' else '危大工程' end as IsSuperLargerHazard "
|
||||
+ @" FROM Solution_LargerHazard AS LargerHazard "
|
||||
+ @" LEFT JOIN Base_Project AS Project ON LargerHazard.ProjectId = Project.ProjectId "
|
||||
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON LargerHazard.HazardId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
|
||||
|
@ -94,6 +95,12 @@ namespace FineUIPro.Web.HSSE.Solution
|
|||
strSql += " AND LargerHazard.HazardCode LIKE @HazardCode";
|
||||
listStr.Add(new SqlParameter("@HazardCode", "%" + this.txtHazardCode.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
if (drpIsSuperLargerHazard.SelectedValue != BLL.Const._Null && !string.IsNullOrWhiteSpace(drpIsSuperLargerHazard.SelectedValue))
|
||||
{
|
||||
strSql += " AND LargerHazard.IsSuperLargerHazard=@IsSuperLargerHazard";
|
||||
listStr.Add(new SqlParameter("@IsSuperLargerHazard", drpIsSuperLargerHazard.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtTypeName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Const.ConstText LIKE @TypeName";
|
||||
|
|
|
@ -104,6 +104,15 @@ namespace FineUIPro.Web.HSSE.Solution
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtHazardCode;
|
||||
|
||||
/// <summary>
|
||||
/// drpIsSuperLargerHazard 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIsSuperLargerHazard;
|
||||
|
||||
/// <summary>
|
||||
/// txtTypeName 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
</div>
|
||||
<div class="zyp">
|
||||
<div class="lab">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,altitude %>" />
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,lifting %>" />
|
||||
</div>
|
||||
<div class="num"><%=WrokCount2 %>/<%=AllWrokCount2 %></div>
|
||||
</div>
|
||||
|
@ -499,10 +499,10 @@
|
|||
<div class="main" style="padding: .1875rem .25rem;">
|
||||
<div class="cl-tab">
|
||||
<div class="cl-btn cl-btn-act" id="span_gdcl" onclick="clOnclick(0)" style="cursor: pointer">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_MaterialLabel %>" />
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_PipeMaterials %>" />
|
||||
</div>
|
||||
<div class="cl-btn" onclick="clOnclick(1)" id="span_sbcl" style="cursor: pointer">
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_PipeMaterials %>" />
|
||||
<asp:Literal runat="server" Text="<%$ Resources:Lan,mainProject2_EquipmentMaterials %>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="table">
|
||||
|
@ -1988,20 +1988,20 @@
|
|||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: '#DADADA',
|
||||
},
|
||||
b: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
},
|
||||
c: {
|
||||
padding: [0, 6],
|
||||
fontSize: 14,
|
||||
padding: [0, 3],
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
d: {
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: '#12CDA2',
|
||||
}
|
||||
}
|
||||
|
@ -2150,20 +2150,20 @@
|
|||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: '#DADADA',
|
||||
},
|
||||
b: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
},
|
||||
c: {
|
||||
padding: [0, 6],
|
||||
fontSize: 14,
|
||||
padding: [0, 3],
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
d: {
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: '#12CDA2',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using BLL;
|
||||
using FineUIPro.Web.BaseInfo;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using FineUIPro.Web.OfficeCheck.Check;
|
||||
using FineUIPro.Web.SysManage;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
|
@ -30,7 +31,7 @@ namespace FineUIPro.Web.common
|
|||
protected string completed = string.Empty;
|
||||
|
||||
protected string qualified = string.Empty;
|
||||
|
||||
|
||||
protected string Cumulative_actual_value = string.Empty;
|
||||
|
||||
//实际值
|
||||
|
@ -202,7 +203,8 @@ namespace FineUIPro.Web.common
|
|||
//int wHours = db.SitePerson_PersonInOutNumber.Where(x => x.ProjectId == ProjectId).Max(x => x.WorkHours) ?? 0;
|
||||
int wHours = 0;
|
||||
DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString());
|
||||
wHours = (from x in db.T_d_EmployInOutRecord where x.ProjectId == ProjectId select x.ManHours ?? 0).ToList().Sum();
|
||||
//wHours = (from x in db.T_d_EmployInOutRecord where x.ProjectId == ProjectId select x.ManHours ?? 0).ToList().Sum();
|
||||
wHours = (from x in db.SitePerson_PersonInOutNumber where x.ProjectId == ProjectId orderby x.InOutDate descending select x.WorkHours ?? 0).ToList().FirstOrDefault();
|
||||
this.divSafeWorkTime.InnerHtml = wHours.ToString();
|
||||
|
||||
//本月安全人工时
|
||||
|
@ -215,19 +217,20 @@ namespace FineUIPro.Web.common
|
|||
this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString();
|
||||
|
||||
//安全培训累计人员
|
||||
var getTrainRecord = db.EduTrain_TrainRecord.Where(x => x.ProjectId == ProjectId).Sum(x => x.TrainPersonNum) ?? 0;
|
||||
//var getTrainRecord = db.EduTrain_TrainRecord.Where(x => x.ProjectId == ProjectId).Sum(x => x.TrainPersonNum) ?? 0;
|
||||
var getTrainRecord = db.View_EduTrain_TrainFind.Where(x => x.ProjectId == ProjectId).Count();
|
||||
//修改:增加博晟教育中的人数
|
||||
var boShengCount = db.Bo_Sheng_TrainPerson.Count(x => x.ProjectId == ProjectId && (x.DeleteTag == "False" || x.DeleteTag == null));
|
||||
|
||||
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
|
||||
|
||||
//安全管理人员
|
||||
var allSum = from x in Funs.DB.SitePerson_Person
|
||||
var allSum = from x in db.SitePerson_Person
|
||||
where x.ProjectId == ProjectId && x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime.Value > DateTime.Now)
|
||||
select x;
|
||||
|
||||
var glAllPerson = from x in allSum
|
||||
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
join y in db.Base_WorkPost on x.WorkPostId equals y.WorkPostId
|
||||
where y.IsHsse == true && x.ProjectId == ProjectId //安管人员
|
||||
select x;
|
||||
this.divSafeManagePersonNum.InnerHtml = glAllPerson.Count().ToString();
|
||||
|
@ -260,9 +263,29 @@ namespace FineUIPro.Web.common
|
|||
var getallin = from x in Funs.DB.T_d_EmployInOutRecord
|
||||
join z in Funs.DB.Base_WorkPost on x.PostId equals z.WorkPostId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
|
||||
//where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == Convert.ToDateTime("2023-08-28")
|
||||
select new { x.IDCardNo, z.PostType };
|
||||
|
||||
//var getallin = (from x in Funs.DB.SitePerson_Checking
|
||||
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
|
||||
// from z in zGroup.DefaultIfEmpty()
|
||||
// //join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId into yGroup
|
||||
// //from y in yGroup.DefaultIfEmpty()
|
||||
// join w in Funs.DB.Base_WorkPost on z.WorkPostId equals w.WorkPostId into wGroup
|
||||
// from w in wGroup.DefaultIfEmpty()
|
||||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.IntoOut == "1" && x.IntoOutTime >= DateTime.Now.Date
|
||||
// select new { x.PersonId, w.PostType }).Union
|
||||
// (from x in Funs.DB.SitePerson_PersonInOut
|
||||
// join z in Funs.DB.SitePerson_Person on x.PersonId equals z.PersonId into zGroup
|
||||
// from z in zGroup.DefaultIfEmpty()
|
||||
// //join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId into yGroup
|
||||
// //from y in yGroup.DefaultIfEmpty()
|
||||
// join w in Funs.DB.Base_WorkPost on z.WorkPostId equals w.WorkPostId into wGroup
|
||||
// from w in wGroup.DefaultIfEmpty()
|
||||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.IsIn == true && x.ChangeTime >= DateTime.Now.Date
|
||||
// select new { x.PersonId, w.PostType });
|
||||
|
||||
AllCount = getallin.Count();
|
||||
if (AllCount > 0)
|
||||
{
|
||||
|
@ -505,7 +528,8 @@ namespace FineUIPro.Web.common
|
|||
int allCount = 0;
|
||||
var getPersonQualitys = from x in Funs.DB.QualityAudit_PersonQuality
|
||||
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId
|
||||
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId == ProjectId && y.OutTime == null
|
||||
join z in Funs.DB.Base_WorkPost on y.WorkPostId equals z.WorkPostId
|
||||
where x.LimitDate.HasValue && x.LimitDate < DateTime.Now && y.ProjectId == ProjectId && y.OutTime == null && z.PostType == Const.PostType_2
|
||||
select x;
|
||||
//// 预警人数
|
||||
allCount = getPersonQualitys.Count();
|
||||
|
@ -864,19 +888,19 @@ namespace FineUIPro.Web.common
|
|||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true && x.ProjectId == ProjectId
|
||||
where (x.IsOnceQualified == null || x.IsOnceQualified == true) && x.ProjectId == ProjectId
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
var num3 = (from x in db.ProcessControl_InspectionManagement
|
||||
where (x.IsOnceQualified == false || x.IsOnceQualified == null) && x.ProjectId == ProjectId
|
||||
select x).Count();
|
||||
var allnum = (from x in db.ProcessControl_InspectionManagement
|
||||
where x.ProjectId == ProjectId
|
||||
select x).Count();
|
||||
var zgl = "0";
|
||||
if (num2 != 0)
|
||||
{
|
||||
zgl = String.Format("{0:N2}", 100.0 * num2 / (num2 + num3));
|
||||
zgl = String.Format("{0:N2}", 100.0 * num2 / allnum);
|
||||
zlgjzgl = zgl.ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
|
||||
zggjzglDataValue = (100 - (100.0 * num2 / allnum)).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -945,8 +969,8 @@ namespace FineUIPro.Web.common
|
|||
decimal a = 0, b = 0;
|
||||
if (ndtList.Count > 0)
|
||||
{
|
||||
//取每个单位最新的一条数据
|
||||
var datalist = ndtList.GroupBy(r => r.UnitId).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
|
||||
//取每个单位、专业最新的一条数据
|
||||
var datalist = ndtList.GroupBy(r => new { r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
|
||||
foreach (var item in datalist)
|
||||
{
|
||||
if (item.TotalQuantity.HasValue)
|
||||
|
@ -957,23 +981,23 @@ namespace FineUIPro.Web.common
|
|||
}
|
||||
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
}
|
||||
else
|
||||
{
|
||||
var hjglData =
|
||||
(from x in db.HJGL_FL_Data
|
||||
where x.ProjectId == ProjectId
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (hjglData != null)
|
||||
{
|
||||
a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
|
||||
b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
|
||||
if (a > 0 && b > 0)
|
||||
{
|
||||
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
}
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// var hjglData =
|
||||
// (from x in db.HJGL_FL_Data
|
||||
// where x.ProjectId == ProjectId
|
||||
// orderby x.CompileDate descending
|
||||
// select x).FirstOrDefault();
|
||||
// if (hjglData != null)
|
||||
// {
|
||||
// a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
|
||||
// b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
|
||||
// if (a > 0 && b > 0)
|
||||
// {
|
||||
// result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (b > 0)
|
||||
|
@ -1655,7 +1679,8 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
|
|||
SqlParameter[] Staticparameter = listStaticListStr.ToArray();
|
||||
DataTable statcitbDataTable = SQLHelper.GetDataTableRunProc("Sp_GJSXStatistic", Staticparameter);
|
||||
var list = from x in Funs.DB.GJSX where x.ProjectId == this.CurrUser.LoginProjectId && x.State != "1" select x;
|
||||
var allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now);
|
||||
//var allcount = list.Count(x => x.State == "0") + list.Count(x => x.State != "0" && x.CompleteDate < DateTime.Now);
|
||||
var allcount = list.Count();
|
||||
var closecount = list.Count(x => x.State == "0");
|
||||
gjsxRate = String.Format("{0:N2}", 100.0 * closecount / allcount);
|
||||
gjsxRate = gjsxRate.ToString().Replace("NaN", "0") + "%";
|
||||
|
@ -1744,7 +1769,7 @@ where qc.QuantityCompletionId=(select top 1 QuantityCompletionId from[JDGL_Quant
|
|||
}
|
||||
|
||||
//设备材料
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "管道" && x.ProjectId == pid);
|
||||
var SbclList = Funs.DB.CLGL_ContractListSum.Where(x => x.C1 == "设备" && x.ProjectId == pid);
|
||||
foreach (var item in SbclList)
|
||||
{
|
||||
sbclHtml += "<div class=\"row\">";
|
||||
|
|
|
@ -1902,7 +1902,7 @@
|
|||
]--%>
|
||||
createZL({ name: '<%=main_new_qualityIssuesRectificationRate%>', value1: <%=zlallNumber%>, value2: <%=zlfinishNumber%>, el: 'zl-map1' })
|
||||
createZL({ name: '<%=OnePassRate%>', value1: <%=zlgjallNumber%>, value2: <%=zlgjfinishNumber%>, el: 'zl-map2' })
|
||||
createZL({ name: '<%=OnePassRateOfWelding%>', value1: <%=hjallNumber%>, value2: <%=hjfinishNumber%>, el: 'zl-map3' })
|
||||
createZL3({ name: '<%=OnePassRateOfWelding%>', value1: <%=hjallNumber%>, value2: <%=hjfinishNumber%>, el: 'zl-map3' })
|
||||
|
||||
function createZL(obj) {
|
||||
let AOption1 = {
|
||||
|
@ -1916,32 +1916,189 @@
|
|||
fontWeight: 100
|
||||
}
|
||||
}, {
|
||||
// text: `总计:${obj.value1} | 完成:${obj.value2}`,
|
||||
text: [`{a|<%=total%>:}{b|${obj.value1}}{c||}{a|<%=completed%>:}{d|${obj.value2}}`],
|
||||
top: '80%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 12,
|
||||
color: '#DADADA',
|
||||
// text: `总计:${obj.value1} | 完成:${obj.value2}`,
|
||||
text: [`{a|<%=total%>:}{b|${obj.value1}}{c||}{a|<%=completed%>:}{d|${obj.value2}}`],
|
||||
top: '80%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 12,
|
||||
color: '#DADADA',
|
||||
},
|
||||
b: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 12,
|
||||
},
|
||||
c: {
|
||||
padding: [0, 3],
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
d: {
|
||||
fontSize: 12,
|
||||
color: '#12CDA2',
|
||||
}
|
||||
},
|
||||
b: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 12,
|
||||
},
|
||||
c: {
|
||||
padding: [0, 6],
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
d: {
|
||||
fontSize: 12,
|
||||
color: '#12CDA2',
|
||||
}
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
type: 'gauge',
|
||||
radius: "60%",
|
||||
center: ["50%", "30%"],
|
||||
startAngle: 360,
|
||||
endAngle: 0,
|
||||
splitNumber: 20,
|
||||
progress: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
roundCap: true,
|
||||
lineStyle: {
|
||||
width: 20,
|
||||
color: [[1, new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1, // 这四个参数分别表示渐变的起点 (x1, y1) 与终点 (x2, y2)
|
||||
[
|
||||
{ offset: 0, color: 'RGBA(38, 223, 235, .4)' }, // 0% 处的颜色
|
||||
{ offset: 1, color: '#29F1FA' } // 100% 处的颜色
|
||||
]
|
||||
)]]
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
valueAnimation: true,
|
||||
formatter: function (value) {
|
||||
//str = `{a|${(obj.value2 / obj.value1 * 100).toFixed(2)}}{b|%}`
|
||||
str = `{a|${parseFloat((obj.value2 / obj.value1 * 100).toFixed(2))}}{b|%}`
|
||||
return str;
|
||||
},
|
||||
color: 'inherit',
|
||||
offsetCenter: [0, 0],
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 20,
|
||||
color: '#FFFFFF'
|
||||
},
|
||||
b: {
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF'
|
||||
}
|
||||
}
|
||||
},
|
||||
pointer: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
|
||||
distance: -20,
|
||||
length: 20,
|
||||
|
||||
lineStyle: {
|
||||
color: '#021837',
|
||||
width: 4,
|
||||
}
|
||||
},
|
||||
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
anchor: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: obj.value1 },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
type: 'gauge',
|
||||
radius: "68%",
|
||||
center: ["50%", "30%"],
|
||||
startAngle: 20,
|
||||
endAngle: 200,
|
||||
splitNumber: 20,
|
||||
progress: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
roundCap: true,
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: [[1, new echarts.graphic.LinearGradient(
|
||||
0, 0, 0, 1, // 这四个参数分别表示渐变的起点 (x1, y1) 与终点 (x2, y2)
|
||||
[
|
||||
{ offset: 0, color: 'RGBA(38, 223, 235, .4)' }, // 0% 处的颜色
|
||||
{ offset: 1, color: '#29F1FA' } // 100% 处的颜色
|
||||
]
|
||||
)]]
|
||||
}
|
||||
},
|
||||
pointer: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
anchor: {
|
||||
show: false
|
||||
},
|
||||
}
|
||||
},
|
||||
]
|
||||
};
|
||||
var aPassChart = echarts.init(document.getElementById(obj.el));
|
||||
aPassChart.setOption(AOption1);
|
||||
}
|
||||
function createZL3(obj) {
|
||||
let AOption1 = {
|
||||
title: [{
|
||||
text: obj.name || '',
|
||||
top: '62%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 14,
|
||||
fontWeight: 100
|
||||
}
|
||||
}, {
|
||||
// text: `总计:${obj.value1} | 完成:${obj.value2}`,
|
||||
text: [`{a|<%=total%>:}{b|${obj.value1}}{c||}{a|<%=qualified%>:}{d|${obj.value2}}`],
|
||||
top: '80%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
rich: {
|
||||
a: {
|
||||
fontSize: 12,
|
||||
color: '#DADADA',
|
||||
},
|
||||
b: {
|
||||
color: '#FFFFFF',
|
||||
fontSize: 12,
|
||||
},
|
||||
c: {
|
||||
padding: [0, 3],
|
||||
fontSize: 12,
|
||||
color: '#FFFFFF',
|
||||
},
|
||||
d: {
|
||||
fontSize: 12,
|
||||
color: '#12CDA2',
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@ using System.Web;
|
|||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Org.BouncyCastle.Ocsp;
|
||||
using FineUIPro.Web.HJGL.FL;
|
||||
|
||||
namespace FineUIPro.Web.common
|
||||
{
|
||||
|
@ -29,6 +30,7 @@ namespace FineUIPro.Web.common
|
|||
protected string OnePassRateOfWelding = string.Empty;
|
||||
protected string total = string.Empty;
|
||||
protected string completed = string.Empty;
|
||||
protected string qualified = string.Empty;
|
||||
protected string mainI_progressStatistics = string.Empty;
|
||||
protected string Percentage_of_progress = string.Empty;
|
||||
|
||||
|
@ -75,7 +77,7 @@ namespace FineUIPro.Web.common
|
|||
: db.Base_Project
|
||||
.Where(x => x.ProjectState == "1")
|
||||
.Select(x => x.ProjectId)
|
||||
.ToArray();
|
||||
.ToArray();
|
||||
//在建项目
|
||||
if (pids == null)
|
||||
{
|
||||
|
@ -102,7 +104,6 @@ namespace FineUIPro.Web.common
|
|||
if (countAqrgsSum > 10000)
|
||||
{
|
||||
countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00);
|
||||
|
||||
this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万";
|
||||
}
|
||||
else
|
||||
|
@ -112,8 +113,8 @@ namespace FineUIPro.Web.common
|
|||
|
||||
// 当月安全人工时
|
||||
var countMonthAqrgs = pids?.Any() == true
|
||||
? CountAqrgs(getStartMonth(), getEndMonth(), pids)
|
||||
: CountAqrgs(getStartMonth(), getEndMonth());
|
||||
? CountAqrgs(getLastMonthEndDay(), getEndMonth(), pids)
|
||||
: CountAqrgs(getLastMonthEndDay(), getEndMonth());
|
||||
|
||||
|
||||
if (countMonthAqrgs > 10000)
|
||||
|
@ -130,7 +131,8 @@ namespace FineUIPro.Web.common
|
|||
var trainingQuery = db.EduTrain_TrainRecord
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.GroupBy(x => 1)
|
||||
.Select(g => new {
|
||||
.Select(g => new
|
||||
{
|
||||
TrainCount = g.Sum(x => x.TrainPersonNum) ?? 0,
|
||||
BoShengCount = db.Bo_Sheng_TrainPerson
|
||||
.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null))
|
||||
|
@ -141,94 +143,96 @@ namespace FineUIPro.Web.common
|
|||
|
||||
divSafePersonNum.InnerHtml = trainingQuery != null
|
||||
? (trainingQuery.TrainCount + trainingQuery.BoShengCount).ToString()
|
||||
: "0";
|
||||
: "0";
|
||||
|
||||
|
||||
|
||||
// 安全管理人员(优化关联查询)
|
||||
var safetyStaffCount = db.SitePerson_Person
|
||||
.Where(x=> x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now))
|
||||
.Where(x => x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now))
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Join(db.Base_WorkPost.Where(x => x.IsHsse==true),
|
||||
.Join(db.Base_WorkPost.Where(x => x.IsHsse == true),
|
||||
person => person.WorkPostId,
|
||||
post => post.WorkPostId,
|
||||
(person, post) => person)
|
||||
.Count();
|
||||
divSafeManagePersonNum.InnerText = safetyStaffCount.ToString();
|
||||
});
|
||||
});
|
||||
}
|
||||
// 质量统计模块封装
|
||||
private async Task BindQualityStatisticsAsync()
|
||||
{
|
||||
await Task.Run(() => {
|
||||
await Task.Run(() =>
|
||||
{
|
||||
|
||||
var db = Funs.DB;
|
||||
var db = Funs.DB;
|
||||
// 质量管理人员(合并公司+项目级查询)
|
||||
var qualityQuery = db.Base_WorkPost
|
||||
.Where(x => x.IsCQMS == true)
|
||||
.GroupJoin(db.SitePerson_Person.Where(x=> x.IsUsed == true),
|
||||
.GroupJoin(db.SitePerson_Person.Where(x => x.IsUsed == true),
|
||||
post => post.WorkPostId,
|
||||
person => person.WorkPostId,
|
||||
(post, persons) => new { post, persons })
|
||||
.SelectMany(x => x.persons.DefaultIfEmpty(),
|
||||
(x, person) => new { x.post, person })
|
||||
.Where(x => pids.Contains(x.person.ProjectId));
|
||||
|
||||
|
||||
//企业总部人员和分支机构人员
|
||||
var query = (from person in db.Person_CompanyBranchPerson
|
||||
join unit in db.Base_Unit on person.UnitId equals unit.UnitId into unitJoin
|
||||
from unit in unitJoin.DefaultIfEmpty() // 左连接
|
||||
join workPost in db.Base_WorkPost on person.WorkPostId equals workPost.WorkPostId into workPostJoin
|
||||
from workPost in workPostJoin.DefaultIfEmpty() // 左连接
|
||||
where person.IsOnJob == true && workPost.IsCQMS == true
|
||||
select new
|
||||
{
|
||||
ID = person.CompanyBranchPersonId,
|
||||
UnitName = unit.UnitName,
|
||||
PersonName = person.PersonName,
|
||||
SexStr = person.Sex == "1" ? "男" : "女",
|
||||
IdentityCard = person.IdentityCard,
|
||||
WorkPostName = workPost.WorkPostName,
|
||||
Telephone = person.Telephone,
|
||||
IsOnJob = person.IsOnJob,
|
||||
Remark = person.Remark,
|
||||
ProjectName = ""
|
||||
}).ToList();
|
||||
join unit in db.Base_Unit on person.UnitId equals unit.UnitId into unitJoin
|
||||
from unit in unitJoin.DefaultIfEmpty() // 左连接
|
||||
join workPost in db.Base_WorkPost on person.WorkPostId equals workPost.WorkPostId into workPostJoin
|
||||
from workPost in workPostJoin.DefaultIfEmpty() // 左连接
|
||||
where person.IsOnJob == true && workPost.IsCQMS == true
|
||||
select new
|
||||
{
|
||||
ID = person.CompanyBranchPersonId,
|
||||
UnitName = unit.UnitName,
|
||||
PersonName = person.PersonName,
|
||||
SexStr = person.Sex == "1" ? "男" : "女",
|
||||
IdentityCard = person.IdentityCard,
|
||||
WorkPostName = workPost.WorkPostName,
|
||||
Telephone = person.Telephone,
|
||||
IsOnJob = person.IsOnJob,
|
||||
Remark = person.Remark,
|
||||
ProjectName = ""
|
||||
}).ToList();
|
||||
|
||||
divCqmsManageNum.InnerText = (qualityQuery.Count() + query.Count()).ToString();
|
||||
// 质量培训人员
|
||||
divCqmsPxNum.InnerText = db.Comprehensive_InspectionPerson
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Count(x => x.IsTrain == true).ToString();
|
||||
divCqmsPxNum.InnerText = db.Comprehensive_InspectionPerson
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Count(x => x.IsTrain == true).ToString();
|
||||
});
|
||||
}
|
||||
// 项目统计优化
|
||||
private async Task BindProjectStatisticsAsync()
|
||||
{
|
||||
await Task.Run(() => {
|
||||
var db = Funs.DB;
|
||||
int acount = allProjects.Count();
|
||||
int pcount1 = 0;
|
||||
int pcount2 = 0;
|
||||
int pcount3 = 0;
|
||||
if (acount > 0)
|
||||
await Task.Run(() =>
|
||||
{
|
||||
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select( x => x.ProjectId).Count();
|
||||
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
|
||||
if (pids == null)
|
||||
var db = Funs.DB;
|
||||
int acount = allProjects.Count();
|
||||
int pcount1 = 0;
|
||||
int pcount2 = 0;
|
||||
int pcount3 = 0;
|
||||
if (acount > 0)
|
||||
{
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId).Count();
|
||||
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
|
||||
if (pids == null)
|
||||
{
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
else
|
||||
{
|
||||
pidzjsg = pids;
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
pcount3 = Count3(pidzjsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
pidzjsg = pids;
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
pcount3 = Count3(pidzjsg);
|
||||
}
|
||||
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
|
||||
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
|
||||
div_wdgcCount.InnerHtml = pcount3.ToString() + "<div class=\"th\">个</div>";
|
||||
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
|
||||
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
|
||||
div_wdgcCount.InnerHtml = pcount3.ToString() + "<div class=\"th\">个</div>";
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -236,16 +240,31 @@ namespace FineUIPro.Web.common
|
|||
#region 当月人工时
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取上月的月末日期
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DateTime getLastMonthEndDay()
|
||||
{
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now.AddMonths(-1);
|
||||
// 获取当前月的最后一天
|
||||
DateTime lastDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, DateTime.DaysInMonth(currentDate.Year, currentDate.Month));
|
||||
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前月的月末日期
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DateTime getEndMonth()
|
||||
{
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now;
|
||||
// 获取当前月的最后一天
|
||||
DateTime lastDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, DateTime.DaysInMonth(currentDate.Year, currentDate.Month));
|
||||
|
||||
int span = Convert.ToInt32(System.DateTime.Now.Day);
|
||||
System.DateTime dateEnd = System.DateTime.Now.AddMonths(1).AddDays(-span);
|
||||
return dateEnd;
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前月初日期
|
||||
|
@ -253,10 +272,11 @@ namespace FineUIPro.Web.common
|
|||
/// <returns></returns>
|
||||
public static DateTime getStartMonth()
|
||||
{
|
||||
int span = Convert.ToInt32(System.DateTime.Now.Day);
|
||||
span = span - 1;
|
||||
System.DateTime dateStart = System.DateTime.Now.AddDays(-span);
|
||||
return dateStart;
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now;
|
||||
// 获取当前月的月初日期
|
||||
DateTime firstDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, 1);
|
||||
return firstDayOfMonth;
|
||||
}
|
||||
|
||||
//安全人工时(穿透)
|
||||
|
@ -272,8 +292,7 @@ namespace FineUIPro.Web.common
|
|||
var datetime1 = d1;
|
||||
var datetime2 = d2;
|
||||
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
|
||||
select new { x.ProjectId, x.InOutDate, x.WorkHours };
|
||||
select new { x.ProjectId, x.InOutDate, x.WorkHours };
|
||||
if (pids != null)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => pids.Contains(x.ProjectId));
|
||||
|
@ -286,18 +305,20 @@ namespace FineUIPro.Web.common
|
|||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
|
||||
}
|
||||
var projects = getAllPersonInOutList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.Select(g => new
|
||||
{
|
||||
Project = g.Key,
|
||||
Items = g.OrderBy(x => x.InOutDate).ToList()
|
||||
})
|
||||
.Where(g => g.Items.Any());
|
||||
cout1 = projects.ToList().Sum(g =>
|
||||
(g.Items.Last().WorkHours ?? 0) -
|
||||
(g.Items.First().WorkHours ?? 0));
|
||||
var projects = getAllPersonInOutList.GroupBy(x => x.ProjectId).Select(g => new
|
||||
{
|
||||
Project = g.Key,
|
||||
Items = g.OrderBy(x => x.InOutDate).ToList()
|
||||
}).Where(g => g.Items.Any());
|
||||
|
||||
if (!datetime1.HasValue && !datetime2.HasValue)
|
||||
{//查累计人工时
|
||||
cout1 = projects.ToList().Sum(g => (g.Items.Last().WorkHours ?? 0));
|
||||
}
|
||||
else
|
||||
{//查当月人工时
|
||||
cout1 = projects.ToList().Sum(g => (g.Items.Last().WorkHours ?? 0) - (g.Items.First().WorkHours ?? 0));
|
||||
}
|
||||
|
||||
var getD1 = from x in Funs.DB.Accident_AccidentHandle
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
|
@ -322,7 +343,7 @@ namespace FineUIPro.Web.common
|
|||
{
|
||||
getD1 = getD1.Where(x => x.AccidentDate <= datetime2);
|
||||
getD2 = getD2.Where(x => x.CompileDate <= datetime2);
|
||||
}
|
||||
}
|
||||
if (getD1.Any())
|
||||
{
|
||||
cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0);
|
||||
|
@ -388,7 +409,7 @@ namespace FineUIPro.Web.common
|
|||
return await Task.Run(() =>
|
||||
{
|
||||
Model.SingleSerie series = new Model.SingleSerie();
|
||||
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x=> new { x.ProjectId, x.ProjectName, x.ProjectState2, x.Province, x.ShortName }).ToList();
|
||||
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => new { x.ProjectId, x.ProjectName, x.ProjectState2, x.Province, x.ShortName }).ToList();
|
||||
var consts = Funs.DB.Sys_Const.Where(x => x.GroupId == ConstValue.GroupId_ProjectState).ToList();
|
||||
string name = string.Empty;
|
||||
if (project1s.Any())
|
||||
|
@ -456,25 +477,25 @@ namespace FineUIPro.Web.common
|
|||
var accidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂")
|
||||
select new { x.ProjectId, x.AccidentDate } ;
|
||||
select new { x.ProjectId, x.AccidentDate };
|
||||
var accidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂")
|
||||
select new { x.ProjectId, x.AccidentDate };
|
||||
var allProvinceProjectList = (from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where provinces.Contains(y.CnShortName )
|
||||
select new { x,y.CnShortName}).ToList();
|
||||
var allProvinces= allProvinceProjectList.Select(x =>x.CnShortName ).Distinct().ToList();
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where provinces.Contains(y.CnShortName)
|
||||
select new { x, y.CnShortName }).ToList();
|
||||
var allProvinces = allProvinceProjectList.Select(x => x.CnShortName).Distinct().ToList();
|
||||
foreach (var province in allProvinces)
|
||||
{
|
||||
int accidentNum = 0;
|
||||
DateTime date = DateTime.Now;
|
||||
decimal money1 = 0, money2 = 0;
|
||||
/* var projects = from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where y.CnShortName == province
|
||||
select x;*/
|
||||
/* var projects = from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where y.CnShortName == province
|
||||
select x;*/
|
||||
var projects = allProvinceProjectList.Where(x => x.CnShortName == province);
|
||||
listdata.Add(projects.Count());
|
||||
decimal progress = 0;
|
||||
|
@ -699,7 +720,7 @@ namespace FineUIPro.Web.common
|
|||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.State == "7"
|
||||
where x.State == "7"
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
|
@ -716,11 +737,11 @@ namespace FineUIPro.Web.common
|
|||
else
|
||||
{
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where pids.Contains(x.ProjectId)
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.State == "7" && pids.Contains(x.ProjectId)
|
||||
where x.State == "7" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
|
@ -755,7 +776,7 @@ namespace FineUIPro.Web.common
|
|||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true
|
||||
where (x.IsOnceQualified == null || x.IsOnceQualified == true)
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
|
@ -771,7 +792,7 @@ namespace FineUIPro.Web.common
|
|||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
||||
where (x.IsOnceQualified == null || x.IsOnceQualified == true) && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
|
@ -799,40 +820,83 @@ namespace FineUIPro.Web.common
|
|||
List<double> listdata = new List<double>();
|
||||
double result = 0;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New select x;
|
||||
var ndtLists = (from x in db.ProcessControl_NondestructiveTest_New select x).ToList();
|
||||
if (pids != null)
|
||||
{
|
||||
ndtLists = ndtLists.Where(x=>pids.Contains(x.ProjectId));
|
||||
ndtLists = ndtLists.Where(x => pids.Contains(x.ProjectId)).ToList();
|
||||
}
|
||||
decimal a = 0, b = 0;
|
||||
|
||||
var sumResult = ndtLists
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.Select(g => new {
|
||||
TotalQ = g.OrderByDescending(x => x.CreateDate)
|
||||
.Select(x => x.TotalQuantity)
|
||||
.FirstOrDefault(),
|
||||
Rate = g.OrderByDescending(x => x.CreateDate)
|
||||
.Select(x => x.TotalRate)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.Where(x => x.TotalQ.HasValue).ToList()
|
||||
.Select(x => new {
|
||||
A = Math.Floor(x.TotalQ.Value * (decimal.Parse(x.Rate)) / 100),
|
||||
B = x.TotalQ.Value
|
||||
});
|
||||
a = sumResult.Sum(x=>x.A);
|
||||
b = sumResult.Sum(x => x.B);
|
||||
if (ndtLists.Count > 0)
|
||||
{
|
||||
//取每个单位、专业最新的一条数据
|
||||
var datalist = ndtLists.GroupBy(r => new { r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
|
||||
foreach (var item in datalist)
|
||||
{
|
||||
if (item.TotalQuantity.HasValue)
|
||||
{
|
||||
a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / 100);
|
||||
b += item.TotalQuantity.Value;
|
||||
}
|
||||
}
|
||||
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// var hjglData =
|
||||
// (from x in db.HJGL_FL_Data
|
||||
// where x.ProjectId == ProjectId
|
||||
// orderby x.CompileDate descending
|
||||
// select x).FirstOrDefault();
|
||||
// if (hjglData != null)
|
||||
// {
|
||||
// a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
|
||||
// b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
|
||||
// if (a > 0 && b > 0)
|
||||
// {
|
||||
// result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (b > 0)
|
||||
{
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
||||
|
||||
hjallNumber = b.ToString();
|
||||
hjfinishNumber = a.ToString();
|
||||
hjzgl = result.ToString();
|
||||
hjDataValue = (100 - result).ToString();
|
||||
}
|
||||
//var sumResult = ndtLists
|
||||
// .GroupBy(x => x.ProjectId)
|
||||
// .Select(g => new
|
||||
// {
|
||||
// TotalQ = g.OrderByDescending(x => x.CreateDate)
|
||||
// .Select(x => x.TotalQuantity)
|
||||
// .FirstOrDefault(),
|
||||
// Rate = g.OrderByDescending(x => x.CreateDate)
|
||||
// .Select(x => x.TotalRate)
|
||||
// .FirstOrDefault()
|
||||
// })
|
||||
// .Where(x => x.TotalQ.HasValue).ToList()
|
||||
// .Select(x => new
|
||||
// {
|
||||
// A = Math.Floor(x.TotalQ.Value * (decimal.Parse(x.Rate)) / 100),
|
||||
// B = x.TotalQ.Value
|
||||
// });
|
||||
//a = sumResult.Sum(x => x.A);
|
||||
//b = sumResult.Sum(x => x.B);
|
||||
|
||||
//if (b > 0)
|
||||
//{
|
||||
// result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
||||
|
||||
// hjallNumber = b.ToString();
|
||||
// hjfinishNumber = a.ToString();
|
||||
// hjzgl = result.ToString();
|
||||
// hjDataValue = (100 - result).ToString();
|
||||
//}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -906,7 +970,7 @@ namespace FineUIPro.Web.common
|
|||
var getallin = new List<Model.PageDataPersonInOutItem>();
|
||||
if (pids == null)
|
||||
{
|
||||
getallin = APIPageDataService.getPersonNum(new List<string>(),DateTime.Now);
|
||||
getallin = APIPageDataService.getPersonNum(new List<string>(), DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -928,8 +992,8 @@ namespace FineUIPro.Web.common
|
|||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
ProjectPersonCount += "'" + getallin.Count(x => x.ProjectId == item.ProjectId) + "',";
|
||||
}
|
||||
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
||||
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
||||
ProjectPersonMc = !string.IsNullOrWhiteSpace(ProjectPersonMc) ? ProjectPersonMc.TrimEnd(',') : string.Empty;
|
||||
ProjectPersonCount = !string.IsNullOrWhiteSpace(ProjectPersonCount) ? ProjectPersonCount.TrimEnd(',') : string.Empty;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
@ -947,7 +1011,7 @@ namespace FineUIPro.Web.common
|
|||
foreach (var item in allProjects)
|
||||
{
|
||||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
ProjectPersonCount += "'" + allperson.Count(x=>x.ProjectId==item.ProjectId) + "',";
|
||||
ProjectPersonCount += "'" + allperson.Count(x => x.ProjectId == item.ProjectId) + "',";
|
||||
}
|
||||
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
||||
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
||||
|
@ -963,7 +1027,7 @@ namespace FineUIPro.Web.common
|
|||
var list = allProjects;
|
||||
if (list.Any())
|
||||
{
|
||||
var progressCompletions = from x in Funs.DB.JDGL_ProgressCompletion select x ;
|
||||
var progressCompletions = from x in Funs.DB.JDGL_ProgressCompletion select x;
|
||||
foreach (var item in list)
|
||||
{
|
||||
var pCs = progressCompletions.Where(x => x.ProjectId == item.ProjectId).ToList();
|
||||
|
@ -989,7 +1053,7 @@ namespace FineUIPro.Web.common
|
|||
div_zgwwc.InnerHtml = GeneralNotClosedNum.ToString();
|
||||
div_zgwcl.InnerHtml = (100.0 * GeneralClosedNum / (GeneralNotClosedNum + GeneralClosedNum)).ToString("0.##") + "%";
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1112,13 +1176,11 @@ namespace FineUIPro.Web.common
|
|||
#endregion
|
||||
|
||||
#region 设备材料
|
||||
sbclHtml += " <div class=\"row\">";
|
||||
pname = item.ShortName;
|
||||
if (item.ShortName.Length > 5)
|
||||
{
|
||||
pname = item.ShortName.Substring(0, 5) + "...";
|
||||
}
|
||||
sbclHtml += "<div class=\"th-p\" title=\"" + item.ShortName + "\">" + pname + "</div>";
|
||||
//采购量
|
||||
var SbcllCglList = SbclList.Where(x => x.ProjectId == pid).ToList();
|
||||
double SbcllCgl = 0.0;
|
||||
|
@ -1137,6 +1199,8 @@ namespace FineUIPro.Web.common
|
|||
}
|
||||
}
|
||||
|
||||
sbclHtml += "<div class=\"row\">";
|
||||
sbclHtml += "<div class=\"th-p\" title=\"" + item.ShortName + "\">" + pname + "</div>";
|
||||
sbclHtml += "<div class=\"th-p\">" + SbcllCgl + "</div>";
|
||||
sbclHtml += "<div class=\"th-p\">" + Sbdhs + "</div>";
|
||||
//百分比
|
||||
|
@ -1149,10 +1213,6 @@ namespace FineUIPro.Web.common
|
|||
{
|
||||
sbclHtml += "<div class=\"th-p\">0%</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sbclHtml += " </div>";
|
||||
#endregion
|
||||
}
|
||||
|
@ -1165,7 +1225,8 @@ namespace FineUIPro.Web.common
|
|||
/// <returns></returns>
|
||||
private int GetNearMissNum()
|
||||
{
|
||||
string cacheKey = "NearMissNum_" + string.Join("_",pids);
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string cacheKey = "NearMissNum_" + string.Join("_", pids);
|
||||
var memoryCache = MemoryCache.Default;
|
||||
if (memoryCache.Get(cacheKey) != null)
|
||||
{
|
||||
|
@ -1174,18 +1235,36 @@ namespace FineUIPro.Web.common
|
|||
int result = 0;
|
||||
if (pids == null)
|
||||
{
|
||||
result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂")
|
||||
select x;
|
||||
var wsAccidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂")
|
||||
select x;
|
||||
result = wsAccidentList1.Count() + wsAccidentList2.Count();
|
||||
//result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
// join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
// where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
// select x).Count();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂") && pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
var wsAccidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂") && pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
result = wsAccidentList1.Count() + wsAccidentList2.Count();
|
||||
//result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
// join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
// where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
// && pids.Contains(x.ProjectId)
|
||||
// select x).Count();
|
||||
}
|
||||
|
||||
var policy = new CacheItemPolicy
|
||||
|
@ -1210,6 +1289,7 @@ namespace FineUIPro.Web.common
|
|||
OnePassRateOfWelding = Resources.Lan.OnePassRateOfWelding;
|
||||
total = Resources.Lan.total;
|
||||
completed = Resources.Lan.completed;
|
||||
qualified = Resources.Lan.qualified;
|
||||
mainI_progressStatistics = Resources.Lan.mainI_progressStatistics;
|
||||
Percentage_of_progress = Resources.Lan.Percentage_of_progress;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue