五环
This commit is contained in:
@@ -12,6 +12,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Org.BouncyCastle.Ocsp;
|
||||
using FineUIPro.Web.HJGL.FL;
|
||||
|
||||
namespace FineUIPro.Web.common
|
||||
{
|
||||
@@ -29,6 +30,7 @@ namespace FineUIPro.Web.common
|
||||
protected string OnePassRateOfWelding = string.Empty;
|
||||
protected string total = string.Empty;
|
||||
protected string completed = string.Empty;
|
||||
protected string qualified = string.Empty;
|
||||
protected string mainI_progressStatistics = string.Empty;
|
||||
protected string Percentage_of_progress = string.Empty;
|
||||
|
||||
@@ -75,7 +77,7 @@ namespace FineUIPro.Web.common
|
||||
: db.Base_Project
|
||||
.Where(x => x.ProjectState == "1")
|
||||
.Select(x => x.ProjectId)
|
||||
.ToArray();
|
||||
.ToArray();
|
||||
//在建项目
|
||||
if (pids == null)
|
||||
{
|
||||
@@ -102,7 +104,6 @@ namespace FineUIPro.Web.common
|
||||
if (countAqrgsSum > 10000)
|
||||
{
|
||||
countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00);
|
||||
|
||||
this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万";
|
||||
}
|
||||
else
|
||||
@@ -112,8 +113,8 @@ namespace FineUIPro.Web.common
|
||||
|
||||
// 当月安全人工时
|
||||
var countMonthAqrgs = pids?.Any() == true
|
||||
? CountAqrgs(getStartMonth(), getEndMonth(), pids)
|
||||
: CountAqrgs(getStartMonth(), getEndMonth());
|
||||
? CountAqrgs(getLastMonthEndDay(), getEndMonth(), pids)
|
||||
: CountAqrgs(getLastMonthEndDay(), getEndMonth());
|
||||
|
||||
|
||||
if (countMonthAqrgs > 10000)
|
||||
@@ -130,7 +131,8 @@ namespace FineUIPro.Web.common
|
||||
var trainingQuery = db.EduTrain_TrainRecord
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.GroupBy(x => 1)
|
||||
.Select(g => new {
|
||||
.Select(g => new
|
||||
{
|
||||
TrainCount = g.Sum(x => x.TrainPersonNum) ?? 0,
|
||||
BoShengCount = db.Bo_Sheng_TrainPerson
|
||||
.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null))
|
||||
@@ -141,94 +143,96 @@ namespace FineUIPro.Web.common
|
||||
|
||||
divSafePersonNum.InnerHtml = trainingQuery != null
|
||||
? (trainingQuery.TrainCount + trainingQuery.BoShengCount).ToString()
|
||||
: "0";
|
||||
: "0";
|
||||
|
||||
|
||||
|
||||
// 安全管理人员(优化关联查询)
|
||||
var safetyStaffCount = db.SitePerson_Person
|
||||
.Where(x=> x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now))
|
||||
.Where(x => x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now))
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Join(db.Base_WorkPost.Where(x => x.IsHsse==true),
|
||||
.Join(db.Base_WorkPost.Where(x => x.IsHsse == true),
|
||||
person => person.WorkPostId,
|
||||
post => post.WorkPostId,
|
||||
(person, post) => person)
|
||||
.Count();
|
||||
divSafeManagePersonNum.InnerText = safetyStaffCount.ToString();
|
||||
});
|
||||
});
|
||||
}
|
||||
// 质量统计模块封装
|
||||
private async Task BindQualityStatisticsAsync()
|
||||
{
|
||||
await Task.Run(() => {
|
||||
await Task.Run(() =>
|
||||
{
|
||||
|
||||
var db = Funs.DB;
|
||||
var db = Funs.DB;
|
||||
// 质量管理人员(合并公司+项目级查询)
|
||||
var qualityQuery = db.Base_WorkPost
|
||||
.Where(x => x.IsCQMS == true)
|
||||
.GroupJoin(db.SitePerson_Person.Where(x=> x.IsUsed == true),
|
||||
.GroupJoin(db.SitePerson_Person.Where(x => x.IsUsed == true),
|
||||
post => post.WorkPostId,
|
||||
person => person.WorkPostId,
|
||||
(post, persons) => new { post, persons })
|
||||
.SelectMany(x => x.persons.DefaultIfEmpty(),
|
||||
(x, person) => new { x.post, person })
|
||||
.Where(x => pids.Contains(x.person.ProjectId));
|
||||
|
||||
|
||||
//企业总部人员和分支机构人员
|
||||
var query = (from person in db.Person_CompanyBranchPerson
|
||||
join unit in db.Base_Unit on person.UnitId equals unit.UnitId into unitJoin
|
||||
from unit in unitJoin.DefaultIfEmpty() // 左连接
|
||||
join workPost in db.Base_WorkPost on person.WorkPostId equals workPost.WorkPostId into workPostJoin
|
||||
from workPost in workPostJoin.DefaultIfEmpty() // 左连接
|
||||
where person.IsOnJob == true && workPost.IsCQMS == true
|
||||
select new
|
||||
{
|
||||
ID = person.CompanyBranchPersonId,
|
||||
UnitName = unit.UnitName,
|
||||
PersonName = person.PersonName,
|
||||
SexStr = person.Sex == "1" ? "男" : "女",
|
||||
IdentityCard = person.IdentityCard,
|
||||
WorkPostName = workPost.WorkPostName,
|
||||
Telephone = person.Telephone,
|
||||
IsOnJob = person.IsOnJob,
|
||||
Remark = person.Remark,
|
||||
ProjectName = ""
|
||||
}).ToList();
|
||||
join unit in db.Base_Unit on person.UnitId equals unit.UnitId into unitJoin
|
||||
from unit in unitJoin.DefaultIfEmpty() // 左连接
|
||||
join workPost in db.Base_WorkPost on person.WorkPostId equals workPost.WorkPostId into workPostJoin
|
||||
from workPost in workPostJoin.DefaultIfEmpty() // 左连接
|
||||
where person.IsOnJob == true && workPost.IsCQMS == true
|
||||
select new
|
||||
{
|
||||
ID = person.CompanyBranchPersonId,
|
||||
UnitName = unit.UnitName,
|
||||
PersonName = person.PersonName,
|
||||
SexStr = person.Sex == "1" ? "男" : "女",
|
||||
IdentityCard = person.IdentityCard,
|
||||
WorkPostName = workPost.WorkPostName,
|
||||
Telephone = person.Telephone,
|
||||
IsOnJob = person.IsOnJob,
|
||||
Remark = person.Remark,
|
||||
ProjectName = ""
|
||||
}).ToList();
|
||||
|
||||
divCqmsManageNum.InnerText = (qualityQuery.Count() + query.Count()).ToString();
|
||||
// 质量培训人员
|
||||
divCqmsPxNum.InnerText = db.Comprehensive_InspectionPerson
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Count(x => x.IsTrain == true).ToString();
|
||||
divCqmsPxNum.InnerText = db.Comprehensive_InspectionPerson
|
||||
.Where(x => pids.Contains(x.ProjectId))
|
||||
.Count(x => x.IsTrain == true).ToString();
|
||||
});
|
||||
}
|
||||
// 项目统计优化
|
||||
private async Task BindProjectStatisticsAsync()
|
||||
{
|
||||
await Task.Run(() => {
|
||||
var db = Funs.DB;
|
||||
int acount = allProjects.Count();
|
||||
int pcount1 = 0;
|
||||
int pcount2 = 0;
|
||||
int pcount3 = 0;
|
||||
if (acount > 0)
|
||||
await Task.Run(() =>
|
||||
{
|
||||
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select( x => x.ProjectId).Count();
|
||||
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
|
||||
if (pids == null)
|
||||
var db = Funs.DB;
|
||||
int acount = allProjects.Count();
|
||||
int pcount1 = 0;
|
||||
int pcount2 = 0;
|
||||
int pcount3 = 0;
|
||||
if (acount > 0)
|
||||
{
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId).Count();
|
||||
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
|
||||
if (pids == null)
|
||||
{
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
else
|
||||
{
|
||||
pidzjsg = pids;
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
pcount3 = Count3(pidzjsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
pidzjsg = pids;
|
||||
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x.ProjectId).Count();
|
||||
}
|
||||
pcount3 = Count3(pidzjsg);
|
||||
}
|
||||
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
|
||||
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
|
||||
div_wdgcCount.InnerHtml = pcount3.ToString() + "<div class=\"th\">个</div>";
|
||||
div_zjxmCount.InnerHtml = pcount1.ToString() + "<div class=\"th\">个</div>";
|
||||
div_cjrsCount.InnerHtml = pcount2.ToString() + "<div class=\"th\">人</div>";
|
||||
div_wdgcCount.InnerHtml = pcount3.ToString() + "<div class=\"th\">个</div>";
|
||||
});
|
||||
}
|
||||
|
||||
@@ -236,16 +240,31 @@ namespace FineUIPro.Web.common
|
||||
#region 当月人工时
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取上月的月末日期
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DateTime getLastMonthEndDay()
|
||||
{
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now.AddMonths(-1);
|
||||
// 获取当前月的最后一天
|
||||
DateTime lastDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, DateTime.DaysInMonth(currentDate.Year, currentDate.Month));
|
||||
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前月的月末日期
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DateTime getEndMonth()
|
||||
{
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now;
|
||||
// 获取当前月的最后一天
|
||||
DateTime lastDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, DateTime.DaysInMonth(currentDate.Year, currentDate.Month));
|
||||
|
||||
int span = Convert.ToInt32(System.DateTime.Now.Day);
|
||||
System.DateTime dateEnd = System.DateTime.Now.AddMonths(1).AddDays(-span);
|
||||
return dateEnd;
|
||||
return lastDayOfMonth;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前月初日期
|
||||
@@ -253,10 +272,11 @@ namespace FineUIPro.Web.common
|
||||
/// <returns></returns>
|
||||
public static DateTime getStartMonth()
|
||||
{
|
||||
int span = Convert.ToInt32(System.DateTime.Now.Day);
|
||||
span = span - 1;
|
||||
System.DateTime dateStart = System.DateTime.Now.AddDays(-span);
|
||||
return dateStart;
|
||||
// 获取当前日期
|
||||
DateTime currentDate = DateTime.Now;
|
||||
// 获取当前月的月初日期
|
||||
DateTime firstDayOfMonth = new DateTime(currentDate.Year, currentDate.Month, 1);
|
||||
return firstDayOfMonth;
|
||||
}
|
||||
|
||||
//安全人工时(穿透)
|
||||
@@ -272,8 +292,7 @@ namespace FineUIPro.Web.common
|
||||
var datetime1 = d1;
|
||||
var datetime2 = d2;
|
||||
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
|
||||
select new { x.ProjectId, x.InOutDate, x.WorkHours };
|
||||
select new { x.ProjectId, x.InOutDate, x.WorkHours };
|
||||
if (pids != null)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => pids.Contains(x.ProjectId));
|
||||
@@ -286,18 +305,20 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
|
||||
}
|
||||
var projects = getAllPersonInOutList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.Select(g => new
|
||||
{
|
||||
Project = g.Key,
|
||||
Items = g.OrderBy(x => x.InOutDate).ToList()
|
||||
})
|
||||
.Where(g => g.Items.Any());
|
||||
cout1 = projects.ToList().Sum(g =>
|
||||
(g.Items.Last().WorkHours ?? 0) -
|
||||
(g.Items.First().WorkHours ?? 0));
|
||||
var projects = getAllPersonInOutList.GroupBy(x => x.ProjectId).Select(g => new
|
||||
{
|
||||
Project = g.Key,
|
||||
Items = g.OrderBy(x => x.InOutDate).ToList()
|
||||
}).Where(g => g.Items.Any());
|
||||
|
||||
if (!datetime1.HasValue && !datetime2.HasValue)
|
||||
{//查累计人工时
|
||||
cout1 = projects.ToList().Sum(g => (g.Items.Last().WorkHours ?? 0));
|
||||
}
|
||||
else
|
||||
{//查当月人工时
|
||||
cout1 = projects.ToList().Sum(g => (g.Items.Last().WorkHours ?? 0) - (g.Items.First().WorkHours ?? 0));
|
||||
}
|
||||
|
||||
var getD1 = from x in Funs.DB.Accident_AccidentHandle
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
@@ -322,7 +343,7 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
getD1 = getD1.Where(x => x.AccidentDate <= datetime2);
|
||||
getD2 = getD2.Where(x => x.CompileDate <= datetime2);
|
||||
}
|
||||
}
|
||||
if (getD1.Any())
|
||||
{
|
||||
cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0);
|
||||
@@ -388,7 +409,7 @@ namespace FineUIPro.Web.common
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
Model.SingleSerie series = new Model.SingleSerie();
|
||||
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x=> new { x.ProjectId, x.ProjectName, x.ProjectState2, x.Province, x.ShortName }).ToList();
|
||||
var project1s = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => new { x.ProjectId, x.ProjectName, x.ProjectState2, x.Province, x.ShortName }).ToList();
|
||||
var consts = Funs.DB.Sys_Const.Where(x => x.GroupId == ConstValue.GroupId_ProjectState).ToList();
|
||||
string name = string.Empty;
|
||||
if (project1s.Any())
|
||||
@@ -456,25 +477,25 @@ namespace FineUIPro.Web.common
|
||||
var accidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂")
|
||||
select new { x.ProjectId, x.AccidentDate } ;
|
||||
select new { x.ProjectId, x.AccidentDate };
|
||||
var accidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂")
|
||||
select new { x.ProjectId, x.AccidentDate };
|
||||
var allProvinceProjectList = (from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where provinces.Contains(y.CnShortName )
|
||||
select new { x,y.CnShortName}).ToList();
|
||||
var allProvinces= allProvinceProjectList.Select(x =>x.CnShortName ).Distinct().ToList();
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where provinces.Contains(y.CnShortName)
|
||||
select new { x, y.CnShortName }).ToList();
|
||||
var allProvinces = allProvinceProjectList.Select(x => x.CnShortName).Distinct().ToList();
|
||||
foreach (var province in allProvinces)
|
||||
{
|
||||
int accidentNum = 0;
|
||||
DateTime date = DateTime.Now;
|
||||
decimal money1 = 0, money2 = 0;
|
||||
/* var projects = from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where y.CnShortName == province
|
||||
select x;*/
|
||||
/* var projects = from x in allProjects
|
||||
join y in provinceDic on x.Province equals y.ProvinceCode
|
||||
where y.CnShortName == province
|
||||
select x;*/
|
||||
var projects = allProvinceProjectList.Where(x => x.CnShortName == province);
|
||||
listdata.Add(projects.Count());
|
||||
decimal progress = 0;
|
||||
@@ -699,7 +720,7 @@ namespace FineUIPro.Web.common
|
||||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.State == "7"
|
||||
where x.State == "7"
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
@@ -716,11 +737,11 @@ namespace FineUIPro.Web.common
|
||||
else
|
||||
{
|
||||
zlallNumber = (from x in Funs.DB.Check_CheckControl
|
||||
where pids.Contains(x.ProjectId)
|
||||
where pids.Contains(x.ProjectId)
|
||||
select x).Count().ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.Check_CheckControl
|
||||
where x.State == "7" && pids.Contains(x.ProjectId)
|
||||
where x.State == "7" && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
|
||||
zlfinishNumber = num2.ToString();
|
||||
@@ -755,7 +776,7 @@ namespace FineUIPro.Web.common
|
||||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true
|
||||
where (x.IsOnceQualified == null || x.IsOnceQualified == true)
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
@@ -771,7 +792,7 @@ namespace FineUIPro.Web.common
|
||||
zlgjallNumber = num1.ToString();
|
||||
|
||||
var num2 = (from x in Funs.DB.ProcessControl_InspectionManagement
|
||||
where x.IsOnceQualified == true && pids.Contains(x.ProjectId)
|
||||
where (x.IsOnceQualified == null || x.IsOnceQualified == true) && pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
zlgjfinishNumber = num2.ToString();
|
||||
|
||||
@@ -799,40 +820,83 @@ namespace FineUIPro.Web.common
|
||||
List<double> listdata = new List<double>();
|
||||
double result = 0;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New select x;
|
||||
var ndtLists = (from x in db.ProcessControl_NondestructiveTest_New select x).ToList();
|
||||
if (pids != null)
|
||||
{
|
||||
ndtLists = ndtLists.Where(x=>pids.Contains(x.ProjectId));
|
||||
ndtLists = ndtLists.Where(x => pids.Contains(x.ProjectId)).ToList();
|
||||
}
|
||||
decimal a = 0, b = 0;
|
||||
|
||||
var sumResult = ndtLists
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.Select(g => new {
|
||||
TotalQ = g.OrderByDescending(x => x.CreateDate)
|
||||
.Select(x => x.TotalQuantity)
|
||||
.FirstOrDefault(),
|
||||
Rate = g.OrderByDescending(x => x.CreateDate)
|
||||
.Select(x => x.TotalRate)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.Where(x => x.TotalQ.HasValue).ToList()
|
||||
.Select(x => new {
|
||||
A = Math.Floor(x.TotalQ.Value * (decimal.Parse(x.Rate)) / 100),
|
||||
B = x.TotalQ.Value
|
||||
});
|
||||
a = sumResult.Sum(x=>x.A);
|
||||
b = sumResult.Sum(x => x.B);
|
||||
if (ndtLists.Count > 0)
|
||||
{
|
||||
//取每个单位、专业最新的一条数据
|
||||
var datalist = ndtLists.GroupBy(r => new { r.UnitId, r.ProfessionalName }).Select(g => g.OrderByDescending(r => r.CreateDate).First()).ToList();
|
||||
foreach (var item in datalist)
|
||||
{
|
||||
if (item.TotalQuantity.HasValue)
|
||||
{
|
||||
a += Math.Floor(item.TotalQuantity.Value * Funs.GetNewDecimalOrZero(item.TotalRate) / 100);
|
||||
b += item.TotalQuantity.Value;
|
||||
}
|
||||
}
|
||||
result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// var hjglData =
|
||||
// (from x in db.HJGL_FL_Data
|
||||
// where x.ProjectId == ProjectId
|
||||
// orderby x.CompileDate descending
|
||||
// select x).FirstOrDefault();
|
||||
// if (hjglData != null)
|
||||
// {
|
||||
// a = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmQualifiedAmount);
|
||||
// b = Funs.GetNewDecimalOrZero(hjglData.OneTimeFilmAmount);
|
||||
// if (a > 0 && b > 0)
|
||||
// {
|
||||
// result = Convert.ToDouble(Convert.ToDecimal(100.0) * b / a);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (b > 0)
|
||||
{
|
||||
result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
||||
|
||||
hjallNumber = b.ToString();
|
||||
hjfinishNumber = a.ToString();
|
||||
hjzgl = result.ToString();
|
||||
hjDataValue = (100 - result).ToString();
|
||||
}
|
||||
//var sumResult = ndtLists
|
||||
// .GroupBy(x => x.ProjectId)
|
||||
// .Select(g => new
|
||||
// {
|
||||
// TotalQ = g.OrderByDescending(x => x.CreateDate)
|
||||
// .Select(x => x.TotalQuantity)
|
||||
// .FirstOrDefault(),
|
||||
// Rate = g.OrderByDescending(x => x.CreateDate)
|
||||
// .Select(x => x.TotalRate)
|
||||
// .FirstOrDefault()
|
||||
// })
|
||||
// .Where(x => x.TotalQ.HasValue).ToList()
|
||||
// .Select(x => new
|
||||
// {
|
||||
// A = Math.Floor(x.TotalQ.Value * (decimal.Parse(x.Rate)) / 100),
|
||||
// B = x.TotalQ.Value
|
||||
// });
|
||||
//a = sumResult.Sum(x => x.A);
|
||||
//b = sumResult.Sum(x => x.B);
|
||||
|
||||
//if (b > 0)
|
||||
//{
|
||||
// result = Convert.ToDouble(decimal.Round(decimal.Parse((a / b * 100).ToString()), 2));
|
||||
|
||||
// hjallNumber = b.ToString();
|
||||
// hjfinishNumber = a.ToString();
|
||||
// hjzgl = result.ToString();
|
||||
// hjDataValue = (100 - result).ToString();
|
||||
//}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -906,7 +970,7 @@ namespace FineUIPro.Web.common
|
||||
var getallin = new List<Model.PageDataPersonInOutItem>();
|
||||
if (pids == null)
|
||||
{
|
||||
getallin = APIPageDataService.getPersonNum(new List<string>(),DateTime.Now);
|
||||
getallin = APIPageDataService.getPersonNum(new List<string>(), DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -928,8 +992,8 @@ namespace FineUIPro.Web.common
|
||||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
ProjectPersonCount += "'" + getallin.Count(x => x.ProjectId == item.ProjectId) + "',";
|
||||
}
|
||||
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
||||
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
||||
ProjectPersonMc = !string.IsNullOrWhiteSpace(ProjectPersonMc) ? ProjectPersonMc.TrimEnd(',') : string.Empty;
|
||||
ProjectPersonCount = !string.IsNullOrWhiteSpace(ProjectPersonCount) ? ProjectPersonCount.TrimEnd(',') : string.Empty;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
@@ -947,7 +1011,7 @@ namespace FineUIPro.Web.common
|
||||
foreach (var item in allProjects)
|
||||
{
|
||||
ProjectPersonMc += "'" + item.ShortName + "',";
|
||||
ProjectPersonCount += "'" + allperson.Count(x=>x.ProjectId==item.ProjectId) + "',";
|
||||
ProjectPersonCount += "'" + allperson.Count(x => x.ProjectId == item.ProjectId) + "',";
|
||||
}
|
||||
ProjectPersonMc = ProjectPersonMc.TrimEnd(',');
|
||||
ProjectPersonCount = ProjectPersonCount.TrimEnd(',');
|
||||
@@ -963,7 +1027,7 @@ namespace FineUIPro.Web.common
|
||||
var list = allProjects;
|
||||
if (list.Any())
|
||||
{
|
||||
var progressCompletions = from x in Funs.DB.JDGL_ProgressCompletion select x ;
|
||||
var progressCompletions = from x in Funs.DB.JDGL_ProgressCompletion select x;
|
||||
foreach (var item in list)
|
||||
{
|
||||
var pCs = progressCompletions.Where(x => x.ProjectId == item.ProjectId).ToList();
|
||||
@@ -989,7 +1053,7 @@ namespace FineUIPro.Web.common
|
||||
div_zgwwc.InnerHtml = GeneralNotClosedNum.ToString();
|
||||
div_zgwcl.InnerHtml = (100.0 * GeneralClosedNum / (GeneralNotClosedNum + GeneralClosedNum)).ToString("0.##") + "%";
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1112,13 +1176,11 @@ namespace FineUIPro.Web.common
|
||||
#endregion
|
||||
|
||||
#region 设备材料
|
||||
sbclHtml += " <div class=\"row\">";
|
||||
pname = item.ShortName;
|
||||
if (item.ShortName.Length > 5)
|
||||
{
|
||||
pname = item.ShortName.Substring(0, 5) + "...";
|
||||
}
|
||||
sbclHtml += "<div class=\"th-p\" title=\"" + item.ShortName + "\">" + pname + "</div>";
|
||||
//采购量
|
||||
var SbcllCglList = SbclList.Where(x => x.ProjectId == pid).ToList();
|
||||
double SbcllCgl = 0.0;
|
||||
@@ -1137,6 +1199,8 @@ namespace FineUIPro.Web.common
|
||||
}
|
||||
}
|
||||
|
||||
sbclHtml += "<div class=\"row\">";
|
||||
sbclHtml += "<div class=\"th-p\" title=\"" + item.ShortName + "\">" + pname + "</div>";
|
||||
sbclHtml += "<div class=\"th-p\">" + SbcllCgl + "</div>";
|
||||
sbclHtml += "<div class=\"th-p\">" + Sbdhs + "</div>";
|
||||
//百分比
|
||||
@@ -1149,10 +1213,6 @@ namespace FineUIPro.Web.common
|
||||
{
|
||||
sbclHtml += "<div class=\"th-p\">0%</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sbclHtml += " </div>";
|
||||
#endregion
|
||||
}
|
||||
@@ -1165,7 +1225,8 @@ namespace FineUIPro.Web.common
|
||||
/// <returns></returns>
|
||||
private int GetNearMissNum()
|
||||
{
|
||||
string cacheKey = "NearMissNum_" + string.Join("_",pids);
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string cacheKey = "NearMissNum_" + string.Join("_", pids);
|
||||
var memoryCache = MemoryCache.Default;
|
||||
if (memoryCache.Get(cacheKey) != null)
|
||||
{
|
||||
@@ -1174,18 +1235,36 @@ namespace FineUIPro.Web.common
|
||||
int result = 0;
|
||||
if (pids == null)
|
||||
{
|
||||
result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂")
|
||||
select x;
|
||||
var wsAccidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂")
|
||||
select x;
|
||||
result = wsAccidentList1.Count() + wsAccidentList2.Count();
|
||||
//result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
// join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
// where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
// select x).Count();
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
|
||||
join y in db.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
where y.AccidentTypeName.Contains("未遂") && pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
var wsAccidentList2 = from x in db.Accident_AccidentReportOther
|
||||
join y in db.Sys_Const on x.AccidentTypeId equals y.ConstValue
|
||||
where y.ConstText.Contains("未遂") && pids.Contains(x.ProjectId)
|
||||
select x;
|
||||
result = wsAccidentList1.Count() + wsAccidentList2.Count();
|
||||
//result = (from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
// join y in Funs.DB.Base_AccidentType on x.AccidentTypeId equals y.AccidentTypeId
|
||||
// where x.IsAttempt == "1" && x.CompileDate > Const.DtmarkTime
|
||||
// && pids.Contains(x.ProjectId)
|
||||
// select x).Count();
|
||||
}
|
||||
|
||||
var policy = new CacheItemPolicy
|
||||
@@ -1210,6 +1289,7 @@ namespace FineUIPro.Web.common
|
||||
OnePassRateOfWelding = Resources.Lan.OnePassRateOfWelding;
|
||||
total = Resources.Lan.total;
|
||||
completed = Resources.Lan.completed;
|
||||
qualified = Resources.Lan.qualified;
|
||||
mainI_progressStatistics = Resources.Lan.mainI_progressStatistics;
|
||||
Percentage_of_progress = Resources.Lan.Percentage_of_progress;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user