提交代码
This commit is contained in:
@@ -14,49 +14,96 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="CheckSpecialId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CheckSpecialItem getCheckSpecialById(string CheckSpecialId)
|
||||
public static Model.CheckSpecialItem getCheckSpecialById(string CheckSpecialId,string state="0")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId),
|
||||
if (state == "0")
|
||||
{
|
||||
//状态是0的时候查看所有
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId,"0"),
|
||||
|
||||
ResponsibleUnit=x.ResponsibleUnit,
|
||||
ResponsibleUnitName=UnitService.GetUnitNameByUnitId(x.ResponsibleUnit),
|
||||
WorkAreaId=x.WorkAreaId,
|
||||
WorkAreaName= UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
QuestionType=x.QuestionType,
|
||||
QuestionTypeName=UnitService.GetQuestionTypeId(x.QuestionType),
|
||||
ResponsibleUnit = x.ResponsibleUnit,
|
||||
ResponsibleUnitName = UnitService.GetUnitNameByUnitId(x.ResponsibleUnit),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
QuestionType = x.QuestionType,
|
||||
QuestionTypeName = UnitService.GetQuestionTypeId(x.QuestionType),
|
||||
|
||||
ResponsibleMan=x.ResponsibleMan,
|
||||
ResponsibleMan = x.ResponsibleMan,
|
||||
ReceiveMan = x.ReceiveMan
|
||||
|
||||
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
}
|
||||
else {
|
||||
//状态是1的时候查看不合格的子项
|
||||
var getInfo = from x in db.Check_CheckSpecial
|
||||
where x.CheckSpecialId == CheckSpecialId
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
ProjectId = x.ProjectId,
|
||||
CheckSpecialCode = x.CheckSpecialCode,
|
||||
CheckTypeName = (x.CheckType == "1" ? "联合" : "专项"),
|
||||
CheckType = x.CheckType,
|
||||
CheckItemSetId = x.CheckItemSetId,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItemSetId).CheckItemName,
|
||||
CheckPersonId = x.CheckPerson,
|
||||
CheckPersonName = db.Sys_User.First(u => u.UserId == x.CheckPerson).UserName,
|
||||
CheckTime = string.Format("{0:yyyy-MM-dd}", x.CheckTime),
|
||||
DaySummary = x.DaySummary,
|
||||
PartInUnitIds = x.PartInUnits,
|
||||
PartInUnitNames = UnitService.getUnitNamesUnitIds(x.PartInUnits),
|
||||
PartInPersonIds = x.PartInPersonIds,
|
||||
PartInPersonNames = UserService.getUserNamesUserIds(x.PartInPersonIds),
|
||||
PartInPersonNames2 = x.PartInPersonNames,
|
||||
CompileManId = x.CompileMan,
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId,"1"),
|
||||
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
ResponsibleUnit = x.ResponsibleUnit,
|
||||
ResponsibleUnitName = UnitService.GetUnitNameByUnitId(x.ResponsibleUnit),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
QuestionType = x.QuestionType,
|
||||
QuestionTypeName = UnitService.GetQuestionTypeId(x.QuestionType),
|
||||
|
||||
ResponsibleMan = x.ResponsibleMan,
|
||||
ReceiveMan = x.ReceiveMan
|
||||
|
||||
|
||||
};
|
||||
return getInfo.FirstOrDefault();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -68,12 +115,14 @@ namespace BLL
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="states"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CheckSpecialItem> getCheckSpecialList(string projectId, string states)
|
||||
public static List<Model.CheckSpecialItem> getCheckSpecialList(string projectId, string states,string userid)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getCheckSpecial = from x in db.Check_CheckSpecial
|
||||
where x.ProjectId == projectId && x.States ==states
|
||||
//当前保存人、审核人、确认人能看到
|
||||
&&(x.CompileMan==userid || x.ResponsibleMan==userid || userid.Contains(x.ReceiveMan))
|
||||
orderby x.CheckSpecialCode descending
|
||||
select new Model.CheckSpecialItem
|
||||
{
|
||||
@@ -97,6 +146,7 @@ namespace BLL
|
||||
CompileManName = db.Sys_User.First(u => u.UserId == x.CompileMan).UserName,
|
||||
States = x.States,
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
|
||||
ReceiveMan=x.ResponsibleMan
|
||||
};
|
||||
return getCheckSpecial.ToList();
|
||||
}
|
||||
@@ -237,43 +287,83 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="checkSpecialId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CheckSpecialDetailItem> getCheckSpecialDetailList(string checkSpecialId)
|
||||
public static List<Model.CheckSpecialDetailItem> getCheckSpecialDetailList(string checkSpecialId,string CompleteStatus="0")
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y=>y.UnitWorkId ==x.CheckArea).UnitWorkName,
|
||||
WorkAreaId=x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
if (CompleteStatus == "0")
|
||||
{
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y => y.UnitWorkId == x.CheckArea).UnitWorkName,
|
||||
WorkAreaId = x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions=x.CheckOpinions,
|
||||
};
|
||||
return getInfo.ToList();
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions = x.CheckOpinions,
|
||||
};
|
||||
return getInfo.ToList();
|
||||
}
|
||||
else {
|
||||
//查询不合格子项
|
||||
var getInfo = from x in db.Check_CheckSpecialDetail
|
||||
where x.CheckSpecialId == checkSpecialId && x.CompleteStatus==false
|
||||
orderby x.SortIndex
|
||||
select new Model.CheckSpecialDetailItem
|
||||
{
|
||||
CheckSpecialDetailId = x.CheckSpecialDetailId,
|
||||
CheckSpecialId = x.CheckSpecialId,
|
||||
CheckItemSetId = x.CheckItem,
|
||||
CheckItemSetName = db.Technique_CheckItemSet.First(y => y.CheckItemSetId == x.CheckItem).CheckItemName,
|
||||
CheckContent = x.CheckContent,
|
||||
SortIndex = x.SortIndex,
|
||||
Unqualified = x.Unqualified,
|
||||
Suggestions = x.Suggestions,
|
||||
WorkArea = db.WBS_UnitWork.First(y => y.UnitWorkId == x.CheckArea).UnitWorkName,
|
||||
WorkAreaId = x.CheckArea,
|
||||
UnitId = x.UnitId,
|
||||
UnitName = db.Base_Unit.First(y => y.UnitId == x.UnitId).UnitName,
|
||||
HandleStep = x.HandleStep,
|
||||
HandleStepName = getNames(x.HandleStep),
|
||||
HiddenHazardType = x.HiddenHazardType,
|
||||
HiddenHazardTypeName = x.HiddenHazardType == "3" ? "重大" : (x.HiddenHazardType == "2" ? "较大" : "一般"),
|
||||
LimitedDate = string.Format("{0:yyyy-MM-dd}", x.LimitedDate),
|
||||
CompleteStatus = x.CompleteStatus,
|
||||
CompleteStatusName = x.CompleteStatus == true ? "已整改" : "待整改",
|
||||
CompletedDate = string.Format("{0:yyyy-MM-dd}", x.CompletedDate),
|
||||
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialDetailId, null),
|
||||
|
||||
CheckItemDetailSetId = x.CheckItemSetId,
|
||||
CheckItemDetailContent = x.CheckItemSetContent,
|
||||
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
|
||||
CheckOpinions = x.CheckOpinions,
|
||||
};
|
||||
return getInfo.ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user