修改施工日志

This commit is contained in:
2023-09-22 14:11:46 +08:00
83 changed files with 2492 additions and 1180 deletions
@@ -82,6 +82,8 @@ namespace BLL
RegisterTypes2Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes2Id) ? null : hazardRegister.RegisterTypes2Id,
RegisterTypes3Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes3Id) ? null : hazardRegister.RegisterTypes3Id,
RegisterTypes4Id = string.IsNullOrEmpty(hazardRegister.RegisterTypes4Id) ? null : hazardRegister.RegisterTypes4Id,
WorkPackageId=WorkPackageService.getWorkPageIdsByControlItemAndCycle(hazardRegister.WorkPackageId, null),
WorkPackageName= WorkPackageService.getWorkPageNamesByControlItemAndCycle(hazardRegister.WorkPackageId, null),
};
var isUpdate = db.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == newHazardRegister.HazardRegisterId);
if (isUpdate == null)
+1
View File
@@ -341,6 +341,7 @@
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
<Compile Include="DigData\CQMSDataCollectService.cs" />
<Compile Include="DigData\CQMSDataDWService .cs" />
<Compile Include="DigData\ProjectWBSAnalysisService.cs" />
<Compile Include="DigData\WBSAnalysisService.cs" />
<Compile Include="DigData\HTGLDataDWService.cs" />
<Compile Include="DigData\JDGLDataDWService.cs" />
+17 -4
View File
@@ -62,6 +62,9 @@ namespace BLL
newCheckControl.State = CheckControl.State;
newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan;
newCheckControl.WorkPackageId = CheckControl.WorkPackageId;
newCheckControl.WorkPackageName = CheckControl.WorkPackageName;
db.Check_CheckControl.InsertOnSubmit(newCheckControl);
db.SubmitChanges();
}
@@ -93,6 +96,9 @@ namespace BLL
newCheckControl.State = CheckControl.State;
newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan;
newCheckControl.WorkPackageId = CheckControl.WorkPackageId;
newCheckControl.WorkPackageName = CheckControl.WorkPackageName;
db.Check_CheckControl.InsertOnSubmit(newCheckControl);
db.SubmitChanges();
}
@@ -215,6 +221,8 @@ namespace BLL
newCheckControl.State = CheckControl.State;
newCheckControl.SaveHandleMan = CheckControl.SaveHandleMan;
newCheckControl.WorkPackageId = CheckControl.WorkPackageId;
newCheckControl.WorkPackageName = CheckControl.WorkPackageName;
db.SubmitChanges();
}
public static List<Model.Check_CheckControl> GetListDataForApi(string state, string name, string projectId, int index, int page)
@@ -277,7 +285,8 @@ namespace BLL
x.RectifyOpinion,
x.LimitDate,
x.CNProfessionalCode,
x.WorkPackageId,
x.WorkPackageName,
CNProfessionalName = (from y in db.Base_CNProfessional where y.CNProfessionalId == x.CNProfessionalCode select y.ProfessionalName).First(),
UnitWork = (from y in db.WBS_UnitWork where y.UnitWorkId == x.UnitWorkId select y.UnitWorkCode + "-" + y.UnitWorkName + (y.ProjectType == "1" ? "(建筑)" : "(安装)")).First(),
CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First()
@@ -316,6 +325,8 @@ namespace BLL
x.CNProfessionalCode = list[i].CNProfessionalCode + "$" + list[i].CNProfessionalName;
x.AttachUrl = AttachFileService.getFileUrl(x.CheckControlCode);
x.ReAttachUrl = AttachFileService.getFileUrl(x.CheckControlCode + "r");
x.WorkPackageId = list[i].WorkPackageId;
x.WorkPackageName = list[i].WorkPackageName;
listRes.Add(x);
}
return listRes;
@@ -489,11 +500,11 @@ namespace BLL
x.RectifyOpinion,
x.LimitDate,
x.CNProfessionalCode,
x.WorkPackageId,
x.WorkPackageName,
CNProfessionalName = (from y in db.Base_CNProfessional where y.CNProfessionalId == x.CNProfessionalCode select y.ProfessionalName).First(),
UnitWork = (from y in db.WBS_UnitWork where y.UnitWorkId == x.UnitWorkId select y.UnitWorkCode + "-" + y.UnitWorkName + (y.ProjectType == "1" ? "(建筑)" : "(安装)")).First(),
CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First()
CheckMan = (from y in db.Person_Persons where y.PersonId == x.CheckMan select y.PersonName).First(),
};
var list = qq1.Skip(index * page).Take(page).ToList();
@@ -522,6 +533,8 @@ namespace BLL
x.CNProfessionalCode = list[i].CNProfessionalCode + "$" + list[i].CNProfessionalName;
x.AttachUrl = AttachFileService.getFileUrl(x.CheckControlCode);
x.ReAttachUrl = AttachFileService.getFileUrl(x.CheckControlCode + "r");
x.WorkPackageId = list[i].WorkPackageId;
x.WorkPackageName = list[i].WorkPackageName;
listRes.Add(x);
}
return listRes;
+78
View File
@@ -751,6 +751,84 @@ namespace BLL
}
#endregion
#region ID获取wbs节点及父节点名称字符串
/// <summary>
/// 根据工作包ID获取wbs节点及父节点字符串
/// </summary>
/// <param name="controlItemAndCycleId"></param>
/// <returns></returns>
public static string getWorkPageNamesByControlItemAndCycle(string workPackageId, string controlItemAndCycleId)
{
string returnValues = string.Empty;
string ControlItemName=string.Empty;
if (!string.IsNullOrEmpty(controlItemAndCycleId))
{
var getControlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ControlItemAndCycleId == controlItemAndCycleId);
if (getControlItemAndCycle != null)
{
workPackageId = getControlItemAndCycle.WorkPackageId;
ControlItemName = getControlItemAndCycle.ControlItemContent;
}
}
var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPackageId);
if (getWorkPackage != null)
{
if (!string.IsNullOrEmpty(ControlItemName))
{
returnValues = getSelectIds(getWorkPackage.WorkPackageId, getWorkPackage.PackageContent + "|" + ControlItemName);
}
else
{
returnValues = getSelectIds(getWorkPackage.WorkPackageId, getWorkPackage.PackageContent);
}
}
return returnValues;
}
/// <summary>
/// id
/// </summary>
/// <param name="node"></param>
/// <param name="id"></param>
/// <returns></returns>
public static string getSelectNames(string workPageId, string returnValues)
{
var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPageId);
if (getWorkPackage != null)
{
if (!string.IsNullOrEmpty(getWorkPackage.SuperWorkPackageId))
{
var getSupWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getWorkPackage.SuperWorkPackageId);
if (getSupWorkPackage != null)
{
returnValues = getWorkPackage.PackageContent + "|" + returnValues;
returnValues = getSelectIds(getWorkPackage.SuperWorkPackageId, returnValues);
}
}
else
{
var getUnitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == getWorkPackage.UnitWorkId);
if (getUnitWork != null)
{
if (getUnitWork.ProjectType == "1")
{
returnValues = "建筑工程|" + getUnitWork.UnitWorkName + "|" + returnValues;
}
else
{
returnValues = "安装工程|" + getUnitWork.UnitWorkName + "|" + returnValues;
}
}
}
}
return returnValues;
}
#endregion
#region
/// <summary>
/// 更新分部分项概算费用
+1 -1
View File
@@ -1409,7 +1409,7 @@ namespace BLL
var request = new RestRequest(Method.POST);
request.AddHeader("token", Token);
request.AddHeader("ClientId", SysConstSetService.ClientId);
request.AddHeader("OperationCode", Baseurl.Substring(Baseurl.LastIndexOf("/", StringComparison.Ordinal)));
request.AddHeader("OperationCode", Baseurl.Substring(Baseurl.LastIndexOf("/", StringComparison.Ordinal)+1));
if (!string.IsNullOrEmpty(JsonBody))
{
request.AddJsonBody(JsonBody);
+81 -6
View File
@@ -26,7 +26,8 @@ namespace BLL
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
select x;
where x.ProjectState == Const.ProjectState_1
select x;
/// <summary>
/// 质量数据仓库
@@ -38,7 +39,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1)
{
var getDataList = from x in Funs.DB.Base_Project select x;
IQueryable<Model.Base_Project> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
{
getDataList = getDataList.Where(x => x.ProjectId == projectId);
@@ -56,13 +57,87 @@ namespace BLL
x.ProjectId,
x.ProjectName,
x.ProjectCode,
Rate1 = "0%", //质量验收问题整改率
Rate2 = "0%", //控制点完成率
Rate3 = "0%", //质量检查问题整改率
Rate4 = "0%", //管道焊接一次合格率
Rate1 = getSpotCheckRate(x.ProjectId), //质量验收问题整改率
Rate2 = getSpotCheckDataRate(x.ProjectId), //控制点完成率
Rate3 = getCheckControlStates(x.ProjectId), //质量检查问题整改率
Rate4 = getFirstPassRate(x.ProjectId), //管道焊接一次合格率
};
}
#endregion
/// <summary>
/// 质量验收问题整改率
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static string getSpotCheckRate(string projectId)
{
//// 实体验收 资料验收
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
where (y.ProjectId == projectId || projectId == null) && y.State == "8"
select x;
int all = getSpotCheckDetail.Count();
// this.lbSpotCheck1.Text = all.ToString();
int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格
// this.lbSpotCheck2.Text= okCount.ToString();
return all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString() + "%" : "0%";
}
/// <summary>
/// 控制点完成率
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static string getSpotCheckDataRate(string projectId)
{
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
where (y.ProjectId == projectId || projectId == null) && y.State == "8"
select x;
/// 资料验收合格项目
var getOKSpotCheckDetail = getSpotCheckDetail.Where(x => x.IsOK == true);
int okYSCount = getOKSpotCheckDetail.Count(); //验收合格
int okDateCount = getSpotCheckDetail.Where(x => x.IsDataOK == "1").Count(); //资料合格
return okYSCount > 0 ? Math.Round(okDateCount * 100.0 / (okYSCount * 1.0)).ToString() + "%" : "0%";
}
/// <summary>
/// 质量检查问题整改率
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static string getCheckControlStates(string projectId)
{
var getCheck_CheckControl = from x in Funs.DB.Check_CheckControl
where (x.ProjectId == projectId || projectId == null)
select x;
int allCheckControlCount = getCheck_CheckControl.Count();
int okCheckControlCount = getCheck_CheckControl.Where(x => x.State == "7").Count(); ///已整改
return allCheckControlCount > 0 ? Math.Round(okCheckControlCount * 100.0 / (allCheckControlCount * 1.0)).ToString() + "%" : "0%";
}
/// <summary>
/// 管道焊接一次合格率
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static string getFirstPassRate(string projectId)
{
var getJots = from x in Funs.DB.HJGL_Batch_NDEItem
join y in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId
join z in Funs.DB.HJGL_Batch_PointBatchItem on y.PointBatchItemId equals z.PointBatchItemId
join a in Funs.DB.HJGL_Batch_NDE on x.NDEID equals a.NDEID
where z.PointDate != null && z.PointState == "1" && y.RepairRecordId == null
&& (a.ProjectId == projectId || projectId == null)
select x;
int allHJCount = getJots.Count();
var getOk = getJots.Where(x => x.CheckResult == "1");
int okHJCount = getOk.Count();
return allHJCount > 0 ? Math.Round(okHJCount * 100.0 / (allHJCount * 1.0)).ToString() + "%" : "0%";
}
}
}
+42 -6
View File
@@ -26,7 +26,8 @@ namespace BLL
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
select x;
where x.ProjectState == Const.ProjectState_1
select x;
/// <summary>
/// 安全数据仓库
@@ -38,7 +39,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1)
{
var getDataList = from x in Funs.DB.Base_Project select x;
IQueryable<Model.Base_Project> getDataList = getDataLists;
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
{
getDataList = getDataList.Where(x => x.ProjectId == projectId);
@@ -56,13 +57,48 @@ namespace BLL
x.ProjectId,
x.ProjectName,
x.ProjectCode,
Count1=0, //人员数量
Count2 =0, //安全人工时
Count3 =0, //安全培训次数
ProblemRate = "0%", //安全巡检整改率
Count1=db.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量
Count2 = getProjecctSafeHours(x.ProjectId), //安全人工时
Count3 =db.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数
ProblemRate = getProblemRate(x.ProjectId), //安全巡检整改率
};
}
#endregion
/// <summary>
/// 安全人工时
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static int getProjecctSafeHours(string projectId)
{
int count = 0;
var getPersonInOutNumber = (from x in Funs.DB.SitePerson_PersonInOutNumber
where (x.ProjectId == projectId || projectId == null)
select x).OrderByDescending(x => x.InOutDate).FirstOrDefault();
if (getPersonInOutNumber != null)
{
count = getPersonInOutNumber.WorkHours ?? 0;
}
return count;
}
/// <summary>
/// 安全问题整改率
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static string getProblemRate(string projectId)
{
var getAllHazardRegister = from x in Funs.DB.HSSE_Hazard_HazardRegister
where (x.ProjectId == projectId || projectId == null)
&& x.States != null && x.States != "4" && x.States != "0"
select x;
int allHazardCount = getAllHazardRegister.Count();
int cHazardCount = getAllHazardRegister.Where(x => x.States == "3").Count();
return allHazardCount > 0 ? Math.Round(cHazardCount * 100.0 / (allHazardCount * 1.0)).ToString() + "%" : "0%";
}
}
}
+37 -3
View File
@@ -26,7 +26,7 @@ namespace BLL
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
select x;
select x;
/// <summary>
/// 进度数据仓库
@@ -36,7 +36,7 @@ namespace BLL
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1)
public static IEnumerable getDataDWList(string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1)
{
var getDataList = from x in Funs.DB.Base_Project select x;
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
@@ -56,10 +56,44 @@ namespace BLL
x.ProjectId,
x.ProjectName,
x.ProjectCode,
JDRate = "0%", //项目进度完成百分比
JDRate = getJDRate(x.ProjectId, startTime, endTime), //项目进度完成百分比
};
}
#endregion
/// <summary>
/// 进度百分比
/// </summary>
/// <returns></returns>
public static string getJDRate(string projectId, DateTime? startTime, DateTime? endTime)
{
double totalSJCost = 0; ////累计实际费用
decimal totalPlanCost = 0; ////计划费用
var getViewWorkPackageParentDetail = from x in Funs.DB.View_WBS_WorkPackageParentDetail
where (x.ProjectId == projectId || projectId == null) && (x.ParentId == "1" || x.ParentId == "2")
select x;
if (startTime.HasValue)
{
getViewWorkPackageParentDetail = getViewWorkPackageParentDetail.Where(x => x.Months >= startTime);
}
if (endTime.HasValue)
{
getViewWorkPackageParentDetail = getViewWorkPackageParentDetail.Where(x => x.Months <= endTime);
}
if (getViewWorkPackageParentDetail.Count() > 0)
{
totalSJCost = getViewWorkPackageParentDetail.Sum(x => x.TotalThisValue ?? 0);
}
var getUnitWork = from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId select x;
if (getUnitWork.Count() > 0)
{
totalPlanCost = getUnitWork.Sum(x => x.PlanCost ?? 0);
}
///项目进度完成百分比
decimal s = Convert.ToDecimal(totalSJCost);
return totalPlanCost > 0 ? Math.Round(s / totalPlanCost).ToString() + "%" : "0%";
}
}
}
@@ -0,0 +1,123 @@
using FineUIPro;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web.Util;
namespace BLL
{
/// <summary>
/// WBS分析
/// </summary>
public static class ProjectWBSAnalysisService
{
public static Model.SGGLDB db = Funs.DB;
#region WBS分析
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.WBS_WorkPackage> getDataLists = from x in db.WBS_WorkPackage
where x.IsApprove == true
select x;
/// <summary>
/// 合同管理数据仓库
/// </summary>
/// <param name="projectId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getDataDWList(string projectId, string workPackageId, Grid Grid1)
{
var getDataList = getDataLists.Where(x => x.ProjectId == projectId);
if (string.IsNullOrEmpty(workPackageId))
{
List<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
Model.WBS_WorkPackage work1 = new Model.WBS_WorkPackage
{
WorkPackageCode = "1",
PackageContent = "建筑工程",
};
listWork.Add(work1);
Model.WBS_WorkPackage work2 = new Model.WBS_WorkPackage
{
WorkPackageCode = "2",
PackageContent = "安装工程",
};
listWork.Add(work2);
getDataList = listWork.AsQueryable();
}
else
{
if (workPackageId != "1" && workPackageId != "2")
{
var getUnitWork = db.WBS_UnitWork.FirstOrDefault(x => x.ProjectId == projectId && x.UnitWorkId == workPackageId);
if (getUnitWork != null)
{
getDataList = getDataList.Where(x => x.UnitWorkId == workPackageId && x.SuperWorkPack == null);
}
else
{
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
if (getDataList.Count() == 0)
{
getDataList = getDataLists.Where(x => x.WorkPackageId == workPackageId);
}
}
}
else
{
var getUnitWork = from x in db.WBS_UnitWork
where x.ProjectId == projectId && x.SuperUnitWork == null && x.ProjectType == workPackageId
select x;
List<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
foreach (var item in getUnitWork)
{
Model.WBS_WorkPackage workItem = new Model.WBS_WorkPackage
{
WorkPackageCode = item.UnitWorkId,
PackageContent = item.UnitWorkCode + "-" + item.UnitWorkName,
};
listWork.Add(workItem);
}
getDataList = listWork.AsQueryable();
}
}
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.WorkPackageCode,
x.PackageContent,
Count1 = 0,
Count2 = 0,
Count3 = 0,
Count4 = 0,
Count5 = 0,
Count6 = 0,
};
}
#endregion
}
}
+20 -30
View File
@@ -38,49 +38,39 @@ namespace BLL
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getDataDWList(string level,string workPackageId, Grid Grid1)
public static IEnumerable getDataDWList(string workPackageId, Grid Grid1)
{
var getDataList = getDataLists;
if (level == "0")
if (string.IsNullOrEmpty(workPackageId) )
{
List<Model.WBS_WorkPackageInit> listWork = new List<Model.WBS_WorkPackageInit>();
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "1")
Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit
{
Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit
{
WorkPackageCode = "1",
PackageContent = "建筑工程",
};
listWork.Add(work1);
}
if (string.IsNullOrEmpty(workPackageId) || workPackageId == "2")
WorkPackageCode = "1",
PackageContent = "建筑工程",
};
listWork.Add(work1);
Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit
{
Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit
{
WorkPackageCode = "2",
PackageContent = "安装工程",
};
listWork.Add(work2);
}
WorkPackageCode = "2",
PackageContent = "安装工程",
};
listWork.Add(work2);
getDataList = listWork.AsQueryable();
}
else
{
if (level == "1")
if (workPackageId != "1" && workPackageId != "2")
{
getDataList = getDataList.Where(x => x.SuperWorkPack == null);
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
if (getDataList.Count() == 0)
{
getDataList = getDataLists.Where(x => x.WorkPackageCode == workPackageId);
}
}
if (!string.IsNullOrEmpty(workPackageId))
else
{
if (workPackageId != "1" && workPackageId != "2")
{
getDataList = getDataList.Where(x => x.SuperWorkPack == workPackageId);
}
else
{
getDataList = getDataList.Where(x => x.ProjectType == workPackageId);
}
getDataList = getDataList.Where(x => x.ProjectType == workPackageId && x.SuperWorkPack == null);
}
}
+47 -2
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using BLL;
using System.Collections.Generic;
namespace BLL
{
@@ -40,6 +41,10 @@ namespace BLL
{
dropName.DataSource = HSSE_getCertificateType();
}
else if (groupId == Group_ProjectPersonStates)
{
dropName.DataSource = HSSE_getProjectPersonStates();
}
dropName.DataBind();
if (isShowPlease)
{
@@ -74,7 +79,10 @@ namespace BLL
{
rblName.DataSource = HSSE_getContractType();
}
else if (groupId == Group_ProjectPersonStates)
{
rblName.DataSource = HSSE_getProjectPersonStates();
}
rblName.DataBind();
if (!string.IsNullOrEmpty(selectValue))
{
@@ -105,6 +113,10 @@ namespace BLL
/// </summary>
public const string Group_PersonType = "PersonType";
/// <summary>
/// 项目人员状态 组id
/// </summary>
public const string Group_ProjectPersonStates = "ProjectPersonStates";
/// <summary>
/// 合同类型 组id
/// </summary>
public const string Group_ContractType = "ContractType";
@@ -330,6 +342,39 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 人员类型 名称
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string HSSE_getProjectPersonStates(string value)
{
string name = string.Empty;
var getType = HSSE_getProjectPersonStates().FirstOrDefault(x => x.Value == value);
if (getType != null)
{
name = getType.Text;
}
return name;
}
/// <summary>
/// 人员类型
/// </summary>
/// <returns></returns>
public static ListItem[] HSSE_getProjectPersonStates()
{
ListItem[] list = new ListItem[4];
list[0] = new ListItem("在审", Const.ProjectPersonStates_0);
list[1] = new ListItem("在岗", Const.ProjectPersonStates_1);
list[2] = new ListItem("离岗", Const.ProjectPersonStates_2);
list[3] = new ListItem("打回", Const.ProjectPersonStates_R);
return list;
}
#endregion
#region
/// <summary>
/// 人员类型 名称
@@ -71,7 +71,11 @@ namespace BLL
RegisterTypes2Id = hazardRegister.RegisterTypes2Id,
RegisterTypes3Id = hazardRegister.RegisterTypes3Id,
RegisterTypes4Id = hazardRegister.RegisterTypes4Id,
CCManIds = hazardRegister.CCManIds
CCManIds = hazardRegister.CCManIds,
WorkPackageId = hazardRegister.WorkPackageId,
WorkPackageName = hazardRegister.WorkPackageName,
};
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister);
db.SubmitChanges();
@@ -116,6 +120,9 @@ namespace BLL
newHazardRegister.RegisterTypes3Id = hazardRegister.RegisterTypes3Id;
newHazardRegister.RegisterTypes4Id = hazardRegister.RegisterTypes4Id;
newHazardRegister.CCManIds = hazardRegister.CCManIds;
newHazardRegister.WorkPackageId = newHazardRegister.WorkPackageId;
newHazardRegister.WorkPackageName = newHazardRegister.WorkPackageName;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
@@ -137,7 +137,7 @@ namespace BLL
/// <param name="PageIndex">页码</param>
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getInPsersonListData(string projectId, string unitId, string personName, string identityCard, Grid Grid1)
public static IEnumerable getInPersonListData(string projectId, string unitId, string personName, string identityCard, Grid Grid1)
{
IQueryable<Model.SitePerson_Person> getInPersonList = getInPersonLists.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
@@ -183,6 +183,103 @@ namespace BLL
}
#endregion
#region
/// <summary>
/// 记录数
/// </summary>
public static int nowCount
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.SitePerson_PersonInOutNow> getNowPersonLists = from x in db.SitePerson_PersonInOutNow
select x;
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="PageIndex">页码</param>
/// <param name="PageSize">每页数量</param>
/// <returns></returns>
public static IEnumerable getNowPersonListData(string projectId, string unitId, string workPostId, string personName, string identityCard, DateTime dateValue, Grid Grid1)
{
IQueryable<Model.SitePerson_PersonInOutNow> getDayAll = getNowPersonLists.Where(x=>x.ProjectId == projectId
&& x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
&& x.ChangeTime.Value.Day == dateValue.Day);
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
{
getDayAll = getDayAll.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(personName))
{
getDayAll = getDayAll.Where(x => x.PersonName.Contains(personName));
}
if (!string.IsNullOrEmpty(identityCard))
{
getDayAll = getDayAll.Where(x => x.IdentityCard.Contains(identityCard));
}
if (!string.IsNullOrEmpty(workPostId) && workPostId != Const._Null)
{
getDayAll = getDayAll.Where(x => x.WorkPostId == workPostId);
}
if (getDayAll.Count() > 0)
{
var getInMaxs = from x in getDayAll
group x by x.PersonId into g
select new
{
ProjectId = g.First().ProjectId,
PersonId = g.First().PersonId,
personName = g.First().PersonName,
identityCard = g.First().IdentityCard,
UnitId = g.First().UnitId,
UnitName = g.First().UnitName,
WorkPostName = g.First().WorkPostName,
ChangeTime = g.Max(x => x.ChangeTime),
IsIn = g.First().IsIn,
PostType = g.First().PostType,
WorkPostId = g.First().WorkPostId,
};
if (getInMaxs.Count() > 0)
{
getInMaxs = getInMaxs.Where(x => x.IsIn == true);
}
nowCount = getInMaxs.Count();
if (nowCount == 0)
{
return null;
}
getInMaxs = SortConditionHelper.SortingAndPaging(getInMaxs, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in getInMaxs
select new
{
x.PersonId,
x.personName,
x.identityCard,
CardNo =db.SitePerson_Person.First(p=>p.PersonId == x.PersonId && p.ProjectId ==x.ProjectId).CardNo,
x.UnitName,
x.UnitId,
x.WorkPostId,
x.WorkPostName,
TeamGroupName=TeamGroupService.GetTeamGroupNameByPersonId(x.ProjectId,x.PersonId),
x.ChangeTime,
};
}
else
{
inCount =0;
return null;
}
}
#endregion
#region --
#region
/// <summary>
+15
View File
@@ -167,5 +167,20 @@ namespace BLL
}
return name;
}
public static string GetTeamGroupNameByPersonId(string projectId, string personId)
{
string name = string.Empty;
var getSitePerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.PersonId == personId);
if (getSitePerson != null)
{
var TeamGroup = Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.TeamGroupId == getSitePerson.TeamGroupId);
if (TeamGroup != null)
{
name = TeamGroup.TeamGroupName;
}
}
return name;
}
}
}