提交代码

This commit is contained in:
2023-09-08 17:09:44 +08:00
parent 47f9a0e959
commit 42d3d45c5c
16 changed files with 4544 additions and 1274 deletions
+496 -11
View File
@@ -58,6 +58,11 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.FireWorkId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireLevel = x.FireLevel
}).FirstOrDefault();
}
#endregion
@@ -96,6 +101,14 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.HeightWorkId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
WorkHeight = x.WorkHeight,
HeightLevel = x.HeightLevel,
FireWatchManName = x.FireWatchManName,
WorkLeaderName = x.WorkLeaderName,
WorkLeaderTel = x.WorkLeaderTel,
}).FirstOrDefault();
}
#endregion
@@ -134,6 +147,16 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.LimitedSpaceId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LimitedDescribe = x.LimitedDescribe,
IsBoolOther = x.IsBoolOther,
IsBoolHarmfulGas = x.IsBoolHarmfulGas,
TestResult = x.TestResult,
TestDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestDate),
TestPerson = x.TestPerson,
VenStep = x.VenStep,
}).FirstOrDefault();
}
#endregion
@@ -177,6 +200,9 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.RadialWorkId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
}).FirstOrDefault();
}
#endregion
@@ -215,6 +241,11 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.OpenCircuitId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
}).FirstOrDefault();
}
#endregion
@@ -252,6 +283,11 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.BreakGroundId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
}).FirstOrDefault();
}
#endregion
@@ -332,6 +368,60 @@ namespace BLL
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.LiftingWorkId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LiftingHeight = x.LiftingHeight,
FireWatchManName = x.FireWatchManName,
WorkLeaderName = x.WorkLeaderName,
WorkLeaderTel = x.WorkLeaderTel,
QzgName = x.QzgName,
QzgPhone = x.QzgPhone,
}).FirstOrDefault();
}
#endregion
#region
if (strMenuId == Const.ProjectElectricityMenuId)
{
getInfo = (from x in db.License_Electricity
where x.ElectricityId == id
select new Model.LicenseDataItem
{
LicenseId = x.ElectricityId,
MenuId = strMenuId,
ProjectId = x.ProjectId,
LicenseCode = x.LicenseCode,
ApplyUnitId = x.ApplyUnitId,
ApplyUnitName = db.Base_Unit.First(u => u.UnitId == x.ApplyUnitId).UnitName,
ApplyManId = x.ApplyManId,
ApplyManName = db.Sys_User.First(u => u.UserId == x.ApplyManId).UserName,
ApplyDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ApplyDate),
WorkPalce = x.WorkPalce,
WorkDepth = x.WorkDepth,
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
WorkMeasures = x.WorkMeasures,
CancelManId = x.CancelManId,
CancelManName = db.Sys_User.First(u => u.UserId == x.CancelManId).UserName,
CancelReasons = x.CancelReasons,
CancelTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CancelTime),
CloseManId = x.CloseManId,
CloseManName = db.Sys_User.First(u => u.UserId == x.CloseManId).UserName,
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
NextManId = x.NextManId,
NextManName = db.Sys_User.First(u => u.UserId == x.NextManId).UserName,
AttachUrl = db.AttachFile.First(z => z.ToKeyId == x.ElectricityId).AttachUrl.Replace('\\', '/'),
States = x.States,
OldLicenseId = x.OldLicenseId,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
WorkLeaderName=x.WorkLeaderName,
WorkLeaderTel=x.WorkLeaderTel
}).FirstOrDefault();
}
#endregion
@@ -419,6 +509,11 @@ namespace BLL
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason=x.Reason,
FireLevel=x.FireLevel
}).ToList();
}
#endregion
@@ -455,6 +550,15 @@ namespace BLL
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
WorkHeight=x.WorkHeight,
HeightLevel=x.HeightLevel,
FireWatchManName=x.FireWatchManName,
WorkLeaderName=x.WorkLeaderName,
WorkLeaderTel=x.WorkLeaderTel,
}).ToList();
}
#endregion
@@ -491,6 +595,20 @@ namespace BLL
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LimitedDescribe=x.LimitedDescribe,
IsBoolOther=x.IsBoolOther,
IsBoolHarmfulGas=x.IsBoolHarmfulGas,
TestResult=x.TestResult,
TestDate= string.Format("{0:yyyy-MM-dd HH:mm}", x.TestDate),
TestPerson=x.TestPerson,
VenStep=x.VenStep,
}).ToList();
}
#endregion
@@ -534,6 +652,10 @@ namespace BLL
NextManId = x.NextManId,
NextManName = db.Sys_User.First(u => u.UserId == x.NextManId).UserName,
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
}).ToList();
}
#endregion
@@ -570,6 +692,12 @@ namespace BLL
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason=x.Reason,
FireWatchManName=x.FireWatchManName,
}).ToList();
}
#endregion
@@ -605,6 +733,12 @@ namespace BLL
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason=x.Reason,
FireWatchManName=x.FireWatchManName,
}).ToList();
}
#endregion
@@ -685,6 +819,60 @@ namespace BLL
NextManId = x.NextManId,
NextManName = db.Sys_User.First(u => u.UserId == x.NextManId).UserName,
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LiftingHeight=x.LiftingHeight,
FireWatchManName=x.FireWatchManName,
WorkLeaderName=x.WorkLeaderName,
WorkLeaderTel=x.WorkLeaderTel,
QzgName=x.QzgName,
QzgPhone=x.QzgPhone,
}).ToList();
}
#endregion
#region
if (strMenuId == Const.ProjectElectricityMenuId)
{
getInfoList = (from x in db.License_Electricity
where x.ProjectId == projectId && (x.ApplyUnitId == unitId || unitId == null)
&& (states == null || x.States == states)
orderby x.LicenseCode descending
select new Model.LicenseDataItem
{
LicenseId = x.ElectricityId,
MenuId = strMenuId,
ProjectId = x.ProjectId,
LicenseCode = x.LicenseCode,
ApplyUnitId = x.ApplyUnitId,
ApplyUnitName = db.Base_Unit.First(u => u.UnitId == x.ApplyUnitId).UnitName,
ApplyManId = x.ApplyManId,
ApplyManName = db.Sys_User.First(u => u.UserId == x.ApplyManId).UserName,
ApplyDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ApplyDate),
WorkPalce = x.WorkPalce,
WorkDepth = x.WorkDepth,
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
WorkMeasures = x.WorkMeasures,
CancelManId = x.CancelManId,
CancelManName = db.Sys_User.First(u => u.UserId == x.CancelManId).UserName,
CancelReasons = x.CancelReasons,
CancelTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CancelTime),
CloseManId = x.CloseManId,
CloseManName = db.Sys_User.First(u => u.UserId == x.CloseManId).UserName,
CloseReasons = x.CloseReasons,
CloseTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.CloseTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
WorkLeaderName=x.WorkLeaderName,
WorkLeaderTel=x.WorkLeaderTel,
}).ToList();
}
#endregion
@@ -760,6 +948,11 @@ namespace BLL
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireLevel = x.FireLevel
}).ToList();
if (getFireWork.Count() > 0)
{
@@ -788,6 +981,14 @@ namespace BLL
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
WorkHeight = x.WorkHeight,
HeightLevel = x.HeightLevel,
FireWatchManName = x.FireWatchManName,
WorkLeaderName = x.WorkLeaderName,
WorkLeaderTel = x.WorkLeaderTel,
}).ToList();
if (getHeightWork.Count() > 0)
{
@@ -815,6 +1016,17 @@ namespace BLL
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LimitedDescribe = x.LimitedDescribe,
IsBoolOther = x.IsBoolOther,
IsBoolHarmfulGas = x.IsBoolHarmfulGas,
TestResult = x.TestResult,
TestDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestDate),
TestPerson = x.TestPerson,
VenStep = x.VenStep,
}).ToList();
if (getLimitedSpace.Count() > 0)
{
@@ -843,6 +1055,9 @@ namespace BLL
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
WorkPalce = x.WorkPalce,
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
}).ToList();
if (getRadialWork.Count() > 0)
{
@@ -871,6 +1086,11 @@ namespace BLL
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
RoadName = x.RoadName,
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
}).ToList();
if (getOpenCircuit.Count() > 0)
{
@@ -899,6 +1119,11 @@ namespace BLL
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
}).ToList();
if (getBreakGround.Count() > 0)
{
@@ -954,6 +1179,15 @@ namespace BLL
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
LiftingHeight = x.LiftingHeight,
FireWatchManName = x.FireWatchManName,
WorkLeaderName = x.WorkLeaderName,
WorkLeaderTel = x.WorkLeaderTel,
QzgName = x.QzgName,
QzgPhone = x.QzgPhone,
}).ToList();
if (getLiftingWork.Count() > 0)
{
@@ -961,6 +1195,41 @@ namespace BLL
}
#endregion
#region
var getElectricity = (from x in db.License_Electricity
where x.ProjectId == projectId && (x.ApplyUnitId == unitId || unitId == null)
&& (states == null || x.States == states)
select new Model.LicenseDataItem
{
LicenseId = x.ElectricityId,
MenuId = Const.ProjectElectricityMenuId,
MenuName = "临时用电",
ProjectId = x.ProjectId,
LicenseCode = x.LicenseCode,
ApplyUnitId = x.ApplyUnitId,
ApplyUnitName = db.Base_Unit.First(u => u.UnitId == x.ApplyUnitId).UnitName,
ApplyManId = x.ApplyManId,
ApplyManName = db.Sys_User.First(u => u.UserId == x.ApplyManId).UserName,
ApplyDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.ApplyDate),
WorkPalce = x.WorkPalce,
WorkDepth = x.WorkDepth,
ValidityStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityStartTime),
ValidityEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ValidityEndTime),
States = x.States,
WorkAreaId = x.WorkAreaId,
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
Reason = x.Reason,
FireWatchManName = x.FireWatchManName,
WorkLeaderName=x.WorkLeaderName,
WorkLeaderTel=x.WorkLeaderTel,
}).ToList();
if (getElectricity.Count() > 0)
{
getInfoList.AddRange(getElectricity);
}
#endregion
#region 稿 "待开工"="1";"作业中"="2";"已关闭"="3";"已取消"="-1"
var getLicenseManager = (from x in db.License_LicenseManager
where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null)
@@ -1106,6 +1375,10 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId,
Reason=newItem.Reason,
FireLevel=newItem.FireLevel
};
if (newItem.States == Const.State_0)
@@ -1156,6 +1429,10 @@ namespace BLL
updateFireWork.WorkMeasures = newFireWork.WorkMeasures;
updateFireWork.NextManId = newFireWork.NextManId;
updateFireWork.States = newFireWork.States;
updateFireWork.WorkAreaId = newItem.WorkAreaId;
updateFireWork.Reason = newItem.Reason;
updateFireWork.FireLevel = newItem.FireLevel;
}
updateFireWork.States = newFireWork.States;
}
@@ -1186,6 +1463,15 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId,
WorkHeight=newItem.WorkHeight,
HeightLevel=newItem.HeightLevel,
FireWatchManName=newItem.FireWatchManName,
WorkLeaderName=newItem.WorkLeaderName,
WorkLeaderTel=newItem.WorkLeaderTel,
};
if (newItem.States == Const.State_0)
{
@@ -1236,6 +1522,12 @@ namespace BLL
updateHeightWork.EquipmentTools = newHeightWork.EquipmentTools;
updateHeightWork.NextManId = newHeightWork.NextManId;
updateHeightWork.States = newHeightWork.States;
updateHeightWork.WorkAreaId = newItem.WorkAreaId;
updateHeightWork.WorkHeight = newItem.WorkHeight;
updateHeightWork.HeightLevel = newItem.HeightLevel;
updateHeightWork.FireWatchManName = newItem.FireWatchManName;
updateHeightWork.WorkLeaderName = newItem.WorkLeaderName;
updateHeightWork.WorkLeaderTel = newItem.WorkLeaderTel;
}
updateHeightWork.States = newHeightWork.States;
}
@@ -1266,6 +1558,14 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
LimitedDescribe=newItem.LimitedDescribe,
IsBoolOther=newItem.IsBoolOther,
IsBoolHarmfulGas=newItem.IsBoolHarmfulGas,
TestResult=newItem.TestResult,
TestDate= Funs.GetNewDateTime(newItem.TestDate),
TestPerson=newItem.TestPerson,
VenStep=newItem.VenStep
};
if (newItem.States == Const.State_0)
{
@@ -1315,6 +1615,14 @@ namespace BLL
updateLimitedSpace.WorkMeasures = newLimitedSpace.WorkMeasures;
updateLimitedSpace.NextManId = newLimitedSpace.NextManId;
updateLimitedSpace.States = newLimitedSpace.States;
updateLimitedSpace.LimitedDescribe = newItem.LimitedDescribe;
updateLimitedSpace.IsBoolOther = newItem.IsBoolOther;
updateLimitedSpace.IsBoolHarmfulGas = newItem.IsBoolHarmfulGas;
updateLimitedSpace.TestResult = newItem.TestResult;
updateLimitedSpace.TestDate = Funs.GetNewDateTime(newItem.TestDate);
updateLimitedSpace.TestPerson = newItem.TestPerson;
updateLimitedSpace.VenStep = newItem.VenStep;
}
updateLimitedSpace.States = newLimitedSpace.States;
}
@@ -1348,6 +1656,8 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId
};
if (newItem.States == Const.State_0)
{
@@ -1400,6 +1710,7 @@ namespace BLL
updateRadialWork.WatchManContact = newRadialWork.WatchManContact;
updateRadialWork.NextManId = newRadialWork.NextManId;
updateRadialWork.States = newRadialWork.States;
updateRadialWork.WorkAreaId = newItem.WorkAreaId;
}
updateRadialWork.States = newRadialWork.States;
}
@@ -1430,6 +1741,11 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId,
Reason=newItem.Reason,
FireWatchManName=newItem.FireWatchManName,
};
if (newItem.States == Const.State_0)
{
@@ -1479,6 +1795,10 @@ namespace BLL
updateOpenCircuit.SafeMeasures = newOpenCircuit.SafeMeasures;
updateOpenCircuit.NextManId = newOpenCircuit.NextManId;
updateOpenCircuit.States = newOpenCircuit.States;
updateOpenCircuit.WorkAreaId = newItem.WorkAreaId;
updateOpenCircuit.Reason = newItem.Reason;
updateOpenCircuit.FireWatchManName = newItem.FireWatchManName;
}
updateOpenCircuit.States = newOpenCircuit.States;
}
@@ -1508,6 +1828,10 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId,
Reason=newItem.Reason,
FireWatchManName=newItem.FireWatchManName
};
if (newItem.States == Const.State_0)
{
@@ -1556,6 +1880,10 @@ namespace BLL
updateBreakGround.WorkMeasures = newBreakGround.WorkMeasures;
updateBreakGround.NextManId = newBreakGround.NextManId;
updateBreakGround.States = newBreakGround.States;
updateBreakGround.WorkAreaId = newItem.WorkAreaId;
updateBreakGround.Reason = newItem.Reason;
updateBreakGround.FireWatchManName = newItem.FireWatchManName;
}
updateBreakGround.States = newBreakGround.States;
}
@@ -1669,6 +1997,15 @@ namespace BLL
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId=newItem.WorkAreaId,
LiftingHeight=newItem.LiftingHeight,
FireWatchManName=newItem.FireWatchManName,
WorkLeaderName=newItem.WorkLeaderName,
WorkLeaderTel=newItem.WorkLeaderTel,
QzgName=newItem.QzgName,
QzgPhone=newItem.QzgPhone,
};
if (newItem.States == Const.State_0)
{
@@ -1718,12 +2055,112 @@ namespace BLL
updateLiftingWork.CraneCapacity = newLiftingWork.CraneCapacity;
updateLiftingWork.NextManId = newLiftingWork.NextManId;
updateLiftingWork.States = newLiftingWork.States;
updateLiftingWork.WorkAreaId = newItem.WorkAreaId;
updateLiftingWork.LiftingHeight = newItem.LiftingHeight;
updateLiftingWork.FireWatchManName = newItem.FireWatchManName;
updateLiftingWork.WorkLeaderName = newItem.WorkLeaderName;
updateLiftingWork.WorkLeaderTel = newItem.WorkLeaderTel;
updateLiftingWork.QzgName = newItem.QzgName;
updateLiftingWork.QzgPhone = newItem.QzgPhone;
}
updateLiftingWork.States = newLiftingWork.States;
}
}
#endregion
#region
if (newItem.MenuId == Const.ProjectElectricityMenuId)
{
Model.License_Electricity newElectricity = new Model.License_Electricity
{
ElectricityId = strLicenseId,
ProjectId = projectId,
LicenseCode = newItem.LicenseCode,
ApplyUnitId = newItem.ApplyUnitId,
ApplyManId = newItem.ApplyManId,
ApplyDate = Funs.GetNewDateTime(newItem.ApplyDate),
WorkPalce = newItem.WorkPalce,
WorkDepth = newItem.WorkDepth,
ValidityStartTime = Funs.GetNewDateTime(newItem.ValidityStartTime),
ValidityEndTime = Funs.GetNewDateTime(newItem.ValidityEndTime),
WorkMeasures = newItem.WorkMeasures,
CancelManId = newItem.CancelManId,
CancelReasons = newItem.CancelReasons,
CancelTime = Funs.GetNewDateTime(newItem.CancelTime),
CloseManId = newItem.CloseManId,
CloseReasons = newItem.CloseReasons,
CloseTime = Funs.GetNewDateTime(newItem.CloseTime),
NextManId = newItem.NextManId,
States = newItem.States,
WorkAreaId = newItem.WorkAreaId,
Reason = newItem.Reason,
FireWatchManName = newItem.FireWatchManName,
WorkLeaderName= newItem.WorkLeaderName,
WorkLeaderTel = newItem.WorkLeaderTel
};
if (newItem.States == Const.State_0)
{
newElectricity.NextManId = newItem.ApplyManId;
}
////保存
var updateElectricity = db.License_Electricity.FirstOrDefault(x => x.ElectricityId == strLicenseId);
if (updateElectricity == null)
{
newElectricity.ApplyDate = DateTime.Now;
strLicenseId = newElectricity.ElectricityId = SQLHelper.GetNewID();
newElectricity.OldLicenseId = newItem.OldLicenseId;
newItem.LicenseCode = newElectricity.LicenseCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectElectricityMenuId, newElectricity.ProjectId, newElectricity.ApplyUnitId);
db.License_Electricity.InsertOnSubmit(newElectricity);
////增加一条编码记录
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectElectricityMenuId, newElectricity.ProjectId, newElectricity.ApplyUnitId, newElectricity.ElectricityId, newElectricity.ApplyDate);
}
else
{
if (newItem.States == Const.State_3)
{
updateElectricity.CloseManId = newElectricity.CloseManId;
updateElectricity.CloseReasons = newElectricity.CloseReasons;
updateElectricity.CloseTime = DateTime.Now;
if (newElectricity.ValidityEndTime.HasValue && newElectricity.ValidityEndTime < DateTime.Now)
{
updateElectricity.CloseTime = newElectricity.ValidityEndTime;
}
}
else if (newItem.States == Const.State_R)
{
updateElectricity.CancelManId = newElectricity.CancelManId;
updateElectricity.CancelReasons = newElectricity.CancelReasons;
updateElectricity.CancelTime = DateTime.Now;
if (newElectricity.ValidityEndTime.HasValue && newElectricity.ValidityEndTime < DateTime.Now)
{
updateElectricity.CancelTime = newElectricity.ValidityEndTime;
}
}
else
{
updateElectricity.WorkPalce = newElectricity.WorkPalce;
updateElectricity.WorkDepth = newElectricity.WorkDepth;
updateElectricity.ValidityStartTime = newElectricity.ValidityStartTime;
updateElectricity.ValidityEndTime = newElectricity.ValidityEndTime;
updateElectricity.WorkMeasures = newElectricity.WorkMeasures;
updateElectricity.NextManId = newElectricity.NextManId;
updateElectricity.States = newElectricity.States;
updateElectricity.WorkAreaId = newItem.WorkAreaId;
updateElectricity.Reason = newItem.Reason;
updateElectricity.FireWatchManName = newItem.FireWatchManName;
updateElectricity.WorkLeaderName = newItem.WorkLeaderName;
updateElectricity.WorkLeaderTel = newItem.WorkLeaderTel;
}
updateElectricity.States = newElectricity.States;
}
}
#endregion
#region 稿
if (newItem.MenuId == Const.ProjectLicenseManagerMenuId)
{
@@ -1880,23 +2317,26 @@ namespace BLL
#region
if (newItem.IsAgree == true)
{
var getCloseAllOperate = db.License_FlowOperate.FirstOrDefault(x => x.DataId == updateFlowOperate.DataId && (!x.IsClosed.HasValue || x.IsClosed == false) && (!x.IsFlowEnd.HasValue || x.IsFlowEnd == false));
if (getCloseAllOperate == null)
{
var getNextFlowOperate = db.License_FlowOperate.FirstOrDefault(x => x.DataId == updateFlowOperate.DataId && x.IsFlowEnd == true);
////判断审核步骤是否结束
if (getNextFlowOperate != null)
{
/////最后一步是关闭所有 步骤
getNextFlowOperate.IsClosed = true;
//修改只需要一个人审批直接通过
//var getCloseAllOperate = db.License_FlowOperate.FirstOrDefault(x => x.DataId == updateFlowOperate.DataId && (!x.IsClosed.HasValue || x.IsClosed == false) && (!x.IsFlowEnd.HasValue || x.IsFlowEnd == false));
//if (getCloseAllOperate == null)
//{
//var getNextFlowOperate = db.License_FlowOperate.FirstOrDefault(x => x.DataId == updateFlowOperate.DataId && x.IsFlowEnd == true);
var getNextFlowOperate = db.License_FlowOperate.FirstOrDefault(x => x.DataId == updateFlowOperate.DataId);
// ////判断审核步骤是否结束
// if (getNextFlowOperate != null)
// {
/////最后一步是关闭所有 步骤
getNextFlowOperate.IsClosed = true;
getNextFlowOperate.OperaterTime = DateTime.Now;
getNextFlowOperate.IsAgree = true;
getNextFlowOperate.OperaterId = newItem.OperaterId;
getNextFlowOperate.Opinion = "审核完成!";
boolIsFlowEnd = true;
db.SubmitChanges();
}
}
// }
//}
#region
if (strMenuId == Const.ProjectFireWorkMenuId)
@@ -2163,6 +2603,39 @@ namespace BLL
}
#endregion
#region
if (strMenuId == Const.ProjectElectricityMenuId)
{
var getElectricity = db.License_Electricity.FirstOrDefault(x => x.ElectricityId == updateFlowOperate.DataId);
if (getElectricity != null)
{
getElectricity.NextManId = newItem.NextOperaterId;
if (newItem.IsAgree == true)
{
if (boolIsFlowEnd == true)
{
getElectricity.NextManId = null;
getElectricity.States = Const.State_2;
if (getElectricity.ValidityStartTime.HasValue && getElectricity.ValidityStartTime < DateTime.Now)
{
int days = 7;
if (getElectricity.ValidityEndTime.HasValue)
{
days = Convert.ToInt32((getElectricity.ValidityEndTime - getElectricity.ValidityStartTime).Value.TotalDays);
}
getElectricity.ValidityStartTime = DateTime.Now;
getElectricity.ValidityEndTime = DateTime.Now.AddDays(days);
}
}
}
else
{
getElectricity.States = Const.State_0;
}
db.SubmitChanges();
}
}
#endregion
if (!boolIsFlowEnd && !string.IsNullOrEmpty(newItem.NextOperaterId))
{
List<string> getUserIds = Funs.GetStrListByStr(newItem.NextOperaterId, ',');
@@ -2291,6 +2764,7 @@ namespace BLL
var getAllFlows = from x in db.License_FlowOperate
where x.DataId == licenseInfo.LicenseId && (!x.IsFlowEnd.HasValue || x.IsFlowEnd == false)
select x;
if (licenseInfo == null || string.IsNullOrEmpty(licenseInfo.LicenseId) || getAllFlows.Count() == 0)
{
getFlowOperate = (from x in db.Sys_MenuFlowOperate
@@ -2617,6 +3091,17 @@ namespace BLL
}
#endregion
#region
else if (newItem.MenuId == Const.ProjectElectricityMenuId)
{
var updateElectricity = db.License_Electricity.FirstOrDefault(x => x.ElectricityId == strLicenseId);
if (updateElectricity == null)
{
updateElectricity.NextManId = null;
updateElectricity.States = Const.State_C;
}
}
#endregion
db.SubmitChanges();
}