This commit is contained in:
2023-11-21 16:14:59 +08:00
41 changed files with 1589 additions and 1326 deletions
@@ -1,4 +1,7 @@
using System;
using FineUIPro;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -9,6 +12,91 @@ namespace BLL
/// </summary>
public static class Check_CheckSpecialService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_CheckSpecial> getDataLists = from x in db.Check_CheckSpecial
select x;
/// <summary>
/// 列表
/// </summary>
/// <param name="projectId"></param>
/// <param name="states"></param>
/// <param name="checkType"></param>
/// <param name="checkItemSetId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projectId, string states, string checkType, string checkItemSetId, DateTime? startTime, DateTime? endTime, Grid Grid1)
{
IQueryable<Model.Check_CheckSpecial> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projectId))
{
getDataList = getDataList.Where(e => e.ProjectId == projectId);
}
if (states != "-1")
{
getDataList = getDataList.Where(e => e.States == states);
}
if (checkType != "-1")
{
if (checkType == "1")
{
getDataList = getDataList.Where(e => e.CheckType == checkType);
}
else
{
getDataList = getDataList.Where(e => e.CheckType == checkType || e.CheckType == null );
}
}
if (!string.IsNullOrEmpty(checkItemSetId) && checkItemSetId != Const._Null)
{
getDataList = getDataList.Where(e => e.CheckItemSetId == checkItemSetId);
}
if (startTime.HasValue)
{
getDataList = getDataList.Where(e => e.CheckTime >= startTime);
}
if (endTime.HasValue)
{
getDataList = getDataList.Where(e => e.CheckTime <= endTime);
}
count = getDataList.Count();
if (count == 0)
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
select new
{
x.CheckSpecialId,
x.CheckTime,
x.CheckSpecialCode,
CheckItemName =db.Technique_CheckItemSet .First(y=>y.CheckItemSetId ==x. CheckItemSetId).CheckItemName,
CheckTypeName = x.CheckType == "1" ? "联合检查" : "专项检查",
StatesName = x.States == "2" ? "已完成" : (x.States == "1" ? "待整改" : "待提交"),
};
}
#endregion
/// <summary>
/// 根据专项检查ID获取专项检查信息
/// </summary>
@@ -1,4 +1,8 @@
using System.Linq;
using FineUIPro;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
@@ -9,6 +13,62 @@ namespace BLL
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in db.SitePerson_Person
select x;
/// <summary>
///
/// </summary>
/// <param name="projectId"></param>
/// <param name="personName"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projectId, string personName, Grid Grid1)
{
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projectId))
{
getDataList = getDataList.Where(e => e.ProjectId == projectId);
}
if (!string.IsNullOrEmpty(personName))
{
getDataList = getDataList.Where(e => e.PersonName.Contains(personName));
}
count = getDataList.Count();
if (count == 0)
{
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getDataList
select new
{
x.ProjectId,
ProjectName = db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName,
x.UnitId,
UnitName = db.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName,
x.SitePersonId,
x.PersonId,
x.CardNo,
x.PersonName,
};
}
#endregion
/// <summary>
/// 根据主键获取体检管理
/// </summary>
+6 -5
View File
@@ -560,7 +560,7 @@ namespace BLL
select x;
if (listUnitIds.Count() > 0)
{
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId));
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x => x.PersonName);
}
if (listRoles.Count() > 0)
{
@@ -579,6 +579,7 @@ namespace BLL
{
list = (from x in getProjectPersons
join y in db.Person_Persons on x.PersonId equals y.PersonId
orderby x.PersonName
select y).ToList();
}
}
@@ -586,11 +587,11 @@ namespace BLL
{
var getPersons = from x in db.Person_Persons
where x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
select x;
if (listUnitIds.Count() > 0)
{
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId));
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x=>x.PersonName);
}
if (listRoles.Count() > 0)
{
@@ -605,11 +606,11 @@ namespace BLL
}
else
{
list = getPersons.ToList();
list = getPersons.OrderBy(x => x.PersonName).ToList();
}
}
return list.OrderBy(x => x.PersonName).ToList();
return list;
}
}
#endregion
+12 -8
View File
@@ -1,6 +1,7 @@
namespace BLL
{
using Model;
using NPOI.Util;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -361,17 +362,20 @@
group x by x.ProjectId into g
select new { g.First().ProjectId, count = g.Count() }).Distinct();
List<Model.Base_Project> getList = new List<Base_Project>();
if (getProjects.Count() > 0)
{
getList = (from x in getProjects
join y in pcount on x.ProjectId equals y.ProjectId into PP
from p in PP.DefaultIfEmpty()
orderby p.count descending
select x).ToList();
var getList = (from x in getProjects
join y in pcount on x.ProjectId equals y.ProjectId into PP
from p in PP.DefaultIfEmpty()
orderby p.count descending
select x);
return getList.ToList();
}
return getList;
else
{
return null;
}
}
}
@@ -156,47 +156,51 @@ namespace BLL
/// <param name="newtable"></param>
public static void AddProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
{
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS
using (var db = new SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TrainPersonNum = newtable.TrainPersonNum,
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
UseNum = newtable.UseNum,
OKNum = newtable.OKNum,
CompanyPersonNum = newtable.CompanyPersonNum,
BranchPersonNum = newtable.BranchPersonNum,
ProjectPersonNum = newtable.ProjectPersonNum,
ProblemNum = newtable.ProblemNum,
ProblemCompletedNum = newtable.ProblemCompletedNum,
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
SNum = newtable.SNum,
ANum = newtable.ANum,
BNum = newtable.BNum,
CNum = newtable.CNum,
KeyProcessNum = newtable.KeyProcessNum,
KeyProcessOKNum = newtable.KeyProcessOKNum,
SpecialProcessNum = newtable.SpecialProcessNum,
SpecialProcessOKNum = newtable.SpecialProcessOKNum,
ConcealedWorksNum = newtable.ConcealedWorksNum,
ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
UnitProjectOnesNum = newtable.UnitProjectOnesNum,
UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
MaterialInRecheckNum = newtable.MaterialInRecheckNum,
MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
SingleProjectNum = newtable.SingleProjectNum,
UnitProjectNum = newtable.UnitProjectNum,
SubProjectNum = newtable.SubProjectNum,
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
InspectionLotNum = newtable.InspectionLotNum,
};
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TrainPersonNum = newtable.TrainPersonNum,
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
UseNum = newtable.UseNum,
OKNum = newtable.OKNum,
CompanyPersonNum = newtable.CompanyPersonNum,
BranchPersonNum = newtable.BranchPersonNum,
ProjectPersonNum = newtable.ProjectPersonNum,
ProblemNum = newtable.ProblemNum,
ProblemCompletedNum = newtable.ProblemCompletedNum,
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
SNum = newtable.SNum,
ANum = newtable.ANum,
BNum = newtable.BNum,
CNum = newtable.CNum,
KeyProcessNum = newtable.KeyProcessNum,
KeyProcessOKNum = newtable.KeyProcessOKNum,
SpecialProcessNum = newtable.SpecialProcessNum,
SpecialProcessOKNum = newtable.SpecialProcessOKNum,
ConcealedWorksNum = newtable.ConcealedWorksNum,
ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
UnitProjectOnesNum = newtable.UnitProjectOnesNum,
UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
MaterialInRecheckNum = newtable.MaterialInRecheckNum,
MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
SingleProjectNum = newtable.SingleProjectNum,
UnitProjectNum = newtable.UnitProjectNum,
SubProjectNum = newtable.SubProjectNum,
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
InspectionLotNum = newtable.InspectionLotNum,
};
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
}
}
/// <summary>
/// 修改
@@ -205,46 +209,50 @@ namespace BLL
public static void UpdateProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
{
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TrainPersonNum = newtable.TrainPersonNum;
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
table.UseNum = newtable.UseNum;
table.OKNum = newtable.OKNum;
table.CompanyPersonNum = newtable.CompanyPersonNum;
table.BranchPersonNum = newtable.BranchPersonNum;
table.ProjectPersonNum = newtable.ProjectPersonNum;
table.ProblemNum = newtable.ProblemNum;
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
table.SNum = newtable.SNum;
table.ANum = newtable.ANum;
table.BNum = newtable.BNum;
table.CNum = newtable.CNum;
table.KeyProcessNum = newtable.KeyProcessNum;
table.KeyProcessOKNum = newtable.KeyProcessOKNum;
table.SpecialProcessNum = newtable.SpecialProcessNum;
table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
table.ConcealedWorksNum = newtable.ConcealedWorksNum;
table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
table.SingleProjectNum = newtable.SingleProjectNum;
table.UnitProjectNum = newtable.UnitProjectNum;
table.SubProjectNum = newtable.SubProjectNum;
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
table.InspectionLotNum = newtable.InspectionLotNum;
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TrainPersonNum = newtable.TrainPersonNum;
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
table.UseNum = newtable.UseNum;
table.OKNum = newtable.OKNum;
table.CompanyPersonNum = newtable.CompanyPersonNum;
table.BranchPersonNum = newtable.BranchPersonNum;
table.ProjectPersonNum = newtable.ProjectPersonNum;
table.ProblemNum = newtable.ProblemNum;
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
table.SNum = newtable.SNum;
table.ANum = newtable.ANum;
table.BNum = newtable.BNum;
table.CNum = newtable.CNum;
table.KeyProcessNum = newtable.KeyProcessNum;
table.KeyProcessOKNum = newtable.KeyProcessOKNum;
table.SpecialProcessNum = newtable.SpecialProcessNum;
table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
table.ConcealedWorksNum = newtable.ConcealedWorksNum;
table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
table.SingleProjectNum = newtable.SingleProjectNum;
table.UnitProjectNum = newtable.UnitProjectNum;
table.SubProjectNum = newtable.SubProjectNum;
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
table.InspectionLotNum = newtable.InspectionLotNum;
db.SubmitChanges();
}
}
}
/// <summary>
@@ -254,12 +262,16 @@ namespace BLL
public static void DeleteProject_CQMSData_CQMSById(string Id)
{
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
db.Project_CQMSData_CQMS.DeleteOnSubmit(table);
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_CQMSData_CQMS.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
/// <summary>
@@ -1,4 +1,5 @@
using FineUIPro;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -87,62 +88,75 @@ namespace BLL
public static void AddProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
{
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
using (var db = new SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
DefectName = newtable.DefectName,
DefectNum = newtable.DefectNum,
};
db.Project_HJGLData_Defect.InsertOnSubmit(table);
db.SubmitChanges();
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
DefectName = newtable.DefectName,
DefectNum = newtable.DefectNum,
};
db.Project_HJGLData_Defect.InsertOnSubmit(table);
db.SubmitChanges();
}
}
public static void UpdateProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
{
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.DefectName = newtable.DefectName;
table.DefectNum = newtable.DefectNum;
db.SubmitChanges();
}
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.DefectName = newtable.DefectName;
table.DefectNum = newtable.DefectNum;
db.SubmitChanges();
}
}
}
public static void DeleteProject_HJGLData_DefectById(string Id)
{
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
db.SubmitChanges();
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
{
var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
db.SubmitChanges();
var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
if (table != null)
{
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
db.SubmitChanges();
}
}
}
/// <summary>
/// 判断当天是否已统计数据
@@ -114,55 +114,63 @@ namespace BLL
}
public static void AddProject_HJGLData_HJGL(Model.Project_HJGLData_HJGL newtable)
{
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL
using (var db = new SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
WelderNum = newtable.WelderNum,
TotalDineNum = newtable.TotalDineNum,
CompleteDineNum = newtable.CompleteDineNum,
TotalFilmNum = newtable.TotalFilmNum,
OKFilmNum = newtable.OKFilmNum,
};
db.Project_HJGLData_HJGL.InsertOnSubmit(table);
db.SubmitChanges();
Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
WelderNum = newtable.WelderNum,
TotalDineNum = newtable.TotalDineNum,
CompleteDineNum = newtable.CompleteDineNum,
TotalFilmNum = newtable.TotalFilmNum,
OKFilmNum = newtable.OKFilmNum,
};
db.Project_HJGLData_HJGL.InsertOnSubmit(table);
db.SubmitChanges();
}
}
public static void UpdateProject_HJGLData_HJGL(Model.Project_HJGLData_HJGL newtable)
{
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.WelderNum = newtable.WelderNum;
table.TotalDineNum = newtable.TotalDineNum;
table.CompleteDineNum = newtable.CompleteDineNum;
table.TotalFilmNum = newtable.TotalFilmNum;
table.OKFilmNum = newtable.OKFilmNum;
db.SubmitChanges();
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.WelderNum = newtable.WelderNum;
table.TotalDineNum = newtable.TotalDineNum;
table.CompleteDineNum = newtable.CompleteDineNum;
table.TotalFilmNum = newtable.TotalFilmNum;
table.OKFilmNum = newtable.OKFilmNum;
db.SubmitChanges();
}
}
}
public static void DeleteProject_HJGLData_HJGLById(string Id)
{
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (var db = new SGGLDB(Funs.ConnString))
{
db.Project_HJGLData_HJGL.DeleteOnSubmit(table);
db.SubmitChanges();
Model.Project_HJGLData_HJGL table = db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_HJGLData_HJGL.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
/// <summary>
/// 判断该项目的该日期是否统计数据
@@ -1193,16 +1193,16 @@ namespace BLL
/// <returns></returns>
public static int GetUseEquipmentNum(string projectid)
{
/*var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
where y.ProjectId == projectid && x.IsUsed == true
where y.ProjectId == projectid
select x).Count() +
(from x in Funs.DB.InApproveManager_GeneralEquipmentInItem
join y in Funs.DB.InApproveManager_GeneralEquipmentIn on x.GeneralEquipmentInId equals y
.GeneralEquipmentInId
where y.ProjectId == projectid && x.IsUsed == true
select x).Count();*/
return 0;
where y.ProjectId == projectid
select x).Count();
return result;
}
/// <summary>
@@ -1211,11 +1211,11 @@ namespace BLL
/// <returns></returns>
public static int GetSpecialEquipmentNum(string projectid)
{
/*var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
var result = (from x in Funs.DB.InApproveManager_EquipmentInItem
join y in Funs.DB.InApproveManager_EquipmentIn on x.EquipmentInId equals y.EquipmentInId
where y.ProjectId == projectid && x.IsUsed == true
select x).Count();*/
return 0;
where y.ProjectId == projectid
select x).Count();
return result;
}
/// <summary>
@@ -1224,10 +1224,35 @@ namespace BLL
/// <returns></returns>
public static int GetLicensesNum(string projectid)
{
/*var result = (from x in Funs.DB.License_LicenseManager
where x.ProjectId == projectid && x.IsHighRisk == true && x.CompileDate > Const.DtmarkTime
select x).Count();*/
return 0;
var result = (from x in Funs.DB.License_LicenseManager
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
select x).Count();
var result1 = (from x in Funs.DB.License_BreakGround
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result2 = (from x in Funs.DB.License_FireWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result3 = (from x in Funs.DB.License_HeightWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result4 = (from x in Funs.DB.License_LiftingWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result5 = (from x in Funs.DB.License_LimitedSpace
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result6 = (from x in Funs.DB.License_NightWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result7 = (from x in Funs.DB.License_OpenCircuit
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
var result8 = (from x in Funs.DB.License_RadialWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime
select x).Count();
return (result+ result1+ result2+ result3+ result4+ result5+ result6+ result7+ result8);
}
/// <summary>
@@ -1236,11 +1261,37 @@ namespace BLL
/// <returns></returns>
public static int GetLicensesCloseNum(string projectid)
{
/*var result = (from x in Funs.DB.License_LicenseManager
where x.ProjectId == projectid && x.IsHighRisk == true && x.WorkStates == "3" &&
var result = (from x in Funs.DB.License_LicenseManager
where x.ProjectId == projectid && x.WorkStates == "3" &&
x.CompileDate > Const.DtmarkTime
select x).Count();*/
return 0;
select x).Count();
var result1 = (from x in Funs.DB.License_BreakGround
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result2 = (from x in Funs.DB.License_FireWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result3 = (from x in Funs.DB.License_HeightWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result4 = (from x in Funs.DB.License_LiftingWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result5 = (from x in Funs.DB.License_LimitedSpace
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result6 = (from x in Funs.DB.License_NightWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result7 = (from x in Funs.DB.License_OpenCircuit
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
var result8 = (from x in Funs.DB.License_RadialWork
where x.ProjectId == projectid && x.ValidityStartTime > Const.DtmarkTime && x.States == "3"
select x).Count();
return (result + result1 + result2 + result3 + result4 + result5 + result6 + result7 + result8);
}
/// <summary>
@@ -1249,11 +1300,10 @@ namespace BLL
/// <returns></returns>
public static int GetGeneralClosedNum(string projectid)
{
/*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States == "3" &&
x.CheckTime > Const.DtmarkTime
select x).Count();*/
return 0;
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == "1" || x.HazardValue == null) && x.States == "3" && x.CheckTime > Const.DtmarkTime
select x).Count();
return result;
}
/// <summary>
@@ -1262,11 +1312,11 @@ namespace BLL
/// <returns></returns>
public static int GetGeneralNotClosedNum(string projectid)
{
/*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "一般" && x.States != "3" &&
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && (x.HazardValue == "0.3" || x.HazardValue == "1" || x.HazardValue == null) && x.States != "3" &&
x.CheckTime > Const.DtmarkTime
select x).Count();*/
return 0;
select x).Count();
return result;
}
/// <summary>
@@ -1275,11 +1325,11 @@ namespace BLL
/// <returns></returns>
public static int GetMajorClosedNum(string projectid)
{
/*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States == "3" &&
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.HazardValue == "3" && x.States == "3" &&
x.CheckTime > Const.DtmarkTime
select x).Count();*/
return 0;
select x).Count();
return result;
}
/// <summary>
@@ -1288,11 +1338,11 @@ namespace BLL
/// <returns></returns>
public static int GetMajorNotClosedNum(string projectid)
{
/*var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.Risk_Level == "重大" && x.States != "3" &&
var result = (from x in Funs.DB.HSSE_Hazard_HazardRegister
where x.ProjectId == projectid && x.HazardValue == "3" && x.States != "3" &&
x.CheckTime > Const.DtmarkTime
select x).Count();*/
return 0;
select x).Count();
return result;
}
/// <summary>
@@ -114,9 +114,11 @@ namespace BLL
}
public static void AddBulkProject_HSSEData_HiddenDangerDetails(List<Model.Project_HSSEData_HiddenDangerDetail> newtables)
{
db.Project_HSSEData_HiddenDangerDetail.InsertAllOnSubmit(newtables);
db.SubmitChanges();
using (var db = new SGGLDB(Funs.ConnString))
{
db.Project_HSSEData_HiddenDangerDetail.InsertAllOnSubmit(newtables);
db.SubmitChanges();
}
}
public static void UpdateProject_HSSEData_HiddenDangerDetail(Model.Project_HSSEData_HiddenDangerDetail newtable)
{