提交代码

This commit is contained in:
2025-06-04 23:14:13 +08:00
parent da1100c508
commit 7108c55584
19 changed files with 3465 additions and 321 deletions
@@ -12,6 +12,7 @@ namespace BLL
/// </summary>
public static class EnvironmentalCheckService
{
#region
/// <summary>
@@ -20,8 +21,8 @@ namespace BLL
/// <returns></returns>
public static ReturnData PushEnvironmentalCheckData()
{
var db1 = Funs.DB;
var items = (from x in db1.EnvironmentalCheck where x.IsPushed == false select x).ToList();
var db = Funs.DB;
var items = (from x in db.EnvironmentalCheck where x.IsPushed == false select x).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
@@ -34,11 +35,11 @@ namespace BLL
{//推送成功后,修改数据状态
foreach (var item in items)
{
Model.EnvironmentalCheck envModel = db1.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id);
Model.EnvironmentalCheck envModel = db.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id);
if (envModel != null)
{
envModel.IsPushed = true;
db1.SubmitChanges();
db.SubmitChanges();
}
}
}
File diff suppressed because it is too large Load Diff
+207 -54
View File
@@ -1,4 +1,4 @@
using FineUIPro;
using FineUIPro;
using Model;
using Newtonsoft.Json;
using System;
@@ -6,13 +6,16 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using Model;
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().Select(x => x.ProjectId).ToList();
#region
@@ -49,22 +52,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 +94,8 @@ namespace BLL
};
db.HJGLData_HJGL.InsertOnSubmit(table);
db.SubmitChanges();
}
}
}
public static void DeleteHJGLData_HJGLById(string Id)
@@ -106,7 +109,7 @@ namespace BLL
db.SubmitChanges();
}
}
}
public static HJGLData_HJGL GetHJGLData_HJGLById(string Id)
@@ -155,23 +158,27 @@ namespace BLL
return data;
}
public static HJGLData GetTodayHJGLData_HJGL()
public static async Task<HJGLData> GetTodayHJGLData_HJGLAsync()
{
var data = new HJGLData();
if (CommonService.GetIsThisUnit().CollCropCode== "91410200170644116B")
if (CommonService.GetIsThisUnit().CollCropCode == "91410200170644116B")
{
return GetELECLTodayHJGLData_HJGL();
return GetELECLTodayHJGLData_HJGL();
}
if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881")
if (CommonService.GetIsThisUnit().CollCropCode == "914200001775697881")
{
return GetCNCEC_16TodayHJGLData_HJGL();
}
var q = GetTodayData();
/* var q = GetTodayData();
if (q != null && q.State == Const.CNCEC_State_S)
data = StatisticalData();
else
data = StatisticalData();
data = StatisticalData();*/
var modelTask = StatisticalDataAsync();
var model = await modelTask;
data = model;
return data;
}
/// <summary>
@@ -185,11 +192,11 @@ namespace BLL
string token = Const.sysglyId;
string response = Funs.RequestPost(baseurl, token, "");
var json = JsonConvert.DeserializeObject(response) as JObject;
if (json != null && json["code"]?.ToString()=="1")
if (json != null && json["code"]?.ToString() == "1")
{
var str = json["data"]?.ToString();
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
}
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
}
return data;
}
@@ -212,10 +219,10 @@ namespace BLL
}
catch (Exception e)
{
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString());
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, e.ToString(), "Request|Post");
}
}
var json = JsonConvert.DeserializeObject(response) as JObject;
if (json != null && json["code"]?.ToString() == "1")
@@ -223,14 +230,14 @@ namespace BLL
var str = json["data"]?.ToString();
if (str != null) data = JsonConvert.DeserializeObject<HJGLData>(str);
}
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response);
APICommonService.SaveSysHttpLog("GetCNCEC_16TodayHJGLData_HJGL", baseurl, response, "Request|Post");
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 +251,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 +266,7 @@ namespace BLL
CreateMan = Const.sysglyId,
CreateDate = DateTime.Now
};
return result;
return result;
}
public static void UpdateTodyData_State()
{
@@ -275,8 +282,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 +296,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,33 +311,101 @@ 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
{
UnitId = thisUnitId,
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 +439,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 +460,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.SitePerson_Person
where BeUnderConstructionList.Contains(x.ProjectId) && x.WorkPostId == Const.WorkPost_Welder && x.States == "1"
select new Model.WelderOutput()
{
ProjectId = x.ProjectId,
UnitId = x.UnitId,
WEDCode = x.CardNo,
WEDName = x.PersonName
//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_WeldJoint
where BeUnderConstructionList.Contains(x.ProjectId)
group x by x.ProjectId into g
select new Model.WeldDineOutput()
{
ProjectId = g.Key,
Size = g.Sum(x => x.Size),
DoneDin = g.Sum(x => x.Dia)
});
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.HJGL_Batch_NDEItem
join y in Funs.DB.HJGL_Batch_NDE on x.NDEID equals y.NDEID
where BeUnderConstructionList.Contains(y.ProjectId)
select new Model.CHCheckItemOutput()
{
Id = x.NDEItemID,
ProjectId = y.ProjectId,
UnitId = y.UnitId,
CHT_TotalFilm = x.TotalFilm,
CHT_PassFilm = x.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);
}
}
}
+135 -18
View File
@@ -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
@@ -108,6 +113,7 @@ namespace BLL
db.HSSEData_HSSE.InsertOnSubmit(table);
db.SubmitChanges();
}
}
public static void DeleteHSSEData_HSSEById(string id)
@@ -148,6 +154,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 +165,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 +191,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 +212,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 +220,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;
@@ -234,6 +245,7 @@ namespace BLL
var hsseDataItems = new List<HsseDataItem> { item };
data.HSSEDataItems = hsseDataItems;
return data;
}
public static HSSEData GetItemByHSSEData_HSSE(HSSEData_HSSE dataHsse,
@@ -253,6 +265,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 +276,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 +302,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 +323,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;
@@ -338,6 +355,7 @@ namespace BLL
var hsseDataItems = new List<HsseDataItem> { item };
data.HSSEDataItems = hsseDataItems;
return data;
}
public static async Task<HSSEData> GetTodayHSSEData_HSSE()
@@ -633,6 +651,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 +709,7 @@ namespace BLL
safeWorkingHourTask,
safeTrainTask,
specialTrainTask,
specialOperationTrainTask,
specialOperationTrainTask, hseTechnicalNumTask,
headOfficeInspectorGeneralTask,
headOfficeFullTimeTask,
branchInspectorGeneralTask,
@@ -751,6 +770,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 +832,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 +864,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 +888,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,6 +965,7 @@ 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,
@@ -925,31 +1000,35 @@ namespace BLL
CompanySpecialPlanNum = 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);
}
@@ -971,6 +1050,7 @@ namespace BLL
var data = GetItemByHSSEData_HSSE(table, Project_HSSEData_HiddenDangerDetailService.GetTodayModel());
return data;
}
//public static HSSEData StatisticalDataOld()
@@ -1109,6 +1189,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 +1225,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,19 +1249,45 @@ 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;
db.SubmitChanges();
}
}
}
/// <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);
}
#region
@@ -3513,13 +3622,15 @@ namespace BLL
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()
{
@@ -3690,6 +3801,7 @@ namespace BLL
x.SafeTrainNum,
x.SpecialTrainNum,
x.SpecialOperationTrainNum,
x.HseTechnicalNum,
x.EnvironmentalTrainNum,
x.TotalEnergyConsumption,
x.IncomeComprehensiveEnergyConsumption,
@@ -3725,10 +3837,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,
@@ -3747,14 +3861,17 @@ 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
};
}
#endregion
@@ -7,12 +7,14 @@ using System.Linq;
using System.Text;
using Model;
using Newtonsoft.Json;
using Microsoft.SqlServer.Dts.Runtime;
namespace BLL
{
public static class Project_CQMSDataService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// CQMS数据类型
/// </summary>
@@ -47,6 +49,18 @@ namespace BLL
/// </summary>
ProjectDivision,
/// <summary>
/// 报验数据
/// </summary>
Inspection,
/// <summary>
/// 施工方案数据
/// </summary>
ConstructSolution,
/// <summary>
/// 特种设备质保体系和图纸会审/设计交底
/// </summary>
SpecialEquipmentAndDesignDetails,
/// <summary>
/// 全部数据
/// </summary>
All
@@ -63,7 +77,7 @@ namespace BLL
}
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table)
{
var q = from x in Funs.DB.Project_CQMSData_CQMS
var q = from x in db.Project_CQMSData_CQMS
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) &&
@@ -140,11 +154,11 @@ namespace BLL
/// <returns></returns>
public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id)
{
return Funs.DB.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
return db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
}
public static List<Model.Project_CQMSData_CQMS> GetProject_CQMSData_CQMSByprojectid(string projectid)
{
var q = (from x in Funs.DB.Project_CQMSData_CQMS
var q = (from x in db.Project_CQMSData_CQMS
where x.ProjectId == projectid
select x).ToList();
return q;
@@ -194,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();
@@ -246,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();
}
}
@@ -268,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>
@@ -321,6 +387,7 @@ namespace BLL
StatisticalData(item.ProjectId, CQMSDateType.All);
}
}
/// <summary>
/// 统计数据
/// </summary>
@@ -391,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)
{
@@ -400,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))
{
@@ -484,7 +580,7 @@ namespace BLL
{
int result = (from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.ProjectId == projectid && y.IsCQMS == true && x.States == "1"
where x.ProjectId == projectid && y.IsCQMS == true
select x).Count();
return result;
}
@@ -690,14 +786,40 @@ 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>
/// <returns></returns>
public static int GetSingleProjectNum(string projectid)
{
int result = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == projectid
int result = (from x in Funs.DB.ProjectData_MainItem
where x.ProjectId == projectid
select x).Count();
return result;
}
@@ -746,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.Check_CheckEquipment
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.Check_CheckEquipment
where x.ProjectId == projectid && x.IsCheckCertificate == true && 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
@@ -354,11 +354,10 @@ namespace BLL
/// <returns></returns>
public static ReturnData PushProjectHJGLData()
{
var db1 = Funs.DB;
var items = (from x in db1.Project_HJGLData_HJGL
var items = (from x in Funs.DB.Project_HJGLData_HJGL
where x.ReportDate == DateTime.Now.Date
select x).ToList();
var defectItems = (from x in db1.Project_HJGLData_Defect
var defectItems = (from x in Funs.DB.Project_HJGLData_Defect
where x.ReportDate == DateTime.Now.Date
select x).ToList();
Model.ReturnData responeData = new Model.ReturnData();
@@ -376,8 +375,22 @@ namespace BLL
responeData.message = "当前没有项目焊接数据";
}
return responeData;
}
#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();
}
}
}
}
}
+1 -1
View File
@@ -16583,7 +16583,7 @@
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
@@ -40,6 +40,7 @@ namespace FineUIPro.Web.ProjectData
this.ProjectId = Request.QueryString["ProjectId"];
UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true);
BindGrid();
this.drpUnit.SelectedValue = Const.UnitId_SEDIN;
if (!String.IsNullOrEmpty(this.ProjectId))
{
+1396 -160
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -257,6 +257,7 @@
<Compile Include="TokenItem.cs" />
<Compile Include="ZHGL\DataSync\AccidentOutput.cs" />
<Compile Include="ZHGL\DataSync\BaseEntities.cs" />
<Compile Include="ZHGL\DataSync\CHCheckItemOutput.cs" />
<Compile Include="ZHGL\DataSync\CheckOutput.cs" />
<Compile Include="ZHGL\DataSync\ConstructionEquipmentOutput.cs" />
<Compile Include="ZHGL\DataSync\CostSmallDetailOutput.cs" />
@@ -266,6 +267,7 @@
<Compile Include="ZHGL\DataSync\HiddenRectificationOutput.cs" />
<Compile Include="ZHGL\DataSync\HJGLDataItem.cs" />
<Compile Include="ZHGL\DataSync\HSSEDataItem.cs" />
<Compile Include="ZHGL\DataSync\InspectionManagementOutput.cs" />
<Compile Include="ZHGL\DataSync\LargeEngineeringOutput.cs" />
<Compile Include="ZHGL\DataSync\LicenseOutput.cs" />
<Compile Include="ZHGL\DataSync\MeetingOutput.cs" />
@@ -274,6 +276,9 @@
<Compile Include="ZHGL\DataSync\ProjectOutput.cs" />
<Compile Include="ZHGL\DataSync\SecurityRiskOutput.cs" />
<Compile Include="ZHGL\DataSync\SYHSEDataItem.cs" />
<Compile Include="ZHGL\DataSync\WBSBreakdownProjectOutput.cs" />
<Compile Include="ZHGL\DataSync\WeldDineOutput.cs" />
<Compile Include="ZHGL\DataSync\WelderOutput.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -0,0 +1,20 @@
using System;
namespace Model
{
/// <summary>
/// 焊接信息
/// </summary>
public class CHCheckItemOutput : BaseEntities
{
public string Id { get; set; }
/// <summary>
/// 总片数
/// </summary>
public int? CHT_TotalFilm { get; set; }
/// <summary>
/// 合格片数
/// </summary>
public int? CHT_PassFilm { get; set; }
}
}
+19
View File
@@ -54,6 +54,25 @@ namespace Model
public int? UnitProjectOnesOKNum { get; set; }
public string UnitProjectOnesRate { get; set; }
public int? UseNum { get; set; }
public int? EquipmentInspectionNum { get; set; }
public int? EquipmentInspectionQualifiedNum { get; set; }
public int? MachineInspectionNum { get; set; }
public int? MachineInspectionQualifiedNum { get; set; }
public int? PersonInspectionNum { get; set; }
public int? PersonInspectionQualifiedNum { get; set; }
public int? MaterialInspectionNum { get; set; }
public int? MaterialInspectionQualifiedNum { get; set; }
public int? ConstructSolutionNum { get; set; }
public int? ConstructSolutionProjectApproveNum { get; set; }
public int? ConstructSolutionUnitApproveNum { get; set; }
public int? SpecialEquipmentQualityAssuranceSystemNum { get; set; }
public int? DesignDetailsNum { get; set; }
public int? UnitProjectAcceptNum { get; set; }
public int? UnitProjectAcceptOKNum { get; set; }
public int? SubProjectAcceptNum { get; set; }
public int? SubProjectAcceptOKNum { get; set; }
public int? SubdivisionalWorksAcceptNum { get; set; }
public int? SubdivisionalWorksAcceptOKNum { get; set; }
}
}
+8
View File
@@ -29,6 +29,8 @@ namespace Model
public int? CompanyComprehensiveCheckNum { get; set; }
public int? CompanyComprehensivePlanNum { get; set; }
public int? CompanyDrillNum { get; set; }
public int? CompanyDrillPersonNum { get; set; }
public int? CompanyLeadShiftCheckNum { get; set; }
public int? CompanyOnSiteDisposalPlan { get; set; }
public int? CompanySpecialCheckNum { get; set; }
@@ -39,6 +41,8 @@ namespace Model
public int? CostUse { get; set; }
public int? EnterpriseTopicsMeetingNum { get; set; }
public int? FinishedNum { get; set; }
public int? ArgumentNum { get; set; }
public int? SuperArgumentNum { get; set; }
public int? GeneralAccidentNum { get; set; }
public int? GeneralClosedNum { get; set; }
public int? GeneralNotClosedNum { get; set; }
@@ -64,6 +68,8 @@ namespace Model
public decimal? NewWaterConsumption { get; set; }
public int? ProjectComprehensivePlanNum { get; set; }
public int? ProjectDrillNum { get; set; }
public int? ProjectDrillPersonNum { get; set; }
public int? ProjectFullTimeNum { get; set; }
public int? ProjectInspectorGeneralNum { get; set; }
public int? ProjectLeadShiftCheckNum { get; set; }
@@ -84,6 +90,8 @@ namespace Model
public int? ShutdownNum { get; set; }
public int? SpecialEquipmentNum { get; set; }
public int? SpecialOperationTrainNum { get; set; }
public int? HseTechnicalNum { get; set; }
public int? EnvironmentalTrainNum { get; set; }
public int? SpecialSeriousAccidentNum { get; set; }
public int? SpecialTrainNum { get; set; }
@@ -0,0 +1,16 @@
using System;
namespace Model
{
/// <summary>
/// 质量验收数据
/// </summary>
public class InspectionManagementOutput : BaseEntities
{
public string Id { get; set; }
public string BreakdownCode { get; set; }
public string BreakdownName { get; set; }
public string Basis { get; set; }
public string CheckPoints { get; set; }
}
}
@@ -1,6 +1,6 @@
namespace Model
{
public class LargeEngineeringOutput:BaseEntities
public class LargeEngineeringOutput : BaseEntities
{
/// <summary>
/// 危大工程审批完成数
@@ -34,5 +34,13 @@
/// 超危大工程完工个数
/// </summary>
public int SuperFinishedNum { get; set; }
/// <summary>
/// 危大工程论证个数
/// </summary>
public int ArgumentNum { get; set; }
/// <summary>
/// 超危大工程论证个数
/// </summary>
public int SuperArgumentNum { get; set; }
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class WBSBreakdownProjectOutput :BaseEntities
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 数量
/// </summary>
public int Sum { get; set; }
}
}
@@ -0,0 +1,20 @@
using System;
namespace Model
{
/// <summary>
/// 焊接达因数
/// </summary>
public class WeldDineOutput : BaseEntities
{
public string Id { get; set; }
/// <summary>
/// 达因数
/// </summary>
public decimal? Size { get; set; }
/// <summary>
/// 完成达因数
/// </summary>
public decimal? DoneDin { get; set; }
}
}
+14
View File
@@ -0,0 +1,14 @@
using System;
namespace Model
{
/// <summary>
/// 焊工数据
/// </summary>
public class WelderOutput : BaseEntities
{
public string Id { get; set; }
public string WEDCode { get; set; }
public string WEDName { get; set; }
}
}
@@ -19,7 +19,7 @@ namespace WebAPI.Controllers
/// 获取质量统计数据
/// </summary>
/// <returns></returns>
public Model.ReturnData PostGetCQMSData()
public async Task<Model.ReturnData> PostGetCQMSData()
{
var returnData = new Model.ReturnData();
returnData.type = "CQMS";
@@ -29,7 +29,7 @@ namespace WebAPI.Controllers
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
{
returnData.data = CQMSDataService.GetTodayCQMSData_CQMS();
returnData.data = await CQMSDataService.GetTodayCQMSData_CQMS();
}
else
{
@@ -70,7 +70,7 @@ namespace WebAPI.Controllers
/// 获取焊接统计数据
/// </summary>
/// <returns></returns>
public Model.ReturnData PostGetHJGLData()
public async Task<ReturnData> PostGetHJGLData()
{
var returnData = new Model.ReturnData();
returnData.type = "HJGL";
@@ -80,7 +80,7 @@ namespace WebAPI.Controllers
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
{
returnData.data = HJGLData_HJGLService.GetTodayHJGLData_HJGL();
returnData.data = await HJGLData_HJGLService.GetTodayHJGLData_HJGLAsync();
}
else
{
@@ -120,6 +120,35 @@ namespace WebAPI.Controllers
/// 获取安全统计数据
/// </summary>
/// <returns></returns>
/*public Model.ReturnData PostGetHSSEData()
{
var returnData = new Model.ReturnData();
returnData.type = "HSSE";
returnData.time = DateTime.Now.ToString();
ServerService.GetToken();
returnData.token = BLL.SysConstSetService.CNCECToken;
returnData.expiryTime = BLL.SysConstSetService.CNCECTTokenExTime;
if (!string.IsNullOrEmpty(returnData.token) && !string.IsNullOrEmpty(returnData.expiryTime) && DateTime.Parse(returnData.expiryTime) > DateTime.Now)
{
try
{
returnData.data = HSSEData_HSSEService.StatisticalDataAsync().Result;
}
catch (Exception ex)
{
returnData.code = 0;
returnData.message = ex.ToString();
}
}
else
{
returnData.code = 500;
returnData.message = "token失效";
}
return returnData;
}*/
public async Task<Model.ReturnData> PostGetHSSEData()
{
var returnData = new Model.ReturnData();
@@ -147,6 +176,7 @@ namespace WebAPI.Controllers
}
return returnData;
}
/// <summary>
/// 获取安全统计数据成功后,回调通知上报成功
/// </summary>