Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -443,13 +443,13 @@ namespace BLL
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId)
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId,string name)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
|
||||
var getPersons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.States == Const.ProjectPersonStates_1
|
||||
where x.ProjectId == projectId && x.States == Const.ProjectPersonStates_1
|
||||
select new Model.PersonItem
|
||||
{
|
||||
SitePersonId = x.SitePersonId,
|
||||
@@ -476,12 +476,23 @@ namespace BLL
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(unitIds))
|
||||
{
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
getPersons = getPersons.Where(x => unitIdList.Contains(x.UnitId));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(workPostIds))
|
||||
{
|
||||
List<string> workPostIdList = Funs.GetStrListByStr(workPostIds, ',');
|
||||
getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
getPersons = getPersons.Where(x => x.PersonName.Contains(name));
|
||||
}
|
||||
|
||||
List<Model.PersonItem> getTrainPersonList = new List<Model.PersonItem>();
|
||||
var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId);
|
||||
if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace BLL
|
||||
CertificateName = certificate.CertificateName,
|
||||
CertificateType = certificate.CertificateType,
|
||||
IsRegisterHSSE = certificate.IsRegisterHSSE,
|
||||
Type= certificate.Type,
|
||||
Remark = certificate.Remark
|
||||
};
|
||||
db.Base_Certificate.InsertOnSubmit(newCertificate);
|
||||
@@ -54,6 +55,7 @@ namespace BLL
|
||||
newCertificate.CertificateName = certificate.CertificateName;
|
||||
newCertificate.CertificateType = certificate.CertificateType;
|
||||
newCertificate.IsRegisterHSSE = certificate.IsRegisterHSSE;
|
||||
newCertificate.Type = certificate.Type;
|
||||
newCertificate.Remark = certificate.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace BLL
|
||||
newControlItemAndCycle.InitControlItemCode = ControlItemAndCycle.InitControlItemCode;
|
||||
newControlItemAndCycle.PlanCompleteDate = ControlItemAndCycle.PlanCompleteDate;
|
||||
newControlItemAndCycle.Costs = ControlItemAndCycle.Costs;
|
||||
newControlItemAndCycle.CheckAcceptType = ControlItemAndCycle.CheckAcceptType;
|
||||
|
||||
db.WBS_ControlItemAndCycle.InsertOnSubmit(newControlItemAndCycle);
|
||||
db.SubmitChanges();
|
||||
@@ -97,6 +98,8 @@ namespace BLL
|
||||
newControlItemAndCycle.CheckNum = ControlItemAndCycle.CheckNum;
|
||||
newControlItemAndCycle.PlanCompleteDate = ControlItemAndCycle.PlanCompleteDate;
|
||||
newControlItemAndCycle.Costs = ControlItemAndCycle.Costs;
|
||||
newControlItemAndCycle.CheckAcceptType = ControlItemAndCycle.CheckAcceptType;
|
||||
newControlItemAndCycle.RealEndDate = ControlItemAndCycle.RealEndDate;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace BLL
|
||||
newControlItem.SHForms = controlItem.SHForms;
|
||||
newControlItem.Standard = controlItem.Standard;
|
||||
newControlItem.ClauseNo = controlItem.ClauseNo;
|
||||
newControlItem.CheckAcceptType = controlItem.CheckAcceptType;
|
||||
|
||||
db.WBS_ControlItemInit.InsertOnSubmit(newControlItem);
|
||||
db.SubmitChanges();
|
||||
@@ -73,6 +74,7 @@ namespace BLL
|
||||
newControlItem.SHForms = controlItem.SHForms;
|
||||
newControlItem.Standard = controlItem.Standard;
|
||||
newControlItem.ClauseNo = controlItem.ClauseNo;
|
||||
newControlItem.CheckAcceptType = controlItem.CheckAcceptType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace BLL
|
||||
newControlItem.Standard = controlItem.Standard;
|
||||
newControlItem.ClauseNo = controlItem.ClauseNo;
|
||||
newControlItem.CheckNum = controlItem.CheckNum;
|
||||
newControlItem.CheckAcceptType = controlItem.CheckAcceptType;
|
||||
|
||||
db.WBS_ControlItemProject.InsertOnSubmit(newControlItem);
|
||||
db.SubmitChanges();
|
||||
@@ -76,6 +77,7 @@ namespace BLL
|
||||
newControlItem.Standard = controlItem.Standard;
|
||||
newControlItem.ClauseNo = controlItem.ClauseNo;
|
||||
newControlItem.CheckNum = controlItem.CheckNum;
|
||||
newControlItem.CheckAcceptType = controlItem.CheckAcceptType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace BLL
|
||||
newPack.PackageContent = workPack.PackageContent;
|
||||
newPack.IsChild = workPack.IsChild;
|
||||
newPack.ProjectType = workPack.ProjectType;
|
||||
newPack.SubItemType = workPack.SubItemType;
|
||||
db.WBS_WorkPackageInit.InsertOnSubmit(newPack);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -34,7 +35,7 @@ namespace BLL
|
||||
Model.WBS_WorkPackageInit newPack = db.WBS_WorkPackageInit.First(e => e.WorkPackageCode == workPack.WorkPackageCode);
|
||||
newPack.IsChild = workPack.IsChild;
|
||||
newPack.PackageContent = workPack.PackageContent;
|
||||
|
||||
newPack.SubItemType = workPack.SubItemType;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace BLL
|
||||
newPack.PackageContent = workPack.PackageContent;
|
||||
newPack.IsChild = workPack.IsChild;
|
||||
newPack.ProjectType = workPack.ProjectType;
|
||||
newPack.SubItemType = workPack.SubItemType;
|
||||
db.WBS_WorkPackageProject.InsertOnSubmit(newPack);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -35,6 +36,7 @@ namespace BLL
|
||||
newPack.WorkPackageCode = workPack.WorkPackageCode;
|
||||
newPack.IsChild = workPack.IsChild;
|
||||
newPack.PackageContent = workPack.PackageContent;
|
||||
newPack.SubItemType = workPack.SubItemType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
@@ -29,6 +31,15 @@ namespace BLL
|
||||
newWorkPackage.ProjectType = WorkPackage.ProjectType;
|
||||
newWorkPackage.IsApprove = WorkPackage.IsApprove;
|
||||
newWorkPackage.Costs = WorkPackage.Costs;
|
||||
newWorkPackage.SubItemType = WorkPackage.SubItemType;
|
||||
newWorkPackage.PreJobId = WorkPackage.PreJobId;
|
||||
newWorkPackage.PlanProjectQuantity = WorkPackage.PlanProjectQuantity;
|
||||
newWorkPackage.RealProjectQuantity = WorkPackage.RealProjectQuantity;
|
||||
newWorkPackage.PlanStartDate = WorkPackage.PlanStartDate;
|
||||
newWorkPackage.PlanEndDate = WorkPackage.PlanEndDate;
|
||||
newWorkPackage.RealStartDate = WorkPackage.RealStartDate;
|
||||
newWorkPackage.RealEndDate = WorkPackage.RealEndDate;
|
||||
newWorkPackage.Unit = WorkPackage.Unit;
|
||||
|
||||
db.WBS_WorkPackage.InsertOnSubmit(newWorkPackage);
|
||||
db.SubmitChanges();
|
||||
@@ -52,6 +63,19 @@ namespace BLL
|
||||
newWorkPackage.Weights = WorkPackage.Weights;
|
||||
newWorkPackage.IsApprove = WorkPackage.IsApprove;
|
||||
newWorkPackage.Costs = WorkPackage.Costs;
|
||||
newWorkPackage.SubItemType = WorkPackage.SubItemType;
|
||||
newWorkPackage.PreJobId = WorkPackage.PreJobId;
|
||||
newWorkPackage.PlanProjectQuantity = WorkPackage.PlanProjectQuantity;
|
||||
newWorkPackage.RealProjectQuantity = WorkPackage.RealProjectQuantity;
|
||||
newWorkPackage.PlanStartDate = WorkPackage.PlanStartDate;
|
||||
newWorkPackage.PlanEndDate = WorkPackage.PlanEndDate;
|
||||
newWorkPackage.RealStartDate = WorkPackage.RealStartDate;
|
||||
newWorkPackage.RealEndDate = WorkPackage.RealEndDate;
|
||||
newWorkPackage.Unit = WorkPackage.Unit;
|
||||
newWorkPackage.IsMileStone = WorkPackage.IsMileStone;
|
||||
newWorkPackage.PlanCost = WorkPackage.PlanCost;
|
||||
newWorkPackage.JDWeights = WorkPackage.JDWeights;
|
||||
newWorkPackage.PreWorkCode = WorkPackage.PreWorkCode;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -216,5 +240,326 @@ namespace BLL
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取模拟树表格
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static DataTable GetAllTreeDataTable(string projectId, string IsOut)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
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;
|
||||
List<Model.View_WBS> getWBSs = (from x in db.View_WBS where x.ProjectId == projectId select x).ToList();
|
||||
List<Model.View_WBS> WBSList = new List<Model.View_WBS>();
|
||||
DataTable table = new DataTable();
|
||||
table.Columns.Add(new DataColumn("Id", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("SupId", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("Name", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("WBSType", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("ProjectId", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("ShowId", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("JDWeights", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("Unit", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PlanProjectQuantity", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("RealProjectQuantity", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PlanStartDate", typeof(DateTime)));
|
||||
table.Columns.Add(new DataColumn("PlanEndDate", typeof(DateTime)));
|
||||
table.Columns.Add(new DataColumn("RealStartDate", typeof(DateTime)));
|
||||
table.Columns.Add(new DataColumn("RealEndDate", typeof(DateTime)));
|
||||
table.Columns.Add(new DataColumn("IsMileStone", typeof(bool)));
|
||||
table.Columns.Add(new DataColumn("PlanCost", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("PreWorkCode", typeof(String)));
|
||||
table.Columns.Add(new DataColumn("Code", typeof(String)));
|
||||
if (getWBSs.Count() > 0)
|
||||
{
|
||||
List<Model.View_WBS> newList = new List<Model.View_WBS>();
|
||||
var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0");
|
||||
int a = 1;
|
||||
foreach (var item in projectTypes)
|
||||
{
|
||||
item.Code = a.ToString();
|
||||
newList.Add(item);
|
||||
if (string.IsNullOrEmpty(IsOut))
|
||||
{
|
||||
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty);
|
||||
}
|
||||
a++;
|
||||
}
|
||||
DataRow row;
|
||||
foreach (Model.View_WBS item in newList)
|
||||
{
|
||||
row = table.NewRow();
|
||||
row[0] = item.Id;
|
||||
row[1] = item.SupId;
|
||||
row[2] = item.Name;
|
||||
row[3] = item.WBSType;
|
||||
row[4] = item.ProjectId;
|
||||
if (item.WBSType == "WorkPackage")
|
||||
{
|
||||
var childWorkPackages = from x in workPackages where x.SuperWorkPackageId == item.Id && x.IsApprove == true select x;
|
||||
if (childWorkPackages.Count() == 0)
|
||||
{
|
||||
row[5] = item.Id;
|
||||
var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.Id);
|
||||
if (workPackage != null)
|
||||
{
|
||||
if (workPackage.JDWeights != null)
|
||||
{
|
||||
row[6] = decimal.Round(Convert.ToDecimal(workPackage.JDWeights), 2);
|
||||
}
|
||||
row[7] = workPackage.Unit;
|
||||
if (workPackage.PlanProjectQuantity != null)
|
||||
{
|
||||
row[8] = decimal.Round(Convert.ToDecimal(workPackage.PlanProjectQuantity), 2);
|
||||
}
|
||||
if (workPackage.RealProjectQuantity != null)
|
||||
{
|
||||
row[9] = decimal.Round(Convert.ToDecimal(workPackage.RealProjectQuantity), 2);
|
||||
}
|
||||
if (workPackage.PlanStartDate != null)
|
||||
{
|
||||
row[10] = workPackage.PlanStartDate;
|
||||
}
|
||||
if (workPackage.PlanEndDate != null)
|
||||
{
|
||||
row[11] = workPackage.PlanEndDate;
|
||||
}
|
||||
if (workPackage.RealStartDate != null)
|
||||
{
|
||||
row[12] = workPackage.RealStartDate;
|
||||
}
|
||||
if (workPackage.RealEndDate != null)
|
||||
{
|
||||
row[13] = workPackage.RealEndDate;
|
||||
}
|
||||
if (workPackage.IsMileStone != null)
|
||||
{
|
||||
row[14] = workPackage.IsMileStone;
|
||||
}
|
||||
if (workPackage.PlanCost != null)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(workPackage.PlanCost), 2);
|
||||
}
|
||||
row[16] = workPackage.PreWorkCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.WBSType == "UnitWork")
|
||||
{
|
||||
var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == item.Id);
|
||||
if (unitWork != null)
|
||||
{
|
||||
if (unitWork.JDWeights != null)
|
||||
{
|
||||
row[6] = decimal.Round(Convert.ToDecimal(unitWork.JDWeights), 2);
|
||||
}
|
||||
if (unitWork.PlanStartDate != null)
|
||||
{
|
||||
row[10] = unitWork.PlanStartDate;
|
||||
}
|
||||
if (unitWork.PlanEndDate != null)
|
||||
{
|
||||
row[11] = unitWork.PlanEndDate;
|
||||
}
|
||||
if (unitWork.RealStartDate != null)
|
||||
{
|
||||
row[12] = unitWork.RealStartDate;
|
||||
}
|
||||
if (unitWork.RealEndDate != null)
|
||||
{
|
||||
row[13] = unitWork.RealEndDate;
|
||||
}
|
||||
if (unitWork.PlanCost != null)
|
||||
{
|
||||
row[15] = decimal.Round(Convert.ToDecimal(unitWork.PlanCost), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
row[17] = item.Code;
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
return table;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
|
||||
int b = 1;
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.Code = preCode + "." + b.ToString();
|
||||
newList.Add(item);
|
||||
AddDetail(newList, oldList, item.Id, item.Code);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddDetail(List<Model.View_WBS> newList, List<Model.View_WBS> oldList, string id, string preCode, string prefix)
|
||||
{
|
||||
var items = oldList.Where(x => x.SupId == 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);
|
||||
AddDetail(newList, oldList, item.Id, item.Code, prefix + "....");
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
#region 更新工作包、工作项
|
||||
/// <summary>
|
||||
/// 更新月工作包、工作项
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
public static void UpdateWorkPackages(Model.SGGLDB db, Model.WBS_WorkPackage workPackage, DateTime? planStartDate, DateTime? planEndDate, DateTime? realStartDate, DateTime? realEndDate)
|
||||
{
|
||||
if (workPackage != null)
|
||||
{
|
||||
Model.WBS_WorkPackage parentWorkPackage = BLL.WorkPackageService.GetWorkPackageByWorkPackageId(workPackage.SuperWorkPackageId);
|
||||
if (parentWorkPackage != null)
|
||||
{
|
||||
if (planStartDate != null)
|
||||
{
|
||||
if (parentWorkPackage.PlanStartDate == null)
|
||||
{
|
||||
parentWorkPackage.PlanStartDate = planStartDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.PlanStartDate > planStartDate)
|
||||
{
|
||||
parentWorkPackage.PlanStartDate = planStartDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (planEndDate != null)
|
||||
{
|
||||
if (parentWorkPackage.PlanEndDate == null)
|
||||
{
|
||||
parentWorkPackage.PlanEndDate = planEndDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.PlanEndDate < planEndDate)
|
||||
{
|
||||
parentWorkPackage.PlanEndDate = planEndDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (realStartDate != null)
|
||||
{
|
||||
if (parentWorkPackage.RealStartDate == null)
|
||||
{
|
||||
parentWorkPackage.RealStartDate = realStartDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.RealStartDate > realStartDate)
|
||||
{
|
||||
parentWorkPackage.RealStartDate = realStartDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (realEndDate != null)
|
||||
{
|
||||
if (parentWorkPackage.RealEndDate == null)
|
||||
{
|
||||
parentWorkPackage.RealEndDate = realEndDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parentWorkPackage.RealEndDate < realEndDate)
|
||||
{
|
||||
parentWorkPackage.RealEndDate = realEndDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateWorkPackages(db, parentWorkPackage, planStartDate, planEndDate, realStartDate, realEndDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 更新分部分项工程实际完成时间
|
||||
/// </summary>
|
||||
/// <param name="WorkPackage"></param>
|
||||
public static void UpdateWorkPackageRealEndDate(string workPackageId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var controlItemAndCycles = from x in db.WBS_ControlItemAndCycle where x.WorkPackageId == workPackageId && x.IsApprove == true select x;
|
||||
var spotCheckDetails = from x in db.Check_SpotCheckDetail where x.IsOK == true select x;
|
||||
bool b = true;
|
||||
if (controlItemAndCycles.Count() > 0)
|
||||
{
|
||||
foreach (var c in controlItemAndCycles)
|
||||
{
|
||||
if (c.CheckNum != null && c.CheckNum != 0) //检查次数为0表示一直检查
|
||||
{
|
||||
var okSpotCheckDetails = spotCheckDetails.Where(x => x.ControlItemAndCycleId == c.ControlItemAndCycleId);
|
||||
if (okSpotCheckDetails.Count() != c.CheckNum)
|
||||
{
|
||||
b = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
b = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
var LastEndControlItemAndCycle = controlItemAndCycles.OrderByDescending(x => x.RealEndDate).FirstOrDefault();
|
||||
if (LastEndControlItemAndCycle != null)
|
||||
{
|
||||
var workPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == LastEndControlItemAndCycle.WorkPackageId);
|
||||
if (workPackage != null)
|
||||
{
|
||||
workPackage.RealEndDate = LastEndControlItemAndCycle.RealEndDate;
|
||||
UpdateWorkPackages(db, workPackage, null, null, null, workPackage.RealEndDate);
|
||||
db.SubmitChanges();
|
||||
var unitWork = db.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId);
|
||||
//获取是否存在其他未完成的分部分项
|
||||
var notEndOthenWorkPackage = db.WBS_WorkPackage.FirstOrDefault(x => x.UnitWorkId == unitWork.UnitWorkId && x.IsApprove == true && x.RealEndDate == null);
|
||||
if (notEndOthenWorkPackage == null)
|
||||
{
|
||||
if (workPackage.RealEndDate != null)
|
||||
{
|
||||
if (unitWork.RealEndDate == null)
|
||||
{
|
||||
unitWork.RealEndDate = workPackage.RealEndDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unitWork.RealEndDate < workPackage.RealEndDate)
|
||||
{
|
||||
unitWork.RealEndDate = workPackage.RealEndDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string Depart_constructionId = "ab1eb44a-1821-48ee-86f2-64b7e6425efa";
|
||||
|
||||
/// <summary>
|
||||
///公司领导部门id
|
||||
/// </summary>
|
||||
public const string Depart_CompanyLeaderId = "c09c17b7-742a-4d1e-aa26-5470b6782d1e";
|
||||
|
||||
/// <summary>
|
||||
///测试项目id
|
||||
/// </summary>
|
||||
@@ -3343,6 +3348,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string OpinionTemplateUrl = "File\\Excel\\DataOut\\策划评审意见收集汇总表.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 进度计划编制模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string JDPlanTemplateUrl = "File\\Excel\\DataOut\\进度计划编制.xls";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
@@ -4458,6 +4468,13 @@ namespace BLL
|
||||
|
||||
#endregion
|
||||
|
||||
#region 进度
|
||||
/// <summary>
|
||||
/// 项目施工WBS定制
|
||||
/// </summary>
|
||||
public const string PlanSetMenuId = "E23F0879-3E9F-4E7B-9A2D-EFF34798D629";
|
||||
#endregion
|
||||
|
||||
#region 施工综合
|
||||
#region 菜单Id
|
||||
/// <summary>
|
||||
|
||||
@@ -1220,15 +1220,15 @@ namespace BLL
|
||||
{
|
||||
if (score >= 80)
|
||||
{
|
||||
value = "合格";
|
||||
value = "A级(合格)";
|
||||
}
|
||||
else if (score >= 71 && score <= 79)
|
||||
{
|
||||
value = "基本合格";
|
||||
value = "B级(基本合格)";
|
||||
}
|
||||
else if (score <= 70)
|
||||
{
|
||||
value = "不合格";
|
||||
value = "C级(不合格)";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace BLL
|
||||
{
|
||||
dropName.DataSource = HSSE_getContractType();
|
||||
}
|
||||
else if (groupId == Group_CertificateType)
|
||||
{
|
||||
dropName.DataSource = HSSE_getCertificateType();
|
||||
}
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
@@ -104,6 +108,11 @@ namespace BLL
|
||||
/// 合同类型 组id
|
||||
/// </summary>
|
||||
public const string Group_ContractType = "ContractType";
|
||||
|
||||
/// <summary>
|
||||
/// 证书类型 组id
|
||||
/// </summary>
|
||||
public const string Group_CertificateType = "CertificateType";
|
||||
#endregion
|
||||
|
||||
#region 公共平台
|
||||
@@ -350,6 +359,20 @@ namespace BLL
|
||||
list[2] = new ListItem("以完成一定工作量", "3");
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 证书类型
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] HSSE_getCertificateType()
|
||||
{
|
||||
ListItem[] list = new ListItem[4];
|
||||
list[0] = new ListItem("特岗", "1");
|
||||
list[1] = new ListItem("安管", "2");
|
||||
list[2] = new ListItem("特种设备", "3");
|
||||
list[3] = new ListItem("其他", "-1");
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace BLL
|
||||
ProjectId = ePSummaryReport.ProjectId,
|
||||
UnitId = ePSummaryReport.UnitId,
|
||||
YearId = ePSummaryReport.YearId,
|
||||
Quarter= ePSummaryReport.Quarter,
|
||||
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = ePSummaryReport.ContactPerson,
|
||||
@@ -63,6 +64,7 @@ namespace BLL
|
||||
{
|
||||
newReport.UnitId = ePSummaryReport.UnitId;
|
||||
newReport.YearId = ePSummaryReport.YearId;
|
||||
newReport.Quarter = ePSummaryReport.Quarter;
|
||||
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
|
||||
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
|
||||
newReport.ContactPerson = ePSummaryReport.ContactPerson;
|
||||
|
||||
@@ -25,19 +25,18 @@ namespace BLL
|
||||
public static void AddCheckNotice(Model.ProjectSupervision_CheckNotice checkNotice)
|
||||
{
|
||||
Model.ProjectSupervision_CheckNotice newCheckNotice = new Model.ProjectSupervision_CheckNotice();
|
||||
newCheckNotice.CheckNoticeId = checkNotice.CheckNoticeId;
|
||||
//newCheckNotice.SubjectUnitId = checkNotice.SubjectUnitId;
|
||||
newCheckNotice.CheckNoticeId = checkNotice.CheckNoticeId;
|
||||
newCheckNotice.SubjectUnitAdd = checkNotice.SubjectUnitAdd;
|
||||
newCheckNotice.SubjectUnitMan = checkNotice.SubjectUnitMan;
|
||||
newCheckNotice.SubjectUnitTel = checkNotice.SubjectUnitTel;
|
||||
newCheckNotice.CheckStartTime = checkNotice.CheckStartTime;
|
||||
newCheckNotice.CheckEndTime = checkNotice.CheckEndTime;
|
||||
//newCheckNotice.SubjectObject = checkNotice.SubjectObject;
|
||||
newCheckNotice.CheckEndTime = checkNotice.CheckEndTime;
|
||||
newCheckNotice.CheckTeamLeader = checkNotice.CheckTeamLeader;
|
||||
newCheckNotice.CompileMan = checkNotice.CompileMan;
|
||||
newCheckNotice.CompileDate = checkNotice.CompileDate;
|
||||
newCheckNotice.CheckTeamLeaderName = checkNotice.CheckTeamLeaderName;
|
||||
newCheckNotice.UnitId = checkNotice.UnitId;
|
||||
newCheckNotice.DepartId = checkNotice.DepartId;
|
||||
newCheckNotice.SexName = checkNotice.SexName;
|
||||
newCheckNotice.SubjectProjectId = checkNotice.SubjectProjectId;
|
||||
Funs.DB.ProjectSupervision_CheckNotice.InsertOnSubmit(newCheckNotice);
|
||||
@@ -48,7 +47,7 @@ namespace BLL
|
||||
{
|
||||
Model.ProjectSupervision_CheckTeam newCheckTeam = new Model.ProjectSupervision_CheckTeam
|
||||
{
|
||||
CheckTeamId = SQLHelper.GetNewID(typeof(Model.ProjectSupervision_CheckTeam))
|
||||
CheckTeamId = SQLHelper.GetNewID()
|
||||
};
|
||||
;
|
||||
newCheckTeam.CheckNoticeId = newCheckNotice.CheckNoticeId;
|
||||
@@ -84,6 +83,7 @@ namespace BLL
|
||||
newCheckNotice.CompileDate = checkNotice.CompileDate;
|
||||
newCheckNotice.CheckTeamLeaderName = checkNotice.CheckTeamLeaderName;
|
||||
newCheckNotice.UnitId = checkNotice.UnitId;
|
||||
newCheckNotice.DepartId = checkNotice.DepartId;
|
||||
newCheckNotice.SexName = checkNotice.SexName;
|
||||
newCheckNotice.SubjectProjectId = checkNotice.SubjectProjectId;
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
@@ -59,10 +59,9 @@ namespace BLL
|
||||
}
|
||||
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
|
||||
{
|
||||
getDataList = from x in getDataList
|
||||
join y in db.SitePerson_PersonItem on x.PersonId equals y.PersonId
|
||||
where y.ProjectId == projetcId && !y.OutTime.HasValue
|
||||
select x;
|
||||
var idLists=(from x in db.SitePerson_PersonItem where x.ProjectId == projetcId && !x.OutTime.HasValue
|
||||
select x.PersonId).Distinct().ToList();
|
||||
getDataList = getDataList.Where(x => idLists.Contains(x.PersonId));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(personType) && personType != Const._Null)
|
||||
@@ -1031,7 +1030,7 @@ namespace BLL
|
||||
Model.Person_Persons newPerson = db.Person_Persons.FirstOrDefault(e => e.PersonId == person.PersonId);
|
||||
if (newPerson != null)
|
||||
{
|
||||
//newPerson.UnitId = person.UnitId;
|
||||
newPerson.UnitId = person.UnitId;
|
||||
//newPerson.DepartId = person.DepartId;
|
||||
// newPerson.WorkPostId = person.WorkPostId;
|
||||
// newPerson.JobNum = person.JobNum;
|
||||
|
||||
@@ -58,6 +58,12 @@ namespace BLL
|
||||
newUnitWork.NDEUnit = UnitWork.NDEUnit;
|
||||
newUnitWork.Costs = UnitWork.Costs;
|
||||
newUnitWork.MainItemAndDesignProfessionalIds = UnitWork.MainItemAndDesignProfessionalIds;
|
||||
newUnitWork.PlanStartDate = UnitWork.PlanStartDate;
|
||||
newUnitWork.PlanEndDate = UnitWork.PlanEndDate;
|
||||
newUnitWork.RealStartDate = UnitWork.RealStartDate;
|
||||
newUnitWork.RealEndDate = UnitWork.RealEndDate;
|
||||
newUnitWork.PlanCost = UnitWork.PlanCost;
|
||||
newUnitWork.JDWeights = UnitWork.JDWeights;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
GetWeights(UnitWork.ProjectId);
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_MillionsMonthlyReport
|
||||
where x.MillionsMonthlyReportId == millionsMonthlyReportId
|
||||
select new Information_MillionsMonthlyReport
|
||||
@@ -226,7 +226,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_AccidentCauseReport
|
||||
where x.AccidentCauseReportId == accidentCauseReportId
|
||||
select new Information_AccidentCauseReport
|
||||
@@ -612,7 +612,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_DrillConductedQuarterlyReport
|
||||
where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId
|
||||
select new Information_DrillConductedQuarterlyReport
|
||||
@@ -714,7 +714,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_DrillPlanHalfYearReport
|
||||
where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId
|
||||
select new Information_DrillPlanHalfYearReport
|
||||
@@ -808,7 +808,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Environmental_ChemicalReport
|
||||
where x.ChemicalReportId == chemicalReportId
|
||||
select new Model.ChemicalReport
|
||||
@@ -970,7 +970,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Environmental_EnergyReport
|
||||
where x.EnergyReportId == energyReportId
|
||||
select new Model.EnergyReport
|
||||
@@ -1077,7 +1077,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Environmental_ArchitectureReport
|
||||
where x.ArchitectureReportId == chemicalReportId
|
||||
select new Model.ArchitectureReport
|
||||
@@ -1174,7 +1174,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_WorkSummaryReport
|
||||
where x.WorkSummaryReportId == workSummaryReportId
|
||||
select new Model.WorkSummaryReport
|
||||
@@ -1266,7 +1266,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_QualityWorkSummaryReport
|
||||
where x.QualityWorkSummaryReportId == qualityWorkSummaryReportId
|
||||
select new Model.QualityWorkSummaryReport
|
||||
@@ -1357,7 +1357,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_SafetyBriefing
|
||||
where x.SafetyBriefingId == safetyBriefingId
|
||||
select new Model.SafetyBriefing
|
||||
@@ -1450,7 +1450,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_QuarterlyProjectQuality
|
||||
where x.QuarterlyProjectQualityId == quarterlyProjectQualityId
|
||||
select new Model.QuarterlyProjectQuality
|
||||
@@ -1556,7 +1556,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var upReport = from x in db.Information_EPSummaryReport
|
||||
where x.EPSummaryReportId == ePSummaryReportId
|
||||
select new Model.EPSummaryReport
|
||||
@@ -1564,6 +1564,7 @@
|
||||
EPSummaryReportId = x.EPSummaryReportId,
|
||||
UnitId = x.UnitId,
|
||||
YearId = x.YearId,
|
||||
Quarter = x.Quarter,
|
||||
ResponsiblePerson = x.ResponsiblePerson,
|
||||
ResponsiblePersonTel = x.ResponsiblePersonTel,
|
||||
ContactPerson = x.ContactPerson,
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace BLL
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="yearId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearId(string unitId, int yearId)
|
||||
public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearIdAndQuarters(string unitId, int yearId, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId);
|
||||
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,6 +43,7 @@ namespace BLL
|
||||
EPSummaryReportId = ePSummaryReport.EPSummaryReportId,
|
||||
UnitId = ePSummaryReport.UnitId,
|
||||
YearId = ePSummaryReport.YearId,
|
||||
Quarter = ePSummaryReport.Quarter,
|
||||
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = ePSummaryReport.ContactPerson,
|
||||
@@ -73,6 +74,7 @@ namespace BLL
|
||||
{
|
||||
newReport.UnitId = ePSummaryReport.UnitId;
|
||||
newReport.YearId = ePSummaryReport.YearId;
|
||||
newReport.Quarter = ePSummaryReport.Quarter;
|
||||
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
|
||||
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
|
||||
newReport.ContactPerson = ePSummaryReport.ContactPerson;
|
||||
|
||||
@@ -1518,12 +1518,13 @@ namespace BLL
|
||||
join v in Funs.DB.ProjectData_TeamGroup on p.TeamGroupId equals v.TeamGroupId
|
||||
join r in Funs.DB.RealName_CollTeam on v.TeamId equals r.TeamId
|
||||
join pu in Funs.DB.Project_ProjectUnit on new { x.UnitId, x.ProjectId } equals new { pu.UnitId, pu.ProjectId }
|
||||
where x.IdcardNumber != null && x.ChangeTime.HasValue
|
||||
where x.ChangeTime.HasValue
|
||||
&& (proCode == null || x.ProCode == proCode)
|
||||
&& v.TeamId.HasValue && r.TeamId.HasValue
|
||||
&& p.States == Const.State_1
|
||||
&& !x.RealNamePushTime.HasValue
|
||||
&& z.JTproCode != null && pu.IsSynchro == true
|
||||
&& z.JTproCode.Length> 0
|
||||
&& pu.IsSynchro == true
|
||||
orderby x.ChangeTime descending
|
||||
select new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user