Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -93,6 +93,29 @@ namespace BLL
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// +
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getProjectWBSByUnitWorkId(string projectId, string unitWorkId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.WBS_WorkPackage
|
||||
where x.ProjectId == projectId && x.SuperWorkPack == null && x.UnitWorkId == unitWorkId
|
||||
orderby x.WorkPackageCode
|
||||
select new Model.BaseInfoItem
|
||||
{
|
||||
BaseInfoId = x.WorkPackageId,
|
||||
BaseInfoCode = x.WorkPackageCode,
|
||||
BaseInfoName = x.PackageContent,
|
||||
}
|
||||
).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目、单位ID获取单位工程
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -647,12 +647,15 @@
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogManagementService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogPersonService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogProblemService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogRecordService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionLogWorkEfficiencyService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionPlanApproveService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionPlanService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionReportApproveService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ConstructionReportService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\PictureService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ProjectConstructionLogService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\ReceiveFileManagerService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\WorkHandoverApproveService.cs" />
|
||||
<Compile Include="PZHGL\InformationProject\WorkHandoverDetailService.cs" />
|
||||
|
||||
@@ -21,6 +21,22 @@ namespace BLL
|
||||
return Funs.DB.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipmentId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取机具设备名称
|
||||
/// </summary>
|
||||
/// <param name="specialEquipmentId"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetSpecialEquipmentNameById(string specialEquipmentId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
var q= Funs.DB.Base_SpecialEquipment.FirstOrDefault(e => e.SpecialEquipmentId == specialEquipmentId);
|
||||
if (q != null)
|
||||
{
|
||||
name = q.SpecialEquipmentName;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加机具设备
|
||||
/// </summary>
|
||||
@@ -87,6 +103,17 @@ namespace BLL
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具设备列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_SpecialEquipment> GetAllSpecialEquipmentList()
|
||||
{
|
||||
return (from x in Funs.DB.Base_SpecialEquipment
|
||||
orderby x.SpecialEquipmentCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备下拉框
|
||||
/// </summary>
|
||||
@@ -105,6 +132,24 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isSpecial">项目id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitAllSpecialEquipmentDropDownList(DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "SpecialEquipmentId";
|
||||
dropName.DataTextField = "SpecialEquipmentName";
|
||||
dropName.DataSource = GetAllSpecialEquipmentList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取机具设备列表
|
||||
/// </summary>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -146,21 +146,23 @@ namespace BLL
|
||||
/// <param name="managerRuleApprove">实体验收审批实体</param>
|
||||
public static void AddSpotCheckApprove(Model.Check_SpotCheckApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_SpotCheckApprove));
|
||||
Model.Check_SpotCheckApprove newApprove = new Model.Check_SpotCheckApprove();
|
||||
newApprove.SpotCheckApproveId = newKeyID;
|
||||
newApprove.SpotCheckCode = approve.SpotCheckCode;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SpotCheckDetailId = approve.SpotCheckDetailId;
|
||||
newApprove.Sign = approve.Sign;
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_SpotCheckApprove));
|
||||
Model.Check_SpotCheckApprove newApprove = new Model.Check_SpotCheckApprove();
|
||||
newApprove.SpotCheckApproveId = newKeyID;
|
||||
newApprove.SpotCheckCode = approve.SpotCheckCode;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SpotCheckDetailId = approve.SpotCheckDetailId;
|
||||
newApprove.Sign = approve.Sign;
|
||||
|
||||
db.Check_SpotCheckApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
db.Check_SpotCheckApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static string AddSpotCheckApproveForApi(Model.Check_SpotCheckApprove approve)
|
||||
{
|
||||
@@ -193,16 +195,18 @@ namespace BLL
|
||||
/// <param name="managerRuleApprove">实体验收审批实体</param>
|
||||
public static void UpdateSpotCheckApprove(Model.Check_SpotCheckApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Check_SpotCheckApprove newApprove = db.Check_SpotCheckApprove.First(e => e.SpotCheckApproveId == approve.SpotCheckApproveId && e.ApproveDate == null);
|
||||
newApprove.SpotCheckCode = approve.SpotCheckCode;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Check_SpotCheckApprove newApprove = db.Check_SpotCheckApprove.First(e => e.SpotCheckApproveId == approve.SpotCheckApproveId && e.ApproveDate == null);
|
||||
newApprove.SpotCheckCode = approve.SpotCheckCode;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -79,6 +79,38 @@ namespace BLL
|
||||
return Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.WorkPackageCode == workPackageCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分部分项编号获取分部分项信息
|
||||
/// </summary>
|
||||
/// <param name="workPackageCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetWorkPackageCodeByPackageContent(string packageContent)
|
||||
{
|
||||
string workPackageCode = string.Empty;
|
||||
var q= Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.PackageContent == packageContent);
|
||||
if (q != null)
|
||||
{
|
||||
workPackageCode = q.WorkPackageCode;
|
||||
}
|
||||
return workPackageCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分部分项编号获取分部分项信息
|
||||
/// </summary>
|
||||
/// <param name="workPackageCode"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetPackageContentByWorkPackageCode(string workPackageCode)
|
||||
{
|
||||
string packageContent = string.Empty;
|
||||
var q = Funs.DB.WBS_WorkPackageInit.FirstOrDefault(x => x.WorkPackageCode == workPackageCode);
|
||||
if (q != null)
|
||||
{
|
||||
packageContent = q.PackageContent;
|
||||
}
|
||||
return packageContent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分部分项编号获取子级分部分项信息集合
|
||||
/// </summary>
|
||||
@@ -88,5 +120,23 @@ namespace BLL
|
||||
{
|
||||
return (from x in Funs.DB.WBS_WorkPackageInit where x.SuperWorkPack == workPackageCode select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 样板类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "PackageContent";
|
||||
dropName.DataTextField = "PackageContent";
|
||||
dropName.DataSource = from x in Funs.DB.WBS_WorkPackageInit where x.SuperWorkPack == null orderby x.ProjectType, x.WorkPackageCode select x;
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = getSelectNames(getWorkPackage.WorkPackageId, getWorkPackage.PackageContent + "|" + ControlItemName);
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValues = getSelectNames(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>
|
||||
/// 更新分部分项概算费用
|
||||
@@ -788,7 +866,21 @@ namespace BLL
|
||||
IQueryable<Model.WBS_WorkPackage> workPackages = from x in db.WBS_WorkPackage where x.ProjectId == projectId select x;
|
||||
IQueryable<Model.WBS_UnitWork> unitWorks = from x in db.WBS_UnitWork where x.ProjectId == projectId select x;
|
||||
IQueryable<Model.View_WBS_WorkPackageDetail> getDetails = from x in db.View_WBS_WorkPackageDetail where x.ProjectId == projectId select x;
|
||||
//获取符合时间范围的所有项
|
||||
List<Model.View_WBS> getWBSs = (from x in db.View_WBS where x.ProjectId == projectId select x).ToList();
|
||||
List<Model.View_WBS> list = getWBSs.Where(x => x.PlanEndDate > startTime && x.PlanEndDate <= endTime).ToList();
|
||||
List<Model.View_WBS> newLists = new List<Model.View_WBS>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
var supItem = getWBSs.FirstOrDefault(x => x.Id == item.SupId);
|
||||
if (supItem != null)
|
||||
{
|
||||
newLists.Add(item);
|
||||
newLists.Add(supItem);
|
||||
AddSupItem(supItem, getWBSs, newLists);
|
||||
}
|
||||
}
|
||||
List<string> ids = newLists.Select(x => x.Id).ToList();
|
||||
List<Model.View_WBS> WBSList = new List<Model.View_WBS>();
|
||||
DateTime startDate, endDate, startMonth, endMonth;
|
||||
List<DateTime> months = new List<DateTime>();
|
||||
@@ -844,11 +936,11 @@ namespace BLL
|
||||
newList.Add(item);
|
||||
if (string.IsNullOrEmpty(IsOut))
|
||||
{
|
||||
AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime);
|
||||
AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, ids);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime);
|
||||
AddDetail2(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, ids);
|
||||
}
|
||||
a++;
|
||||
}
|
||||
@@ -990,29 +1082,40 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail2(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, DateTime startTime, DateTime endTime)
|
||||
private static void AddSupItem(Model.View_WBS item, List<Model.View_WBS> getWBSs, List<Model.View_WBS> newLists)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id && x.PlanEndDate > startTime && x.PlanEndDate <= endTime).OrderBy(x => x.Code);
|
||||
var supItem = getWBSs.FirstOrDefault(x => x.Id == item.SupId);
|
||||
if (supItem != null)
|
||||
{
|
||||
newLists.Add(item);
|
||||
newLists.Add(supItem);
|
||||
AddSupItem(supItem, getWBSs, newLists);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail2(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, DateTime startTime, DateTime endTime,List<string> ids)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id && ((x.PlanEndDate > startTime && x.PlanEndDate <= endTime) || ids.Contains(x.Id))).OrderBy(x => x.Code);
|
||||
int b = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.Code = preCode + "." + b.ToString();
|
||||
newList.Add(item);
|
||||
AddDetail2(newList, oldList, item.Id, item.Code, startTime, endTime);
|
||||
AddDetail2(newList, oldList, item.Id, item.Code, startTime, endTime, ids);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail2(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix, DateTime startTime, DateTime endTime)
|
||||
private static void AddDetail2(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix, DateTime startTime, DateTime endTime, List<string> ids)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id && x.PlanEndDate > startTime && x.PlanEndDate <= endTime).OrderBy(x => x.Code);
|
||||
var items = oldList.Where(x => x.SupId == id && ((x.PlanEndDate > startTime && x.PlanEndDate <= endTime) || ids.Contains(x.Id))).OrderBy(x => x.Code);
|
||||
int b = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.Code = preCode + "." + b.ToString();
|
||||
item.Name = prefix + "...." + item.Name;
|
||||
newList.Add(item);
|
||||
AddDetail2(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime);
|
||||
AddDetail2(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, ids);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,6 +342,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa";
|
||||
|
||||
/// <summary>
|
||||
/// 施工经理岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_ConstructionManager = "49198d7c-8d14-4ea6-a495-2fe1aa179769";
|
||||
|
||||
/// <summary>
|
||||
/// HSE工程师岗位Id
|
||||
/// </summary>
|
||||
@@ -367,6 +372,31 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static string WorkPost_Checker = "595999E9-75A8-4064-9BD1-9EE02F236297";
|
||||
|
||||
/// <summary>
|
||||
/// 瓦工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_BricklayerId = "668CB91E-F067-42E6-95ED-FFF1BCCE4576";
|
||||
|
||||
/// <summary>
|
||||
/// 钢筋工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_SteelFixerId = "48280AA2-62D6-4105-AAA7-C38471F44DA9";
|
||||
|
||||
/// <summary>
|
||||
/// 木工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_CarpentryId = "FA155A27-E5E5-44DF-8CC3-05404F572DB8";
|
||||
|
||||
/// <summary>
|
||||
/// 混凝土工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_ConcreteWorkerId = "65F02FD8-6C67-402E-9588-4DAB038A697A";
|
||||
|
||||
/// <summary>
|
||||
/// 架子工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_ScaffolderId = "1331D109-6435-4709-9A35-65AEC7B3F06F";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 系统环境设置常量
|
||||
@@ -4522,9 +4552,14 @@ namespace BLL
|
||||
public const string ConstructionReportMenuId = "0DAFF358-EA16-44B2-8E4B-E15E40EFAAD0";
|
||||
|
||||
/// <summary>
|
||||
/// 项目级施工日志
|
||||
/// 个人施工日志
|
||||
/// </summary>
|
||||
public const string ConstructionLogMenuId = "4CB03F8B-C967-4082-ADF1-08776FE40E21";
|
||||
public const string ConstructionLogMenuId = "0383A4A1-1565-4F11-BAF3-2B84CB621796";
|
||||
|
||||
/// <summary>
|
||||
/// 项目施工日志
|
||||
/// </summary>
|
||||
public const string ProjectConstructionLogMenuId = "D3F67A7B-2FC4-468A-98BB-5F3DF2F193C4";
|
||||
|
||||
/// <summary>
|
||||
/// 项目级施工日志
|
||||
|
||||
@@ -1420,6 +1420,53 @@ namespace BLL
|
||||
IRestResponse response = client.Execute(request);
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据星期几返回值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetWeekDay(string value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
if (value == "Sunday")
|
||||
{
|
||||
return "日";
|
||||
}
|
||||
else if (value == "Monday")
|
||||
{
|
||||
return "一";
|
||||
}
|
||||
else if (value == "Tuesday")
|
||||
{
|
||||
return "二";
|
||||
}
|
||||
else if (value == "Wednesday")
|
||||
{
|
||||
return "三";
|
||||
}
|
||||
else if (value == "Thursday")
|
||||
{
|
||||
return "四";
|
||||
}
|
||||
else if (value == "Friday")
|
||||
{
|
||||
return "五";
|
||||
}
|
||||
else if (value == "Saturday")
|
||||
{
|
||||
return "六";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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%";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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%";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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, Grid Grid1)
|
||||
{
|
||||
var getDataList = from x in Funs.DB.Base_Project select x;
|
||||
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
|
||||
@@ -56,10 +56,29 @@ namespace BLL
|
||||
x.ProjectId,
|
||||
x.ProjectName,
|
||||
x.ProjectCode,
|
||||
Count1=0,
|
||||
Count1= getTotalProfit(x.ProjectId),
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static string getTotalProfit(string projectId)
|
||||
{
|
||||
decimal contractAmount = 0;
|
||||
var getContract = Funs.DB.PHTGL_Contract.Where(x => x.ProjectId == projectId);
|
||||
if (getContract.Count() > 0)
|
||||
{
|
||||
contractAmount = getContract.Sum(x => x.ContractAmount ?? 0);
|
||||
}
|
||||
|
||||
decimal estimatedAmount = 0;
|
||||
var getContractTrack = Funs.DB.PHTGL_ContractTrack.Where(x => x.ProjectId == projectId);
|
||||
if (getContractTrack.Count() > 0)
|
||||
{
|
||||
estimatedAmount = getContractTrack.Sum(x => x.EstimatedAmount ?? 0);
|
||||
}
|
||||
|
||||
return estimatedAmount > 0 ? Math.Round(contractAmount / estimatedAmount).ToString() + "%" : "0%";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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%";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,14 +48,16 @@ namespace BLL
|
||||
List<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
|
||||
Model.WBS_WorkPackage work1 = new Model.WBS_WorkPackage
|
||||
{
|
||||
WorkPackageCode = "1",
|
||||
WorkPackageId = "Type1",
|
||||
PackageContent = "建筑工程",
|
||||
ProjectId = projectId,
|
||||
};
|
||||
listWork.Add(work1);
|
||||
Model.WBS_WorkPackage work2 = new Model.WBS_WorkPackage
|
||||
{
|
||||
WorkPackageCode = "2",
|
||||
WorkPackageId = "Type2",
|
||||
PackageContent = "安装工程",
|
||||
ProjectId = projectId,
|
||||
};
|
||||
listWork.Add(work2);
|
||||
getDataList = listWork.AsQueryable();
|
||||
@@ -88,8 +90,9 @@ namespace BLL
|
||||
{
|
||||
Model.WBS_WorkPackage workItem = new Model.WBS_WorkPackage
|
||||
{
|
||||
WorkPackageCode = item.UnitWorkId,
|
||||
WorkPackageId = item.UnitWorkId,
|
||||
PackageContent = item.UnitWorkCode + "-" + item.UnitWorkName,
|
||||
ProjectId = item.ProjectId,
|
||||
};
|
||||
listWork.Add(workItem);
|
||||
}
|
||||
@@ -107,17 +110,16 @@ namespace BLL
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.WorkPackageCode,
|
||||
x.WorkPackageId,
|
||||
x.PackageContent,
|
||||
Count1 = 0,
|
||||
Count2 = 0,
|
||||
Count3 = 0,
|
||||
Count4 = 0,
|
||||
Count5 = 0,
|
||||
Count6 = 0,
|
||||
Count1 = WBSAnalysisService.getWBSExpertArgumentCount(projectId,x.WorkPackageId),
|
||||
Count2 = WBSAnalysisService.getWBSAccidentCount(projectId, x.WorkPackageId),
|
||||
Count3 = WBSAnalysisService.getWBSHSEProblemCount(projectId, x.WorkPackageId),
|
||||
Count4 = WBSAnalysisService.getWBSSpotCheckRate(projectId, x.WorkPackageId),
|
||||
Count5 = WBSAnalysisService.getWBSSpotCheckDataRate(projectId, x.WorkPackageId),
|
||||
Count6 = WBSAnalysisService.getWBSCheckControlCount(projectId, x.WorkPackageId),
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Org.BouncyCastle.Crypto.Tls;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -46,13 +48,13 @@ namespace BLL
|
||||
List<Model.WBS_WorkPackageInit> listWork = new List<Model.WBS_WorkPackageInit>();
|
||||
Model.WBS_WorkPackageInit work1 = new Model.WBS_WorkPackageInit
|
||||
{
|
||||
WorkPackageCode = "1",
|
||||
WorkPackageCode = "Type1",
|
||||
PackageContent = "建筑工程",
|
||||
};
|
||||
listWork.Add(work1);
|
||||
Model.WBS_WorkPackageInit work2 = new Model.WBS_WorkPackageInit
|
||||
{
|
||||
WorkPackageCode = "2",
|
||||
WorkPackageCode = "Type2",
|
||||
PackageContent = "安装工程",
|
||||
};
|
||||
listWork.Add(work2);
|
||||
@@ -85,15 +87,138 @@ namespace BLL
|
||||
{
|
||||
x.WorkPackageCode,
|
||||
x.PackageContent,
|
||||
Count1=0,
|
||||
Count2 = 0,
|
||||
Count3 = 0,
|
||||
Count4 = 0,
|
||||
Count5 = 0,
|
||||
Count6 = 0,
|
||||
Count1= getWBSExpertArgumentCount(null, x.WorkPackageCode),
|
||||
Count2 = getWBSAccidentCount(null,x.WorkPackageCode),
|
||||
Count3 = getWBSHSEProblemCount(null, x.WorkPackageCode),
|
||||
Count4 = getWBSSpotCheckRate(null, x.WorkPackageCode),
|
||||
Count5 = getWBSSpotCheckDataRate(null, x.WorkPackageCode),
|
||||
Count6 = getWBSCheckControlCount(null, x.WorkPackageCode),
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 危大工程数量
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int getWBSExpertArgumentCount(string projectId,string workPackageId)
|
||||
{
|
||||
var getLargerHazardListItem = from x in Funs.DB.Solution_LargerHazardListItem
|
||||
join y in Funs.DB.Solution_LargerHazardList on x.LargerHazardListId equals y.LargerHazardListId
|
||||
where x.WorkPackageId.Contains(workPackageId)
|
||||
&& y.States == Const.State_1
|
||||
select new {x.LargerHazardListItemId,y.LargerHazardListId,y.ProjectId,x.WorkPackageId };
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getLargerHazardListItem = getLargerHazardListItem.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
|
||||
return getLargerHazardListItem.Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全事故数量
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int getWBSAccidentCount(string projectId, string workPackageId)
|
||||
{
|
||||
var getAccidentPersonRecord = from x in Funs.DB.Accident_AccidentPersonRecord
|
||||
where x.WorkPackageId.Contains(workPackageId)
|
||||
&& x.States == Const.State_2
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getAccidentPersonRecord = getAccidentPersonRecord.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
|
||||
return getAccidentPersonRecord.Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全巡检问题总数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int getWBSHSEProblemCount(string projectId, string workPackageId)
|
||||
{
|
||||
var getHazardRegister = from x in Funs.DB.HSSE_Hazard_HazardRegister
|
||||
where x.States != "4" && x.States != "0"
|
||||
&& x.WorkPackageId.Contains(workPackageId)
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getHazardRegister = getHazardRegister.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
|
||||
return getHazardRegister.Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体验收一次合格率
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static string getWBSSpotCheckRate(string projectId, string workPackageId)
|
||||
{
|
||||
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where x.WorkPackageId.Contains(workPackageId) && (projectId ==null || y.ProjectId == projectId)
|
||||
&& y.State == "8"
|
||||
select new { x.SpotCheckCode ,y.ProjectId,x.IsDataOK,x.IsOnesOK};
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getSpotCheckDetail = getSpotCheckDetail.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
|
||||
int all = getSpotCheckDetail.Count();
|
||||
// this.lbSpotCheck1.Text = all.ToString();
|
||||
int onesOKCount = getSpotCheckDetail.Where(x => x.IsOnesOK == true).Count(); //一次合格
|
||||
return (all > 0 ? Math.Round(onesOKCount * 100.0 / (all * 1.0)).ToString() + "%" : "0%");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 施工资料同步率
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static string getWBSSpotCheckDataRate(string projectId, string workPackageId)
|
||||
{
|
||||
//// 实体验收 资料验收
|
||||
var getSpotCheckDetail = from x in Funs.DB.Check_SpotCheckDetail
|
||||
join y in Funs.DB.Check_SpotCheck on x.SpotCheckCode equals y.SpotCheckCode
|
||||
where x.WorkPackageId.Contains(workPackageId)
|
||||
&& y.State == "8"
|
||||
select new { x.SpotCheckCode, y.ProjectId, x.IsDataOK, x.IsOnesOK,x.IsOK };
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getSpotCheckDetail = getSpotCheckDetail.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
/// 资料验收合格项目
|
||||
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 int getWBSCheckControlCount(string projectId, string workPackageId)
|
||||
{
|
||||
var getCheck_CheckControl = from x in Funs.DB.Check_CheckControl
|
||||
where x.WorkPackageId.Contains(workPackageId)
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getCheck_CheckControl = getCheck_CheckControl.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
|
||||
return getCheck_CheckControl.Count();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -250,8 +250,8 @@ namespace BLL
|
||||
{
|
||||
getInMaxs = getInMaxs.Where(x => x.IsIn == true);
|
||||
}
|
||||
inCount = getInMaxs.Count();
|
||||
if (inCount == 0)
|
||||
nowCount = getInMaxs.Count();
|
||||
if (nowCount == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -429,7 +429,7 @@ namespace BLL
|
||||
public static List<Model.SitePerson_Person> GetSitePersonsByProjectIds(List<string> ProjectIds)
|
||||
{
|
||||
return (from x in Funs.DB.SitePerson_Person
|
||||
where ProjectIds.Contains(x.ProjectId) && x.RoleIds.Length > 1
|
||||
where ProjectIds.Contains(x.ProjectId) && x.RoleIds.Length > 1 && x.States == Const.ProjectPersonStates_1
|
||||
select x).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using EmitMapper;
|
||||
using FineUIPro;
|
||||
@@ -81,37 +82,37 @@ namespace BLL
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ContractNum,
|
||||
x.MainItemCode,
|
||||
x.MainItemName,
|
||||
x.MajorName,
|
||||
x.MajorCode,
|
||||
x.SubProject,
|
||||
x.SubItemProject,
|
||||
x.ProjectCode,
|
||||
x.ProjectName,
|
||||
x.ProjectDescription,
|
||||
x.UnitOfMeasurement,
|
||||
x.Quantity,
|
||||
x.TotalCostFixedComprehensiveUnitPrice,
|
||||
x.MainMaterialCost,
|
||||
x.TotalPrice,
|
||||
x.CalculationRule,
|
||||
x.WorkContent,
|
||||
x.Remarks,
|
||||
x.ConstructionSubcontractor,
|
||||
x.ContractWeight,
|
||||
x.MaterialSupplier,
|
||||
x.IsWithinGeneralContractScope,
|
||||
x.EstimatedQuantity,
|
||||
x.EstimatedAmount,
|
||||
x.SettledQuantity,
|
||||
x.SettledAmount,
|
||||
x.ContractId
|
||||
};
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ContractNum,
|
||||
x.MainItemCode,
|
||||
x.MainItemName,
|
||||
x.MajorName,
|
||||
x.MajorCode,
|
||||
x.SubProject,
|
||||
x.SubItemProject,
|
||||
x.ProjectCode,
|
||||
x.ProjectName,
|
||||
x.ProjectDescription,
|
||||
x.UnitOfMeasurement,
|
||||
x.Quantity,
|
||||
x.TotalCostFixedComprehensiveUnitPrice,
|
||||
x.MainMaterialCost,
|
||||
x.TotalPrice,
|
||||
x.CalculationRule,
|
||||
x.WorkContent,
|
||||
x.Remarks,
|
||||
x.ConstructionSubcontractor,
|
||||
x.ContractWeight,
|
||||
x.MaterialSupplier,
|
||||
x.IsWithinGeneralContractScope,
|
||||
x.EstimatedQuantity,
|
||||
x.EstimatedAmount,
|
||||
x.SettledQuantity,
|
||||
x.SettledAmount,
|
||||
x.ContractId
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -195,8 +196,8 @@ namespace BLL
|
||||
table.EstimatedAmount = newtable.EstimatedAmount;
|
||||
table.SettledQuantity = newtable.SettledQuantity;
|
||||
table.SettledAmount = newtable.SettledAmount;
|
||||
table.ContractId=newtable.ContractId;
|
||||
table.ProjectId=newtable.ProjectId;
|
||||
table.ContractId = newtable.ContractId;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -250,7 +251,7 @@ namespace BLL
|
||||
};
|
||||
if (string.IsNullOrEmpty(item.ProjectCode)) continue;
|
||||
var resultModel = GetPHTGL_ContractTrackByModle(phtglContractTrack);
|
||||
item.ContractNum=ContractService.GetContractById(contractid)?.ContractNum;
|
||||
item.ContractNum = ContractService.GetContractById(contractid)?.ContractNum;
|
||||
if (resultModel.Any())
|
||||
{
|
||||
item.Id = resultModel[0].Id;
|
||||
@@ -267,6 +268,202 @@ namespace BLL
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取模拟树表格
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetAllTreeDataTable(string projectId, string IsOut, List<string> contractNoList, List<string> professionalList, List<string> workPostIds, List<string> machineIds, string constructionLogId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var pros = BLL.PHTGL_QuantityService.GetMajorItems();
|
||||
List<string> proNames = new List<string>();
|
||||
foreach (var item in professionalList)
|
||||
{
|
||||
var pro = pros.FirstOrDefault(x => x.Text == item);
|
||||
if (pro != null)
|
||||
{
|
||||
proNames.Add(pro.Value);
|
||||
}
|
||||
}
|
||||
IQueryable<Model.PHTGL_ContractTrack> getContractTracks = from x in db.PHTGL_ContractTrack
|
||||
where x.ProjectId == projectId && contractNoList.Contains(x.ContractId) && proNames.Contains(x.MajorName)
|
||||
orderby x.ProjectCode, x.ProjectName
|
||||
select x;
|
||||
IQueryable<Model.ZHGL_ConstructionLogWorkEfficiency> workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
where x.ConstructionLogId == constructionLogId
|
||||
select x;
|
||||
var unitWorks = (from x in getContractTracks
|
||||
select new { MainItemCode = x.MainItemCode, MainItemName = x.MainItemName }).Distinct().ToList();
|
||||
|
||||
DataTable table = new DataTable();
|
||||
table.Columns.Add(new DataColumn("Id", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("Code", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("ProjectCode", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("ProjectName", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("UnitOfMeasurement", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PhysicalCompletionQuantity", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MaterialConsumption", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("ShowId", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours0", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency0", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours1", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency1", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours2", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency2", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours3", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency3", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours4", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency4", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours5", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency5", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours6", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency6", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours7", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency7", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours8", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency8", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours9", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency9", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours10", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency10", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours11", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency11", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours12", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency12", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours13", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency13", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours14", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency14", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours15", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency15", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours16", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency16", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours17", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency17", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours18", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency18", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonConsumeHours19", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PersonWorkEfficiency19", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours0", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency0", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours1", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency1", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours2", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency2", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours3", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency3", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours4", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency4", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours5", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency5", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours6", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency6", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours7", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency7", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours8", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency8", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours9", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency9", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours10", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency10", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours11", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency11", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours12", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency12", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours13", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency13", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours14", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency14", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours15", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency15", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours16", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency16", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours17", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency17", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours18", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency18", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineConsumeHours19", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("MachineWorkEfficiency19", typeof(String)));
|
||||
DataRow row;
|
||||
int a = 1;
|
||||
foreach (var unitWork in unitWorks)
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = unitWork.MainItemCode;
|
||||
row[1] = a;
|
||||
row[2] = string.Empty;
|
||||
row[3] = unitWork.MainItemName;
|
||||
table.Rows.Add(row);
|
||||
int b = 1;
|
||||
foreach (var proName in proNames)
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = unitWork.MainItemCode + b.ToString();
|
||||
row[1] = a + "." + b;
|
||||
row[2] = string.Empty;
|
||||
row[3] = proName;
|
||||
table.Rows.Add(row);
|
||||
int c = 1;
|
||||
var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName);
|
||||
foreach (Model.PHTGL_ContractTrack item in contractTracks)
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = item.Id;
|
||||
row[1] = a + "." + b + "." + c;
|
||||
row[2] = item.ProjectCode;
|
||||
row[3] = item.ProjectName;
|
||||
row[4] = item.UnitOfMeasurement;
|
||||
row[7] = item.Id;
|
||||
if (workEfficiencys.Count() > 0)
|
||||
{
|
||||
var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id);
|
||||
if (we != null)
|
||||
{
|
||||
row[5] = we.PhysicalCompletionQuantity;
|
||||
row[6] = we.MaterialConsumption;
|
||||
}
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId== item.Id);
|
||||
if (workEfficiency != null)
|
||||
{
|
||||
if (workEfficiency.ConsumeHours != null)
|
||||
{
|
||||
row[8 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2);
|
||||
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
|
||||
{
|
||||
row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < machineIds.Count; i++)
|
||||
{
|
||||
var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id);
|
||||
if (workEfficiency != null)
|
||||
{
|
||||
if (workEfficiency.ConsumeHours != null)
|
||||
{
|
||||
row[48 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2);
|
||||
if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0)
|
||||
{
|
||||
row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
table.Rows.Add(row);
|
||||
c++;
|
||||
}
|
||||
b++;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
return table;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class PHTGL_ContractTrackDtoIn
|
||||
{
|
||||
@@ -331,5 +528,4 @@ namespace BLL
|
||||
/// </summary>
|
||||
[ExcelColumnIndex("P")] public string Remarks { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,12 +31,8 @@ namespace BLL
|
||||
newConstructionLogMachine.ConstructionLogMachineId = constructionLogMachine.ConstructionLogMachineId;
|
||||
newConstructionLogMachine.ConstructionLogId = constructionLogMachine.ConstructionLogId;
|
||||
newConstructionLogMachine.UnitWorkId = constructionLogMachine.UnitWorkId;
|
||||
newConstructionLogMachine.WJNum = constructionLogMachine.WJNum;
|
||||
newConstructionLogMachine.DCNum = constructionLogMachine.DCNum;
|
||||
newConstructionLogMachine.DZJNum = constructionLogMachine.DZJNum;
|
||||
newConstructionLogMachine.GCNum = constructionLogMachine.GCNum;
|
||||
newConstructionLogMachine.BCNum = constructionLogMachine.BCNum;
|
||||
newConstructionLogMachine.BengCNum = constructionLogMachine.BengCNum;
|
||||
newConstructionLogMachine.MachineId = constructionLogMachine.MachineId;
|
||||
newConstructionLogMachine.Num = constructionLogMachine.Num;
|
||||
|
||||
db.ZHGL_ConstructionLogMachine.InsertOnSubmit(newConstructionLogMachine);
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BLL
|
||||
public static List<Model.ZHGL_ConstructionLogManagement> GetConstructionLogManagementsByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
return (from x in db.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,12 +31,8 @@ namespace BLL
|
||||
newConstructionLogPerson.ConstructionLogPersonId = constructionLogPerson.ConstructionLogPersonId;
|
||||
newConstructionLogPerson.ConstructionLogId = constructionLogPerson.ConstructionLogId;
|
||||
newConstructionLogPerson.UnitWorkId = constructionLogPerson.UnitWorkId;
|
||||
newConstructionLogPerson.WGNum = constructionLogPerson.WGNum;
|
||||
newConstructionLogPerson.GJGNum = constructionLogPerson.GJGNum;
|
||||
newConstructionLogPerson.MGNum = constructionLogPerson.MGNum;
|
||||
newConstructionLogPerson.HNTGNum = constructionLogPerson.HNTGNum;
|
||||
newConstructionLogPerson.HGNum = constructionLogPerson.HGNum;
|
||||
newConstructionLogPerson.JZGNum = constructionLogPerson.JZGNum;
|
||||
newConstructionLogPerson.WorkPostId = constructionLogPerson.WorkPostId;
|
||||
newConstructionLogPerson.Num = constructionLogPerson.Num;
|
||||
|
||||
db.ZHGL_ConstructionLogPerson.InsertOnSubmit(newConstructionLogPerson);
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -1,13 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogProblemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志需要协调解决的问题明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogProblem> getListData(string ConstructionLogId)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogProblem
|
||||
where x.ConstructionLogId == ConstructionLogId
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志需要协调解决的问题明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志需要协调解决的问题明细实体</param>
|
||||
public static void AddConstructionLogProblem(Model.ZHGL_ConstructionLogProblem constructionLogProblem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogProblem newConstructionLogProblem = new Model.ZHGL_ConstructionLogProblem();
|
||||
newConstructionLogProblem.ConstructionLogProblemId = constructionLogProblem.ConstructionLogProblemId;
|
||||
newConstructionLogProblem.ConstructionLogId = constructionLogProblem.ConstructionLogId;
|
||||
newConstructionLogProblem.UnitWorkId = constructionLogProblem.UnitWorkId;
|
||||
newConstructionLogProblem.MainProblem = constructionLogProblem.MainProblem;
|
||||
newConstructionLogProblem.HandlingMeasures = constructionLogProblem.HandlingMeasures;
|
||||
newConstructionLogProblem.WorkPackageId = constructionLogProblem.WorkPackageId;
|
||||
newConstructionLogProblem.ImportanceLevel = constructionLogProblem.ImportanceLevel;
|
||||
|
||||
db.ZHGL_ConstructionLogProblem.InsertOnSubmit(newConstructionLogProblem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志需要协调解决的问题明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志需要协调解决的问题明细编号</param>
|
||||
public static void DeleteConstructionLogProblemsByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogProblem where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogProblem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id获取对应的所有施工日志需要协调解决的问题明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志需要协调解决的问题明细编号</param>
|
||||
public static List<Model.ZHGL_ConstructionLogProblem> GetConstructionLogProblemsByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in db.ZHGL_ConstructionLogProblem where x.ConstructionLogId == ConstructionLogId orderby x.UnitWorkId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogRecordService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志施工经理相关记录明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogRecord> getListData(string ConstructionLogId)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogRecord
|
||||
where x.ConstructionLogId == ConstructionLogId
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志作业人员明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志作业人员明细实体</param>
|
||||
public static void AddConstructionLogRecord(Model.ZHGL_ConstructionLogRecord constructionLogRecord)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogRecord newConstructionLogRecord = new Model.ZHGL_ConstructionLogRecord();
|
||||
newConstructionLogRecord.ConstructionLogRecordId = constructionLogRecord.ConstructionLogRecordId;
|
||||
newConstructionLogRecord.ConstructionLogId = constructionLogRecord.ConstructionLogId;
|
||||
newConstructionLogRecord.Record = constructionLogRecord.Record;
|
||||
newConstructionLogRecord.Remark = constructionLogRecord.Remark;
|
||||
|
||||
db.ZHGL_ConstructionLogRecord.InsertOnSubmit(newConstructionLogRecord);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志作业人员明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志作业人员明细编号</param>
|
||||
public static void DeleteConstructionLogRecordsByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogRecord where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogRecord.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id获取对应的所有施工日志作业人员明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志作业人员明细编号</param>
|
||||
public static List<Model.ZHGL_ConstructionLogRecord> GetConstructionLogRecordsByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in db.ZHGL_ConstructionLogRecord where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@ namespace BLL
|
||||
Professional = ConstructionLog.Professional,
|
||||
CompileMan = ConstructionLog.CompileMan,
|
||||
CompileDate = ConstructionLog.CompileDate,
|
||||
State= ConstructionLog.State,
|
||||
Remark= ConstructionLog.Remark,
|
||||
HSETodaySummary= ConstructionLog.HSETodaySummary,
|
||||
State = ConstructionLog.State,
|
||||
Remark = ConstructionLog.Remark,
|
||||
HSETodaySummary = ConstructionLog.HSETodaySummary,
|
||||
HSETodaySummaryRemark = ConstructionLog.HSETodaySummaryRemark,
|
||||
HSETomorrowPlan = ConstructionLog.HSETomorrowPlan,
|
||||
HSETomorrowPlanRemark = ConstructionLog.HSETomorrowPlanRemark,
|
||||
@@ -60,6 +60,9 @@ namespace BLL
|
||||
CQMSTodaySummaryRemark = ConstructionLog.CQMSTodaySummaryRemark,
|
||||
CQMSTomorrowPlan = ConstructionLog.CQMSTomorrowPlan,
|
||||
CQMSTomorrowPlanRemark = ConstructionLog.CQMSTomorrowPlanRemark,
|
||||
FileCode = ConstructionLog.FileCode,
|
||||
WorkPostId = ConstructionLog.WorkPostId,
|
||||
MachineId = ConstructionLog.MachineId,
|
||||
};
|
||||
db.ZHGL_ConstructionLog.InsertOnSubmit(newConstructionLog);
|
||||
db.SubmitChanges();
|
||||
@@ -75,6 +78,7 @@ namespace BLL
|
||||
Model.ZHGL_ConstructionLog newConstructionLog = db.ZHGL_ConstructionLog.FirstOrDefault(e => e.ConstructionLogId == ConstructionLog.ConstructionLogId);
|
||||
if (newConstructionLog != null)
|
||||
{
|
||||
newConstructionLog.FileCode = ConstructionLog.FileCode;
|
||||
newConstructionLog.Weather = ConstructionLog.Weather;
|
||||
newConstructionLog.Temperature = ConstructionLog.Temperature;
|
||||
newConstructionLog.ContractNo = ConstructionLog.ContractNo;
|
||||
@@ -90,6 +94,8 @@ namespace BLL
|
||||
newConstructionLog.CQMSTodaySummaryRemark = ConstructionLog.CQMSTodaySummaryRemark;
|
||||
newConstructionLog.CQMSTomorrowPlan = ConstructionLog.CQMSTomorrowPlan;
|
||||
newConstructionLog.CQMSTomorrowPlanRemark = ConstructionLog.CQMSTomorrowPlanRemark;
|
||||
newConstructionLog.WorkPostId = ConstructionLog.WorkPostId;
|
||||
newConstructionLog.MachineId = ConstructionLog.MachineId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ConstructionLogWorkEfficiencyService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工日志工效明细列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ZHGL_ConstructionLogWorkEfficiency> getListData(string ConstructionLogId)
|
||||
{
|
||||
return (from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
where x.ConstructionLogId == ConstructionLogId
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工日志工效明细
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工日志工效明细实体</param>
|
||||
public static void AddConstructionLogWorkEfficiency(Model.ZHGL_ConstructionLogWorkEfficiency constructionLogWorkEfficiency)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ConstructionLogWorkEfficiency newConstructionLogWorkEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiency();
|
||||
newConstructionLogWorkEfficiency.ConstructionLogWorkEfficiencyId = constructionLogWorkEfficiency.ConstructionLogWorkEfficiencyId;
|
||||
newConstructionLogWorkEfficiency.ConstructionLogId = constructionLogWorkEfficiency.ConstructionLogId;
|
||||
newConstructionLogWorkEfficiency.ContractTrackId = constructionLogWorkEfficiency.ContractTrackId;
|
||||
newConstructionLogWorkEfficiency.PhysicalCompletionQuantity = constructionLogWorkEfficiency.PhysicalCompletionQuantity;
|
||||
newConstructionLogWorkEfficiency.MaterialConsumption = constructionLogWorkEfficiency.MaterialConsumption;
|
||||
newConstructionLogWorkEfficiency.Type = constructionLogWorkEfficiency.Type;
|
||||
newConstructionLogWorkEfficiency.TypeId = constructionLogWorkEfficiency.TypeId;
|
||||
newConstructionLogWorkEfficiency.ConsumeHours = constructionLogWorkEfficiency.ConsumeHours;
|
||||
|
||||
db.ZHGL_ConstructionLogWorkEfficiency.InsertOnSubmit(newConstructionLogWorkEfficiency);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id删除对应的所有施工日志工效明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志工效明细编号</param>
|
||||
public static void DeleteConstructionLogWorkEfficiencysByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.ZHGL_ConstructionLogWorkEfficiency where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.ZHGL_ConstructionLogWorkEfficiency.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据月报id获取对应的所有施工日志工效明细
|
||||
/// </summary>
|
||||
/// <param name="ConstructionLogId">施工日志工效明细编号</param>
|
||||
public static List<Model.ZHGL_ConstructionLogWorkEfficiency> GetConstructionLogWorkEfficiencysByConstructionLogId(string ConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in db.ZHGL_ConstructionLogWorkEfficiency where x.ConstructionLogId == ConstructionLogId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目级施工日志
|
||||
/// </summary>
|
||||
public static class ProjectConstructionLogService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ProjectConstructionLogId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ProjectConstructionLog GetProjectConstructionLogById(string ProjectConstructionLogId)
|
||||
{
|
||||
return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLogId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目、用户及日期获取项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ProjectConstructionLogId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ZHGL_ProjectConstructionLog GetProjectConstructionLogByProjectIdAndUserIDAndDate(string ProjectConstructionLogId, string projectId, string userId, DateTime date)
|
||||
{
|
||||
return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId != ProjectConstructionLogId && e.ProjectId == projectId && e.CompileMan == userId);
|
||||
//return Funs.DB.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId != ProjectConstructionLogId && e.ProjectId == projectId && e.CompileMan == userId && e.CompileDate == date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ProjectConstructionLog"></param>
|
||||
public static void AddProjectConstructionLog(Model.ZHGL_ProjectConstructionLog ProjectConstructionLog)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ProjectConstructionLog newProjectConstructionLog = new Model.ZHGL_ProjectConstructionLog
|
||||
{
|
||||
ProjectConstructionLogId = ProjectConstructionLog.ProjectConstructionLogId,
|
||||
ProjectId = ProjectConstructionLog.ProjectId,
|
||||
Weather = ProjectConstructionLog.Weather,
|
||||
Temperature = ProjectConstructionLog.Temperature,
|
||||
ContractNo = ProjectConstructionLog.ContractNo,
|
||||
UnitWorks = ProjectConstructionLog.UnitWorks,
|
||||
Professional = ProjectConstructionLog.Professional,
|
||||
CompileMan = ProjectConstructionLog.CompileMan,
|
||||
CompileDate = ProjectConstructionLog.CompileDate,
|
||||
State = ProjectConstructionLog.State,
|
||||
Remark = ProjectConstructionLog.Remark,
|
||||
HSETodaySummary = ProjectConstructionLog.HSETodaySummary,
|
||||
HSETodaySummaryRemark = ProjectConstructionLog.HSETodaySummaryRemark,
|
||||
HSETomorrowPlan = ProjectConstructionLog.HSETomorrowPlan,
|
||||
HSETomorrowPlanRemark = ProjectConstructionLog.HSETomorrowPlanRemark,
|
||||
CQMSTodaySummary = ProjectConstructionLog.CQMSTodaySummary,
|
||||
CQMSTodaySummaryRemark = ProjectConstructionLog.CQMSTodaySummaryRemark,
|
||||
CQMSTomorrowPlan = ProjectConstructionLog.CQMSTomorrowPlan,
|
||||
CQMSTomorrowPlanRemark = ProjectConstructionLog.CQMSTomorrowPlanRemark,
|
||||
FileCode = ProjectConstructionLog.FileCode,
|
||||
WorkPostId = ProjectConstructionLog.WorkPostId,
|
||||
MachineId = ProjectConstructionLog.MachineId,
|
||||
};
|
||||
db.ZHGL_ProjectConstructionLog.InsertOnSubmit(newProjectConstructionLog);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ProjectConstructionLog"></param>
|
||||
public static void UpdateProjectConstructionLog(Model.ZHGL_ProjectConstructionLog ProjectConstructionLog)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ProjectConstructionLog newProjectConstructionLog = db.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLog.ProjectConstructionLogId);
|
||||
if (newProjectConstructionLog != null)
|
||||
{
|
||||
newProjectConstructionLog.FileCode = ProjectConstructionLog.FileCode;
|
||||
newProjectConstructionLog.Weather = ProjectConstructionLog.Weather;
|
||||
newProjectConstructionLog.Temperature = ProjectConstructionLog.Temperature;
|
||||
newProjectConstructionLog.ContractNo = ProjectConstructionLog.ContractNo;
|
||||
newProjectConstructionLog.UnitWorks = ProjectConstructionLog.UnitWorks;
|
||||
newProjectConstructionLog.Professional = ProjectConstructionLog.Professional;
|
||||
newProjectConstructionLog.State = ProjectConstructionLog.State;
|
||||
newProjectConstructionLog.Remark = ProjectConstructionLog.Remark;
|
||||
newProjectConstructionLog.HSETodaySummary = ProjectConstructionLog.HSETodaySummary;
|
||||
newProjectConstructionLog.HSETodaySummaryRemark = ProjectConstructionLog.HSETodaySummaryRemark;
|
||||
newProjectConstructionLog.HSETomorrowPlan = ProjectConstructionLog.HSETomorrowPlan;
|
||||
newProjectConstructionLog.HSETomorrowPlanRemark = ProjectConstructionLog.HSETomorrowPlanRemark;
|
||||
newProjectConstructionLog.CQMSTodaySummary = ProjectConstructionLog.CQMSTodaySummary;
|
||||
newProjectConstructionLog.CQMSTodaySummaryRemark = ProjectConstructionLog.CQMSTodaySummaryRemark;
|
||||
newProjectConstructionLog.CQMSTomorrowPlan = ProjectConstructionLog.CQMSTomorrowPlan;
|
||||
newProjectConstructionLog.CQMSTomorrowPlanRemark = ProjectConstructionLog.CQMSTomorrowPlanRemark;
|
||||
newProjectConstructionLog.WorkPostId = ProjectConstructionLog.WorkPostId;
|
||||
newProjectConstructionLog.MachineId = ProjectConstructionLog.MachineId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除项目级施工日志
|
||||
/// </summary>
|
||||
/// <param name="ProjectConstructionLogId"></param>
|
||||
public static void DeleteProjectConstructionLogById(string ProjectConstructionLogId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ZHGL_ProjectConstructionLog ProjectConstructionLog = db.ZHGL_ProjectConstructionLog.FirstOrDefault(e => e.ProjectConstructionLogId == ProjectConstructionLogId);
|
||||
if (ProjectConstructionLog != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ProjectConstructionLog.ProjectConstructionLogId);
|
||||
db.ZHGL_ProjectConstructionLog.DeleteOnSubmit(ProjectConstructionLog);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取天气状况
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetWeatherList()
|
||||
{
|
||||
ListItem[] lis = new ListItem[4];
|
||||
lis[0] = new ListItem("阴", "阴");
|
||||
lis[1] = new ListItem("晴", "晴");
|
||||
lis[2] = new ListItem("雨", "雨");
|
||||
lis[3] = new ListItem("雪", "雪");
|
||||
return lis;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -841,6 +841,8 @@ namespace BLL
|
||||
newPerson.RelativeTel = person.RelativeTel;
|
||||
newPerson.MultiProject = person.MultiProject;
|
||||
newPerson.HomePageType = person.HomePageType;
|
||||
newPerson.LogWorkPostId = person.LogWorkPostId;
|
||||
newPerson.LogMachineId = person.LogMachineId;
|
||||
|
||||
newPerson.IsCardNoOK = IDCardValid.CheckIDCard(person.IdentityCard);
|
||||
if (string.IsNullOrEmpty(person.QRCodeAttachUrl))
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace BLL
|
||||
newUnitWork.NDEUnit = UnitWork.NDEUnit;
|
||||
newUnitWork.Costs = UnitWork.Costs;
|
||||
newUnitWork.MainItemAndDesignProfessionalIds = UnitWork.MainItemAndDesignProfessionalIds;
|
||||
newUnitWork.ContractId = UnitWork.ContractId;
|
||||
newUnitWork.MainItemCode = UnitWork.MainItemCode;
|
||||
db.WBS_UnitWork.InsertOnSubmit(newUnitWork);
|
||||
db.SubmitChanges();
|
||||
GetWeights(UnitWork.ProjectId);
|
||||
@@ -64,6 +66,8 @@ namespace BLL
|
||||
newUnitWork.RealEndDate = UnitWork.RealEndDate;
|
||||
newUnitWork.PlanCost = UnitWork.PlanCost;
|
||||
newUnitWork.JDWeights = UnitWork.JDWeights;
|
||||
newUnitWork.ContractId = UnitWork.ContractId;
|
||||
newUnitWork.MainItemCode = UnitWork.MainItemCode;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
GetWeights(UnitWork.ProjectId);
|
||||
@@ -273,6 +277,21 @@ namespace BLL
|
||||
return item;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位工程名称项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnitWorkListByContract(string projectId, List<string> contracts)
|
||||
{
|
||||
List<Model.WBS_UnitWork> q = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null && contracts.Contains(x.ContractId) orderby x.UnitWorkCode select x).ToList();
|
||||
ListItem[] item = new ListItem[q.Count()];
|
||||
for (int i = 0; i < q.Count(); i++)
|
||||
{
|
||||
item[i] = new ListItem((q[i].UnitWorkCode + "-" + q[i].UnitWorkName + GetProjectType(q[i].ProjectType)) ?? "", q[i].UnitWorkId.ToString());
|
||||
}
|
||||
return item;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取安装工程单位工程名称项
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
@@ -358,6 +377,22 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 单位工程表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitContractUnitWorkDownList(FineUIPro.DropDownList dropName, string projectId, List<string> contracts, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = BLL.UnitWorkService.GetUnitWorkListByContract(projectId, contracts);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 安装工程单位工程表下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
|
||||
Reference in New Issue
Block a user