20231024
This commit is contained in:
parent
4abb69942e
commit
bfb4cdc428
|
@ -0,0 +1 @@
|
|||
UPDATE TOP(1) [dbo].[Sys_Menu] SET [MenuId]=N'68A54450-557C-4C33-9121-797C15AF1047', [MenuName]=N'开工报告', [Icon]=NULL, [Url]=N'PZHGL/StartWorkReport.aspx', [SortIndex]='10', [SuperMenu]=N'0', [MenuType]=N'Menu_CQMS', [IsOffice]='0', [IsEnd]='1', [IsUsed]='1' WHERE ([MenuId]=N'68A54450-557C-4C33-9121-797C15AF1047');
|
|
@ -73,22 +73,26 @@
|
|||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpSponsorUnit" runat="server" Label="施工单位" EnableEdit="true" EmptyText="请选择查询条件"
|
||||
<f:DropDownList ID="drpSponsorUnit" runat="server" Label="施工单位" EnableEdit="true" EmptyText="请选择查询条件" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="btnQuery_Click"
|
||||
LabelAlign="right">
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="btnQuery_Click">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpCNProfessional" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="drpCNProfessional" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="btnQuery_Click">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpQuestionType" runat="server" Label="问题类别" Width="210px" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="drpQuestionType" runat="server" Label="问题类别" Width="210px" LabelAlign="Right" EnableEdit="true" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="btnQuery_Click">
|
||||
</f:DropDownList>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="dpHandelStatus" runat="server" Label="整改状态" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="dpHandelStatus" runat="server" Label="整改状态" LabelAlign="Right" EnableEdit="true" AutoPostBack="true" EnableMultiSelect="true" EnableCheckBoxSelect="true" OnSelectedIndexChanged="btnQuery_Click" AutoSelectFirstItem="false">
|
||||
<f:ListItem Text="待整改" Value="4" />
|
||||
<f:ListItem Text="已整改-待复查验收" Value="1" />
|
||||
<f:ListItem Text="超期未整改" Value="3" />
|
||||
|
@ -96,16 +100,15 @@
|
|||
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime"
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime" AutoPostBack="true" OnTextChanged="btnQuery_Click"
|
||||
LabelAlign="right" >
|
||||
</f:DatePicker>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime"
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime" AutoPostBack="true" OnTextChanged="btnQuery_Click"
|
||||
LabelAlign="right" >
|
||||
</f:DatePicker>
|
||||
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" >
|
||||
</f:Button>
|
||||
|
||||
<f:Button ID="btnRset" OnClick="btnRset_Click" ToolTip="重置" Icon="ArrowUndo" EnablePostBack="true" runat="server" >
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace FineUIPro.Web.CQMS.Check
|
|||
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
|
||||
CNProfessionalService.InitCNProfessionalDownList(drpCNProfessional, true);
|
||||
QualityQuestionTypeService.InitQualityQuestionTypeDownList(drpQuestionType, true);
|
||||
Funs.FineUIPleaseSelect(this.dpHandelStatus);
|
||||
//Funs.FineUIPleaseSelect(this.dpHandelStatus);
|
||||
btnNew.OnClientClick = Window1.GetShowReference("ChecklistEdit.aspx") + "return false;";
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
|
||||
|
@ -166,23 +166,30 @@ namespace FineUIPro.Web.CQMS.Check
|
|||
strSql += " AND chec.QuestionType=@QuestionType";
|
||||
listStr.Add(new SqlParameter("@QuestionType", drpQuestionType.SelectedValue));
|
||||
}
|
||||
if (dpHandelStatus.SelectedValue != Const._Null)
|
||||
if (dpHandelStatus.SelectedValueArray.Count() > 0)
|
||||
{
|
||||
if (dpHandelStatus.SelectedValue.Equals("1"))
|
||||
string subQuery = "";
|
||||
if (dpHandelStatus.SelectedValueArray.Contains("1"))
|
||||
{
|
||||
strSql += " AND (chec.state='5' or chec.state='6')";
|
||||
subQuery += " ((chec.state='5' or chec.state='6')) OR";
|
||||
}
|
||||
else if (dpHandelStatus.SelectedValue.Equals("2"))
|
||||
if (dpHandelStatus.SelectedValueArray.Contains("2"))
|
||||
{
|
||||
strSql += " AND chec.state='7'";
|
||||
subQuery += " (chec.state='7') OR";
|
||||
}
|
||||
else if (dpHandelStatus.SelectedValue.Equals("3"))
|
||||
if (dpHandelStatus.SelectedValueArray.Contains("3"))
|
||||
{
|
||||
strSql += " AND DATEADD(day,1,chec.LimitDate)< GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7";
|
||||
subQuery += " (DATEADD(day,1,chec.LimitDate)< GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7) OR";
|
||||
}
|
||||
else if (dpHandelStatus.SelectedValue.Equals("4"))
|
||||
if (dpHandelStatus.SelectedValueArray.Contains("4"))
|
||||
{
|
||||
strSql += " AND DATEADD(day,1,chec.LimitDate)> GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7";
|
||||
subQuery += " (DATEADD(day,1,chec.LimitDate)> GETDATE() and chec.state<>5 and chec.state<>6 and chec.state<>7) OR";
|
||||
}
|
||||
|
||||
subQuery = subQuery.TrimEnd('R').TrimEnd('O');
|
||||
if (!string.IsNullOrEmpty(subQuery))
|
||||
{
|
||||
strSql += " and " + subQuery;
|
||||
}
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
|
|
@ -131,15 +131,6 @@ namespace FineUIPro.Web.CQMS.Check
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndTime;
|
||||
|
||||
/// <summary>
|
||||
/// btnQuery 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQuery;
|
||||
|
||||
/// <summary>
|
||||
/// btnRset 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -100,11 +100,17 @@ namespace FineUIPro.Web.HSSE.Manager
|
|||
|
||||
for (int i = 1; i <= 12; i++)
|
||||
{
|
||||
|
||||
if (i != cm)
|
||||
{
|
||||
//string monthC = "Month" + i.ToString();
|
||||
//RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
//e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
DateTime temp = DateTime.Parse(DateTime.Now.Year + "-" + i + "-10");
|
||||
if (temp.AddMonths(1) < DateTime.Now)
|
||||
{
|
||||
string monthC = "Month" + i.ToString();
|
||||
RenderField month = Grid1.FindColumn(monthC) as RenderField;
|
||||
e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
<f:TextBox runat="server" Label="岗位" ID="txtWorkPostName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="70px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpIsUsedName" runat="server" Label="状态" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged ="TextBox_TextChanged"
|
||||
Width="200px" LabelWidth="70px" LabelAlign="right" ForceSelection="false">
|
||||
<f:ListItem Value="待审核" Text="待审核" />
|
||||
<f:ListItem Value="在岗" Text="在岗" Selected="true"/>
|
||||
<f:ListItem Value="离岗" Text="离岗" />
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
|
|
|
@ -90,6 +90,21 @@ namespace FineUIPro.Web.HSSE.QualityAudit
|
|||
{
|
||||
strSql += " AND Person.CardNo LIKE @CardNo";
|
||||
listStr.Add(new SqlParameter("@CardNo", "%" + this.txtCardNo.Text.Trim() + "%"));
|
||||
}
|
||||
if (drpIsUsedName.SelectedValue == "待审核")
|
||||
{
|
||||
strSql += " AND Person.IsUsed = @IsUsed";
|
||||
listStr.Add(new SqlParameter("@IsUsed", "2"));
|
||||
}
|
||||
else if (drpIsUsedName.SelectedValue == "在岗")
|
||||
{
|
||||
strSql += " AND Person.IsUsed = @IsUsed";
|
||||
listStr.Add(new SqlParameter("@IsUsed", "1"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND Person.IsUsed = @IsUsed";
|
||||
listStr.Add(new SqlParameter("@IsUsed", "0"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
{
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit {
|
||||
namespace FineUIPro.Web.HSSE.QualityAudit
|
||||
{
|
||||
|
||||
|
||||
public partial class EquipmentPersonQuality {
|
||||
public partial class EquipmentPersonQuality
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -93,6 +95,15 @@ namespace FineUIPro.Web.HSSE.QualityAudit {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkPostName;
|
||||
|
||||
/// <summary>
|
||||
/// drpIsUsedName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIsUsedName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using BLL;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
|
@ -82,26 +83,61 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
|
||||
if (project != null)
|
||||
{
|
||||
var personLists = BLL.PersonService.GetPersonList(project.ProjectId);
|
||||
string strSql1 = @"select UnitId,count(1) num from SitePerson_Person
|
||||
where ProjectId=@ProjectId
|
||||
group by UnitId";
|
||||
List<SqlParameter> listStr1 = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@ProjectId", this.ProjectId)
|
||||
};
|
||||
SqlParameter[] parameter1 = listStr1.ToArray();
|
||||
DataTable tb1 = SQLHelper.GetDataTableRunText(strSql1, parameter1);
|
||||
string strSql2 = @"select UnitId,count(1) num from SitePerson_Person
|
||||
where ProjectId=@ProjectId and IsUsed =1 and InTime <getdate() and (OutTime is null or OutTime >getdate())
|
||||
group by UnitId";
|
||||
List<SqlParameter> listStr2 = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@ProjectId", this.ProjectId)
|
||||
};
|
||||
SqlParameter[] parameter2 = listStr2.ToArray();
|
||||
DataTable tb2 = SQLHelper.GetDataTableRunText(strSql2, parameter2);
|
||||
int total = 0;
|
||||
int totalIn = 0;
|
||||
Dictionary<string, int> dicTotal = new Dictionary<string, int>();
|
||||
Dictionary<string, int> dicTotalIn = new Dictionary<string, int>();
|
||||
|
||||
if (tb1 != null)
|
||||
{
|
||||
foreach (DataRow row in tb1.Rows)
|
||||
{
|
||||
total += int.Parse(row["num"].ToString());
|
||||
dicTotal.Add(row["UnitId"].ToString(), int.Parse(row["num"].ToString()));
|
||||
}
|
||||
}
|
||||
if (tb2 != null)
|
||||
{
|
||||
foreach (DataRow row in tb2.Rows)
|
||||
{
|
||||
totalIn += int.Parse(row["num"].ToString());
|
||||
dicTotalIn.Add(row["UnitId"].ToString(), int.Parse(row["num"].ToString()));
|
||||
|
||||
}
|
||||
}
|
||||
TreeNode rootNode = new TreeNode();
|
||||
rootNode = new TreeNode
|
||||
{
|
||||
Text = project.ProjectName,
|
||||
NodeID = project.ProjectId
|
||||
};
|
||||
if (personLists.Count() > 0)
|
||||
{
|
||||
var personIn = personLists.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == 1
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)).ToList();
|
||||
rootNode.ToolTip = "当前项目人员总数:" + personLists.Count() + ";在场人员数:" + personIn.Count() + ";离场人员数:" + (personLists.Count() - personIn.Count());
|
||||
}
|
||||
else
|
||||
{
|
||||
rootNode.ToolTip = "当前项目人员总数:0";
|
||||
}
|
||||
|
||||
|
||||
|
||||
rootNode.ToolTip = "当前项目人员总数:" + total + ";在场人员数:" + totalIn + ";离场人员数:" + (total - totalIn);
|
||||
|
||||
|
||||
rootNode.Expanded = true;
|
||||
this.tvProjectAndUnit.Nodes.Add(rootNode);
|
||||
GetUnitLists(rootNode.Nodes, this.ProjectId, personLists);
|
||||
GetUnitLists(rootNode.Nodes, this.ProjectId, dicTotal, dicTotalIn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,6 +201,66 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
}
|
||||
}
|
||||
}
|
||||
private void GetUnitLists(TreeNodeCollection nodes, string parentId, Dictionary<string, int> dicTotal, Dictionary<string, int> dicTotalIn)
|
||||
{
|
||||
List<Model.Base_Unit> unitLists = BLL.UnitService.GetUnitByProjectIdList(parentId);
|
||||
if (unitLists.Count() > 0)
|
||||
{
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(parentId, this.CurrUser.UnitId))
|
||||
{
|
||||
unitLists = unitLists.Where(x => x.UnitId == this.CurrUser.UnitId).ToList();
|
||||
}
|
||||
|
||||
//添加其他单位/无单位人员
|
||||
Model.Base_Unit otherUnit = new Model.Base_Unit
|
||||
{
|
||||
UnitId = "0",
|
||||
UnitName = "其他"
|
||||
};
|
||||
unitLists.Add(otherUnit);
|
||||
|
||||
TreeNode newNode = null;
|
||||
foreach (var q in unitLists)
|
||||
{
|
||||
int total = 0;
|
||||
int totalIn = 0;
|
||||
if (q.UnitId != "0")
|
||||
{
|
||||
if (dicTotal.ContainsKey(q.UnitId))
|
||||
{
|
||||
total = dicTotal[q.UnitId];
|
||||
}
|
||||
if (dicTotalIn.ContainsKey(q.UnitId))
|
||||
{
|
||||
totalIn = dicTotalIn[q.UnitId];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dicTotal.ContainsKey(""))
|
||||
{
|
||||
total = dicTotal[""];
|
||||
}
|
||||
if (dicTotalIn.ContainsKey(""))
|
||||
{
|
||||
totalIn = dicTotalIn[""];
|
||||
}
|
||||
}
|
||||
newNode = new TreeNode
|
||||
{
|
||||
Text = q.UnitName,
|
||||
NodeID = q.UnitId + "|" + parentId,
|
||||
ToolTip = q.UnitName
|
||||
};
|
||||
|
||||
|
||||
newNode.ToolTip = q.UnitName + "人员总数:" + total + ";在场人员数:" + totalIn + ";离场人员数:" + (total - totalIn);
|
||||
|
||||
newNode.EnableClickEvent = true;
|
||||
nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
|
@ -197,10 +293,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
strSql += " AND UnitId =@UnitId ";
|
||||
listStr.Add(new SqlParameter("@UnitId", unitId));
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// strSql += " AND UnitId IS NULL";
|
||||
//}
|
||||
else if( unitId == "0")
|
||||
{
|
||||
strSql += " AND UnitId IS NULL";
|
||||
}
|
||||
if (drpIsUsedName.SelectedValue == "待审核")
|
||||
{
|
||||
strSql += " AND IsUsed = @IsUsed";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Tree>
|
||||
<TreeNode id="F8E57293-0BD8-435E-AA08-3B1DC2858CB6" Text="质量策划" NavigateUrl="">
|
||||
<TreeNode id="063601B5-EF75-418B-90E8-4255C0DB06D7" Text="公司/部门质量管理规定" NavigateUrl="CQMS/ZLCH/Zlgltx.aspx">
|
||||
<TreeNode id="68A54450-557C-4C33-9121-797C15AF1047" Text="开工报告" NavigateUrl="PZHGL/StartWorkReport.aspx">
|
||||
</TreeNode>
|
||||
<TreeNode id="F8E57293-0BD8-435E-AA08-3B1DC2858CB6" Text="质量策划" NavigateUrl=""><TreeNode id="063601B5-EF75-418B-90E8-4255C0DB06D7" Text="公司/部门质量管理规定" NavigateUrl="CQMS/ZLCH/Zlgltx.aspx"></TreeNode>
|
||||
<TreeNode id="AC145EE1-4E5C-4CEF-A85A-AAC331A041DB" Text="质量管理实施计划" NavigateUrl="CQMS/ZLCH/Zlssjh.aspx"></TreeNode>
|
||||
<TreeNode id="098307DA-C53D-4EDB-8587-339CD782031F" Text="质量管理规定/程序文件" NavigateUrl="CQMS/ZLCH/Zlglgd.aspx"></TreeNode>
|
||||
</TreeNode>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Tree>
|
||||
<TreeNode id="68A54450-557C-4C33-9121-797C15AF1047" Text="开工报告" NavigateUrl="PZHGL/StartWorkReport.aspx">
|
||||
<TreeNode id="8DE7DF6C-979E-48A7-80F7-55287726685F" Text="施工策划" NavigateUrl="">
|
||||
<TreeNode id="67CEE910-DDFB-4E69-B4B7-DA29B9F43E1D" Text="公司/部门施工管理规定" NavigateUrl="PZHGL/SGCH/GsBmGlgd.aspx">
|
||||
</TreeNode>
|
||||
<TreeNode id="8DE7DF6C-979E-48A7-80F7-55287726685F" Text="施工策划" NavigateUrl=""><TreeNode id="67CEE910-DDFB-4E69-B4B7-DA29B9F43E1D" Text="公司/部门施工管理规定" NavigateUrl="PZHGL/SGCH/GsBmGlgd.aspx"></TreeNode>
|
||||
<TreeNode id="90217D8E-D2AC-4B8D-A1A7-A27317890408" Text="项目施工管理规定" NavigateUrl="PZHGL/SGCH/XmsgGlgd.aspx"></TreeNode>
|
||||
<TreeNode id="971D3B85-9ECE-4325-BB84-AE9CF7577476" Text="分包策划" NavigateUrl="PZHGL/SGCH/Fbch.aspx"></TreeNode>
|
||||
<TreeNode id="DC14E545-F8B5-40C1-A604-73A8DA8741CC" Text="人力动员策划" NavigateUrl="PZHGL/SGCH/Rldych.aspx"></TreeNode>
|
||||
|
|
|
@ -70,30 +70,34 @@ namespace FineUIPro.Web.common
|
|||
private void getPersonWorkTime()
|
||||
{
|
||||
this.divSafeWorkTime.InnerHtml = "0000000000";
|
||||
//var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem
|
||||
//join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
|
||||
//where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem
|
||||
// select x.YearTotal).Sum();
|
||||
var ProjectTotal = (from x in Funs.DB.HSSE_MonthReportItem
|
||||
join y in Funs.DB.HSSE_MonthReport on x.MonthReportId equals y.MonthReportId
|
||||
where y.ProjectId == this.ProjectId && "安全生产人工时数" == x.ReportItem
|
||||
select x.YearTotal).Sum();
|
||||
decimal sumMonthCount = 0;
|
||||
var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth);
|
||||
var getmax = getMonts.FirstOrDefault();
|
||||
if (getMonts.Count() > 0)
|
||||
if (ProjectTotal.HasValue)
|
||||
{
|
||||
foreach (var item in getMonts)
|
||||
{
|
||||
decimal monthCount = 0;
|
||||
var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId);
|
||||
if (getItem != null && getItem.MonthWorkTime.HasValue)
|
||||
{
|
||||
monthCount = getItem.MonthWorkTime ?? 0;
|
||||
sumMonthCount += monthCount;
|
||||
if (sumMonthCount < getItem.ProjectWorkTime)
|
||||
{
|
||||
sumMonthCount = getItem.ProjectWorkTime ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
sumMonthCount = ProjectTotal.Value;
|
||||
}
|
||||
//var getMonts = Funs.DB.SeDin_MonthReport.Where(x => x.ProjectId == this.ProjectId).OrderBy(x => x.ReporMonth);
|
||||
//var getmax = getMonts.FirstOrDefault();
|
||||
//if (getMonts.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in getMonts)
|
||||
// {
|
||||
// decimal monthCount = 0;
|
||||
// var getItem = Funs.DB.SeDin_MonthReport2.FirstOrDefault(x => x.MonthReportId == item.MonthReportId);
|
||||
// if (getItem != null && getItem.MonthWorkTime.HasValue)
|
||||
// {
|
||||
// monthCount = getItem.MonthWorkTime ?? 0;
|
||||
// sumMonthCount += monthCount;
|
||||
// if (sumMonthCount < getItem.ProjectWorkTime)
|
||||
// {
|
||||
// sumMonthCount = getItem.ProjectWorkTime ?? 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
if (sumMonthCount>0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue