集团大屏数据
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,14 +5,14 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Net.PeerToPeer;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class HJGLData_HJGLService
|
||||
{
|
||||
public static SGGLDB db = Funs.DB;
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Where(x => (x.ProjectAttribute == "GONGCHENG" || x.ProjectAttribute == null)).Select(x => x.ProjectId).ToList();
|
||||
|
||||
#region 获取列表
|
||||
|
||||
@@ -49,22 +49,22 @@ namespace BLL
|
||||
if (count == 0) return null;
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.WelderNum,
|
||||
x.TotalDineNum,
|
||||
x.CompleteDineNum,
|
||||
x.TotalFilmNum,
|
||||
x.OKFilmNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
};
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.UnitId,
|
||||
x.CollCropCode,
|
||||
x.UnitName,
|
||||
x.ReportDate,
|
||||
x.WelderNum,
|
||||
x.TotalDineNum,
|
||||
x.CompleteDineNum,
|
||||
x.TotalFilmNum,
|
||||
x.OKFilmNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
};
|
||||
}
|
||||
|
||||
#endregion 获取列表
|
||||
@@ -91,8 +91,8 @@ namespace BLL
|
||||
};
|
||||
db.HJGLData_HJGL.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteHJGLData_HJGLById(string Id)
|
||||
@@ -106,7 +106,7 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static HJGLData_HJGL GetHJGLData_HJGLById(string Id)
|
||||
@@ -155,82 +155,27 @@ namespace BLL
|
||||
return data;
|
||||
}
|
||||
|
||||
public static HJGLData GetTodayHJGLData_HJGL()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
if (CommonService.GetIsThisUnit().CollCropCode== "91410200170644116B")
|
||||
{
|
||||
return GetELECLTodayHJGLData_HJGL();
|
||||
}
|
||||
if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881")
|
||||
{
|
||||
return GetCNCEC_16TodayHJGLData_HJGL();
|
||||
|
||||
}
|
||||
var q = GetTodayData();
|
||||
if (q != null && q.State == Const.CNCEC_State_S)
|
||||
data = StatisticalData();
|
||||
else
|
||||
data = StatisticalData();
|
||||
return data;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取十一化建焊接数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static HJGLData GetELECLTodayHJGLData_HJGL()
|
||||
public static async Task<HJGLData> GetTodayHJGLData_HJGLAsync()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
string baseurl = "http://36.99.162.230:9493/sgglapi/api/CNCECServer/PostGetHJGLData";
|
||||
string token = Const.sysglyId;
|
||||
string response = Funs.RequestPost(baseurl, token, "");
|
||||
var json = JsonConvert.DeserializeObject(response) as JObject;
|
||||
if (json != null && json["code"]?.ToString()=="1")
|
||||
{
|
||||
var str = json["data"]?.ToString();
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
}
|
||||
return data;
|
||||
/* var q = GetTodayData();
|
||||
if (q != null && q.State == Const.CNCEC_State_S)
|
||||
data = StatisticalData();
|
||||
else
|
||||
data = StatisticalData();*/
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取十六化建焊接数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static HJGLData GetCNCEC_16TodayHJGLData_HJGL()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
string baseurl = "https://aq.cncec16.com.cn/hjglWebApi/api/CNCECServer/PostGetHJGLData";
|
||||
string token = Const.sysglyId;
|
||||
string response = Funs.RequestPost(baseurl, token, "");
|
||||
if (string.IsNullOrEmpty(response))
|
||||
{
|
||||
try
|
||||
{
|
||||
baseurl = "http://192.168.1.8/hjglwebapi/api/CNCECServer/PostGetHJGLData";
|
||||
response = Funs.RequestPost(baseurl, token, "");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
var json = JsonConvert.DeserializeObject(response) as JObject;
|
||||
if (json != null && json["code"]?.ToString() == "1")
|
||||
{
|
||||
var str = json["data"]?.ToString();
|
||||
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
|
||||
}
|
||||
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response);
|
||||
var modelTask = StatisticalDataAsync();
|
||||
var model = await modelTask;
|
||||
data = model;
|
||||
return data;
|
||||
}
|
||||
|
||||
public static HJGLData_HJGL GetTodayData()
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).FirstOrDefault();
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static HJGLData_HJGL GetSubUnitHjglDataByDate(string Unitid, DateTime? reportdate)
|
||||
@@ -244,7 +189,7 @@ namespace BLL
|
||||
var baseUnit = UnitService.GetUnitByUnitId(Unitid);
|
||||
var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate == reportdate && projectlist.Select(e => e.ProjectId).Contains(x.ProjectId)
|
||||
select x).ToList();
|
||||
select x).ToList();
|
||||
result = new HJGLData_HJGL
|
||||
{
|
||||
UnitId = Unitid,
|
||||
@@ -259,7 +204,7 @@ namespace BLL
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
public static void UpdateTodyData_State()
|
||||
{
|
||||
@@ -275,8 +220,8 @@ namespace BLL
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
|
||||
select x).ToList();
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < dateTime.Date.AddDays(1).Date
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0) result = true;
|
||||
return result;
|
||||
}
|
||||
@@ -289,8 +234,8 @@ namespace BLL
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
if (q.Count > 0) result = true;
|
||||
return result;
|
||||
}
|
||||
@@ -304,18 +249,31 @@ namespace BLL
|
||||
return responeData;
|
||||
}
|
||||
|
||||
public static HJGLData StatisticalData()
|
||||
public static async Task<HJGLData> StatisticalDataAsync()
|
||||
{
|
||||
var data = new HJGLData();
|
||||
var thisUnitId = string.Empty;
|
||||
var thisUnit = CommonService.GetIsThisUnit();
|
||||
if (thisUnit != null) thisUnitId = thisUnit.UnitId;
|
||||
var baseUnit = UnitService.GetUnitByUnitId(thisUnitId);
|
||||
var ProjectData = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
|
||||
select x).ToList();
|
||||
Project_HJGLData_HJGLService.StatisticalAllProjectData();
|
||||
Project_HJGLData_DefectService.StatisticalAllProjectData();
|
||||
// 并行执行异步方法
|
||||
var welderNumTask = HJGLData_HJGLService.GetWelderNumAsync(); //获取焊工总数
|
||||
var dineInfoListTask = HJGLData_HJGLService.GetDineInfoAsync(); //获达因数信息
|
||||
var chCheckItemListTask = HJGLData_HJGLService.GetCHCheckItemAsync(); //获取焊接检查信息
|
||||
|
||||
// 等待所有异步方法执行完成
|
||||
await Task.WhenAll(
|
||||
welderNumTask,
|
||||
dineInfoListTask,
|
||||
chCheckItemListTask
|
||||
);
|
||||
|
||||
// 统一获取异步方法的返回值
|
||||
var welderNum = await welderNumTask;
|
||||
var dineInfoList = await dineInfoListTask;
|
||||
var chCheckItemList = await chCheckItemListTask;
|
||||
|
||||
|
||||
var table = new HJGLData_HJGL
|
||||
{
|
||||
@@ -323,14 +281,69 @@ namespace BLL
|
||||
CollCropCode = baseUnit.CollCropCode,
|
||||
UnitName = baseUnit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
WelderNum = ProjectData.Sum(x => x.WelderNum),
|
||||
TotalDineNum = ProjectData.Sum(x => x.TotalDineNum),
|
||||
CompleteDineNum = ProjectData.Sum(x => x.CompleteDineNum),
|
||||
TotalFilmNum = ProjectData.Sum(x => x.TotalFilmNum),
|
||||
OKFilmNum = ProjectData.Sum(x => x.OKFilmNum),
|
||||
WelderNum = welderNum.Count(),
|
||||
TotalDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.Size)),
|
||||
CompleteDineNum = Convert.ToInt32(dineInfoList.Sum(x => x.DoneDin)),
|
||||
TotalFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_TotalFilm)),
|
||||
OKFilmNum = Convert.ToInt32(chCheckItemList.Sum(x => x.CHT_PassFilm)),
|
||||
CreateMan = Const.sysglyId,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
|
||||
Project_HJGLData_HJGLService.DeleteProject_HJGLData_HJGLByDate(DateTime.Now.Date);
|
||||
// 预先对 dineInfoList 和 chCheckItemList 按 ProjectId 进行分组
|
||||
var dineInfoDict = dineInfoList
|
||||
.Where(x => BeUnderConstructionList.Contains(x.ProjectId))
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(g => g.Key, g => new
|
||||
{
|
||||
TotalDineNum = g.Sum(x => x.Size),
|
||||
CompleteDineNum = g.Sum(x => x.DoneDin)
|
||||
});
|
||||
|
||||
var chCheckItemDict = chCheckItemList
|
||||
.Where(x => BeUnderConstructionList.Contains(x.ProjectId))
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(g => g.Key, g => new
|
||||
{
|
||||
TotalFilmNum = g.Sum(x => x.CHT_TotalFilm),
|
||||
OKFilmNum = g.Sum(x => x.CHT_PassFilm)
|
||||
});
|
||||
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
// 获取焊工数量
|
||||
int welderCount = welderNum.Count(x => x.ProjectId == projectid);
|
||||
|
||||
// 获取达因信息
|
||||
var dineInfo = dineInfoDict.TryGetValue(projectid, out var dineData)
|
||||
? dineData
|
||||
: new { TotalDineNum = (decimal?)0, CompleteDineNum = (decimal?)0 };
|
||||
|
||||
// 获取拍片信息
|
||||
var chCheckItem = chCheckItemDict.TryGetValue(projectid, out var checkData)
|
||||
? checkData
|
||||
: new { TotalFilmNum = (int?)0, OKFilmNum = (int?)0 };
|
||||
|
||||
var projectCqmsData = new Project_HJGLData_HJGL()
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
ProjectId = projectid,
|
||||
UnitId = thisUnitId,
|
||||
CollCropCode = baseUnit.CollCropCode,
|
||||
UnitName = baseUnit.UnitName,
|
||||
ReportDate = DateTime.Now.Date,
|
||||
WelderNum = welderCount,
|
||||
TotalDineNum = Convert.ToInt32(dineInfo.TotalDineNum),
|
||||
CompleteDineNum = Convert.ToInt32(dineInfo.CompleteDineNum),
|
||||
TotalFilmNum = chCheckItem.TotalFilmNum,
|
||||
OKFilmNum = chCheckItem.OKFilmNum,
|
||||
};
|
||||
|
||||
Project_HJGLData_HJGLService.AddProject_HJGLData_HJGL(projectCqmsData);
|
||||
}
|
||||
|
||||
|
||||
if (IsReportByToday())
|
||||
{
|
||||
table.Id = GetTodayData().Id;
|
||||
@@ -364,7 +377,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
public static void UpdateHJGLData_HJGL(HJGLData_HJGL newtable)
|
||||
{
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
@@ -385,8 +398,86 @@ namespace BLL
|
||||
table.CreateDate = newtable.CreateDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取焊工总数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<WelderOutput> GetWelderNum()
|
||||
{
|
||||
var result = (from x in Funs.DB.BS_Welder
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.WED_IfOnGuard == true
|
||||
select new Model.WelderOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
UnitId = x.WED_Unit,
|
||||
WEDCode = x.WED_Code,
|
||||
WEDName = x.WED_Name
|
||||
//UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊工总数(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<WelderOutput>> GetWelderNumAsync()
|
||||
{
|
||||
return await Task.Run(GetWelderNum);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取总达因数和完成达因数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<WeldDineOutput> GetDineInfo()
|
||||
{
|
||||
var result = (from x in Funs.DB.HJGL_FL_TotalQuantity
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
group x by x.ProjectId into g
|
||||
select new Model.WeldDineOutput()
|
||||
{
|
||||
ProjectId = g.Key,
|
||||
Size = g.Sum(x => Convert.ToDecimal(!string.IsNullOrEmpty(x.TotalWeldQuantity) ? Convert.ToDecimal(x.TotalWeldQuantity) : 0)),
|
||||
DoneDin = g.Sum(x => Convert.ToDecimal(!string.IsNullOrEmpty(x.TotalCompleted) ? Convert.ToDecimal(x.TotalCompleted) : 0))
|
||||
});
|
||||
return result;
|
||||
}
|
||||
public static async Task<IEnumerable<WeldDineOutput>> GetDineInfoAsync()
|
||||
{
|
||||
return await Task.Run(GetDineInfo);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊接检查信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<CHCheckItemOutput> GetCHCheckItem()
|
||||
{
|
||||
var result = (from x in Funs.DB.CH_CheckItem
|
||||
join y in Funs.DB.CH_Check on x.CHT_CheckID equals y.CHT_CheckID
|
||||
where BeUnderConstructionList.Contains(y.ProjectId)
|
||||
select new Model.CHCheckItemOutput()
|
||||
{
|
||||
Id = x.CHT_CheckItemID,
|
||||
ProjectId = y.ProjectId,
|
||||
UnitId = y.UnitId,
|
||||
CHT_TotalFilm = x.CHT_TotalFilm,
|
||||
CHT_PassFilm = x.CHT_PassFilm
|
||||
//UnitName = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取焊接检查信息(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<CHCheckItemOutput>> GetCHCheckItemAsync()
|
||||
{
|
||||
return await Task.Run(GetCHCheckItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using System.Web.UI.WebControls;
|
||||
using Aspose.Words.Lists;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace BLL
|
||||
{
|
||||
public static SGGLDB Db = Funs.DB;
|
||||
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Where(x=> (x.ProjectAttribute == "GONGCHENG" || x.ProjectAttribute == null)).Select(x => x.ProjectId).ToList();
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Where(x => (x.ProjectAttribute == "GONGCHENG" || x.ProjectAttribute == null)).Select(x => x.ProjectId).ToList();
|
||||
|
||||
public static void AddHSSEData_HSSE(HSSEData_HSSE newtable)
|
||||
{
|
||||
@@ -40,6 +40,7 @@ namespace BLL
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
HseTechnicalNum = newtable.HseTechnicalNum,
|
||||
EnvironmentalTrainNum = newtable.EnvironmentalTrainNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -75,10 +76,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
ProjectDrillPersonNum = newtable.ProjectDrillPersonNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
@@ -97,10 +100,12 @@ namespace BLL
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
ArgumentNum = newtable.ArgumentNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
SuperArgumentNum = newtable.SuperArgumentNum,
|
||||
State = newtable.State,
|
||||
CreateDate = newtable.CreateDate,
|
||||
CreateMan = newtable.CreateMan
|
||||
@@ -148,6 +153,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -158,6 +164,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -183,6 +190,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -203,6 +211,7 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
@@ -210,6 +219,7 @@ namespace BLL
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
item.TrainPersonNum = dataHsse.TrainPersonNum;
|
||||
@@ -253,6 +263,7 @@ namespace BLL
|
||||
item.CompanyComprehensiveCheckNum = dataHsse.CompanyComprehensiveCheckNum;
|
||||
item.CompanyComprehensivePlanNum = dataHsse.CompanyComprehensivePlanNum;
|
||||
item.CompanyDrillNum = dataHsse.CompanyDrillNum;
|
||||
item.CompanyDrillPersonNum = dataHsse.CompanyDrillPersonNum;
|
||||
item.CompanyLeadShiftCheckNum = dataHsse.CompanyLeadShiftCheckNum;
|
||||
item.CompanyOnSiteDisposalPlan = dataHsse.CompanyOnSiteDisposalPlan;
|
||||
item.CompanySpecialCheckNum = dataHsse.CompanySpecialCheckNum;
|
||||
@@ -263,6 +274,7 @@ namespace BLL
|
||||
item.CostUse = dataHsse.CostUse;
|
||||
item.EnterpriseTopicsMeetingNum = dataHsse.EnterpriseTopicsMeetingNum;
|
||||
item.FinishedNum = dataHsse.FinishedNum;
|
||||
item.ArgumentNum = dataHsse.ArgumentNum;
|
||||
item.GeneralAccidentNum = dataHsse.GeneralAccidentNum;
|
||||
item.GeneralClosedNum = dataHsse.GeneralClosedNum;
|
||||
item.GeneralNotClosedNum = dataHsse.GeneralNotClosedNum;
|
||||
@@ -288,6 +300,7 @@ namespace BLL
|
||||
item.NewWaterConsumption = dataHsse.NewWaterConsumption;
|
||||
item.ProjectComprehensivePlanNum = dataHsse.ProjectComprehensivePlanNum;
|
||||
item.ProjectDrillNum = dataHsse.ProjectDrillNum;
|
||||
item.ProjectDrillPersonNum = dataHsse.ProjectDrillPersonNum;
|
||||
item.ProjectFullTimeNum = dataHsse.ProjectFullTimeNum;
|
||||
item.ProjectInspectorGeneralNum = dataHsse.ProjectInspectorGeneralNum;
|
||||
item.ProjectLeadShiftCheckNum = dataHsse.ProjectLeadShiftCheckNum;
|
||||
@@ -308,12 +321,14 @@ namespace BLL
|
||||
item.ShutdownNum = dataHsse.ShutdownNum;
|
||||
item.SpecialEquipmentNum = dataHsse.SpecialEquipmentNum;
|
||||
item.SpecialOperationTrainNum = dataHsse.SpecialOperationTrainNum;
|
||||
item.HseTechnicalNum = dataHsse.HseTechnicalNum;
|
||||
item.EnvironmentalTrainNum = dataHsse.EnvironmentalTrainNum;
|
||||
item.SpecialSeriousAccidentNum = dataHsse.SpecialSeriousAccidentNum;
|
||||
item.SpecialTrainNum = dataHsse.SpecialTrainNum;
|
||||
item.SuperCompletedNum = dataHsse.SuperCompletedNum;
|
||||
item.SuperConstructionNum = dataHsse.SuperConstructionNum;
|
||||
item.SuperFinishedNum = dataHsse.SuperFinishedNum;
|
||||
item.SuperArgumentNum = dataHsse.SuperArgumentNum;
|
||||
item.SuperTrainPersonNum = dataHsse.SuperTrainPersonNum;
|
||||
item.TotalEnergyConsumption = dataHsse.TotalEnergyConsumption;
|
||||
item.TotalWorkingHour = dataHsse.TotalWorkingHour;
|
||||
@@ -341,13 +356,13 @@ namespace BLL
|
||||
}
|
||||
|
||||
public static async Task<HSSEData> GetTodayHSSEData_HSSE()
|
||||
{
|
||||
var modelTask= StatisticalDataAsync();
|
||||
var model=await modelTask;
|
||||
{
|
||||
var modelTask = StatisticalDataAsync();
|
||||
var model = await modelTask;
|
||||
HSSEData data = model;
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static HSSEData_HSSE GetTodayData()
|
||||
{
|
||||
var q = (from x in Funs.DB.HSSEData_HSSE
|
||||
@@ -602,7 +617,7 @@ namespace BLL
|
||||
|
||||
var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<HSSEData> StatisticalDataAsync()
|
||||
{
|
||||
@@ -633,6 +648,7 @@ namespace BLL
|
||||
var safeTrainTask = HSSEData_HSSEService.GetSafeTrainAsync();
|
||||
var specialTrainTask = HSSEData_HSSEService.GetSpecialTrainAsync();
|
||||
var specialOperationTrainTask = HSSEData_HSSEService.GetSpecialOperationTrainAsync();
|
||||
var hseTechnicalNumTask = HSSEData_HSSEService.GetHseTechnicalNumAsync();
|
||||
var headOfficeInspectorGeneralTask = HSSEData_HSSEService.GetHeadOfficeInspectorGeneralAsync();
|
||||
var headOfficeFullTimeTask = HSSEData_HSSEService.GetHeadOfficeFullTimeAsync();
|
||||
var branchInspectorGeneralTask = HSSEData_HSSEService.GetBranchInspectorGeneralAsync();
|
||||
@@ -690,7 +706,7 @@ namespace BLL
|
||||
safeWorkingHourTask,
|
||||
safeTrainTask,
|
||||
specialTrainTask,
|
||||
specialOperationTrainTask,
|
||||
specialOperationTrainTask, hseTechnicalNumTask,
|
||||
headOfficeInspectorGeneralTask,
|
||||
headOfficeFullTimeTask,
|
||||
branchInspectorGeneralTask,
|
||||
@@ -751,6 +767,7 @@ namespace BLL
|
||||
var safeTrainList = await safeTrainTask;
|
||||
var specialTrainList = await specialTrainTask;
|
||||
var specialOperationTrainList = await specialOperationTrainTask;
|
||||
var hseTechnicalNum = await hseTechnicalNumTask;
|
||||
var headOfficeInspectorGeneralList = await headOfficeInspectorGeneralTask;
|
||||
var headOfficeFullTimeList = await headOfficeFullTimeTask;
|
||||
var branchInspectorGeneralList = await branchInspectorGeneralTask;
|
||||
@@ -812,6 +829,7 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = totalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = incomeComprehensiveEnergyConsumption,
|
||||
@@ -843,10 +861,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = companySpecialPlanList.Count(),
|
||||
CompanyOnSiteDisposalPlan = companyOnSiteDisposalPlanList.Count(),
|
||||
CompanyDrillNum = companyDrillList.Count(),
|
||||
CompanyDrillPersonNum = companyDrillList.Sum(x => x.JointPersonNum),
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(),
|
||||
ProjectDrillNum = projectDrillList.Count(),
|
||||
ProjectDrillPersonNum = projectDrillList.Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(),
|
||||
@@ -865,16 +885,67 @@ namespace BLL
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum)
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperConstructionNum),
|
||||
SuperFinishedNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperFinishedNum),
|
||||
SuperArgumentNum = largeEngineeringOutputsTask.Result.Sum(x => x.SuperArgumentNum)
|
||||
};
|
||||
|
||||
#region 添加项目统计数据
|
||||
|
||||
Project_HSSEData_HSSEService.DeleteProject_HSSEData_HSSEByDate(DateTime.Now.Date);
|
||||
|
||||
var generalHiddenRectificationOutputsDict = generalHiddenRectificationOutputsList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var majorHiddenRectificationOutputsDict = majorHiddenRectificationOutputsList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new { ClosedNum = g.Sum(x => x.RecNum), NotClosedNum = g.Sum(x => x.NoRecNum) }
|
||||
);
|
||||
var securityRiskOutputList = securityRiskOutputListTask.Result;
|
||||
var securityRiskOutputDict = securityRiskOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
LowRiskNum = g.Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = g.Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = g.Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = g.Sum(x => x.HighRiskNum)
|
||||
}
|
||||
);
|
||||
var largeEngineeringOutputList = largeEngineeringOutputsTask.Result;
|
||||
var largeEngineeringOutputsDict = largeEngineeringOutputList
|
||||
.GroupBy(x => x.ProjectId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => new
|
||||
{
|
||||
CompletedNum = g.Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = g.Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = g.Sum(x => x.ConstructionNum),
|
||||
FinishedNum = g.Sum(x => x.FinishedNum),
|
||||
ArgumentNum = g.Sum(x => x.ArgumentNum),
|
||||
SuperCompletedNum = g.Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = g.Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = g.Sum(x => x.SuperConstructionNum),
|
||||
SuperArgumentNum = g.Sum(x => x.SuperArgumentNum)
|
||||
}
|
||||
);
|
||||
foreach (var projectid in BeUnderConstructionList)
|
||||
{
|
||||
generalHiddenRectificationOutputsDict.TryGetValue(projectid, out var generalHiddenRectificationOutputs);
|
||||
majorHiddenRectificationOutputsDict.TryGetValue(projectid, out var majorHiddenRectificationOutputs);
|
||||
securityRiskOutputDict.TryGetValue(projectid, out var securityRiskOutputs);
|
||||
largeEngineeringOutputsDict.TryGetValue(projectid, out var largeEngineeringOutputs);
|
||||
var projectHsseData = new Project_HSSEData_HSSE
|
||||
{
|
||||
Id = SQLHelper.GetNewID(),
|
||||
@@ -891,12 +962,13 @@ namespace BLL
|
||||
SafeTrainNum = safeTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialTrainNum = specialTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
SpecialOperationTrainNum = specialOperationTrainList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
HseTechnicalNum = hseTechnicalNum,
|
||||
EnvironmentalTrainNum = 0,
|
||||
TotalEnergyConsumption = 0,
|
||||
IncomeComprehensiveEnergyConsumption = 0,
|
||||
NewWaterConsumption = 0,
|
||||
HeadOfficeInspectorGeneralNum = 0,
|
||||
HeadOfficeFullTimeNum =0,
|
||||
HeadOfficeFullTimeNum = 0,
|
||||
BranchInspectorGeneralNum = 0,
|
||||
BranchFullTimeNum = 0,
|
||||
SafetyInjectionEngineer = safetyInjectionEngineerList.Count(x => x.ProjectId == projectid),
|
||||
@@ -923,33 +995,37 @@ namespace BLL
|
||||
SpecialSeriousAccidentNum = specialSeriousAccidentList.Count(x => x.ProjectId == projectid),
|
||||
CompanyComprehensivePlanNum = 0,
|
||||
CompanySpecialPlanNum = 0,
|
||||
CompanyOnSiteDisposalPlan =0,
|
||||
CompanyOnSiteDisposalPlan = 0,
|
||||
CompanyDrillNum = 0,
|
||||
CompanyDrillPersonNum = 0,
|
||||
ProjectComprehensivePlanNum = projectComprehensivePlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectSpecialPlanNum = projectSpecialPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectOnSiteDisposalPlan = projectOnSiteDisposalPlanList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillNum = projectDrillList.Count(x => x.ProjectId == projectid),
|
||||
ProjectDrillPersonNum = projectDrillList.Where(x => x.ProjectId == projectid).Sum(x => x.JointPersonNum),
|
||||
CostExtract = Convert.ToInt32(costExtract.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
CostUse = Convert.ToInt32(costUseList.Where(x => x.ProjectId == projectid).Sum(x => x.SUMCost)),
|
||||
UseEquipmentNum = useEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
SpecialEquipmentNum = specialEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
LicensesNum = licensesList.Count(x => x.ProjectId == projectid),
|
||||
LicensesCloseNum = licensesCloseList.Count(x => x.ProjectId == projectid),
|
||||
GeneralClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
MajorClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.RecNum),
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputsList.Where(x => x.ProjectId == projectid).Sum(x => x.NoRecNum),
|
||||
LowRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.LowRiskNum),
|
||||
GeneralRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.GeneralRiskNum),
|
||||
MediumRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.MediumRiskNum),
|
||||
HighRiskNum = securityRiskOutputListTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.HighRiskNum),
|
||||
CompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.CompletedNum),
|
||||
TrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
ConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.ConstructionNum),
|
||||
FinishedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.FinishedNum),
|
||||
SuperCompletedNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperCompletedNum),
|
||||
SuperTrainPersonNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperTrainPersonNum),
|
||||
SuperConstructionNum = largeEngineeringOutputsTask.Result.Where(x => x.ProjectId == projectid).Sum(x => x.SuperConstructionNum)
|
||||
GeneralClosedNum = generalHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
GeneralNotClosedNum = generalHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
MajorClosedNum = majorHiddenRectificationOutputs?.ClosedNum ?? 0,
|
||||
MajorNotClosedNum = majorHiddenRectificationOutputs?.NotClosedNum ?? 0,
|
||||
LowRiskNum = securityRiskOutputs?.LowRiskNum ?? 0,
|
||||
GeneralRiskNum = securityRiskOutputs?.GeneralRiskNum ?? 0,
|
||||
MediumRiskNum = securityRiskOutputs?.MediumRiskNum ?? 0,
|
||||
HighRiskNum = securityRiskOutputs?.HighRiskNum ?? 0,
|
||||
CompletedNum = largeEngineeringOutputs?.CompletedNum ?? 0,
|
||||
TrainPersonNum = largeEngineeringOutputs?.TrainPersonNum ?? 0,
|
||||
ConstructionNum = largeEngineeringOutputs?.ConstructionNum ?? 0,
|
||||
FinishedNum = largeEngineeringOutputs?.FinishedNum ?? 0,
|
||||
ArgumentNum = largeEngineeringOutputs?.ArgumentNum ?? 0,
|
||||
SuperCompletedNum = largeEngineeringOutputs?.SuperCompletedNum ?? 0,
|
||||
SuperTrainPersonNum = largeEngineeringOutputs?.SuperTrainPersonNum ?? 0,
|
||||
SuperConstructionNum = largeEngineeringOutputs?.SuperConstructionNum ?? 0,
|
||||
SuperArgumentNum = largeEngineeringOutputs?.SuperArgumentNum ?? 0
|
||||
};
|
||||
Project_HSSEData_HSSEService.AddProject_HSSEData_HSSE(projectHsseData);
|
||||
}
|
||||
@@ -1109,6 +1185,7 @@ namespace BLL
|
||||
table.SafeTrainNum = newtable.SafeTrainNum;
|
||||
table.SpecialTrainNum = newtable.SpecialTrainNum;
|
||||
table.SpecialOperationTrainNum = newtable.SpecialOperationTrainNum;
|
||||
table.HseTechnicalNum = newtable.HseTechnicalNum;
|
||||
table.EnvironmentalTrainNum = newtable.EnvironmentalTrainNum;
|
||||
table.TotalEnergyConsumption = newtable.TotalEnergyConsumption;
|
||||
table.IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption;
|
||||
@@ -1144,10 +1221,12 @@ namespace BLL
|
||||
table.CompanySpecialPlanNum = newtable.CompanySpecialPlanNum;
|
||||
table.CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan;
|
||||
table.CompanyDrillNum = newtable.CompanyDrillNum;
|
||||
table.CompanyDrillPersonNum = newtable.CompanyDrillPersonNum;
|
||||
table.ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum;
|
||||
table.ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum;
|
||||
table.ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan;
|
||||
table.ProjectDrillNum = newtable.ProjectDrillNum;
|
||||
table.ProjectDrillPersonNum = newtable.ProjectDrillPersonNum;
|
||||
table.CostExtract = newtable.CostExtract;
|
||||
table.CostUse = newtable.CostUse;
|
||||
table.UseEquipmentNum = newtable.UseEquipmentNum;
|
||||
@@ -1166,10 +1245,12 @@ namespace BLL
|
||||
table.TrainPersonNum = newtable.TrainPersonNum;
|
||||
table.ConstructionNum = newtable.ConstructionNum;
|
||||
table.FinishedNum = newtable.FinishedNum;
|
||||
table.ArgumentNum = newtable.ArgumentNum;
|
||||
table.SuperCompletedNum = newtable.SuperCompletedNum;
|
||||
table.SuperTrainPersonNum = newtable.SuperTrainPersonNum;
|
||||
table.SuperConstructionNum = newtable.SuperConstructionNum;
|
||||
table.SuperFinishedNum = newtable.SuperFinishedNum;
|
||||
table.SuperArgumentNum = newtable.SuperArgumentNum;
|
||||
table.State = newtable.State;
|
||||
table.CreateMan = newtable.CreateMan;
|
||||
table.CreateDate = newtable.CreateDate;
|
||||
@@ -1217,10 +1298,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeInspectorGeneralAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetHeadOfficeInspectorGeneral);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业总部专职人数
|
||||
@@ -1258,7 +1339,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetHeadOfficeFullTimeAsync()
|
||||
{
|
||||
return await Task.Run(GetHeadOfficeFullTime);
|
||||
return await Task.Run(GetHeadOfficeFullTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1297,7 +1378,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchFullTimeAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetBranchFullTime);
|
||||
}
|
||||
|
||||
@@ -1336,7 +1417,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetBranchInspectorGeneralAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetBranchInspectorGeneral);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1376,7 +1457,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectInspectorGeneralAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetProjectInspectorGeneral);
|
||||
}
|
||||
|
||||
@@ -1434,7 +1515,7 @@ namespace BLL
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
join post in Funs.DB.Base_WorkPost on x.WorkPostId equals post.WorkPostId into postGroup
|
||||
from post in postGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new Model.OfSafetySupervisorsOutput
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
@@ -1460,7 +1541,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetProjectSafetyMonitorAsync()
|
||||
{
|
||||
return await Task.Run(GetProjectSafetyMonitor);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1525,7 +1606,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetSafetyInjectionEngineerAsync()
|
||||
{
|
||||
return await Task.Run(GetSafetyInjectionEngineer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1585,7 +1666,7 @@ namespace BLL
|
||||
/// 获取A证人员(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateAAsync()
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateAAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateA);
|
||||
}
|
||||
@@ -1650,7 +1731,7 @@ namespace BLL
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateBAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateB);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1711,7 +1792,7 @@ namespace BLL
|
||||
/// 获取C证人员(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateCAsync()
|
||||
public static async Task<List<Model.OfSafetySupervisorsOutput>> GetCertificateCAsync()
|
||||
{
|
||||
return await Task.Run(GetCertificateC);
|
||||
}
|
||||
@@ -1722,29 +1803,29 @@ namespace BLL
|
||||
/// 获取企业安委会会数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<MeetingOutput> GetSafetyCommitteeMeeting()
|
||||
public static List<MeetingOutput> GetSafetyCommitteeMeeting()
|
||||
{
|
||||
var result =
|
||||
(from x in Funs.DB.Meeting_CompanySafetyMeeting
|
||||
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
select new MeetingOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = u.UnitName,
|
||||
Id = x.CompanySafetyMeetingId,
|
||||
MeetingName = x.CompanySafetyMeetingName,
|
||||
MeetingDate = x.CompanySafetyMeetingDate,
|
||||
MeetingHours = x.MeetingHours,
|
||||
HostMan = x.MeetingHostMan,
|
||||
AttentPerson = x.AttentPerson,
|
||||
AttentPersonNum = x.AttentPersonNum,
|
||||
});
|
||||
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
select new MeetingOutput()
|
||||
{
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = u.UnitName,
|
||||
Id = x.CompanySafetyMeetingId,
|
||||
MeetingName = x.CompanySafetyMeetingName,
|
||||
MeetingDate = x.CompanySafetyMeetingDate,
|
||||
MeetingHours = x.MeetingHours,
|
||||
HostMan = x.MeetingHostMan,
|
||||
AttentPerson = x.AttentPerson,
|
||||
AttentPersonNum = x.AttentPersonNum,
|
||||
});
|
||||
return result.ToList();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1775,7 +1856,7 @@ namespace BLL
|
||||
public static List<MeetingOutput> GetEnterpriseTopicsMeeting()
|
||||
{
|
||||
var result =
|
||||
(from x in Funs.DB.Meeting_CompanySpecialMeeting
|
||||
(from x in Funs.DB.Meeting_CompanySpecialMeeting
|
||||
join u in Funs.DB.Base_Unit on x.UnitId equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
where x.CompileDate > Const.DtmarkTime
|
||||
@@ -1798,7 +1879,7 @@ namespace BLL
|
||||
/// 获取企业专题会议(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<MeetingOutput>> GetEnterpriseTopicsMeetingAsync()
|
||||
public static async Task<List<MeetingOutput>> GetEnterpriseTopicsMeetingAsync()
|
||||
{
|
||||
return await Task.Run(GetEnterpriseTopicsMeeting);
|
||||
}
|
||||
@@ -1904,7 +1985,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<MeetingOutput>> GetProjectSafetyLeadingGroupMeetingAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetProjectSafetyLeadingGroupMeeting);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -2133,7 +2214,7 @@ namespace BLL
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join u in Funs.DB.Base_Unit on x.ResponsibleUnit equals u.UnitId into uGroup
|
||||
from u in uGroup.DefaultIfEmpty()
|
||||
join user in Funs.DB.Sys_User on x.CheckManId equals user.UserId into userGroup
|
||||
join user in Funs.DB.Sys_User on x.CheckManId equals user.UserId into userGroup
|
||||
from user in userGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId) && x.CheckTime > Const.DtmarkTime
|
||||
select new Model.CheckOutput()
|
||||
@@ -2566,7 +2647,7 @@ namespace BLL
|
||||
from projectType in projectTypeJoin.DefaultIfEmpty()
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -2703,7 +2784,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> GetLostWorkingHourAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetLostWorkingHour);
|
||||
}
|
||||
|
||||
@@ -2855,6 +2936,29 @@ namespace BLL
|
||||
return await Task.Run(GetSpecialOperationTrain);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetHseTechnicalNum()
|
||||
{
|
||||
var list = (from x in Funs.DB.License_HSETechnical
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
select x).Distinct().ToList();
|
||||
var result = list.ToList().Count();
|
||||
return result;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取安全技术交底数(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<int> GetHseTechnicalNumAsync()
|
||||
{
|
||||
return await Task.Run(GetHseTechnicalNum);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -3127,22 +3231,22 @@ namespace BLL
|
||||
public static List<Model.CostSmallDetailOutput> GetCostExtract()
|
||||
{
|
||||
var query = from cost in Funs.DB.CostGoods_CostSmallDetail
|
||||
join p in Funs.DB.Base_Project on cost.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join unit in Funs.DB.Base_Unit on cost.UnitId equals unit.UnitId into unitGroup
|
||||
from unit in unitGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new CostSmallDetailOutput
|
||||
{
|
||||
Id = cost.CostSmallDetailId,
|
||||
ProjectId = p.ProjectId,
|
||||
ProjectCode = p.ProjectCode,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = cost.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
Months = cost.Months,
|
||||
SUMCost = cost.Extract//Math.Round(sumCost, 2)
|
||||
};
|
||||
join p in Funs.DB.Base_Project on cost.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
join unit in Funs.DB.Base_Unit on cost.UnitId equals unit.UnitId into unitGroup
|
||||
from unit in unitGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId)
|
||||
select new CostSmallDetailOutput
|
||||
{
|
||||
Id = cost.CostSmallDetailId,
|
||||
ProjectId = p.ProjectId,
|
||||
ProjectCode = p.ProjectCode,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitId = cost.UnitId,
|
||||
UnitName = unit.UnitName,
|
||||
Months = cost.Months,
|
||||
SUMCost = cost.Extract//Math.Round(sumCost, 2)
|
||||
};
|
||||
return query.ToList();
|
||||
}
|
||||
public static async Task<List<Model.CostSmallDetailOutput>> GetCostExtractAsync()
|
||||
@@ -3304,7 +3408,7 @@ namespace BLL
|
||||
return query.ToList();
|
||||
}
|
||||
public static async Task<List<Model.ConstructionEquipmentOutput>> GetSpecialEquipmentAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetSpecialEquipment);
|
||||
}
|
||||
|
||||
@@ -3342,7 +3446,7 @@ namespace BLL
|
||||
}
|
||||
public static async Task<List<LicenseOutput>> GetLicensesAsync()
|
||||
{
|
||||
|
||||
|
||||
return await Task.Run(GetLicenses);
|
||||
}
|
||||
|
||||
@@ -3399,17 +3503,17 @@ namespace BLL
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
ProNum = gg.Count(y => y.States != "4" && y.States != "-1"),
|
||||
RecNum = gg.Count(y => y.States == "3"),
|
||||
NoRecNum = gg.Count(y => y.States != "3" && y.States != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round(Convert.ToDecimal( gg.Count(y => y.States == "3") /
|
||||
ProNum = gg.Count(y => y.States != "4" && y.States != "-1"),
|
||||
RecNum = gg.Count(y => y.States == "3"),
|
||||
NoRecNum = gg.Count(y => y.States != "3" && y.States != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round(Convert.ToDecimal(gg.Count(y => y.States == "3") /
|
||||
gg.Count(y => y.States != "4" && y.States != "-1") * 100), 2, MidpointRounding.AwayFromZero).ToString()
|
||||
}).ToList();
|
||||
|
||||
foreach (var item in query)
|
||||
{
|
||||
item.RecRate = Math .Round(Convert.ToDecimal(item.RecRate),2) .ToString(); // 转换为字符串并格式化为两位小数
|
||||
item.RecRate = Math.Round(Convert.ToDecimal(item.RecRate), 2).ToString(); // 转换为字符串并格式化为两位小数
|
||||
}
|
||||
return query;
|
||||
}
|
||||
@@ -3434,12 +3538,12 @@ namespace BLL
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
ProNum = gg.Count(y => y.States != "4" && y.States != "-1" ),
|
||||
RecNum = gg.Count(y => y.States == "3" ),
|
||||
NoRecNum = gg.Count(y => y.States != "3" && y.States != "-1" ),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1" ) == 0 ? "0" :
|
||||
Math.Round((decimal)gg.Count(y => y.States == "3" ) /
|
||||
gg.Count(y => y.States != "4" && y.States != "-1" ) * 100, 2, MidpointRounding.AwayFromZero).ToString()
|
||||
ProNum = gg.Count(y => y.States != "4" && y.States != "-1"),
|
||||
RecNum = gg.Count(y => y.States == "3"),
|
||||
NoRecNum = gg.Count(y => y.States != "3" && y.States != "-1"),
|
||||
RecRate = gg.Count(y => y.States != "4" && y.States != "-1") == 0 ? "0" :
|
||||
Math.Round((decimal)gg.Count(y => y.States == "3") /
|
||||
gg.Count(y => y.States != "4" && y.States != "-1") * 100, 2, MidpointRounding.AwayFromZero).ToString()
|
||||
}).ToList();
|
||||
foreach (var item in query)
|
||||
{
|
||||
@@ -3462,22 +3566,22 @@ namespace BLL
|
||||
public static List<Model.SecurityRiskOutput> GetSecurityRiskOutputs()
|
||||
{
|
||||
var query = (from x in Funs.DB.Base_Project
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && (y.IsStart == true || y.State == "1")
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
LowRiskNum = gg.Sum(g => (g.z.RiskLevel == 1 || g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.z.RiskLevel == 2 || g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.z.RiskLevel == 3 || g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => g.z.RiskLevel == 4 ? 1 : 0),
|
||||
}).ToList();
|
||||
join y in Funs.DB.Hazard_HazardSelectedItem on x.ProjectId equals y.ProjectId into yGroup
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && (y.IsStart == true || y.State == "1")
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
LowRiskNum = gg.Sum(g => (g.z.RiskLevel == 1 || g.y.HazardLevel == "1") ? 1 : 0),
|
||||
GeneralRiskNum = gg.Sum(g => (g.z.RiskLevel == 2 || g.y.HazardLevel == "2") ? 1 : 0),
|
||||
MediumRiskNum = gg.Sum(g => (g.z.RiskLevel == 3 || g.y.HazardLevel == "3") ? 1 : 0),
|
||||
HighRiskNum = gg.Sum(g => g.z.RiskLevel == 4 ? 1 : 0),
|
||||
}).ToList();
|
||||
return query;
|
||||
}
|
||||
public static async Task<List<Model.SecurityRiskOutput>> GetSecurityRiskOutputsAsync()
|
||||
@@ -3503,20 +3607,21 @@ namespace BLL
|
||||
ProjectId = gg.Key.ProjectId,
|
||||
ProjectName = gg.Key.ProjectName,
|
||||
ProjectCode = gg.Key.ProjectCode,
|
||||
CompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == false ),
|
||||
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false ).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false ),
|
||||
CompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == false),
|
||||
TrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
ConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == false),
|
||||
FinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == false),
|
||||
ArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == false),
|
||||
SuperCompletedNum = gg.Count(x => x.States == "1" && x.IsSuperLargerHazard == true),
|
||||
SuperTrainPersonNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.TrainPersonNum) ?? 0,
|
||||
SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true),
|
||||
SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true),
|
||||
|
||||
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
||||
}).ToList();
|
||||
return query;
|
||||
}
|
||||
public static async Task<List<Model.LargeEngineeringOutput>> GetLargeEngineeringOutputsAsync()
|
||||
{
|
||||
{
|
||||
return await Task.Run(GetLargeEngineeringOutputs);
|
||||
}
|
||||
|
||||
@@ -3684,6 +3789,7 @@ namespace BLL
|
||||
x.SafeTrainNum,
|
||||
x.SpecialTrainNum,
|
||||
x.SpecialOperationTrainNum,
|
||||
x.HseTechnicalNum,
|
||||
x.EnvironmentalTrainNum,
|
||||
x.TotalEnergyConsumption,
|
||||
x.IncomeComprehensiveEnergyConsumption,
|
||||
@@ -3719,10 +3825,12 @@ namespace BLL
|
||||
x.CompanySpecialPlanNum,
|
||||
x.CompanyOnSiteDisposalPlan,
|
||||
x.CompanyDrillNum,
|
||||
x.CompanyDrillPersonNum,
|
||||
x.ProjectComprehensivePlanNum,
|
||||
x.ProjectSpecialPlanNum,
|
||||
x.ProjectOnSiteDisposalPlan,
|
||||
x.ProjectDrillNum,
|
||||
x.ProjectDrillPersonNum,
|
||||
x.CostExtract,
|
||||
x.CostUse,
|
||||
x.UseEquipmentNum,
|
||||
@@ -3741,10 +3849,12 @@ namespace BLL
|
||||
x.TrainPersonNum,
|
||||
x.ConstructionNum,
|
||||
x.FinishedNum,
|
||||
x.ArgumentNum,
|
||||
x.SuperCompletedNum,
|
||||
x.SuperTrainPersonNum,
|
||||
x.SuperConstructionNum,
|
||||
x.SuperFinishedNum,
|
||||
x.SuperArgumentNum,
|
||||
x.State,
|
||||
x.CreateDate,
|
||||
x.CreateMan
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -48,6 +49,18 @@ namespace BLL
|
||||
/// </summary>
|
||||
ProjectDivision,
|
||||
/// <summary>
|
||||
/// 报验数据
|
||||
/// </summary>
|
||||
Inspection,
|
||||
/// <summary>
|
||||
/// 施工方案数据
|
||||
/// </summary>
|
||||
ConstructSolution,
|
||||
/// <summary>
|
||||
/// 特种设备质保体系和图纸会审/设计交底
|
||||
/// </summary>
|
||||
SpecialEquipmentAndDesignDetails,
|
||||
/// <summary>
|
||||
/// 全部数据
|
||||
/// </summary>
|
||||
All
|
||||
@@ -195,6 +208,25 @@ namespace BLL
|
||||
SubProjectNum = newtable.SubProjectNum,
|
||||
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
|
||||
InspectionLotNum = newtable.InspectionLotNum,
|
||||
EquipmentInspectionNum = newtable.EquipmentInspectionNum,
|
||||
EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum,
|
||||
MachineInspectionNum = newtable.MachineInspectionNum,
|
||||
MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum,
|
||||
PersonInspectionNum = newtable.PersonInspectionNum,
|
||||
PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum,
|
||||
MaterialInspectionNum = newtable.MaterialInspectionNum,
|
||||
MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum,
|
||||
ConstructSolutionNum = newtable.ConstructSolutionNum,
|
||||
ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum,
|
||||
ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum,
|
||||
SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum,
|
||||
DesignDetailsNum = newtable.DesignDetailsNum,
|
||||
UnitProjectAcceptNum = newtable.UnitProjectAcceptNum,
|
||||
UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum,
|
||||
SubProjectAcceptNum = newtable.SubProjectAcceptNum,
|
||||
SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum,
|
||||
SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum,
|
||||
SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum
|
||||
};
|
||||
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
@@ -247,6 +279,25 @@ namespace BLL
|
||||
table.SubProjectNum = newtable.SubProjectNum;
|
||||
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
|
||||
table.InspectionLotNum = newtable.InspectionLotNum;
|
||||
table.EquipmentInspectionNum = newtable.EquipmentInspectionNum;
|
||||
table.EquipmentInspectionQualifiedNum = newtable.EquipmentInspectionQualifiedNum;
|
||||
table.MachineInspectionNum = newtable.MachineInspectionNum;
|
||||
table.MachineInspectionQualifiedNum = newtable.MachineInspectionQualifiedNum;
|
||||
table.PersonInspectionNum = newtable.PersonInspectionNum;
|
||||
table.PersonInspectionQualifiedNum = newtable.PersonInspectionQualifiedNum;
|
||||
table.MaterialInspectionNum = newtable.MaterialInspectionNum;
|
||||
table.MaterialInspectionQualifiedNum = newtable.MaterialInspectionQualifiedNum;
|
||||
table.ConstructSolutionNum = newtable.ConstructSolutionNum;
|
||||
table.ConstructSolutionProjectApproveNum = newtable.ConstructSolutionProjectApproveNum;
|
||||
table.ConstructSolutionUnitApproveNum = newtable.ConstructSolutionUnitApproveNum;
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = newtable.SpecialEquipmentQualityAssuranceSystemNum;
|
||||
table.DesignDetailsNum = newtable.DesignDetailsNum;
|
||||
table.UnitProjectAcceptNum = newtable.UnitProjectAcceptNum;
|
||||
table.UnitProjectAcceptOKNum = newtable.UnitProjectAcceptOKNum;
|
||||
table.SubProjectAcceptNum = newtable.SubProjectAcceptNum;
|
||||
table.SubProjectAcceptOKNum = newtable.SubProjectAcceptOKNum;
|
||||
table.SubdivisionalWorksAcceptNum = newtable.SubdivisionalWorksAcceptNum;
|
||||
table.SubdivisionalWorksAcceptOKNum = newtable.SubdivisionalWorksAcceptOKNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -269,6 +320,20 @@ namespace BLL
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void DeleteProject_CQMSData_CQMByDate(DateTime? reportDate)
|
||||
{
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.Project_CQMSData_CQMS.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_CQMSData_CQMS.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据projectid判断当天项目是否已统计数据
|
||||
/// </summary>
|
||||
@@ -322,6 +387,7 @@ namespace BLL
|
||||
StatisticalData(item.ProjectId, CQMSDateType.All);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 统计数据
|
||||
/// </summary>
|
||||
@@ -392,6 +458,13 @@ namespace BLL
|
||||
table.UnitProjectOnesOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.MaterialInRecheckNum = GetMaterialInRecheckNum(projectid);
|
||||
table.MaterialInRecheckOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
|
||||
table.UnitProjectAcceptNum = GetUnitProjectOnesNum(projectid);
|
||||
table.UnitProjectAcceptOKNum = GetUnitProjectOnesOKNum(projectid);
|
||||
table.SubProjectAcceptNum = GetMaterialInRecheckNum(projectid);
|
||||
table.SubProjectAcceptOKNum = GetMaterialInRecheckOKNum(projectid);
|
||||
table.SubdivisionalWorksAcceptNum = GetSubdivisionalWorksAcceptNum(projectid);
|
||||
table.SubdivisionalWorksAcceptOKNum = GetSubdivisionalWorksAcceptOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ProjectDivision || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
@@ -401,6 +474,28 @@ namespace BLL
|
||||
table.SubdivisionalWorksNum = GetSubdivisionalWorksNum(projectid);
|
||||
table.InspectionLotNum = GetInspectionLotNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.Inspection || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.EquipmentInspectionNum = GetComprehensiveInspectionEquipmentNum(projectid);
|
||||
table.EquipmentInspectionQualifiedNum = GetComprehensiveInspectionEquipmentOKNum(projectid);
|
||||
table.MachineInspectionNum = GetComprehensiveInspectionMachineNum(projectid);
|
||||
table.MachineInspectionQualifiedNum = GetComprehensiveInspectionMachineOKNum(projectid);
|
||||
table.PersonInspectionNum = GetComprehensiveInspectionPersonNum(projectid);
|
||||
table.PersonInspectionQualifiedNum = GetComprehensiveInspectionPersonOKNum(projectid);
|
||||
table.MaterialInspectionNum = GetComprehensiveInspectionMaterialNum(projectid);
|
||||
table.MaterialInspectionQualifiedNum = GetComprehensiveInspectionMaterialOKNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.ConstructSolution || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.ConstructSolutionNum = GetConstructSolutionNum(projectid);
|
||||
table.ConstructSolutionProjectApproveNum = GetConstructSolutionProjectApproveNum(projectid);
|
||||
table.ConstructSolutionUnitApproveNum = GetConstructSolutionUnitApproveNum(projectid);
|
||||
}
|
||||
if (cQMSDateType == CQMSDateType.SpecialEquipmentAndDesignDetails || cQMSDateType == CQMSDateType.All)
|
||||
{
|
||||
table.SpecialEquipmentQualityAssuranceSystemNum = GetSpecialEquipmentQualityAssuranceSystemNum(projectid);
|
||||
table.DesignDetailsNum = GetTechnicalDisclosePersonNum(projectid);
|
||||
}
|
||||
|
||||
if (IsReportByToday(projectid))
|
||||
{
|
||||
@@ -691,6 +786,32 @@ namespace BLL
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "6" && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取分项工程验收合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetSubdivisionalWorksAcceptOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
|
||||
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
|
||||
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
|
||||
where y.ProjectId == projectid && y.CheckAcceptType == "6" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取单项工程个数
|
||||
/// </summary>
|
||||
@@ -747,6 +868,148 @@ namespace BLL
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionEquipmentOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionEquipment
|
||||
where x.ProjectId == projectid && x.SamplingResult == "1" && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具报验-报检合格数
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMachineOKNum(string projectid)
|
||||
{
|
||||
int result = (from x in Funs.DB.Comprehensive_InspectionMachine
|
||||
where x.ProjectId == projectid && x.IsCheckOK.HasValue && x.IsCheckOK == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite.HasValue && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionPersonOKNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where x.ProjectId == projectid && x.IsOnSite == true && x.CompileDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取材料报验-报检合格数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetComprehensiveInspectionMaterialOKNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 施工方案数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionProjectApproveNum(string projectid)
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_CQMSConstructSolution
|
||||
where x.ProjectId == projectid && x.State == "1"
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 施工方案数量——项目审批数量
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetConstructSolutionUnitApproveNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 特种设备质保体系
|
||||
/// </summary>
|
||||
/// <param name="projectid"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetSpecialEquipmentQualityAssuranceSystemNum(string projectid)
|
||||
{
|
||||
var result = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 推送项目质量数据
|
||||
|
||||
|
||||
@@ -100,6 +100,20 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public static void DeleteProject_HJGLData_HJGLByDate(DateTime? reportDate)
|
||||
{
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var table = db.Project_HJGLData_HJGL.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_HJGL.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Model.Project_HJGLData_HJGL GetProject_HJGLData_HJGLById(string Id)
|
||||
{
|
||||
return db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
|
||||
@@ -348,7 +362,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 推送项目焊接数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <returns></returns>
|
||||
public static ReturnData PushProjectHJGLData()
|
||||
{
|
||||
var items = (from x in Funs.DB.Project_HJGLData_HJGL
|
||||
|
||||
@@ -129,6 +129,7 @@ namespace BLL
|
||||
SafeTrainNum = newtable.SafeTrainNum,
|
||||
SpecialTrainNum = newtable.SpecialTrainNum,
|
||||
SpecialOperationTrainNum = newtable.SpecialOperationTrainNum,
|
||||
HseTechnicalNum = newtable.HseTechnicalNum,
|
||||
TotalEnergyConsumption = newtable.TotalEnergyConsumption,
|
||||
IncomeComprehensiveEnergyConsumption = newtable.IncomeComprehensiveEnergyConsumption,
|
||||
NewWaterConsumption = newtable.NewWaterConsumption,
|
||||
@@ -163,10 +164,12 @@ namespace BLL
|
||||
CompanySpecialPlanNum = newtable.CompanySpecialPlanNum,
|
||||
CompanyOnSiteDisposalPlan = newtable.CompanyOnSiteDisposalPlan,
|
||||
CompanyDrillNum = newtable.CompanyDrillNum,
|
||||
CompanyDrillPersonNum = newtable.CompanyDrillPersonNum,
|
||||
ProjectComprehensivePlanNum = newtable.ProjectComprehensivePlanNum,
|
||||
ProjectSpecialPlanNum = newtable.ProjectSpecialPlanNum,
|
||||
ProjectOnSiteDisposalPlan = newtable.ProjectOnSiteDisposalPlan,
|
||||
ProjectDrillNum = newtable.ProjectDrillNum,
|
||||
ProjectDrillPersonNum = newtable.ProjectDrillPersonNum,
|
||||
CostExtract = newtable.CostExtract,
|
||||
CostUse = newtable.CostUse,
|
||||
UseEquipmentNum = newtable.UseEquipmentNum,
|
||||
@@ -185,10 +188,12 @@ namespace BLL
|
||||
TrainPersonNum = newtable.TrainPersonNum,
|
||||
ConstructionNum = newtable.ConstructionNum,
|
||||
FinishedNum = newtable.FinishedNum,
|
||||
ArgumentNum = newtable.ArgumentNum,
|
||||
SuperCompletedNum = newtable.SuperCompletedNum,
|
||||
SuperTrainPersonNum = newtable.SuperTrainPersonNum,
|
||||
SuperConstructionNum = newtable.SuperConstructionNum,
|
||||
SuperFinishedNum = newtable.SuperFinishedNum
|
||||
SuperFinishedNum = newtable.SuperFinishedNum,
|
||||
SuperArgumentNum = newtable.SuperArgumentNum
|
||||
};
|
||||
db.Project_HSSEData_HSSE.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
|
||||
Reference in New Issue
Block a user