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
@@ -0,0 +1,37 @@
alter table Information_ActionWorkLedger add KeyWorkNum int null
alter table Information_ActionWorkLedger add KeyWorkOKNum int null
alter table Information_ActionWorkLedger add KeyWorkOKRate nvarchar(20) null
GO
ALTER VIEW [dbo].[View_Information_ActionWorkLedger] AS
SELECT
Report.ActionWorkLedgerId,
Report.UnitId,
Report.ReportDate,
Report.YearId,
Report.Quarter,
Report.UpState,
Report.HandleState,
Report.KeyWorkNum,
Report.KeyWorkOKNum,
Report.KeyWorkOKRate,
(ISNULL(Group_0008.ConstText,'-') + ISNULL(Group_0011.ConstText,'-')) AS Quarters,
u.UnitName,
Report.HandleMan,
US.PersonName as UserName
FROM dbo.Information_ActionWorkLedger AS Report
LEFT JOIN Sys_Const AS Group_0008 ON Group_0008.GroupId='0008' AND Group_0008.ConstValue =Report.YearId
LEFT JOIN Sys_Const AS Group_0011 ON Group_0011.GroupId='0011' AND Group_0011.ConstValue =Report.Quarter
Left join Base_Unit as u on u.UnitId=Report.UnitId
LEFT JOIN Person_Persons AS US ON US.PersonId=Report.HandleMan
GO
@@ -1679,6 +1679,9 @@
Quarter = x.Quarter, Quarter = x.Quarter,
YearId = x.YearId, YearId = x.YearId,
CompileMan = x.CompileMan, CompileMan = x.CompileMan,
KeyWorkNum = x.KeyWorkNum,
KeyWorkOKNum = x.KeyWorkOKNum,
KeyWorkOKRate = x.KeyWorkOKRate,
}; };
var upReportItem = from x in db.Information_ActionWorkLedgerItem var upReportItem = from x in db.Information_ActionWorkLedgerItem
+3 -3
View File
@@ -692,7 +692,7 @@ namespace BLL
EquipmentInspectionNum = inspectionEquipmentList.Count(), EquipmentInspectionNum = inspectionEquipmentList.Count(),
EquipmentInspectionQualifiedNum = inspectionEquipmentList.Count(), EquipmentInspectionQualifiedNum = inspectionEquipmentList.Count(),
PersonInspectionNum = inspectionPersonList.Count(), PersonInspectionNum = inspectionPersonList.Count(),
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true).Count(), PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.ValidityDate == null || (x.ValidityDate.HasValue && x.ValidityDate >= DateTime.Now)).Count(),
MachineInspectionNum = inspectionMachineList.Count(), MachineInspectionNum = inspectionMachineList.Count(),
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true).Count(), MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true).Count(),
@@ -765,7 +765,7 @@ namespace BLL
EquipmentInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid), EquipmentInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid),
EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.ProjectId == projectid).Count(), EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.ProjectId == projectid).Count(),
PersonInspectionNum = inspectionPersonList.Count(x => x.ProjectId == projectid), PersonInspectionNum = inspectionPersonList.Count(x => x.ProjectId == projectid),
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true && x.ProjectId == projectid).Count(), PersonInspectionQualifiedNum = inspectionPersonList.Where(x => (x.ValidityDate == null || (x.ValidityDate.HasValue && x.ValidityDate >= DateTime.Now)) && x.ProjectId == projectid).Count(),
MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid), MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid),
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true && x.ProjectId == projectid).Count(), MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true && x.ProjectId == projectid).Count(),
MaterialInspectionNum = 0, MaterialInspectionNum = 0,
@@ -1213,7 +1213,7 @@ namespace BLL
public static List<Model.Comprehensive_InspectionPerson> GetComprehensive_InspectionPerson() public static List<Model.Comprehensive_InspectionPerson> GetComprehensive_InspectionPerson()
{ {
var result = (from x in Funs.DB.Comprehensive_InspectionPerson var result = (from x in Funs.DB.Comprehensive_InspectionPerson
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime where BeUnderConstructionList.Contains(x.ProjectId) && x.IsOnSite.HasValue && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime
select x).ToList(); select x).ToList();
return result; return result;
} }
@@ -81,6 +81,9 @@ namespace BLL
newActionWorkLedger.UpState = ActionWorkLedger.UpState; newActionWorkLedger.UpState = ActionWorkLedger.UpState;
newActionWorkLedger.HandleState = ActionWorkLedger.HandleState; newActionWorkLedger.HandleState = ActionWorkLedger.HandleState;
newActionWorkLedger.HandleMan = ActionWorkLedger.HandleMan; newActionWorkLedger.HandleMan = ActionWorkLedger.HandleMan;
newActionWorkLedger.KeyWorkNum = ActionWorkLedger.KeyWorkNum;
newActionWorkLedger.KeyWorkOKNum = ActionWorkLedger.KeyWorkOKNum;
newActionWorkLedger.KeyWorkOKRate = ActionWorkLedger.KeyWorkOKRate;
Funs.DB.SubmitChanges(); Funs.DB.SubmitChanges();
} }
} }
@@ -80,14 +80,26 @@
<Items> <Items>
<f:Label ID="txtUnitName" runat="server" Hidden="true"> <f:Label ID="txtUnitName" runat="server" Hidden="true">
</f:Label> </f:Label>
<f:Label ID="txtQuarter" runat="server"> <f:Label ID="txtQuarter" runat="server" LabelWidth="130px">
</f:Label> </f:Label>
<f:Label ID="txtCompileDate" runat="server"> <f:Label ID="txtCompileDate" runat="server" LabelWidth="130px">
</f:Label> </f:Label>
<f:Label ID="lbHandleMan" runat="server"> <f:Label ID="lbHandleMan" runat="server">
</f:Label> </f:Label>
</Items> </Items>
</f:FormRow> </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> </Rows>
</f:Form> </f:Form>
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" <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; txtUnitName.Text = string.Empty;
txtQuarter.Text = string.Empty; txtQuarter.Text = string.Empty;
txtCompileDate.Text = string.Empty; txtCompileDate.Text = string.Empty;
txtKeyWorkNum.Text = string.Empty;
txtKeyWorkOKNum.Text = string.Empty;
txtKeyWorkOKRate.Text = string.Empty;
this.lbHandleMan.Text = string.Empty; this.lbHandleMan.Text = string.Empty;
Grid1.DataSource = null; Grid1.DataSource = null;
Grid1.DataBind(); Grid1.DataBind();
@@ -105,6 +108,18 @@ namespace FineUIPro.Web.ZHGL.Information
this.ActionWorkLedgerId = report.ActionWorkLedgerId; this.ActionWorkLedgerId = report.ActionWorkLedgerId;
txtUnitName.Text = "单位:" + report.UnitName; txtUnitName.Text = "单位:" + report.UnitName;
txtQuarter.Text = "季度:" + report.Quarters; 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) if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3)
{ {
this.lbHandleMan.Hidden = true; this.lbHandleMan.Hidden = true;
@@ -228,6 +228,42 @@ namespace FineUIPro.Web.ZHGL.Information {
/// </remarks> /// </remarks>
protected global::FineUIPro.Label lbHandleMan; 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> /// <summary>
/// Grid1 控件。 /// Grid1 控件。
/// </summary> /// </summary>
@@ -27,6 +27,15 @@
</f:DatePicker> </f:DatePicker>
</Items> </Items>
</f:FormRow> </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> <f:FormRow>
<Items> <Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server" <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); 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 else
@@ -237,6 +249,9 @@ namespace FineUIPro.Web.ZHGL.Information
} }
ActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue); ActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
ActionWorkLedger.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.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)) if (string.IsNullOrEmpty(this.ActionWorkLedgerId))
{ {
this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger)); ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId; this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger)); ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
@@ -530,5 +545,17 @@ namespace FineUIPro.Web.ZHGL.Information
} }
} }
#endregion #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> /// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate; 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> /// <summary>
/// Grid1 控件。 /// Grid1 控件。
/// </summary> /// </summary>
@@ -1,7 +1,4 @@
using BLL; using BLL;
using FineUIPro.Web.BaseInfo;
using FineUIPro.Web.DataShow;
using FineUIPro.Web.InformationProject;
using Model; using Model;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@@ -61,36 +58,11 @@ namespace FineUIPro.Web.ZHGL.Information
MillionsMonthlyReportId = Request.QueryString["MillionsMonthlyReportId"]; MillionsMonthlyReportId = Request.QueryString["MillionsMonthlyReportId"];
if (!String.IsNullOrEmpty(MillionsMonthlyReportId)) if (!String.IsNullOrEmpty(MillionsMonthlyReportId))
{ {
items = BLL.MillionsMonthlyReportItemService.GetItemsNoSum(MillionsMonthlyReportId);
this.Grid1.DataSource = items;
this.Grid1.DataBind();
var report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(MillionsMonthlyReportId); var report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(MillionsMonthlyReportId);
if (report != null) if (report != null)
{
setPageInfo(report);
}
}
else
{
this.btnCopy.Hidden = false;
drpMonth.SelectedValue = months;
drpYear.SelectedValue = year;
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
txtDutyPerson.Text = this.CurrUser.PersonName;
//增加明细集合
GetNewItems(year, months);
this.txtRecordableIncidentRate.Text = "0";
this.txtLostTimeRate.Text = "0";
this.txtLostTimeInjuryRate.Text = "0";
this.txtDeathAccidentFrequency.Text = "0";
this.txtAccidentMortality.Text = "0";
}
}
}
#region
/// <summary>
///
/// </summary>
/// <param name="report"></param>
private void setPageInfo(Model.Information_MillionsMonthlyReport report)
{ {
this.btnSave.Hidden = true; this.btnSave.Hidden = true;
this.btnSubmit.Hidden = true; this.btnSubmit.Hidden = true;
@@ -110,7 +82,7 @@ namespace FineUIPro.Web.ZHGL.Information
if (report.UpState == BLL.Const.UpState_3) if (report.UpState == BLL.Const.UpState_3)
{ {
this.btnSave.Hidden = true; this.btnSave.Hidden = true;
this.btnUpdata.Hidden = true; //this.btnUpdata.Hidden = true;
} }
drpMonth.SelectedValue = report.Month.ToString(); drpMonth.SelectedValue = report.Month.ToString();
drpYear.SelectedValue = report.Year.ToString(); drpYear.SelectedValue = report.Year.ToString();
@@ -204,13 +176,27 @@ namespace FineUIPro.Web.ZHGL.Information
{ {
this.txtSoleDutyNum.Text = Convert.ToString(report.SoleDutyNum); this.txtSoleDutyNum.Text = Convert.ToString(report.SoleDutyNum);
} }
}
items = BLL.MillionsMonthlyReportItemService.GetItemsNoSum(MillionsMonthlyReportId); }
else
{
this.btnCopy.Hidden = false;
drpMonth.SelectedValue = months;
drpYear.SelectedValue = year;
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
txtDutyPerson.Text = this.CurrUser.PersonName;
//增加明细集合
GetNewItems(year, months);
this.Grid1.DataSource = items; this.Grid1.DataSource = items;
this.Grid1.DataBind(); this.Grid1.DataBind();
this.txtRecordableIncidentRate.Text = "0";
this.txtLostTimeRate.Text = "0";
this.txtLostTimeInjuryRate.Text = "0";
this.txtDeathAccidentFrequency.Text = "0";
this.txtAccidentMortality.Text = "0";
}
}
} }
#endregion
#endregion #endregion
#region #region
@@ -362,22 +348,101 @@ namespace FineUIPro.Web.ZHGL.Information
{ {
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=MillionsMonthlyReport&Id={0}", report.MillionsMonthlyReportId, "编辑 - "))); 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) protected void btnSave_Click(object sender, EventArgs e)
{
string err = AuditData();
if (string.IsNullOrEmpty(err))
{ {
Save("add"); Save("add");
} }
else
{
ShowNotify(err, MessageBoxIcon.Warning);
}
}
protected void btnUpdata_Click(object sender, EventArgs e) protected void btnUpdata_Click(object sender, EventArgs e)
{
string err = AuditData();
if (string.IsNullOrEmpty(err))
{ {
Save("updata"); Save("updata");
} }
else
{
ShowNotify(err, MessageBoxIcon.Warning);
}
}
protected void btnSubmit_Click(object sender, EventArgs e) protected void btnSubmit_Click(object sender, EventArgs e)
{
string err = AuditData();
if (string.IsNullOrEmpty(err))
{ {
Save("submit"); 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 #endregion
#region #region
@@ -735,99 +800,29 @@ namespace FineUIPro.Web.ZHGL.Information
#region #region
private void GetNewItems(string year, string months) private void GetNewItems(string year, string months)
{ {
DateTime nowTime = Funs.GetNewDateTimeOrNow(year + "-" + months); //获取项目集合
DateTime starTime = nowTime.AddMonths(-2).AddDays(24); 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();
DateTime endTime = nowTime.AddMonths(-1).AddDays(23); this.txtInputCosts.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.InputCosts ?? 0));
this.txtTrainNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.TrainNum ?? 0));
var getCosts = from x in Funs.DB.CostGoods_CostManageItem this.txtGeneralHazardNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.GeneralHazardNum ?? 0));
join y in Funs.DB.CostGoods_CostManage on x.CostManageId equals y.CostManageId this.txtMajorHazardNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.MajorHazardNum ?? 0));
where y.CostManageDate >=starTime && y.CostManageDate <= endTime this.txtNotProofLargeProjectNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.NotProofLargeProjectNum ?? 0));
select x; this.txtProofLargeProjectNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.ProofLargeProjectNum ?? 0));
if (getCosts.Count() > 0) this.txtFireLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.FireLicenseNum ?? 0));
{ this.txtLimitLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.LimitLicenseNum ?? 0));
this.txtInputCosts.Text = getCosts.Sum(x => x.PriceMoney ?? 0).ToString(); this.txtHighLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.HighLicenseNum ?? 0));
} this.txtHoistingLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.HoistingLicenseNum ?? 0));
this.txtTrainNum.Text = Funs.DB.EduTrain_TrainRecord.Where(x => x.TrainStartDate >= starTime && x.TrainStartDate <= endTime).Count().ToString(); this.txtBreakGroundLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.BreakGroundLicenseNum ?? 0));
this.txtElectricityLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.ElectricityLicenseNum ?? 0));
int HazardAll = 0, RectifyAll = 0; this.txtRTLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.RTLicenseNum ?? 0));
int HazardMajor = 0, RectifyMajor = 0; this.txtNightLicenseNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.NightLicenseNum ?? 0));
var getHazardRegister = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.RegisterDate >= starTime && x.RegisterDate <= endTime && x.States == Const.State_3); this.txtCommissionerNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.CommissionerNum ?? 0));
HazardAll = getHazardRegister.Count(); this.txtSoleDutyNum.Text = Convert.ToString(millionsMonthlyReports.Sum(x => x.SoleDutyNum ?? 0));
if (HazardAll > 0) List<string> projectIds = millionsMonthlyReports.Select(x => x.ProjectId).ToList();
{
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();
//增加明细集合 //增加明细集合
Model.Information_MillionsMonthlyReportItem item1 = new Information_MillionsMonthlyReportItem Model.Information_MillionsMonthlyReportItem item1 = new Information_MillionsMonthlyReportItem
{ {
MillionsMonthlyReportItemId = SQLHelper.GetNewID(), MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "机关后勤服务", Affiliation = "机关后勤服务",
Name = "总部", Name = "总部",
SortIndex = 10, SortIndex = 10,
@@ -863,7 +858,7 @@ namespace FineUIPro.Web.ZHGL.Information
items.Add(item1); items.Add(item1);
Model.Information_MillionsMonthlyReportItem item2 = new Information_MillionsMonthlyReportItem Model.Information_MillionsMonthlyReportItem item2 = new Information_MillionsMonthlyReportItem
{ {
MillionsMonthlyReportItemId = SQLHelper.GetNewID(), MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "机关后勤服务", Affiliation = "机关后勤服务",
Name = "二级单位", Name = "二级单位",
SortIndex = 20, SortIndex = 20,
@@ -896,16 +891,21 @@ namespace FineUIPro.Web.ZHGL.Information
LossDayNum = 0, LossDayNum = 0,
}; };
items.Add(item2); items.Add(item2);
var projects = (from x in Funs.DB.Base_Project
where projectIds.Contains(x.ProjectId)
select x).ToList();
if (this.CurrUser.UnitId == BLL.Const.UnitId_SEDIN)
var projects = BLL.ProjectService.GetProjectWorkList(); {
projects = BLL.ProjectService.GetProjectWorkList();
}
int i = 20; int i = 20;
foreach (var p in projects) foreach (var p in projects)
{ {
i += 10; i += 10;
Model.Information_MillionsMonthlyReportItem item = new Information_MillionsMonthlyReportItem Model.Information_MillionsMonthlyReportItem item = new Information_MillionsMonthlyReportItem
{ {
MillionsMonthlyReportItemId = SQLHelper.GetNewID(), MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
Affiliation = "项目现场", Affiliation = "项目现场",
Name = p.ProjectName, Name = p.ProjectName,
SortIndex = i SortIndex = i
@@ -920,24 +920,45 @@ namespace FineUIPro.Web.ZHGL.Information
item.Name = "[" + p.ProjectCode + "]" + p.ProjectName; 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; Model.InformationProject_MillionsMonthlyReport report = millionsMonthlyReports.FirstOrDefault(x => x.ProjectId == p.ProjectId);
item.SnapPersonNum = 0; if (report != null)
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)
{ {
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.SeriousInjuriesNum = 0;
item.SeriousInjuriesPersonNum = 0; item.SeriousInjuriesPersonNum = 0;
item.SeriousInjuriesLossHour = 0; item.SeriousInjuriesLossHour = 0;
@@ -960,11 +981,9 @@ namespace FineUIPro.Web.ZHGL.Information
item.FirstAidDressingsNum = 0; item.FirstAidDressingsNum = 0;
item.AttemptedEventNum = 0; item.AttemptedEventNum = 0;
item.LossDayNum = 0; item.LossDayNum = 0;
}
items.Add(item); items.Add(item);
} }
this.Grid1.DataSource = items;
this.Grid1.DataBind();
} }
#endregion #endregion
@@ -984,6 +1003,16 @@ namespace FineUIPro.Web.ZHGL.Information
Grid1.DataSource = items; Grid1.DataSource = items;
Grid1.DataBind(); Grid1.DataBind();
} }
protected void drpDate_SelectedIndexChanged(object sender, EventArgs e)
{
items.Clear();
GetNewItems(drpYear.SelectedValue, drpMonth.SelectedValue);
Grid1.DataSource = items;
Grid1.DataBind();
}
#endregion #endregion
#region #region
+18
View File
@@ -40,5 +40,23 @@ namespace Model
get; get;
set; set;
} }
public int? KeyWorkNum
{
get;
set;
}
public int? KeyWorkOKNum
{
get;
set;
}
public string KeyWorkOKRate
{
get;
set;
}
} }
} }
+126
View File
@@ -120179,6 +120179,12 @@ namespace Model
private string _HandleMan; private string _HandleMan;
private System.Nullable<int> _KeyWorkNum;
private System.Nullable<int> _KeyWorkOKNum;
private string _KeyWorkOKRate;
private EntityRef<Base_Unit> _Base_Unit; private EntityRef<Base_Unit> _Base_Unit;
private EntitySet<Information_ActionWorkLedgerItem> _Information_ActionWorkLedgerItem; private EntitySet<Information_ActionWorkLedgerItem> _Information_ActionWorkLedgerItem;
@@ -120205,6 +120211,12 @@ namespace Model
partial void OnHandleStateChanged(); partial void OnHandleStateChanged();
partial void OnHandleManChanging(string value); partial void OnHandleManChanging(string value);
partial void OnHandleManChanged(); partial void OnHandleManChanged();
partial void OnKeyWorkNumChanging(System.Nullable<int> value);
partial void OnKeyWorkNumChanged();
partial void OnKeyWorkOKNumChanging(System.Nullable<int> value);
partial void OnKeyWorkOKNumChanged();
partial void OnKeyWorkOKRateChanging(string value);
partial void OnKeyWorkOKRateChanged();
#endregion #endregion
public Information_ActionWorkLedger() public Information_ActionWorkLedger()
@@ -120398,6 +120410,66 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkNum", DbType="Int")]
public System.Nullable<int> KeyWorkNum
{
get
{
return this._KeyWorkNum;
}
set
{
if ((this._KeyWorkNum != value))
{
this.OnKeyWorkNumChanging(value);
this.SendPropertyChanging();
this._KeyWorkNum = value;
this.SendPropertyChanged("KeyWorkNum");
this.OnKeyWorkNumChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkOKNum", DbType="Int")]
public System.Nullable<int> KeyWorkOKNum
{
get
{
return this._KeyWorkOKNum;
}
set
{
if ((this._KeyWorkOKNum != value))
{
this.OnKeyWorkOKNumChanging(value);
this.SendPropertyChanging();
this._KeyWorkOKNum = value;
this.SendPropertyChanged("KeyWorkOKNum");
this.OnKeyWorkOKNumChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkOKRate", DbType="NVarChar(20)")]
public string KeyWorkOKRate
{
get
{
return this._KeyWorkOKRate;
}
set
{
if ((this._KeyWorkOKRate != value))
{
this.OnKeyWorkOKRateChanging(value);
this.SendPropertyChanging();
this._KeyWorkOKRate = value;
this.SendPropertyChanged("KeyWorkOKRate");
this.OnKeyWorkOKRateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Information_ActionWorkLedger_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Information_ActionWorkLedger_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit public Base_Unit Base_Unit
{ {
@@ -296990,6 +297062,12 @@ namespace Model
private string _HandleState; private string _HandleState;
private System.Nullable<int> _KeyWorkNum;
private System.Nullable<int> _KeyWorkOKNum;
private string _KeyWorkOKRate;
private string _Quarters; private string _Quarters;
private string _UnitName; private string _UnitName;
@@ -297114,6 +297192,54 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkNum", DbType="Int")]
public System.Nullable<int> KeyWorkNum
{
get
{
return this._KeyWorkNum;
}
set
{
if ((this._KeyWorkNum != value))
{
this._KeyWorkNum = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkOKNum", DbType="Int")]
public System.Nullable<int> KeyWorkOKNum
{
get
{
return this._KeyWorkOKNum;
}
set
{
if ((this._KeyWorkOKNum != value))
{
this._KeyWorkOKNum = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_KeyWorkOKRate", DbType="NVarChar(20)")]
public string KeyWorkOKRate
{
get
{
return this._KeyWorkOKRate;
}
set
{
if ((this._KeyWorkOKRate != value))
{
this._KeyWorkOKRate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarters", DbType="NVarChar(200) NOT NULL", CanBeNull=false)] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarters", DbType="NVarChar(200) NOT NULL", CanBeNull=false)]
public string Quarters public string Quarters
{ {