修改施工方案和关键事项
This commit is contained in:
@@ -848,10 +848,14 @@
|
||||
<Compile Include="ZHGL\HSSESystem\HSSEOrganizeService.cs" />
|
||||
<Compile Include="ZHGL\Information\AccidentCauseReportItemService.cs" />
|
||||
<Compile Include="ZHGL\Information\AccidentCauseReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\ActionWorkLedgerItemService.cs" />
|
||||
<Compile Include="ZHGL\Information\ActionWorkLedgerService.cs" />
|
||||
<Compile Include="ZHGL\Information\EPSummaryReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\QualityWorkSummaryReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\QuarterlyProjectQualityService.cs" />
|
||||
<Compile Include="ZHGL\Information\SafetyBriefingService.cs" />
|
||||
<Compile Include="ZHGL\Information\SafetyProductionEvaluationItemService.cs" />
|
||||
<Compile Include="ZHGL\Information\SafetyProductionEvaluationService.cs" />
|
||||
<Compile Include="ZHGL\Information\UrgeReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\AnalyseResourceService.cs" />
|
||||
<Compile Include="ZHGL\Information\DrillConductedQuarterlyReportItemService.cs" />
|
||||
|
||||
@@ -37,6 +37,13 @@ namespace BLL
|
||||
return (from x in Funs.DB.Solution_CQMSConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType != "S" && x.SignType == signType && x.Edition == edtion select x.ApproveMan).ToList();
|
||||
}
|
||||
|
||||
public static List<string> GetUserIdsApprovesBySignTypeNew(string ConstructSolutionId, string signType)
|
||||
{
|
||||
var edtion = GetUserIdsApprovesBySignTypeEditon(ConstructSolutionId);
|
||||
return (from x in Funs.DB.Solution_CQMSConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType != "S"
|
||||
&& x.SignType == signType && x.Edition == edtion-1 select x.ApproveMan).ToList();
|
||||
}
|
||||
|
||||
public static int? GetUserIdsApprovesBySignTypeEditon(string ConstructSolutionId)
|
||||
{
|
||||
int edition = 0;
|
||||
@@ -54,17 +61,19 @@ namespace BLL
|
||||
/// <param name="managerRuleApprove">施工方案审批实体</param>
|
||||
public static void UpdateConstructSolutionApprove(Model.Solution_CQMSConstructSolutionApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_CQMSConstructSolutionApprove newApprove = db.Solution_CQMSConstructSolutionApprove.First(e => e.ConstructSolutionApproveId == approve.ConstructSolutionApproveId && e.ApproveDate == null);
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order=approve.Order;
|
||||
db.SubmitChanges();
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString)) {
|
||||
|
||||
Model.Solution_CQMSConstructSolutionApprove newApprove = db.Solution_CQMSConstructSolutionApprove.First(e => e.ConstructSolutionApproveId == approve.ConstructSolutionApproveId && e.ApproveDate == null);
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order=approve.Order;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据施工方案发布Id获取所以对应施工方案审批信息(查询全部会签状态)
|
||||
@@ -78,6 +87,13 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
public static List<Model.Solution_CQMSConstructSolutionApprove> GetHandleConstructSolutionApprovesByConstructSolutionId2(string ConstructSolutionId, int edition)
|
||||
{
|
||||
var list = Funs.DB.Solution_CQMSConstructSolutionApprove.Where(p => p.ConstructSolutionId == ConstructSolutionId && p.ApproveType == Const.CQMSConstructSolution_Audit1 && p.Edition == edition).ToList();
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
public static List<Model.Solution_CQMSConstructSolutionApprove> GetHandleConstruct(string ConstructSolutionId, int edition)
|
||||
{
|
||||
var list = Funs.DB.Solution_CQMSConstructSolutionApprove.Where(p => p.ConstructSolutionId == ConstructSolutionId && p.ApproveType != "S" && p.ApproveDate != null && p.Edition == edition).ToList();
|
||||
@@ -162,10 +178,13 @@ namespace BLL
|
||||
/// <param name="ConstructSolutionId"></param>
|
||||
public static void delSolutionApprove(string constructSolutionId, string man)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove where x.ConstructSolutionId == constructSolutionId && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.ApproveDate == null select x).ToList();
|
||||
db.Solution_CQMSConstructSolutionApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = db.Solution_CQMSConstructSolutionApprove.Where(x => x.ConstructSolutionId == constructSolutionId && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.ApproveDate == null)
|
||||
.ToList();
|
||||
db.Solution_CQMSConstructSolutionApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -177,7 +196,7 @@ namespace BLL
|
||||
public static void DeleteConstructSolutionApprovesByConstructSolutionId(string ConstructSolutionId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId select x).ToList();
|
||||
var q = (from x in db.Solution_CQMSConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId select x).ToList();
|
||||
db.Solution_CQMSConstructSolutionApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -209,8 +228,8 @@ namespace BLL
|
||||
/// <param name="managerRuleApprove">施工方案审批实体</param>
|
||||
public static void AddConstructSolutionApprove(Model.Solution_CQMSConstructSolutionApprove approve)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Solution_CQMSConstructSolutionApprove newApprove = new Model.Solution_CQMSConstructSolutionApprove();
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString)) {
|
||||
Model.Solution_CQMSConstructSolutionApprove newApprove = new Model.Solution_CQMSConstructSolutionApprove();
|
||||
if (string.IsNullOrWhiteSpace(approve.ConstructSolutionApproveId))
|
||||
{
|
||||
newApprove.ConstructSolutionApproveId = SQLHelper.GetNewID(typeof(Model.Solution_CQMSConstructSolutionApprove));
|
||||
@@ -227,9 +246,11 @@ namespace BLL
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SignType = approve.SignType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order= GetMaxOrderByConstructSolutionId(approve.ConstructSolutionId);
|
||||
//newApprove.Order= GetMaxOrderByConstructSolutionId(approve.ConstructSolutionId);
|
||||
newApprove.Order = approve.Order;
|
||||
db.Solution_CQMSConstructSolutionApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetMaxOrderByConstructSolutionId(string constructSolutionId)
|
||||
@@ -254,18 +275,87 @@ namespace BLL
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static string GetThisApproveNameByConstructSolutionId(object constructSolutionId)
|
||||
|
||||
public static List<Model.Solution_CQMSConstructSolutionApprove> GetThisApproveByConstructSolutionId(string constructSolutionId,string state)
|
||||
{
|
||||
string name = "";
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId.ToString() && x.ApproveDate == null
|
||||
orderby x.Order
|
||||
select x).FirstOrDefault();
|
||||
if (q!=null)
|
||||
var constructSolution =
|
||||
CQMSConstructSolutionService.GetConstructSolutionByConstructSolutionId(constructSolutionId.ToString());
|
||||
|
||||
var q = new List<Model.Solution_CQMSConstructSolutionApprove>();
|
||||
if (state == "2")
|
||||
{
|
||||
name = UserService.GetUserNameByUserId(q.ApproveMan);
|
||||
q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null
|
||||
&& x.SignType == "Yi"
|
||||
&& x.Edition==constructSolution.Edition
|
||||
orderby x.Order
|
||||
select x).ToList();
|
||||
}
|
||||
return name;
|
||||
else if (state == "3")
|
||||
{
|
||||
q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null
|
||||
&& x.SignType == "Er"
|
||||
&& x.Edition == constructSolution.Edition
|
||||
orderby x.Order
|
||||
select x).ToList();
|
||||
}
|
||||
else {
|
||||
q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null
|
||||
&& x.SignType == null
|
||||
&& x.Edition == constructSolution.Edition
|
||||
orderby x.Order
|
||||
select x).ToList();
|
||||
}
|
||||
return q;
|
||||
}
|
||||
|
||||
//加载审批人
|
||||
public static string GetThisApproveNameByConstructSolutionId(object constructSolutionId,object state)
|
||||
{
|
||||
var constructSolution =
|
||||
CQMSConstructSolutionService.GetConstructSolutionByConstructSolutionId(constructSolutionId.ToString());
|
||||
|
||||
string name = "";
|
||||
if (state.ToString() == "2")
|
||||
{
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId.ToString() && x.ApproveDate == null
|
||||
&& x.Edition == constructSolution.Edition
|
||||
&& x.SignType == "Yi"
|
||||
orderby x.Order
|
||||
select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
foreach (var item in q)
|
||||
{
|
||||
name += UserService.GetUserNameByUserId(item.ApproveMan) + ",";
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
else if (state.ToString() == "3")
|
||||
{
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId.ToString() && x.ApproveDate == null
|
||||
&& x.SignType == "Er"
|
||||
&& x.Edition == constructSolution.Edition
|
||||
orderby x.Order
|
||||
select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
foreach (var item in q)
|
||||
{
|
||||
name += UserService.GetUserNameByUserId(item.ApproveMan) + ",";
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送待办给下一步办理人
|
||||
|
||||
@@ -66,6 +66,8 @@ namespace BLL
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newConstructSolution.Content= constructSolution.Content;
|
||||
newConstructSolution.CsUsers = constructSolution.CsUsers;
|
||||
|
||||
db.Solution_CQMSConstructSolution.InsertOnSubmit(newConstructSolution);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -75,20 +77,22 @@ namespace BLL
|
||||
/// <param name="constructSolution">方案审查实体</param>
|
||||
public static void UpdateConstructSolution(Model.Solution_CQMSConstructSolution constructSolution)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_CQMSConstructSolution newConstructSolution = db.Solution_CQMSConstructSolution.First(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId);
|
||||
newConstructSolution.Code = constructSolution.Code;
|
||||
newConstructSolution.UnitId = constructSolution.UnitId;
|
||||
newConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
newConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newConstructSolution.Content= constructSolution.Content;
|
||||
db.SubmitChanges();
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString)) {
|
||||
Model.Solution_CQMSConstructSolution newConstructSolution = db.Solution_CQMSConstructSolution.First(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId);
|
||||
newConstructSolution.Code = constructSolution.Code;
|
||||
newConstructSolution.UnitId = constructSolution.UnitId;
|
||||
newConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
newConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newConstructSolution.Content= constructSolution.Content;
|
||||
newConstructSolution.CsUsers = constructSolution.CsUsers;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +116,11 @@ namespace BLL
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Audit)
|
||||
{
|
||||
return "会签";
|
||||
return "一级审批";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Audit1)
|
||||
{
|
||||
return "二级审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CQMSConstructSolution_Complete)
|
||||
{
|
||||
|
||||
@@ -4656,14 +4656,21 @@ namespace BLL
|
||||
public static string CQMSConstructSolution_Compile = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 会签
|
||||
/// 一级审批
|
||||
/// </summary>
|
||||
public static string CQMSConstructSolution_Audit = "2";
|
||||
|
||||
/// <summary>
|
||||
/// 二级审批
|
||||
/// </summary>
|
||||
public static string CQMSConstructSolution_Audit1 = "3";
|
||||
|
||||
/// <summary>
|
||||
/// 审批完成
|
||||
/// </summary>
|
||||
public static string CQMSConstructSolution_Complete = "3";
|
||||
public static string CQMSConstructSolution_Complete = "4";
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -6091,5 +6098,26 @@ namespace BLL
|
||||
/// HSSE管理月报新
|
||||
/// </summary>
|
||||
public const string ManagerMonthCNewMenuId = "9E4B28DF-8C8E-49F8-AB15-270BBDC73449";
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
public const string ActionWorkLedgerMenuId = "CB76394B-BDEB-4F45-9D19-F38612DC6591";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
public const string SafetyProductionEvaluationMenuId = "C48087A8-4C9F-485D-B0A4-C85E112BA705";
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
public const string ReportType_11 = "11";
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账上报
|
||||
/// </summary>
|
||||
public const string ReportType_12 = "12";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
public const string ActionWorkLedgerMenuId = "CB76394B-BDEB-4F45-9D19-F38612DC6591";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
public const string SafetyProductionEvaluationMenuId = "C48087A8-4C9F-485D-B0A4-C85E112BA705";
|
||||
@@ -53,5 +53,67 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
#region 施工方案审批
|
||||
public static void AddSolution_CQMSConstructSolutionApprove_Item(Model.Solution_CQMSConstructSolutionApprove_Item data)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString)) {
|
||||
Model.Solution_CQMSConstructSolutionApprove_Item newData = new Model.Solution_CQMSConstructSolutionApprove_Item
|
||||
{
|
||||
Id = data.Id,
|
||||
TypeSortId = data.TypeSortId,
|
||||
ConstructSolutionId = data.ConstructSolutionId,
|
||||
SortId = data.SortId,
|
||||
Chapter = data.Chapter,
|
||||
Amendment = data.Amendment,
|
||||
Proposer=data.Proposer,
|
||||
ProposerName=data.ProposerName,
|
||||
Modification = data.Modification,
|
||||
ReviewerOpinion = data.ReviewerOpinion,
|
||||
IsAccept = data.IsAccept,
|
||||
};
|
||||
db.Solution_CQMSConstructSolutionApprove_Item.InsertOnSubmit(newData);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateSolution_CQMSConstructSolutionApprove_Item(Model.Solution_CQMSConstructSolutionApprove_Item data) {
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var result = db.Solution_CQMSConstructSolutionApprove_Item.FirstOrDefault(a => a.Id == data.Id);
|
||||
if (result != null)
|
||||
{
|
||||
result.Modification = data.Modification;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateSolution_CQMSConstructSolutionApprove_ItemNew(Model.Solution_CQMSConstructSolutionApprove_Item data)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var result = db.Solution_CQMSConstructSolutionApprove_Item.FirstOrDefault(a => a.Id == data.Id);
|
||||
if (result != null)
|
||||
{
|
||||
result.ReviewerOpinion = data.ReviewerOpinion;
|
||||
result.IsAccept = data.IsAccept;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteSolution_CQMSConstructSolutionApprove_Item(string ConstructSolutionId,string Proposer)
|
||||
{
|
||||
var q = (from x in Funs.DB.Solution_CQMSConstructSolutionApprove_Item where x.ConstructSolutionId == ConstructSolutionId
|
||||
&& x.Proposer== Proposer
|
||||
select x).ToList();
|
||||
if (q .Count>0)
|
||||
{
|
||||
Funs.DB.Solution_CQMSConstructSolutionApprove_Item.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BLL
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.GJSX_detail));
|
||||
Model.GJSX_detail newGJSXMX = new Model.GJSX_detail();
|
||||
|
||||
newGJSXMX.Cuid = newKeyID;
|
||||
newGJSXMX.Cuid = gjsxmx.Cuid;
|
||||
newGJSXMX.GJSXID = gjsxmx.GJSXID;
|
||||
newGJSXMX.Progress_user = gjsxmx.Progress_user;
|
||||
newGJSXMX.Progress_detail = gjsxmx.Progress_detail;
|
||||
|
||||
@@ -43,7 +43,9 @@ namespace BLL
|
||||
IsManypeople = _GJSX.IsManypeople,
|
||||
CompleteDate = _GJSX.CompleteDate,
|
||||
AttachUrl = _GJSX.AttachUrl,
|
||||
User_Acceptance = _GJSX.User_Acceptance
|
||||
User_Acceptance = _GJSX.User_Acceptance,
|
||||
|
||||
CsUsers=_GJSX.CsUsers
|
||||
};
|
||||
|
||||
db.GJSX.InsertOnSubmit(newGJSX);
|
||||
@@ -75,6 +77,7 @@ namespace BLL
|
||||
newGJSX.CompleteDate = _GJSX.CompleteDate;
|
||||
newGJSX.AttachUrl = _GJSX.AttachUrl;
|
||||
newGJSX.User_Acceptance = _GJSX.User_Acceptance;
|
||||
newGJSX.CsUsers = _GJSX.CsUsers;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3305,6 +3305,192 @@
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 中央企业安全生产治本攻坚三年行动工作台账上报
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账上报
|
||||
/// </summary>
|
||||
public static string UpActionWorkLedger(string actionWorkLedgerId, Model.Sys_User CurrUser)
|
||||
{
|
||||
string code = "0";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
|
||||
var upReport = from x in db.Information_ActionWorkLedger
|
||||
where x.ActionWorkLedgerId == actionWorkLedgerId
|
||||
select new Model.ActionWorkLedger
|
||||
{
|
||||
ActionWorkLedgerId = x.ActionWorkLedgerId,
|
||||
UnitId = x.UnitId,
|
||||
ReportDate = x.ReportDate,
|
||||
Quarter = x.Quarter,
|
||||
YearId = x.YearId,
|
||||
CompileMan = x.CompileMan,
|
||||
};
|
||||
|
||||
var upReportItem = from x in db.Information_ActionWorkLedgerItem
|
||||
where x.ActionWorkLedgerId == actionWorkLedgerId
|
||||
select new Model.ActionWorkLedgerItem
|
||||
{
|
||||
ActionWorkLedgerItemId = x.ActionWorkLedgerItemId,
|
||||
ActionWorkLedgerId = x.ActionWorkLedgerId,
|
||||
SortIndex = x.SortIndex,
|
||||
Focus = x.Focus,
|
||||
SpecialTask = x.SpecialTask,
|
||||
WorkPoints = x.WorkPoints,
|
||||
FillingRequirements = x.FillingRequirements,
|
||||
CompletionDeadline = x.CompletionDeadline,
|
||||
ImplementationStatus = x.ImplementationStatus,
|
||||
};
|
||||
|
||||
//var getR = hsseC.DataInsertInformation_DrillConductedQuarterlyReportTable(upReport.ToList(), upReportItem.ToList());
|
||||
//新接口Api
|
||||
code = UpApiSaveActionWorkLedger(upReport, upReportItem).ToString();
|
||||
if (code == "1")
|
||||
{
|
||||
foreach (var item in upReport.Select(p => p.ActionWorkLedgerId))
|
||||
{
|
||||
var report = db.Information_ActionWorkLedger.FirstOrDefault(e => e.ActionWorkLedgerId == item);
|
||||
if (report != null)
|
||||
{
|
||||
report.UpState = BLL.Const.UpState_3;
|
||||
db.SubmitChanges();
|
||||
////更新 当前人要处理的意见
|
||||
ProjectDataFlowSetService.CloseFlowOperate(Const.ActionWorkLedgerMenuId, item, string.Empty);
|
||||
////更新催报信息
|
||||
UrgeReportService.SetComplete(report.UnitId, Const.ReportType_11, report.YearId.ToString(), report.Quarter.ToString());
|
||||
}
|
||||
}
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器", ex);
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// DrillConductedQuarterlyReportApi调用
|
||||
/// </summary>
|
||||
/// <param name="upReport">主表</param>
|
||||
/// <param name="upReportItem">明细表</param>
|
||||
/// <returns></returns>
|
||||
private static int UpApiSaveActionWorkLedger(IQueryable<Model.ActionWorkLedger> upReport, IQueryable<Model.ActionWorkLedgerItem> upReportItem)
|
||||
{
|
||||
string baseurl = "/api/InformationData/SaveActionWorkLedger";
|
||||
//合并
|
||||
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
|
||||
var resultJson = JsonConvert.SerializeObject(upReport.FirstOrDefault());
|
||||
var resultJson1 = JsonConvert.SerializeObject(new { actionWorkLedgerItem = upReportItem });
|
||||
resultJson = "{\"InformationDataItems\":[" + (resultJson + resultJson1).Replace("}{", ",") + "]}";
|
||||
var responeData = BLL.ServerService.PushCNCEC(resultJson, baseurl);
|
||||
return responeData.code;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 中央企业安全生产管理评价工作调度台账上报
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账上报
|
||||
/// </summary>
|
||||
public static string UpSafetyProductionEvaluation(string safetyProductionEvaluationId, Model.Sys_User CurrUser)
|
||||
{
|
||||
string code = "0";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
|
||||
var upReport = from x in db.Information_SafetyProductionEvaluation
|
||||
where x.SafetyProductionEvaluationId == safetyProductionEvaluationId
|
||||
select new Model.SafetyProductionEvaluation
|
||||
{
|
||||
SafetyProductionEvaluationId = x.SafetyProductionEvaluationId,
|
||||
UnitId = x.UnitId,
|
||||
ReportDate = x.ReportDate,
|
||||
Quarter = x.Quarter,
|
||||
YearId = x.YearId,
|
||||
CompileMan = x.CompileMan,
|
||||
};
|
||||
|
||||
var upReportItem = from x in db.Information_SafetyProductionEvaluationItem
|
||||
where x.SafetyProductionEvaluationId == safetyProductionEvaluationId
|
||||
select new Model.SafetyProductionEvaluationItem
|
||||
{
|
||||
SafetyProductionEvaluationItemId = x.SafetyProductionEvaluationItemId,
|
||||
SafetyProductionEvaluationId = x.SafetyProductionEvaluationId,
|
||||
SortIndex = x.SortIndex,
|
||||
Type = x.Type,
|
||||
EvaluateWork = x.EvaluateWork,
|
||||
EvaluationContent = x.EvaluationContent,
|
||||
FillingRequirements = x.FillingRequirements,
|
||||
CompletionDeadline = x.CompletionDeadline,
|
||||
ImplementationStatus = x.ImplementationStatus,
|
||||
};
|
||||
|
||||
//var getR = hsseC.DataInsertInformation_DrillConductedQuarterlyReportTable(upReport.ToList(), upReportItem.ToList());
|
||||
//新接口Api
|
||||
code = UpApiSaveSafetyProductionEvaluation(upReport, upReportItem).ToString();
|
||||
if (code == "1")
|
||||
{
|
||||
foreach (var item in upReport.Select(p => p.SafetyProductionEvaluationId))
|
||||
{
|
||||
var report = db.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.SafetyProductionEvaluationId == item);
|
||||
if (report != null)
|
||||
{
|
||||
report.UpState = BLL.Const.UpState_3;
|
||||
db.SubmitChanges();
|
||||
////更新 当前人要处理的意见
|
||||
ProjectDataFlowSetService.CloseFlowOperate(Const.SafetyProductionEvaluationMenuId, item, string.Empty);
|
||||
////更新催报信息
|
||||
UrgeReportService.SetComplete(report.UnitId, Const.ReportType_12, report.YearId.ToString(), report.Quarter.ToString());
|
||||
}
|
||||
}
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("【中央企业安全生产管理评价工作调度台账上报】上传到服务器", ex);
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// DrillConductedQuarterlyReportApi调用
|
||||
/// </summary>
|
||||
/// <param name="upReport">主表</param>
|
||||
/// <param name="upReportItem">明细表</param>
|
||||
/// <returns></returns>
|
||||
private static int UpApiSaveSafetyProductionEvaluation(IQueryable<Model.SafetyProductionEvaluation> upReport, IQueryable<Model.SafetyProductionEvaluationItem> upReportItem)
|
||||
{
|
||||
string baseurl = "/api/InformationData/SaveSafetyProductionEvaluation";
|
||||
//合并
|
||||
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
|
||||
var resultJson = JsonConvert.SerializeObject(upReport.FirstOrDefault());
|
||||
var resultJson1 = JsonConvert.SerializeObject(new { safetyProductionEvaluationItem = upReportItem });
|
||||
resultJson = "{\"InformationDataItems\":[" + (resultJson + resultJson1).Replace("}{", ",") + "]}";
|
||||
var responeData = BLL.ServerService.PushCNCEC(resultJson, baseurl);
|
||||
return responeData.code;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账明细表
|
||||
/// </summary>
|
||||
public static class ActionWorkLedgerItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取中央企业安全生产治本攻坚三年行动工作台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_ActionWorkLedgerItem GetActionWorkLedgerItemById(string ActionWorkLedgerItemId)
|
||||
{
|
||||
return Funs.DB.Information_ActionWorkLedgerItem.FirstOrDefault(e => e.ActionWorkLedgerItemId == ActionWorkLedgerItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据中央企业安全生产治本攻坚三年行动工作台账Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Information_ActionWorkLedgerItem> GetActionWorkLedgerItemList(string ActionWorkLedgerId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_ActionWorkLedgerItem where x.ActionWorkLedgerId == ActionWorkLedgerId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加中央企业安全生产治本攻坚三年行动工作台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerItem"></param>
|
||||
public static void AddActionWorkLedgerItem(Model.Information_ActionWorkLedgerItem ActionWorkLedgerItem)
|
||||
{
|
||||
Model.Information_ActionWorkLedgerItem newActionWorkLedgerItem = new Model.Information_ActionWorkLedgerItem
|
||||
{
|
||||
ActionWorkLedgerItemId = ActionWorkLedgerItem.ActionWorkLedgerItemId,
|
||||
ActionWorkLedgerId = ActionWorkLedgerItem.ActionWorkLedgerId,
|
||||
Focus = ActionWorkLedgerItem.Focus,
|
||||
SpecialTask = ActionWorkLedgerItem.SpecialTask,
|
||||
WorkPoints = ActionWorkLedgerItem.WorkPoints,
|
||||
FillingRequirements = ActionWorkLedgerItem.FillingRequirements,
|
||||
CompletionDeadline = ActionWorkLedgerItem.CompletionDeadline,
|
||||
ImplementationStatus = ActionWorkLedgerItem.ImplementationStatus,
|
||||
SortIndex = ActionWorkLedgerItem.SortIndex
|
||||
};
|
||||
Funs.DB.Information_ActionWorkLedgerItem.InsertOnSubmit(newActionWorkLedgerItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中央企业安全生产治本攻坚三年行动工作台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerItem"></param>
|
||||
public static void UpdateActionWorkLedgerItem(Model.Information_ActionWorkLedgerItem ActionWorkLedgerItem)
|
||||
{
|
||||
Model.Information_ActionWorkLedgerItem newActionWorkLedgerItem = Funs.DB.Information_ActionWorkLedgerItem.FirstOrDefault(e => e.ActionWorkLedgerItemId == ActionWorkLedgerItem.ActionWorkLedgerItemId);
|
||||
if (newActionWorkLedgerItem != null)
|
||||
{
|
||||
newActionWorkLedgerItem.Focus = ActionWorkLedgerItem.Focus;
|
||||
newActionWorkLedgerItem.SpecialTask = ActionWorkLedgerItem.SpecialTask;
|
||||
newActionWorkLedgerItem.WorkPoints = ActionWorkLedgerItem.WorkPoints;
|
||||
newActionWorkLedgerItem.FillingRequirements = ActionWorkLedgerItem.FillingRequirements;
|
||||
newActionWorkLedgerItem.CompletionDeadline = ActionWorkLedgerItem.CompletionDeadline;
|
||||
newActionWorkLedgerItem.ImplementationStatus = ActionWorkLedgerItem.ImplementationStatus;
|
||||
newActionWorkLedgerItem.SortIndex = ActionWorkLedgerItem.SortIndex;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除中央企业安全生产治本攻坚三年行动工作台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerItemId"></param>
|
||||
public static void DeleteActionWorkLedgerItemById(string ActionWorkLedgerItemId)
|
||||
{
|
||||
Model.Information_ActionWorkLedgerItem ActionWorkLedgerItem = Funs.DB.Information_ActionWorkLedgerItem.FirstOrDefault(e => e.ActionWorkLedgerItemId == ActionWorkLedgerItemId);
|
||||
if (ActionWorkLedgerItem != null)
|
||||
{
|
||||
Funs.DB.Information_ActionWorkLedgerItem.DeleteOnSubmit(ActionWorkLedgerItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据中央企业安全生产治本攻坚三年行动工作台账主表id删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerId"></param>
|
||||
public static void DeleteActionWorkLedgerItemList(string ActionWorkLedgerId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Information_ActionWorkLedgerItem where x.ActionWorkLedgerId == ActionWorkLedgerId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_ActionWorkLedgerItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
public static class ActionWorkLedgerService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_ActionWorkLedger GetActionWorkLedgerById(string ActionWorkLedgerId)
|
||||
{
|
||||
return Funs.DB.Information_ActionWorkLedger.FirstOrDefault(e => e.ActionWorkLedgerId == ActionWorkLedgerId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarters">季度</param>
|
||||
/// <returns>中央企业安全生产治本攻坚三年行动工作台账</returns>
|
||||
public static Model.Information_ActionWorkLedger GetActionWorkLedgerByUnitIdAndYearAndQuarters(string unitId, int year, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_ActionWorkLedger.FirstOrDefault(e => e.UnitId == unitId && e.Quarter == quarters && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取安全生产数据季报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>安全生产数据季报集合</returns>
|
||||
public static List<Model.View_Information_ActionWorkLedger> GetActionWorkLedgersByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_ActionWorkLedger where x.UnitId == UnitId orderby x.ReportDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedger"></param>
|
||||
public static void AddActionWorkLedger(Model.Information_ActionWorkLedger ActionWorkLedger)
|
||||
{
|
||||
Model.Information_ActionWorkLedger newActionWorkLedger = new Model.Information_ActionWorkLedger
|
||||
{
|
||||
ActionWorkLedgerId = ActionWorkLedger.ActionWorkLedgerId,
|
||||
UnitId = ActionWorkLedger.UnitId,
|
||||
ReportDate = ActionWorkLedger.ReportDate,
|
||||
YearId = ActionWorkLedger.YearId,
|
||||
Quarter = ActionWorkLedger.Quarter,
|
||||
CompileMan = ActionWorkLedger.CompileMan,
|
||||
UpState = ActionWorkLedger.UpState,
|
||||
HandleState = ActionWorkLedger.HandleState,
|
||||
HandleMan = ActionWorkLedger.HandleMan
|
||||
};
|
||||
Funs.DB.Information_ActionWorkLedger.InsertOnSubmit(newActionWorkLedger);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedger"></param>
|
||||
public static void UpdateActionWorkLedger(Model.Information_ActionWorkLedger ActionWorkLedger)
|
||||
{
|
||||
Model.Information_ActionWorkLedger newActionWorkLedger = Funs.DB.Information_ActionWorkLedger.FirstOrDefault(e => e.ActionWorkLedgerId == ActionWorkLedger.ActionWorkLedgerId);
|
||||
if (newActionWorkLedger != null)
|
||||
{
|
||||
newActionWorkLedger.UnitId = ActionWorkLedger.UnitId;
|
||||
newActionWorkLedger.ReportDate = ActionWorkLedger.ReportDate;
|
||||
newActionWorkLedger.YearId = ActionWorkLedger.YearId;
|
||||
newActionWorkLedger.Quarter = ActionWorkLedger.Quarter;
|
||||
newActionWorkLedger.UpState = ActionWorkLedger.UpState;
|
||||
newActionWorkLedger.HandleState = ActionWorkLedger.HandleState;
|
||||
newActionWorkLedger.HandleMan = ActionWorkLedger.HandleMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerId"></param>
|
||||
public static void DeleteActionWorkLedgerById(string ActionWorkLedgerId)
|
||||
{
|
||||
Model.Information_ActionWorkLedger ActionWorkLedger = Funs.DB.Information_ActionWorkLedger.FirstOrDefault(e => e.ActionWorkLedgerId == ActionWorkLedgerId);
|
||||
if (ActionWorkLedger != null)
|
||||
{
|
||||
Funs.DB.Information_ActionWorkLedger.DeleteOnSubmit(ActionWorkLedger);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位、季度获取中央企业安全生产治本攻坚三年行动工作台账
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="quarter"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_ActionWorkLedger GetActionWorkLedgerByUnitIdDate(string unitId, int yearId, int quarter, string ActionWorkLedgerId)
|
||||
{
|
||||
return Funs.DB.Information_ActionWorkLedger.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarter && ((ActionWorkLedgerId == null && e.ActionWorkLedgerId != null) || e.ActionWorkLedgerId != ActionWorkLedgerId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账明细表
|
||||
/// </summary>
|
||||
public static class SafetyProductionEvaluationItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取中央企业安全生产管理评价工作调度台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyProductionEvaluationItem GetSafetyProductionEvaluationItemById(string SafetyProductionEvaluationItemId)
|
||||
{
|
||||
return Funs.DB.Information_SafetyProductionEvaluationItem.FirstOrDefault(e => e.SafetyProductionEvaluationItemId == SafetyProductionEvaluationItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据中央企业安全生产管理评价工作调度台账Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Information_SafetyProductionEvaluationItem> GetSafetyProductionEvaluationItemList(string SafetyProductionEvaluationId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_SafetyProductionEvaluationItem where x.SafetyProductionEvaluationId == SafetyProductionEvaluationId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加中央企业安全生产管理评价工作调度台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationItem"></param>
|
||||
public static void AddSafetyProductionEvaluationItem(Model.Information_SafetyProductionEvaluationItem SafetyProductionEvaluationItem)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluationItem newSafetyProductionEvaluationItem = new Model.Information_SafetyProductionEvaluationItem
|
||||
{
|
||||
SafetyProductionEvaluationItemId = SafetyProductionEvaluationItem.SafetyProductionEvaluationItemId,
|
||||
SafetyProductionEvaluationId = SafetyProductionEvaluationItem.SafetyProductionEvaluationId,
|
||||
Type = SafetyProductionEvaluationItem.Type,
|
||||
EvaluateWork = SafetyProductionEvaluationItem.EvaluateWork,
|
||||
EvaluationContent = SafetyProductionEvaluationItem.EvaluationContent,
|
||||
FillingRequirements = SafetyProductionEvaluationItem.FillingRequirements,
|
||||
CompletionDeadline = SafetyProductionEvaluationItem.CompletionDeadline,
|
||||
ImplementationStatus = SafetyProductionEvaluationItem.ImplementationStatus,
|
||||
SortIndex = SafetyProductionEvaluationItem.SortIndex
|
||||
};
|
||||
Funs.DB.Information_SafetyProductionEvaluationItem.InsertOnSubmit(newSafetyProductionEvaluationItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中央企业安全生产管理评价工作调度台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationItem"></param>
|
||||
public static void UpdateSafetyProductionEvaluationItem(Model.Information_SafetyProductionEvaluationItem SafetyProductionEvaluationItem)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluationItem newSafetyProductionEvaluationItem = Funs.DB.Information_SafetyProductionEvaluationItem.FirstOrDefault(e => e.SafetyProductionEvaluationItemId == SafetyProductionEvaluationItem.SafetyProductionEvaluationItemId);
|
||||
if (newSafetyProductionEvaluationItem != null)
|
||||
{
|
||||
newSafetyProductionEvaluationItem.Type = SafetyProductionEvaluationItem.Type;
|
||||
newSafetyProductionEvaluationItem.EvaluateWork = SafetyProductionEvaluationItem.EvaluateWork;
|
||||
newSafetyProductionEvaluationItem.EvaluationContent = SafetyProductionEvaluationItem.EvaluationContent;
|
||||
newSafetyProductionEvaluationItem.FillingRequirements = SafetyProductionEvaluationItem.FillingRequirements;
|
||||
newSafetyProductionEvaluationItem.CompletionDeadline = SafetyProductionEvaluationItem.CompletionDeadline;
|
||||
newSafetyProductionEvaluationItem.ImplementationStatus = SafetyProductionEvaluationItem.ImplementationStatus;
|
||||
newSafetyProductionEvaluationItem.SortIndex = SafetyProductionEvaluationItem.SortIndex;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除中央企业安全生产管理评价工作调度台账明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationItemId"></param>
|
||||
public static void DeleteSafetyProductionEvaluationItemById(string SafetyProductionEvaluationItemId)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluationItem SafetyProductionEvaluationItem = Funs.DB.Information_SafetyProductionEvaluationItem.FirstOrDefault(e => e.SafetyProductionEvaluationItemId == SafetyProductionEvaluationItemId);
|
||||
if (SafetyProductionEvaluationItem != null)
|
||||
{
|
||||
Funs.DB.Information_SafetyProductionEvaluationItem.DeleteOnSubmit(SafetyProductionEvaluationItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据中央企业安全生产管理评价工作调度台账主表id删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationId"></param>
|
||||
public static void DeleteSafetyProductionEvaluationItemList(string SafetyProductionEvaluationId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Information_SafetyProductionEvaluationItem where x.SafetyProductionEvaluationId == SafetyProductionEvaluationId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_SafetyProductionEvaluationItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
public static class SafetyProductionEvaluationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyProductionEvaluation GetSafetyProductionEvaluationById(string SafetyProductionEvaluationId)
|
||||
{
|
||||
return Funs.DB.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.SafetyProductionEvaluationId == SafetyProductionEvaluationId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarters">季度</param>
|
||||
/// <returns>中央企业安全生产管理评价工作调度台账</returns>
|
||||
public static Model.Information_SafetyProductionEvaluation GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(string unitId, int year, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.UnitId == unitId && e.Quarter == quarters && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取安全生产数据季报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>安全生产数据季报集合</returns>
|
||||
public static List<Model.View_Information_SafetyProductionEvaluation> GetSafetyProductionEvaluationsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_SafetyProductionEvaluation where x.UnitId == UnitId orderby x.ReportDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluation"></param>
|
||||
public static void AddSafetyProductionEvaluation(Model.Information_SafetyProductionEvaluation SafetyProductionEvaluation)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation newSafetyProductionEvaluation = new Model.Information_SafetyProductionEvaluation
|
||||
{
|
||||
SafetyProductionEvaluationId = SafetyProductionEvaluation.SafetyProductionEvaluationId,
|
||||
UnitId = SafetyProductionEvaluation.UnitId,
|
||||
ReportDate = SafetyProductionEvaluation.ReportDate,
|
||||
YearId = SafetyProductionEvaluation.YearId,
|
||||
Quarter = SafetyProductionEvaluation.Quarter,
|
||||
CompileMan = SafetyProductionEvaluation.CompileMan,
|
||||
UpState = SafetyProductionEvaluation.UpState,
|
||||
HandleState = SafetyProductionEvaluation.HandleState,
|
||||
HandleMan = SafetyProductionEvaluation.HandleMan
|
||||
};
|
||||
Funs.DB.Information_SafetyProductionEvaluation.InsertOnSubmit(newSafetyProductionEvaluation);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluation"></param>
|
||||
public static void UpdateSafetyProductionEvaluation(Model.Information_SafetyProductionEvaluation SafetyProductionEvaluation)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation newSafetyProductionEvaluation = Funs.DB.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.SafetyProductionEvaluationId == SafetyProductionEvaluation.SafetyProductionEvaluationId);
|
||||
if (newSafetyProductionEvaluation != null)
|
||||
{
|
||||
newSafetyProductionEvaluation.UnitId = SafetyProductionEvaluation.UnitId;
|
||||
newSafetyProductionEvaluation.ReportDate = SafetyProductionEvaluation.ReportDate;
|
||||
newSafetyProductionEvaluation.YearId = SafetyProductionEvaluation.YearId;
|
||||
newSafetyProductionEvaluation.Quarter = SafetyProductionEvaluation.Quarter;
|
||||
newSafetyProductionEvaluation.UpState = SafetyProductionEvaluation.UpState;
|
||||
newSafetyProductionEvaluation.HandleState = SafetyProductionEvaluation.HandleState;
|
||||
newSafetyProductionEvaluation.HandleMan = SafetyProductionEvaluation.HandleMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationId"></param>
|
||||
public static void DeleteSafetyProductionEvaluationById(string SafetyProductionEvaluationId)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation SafetyProductionEvaluation = Funs.DB.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.SafetyProductionEvaluationId == SafetyProductionEvaluationId);
|
||||
if (SafetyProductionEvaluation != null)
|
||||
{
|
||||
Funs.DB.Information_SafetyProductionEvaluation.DeleteOnSubmit(SafetyProductionEvaluation);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位、季度获取中央企业安全生产管理评价工作调度台账
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="quarter"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyProductionEvaluation GetSafetyProductionEvaluationByUnitIdDate(string unitId, int yearId, int quarter, string SafetyProductionEvaluationId)
|
||||
{
|
||||
return Funs.DB.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarter && ((SafetyProductionEvaluationId == null && e.SafetyProductionEvaluationId != null) || e.SafetyProductionEvaluationId != SafetyProductionEvaluationId));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user