提交代码

This commit is contained in:
高飞 2025-02-14 15:21:20 +08:00
parent d7098ea006
commit 8039877553
4 changed files with 88 additions and 59 deletions

View File

@ -19357,7 +19357,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -11,7 +11,7 @@
<FineUIPro DebugMode="true" Theme="Cupertino"/>
<appSettings>
<!--连接字符串-->
<add key="ConnectionString" value="Server=.\SQL2012;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>
<!--<add key="ConnectionString" value="Server=.\MSSQLSERVER01;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200"/>-->
<!--系统名称-->
<add key="SystemName" value="智慧施工管理信息系统V1.0"/>

View File

@ -481,7 +481,7 @@ namespace FineUIPro.Web.common
/// <returns></returns>
protected int GetSuperCompletedNum()
{
var result = Project_HSSEData_HSSEService.GetSuperCompletedNum(ProjectId);
var result = Project_HSSEData_HSSEService.GetSuperFinishedNum(ProjectId);
return result;
}

View File

@ -24,15 +24,16 @@ namespace FineUIPro.Web.common
{
pids = CurrUser.CompanyProjectId.Split(',');
}
else {
else
{
//加载所有在建项目的数据
var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x=>x.ProjectId).ToArray();
if (pidArray.Length>0)
var pidArray = Funs.DB.Base_Project.Where(x => x.ProjectState == "1").Select(x => x.ProjectId).ToArray();
if (pidArray.Length > 0)
{
pids = pidArray;
}
}
//未遂事故
var wsAccidentList1 = from x in db.Accident_AccidentPersonRecord
@ -52,21 +53,23 @@ namespace FineUIPro.Web.common
{
countAqrgsSum = CountAqrgs();
}
else {
countAqrgsSum = CountAqrgs(null,null,pids);
else
{
countAqrgsSum = CountAqrgs(null, null, pids);
}
if (countAqrgsSum > 10000)
{
countAqrgsSum = countAqrgsSum / Convert.ToDecimal(10000.00);
this.divSafeWorkTime.InnerHtml = Math.Round(countAqrgsSum, 2).ToString() + "万";
}
else {
else
{
this.divSafeWorkTime.InnerHtml = countAqrgsSum.ToString().Split('.')[0];
}
//本月安全人工时
//int wHoursMonth = 0;
@ -85,7 +88,7 @@ namespace FineUIPro.Web.common
}
else
{
countMonthAqrgs = CountAqrgs(d1, d2,pids);
countMonthAqrgs = CountAqrgs(d1, d2, pids);
}
if (countMonthAqrgs > 10000)
{
@ -93,7 +96,8 @@ namespace FineUIPro.Web.common
this.divSafeWorkTimeMonth.InnerHtml = Math.Round(countMonthAqrgs, 2).ToString() + "万";
}
else {
else
{
this.divSafeWorkTimeMonth.InnerHtml = CountAqrgs(d1, d2).ToString().Split('.')[0];
}
@ -113,11 +117,12 @@ namespace FineUIPro.Web.common
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)).ToList().Count;
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
}
else {
getTrainRecord = db.EduTrain_TrainRecord.Where(x=>pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0;
else
{
getTrainRecord = db.EduTrain_TrainRecord.Where(x => pids.Contains(x.ProjectId)).Sum(x => x.TrainPersonNum) ?? 0;
//修改:增加博晟教育中的人数
boShengCount = db.Bo_Sheng_TrainPerson.Where(x => (x.DeleteTag == "False" || x.DeleteTag == null)
&& pids.Contains(x.ProjectId) ).ToList().Count;
&& pids.Contains(x.ProjectId)).ToList().Count;
this.divSafePersonNum.InnerHtml = (getTrainRecord + boShengCount).ToString();
}
@ -137,7 +142,8 @@ namespace FineUIPro.Web.common
select x;
this.divSafeManagePersonNum.InnerText = glAllPerson.Count().ToString();
}
else {
else
{
//安全管理人员
var allSum = from x in Funs.DB.SitePerson_Person
where x.IsUsed == true && x.InTime < DateTime.Now && (x.OutTime == null || x.OutTime > DateTime.Now)
@ -174,11 +180,12 @@ namespace FineUIPro.Web.common
select x).Count();
divCqmsPxNum.InnerText = CqmsPxNum.ToString();
}
else {
else
{
CqmsManageNum = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId)
select x).Count();
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.IsUsed == true && y.IsCQMS == true && pids.Contains(x.ProjectId)
select x).Count();
this.divCqmsManageNum.InnerText = CqmsManageNum.ToString();
CqmsPxNum = (from x in Funs.DB.Comprehensive_InspectionPerson
@ -193,10 +200,11 @@ namespace FineUIPro.Web.common
{
allProjects = ProjectService.GetAllProjectDropDownList();
}
else {
else
{
allProjects = ProjectService.GetAllProjectDropDownList(pids);
}
int acount = allProjects.Count();
int pcount1 = 0;
int pcount2 = 0;
@ -205,10 +213,12 @@ namespace FineUIPro.Web.common
{
pcount1 = allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Count();
var pidzjsg = string.Join(",", allProjects.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).Select(x => x.ProjectId)).Split(',');
if (pids == null) {
if (pids == null)
{
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pidzjsg.Contains(x.ProjectId) select x).Count();
}
else {
else
{
pidzjsg = pids;
pcount2 = (from x in Funs.DB.SitePerson_Person where x.IsUsed == true && pids.Contains(x.ProjectId) select x).Count();
}
@ -279,7 +289,7 @@ namespace FineUIPro.Web.common
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null,string[] pids =null)
protected decimal CountAqrgs(DateTime? d1 = null, DateTime? d2 = null, string[] pids = null)
{
decimal cout1 = 0;
@ -288,12 +298,13 @@ namespace FineUIPro.Web.common
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
select x;
if (pids != null) {
if (pids != null)
{
getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
where pids.Contains(x.ProjectId)
select x;
}
if (getAllPersonInOutList.Count() > 0)
if (getAllPersonInOutList.Count() > 0)
{
if (datetime1.HasValue)
{
@ -305,7 +316,16 @@ namespace FineUIPro.Web.common
}
if (getAllPersonInOutList.Count() > 0)
{
cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours);
//cout1 = getAllPersonInOutList.Sum(x => (long)x.WorkHours);
foreach (var pid in pids)
{
var q1 = getAllPersonInOutList.Where(x => x.ProjectId == pid).OrderByDescending(x => x.InOutDate);
var q2 = getAllPersonInOutList.Where(x => x.ProjectId == pid).OrderBy(x => x.InOutDate);
if (q1.Count() > 0)
{
cout1 += (q1.First().WorkHours ?? 0) - (q2.First().WorkHours ?? 0);
}
}
}
}
@ -318,15 +338,15 @@ namespace FineUIPro.Web.common
where y.ProjectState == Const.ProjectState_1
select x;
if (pids!=null)
if (pids != null)
{
getD1 = from x in Funs.DB.Accident_AccidentHandle
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x;
getD2 = from x in Funs.DB.Accident_AccidentReport
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where pids.Contains(x.ProjectId)
where pids.Contains(x.ProjectId)
select x;
}
@ -716,7 +736,8 @@ namespace FineUIPro.Web.common
zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
}
else {
else
{
zlallNumber = (from x in Funs.DB.Check_CheckControl
where x.CheckDate <= DateTime.Now && pids.Contains(x.ProjectId)
select x).Count().ToString();
@ -736,7 +757,7 @@ namespace FineUIPro.Web.common
zgzglDataValue = (100 - (100.0 * num2 / (num2 + num3))).ToString();
}
}
#endregion
@ -764,7 +785,8 @@ namespace FineUIPro.Web.common
zlgjzgl = zgl.ToString();
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
}
else {
else
{
var num1 = (from x in Funs.DB.ProcessControl_InspectionManagement
where pids.Contains(x.ProjectId)
select x).Count();
@ -780,7 +802,7 @@ namespace FineUIPro.Web.common
zlgjzgl = zgl.ToString();
zggjzglDataValue = (100 - (100.0 * num2 / num1)).ToString();
}
}
#endregion
@ -799,7 +821,7 @@ namespace FineUIPro.Web.common
double result = 0;
Model.SGGLDB db = Funs.DB;
var ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" select x;
if (pids!=null)
if (pids != null)
{
ndtLists = from x in db.ProcessControl_NondestructiveTest_New where x.ProfessionalName == "工艺管道" && pids.Contains(x.ProjectId) select x;
}
@ -886,7 +908,8 @@ namespace FineUIPro.Web.common
select x).Count();
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
}
else {
else
{
//Check_JointCheck
var znum = (from x in Funs.DB.GJSX
where pids.Contains(x.ProjectId)
@ -913,7 +936,7 @@ namespace FineUIPro.Web.common
select x).Count();
gjsxZdl = Math.Round((100.0 * ywcnum / znum), 2).ToString();
}
}
#endregion
@ -928,8 +951,9 @@ namespace FineUIPro.Web.common
{
getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now);
}
else {
getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now,pids);
else
{
getallin = APIPageDataService.getPersonNumByCompany(DateTime.Now, pids);
}
AllCount = getallin.Count();
if (AllCount > 0)
@ -954,13 +978,14 @@ namespace FineUIPro.Web.common
var list = new List<Model.Base_Project>();
if (pids == null)
{
list= Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null)).ToList();
}
else {
else
{
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId)).ToList();
}
foreach (var item in list)
{
ProjectPersonMc += "'" + item.ShortName + "',";
@ -981,10 +1006,11 @@ namespace FineUIPro.Web.common
{
list = Funs.DB.Base_Project.Where(x => (x.ProjectState == Const.ProjectState_1 || x.ProjectState == null) && x.Progress != null).ToList();
}
else {
else
{
list = Funs.DB.Base_Project.Where(x => pids.Contains(x.ProjectId) && x.Progress != null).ToList();
}
if (list.Count>0)
if (list.Count > 0)
{
foreach (var item in list)
{
@ -994,7 +1020,7 @@ namespace FineUIPro.Web.common
ProjectJd = ProjectJd.TrimEnd(',');
ProjectMc = ProjectMc.TrimEnd(',');
}
}
#endregion
@ -1011,28 +1037,29 @@ namespace FineUIPro.Web.common
/// 获取隐患整改闭环项
/// </summary>
/// <returns></returns>
public int GetGeneralClosedNum()
public int GetGeneralClosedNum()
{
int result = 0;
if (pids==null)
if (pids == null)
{
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.States == "3"
select x).Count();
}
else {
else
{
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.States == "3" && pids.Contains(x.ProjectId)
select x).Count();
}
return result;
}
/// <summary>
/// 获取隐患未整改完成项
/// </summary>
/// <returns></returns>
public int GetGeneralNotClosedNum()
public int GetGeneralNotClosedNum()
{
int result = 0;
if (pids == null)
@ -1041,12 +1068,13 @@ namespace FineUIPro.Web.common
where x.States != "3"
select x).Count();
}
else {
else
{
result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.States != "3" && pids.Contains(x.ProjectId)
select x).Count();
}
return result;
}
#endregion
@ -1192,7 +1220,7 @@ namespace FineUIPro.Web.common
/// 获取未遂事件数
/// </summary>
/// <returns></returns>
private int GetNearMissNum()
private int GetNearMissNum()
{
if (pids == null)
{
@ -1202,7 +1230,8 @@ namespace FineUIPro.Web.common
select x).Count();
return result;
}
else {
else
{
var 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
@ -1210,7 +1239,7 @@ namespace FineUIPro.Web.common
select x).Count();
return result;
}
}
}
}