提交代码

This commit is contained in:
2023-09-27 09:59:07 +08:00
parent 74327b5a3e
commit 988d168cbf
15 changed files with 721 additions and 140 deletions
+70 -33
View File
@@ -43,6 +43,18 @@ namespace BLL
States = x.States,
AttachUrl1 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId, null),
CheckSpecialDetailItems = getCheckSpecialDetailList(x.CheckSpecialId),
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,
};
return getInfo.FirstOrDefault();
}
@@ -117,18 +129,38 @@ namespace BLL
PartInPersons = UserService.getUserNamesUserIds(newItem.PartInPersonIds),
PartInPersonNames = newItem.PartInPersonNames2,
CompileMan = newItem.CompileManId,
States = Const.State_0,
States = newItem.States,
ResponsibleUnit=newItem.ResponsibleUnit,
WorkAreaId=newItem.WorkAreaId,
QuestionType=newItem.QuestionType,
//审核人
ResponsibleMan=newItem.ResponsibleMan
};
//if (newItem.States != Const.State_1)
//{
// newCheckSpecial.States = Const.State_0;
//}
if (newItem.CheckSpecialDetailItems == null || newItem.CheckSpecialDetailItems.Count() == 0)
//if (newItem.CheckSpecialDetailItems == null || newItem.CheckSpecialDetailItems.Count() == 0)
//{
// if (newItem.States == Const.State_1)
// {
// newCheckSpecial.States = Const.State_2;
// }
//}
//如果审核状态不为空
if (!string.IsNullOrEmpty(newItem.AuditState))
{
if (newItem.States == Const.State_1)
//不同意的话
if (newItem.AuditState=="0")
{
newCheckSpecial.States = Const.State_2;
newCheckSpecial.States = "0";
}
else if (newItem.AuditState=="1")
{
newCheckSpecial.States = "2";
}
}
@@ -167,31 +199,32 @@ namespace BLL
SaveCheckSpecialDetail(item);
}
//// 单据完成后 系统自动按照单位 整改要求生成隐患整改单
if (newItem.States == Const.State_1)
{
var getC = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false);
if (getC == null)
{
newCheckSpecial.States = Const.State_2;
Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
}
else
{
var getNA = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false && (x.HandleStep== null || x.HandleStep==""));
if (getNA == null)
{
var detailLists = db.Check_CheckSpecialDetail.Where(x => x.CheckSpecialId == newCheckSpecial.CheckSpecialId && x.CompleteStatus == false);
if (detailLists.Count() > 0)
{
message = Check_CheckSpecialService.IssueRectification(detailLists.ToList(), newCheckSpecial);
}
}
else
{
message += "存在待整改,没有处理措施的记录!";
}
}
}
///五环不需要
//if (newItem.States == Const.State_1)
//{
// var getC = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false);
// if (getC == null)
// {
// newCheckSpecial.States = Const.State_2;
// Check_CheckSpecialService.UpdateCheckSpecial(newCheckSpecial);
// }
// else
// {
// var getNA = newItem.CheckSpecialDetailItems.FirstOrDefault(x => x.CompleteStatus == false && (x.HandleStep== null || x.HandleStep==""));
// if (getNA == null)
// {
// var detailLists = db.Check_CheckSpecialDetail.Where(x => x.CheckSpecialId == newCheckSpecial.CheckSpecialId && x.CompleteStatus == false);
// if (detailLists.Count() > 0)
// {
// message = Check_CheckSpecialService.IssueRectification(detailLists.ToList(), newCheckSpecial);
// }
// }
// else
// {
// message += "存在待整改,没有处理措施的记录!";
// }
// }
//}
}
return message;
}
@@ -238,6 +271,7 @@ namespace BLL
CheckItemDetailSetId = x.CheckItemSetId,
CheckItemDetailContent = x.CheckItemSetContent,
Rectification_Date = string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
CheckOpinions=x.CheckOpinions,
};
return getInfo.ToList();
}
@@ -290,6 +324,7 @@ namespace BLL
CheckItemDetailSetId=x.CheckItemSetId,
CheckItemDetailContent=x.CheckItemSetContent,
Rectification_Date= string.Format("{0:yyyy-MM-dd}", x.Rectification_Date),
CheckOpinions=x.CheckOpinions
};
return getInfo.First();
}
@@ -316,7 +351,7 @@ namespace BLL
UnitId = newDetail.UnitId,
HandleStep = newDetail.HandleStep,
HiddenHazardType = newDetail.HiddenHazardType,
CompleteStatus = newDetail.CompleteStatus ?? false,
CompleteStatus = newDetail.CompleteStatus,
RectifyNoticeId = newDetail.RectifyNoticeId,
LimitedDate = Funs.GetNewDateTime(newDetail.LimitedDate),
CompletedDate = Funs.GetNewDateTime(newDetail.CompletedDate),
@@ -325,10 +360,11 @@ namespace BLL
CheckArea = newDetail.WorkAreaId,
CheckContent = newDetail.CheckContent,
//整改日期、检查内容、检查内容id
//整改日期、检查内容、检查内容id、处理意见
CheckItemSetId= newDetail.CheckItemDetailSetId,
CheckItemSetContent= newDetail.CheckItemDetailContent,
Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date)
Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date),
CheckOpinions=newDetail.CheckOpinions,
};
if (newCheckSpecialDetail.CompleteStatus == false && newCheckSpecialDetail.HandleStep.Contains("1") && string.IsNullOrEmpty(newCheckSpecialDetail.HiddenHazardType))
{
@@ -371,10 +407,11 @@ namespace BLL
updateDetail.CheckArea = newCheckSpecialDetail.CheckArea;
updateDetail.CheckContent = newCheckSpecialDetail.CheckContent;
//整改日期、检查内容、检查内容id
//整改日期、检查内容、检查内容id、处理意见
updateDetail.CheckItemSetId = newDetail.CheckItemDetailSetId;
updateDetail.CheckItemSetContent = newDetail.CheckItemDetailContent;
updateDetail.Rectification_Date = Funs.GetNewDateTime(newDetail.Rectification_Date);
updateDetail.CheckOpinions = newDetail.CheckOpinions;
db.SubmitChanges();
}
////保存附件