20230607新增月报费用取值,上报集团报表(月报)默认自动取值功能新增

This commit is contained in:
2023-06-07 18:01:30 +08:00
parent e4871bc690
commit c7994e1a5c
21 changed files with 914 additions and 723 deletions
@@ -1,4 +1,5 @@
using BLL;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@@ -39,10 +40,10 @@ namespace FineUIPro.Web.DataShow
string cpara = string.Empty;
if (this.drpProject.SelectedValue != Const._Null)
{
strSql += " AND projectId = @projectId"; ///状态为已完成
strSql += " AND projectId = @projectId";
listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue));
}
//if (!string.IsNullOrEmpty(this.txtStartTime.Text))
//{
// strSql += " AND h.RegisterDate >=@StartTime";
@@ -57,7 +58,7 @@ namespace FineUIPro.Web.DataShow
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
//}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
@@ -165,7 +166,7 @@ namespace FineUIPro.Web.DataShow
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count1(object projectId)
public int Count1(object projectId)
{
int cout1 = 0;
if (projectId != null)
@@ -180,14 +181,14 @@ namespace FineUIPro.Web.DataShow
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count2(object projectId)
public int Count2(object projectId)
{
int cout1 = 0;
int cout4 = 0;
if (projectId != null)
{
cout1 = getcount(projectId.ToString(),2);
cout4 = getcount(projectId.ToString(),2);
}
return cout1;
return cout4;
}
/// <summary>
@@ -195,36 +196,26 @@ namespace FineUIPro.Web.DataShow
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count3(object projectId)
public int Count3(object projectId)
{
int cout1 = 0;
int cout3 = 0;
if (projectId != null)
{
cout1= getcount(projectId.ToString(), 3);
cout3 = getcount(projectId.ToString(), 3);
}
return cout1;
return cout3;
}
protected int Count4(object projectId)
public int Count4(object projectId)
{
int cout1 = 0;
int cout4 = 0;
if (projectId != null)
{
cout1 = getcount(projectId.ToString(), 4);
cout4 = getcount(projectId.ToString(), 4);
}
return cout1;
return cout4;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Hazard_HazardList> getDataLists = from x in Funs.DB.Hazard_HazardList
select x;
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Hazard_HazardSelectedItem> getDataItemLists = from x in Funs.DB.Hazard_HazardSelectedItem
where x.IsStart == true
select x;
/// <summary>
///
/// </summary>
@@ -237,7 +228,18 @@ namespace FineUIPro.Web.DataShow
var getlevel = Funs.DB.Base_RiskLevel.FirstOrDefault(x => x.RiskLevel == level);
if (getlevel != null)
{
count = getDataItemLists.Where(x => x.ProjectId == projectId && x.HazardLevel == getlevel.RiskLevelId).Count();
count = (from x in Funs.DB.Hazard_HazardSelectedItem
join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId
where y.ProjectId == projectId && (x.HazardLevel == getlevel.RiskLevelId || x.HazardLevel == level.ToString()) && y.States == Const.State_2
select x).Count();
}
else
{
count = (from x in Funs.DB.Hazard_HazardSelectedItem
join y in Funs.DB.Hazard_HazardList on x.HazardListId equals y.HazardListId
where y.ProjectId == projectId && x.HazardLevel == level.ToString() && y.States == Const.State_2
select x).Count();
}
return count;