提交代码
This commit is contained in:
@@ -15,6 +15,9 @@ namespace FineUIPro.Web.common
|
||||
public partial class main_new1 : PageBase
|
||||
{
|
||||
protected string divProjectImg;
|
||||
protected string hjallNumber = "0";
|
||||
protected string hjfinishNumber = "0";
|
||||
protected string hjzgl = "0";
|
||||
/// <summary>
|
||||
/// 页面加载
|
||||
/// </summary>
|
||||
@@ -23,7 +26,7 @@ namespace FineUIPro.Web.common
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
{
|
||||
ProjectService.InitProjectShortNameByStateDropDownList(this.drpProject, this.CurrUser.UserId, BLL.Const.ProjectState_1, false);
|
||||
if (this.drpProject.Items.Count > 0)
|
||||
{
|
||||
@@ -41,6 +44,40 @@ namespace FineUIPro.Web.common
|
||||
|
||||
//资质预警
|
||||
getEarlyWarningCounts();
|
||||
|
||||
//在建项目
|
||||
var allProjects = ProjectService.GetAllProjectDropDownList();
|
||||
//焊接数据
|
||||
double result = 0;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" select x;
|
||||
decimal a = 0, b = 0;
|
||||
if (ndtLists.Count() > 0)
|
||||
{
|
||||
foreach (var project in allProjects)
|
||||
{
|
||||
var ndt = (from x in ndtLists
|
||||
where x.ProjectId == project.ProjectId
|
||||
orderby x.CreateDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (ndt != null)
|
||||
{
|
||||
if (ndt.TotalQuantity.HasValue)
|
||||
{
|
||||
a += Math.Floor(ndt.TotalQuantity.Value * Funs.GetNewDecimalOrZero(ndt.TotalRate) / 100);
|
||||
b += ndt.TotalQuantity.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (b > 0)
|
||||
{
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
||||
|
||||
hjallNumber = b.ToString();
|
||||
hjfinishNumber = a.ToString();
|
||||
hjzgl = result.ToString() + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,14 +157,15 @@ namespace FineUIPro.Web.common
|
||||
/// 机械预警
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetJxyjNum() {
|
||||
public static int GetJxyjNum()
|
||||
{
|
||||
int result = 0;
|
||||
//机具报验的到期提醒和过期提醒记录数加一起
|
||||
//机具报验的到期提醒数
|
||||
var num1 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && DateTime.Now < x.NextTestDate
|
||||
&& ((DateTime)x.NextTestDate).AddDays(-15) < DateTime.Now).Count();
|
||||
//过期提醒记录数
|
||||
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate<DateTime.Now).Count();
|
||||
var num2 = Funs.DB.Comprehensive_InspectionMachine.Where(x => x.IsOnSite == true && x.NextTestDate < DateTime.Now).Count();
|
||||
result = num1 + num2;
|
||||
return result;
|
||||
}
|
||||
@@ -138,9 +176,8 @@ namespace FineUIPro.Web.common
|
||||
/// <returns></returns>
|
||||
public static int GetTrainPersonNum()
|
||||
{
|
||||
DateTime date = DateTime.Now.AddDays(-1);
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.IsTrain == true && x.CompileDate.Value.Year == date.Year && x.CompileDate.Value.Month == date.Month && x.CompileDate.Value.Day == date.Day
|
||||
where x.IsTrain == true
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
@@ -151,10 +188,8 @@ namespace FineUIPro.Web.common
|
||||
/// <returns></returns>
|
||||
public static int GetTechnicalDisclosePersonNum()
|
||||
{
|
||||
DateTime date = DateTime.Now.AddDays(-1);
|
||||
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
where x.DetailsDate.Value.Year == date.Year && x.DetailsDate.Value.Month == date.Month && x.DetailsDate.Value.Day == date.Day
|
||||
select x.JoinPersonNum??0).ToList().Sum();
|
||||
select x.JoinPersonNum ?? 0).ToList().Sum();
|
||||
var q = Funs.GetNewIntOrZero(result.ToString());
|
||||
return q;
|
||||
}
|
||||
@@ -372,8 +407,8 @@ namespace FineUIPro.Web.common
|
||||
int result = 0;
|
||||
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmAmount.Split('.')[0]);
|
||||
@@ -388,8 +423,8 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
int result = 0;
|
||||
var getD2 = (from x in Funs.DB.HJGL_FL_Data
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (getD2 != null)
|
||||
{
|
||||
result = Funs.GetNewIntOrZero(getD2.OneTimeFilmQualifiedAmount.Split('.')[0]);
|
||||
@@ -404,7 +439,7 @@ namespace FineUIPro.Web.common
|
||||
public static string GetOKFilmHgl()
|
||||
{
|
||||
string zgl = "0";
|
||||
if (GetOKFilmNum()>0)
|
||||
if (GetOKFilmNum() > 0)
|
||||
{
|
||||
zgl = String.Format("{0:N2}", 100.0 * GetOKFilmNum() / GetTotalFilmNum());
|
||||
}
|
||||
@@ -421,8 +456,9 @@ namespace FineUIPro.Web.common
|
||||
protected string InspectionManagementOkCount;
|
||||
//一次验收合格率
|
||||
protected string InspectionManagementOneOkCount;
|
||||
private void getInspectionManagementInfo() {
|
||||
|
||||
private void getInspectionManagementInfo()
|
||||
{
|
||||
|
||||
var q = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId orderby x.SortIndex select x).ToList();
|
||||
foreach (var item in q)
|
||||
{
|
||||
@@ -436,7 +472,7 @@ namespace FineUIPro.Web.common
|
||||
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.CNProfessionalId == item.CNProfessionalId
|
||||
select x).Count();
|
||||
InspectionManagementSumCount += "'"+ num1 + "',";
|
||||
InspectionManagementSumCount += "'" + num1 + "',";
|
||||
|
||||
//根据专业获取合格数
|
||||
//var num2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
@@ -450,9 +486,9 @@ namespace FineUIPro.Web.common
|
||||
|
||||
//一次验收合格率
|
||||
var hgl = "0";
|
||||
if (num1>0)
|
||||
if (num1 > 0)
|
||||
{
|
||||
hgl+= String.Format("{0:N2}", 100.0 * num2 / num1);
|
||||
hgl += String.Format("{0:N2}", 100.0 * num2 / num1);
|
||||
}
|
||||
InspectionManagementOneOkCount += "'" + hgl + "',";
|
||||
}
|
||||
@@ -470,7 +506,7 @@ namespace FineUIPro.Web.common
|
||||
//未整改完成项
|
||||
protected string ncrwZgbhx;
|
||||
//整改率
|
||||
protected string ncrZgl="0%";
|
||||
protected string ncrZgl = "0%";
|
||||
|
||||
//图表数据
|
||||
//专业
|
||||
@@ -481,23 +517,23 @@ namespace FineUIPro.Web.common
|
||||
//闭环项 有完成日期的
|
||||
//var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate != null).Count();
|
||||
//var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CompleteDate == null).Count();
|
||||
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.Status=="3").Count();
|
||||
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => !x.Status.Equals('3') ||x.Status ==null).Count();
|
||||
var num1 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "已闭合").Count();
|
||||
var num2 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.ImplementationFrontState == "整改中").Count();
|
||||
ncrZgbhx = num1.ToString();
|
||||
ncrwZgbhx = num2.ToString();
|
||||
if ((num1 + num2) >0)
|
||||
if ((num1 + num2) > 0)
|
||||
{
|
||||
ncrZgl= String.Format("{0:N2}", 100.0 * num1 / (num1 + num2))+"%";
|
||||
ncrZgl = String.Format("{0:N2}", 100.0 * num1 / (num1 + num2)) + "%";
|
||||
}
|
||||
|
||||
//加载专业
|
||||
var list = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId orderby x.SortIndex select x).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
ncrZy += "'"+item.ProfessionalName+"',";
|
||||
ncrZy += "'" + item.ProfessionalName + "',";
|
||||
//根据专业加载数据量
|
||||
var num3= Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId==item.CNProfessionalId).Count();
|
||||
ncrCount += "'"+num3+"',";
|
||||
var num3 = Funs.DB.Comprehensive_NCRManagement.Where(x => x.CNProfessionalId == item.CNProfessionalId).Count();
|
||||
ncrCount += "'" + num3 + "',";
|
||||
}
|
||||
ncrZy = ncrZy.TrimEnd(',');
|
||||
ncrCount = ncrCount.TrimEnd(',');
|
||||
@@ -542,7 +578,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
isHiddDefaultImg = true;
|
||||
divProjectImg += string.Format(" <div class=\"swiper-slide\"><img src=\"{0}\"></div>",
|
||||
atturl.Replace(Funs.RootPath, "/"));
|
||||
atturl.Replace(Funs.RootPath, "/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -556,10 +592,10 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
string jsCode = "var swiperWrapper = document.getElementById('swiper-wrapper');";
|
||||
jsCode += "swiperWrapper.innerHTML = '" + divProjectImg + "';";
|
||||
string script2 = " createSwiper();";
|
||||
PageContext.RegisterStartupScript(jsCode);
|
||||
PageContext.RegisterStartupScript(script2);
|
||||
|
||||
string script2 = " createSwiper();";
|
||||
PageContext.RegisterStartupScript(jsCode);
|
||||
PageContext.RegisterStartupScript(script2);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user