修改项目安全实施计划
This commit is contained in:
@@ -393,6 +393,7 @@
|
||||
<Compile Include="HSSE\Accident\AccidentReportOtherService.cs" />
|
||||
<Compile Include="HSSE\Accident\AccidentReportService.cs" />
|
||||
<Compile Include="HSSE\Accident\NoFourLetoffService.cs" />
|
||||
<Compile Include="HSSE\ActionPlan\ActionPlanListApproveService.cs" />
|
||||
<Compile Include="HSSE\ActionPlan\ActionPlanListService.cs" />
|
||||
<Compile Include="HSSE\ActionPlan\ActionPlan_CompanyManagerRuleService.cs" />
|
||||
<Compile Include="HSSE\ActionPlan\ActionPlan_ManagerRuleService.cs" />
|
||||
|
||||
@@ -151,6 +151,27 @@ namespace BLL
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="toKeyId"></param>
|
||||
/// <param name="menuId"></param>
|
||||
/// <returns></returns>
|
||||
public static Boolean Getfile(string toKeyId)
|
||||
{
|
||||
bool res = false;
|
||||
var q = Funs.DB.AttachFile.FirstOrDefault((x => x.ToKeyId == toKeyId));
|
||||
if (q != null)
|
||||
{
|
||||
var file = q.AttachUrl;
|
||||
if (!string.IsNullOrEmpty(file))
|
||||
{
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -943,7 +943,10 @@
|
||||
/// 同步记录
|
||||
/// </summary>
|
||||
public const string RealNameSynchroRecordMenuId = "F36E6C54-E39F-4032-874D-548EE090A35B";
|
||||
|
||||
/// <summary>
|
||||
/// 实施计划
|
||||
/// </summary>
|
||||
public const string OfficeActionPlanListMenuId = "B6A2B6EB-6B90-4953-B544-83FFF4F0EC19";
|
||||
/// <summary>
|
||||
/// 总包施工质量计划
|
||||
/// </summary>
|
||||
@@ -3431,6 +3434,47 @@
|
||||
public const string ProjectInformation_DrillPlanHalfYearReportId = "10";
|
||||
#endregion
|
||||
|
||||
#region 安全流程定义
|
||||
#region 安全实施计划流程定义
|
||||
|
||||
/// <summary>
|
||||
/// 重报
|
||||
/// </summary>
|
||||
public const string ActionPlanList_ReCompile = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 编制
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Compile = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 会签
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Audit = "2";
|
||||
|
||||
/// <summary>
|
||||
/// 评审负责人办理
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Review = "3";
|
||||
|
||||
/// <summary>
|
||||
/// 施工管理部评审
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Reviewing = "4";
|
||||
|
||||
/// <summary>
|
||||
/// 评审负责人办理
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Review2 = "5";
|
||||
|
||||
/// <summary>
|
||||
/// 审批完成
|
||||
/// </summary>
|
||||
public static string ActionPlanList_Complete = "C";
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 质量
|
||||
#region 质量管理
|
||||
#region 基础设置
|
||||
|
||||
@@ -0,0 +1,482 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ActionPlanListApproveService
|
||||
{
|
||||
public static Model.ActionPlan_ActionPlanListApprove GetSee(string ActionPlanListId, string userId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
public static Model.ActionPlan_ActionPlanListApprove GetReview(string ActionPlanListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "R");
|
||||
}
|
||||
|
||||
public static void See(string ActionPlanListId, string userId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var res = db.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
if (res != null)
|
||||
{
|
||||
res.ApproveDate = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 部门评审小组审批信息
|
||||
/// </summary>
|
||||
/// <param name="MainPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetReviewings(string ActionPlanListId, int edtion)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 部门评审小组审批信息
|
||||
/// </summary>
|
||||
/// <param name="MainPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetReviewingEnds(string ActionPlanListId, int edtion)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing && x.Edition == edtion && x.ApproveDate != null select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 部门评审小组审批人员Id集合
|
||||
/// </summary>
|
||||
/// <param name="MainPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<string> GetReviewingPersonIds(string ActionPlanListId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_Reviewing select x.ApproveMan).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全实施计划编号获取对应的所有未办理安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListId">安全实施计划编号</param>
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetActionPlanListApprovesNotHandleList(string ActionPlanListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全实施计划发布Id获取对应组会签人id集合信息
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListCode">安全实施计划发布Id</param>
|
||||
/// <returns>安全实施计划审批集合</returns>
|
||||
public static List<string> GetUserIdsApprovesBySignType(string ActionPlanListId, string signType)
|
||||
{
|
||||
var edtion = GetUserIdsApprovesBySignTypeEditon(ActionPlanListId);
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.SignType == signType && x.Edition == edtion select x.ApproveMan).ToList();
|
||||
}
|
||||
|
||||
public static int? GetUserIdsApprovesBySignTypeEditon(string ActionPlanListId)
|
||||
{
|
||||
int edition = 0;
|
||||
var actionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(p => p.ActionPlanListId == ActionPlanListId);
|
||||
if (actionPlanList != null)
|
||||
{
|
||||
edition = Convert.ToInt32(actionPlanList.Edition);
|
||||
}
|
||||
return edition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">安全实施计划审批实体</param>
|
||||
public static void UpdateActionPlanListApprove(Model.ActionPlan_ActionPlanListApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.First(e => e.ActionPlanListApproveId == approve.ActionPlanListApproveId && e.ApproveDate == null);
|
||||
newApprove.ActionPlanListId = approve.ActionPlanListId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据安全实施计划发布Id获取所以对应安全实施计划审批信息(查询全部会签状态)
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListCode">安全实施计划发布Id</param>
|
||||
/// <returns>安全实施计划审批集合</returns>
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetHandleActionPlanListApprovesByActionPlanListId(string ActionPlanListId, int edition)
|
||||
{
|
||||
var list = Funs.DB.ActionPlan_ActionPlanListApprove.Where(p => p.ActionPlanListId == ActionPlanListId && p.ApproveType == Const.ActionPlanList_Audit && p.Edition == edition).ToList();
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetHandleConstruct(string ActionPlanListId, int edition)
|
||||
{
|
||||
var list = Funs.DB.ActionPlan_ActionPlanListApprove.Where(p => p.ActionPlanListId == ActionPlanListId && p.ApproveType != "S" && p.ApproveDate != null && p.Edition == edition).ToList();
|
||||
return list;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据安全实施计划发布Id获取所以对应安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListCode">安全实施计划发布Id</param>
|
||||
/// <returns>安全实施计划审批集合</returns>
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> GetActionPlanListApprovesByActionPlanListId(string ActionPlanListId, string state)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var reDate = (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == BLL.Const.ActionPlanList_ReCompile orderby x.ApproveDate descending select x.ApproveDate).FirstOrDefault();
|
||||
if (reDate == null)
|
||||
{
|
||||
return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == state select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (from x in db.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType == state && (x.ApproveDate == null || x.ApproveDate > reDate) select x).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全实施计划模板列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static IList<Model.ActionPlan_ActionPlanListApprove> getListData(string ActionPlanListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var res = from x in db.ActionPlan_ActionPlanListApprove
|
||||
where x.ActionPlanListId == ActionPlanListId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select x;
|
||||
|
||||
//select new
|
||||
//{
|
||||
// x.ActionPlanListApproveId,
|
||||
// x.ActionPlanListId,
|
||||
// x.ApproveMan,
|
||||
// x.ApproveDate,
|
||||
// x.IsAgree,
|
||||
// x.ApproveIdea,
|
||||
// x.ApproveType,
|
||||
// x.SignType,
|
||||
// //= x.IsAgree == true ? "是" : "否",
|
||||
//};
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取未代办的记录数量
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static int getListActionPlanApproveCount(string ActionPlanListId, string man, string signType)
|
||||
{
|
||||
|
||||
var res = (from x in Funs.DB.ActionPlan_ActionPlanListApprove
|
||||
where x.ActionPlanListId == ActionPlanListId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.SignType == signType
|
||||
orderby x.ApproveDate
|
||||
select x).Count();
|
||||
return res;
|
||||
}
|
||||
public static IList<Model.ActionPlan_ActionPlanListApprove> getListActionPlanApprove(string ActionPlanListId, string man)
|
||||
{
|
||||
|
||||
var res = (from x in Funs.DB.ActionPlan_ActionPlanListApprove
|
||||
where x.ActionPlanListId == ActionPlanListId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man)
|
||||
orderby x.ApproveDate
|
||||
select x).ToList();
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除未代办的记录
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListId"></param>
|
||||
public static void delActionPlanApprove(string ActionPlanListId, string man)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.ApproveDate == null select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
db.ActionPlan_ActionPlanListApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全实施计划编号删除对应的所有安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListCode">安全实施计划编号</param>
|
||||
public static void DeleteActionPlanListApprovesByActionPlanListId(string ActionPlanListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.ActionPlan_ActionPlanListApprove where x.ActionPlanListId == ActionPlanListId select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
db.ActionPlan_ActionPlanListApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据安全实施计划编号获取一个安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanListCode">安全实施计划编号</param>
|
||||
/// <returns>一个安全实施计划审批实体</returns>
|
||||
public static Model.ActionPlan_ActionPlanListApprove GetActionPlanListApproveByApproveMan(string ActionPlanListId, string approveMan)
|
||||
{
|
||||
|
||||
return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
public static Model.ActionPlan_ActionPlanListApprove GetConstructSoluAppByApproveMan(string ActionPlanListId, string approveMan, int edtion)
|
||||
{
|
||||
|
||||
return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.Edition == edtion && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
public static Model.ActionPlan_ActionPlanListApprove GetConstructSolApproveByApproveMan(string ActionPlanListId, string approveMan)
|
||||
{
|
||||
return Funs.DB.ActionPlan_ActionPlanListApprove.FirstOrDefault(x => x.ActionPlanListId == ActionPlanListId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加安全实施计划审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">安全实施计划审批实体</param>
|
||||
public static void AddActionPlanListApprove(Model.ActionPlan_ActionPlanListApprove approve)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.ActionPlan_ActionPlanListApprove newApprove = new Model.ActionPlan_ActionPlanListApprove();
|
||||
if (string.IsNullOrWhiteSpace(approve.ActionPlanListApproveId))
|
||||
{
|
||||
newApprove.ActionPlanListApproveId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanListApprove));
|
||||
}
|
||||
else
|
||||
{
|
||||
newApprove.ActionPlanListApproveId = approve.ActionPlanListApproveId;
|
||||
}
|
||||
newApprove.ActionPlanListId = approve.ActionPlanListId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SignType = approve.SignType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
public static void AddActionPlanListApproveForApi(Model.ActionPlan_ActionPlanListApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove newApprove = new Model.ActionPlan_ActionPlanListApprove();
|
||||
if (string.IsNullOrWhiteSpace(approve.ActionPlanListApproveId))
|
||||
{
|
||||
newApprove.ActionPlanListApproveId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanListApprove));
|
||||
}
|
||||
else
|
||||
{
|
||||
newApprove.ActionPlanListApproveId = approve.ActionPlanListApproveId;
|
||||
}
|
||||
newApprove.ActionPlanListId = approve.ActionPlanListId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SignType = approve.SignType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
db.ActionPlan_ActionPlanListApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> getListDataForApi(string ActionPlanListId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.ActionPlan_ActionPlanListApprove
|
||||
where x.ActionPlanListId == ActionPlanListId && x.Edition == edition && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ActionPlanListApproveId,
|
||||
x.ActionPlanListId,
|
||||
x.ApproveMan,
|
||||
ApproveManName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
x.SignType,
|
||||
};
|
||||
var list = q.ToList();
|
||||
List<Model.ActionPlan_ActionPlanListApprove> res = new List<Model.ActionPlan_ActionPlanListApprove>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove ap = new Model.ActionPlan_ActionPlanListApprove();
|
||||
ap.ActionPlanListApproveId = item.ActionPlanListApproveId;
|
||||
ap.ActionPlanListId = item.ActionPlanListId;
|
||||
ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName;
|
||||
ap.ApproveDate = item.ApproveDate;
|
||||
ap.IsAgree = item.IsAgree;
|
||||
ap.ApproveIdea = item.ApproveIdea;
|
||||
ap.ApproveType = item.ApproveType;
|
||||
ap.SignType = item.SignType;
|
||||
ap.AttachUrl = AttachFileService.getFileUrl(ap.ActionPlanListApproveId);
|
||||
res.Add(ap);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> getListDataForApi(string ActionPlanListId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.ActionPlan_ActionPlanListApprove
|
||||
where x.ActionPlanListId == ActionPlanListId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ActionPlanListApproveId,
|
||||
x.ActionPlanListId,
|
||||
x.ApproveMan,
|
||||
ApproveManName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
x.SignType,
|
||||
};
|
||||
var list = q.ToList();
|
||||
List<Model.ActionPlan_ActionPlanListApprove> res = new List<Model.ActionPlan_ActionPlanListApprove>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove ap = new Model.ActionPlan_ActionPlanListApprove();
|
||||
ap.ActionPlanListApproveId = item.ActionPlanListApproveId;
|
||||
ap.ActionPlanListId = item.ActionPlanListId;
|
||||
ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName;
|
||||
ap.ApproveDate = item.ApproveDate;
|
||||
ap.IsAgree = item.IsAgree;
|
||||
ap.ApproveIdea = item.ApproveIdea;
|
||||
ap.ApproveType = item.ApproveType;
|
||||
ap.SignType = item.SignType;
|
||||
ap.AttachUrl = AttachFileService.getFileUrl(ap.ActionPlanListApproveId);
|
||||
res.Add(ap);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.ActionPlan_ActionPlanListApprove getCurrApproveForApi(string ActionPlanListId, string approveMan, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.FirstOrDefault(e => e.ActionPlanListId == ActionPlanListId && e.ApproveMan == approveMan && e.Edition == edition && e.ApproveType != "S" && e.ApproveDate == null);
|
||||
if (newApprove != null)
|
||||
{
|
||||
newApprove.ApproveIdea = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan);
|
||||
}
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> getConApproveForApi(string ActionPlanListId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.ActionPlan_ActionPlanListApprove> res = new List<Model.ActionPlan_ActionPlanListApprove>();
|
||||
var newApproves = db.ActionPlan_ActionPlanListApprove.Where(e => e.ActionPlanListId == ActionPlanListId && e.Edition == edition && e.ApproveType == "2").ToList();
|
||||
if (newApproves != null)
|
||||
{
|
||||
foreach (Model.ActionPlan_ActionPlanListApprove newApprove in newApproves)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove a = new Model.ActionPlan_ActionPlanListApprove();
|
||||
a.ActionPlanListApproveId = newApprove.ActionPlanListApproveId;
|
||||
a.ActionPlanListId = newApprove.ActionPlanListId;
|
||||
a.ApproveDate = newApprove.ApproveDate;
|
||||
a.ApproveMan = newApprove.ApproveMan;
|
||||
a.ApproveType = newApprove.ApproveType;
|
||||
a.Edition = newApprove.Edition;
|
||||
a.IsAgree = newApprove.IsAgree;
|
||||
var name = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan);
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
a.ApproveMan = a.ApproveMan + "$" + name;
|
||||
}
|
||||
a.AttachUrl = AttachFileService.getFileUrl(a.ActionPlanListApproveId);
|
||||
res.Add(a);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static List<Model.ActionPlan_ActionPlanListApprove> getConApprovesForApi(string ActionPlanListId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.ActionPlan_ActionPlanListApprove> res = new List<Model.ActionPlan_ActionPlanListApprove>();
|
||||
var newApproves = db.ActionPlan_ActionPlanListApprove.Where(e => e.ActionPlanListId == ActionPlanListId && e.Edition == edition).ToList();
|
||||
if (newApproves != null)
|
||||
{
|
||||
foreach (Model.ActionPlan_ActionPlanListApprove newApprove in newApproves)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove a = new Model.ActionPlan_ActionPlanListApprove();
|
||||
a.ActionPlanListApproveId = newApprove.ActionPlanListApproveId;
|
||||
a.ActionPlanListId = newApprove.ActionPlanListId;
|
||||
a.ApproveDate = newApprove.ApproveDate;
|
||||
a.ApproveMan = newApprove.ApproveMan;
|
||||
a.ApproveType = newApprove.ApproveType;
|
||||
a.Edition = newApprove.Edition;
|
||||
a.IsAgree = newApprove.IsAgree;
|
||||
var name = Person_PersonsService.GetPersonsNameById(newApprove.ApproveMan);
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
a.ApproveMan = a.ApproveMan + "$" + name;
|
||||
}
|
||||
a.AttachUrl = AttachFileService.getFileUrl(a.ActionPlanListApproveId);
|
||||
res.Add(a);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.ActionPlan_ActionPlanListApprove UpdateActionPlanListApproveForApi(Model.ActionPlan_ActionPlanListApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.ActionPlan_ActionPlanListApprove newApprove = db.ActionPlan_ActionPlanListApprove.First(e => e.ActionPlanListApproveId == approve.ActionPlanListApproveId);
|
||||
if (!string.IsNullOrEmpty(approve.ActionPlanListId))
|
||||
newApprove.ActionPlanListId = approve.ActionPlanListId;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
if (approve.ApproveDate.HasValue)
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveIdea))
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
if (approve.IsAgree.HasValue)
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveType))
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
AttachFileService.updateAttachFile(approve.AttachUrl, newApprove.ActionPlanListApproveId, Const.ProjectActionPlanListMenuId);
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,10 @@ namespace BLL
|
||||
ActionPlanListName = actionPlanList.ActionPlanListName,
|
||||
VersionNo = actionPlanList.VersionNo,
|
||||
ProjectType = actionPlanList.ProjectType,
|
||||
Edition = actionPlanList.Edition,
|
||||
IsReview = actionPlanList.IsReview,
|
||||
ReviewMan = actionPlanList.ReviewMan,
|
||||
IsCompanyReview = actionPlanList.IsCompanyReview,
|
||||
ActionPlanListContents = actionPlanList.ActionPlanListContents,
|
||||
CompileMan = actionPlanList.CompileMan,
|
||||
CompileDate = actionPlanList.CompileDate,
|
||||
@@ -72,6 +76,10 @@ namespace BLL
|
||||
newActionPlanList.ActionPlanListName = actionPlanList.ActionPlanListName;
|
||||
newActionPlanList.VersionNo = actionPlanList.VersionNo;
|
||||
newActionPlanList.ProjectType = actionPlanList.ProjectType;
|
||||
newActionPlanList.Edition = actionPlanList.Edition;
|
||||
newActionPlanList.IsReview = actionPlanList.IsReview;
|
||||
newActionPlanList.ReviewMan = actionPlanList.ReviewMan;
|
||||
newActionPlanList.IsCompanyReview = actionPlanList.IsCompanyReview;
|
||||
newActionPlanList.ActionPlanListContents = actionPlanList.ActionPlanListContents;
|
||||
newActionPlanList.CompileMan = actionPlanList.CompileMan;
|
||||
newActionPlanList.CompileDate = actionPlanList.CompileDate;
|
||||
@@ -89,6 +97,7 @@ namespace BLL
|
||||
Model.ActionPlan_ActionPlanList actionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(e => e.ActionPlanListId == actionPlanListId);
|
||||
if (actionPlanList != null)
|
||||
{
|
||||
BLL.ActionPlanListApproveService.DeleteActionPlanListApprovesByActionPlanListId(actionPlanListId);
|
||||
////删除审核流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(actionPlanList.ActionPlanListId);
|
||||
///删除附件
|
||||
@@ -99,5 +108,68 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.ActionPlanList_ReCompile)
|
||||
{
|
||||
return "重报";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Audit)
|
||||
{
|
||||
return "会签";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Review)
|
||||
{
|
||||
return "评审负责人办理";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Reviewing)
|
||||
{
|
||||
return "施工管理部评审";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Review2)
|
||||
{
|
||||
return "评审负责人办理";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.ActionPlanList_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static string IsAgree(Object type, Object res)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (type.ToString().Equals(Const.ActionPlanList_ReCompile) || type.ToString().Equals(Const.ActionPlanList_Compile))
|
||||
{
|
||||
res = null;
|
||||
}
|
||||
if (res != null)
|
||||
{
|
||||
if (Convert.ToBoolean(res))
|
||||
{
|
||||
result = "是";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "否";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user