修改质量接口

This commit is contained in:
2023-03-17 09:59:48 +08:00
parent eef27faf84
commit 4a3fb76c8c
12 changed files with 962 additions and 74 deletions
@@ -196,7 +196,7 @@ namespace BLL
approve.ApproveDate = item.ApproveDate;
approve.IsAgree = item.IsAgree;
approve.ApproveIdea = item.ApproveIdea;
approve.ApproveType = item.ApproveType;
approve.ApproveType = item.ApproveType + "$" + CQMS_MeetingService.ConvertState(item.ApproveType); ;
res.Add(approve);
}
return res;
+2 -2
View File
@@ -190,7 +190,7 @@ namespace BLL
}
/// <summary>
/// 根据状态选择下一步办理类型
/// 根据状态获取办理人
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
@@ -374,7 +374,7 @@ namespace BLL
CompileDate = Meeting.CompileDate,
};
db.Meeting_CQMSMeeting.InsertOnSubmit(Meeting);
db.Meeting_CQMSMeeting.InsertOnSubmit(newCQMSMeeting);
db.SubmitChanges();
Model.Meeting_CQMSMeetingApprove approve = new Model.Meeting_CQMSMeetingApprove();
+107
View File
@@ -41,6 +41,23 @@ namespace BLL
Funs.DB.SubmitChanges();
}
public static void AddQualityModelForApi(Model.Model_QualityModel QualityModel)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
Model.Model_QualityModel newQualityModel = new Model.Model_QualityModel();
newQualityModel.QualityModelId = QualityModel.QualityModelId;
newQualityModel.ProjectId = QualityModel.ProjectId;
newQualityModel.CompanyModelId = QualityModel.CompanyModelId;
newQualityModel.Evaluate = QualityModel.Evaluate;
newQualityModel.Remark = QualityModel.Remark;
newQualityModel.CompileMan = QualityModel.CompileMan;
newQualityModel.CompileDate = QualityModel.CompileDate;
db.Model_QualityModel.InsertOnSubmit(newQualityModel);
db.SubmitChanges();
}
}
/// <summary>
/// 修改公司质量样板
/// </summary>
@@ -57,6 +74,24 @@ namespace BLL
}
}
public static void UpdateQualityModelForApi(Model.Model_QualityModel QualityModel)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Model_QualityModel newQualityModel = db.Model_QualityModel.FirstOrDefault(e => e.QualityModelId == QualityModel.QualityModelId);
if (newQualityModel != null)
{
if (!string.IsNullOrEmpty(QualityModel.CompanyModelId))
newQualityModel.CompanyModelId = QualityModel.CompanyModelId;
if (!string.IsNullOrEmpty(QualityModel.Evaluate))
newQualityModel.Evaluate = QualityModel.Evaluate;
if (!string.IsNullOrEmpty(QualityModel.Remark))
newQualityModel.Remark = QualityModel.Remark;
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除公司质量样板
/// </summary>
@@ -71,5 +106,77 @@ namespace BLL
Funs.DB.SubmitChanges();
}
}
public static List<Model.Model_QualityModel> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
IQueryable<Model.Model_QualityModel> q = db.Model_QualityModel;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);
}
var qres = from x in q
orderby x.CompileDate descending
select new
{
x.QualityModelId,
x.ProjectId,
x.CompanyModelId,
ModelType = (from y in db.Base_CompanyModel where y.CompanyModelId == x.CompanyModelId select y.ModelType).First(),
CompanyModelKindName = (from y in db.Base_CompanyModelKind
join z in db.Base_CompanyModel on y.CompanyModelKindId equals z.CompanyModelKindId
where z.CompanyModelId == x.CompanyModelId
select y.CompanyModelKindName).First(),
x.Evaluate,
x.Remark,
x.CompileDate,
x.CompileMan,
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
x.AttachUrl,
};
List<Model.Model_QualityModel> res = new List<Model.Model_QualityModel>();
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
foreach (var item in list)
{
Model.Model_QualityModel cd = new Model.Model_QualityModel();
cd.QualityModelId = item.QualityModelId;
cd.ProjectId = item.ProjectId;
cd.CompanyModelId = item.CompanyModelId + "$" + item.ModelType + "$" + item.CompanyModelKindName;
cd.Evaluate = item.Evaluate;
cd.Remark = item.Remark;
cd.CompileDate = item.CompileDate;
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
cd.AttachUrlModel = AttachFileService.getFileUrl(item.CompanyModelId);
cd.AttachUrl = AttachFileService.getFileUrl(item.QualityModelId);
res.Add(cd);
}
return res;
}
}
/// <summary>
/// 获取质量模板信息
/// </summary>
/// <param name="UnitWorkId"></param>
/// <returns></returns>
public static Model.Model_QualityModel GetQualityModelByQualityModelIdForApi(string QualityModelId)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
var q = db.Model_QualityModel.FirstOrDefault(e => e.QualityModelId == QualityModelId);
if (q != null)
{
q.CompanyModelId = q.CompanyModelId + "$" + (from y in db.Base_CompanyModel where y.CompanyModelId == q.CompanyModelId select y.ModelType).First() + "$"+ (from y in db.Base_CompanyModelKind
join z in db.Base_CompanyModel on y.CompanyModelKindId equals z.CompanyModelKindId
where z.CompanyModelId == q.CompanyModelId
select y.CompanyModelKindName).First();
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
q.AttachUrlModel = AttachFileService.getFileUrl(q.CompanyModelId);
q.AttachUrl = AttachFileService.getFileUrl(q.QualityModelId);
}
return q;
}
}
}
}
@@ -121,6 +121,30 @@ namespace BLL
db.SubmitChanges();
}
public static void UpdateRewardAndPunishApproveForApi(Model.RewardAndPunish_RewardAndPunishApprove approve)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.RewardAndPunish_RewardAndPunishApprove newApprove = db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(e => e.RewardAndPunishApproveId == approve.RewardAndPunishApproveId && e.ApproveDate == null);
if (newApprove != null)
{
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();
}
}
}
/// <summary>
/// 增加质量奖罚审批信息
/// </summary>
@@ -141,6 +165,27 @@ namespace BLL
db.SubmitChanges();
}
public static string AddRewardAndPunishApproveForApi(Model.RewardAndPunish_RewardAndPunishApprove approve)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
string newKeyID = SQLHelper.GetNewID(typeof(Model.RewardAndPunish_RewardAndPunishApprove));
Model.RewardAndPunish_RewardAndPunishApprove newApprove = new Model.RewardAndPunish_RewardAndPunishApprove();
newApprove.RewardAndPunishApproveId = newKeyID;
newApprove.RewardAndPunishId = approve.RewardAndPunishId;
newApprove.ApproveMan = approve.ApproveMan;
newApprove.ApproveDate = approve.ApproveDate;
newApprove.ApproveIdea = approve.ApproveIdea;
newApprove.IsAgree = approve.IsAgree;
newApprove.ApproveType = approve.ApproveType;
db.RewardAndPunish_RewardAndPunishApprove.InsertOnSubmit(newApprove);
db.SubmitChanges();
return newKeyID;
}
}
/// <summary>
/// 总包专业工程师审核信息
/// </summary>
@@ -155,5 +200,60 @@ namespace BLL
{
return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Compile);
}
public static string GetHandleManName(string RewardAndPunishId)
{
string name = string.Empty;
var a = Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveDate == null);
if (a != null)
{
name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan);
}
return name;
}
public static List<Model.RewardAndPunish_RewardAndPunishApprove> GetListDataByIdForApi(string id)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
var q = from x in db.RewardAndPunish_RewardAndPunishApprove
where x.RewardAndPunishId == id && x.ApproveDate != null && x.ApproveType != "S"
orderby x.ApproveDate
select new
{
x.RewardAndPunishApproveId,
x.RewardAndPunishId,
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
x.ApproveDate,
x.IsAgree,
x.ApproveIdea,
x.ApproveType,
};
List<Model.RewardAndPunish_RewardAndPunishApprove> res = new List<Model.RewardAndPunish_RewardAndPunishApprove>();
var list = q.ToList();
foreach (var item in list)
{
Model.RewardAndPunish_RewardAndPunishApprove approve = new Model.RewardAndPunish_RewardAndPunishApprove();
approve.RewardAndPunishApproveId = item.RewardAndPunishApproveId;
approve.RewardAndPunishId = item.RewardAndPunishId;
approve.ApproveMan = item.ApproveMan;
approve.ApproveDate = item.ApproveDate;
approve.IsAgree = item.IsAgree;
approve.ApproveIdea = item.ApproveIdea;
approve.ApproveType = item.ApproveType + "$" + RewardAndPunishService.ConvertState(item.ApproveType); ;
res.Add(approve);
}
return res;
}
}
public static Model.RewardAndPunish_RewardAndPunishApprove getCurrApproveForApi(string id)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.RewardAndPunish_RewardAndPunishApprove newApprove = db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(e => e.RewardAndPunishId == id && e.ApproveType != "S" && e.ApproveDate == null);
return newApprove;
}
}
}
}
@@ -47,6 +47,39 @@ namespace BLL
db.SubmitChanges();
}
public static void AddRewardAndPunishForApi(Model.RewardAndPunish_RewardAndPunish RewardAndPunish)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.RewardAndPunish_RewardAndPunish newRewardAndPunish = new Model.RewardAndPunish_RewardAndPunish
{
RewardAndPunishId = RewardAndPunish.RewardAndPunishId,
ProjectId = RewardAndPunish.ProjectId,
RewardAndPunishCode = RewardAndPunish.RewardAndPunishCode,
UnitId = RewardAndPunish.UnitId,
Type = RewardAndPunish.Type,
RewardAndPunishTypeId = RewardAndPunish.RewardAndPunishTypeId,
RewardAndPunishBasis = RewardAndPunish.RewardAndPunishBasis,
State = RewardAndPunish.State,
CompileMan = RewardAndPunish.CompileMan,
CompileDate = RewardAndPunish.CompileDate,
RewardAndPunishDecision=RewardAndPunish.RewardAndPunishDecision,
};
db.RewardAndPunish_RewardAndPunish.InsertOnSubmit(newRewardAndPunish);
db.SubmitChanges();
Model.RewardAndPunish_RewardAndPunishApprove approve = new Model.RewardAndPunish_RewardAndPunishApprove();
approve.RewardAndPunishApproveId = BLL.SQLHelper.GetNewID();
approve.RewardAndPunishId = RewardAndPunish.RewardAndPunishId;
approve.ApproveType = BLL.Const.RewardAndPunish_Compile;
approve.ApproveMan = RewardAndPunish.CompileMan;
approve.ApproveDate = RewardAndPunish.CompileDate;
db.RewardAndPunish_RewardAndPunishApprove.InsertOnSubmit(approve);
db.SubmitChanges();
}
}
/// <summary>
/// 修改质量奖罚
/// </summary>
@@ -69,6 +102,30 @@ namespace BLL
}
}
public static void UpdateRewardAndPunishForApi(Model.RewardAndPunish_RewardAndPunish RewardAndPunish)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
Model.RewardAndPunish_RewardAndPunish newRewardAndPunish = db.RewardAndPunish_RewardAndPunish.First(e => e.RewardAndPunishId == RewardAndPunish.RewardAndPunishId);
if (!string.IsNullOrEmpty(RewardAndPunish.RewardAndPunishCode))
newRewardAndPunish.RewardAndPunishCode = RewardAndPunish.RewardAndPunishCode;
if (!string.IsNullOrEmpty(RewardAndPunish.UnitId))
newRewardAndPunish.UnitId = RewardAndPunish.UnitId;
if (!string.IsNullOrEmpty(RewardAndPunish.Type))
newRewardAndPunish.Type = RewardAndPunish.Type;
if (!string.IsNullOrEmpty(RewardAndPunish.RewardAndPunishTypeId))
newRewardAndPunish.RewardAndPunishTypeId = RewardAndPunish.RewardAndPunishTypeId;
if (!string.IsNullOrEmpty(RewardAndPunish.RewardAndPunishBasis))
newRewardAndPunish.RewardAndPunishBasis = RewardAndPunish.RewardAndPunishBasis;
if (!string.IsNullOrEmpty(RewardAndPunish.RewardAndPunishDecision))
newRewardAndPunish.RewardAndPunishDecision = RewardAndPunish.RewardAndPunishDecision;
if (!string.IsNullOrEmpty(RewardAndPunish.State))
newRewardAndPunish.State = RewardAndPunish.State;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除质量奖罚
/// </summary>
@@ -116,72 +173,228 @@ namespace BLL
return null;
}
//public static List<Model.Meeting_CQMSMeeting> getListDataForApi(string projectId, int startRowIndex, int maximumRows, string type)
//{
// using (var db = new Model.SGGLDB(Funs.ConnString))
// {
// IQueryable<Model.RewardAndPunish_RewardAndPunish> q = db.RewardAndPunish_RewardAndPunish;
// if (!string.IsNullOrEmpty(projectId))
// {
// q = q.Where(e => e.ProjectId == projectId);
// }
// if (type!="0")
// {
// q = q.Where(e => e.Type == type);
// }
// var qres = from x in q
// orderby x.CompileDate descending
// select new
// {
// x.MeetingId,
// x.ProjectId,
// x.UnitId,
// UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
// x.MeetingType,
// MeetingTypeStr = x.MeetingType == "M" ? "质量月例会" : "质量专题会",
// x.MeetingCode,
// x.MeetingDate,
// x.Place,
// x.HostMan,
// HostManName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.HostMan),
// x.AttentPerson,
// AttentPersonName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.AttentPerson),
// x.AttentPersonNum,
// x.MeetingTheme,
// x.MeetingContents,
// x.CompileDate,
// x.CompileMan,
// x.State,
// StateStr = ConvertState(x.State),
// CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
// HandleManName = BLL.CQMS_MeetingApproveService.GetHandleManName(x.MeetingId),
// x.AttachUrl,
// };
// List<Model.Meeting_CQMSMeeting> res = new List<Model.Meeting_CQMSMeeting>();
// var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
// foreach (var item in list)
// {
// Model.Meeting_CQMSMeeting cd = new Model.Meeting_CQMSMeeting();
// cd.MeetingId = item.MeetingId;
// cd.ProjectId = item.ProjectId;
// cd.UnitId = item.UnitId + "$" + item.UnitName;
// cd.MeetingType = item.MeetingType + "$" + item.MeetingTypeStr;
// cd.MeetingCode = item.MeetingCode;
// cd.MeetingDate = item.MeetingDate;
// cd.Place = item.Place;
// cd.HostMan = item.HostMan + "$" + item.HostManName;
// cd.AttentPerson = item.AttentPerson + "$" + item.AttentPersonName;
// cd.AttentPersonNum = item.AttentPersonNum;
// cd.MeetingTheme = item.MeetingTheme;
// cd.MeetingContents = item.MeetingContents;
// cd.CompileDate = item.CompileDate;
// cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
// cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
// cd.AttachUrl = AttachFileService.getFileUrl(item.MeetingId);
// res.Add(cd);
// }
// return res;
// }
//}
/// <summary>
/// 根据状态选择下一步办理类型
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetDHandleTypeByStateForApi(string state)
{
List<Model.BaseInfoItem> list = new List<Model.BaseInfoItem>();
if (state == Const.RewardAndPunish_Compile || state == Const.RewardAndPunish_ReCompile)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = Const.RewardAndPunish_Audit1;
item.BaseInfoName = "质量经理审核";
list.Add(item);
return list;
}
else if (state == Const.RewardAndPunish_Audit1)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = Const.RewardAndPunish_Audit2;
item.BaseInfoName = "项目经理批准";
list.Add(item);
Model.BaseInfoItem item2 = new Model.BaseInfoItem();
item2.BaseInfoId = Const.RewardAndPunish_ReCompile;
item2.BaseInfoName = "重新编制";
list.Add(item2);
return list;
}
else if (state == Const.RewardAndPunish_Audit2)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = Const.RewardAndPunish_Complete;
item.BaseInfoName = "审批完成";
list.Add(item);
Model.BaseInfoItem item2 = new Model.BaseInfoItem();
item2.BaseInfoId = Const.RewardAndPunish_ReCompile;
item2.BaseInfoName = "重新编制";
list.Add(item2);
return list;
}
else
return null;
}
/// <summary>
/// 把状态转换代号为文字形式
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public static string ConvertState(object state)
{
if (state != null)
{
if (state.ToString() == BLL.Const.RewardAndPunish_ReCompile)
{
return "重新编制";
}
else if (state.ToString() == BLL.Const.RewardAndPunish_Compile)
{
return "编制";
}
else if (state.ToString() == BLL.Const.RewardAndPunish_Audit1)
{
return "质量经理审核";
}
else if (state.ToString() == BLL.Const.RewardAndPunish_Audit2)
{
return "项目经理批准";
}
else if (state.ToString() == BLL.Const.RewardAndPunish_Complete)
{
return "审批完成";
}
else
{
return "";
}
}
return "";
}
/// <summary>
/// 把状态转换代号为文字形式
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public static string ConvertCause(object RewardAndPunishTypeId)
{
string cause = string.Empty;
if (RewardAndPunishTypeId != null)
{
Model.Base_RewardType rt = BLL.RewardTypeService.GetRewardTypeById(RewardAndPunishTypeId.ToString());
Model.Base_PunishType pt = BLL.PunishTypeService.GetPunishTypeById(RewardAndPunishTypeId.ToString());
if (rt != null)
{
cause = rt.RewardCause;
}
else if (pt != null)
{
cause = pt.PunishCause;
}
}
return cause;
}
public static List<Model.RewardAndPunish_RewardAndPunish> getListDataForApi(string projectId, int startRowIndex, int maximumRows, string type)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
IQueryable<Model.RewardAndPunish_RewardAndPunish> q = db.RewardAndPunish_RewardAndPunish;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);
}
if (type != "0")
{
q = q.Where(e => e.Type == type);
}
var qres = from x in q
orderby x.CompileDate descending
select new
{
x.RewardAndPunishId,
x.ProjectId,
x.RewardAndPunishCode,
x.UnitId,
UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
x.Type,
TypeStr = x.Type == "1" ? "奖励" : "处罚",
x.RewardAndPunishTypeId,
RewardAndPunishTypeStr = ConvertCause(x.RewardAndPunishTypeId),
x.RewardAndPunishBasis,
x.RewardAndPunishDecision,
x.CompileDate,
x.CompileMan,
x.State,
StateStr = ConvertState(x.State),
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
HandleManName = BLL.RewardAndPunishApproveService.GetHandleManName(x.RewardAndPunishId),
x.AttachUrl,
};
List<Model.RewardAndPunish_RewardAndPunish> res = new List<Model.RewardAndPunish_RewardAndPunish>();
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
foreach (var item in list)
{
Model.RewardAndPunish_RewardAndPunish cd = new Model.RewardAndPunish_RewardAndPunish();
cd.RewardAndPunishId = item.RewardAndPunishId;
cd.ProjectId = item.ProjectId;
cd.RewardAndPunishCode = item.RewardAndPunishCode;
cd.UnitId = item.UnitId + "$" + item.UnitName;
cd.Type = item.Type + "$" + item.TypeStr;
cd.RewardAndPunishTypeId = item.RewardAndPunishTypeId + "$" + item.RewardAndPunishTypeStr;
cd.RewardAndPunishBasis = item.RewardAndPunishBasis;
cd.RewardAndPunishDecision = item.RewardAndPunishDecision;
cd.CompileDate = item.CompileDate;
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName;
cd.AttachUrl = AttachFileService.getFileUrl(item.RewardAndPunishId);
res.Add(cd);
}
return res;
}
}
/// <summary>
/// 获取质量奖罚信息
/// </summary>
/// <param name="UnitWorkId"></param>
/// <returns></returns>
public static Model.RewardAndPunish_RewardAndPunish GetRewardAndPunishByRewardAndPunishIdForApi(string RewardAndPunishId)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
var q = db.RewardAndPunish_RewardAndPunish.FirstOrDefault(e => e.RewardAndPunishId == RewardAndPunishId);
if (q != null)
{
q.UnitId = q.UnitId + "$" + BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
q.Type = q.Type + "$" + (q.Type == "1" ? "奖励" : "处罚");
q.RewardAndPunishTypeId = q.RewardAndPunishTypeId + "$" + ConvertCause(q.RewardAndPunishTypeId);
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.RewardAndPunishApproveService.GetHandleManName(q.RewardAndPunishId);
q.AttachUrl = AttachFileService.getFileUrl(q.RewardAndPunishId);
}
return q;
}
}
/// <summary>
/// 根据状态获取办理人
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public static List<Model.BaseInfoItem> GetHandleManListForApi(string state, string id, string projectId)
{
List<Model.BaseInfoItem> list = new List<Model.BaseInfoItem>();
if (state == Const.RewardAndPunish_Compile)
{
return null;
}
else if (state == Const.RewardAndPunish_ReCompile)
{
var user = BLL.Person_PersonsService.GetPerson_PersonsById(BLL.RewardAndPunishApproveService.GetAuditMan(id, BLL.Const.RewardAndPunish_Compile).ApproveMan);
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = user.PersonId;
item.BaseInfoName = user.PersonName;
list.Add(item);
return list;
}
else if (state == Const.RewardAndPunish_Audit1 || state == Const.RewardAndPunish_Audit2)
{
var users = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, null);
foreach (var user in users)
{
Model.BaseInfoItem item = new Model.BaseInfoItem();
item.BaseInfoId = user.PersonId;
item.BaseInfoName = user.PersonName;
list.Add(item);
}
return list;
}
else
return null;
}
}
}