This commit is contained in:
2025-07-11 17:28:44 +08:00
parent 03b816fd2c
commit 28455c3a4c
13 changed files with 617 additions and 275 deletions
@@ -80,14 +80,26 @@
<Items>
<f:Label ID="txtUnitName" runat="server" Hidden="true">
</f:Label>
<f:Label ID="txtQuarter" runat="server">
<f:Label ID="txtQuarter" runat="server" LabelWidth="130px">
</f:Label>
<f:Label ID="txtCompileDate" runat="server">
<f:Label ID="txtCompileDate" runat="server" LabelWidth="130px">
</f:Label>
<f:Label ID="lbHandleMan" runat="server">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Label ID="Label1" runat="server" Hidden="true">
</f:Label>
<f:Label ID="txtKeyWorkNum" runat="server" Label="重点工作任务数" LabelWidth="130px">
</f:Label>
<f:Label ID="txtKeyWorkOKNum" runat="server" Label="重点工作完成数" LabelWidth="130px">
</f:Label>
<f:Label ID="txtKeyWorkOKRate" runat="server" Label="综合完成率">
</f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
@@ -62,6 +62,9 @@ namespace FineUIPro.Web.ZHGL.Information
txtUnitName.Text = string.Empty;
txtQuarter.Text = string.Empty;
txtCompileDate.Text = string.Empty;
txtKeyWorkNum.Text = string.Empty;
txtKeyWorkOKNum.Text = string.Empty;
txtKeyWorkOKRate.Text = string.Empty;
this.lbHandleMan.Text = string.Empty;
Grid1.DataSource = null;
Grid1.DataBind();
@@ -105,6 +108,18 @@ namespace FineUIPro.Web.ZHGL.Information
this.ActionWorkLedgerId = report.ActionWorkLedgerId;
txtUnitName.Text = "单位:" + report.UnitName;
txtQuarter.Text = "季度:" + report.Quarters;
if (report.KeyWorkNum != null)
{
txtKeyWorkNum.Text = report.KeyWorkNum.ToString();
}
if (report.KeyWorkOKNum != null)
{
txtKeyWorkOKNum.Text = report.KeyWorkOKNum.ToString();
}
if (!string.IsNullOrEmpty(report.KeyWorkOKRate))
{
txtKeyWorkOKRate.Text = report.KeyWorkOKRate;
}
if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3)
{
this.lbHandleMan.Hidden = true;
@@ -228,6 +228,42 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.Label lbHandleMan;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtKeyWorkNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtKeyWorkNum;
/// <summary>
/// txtKeyWorkOKNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtKeyWorkOKNum;
/// <summary>
/// txtKeyWorkOKRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtKeyWorkOKRate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -27,6 +27,15 @@
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox runat="server" ID="txtKeyWorkNum" Label="重点工作任务数" NoDecimal="true" LabelWidth="130px" NoNegative="true" Required="true" ShowRedStar="true" AutoPostBack="true" OnTextChanged="txtKeyWorkNum_TextChanged"></f:NumberBox>
<f:NumberBox runat="server" ID="txtKeyWorkOKNum" Label="重点工作完成数" NoDecimal="true" LabelWidth="130px" NoNegative="true" Required="true" ShowRedStar="true" AutoPostBack="true" OnTextChanged="txtKeyWorkNum_TextChanged"></f:NumberBox>
<f:TextBox ID="txtKeyWorkOKRate" runat="server" Label="综合完成率" Readonly="true">
</f:TextBox>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
@@ -99,6 +99,18 @@ namespace FineUIPro.Web.ZHGL.Information
{
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ActionWorkLedger.ReportDate);
}
if (ActionWorkLedger.KeyWorkNum != null)
{
this.txtKeyWorkNum.Text = ActionWorkLedger.KeyWorkNum.ToString();
}
if (ActionWorkLedger.KeyWorkOKNum != null)
{
this.txtKeyWorkOKNum.Text = ActionWorkLedger.KeyWorkOKNum.ToString();
}
if (!string.IsNullOrEmpty(ActionWorkLedger.KeyWorkOKRate))
{
this.txtKeyWorkOKRate.Text = ActionWorkLedger.KeyWorkOKRate;
}
}
}
else
@@ -237,6 +249,9 @@ namespace FineUIPro.Web.ZHGL.Information
}
ActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
ActionWorkLedger.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
ActionWorkLedger.KeyWorkNum = Funs.GetNewIntOrZero(this.txtKeyWorkNum.Text.Trim());
ActionWorkLedger.KeyWorkOKNum = Funs.GetNewIntOrZero(this.txtKeyWorkOKNum.Text.Trim());
ActionWorkLedger.KeyWorkOKRate = this.txtKeyWorkOKRate.Text.Trim();
if (string.IsNullOrEmpty(this.ActionWorkLedgerId))
{
this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger)); ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
@@ -530,5 +545,17 @@ namespace FineUIPro.Web.ZHGL.Information
}
}
#endregion
protected void txtKeyWorkNum_TextChanged(object sender, EventArgs e)
{
decimal keyWorkNum = Funs.GetNewDecimalOrZero(this.txtKeyWorkNum.Text.Trim());
decimal keyWorkOKNum = Funs.GetNewDecimalOrZero(this.txtKeyWorkOKNum.Text.Trim());
string rate = string.Empty;
if (keyWorkNum > 0)
{
rate = (decimal.Round(keyWorkOKNum / keyWorkNum, 4) * 100).ToString("0.##") + "%";
}
this.txtKeyWorkOKRate.Text = rate;
}
}
}
@@ -75,6 +75,33 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate;
/// <summary>
/// txtKeyWorkNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtKeyWorkNum;
/// <summary>
/// txtKeyWorkOKNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtKeyWorkOKNum;
/// <summary>
/// txtKeyWorkOKRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtKeyWorkOKRate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -1,7 +1,4 @@
using BLL;
using FineUIPro.Web.BaseInfo;
using FineUIPro.Web.DataShow;
using FineUIPro.Web.InformationProject;
using Model;
using Newtonsoft.Json.Linq;
using System;
@@ -60,11 +57,125 @@ namespace FineUIPro.Web.ZHGL.Information
string months = Request.QueryString["Months"];
MillionsMonthlyReportId = Request.QueryString["MillionsMonthlyReportId"];
if (!String.IsNullOrEmpty(MillionsMonthlyReportId))
{
{
items = BLL.MillionsMonthlyReportItemService.GetItemsNoSum(MillionsMonthlyReportId);
this.Grid1.DataSource = items;
this.Grid1.DataBind();
var report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(MillionsMonthlyReportId);
if (report != null)
{
setPageInfo(report);
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.btnCopy.Hidden = true;
if (report.HandleState == BLL.Const.HandleState_4)
{
this.btnUpdata.Hidden = false;
}
else
{
if (report.HandleMan == this.CurrUser.PersonId || this.CurrUser.PersonId == BLL.Const.sysglyId)
{
this.btnSave.Hidden = false;
this.btnSubmit.Hidden = false;
}
}
if (report.UpState == BLL.Const.UpState_3)
{
this.btnSave.Hidden = true;
//this.btnUpdata.Hidden = true;
}
drpMonth.SelectedValue = report.Month.ToString();
drpYear.SelectedValue = report.Year.ToString();
drpUnit.SelectedValue = report.UnitId;
if (report.FillingDate != null)
{
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate);
}
txtDutyPerson.Text = report.DutyPerson;
if (report.RecordableIncidentRate != null)
{
txtRecordableIncidentRate.Text = report.RecordableIncidentRate.ToString();
}
if (report.LostTimeRate != null)
{
txtLostTimeRate.Text = report.LostTimeRate.ToString();
}
if (report.LostTimeInjuryRate != null)
{
txtLostTimeInjuryRate.Text = report.LostTimeInjuryRate.ToString();
}
if (report.DeathAccidentFrequency != null)
{
txtDeathAccidentFrequency.Text = report.DeathAccidentFrequency.ToString();
}
if (report.AccidentMortality != null)
{
txtAccidentMortality.Text = report.AccidentMortality.ToString();
}
if (report.InputCosts != null)
{
this.txtInputCosts.Text = Convert.ToString(report.InputCosts);
}
if (report.TrainNum != null)
{
this.txtTrainNum.Text = Convert.ToString(report.TrainNum);
}
if (report.GeneralHazardNum != null)
{
this.txtGeneralHazardNum.Text = Convert.ToString(report.GeneralHazardNum);
}
if (report.MajorHazardNum != null)
{
this.txtMajorHazardNum.Text = Convert.ToString(report.MajorHazardNum);
}
if (report.NotProofLargeProjectNum != null)
{
this.txtNotProofLargeProjectNum.Text = Convert.ToString(report.NotProofLargeProjectNum);
}
if (report.ProofLargeProjectNum != null)
{
this.txtProofLargeProjectNum.Text = Convert.ToString(report.ProofLargeProjectNum);
}
if (report.FireLicenseNum != null)
{
this.txtFireLicenseNum.Text = Convert.ToString(report.FireLicenseNum);
}
if (report.LimitLicenseNum != null)
{
this.txtLimitLicenseNum.Text = Convert.ToString(report.LimitLicenseNum);
}
if (report.HighLicenseNum != null)
{
this.txtHighLicenseNum.Text = Convert.ToString(report.HighLicenseNum);
}
if (report.HoistingLicenseNum != null)
{
this.txtHoistingLicenseNum.Text = Convert.ToString(report.HoistingLicenseNum);
}
if (report.BreakGroundLicenseNum != null)
{
this.txtBreakGroundLicenseNum.Text = Convert.ToString(report.BreakGroundLicenseNum);
}
if (report.ElectricityLicenseNum != null)
{
this.txtElectricityLicenseNum.Text = Convert.ToString(report.ElectricityLicenseNum);
}
if (report.RTLicenseNum != null)
{
this.txtRTLicenseNum.Text = Convert.ToString(report.RTLicenseNum);
}
if (report.NightLicenseNum != null)
{
this.txtNightLicenseNum.Text = Convert.ToString(report.NightLicenseNum);
}
if (report.CommissionerNum != null)
{
this.txtCommissionerNum.Text = Convert.ToString(report.CommissionerNum);
}
if (report.SoleDutyNum != null)
{
this.txtSoleDutyNum.Text = Convert.ToString(report.SoleDutyNum);
}
}
}
else
@@ -75,7 +186,9 @@ namespace FineUIPro.Web.ZHGL.Information
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
txtDutyPerson.Text = this.CurrUser.PersonName;
//增加明细集合
GetNewItems(year, months);
GetNewItems(year, months);
this.Grid1.DataSource = items;
this.Grid1.DataBind();
this.txtRecordableIncidentRate.Text = "0";
this.txtLostTimeRate.Text = "0";
this.txtLostTimeInjuryRate.Text = "0";
@@ -84,133 +197,6 @@ namespace FineUIPro.Web.ZHGL.Information
}
}
}
#region
/// <summary>
///
/// </summary>
/// <param name="report"></param>
private void setPageInfo(Model.Information_MillionsMonthlyReport report)
{
this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true;
this.btnCopy.Hidden = true;
if (report.HandleState == BLL.Const.HandleState_4)
{
this.btnUpdata.Hidden = false;
}
else
{
if (report.HandleMan == this.CurrUser.PersonId || this.CurrUser.PersonId == BLL.Const.sysglyId)
{
this.btnSave.Hidden = false;
this.btnSubmit.Hidden = false;
}
}
if (report.UpState == BLL.Const.UpState_3)
{
this.btnSave.Hidden = true;
this.btnUpdata.Hidden = true;
}
drpMonth.SelectedValue = report.Month.ToString();
drpYear.SelectedValue = report.Year.ToString();
drpUnit.SelectedValue = report.UnitId;
if (report.FillingDate != null)
{
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", report.FillingDate);
}
txtDutyPerson.Text = report.DutyPerson;
if (report.RecordableIncidentRate != null)
{
txtRecordableIncidentRate.Text = report.RecordableIncidentRate.ToString();
}
if (report.LostTimeRate != null)
{
txtLostTimeRate.Text = report.LostTimeRate.ToString();
}
if (report.LostTimeInjuryRate != null)
{
txtLostTimeInjuryRate.Text = report.LostTimeInjuryRate.ToString();
}
if (report.DeathAccidentFrequency != null)
{
txtDeathAccidentFrequency.Text = report.DeathAccidentFrequency.ToString();
}
if (report.AccidentMortality != null)
{
txtAccidentMortality.Text = report.AccidentMortality.ToString();
}
if (report.InputCosts != null)
{
this.txtInputCosts.Text = Convert.ToString(report.InputCosts);
}
if (report.TrainNum != null)
{
this.txtTrainNum.Text = Convert.ToString(report.TrainNum);
}
if (report.GeneralHazardNum != null)
{
this.txtGeneralHazardNum.Text = Convert.ToString(report.GeneralHazardNum);
}
if (report.MajorHazardNum != null)
{
this.txtMajorHazardNum.Text = Convert.ToString(report.MajorHazardNum);
}
if (report.NotProofLargeProjectNum != null)
{
this.txtNotProofLargeProjectNum.Text = Convert.ToString(report.NotProofLargeProjectNum);
}
if (report.ProofLargeProjectNum != null)
{
this.txtProofLargeProjectNum.Text = Convert.ToString(report.ProofLargeProjectNum);
}
if (report.FireLicenseNum != null)
{
this.txtFireLicenseNum.Text = Convert.ToString(report.FireLicenseNum);
}
if (report.LimitLicenseNum != null)
{
this.txtLimitLicenseNum.Text = Convert.ToString(report.LimitLicenseNum);
}
if (report.HighLicenseNum != null)
{
this.txtHighLicenseNum.Text = Convert.ToString(report.HighLicenseNum);
}
if (report.HoistingLicenseNum != null)
{
this.txtHoistingLicenseNum.Text = Convert.ToString(report.HoistingLicenseNum);
}
if (report.BreakGroundLicenseNum != null)
{
this.txtBreakGroundLicenseNum.Text = Convert.ToString(report.BreakGroundLicenseNum);
}
if (report.ElectricityLicenseNum != null)
{
this.txtElectricityLicenseNum.Text = Convert.ToString(report.ElectricityLicenseNum);
}
if (report.RTLicenseNum != null)
{
this.txtRTLicenseNum.Text = Convert.ToString(report.RTLicenseNum);
}
if (report.NightLicenseNum != null)
{
this.txtNightLicenseNum.Text = Convert.ToString(report.NightLicenseNum);
}
if (report.CommissionerNum != null)
{
this.txtCommissionerNum.Text = Convert.ToString(report.CommissionerNum);
}
if (report.SoleDutyNum != null)
{
this.txtSoleDutyNum.Text = Convert.ToString(report.SoleDutyNum);
}
items = BLL.MillionsMonthlyReportItemService.GetItemsNoSum(MillionsMonthlyReportId);
this.Grid1.DataSource = items;
this.Grid1.DataBind();
}
#endregion
#endregion
#region
@@ -362,21 +348,100 @@ namespace FineUIPro.Web.ZHGL.Information
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=MillionsMonthlyReport&Id={0}", report.MillionsMonthlyReportId, "编辑 - ")));
}
else if (type == "add")
{
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
Save("add");
string err = AuditData();
if (string.IsNullOrEmpty(err))
{
Save("add");
}
else
{
ShowNotify(err, MessageBoxIcon.Warning);
}
}
protected void btnUpdata_Click(object sender, EventArgs e)
{
Save("updata");
string err = AuditData();
if (string.IsNullOrEmpty(err))
{
Save("updata");
}
else
{
ShowNotify(err, MessageBoxIcon.Warning);
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Save("submit");
string err = AuditData();
if (string.IsNullOrEmpty(err))
{
Save("submit");
}
else
{
ShowNotify(err, MessageBoxIcon.Warning);
}
}
private string AuditData()
{
string err = string.Empty;
Model.SGGLDB db = Funs.DB;
var reports = from x in db.Information_MillionsMonthlyReport
where x.FillingDate < DateTime.Now
orderby x.FillingDate descending
select x;
if (!string.IsNullOrEmpty(this.MillionsMonthlyReportId))
{
reports = from x in reports
where x.MillionsMonthlyReportId != this.MillionsMonthlyReportId
orderby x.FillingDate descending
select x;
}
var reportIds = reports.Select(x => x.MillionsMonthlyReportId).Take(3).ToList();
//var items = from x in db.Information_MillionsMonthlyReportItem
// where reportIds.Contains(x.MillionsMonthlyReportId)
// select new { x.Name, x.TotalWorkNum };
var items = from x in db.Information_MillionsMonthlyReportItem
where reportIds.Contains(x.MillionsMonthlyReportId)
select new { x.Name, x.TotalWorkNum };
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
if (!string.IsNullOrEmpty(values["Name"].ToString()) && !string.IsNullOrEmpty(values["TotalWorkNum"].ToString()))
{
string name = values.Value<string>("Name");
decimal d = values.Value<decimal>("TotalWorkNum");
var list = items.Where(x => x.Name == name);
decimal a = 0;
if (list.Count() > 0)
{
foreach (var item in list)
{
a += item.TotalWorkNum ?? 0;
}
}
decimal b = a / list.Count();
if (d > b * 5)
{
err = name + "的总工时数超过前三个月平均值5倍,请核对后重新录入!";
break;
}
}
}
return err;
}
#endregion
@@ -735,99 +800,29 @@ namespace FineUIPro.Web.ZHGL.Information
#region
private void GetNewItems(string year, string months)
{
DateTime nowTime = Funs.GetNewDateTimeOrNow(year + "-" + months);
DateTime starTime = nowTime.AddMonths(-2).AddDays(24);
DateTime endTime = nowTime.AddMonths(-1).AddDays(23);
var getCosts = from x in Funs.DB.CostGoods_CostManageItem
join y in Funs.DB.CostGoods_CostManage on x.CostManageId equals y.CostManageId
where y.CostManageDate >=starTime && y.CostManageDate <= endTime
select x;
if (getCosts.Count() > 0)
{
this.txtInputCosts.Text = getCosts.Sum(x => x.PriceMoney ?? 0).ToString();
}
this.txtTrainNum.Text = Funs.DB.EduTrain_TrainRecord.Where(x => x.TrainStartDate >= starTime && x.TrainStartDate <= endTime).Count().ToString();
int HazardAll = 0, RectifyAll = 0;
int HazardMajor = 0, RectifyMajor = 0;
var getHazardRegister = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.RegisterDate >= starTime && x.RegisterDate <= endTime && x.States == Const.State_3);
HazardAll = getHazardRegister.Count();
if (HazardAll > 0)
{
HazardMajor = getHazardRegister.Where(x => x.HazardValue == "2").Count();
}
var getRectifyNotices = Funs.DB.Check_RectifyNotices.Where(x => x.CheckedDate >= starTime && x.CheckedDate <= endTime && x.States == Const.State_5);
RectifyAll = getRectifyNotices.Count();
if (RectifyAll > 0)
{
RectifyMajor = getRectifyNotices.Where(x => x.HiddenHazardType == "3").Count();
}
this.txtGeneralHazardNum.Text = ((HazardAll - HazardMajor) + (RectifyAll - RectifyMajor)).ToString();
this.txtMajorHazardNum.Text = (HazardMajor + RectifyMajor).ToString();
var getLarger = from x in Funs.DB.Solution_LargerHazardListItem
join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId
where y.States == Const.State_1 && y.RecordTime >= starTime && y.RecordTime <= endTime
select x;
if (getLarger.Count() > 0)
{
this.txtNotProofLargeProjectNum.Text = Convert.ToString(getLarger.Where(x => x.IsArgument == false).Count());
this.txtProofLargeProjectNum.Text = Convert.ToString(getLarger.Where(x => x.IsArgument == true).Count());
}
var getLicense = from x in Funs.DB.License_LicenseManager
join y in Funs.DB.Base_LicenseType on x.LicenseTypeId equals y.LicenseTypeId
where x.States != Const.State_R && x.StartDate >= starTime && x.StartDate <= endTime
select new { x.LicenseManagerId,x.StartDate,x.EndDate,x.States,y.LicenseTypeId,y.LicenseTypeCode,y.LicenseTypeName};
int fire1 = Funs.DB.License_FireWork.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int fire2 = getLicense.Where(x => x.LicenseTypeName.Contains("动火")).Count();
this.txtFireLicenseNum.Text =(fire1+ fire2) .ToString();
int limit1 = Funs.DB.License_LimitedSpace.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int limit2 = getLicense.Where(x => x.LicenseTypeName.Contains("受限空间")).Count();
this.txtLimitLicenseNum.Text = (limit1+ limit2).ToString();
int High1 = Funs.DB.License_HeightWork.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int High2 = getLicense.Where(x => x.LicenseTypeName.Contains("登高")).Count();
this.txtHighLicenseNum.Text =(High1+ High2).ToString();
int Hoisting1 = Funs.DB.License_LiftingWork.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int Hoisting2 = getLicense.Where(x => x.LicenseTypeName.Contains("吊装")).Count();
this.txtHoistingLicenseNum.Text =(Hoisting1+ Hoisting2).ToString();
int Break1 = Funs.DB.License_BreakGround.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int Break2 = getLicense.Where(x => x.LicenseTypeName.Contains("动土")).Count();
this.txtBreakGroundLicenseNum.Text = (Break1+ Break2).ToString();
this.txtElectricityLicenseNum.Text = getLicense.Where(x=>x.LicenseTypeName.Contains("临电")).Count().ToString();
int rt1 = Funs.DB.License_RadialWork.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int rt2 = getLicense.Where(x => x.LicenseTypeName.Contains("射线")).Count();
this.txtRTLicenseNum.Text =(rt1+ rt2).ToString();
int night1 = Funs.DB.License_NightWork.Where(x => x.ApplyDate >= starTime && x.ApplyDate <= endTime && (x.States == Const.State_2 || x.States == Const.State_3)).Count();
int night2 = getLicense.Where(x => x.LicenseTypeName.Contains("夜间")).Count();
this.txtNightLicenseNum.Text =(night1+ night2).ToString();
var getPersons = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.States == Const.ProjectPersonStates_1 && y.IsHsse == true
select new { x.ProjectId,y.WorkPostName} ;
int isHsse = getPersons.Count();
if (isHsse > 0)
{
this.txtCommissionerNum.Text = Convert.ToString(getPersons.Where(x => x.WorkPostName.Contains("安全总监")).Count());
}
this.txtSoleDutyNum.Text = isHsse.ToString();
//获取项目集合
List<Model.InformationProject_MillionsMonthlyReport> millionsMonthlyReports = (from x in Funs.DB.InformationProject_MillionsMonthlyReport where x.Year.ToString() == year && x.Month.ToString() == months && x.States == BLL.Const.State_2 select x).ToList();
this.txtInputCosts.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.InputCosts ?? 0));
this.txtTrainNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.TrainNum ?? 0));
this.txtGeneralHazardNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.GeneralHazardNum ?? 0));
this.txtMajorHazardNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.MajorHazardNum ?? 0));
this.txtNotProofLargeProjectNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.NotProofLargeProjectNum ?? 0));
this.txtProofLargeProjectNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.ProofLargeProjectNum ?? 0));
this.txtFireLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.FireLicenseNum ?? 0));
this.txtLimitLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.LimitLicenseNum ?? 0));
this.txtHighLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.HighLicenseNum ?? 0));
this.txtHoistingLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.HoistingLicenseNum ?? 0));
this.txtBreakGroundLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.BreakGroundLicenseNum ?? 0));
this.txtElectricityLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.ElectricityLicenseNum ?? 0));
this.txtRTLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.RTLicenseNum ?? 0));
this.txtNightLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.NightLicenseNum ?? 0));
this.txtCommissionerNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.CommissionerNum ?? 0));
this.txtSoleDutyNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.SoleDutyNum ?? 0));
List<string> projectIds = millionsMonthlyReports.Select(x => x.ProjectId).ToList();
//增加明细集合
Model.Information_MillionsMonthlyReportItem item1 = new Information_MillionsMonthlyReportItem
{
MillionsMonthlyReportItemId = SQLHelper.GetNewID(),
MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "机关后勤服务",
Name = "总部",
SortIndex = 10,
@@ -863,7 +858,7 @@ namespace FineUIPro.Web.ZHGL.Information
items.Add(item1);
Model.Information_MillionsMonthlyReportItem item2 = new Information_MillionsMonthlyReportItem
{
MillionsMonthlyReportItemId = SQLHelper.GetNewID(),
MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "机关后勤服务",
Name = "二级单位",
SortIndex = 20,
@@ -896,16 +891,21 @@ namespace FineUIPro.Web.ZHGL.Information
LossDayNum = 0,
};
items.Add(item2);
var projects = (from x in Funs.DB.Base_Project
where projectIds.Contains(x.ProjectId)
select x).ToList();
var projects = BLL.ProjectService.GetProjectWorkList();
if (this.CurrUser.UnitId == BLL.Const.UnitId_SEDIN)
{
projects = BLL.ProjectService.GetProjectWorkList();
}
int i = 20;
foreach (var p in projects)
{
i += 10;
Model.Information_MillionsMonthlyReportItem item = new Information_MillionsMonthlyReportItem
{
MillionsMonthlyReportItemId = SQLHelper.GetNewID(),
MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "项目现场",
Name = p.ProjectName,
SortIndex = i
@@ -920,51 +920,70 @@ namespace FineUIPro.Web.ZHGL.Information
item.Name = "[" + p.ProjectCode + "]" + p.ProjectName;
}
}
var getSitePersons = Funs.DB.SitePerson_Person.Where(x => x.ProjectId == p.ProjectId && x.States == Const.ProjectPersonStates_1);
//var getZSOerson = from x in getSitePersons
// join y in Funs.DB.Person_Persons on x.PersonId equals y.PersonId
// where y.PersonType == "1" && x.UnitId == Const.UnitId_SEDIN
// select x;
var getAllSedinPerson= getSitePersons.Where(x => x.UnitId == Const.UnitId_SEDIN).Count();
item.PostPersonNum = getAllSedinPerson;
item.SnapPersonNum = 0;
item.ContractorNum = getSitePersons.Where(x => x.UnitId != Const.UnitId_SEDIN).Count();
item.SumPersonNum = getSitePersons.Count();
item.TotalWorkNum = 0;
var getInfo = APISeDinMonthReportService.getSeDinMonthReport2ById(p.ProjectId, year + "-" + months);
if (getInfo != null)
Model.InformationProject_MillionsMonthlyReport report = millionsMonthlyReports.FirstOrDefault(x => x.ProjectId == p.ProjectId);
if (report != null)
{
item.TotalWorkNum = Math.Round(getInfo.MonthWorkTime / 10000 ?? 0, 4);
item.PostPersonNum = report.PostPersonNum;
item.SnapPersonNum = report.SnapPersonNum;
item.ContractorNum = report.ContractorNum;
item.SumPersonNum = report.SumPersonNum;
item.TotalWorkNum = report.TotalWorkNum;
item.SeriousInjuriesNum = report.SeriousInjuriesNum;
item.SeriousInjuriesPersonNum = report.SeriousInjuriesPersonNum;
item.SeriousInjuriesLossHour = report.SeriousInjuriesLossHour;
item.MinorAccidentNum = report.MinorAccidentNum;
item.MinorAccidentPersonNum = report.MinorAccidentPersonNum;
item.MinorAccidentLossHour = report.MinorAccidentLossHour;
item.DeathAccidentNum = report.DeathAccidentNum;
item.DeathAccidentPersonNum = report.DeathAccidentPersonNum;
item.DeathAccidentLossHour = report.DeathAccidentLossHour;
item.RestrictedWorkPersonNum = report.RestrictedWorkPersonNum;
item.RestrictedWorkLossHour = report.RestrictedWorkLossHour;
item.MedicalTreatmentPersonNum = report.MedicalTreatmentPersonNum;
item.MedicalTreatmentLossHour = report.MedicalTreatmentLossHour;
item.FireNum = report.FireNum;
item.EnvironmenNum = report.EnvironmenNum;
item.TrafficNum = report.TrafficNum;
item.EquipmentNum = report.EquipmentNum;
item.QualityNum = report.QualityNum;
item.OtherNum = report.OtherNum;
item.FirstAidDressingsNum = report.FirstAidDressingsNum;
item.AttemptedEventNum = report.AttemptedEventNum;
item.LossDayNum = report.LossDayNum;
}
else
{
item.PostPersonNum = 0;
item.SnapPersonNum = 0;
item.ContractorNum = 0;
item.SumPersonNum = 0;
item.TotalWorkNum = 0;
item.SeriousInjuriesNum = 0;
item.SeriousInjuriesPersonNum = 0;
item.SeriousInjuriesLossHour = 0;
item.MinorAccidentNum = 0;
item.MinorAccidentPersonNum = 0;
item.MinorAccidentLossHour = 0;
item.DeathAccidentNum = 0;
item.DeathAccidentPersonNum = 0;
item.DeathAccidentLossHour = 0;
item.RestrictedWorkPersonNum = 0;
item.RestrictedWorkLossHour = 0;
item.MedicalTreatmentPersonNum = 0;
item.MedicalTreatmentLossHour = 0;
item.FireNum = 0;
item.EnvironmenNum = 0;
item.TrafficNum = 0;
item.EquipmentNum = 0;
item.QualityNum = 0;
item.OtherNum = 0;
item.FirstAidDressingsNum = 0;
item.AttemptedEventNum = 0;
item.LossDayNum = 0;
}
item.SeriousInjuriesNum = 0;
item.SeriousInjuriesPersonNum = 0;
item.SeriousInjuriesLossHour = 0;
item.MinorAccidentNum = 0;
item.MinorAccidentPersonNum = 0;
item.MinorAccidentLossHour = 0;
item.DeathAccidentNum = 0;
item.DeathAccidentPersonNum = 0;
item.DeathAccidentLossHour = 0;
item.RestrictedWorkPersonNum = 0;
item.RestrictedWorkLossHour = 0;
item.MedicalTreatmentPersonNum = 0;
item.MedicalTreatmentLossHour = 0;
item.FireNum = 0;
item.EnvironmenNum = 0;
item.TrafficNum = 0;
item.EquipmentNum = 0;
item.QualityNum = 0;
item.OtherNum = 0;
item.FirstAidDressingsNum = 0;
item.AttemptedEventNum = 0;
item.LossDayNum = 0;
items.Add(item);
}
this.Grid1.DataSource = items;
this.Grid1.DataBind();
}
#endregion
@@ -984,6 +1003,16 @@ namespace FineUIPro.Web.ZHGL.Information
Grid1.DataSource = items;
Grid1.DataBind();
}
protected void drpDate_SelectedIndexChanged(object sender, EventArgs e)
{
items.Clear();
GetNewItems(drpYear.SelectedValue, drpMonth.SelectedValue);
Grid1.DataSource = items;
Grid1.DataBind();
}
#endregion
#region