河北专项检查和移动端
This commit is contained in:
@@ -247,116 +247,116 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
|
||||
inspection.ProjectId = this.ProjectId;
|
||||
inspection.InspectType = "1";
|
||||
inspection.States = "1";
|
||||
inspection.InspectMan = this.CurrUser.UserId;
|
||||
|
||||
inspection.CreateMan = this.CurrUser.UserId;
|
||||
inspection.CreateTime = DateTime.Now;
|
||||
Inspect_InspectionService.AddInspection(inspection);
|
||||
Inspect_InspectionService.SaveInspection(inspection);
|
||||
}
|
||||
var val = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
|
||||
//明细数据赋值
|
||||
JArray data = Grid1.GetMergedData();
|
||||
//判断是否有明细数据
|
||||
if (data.Count > 0)
|
||||
{
|
||||
foreach (var item in data)
|
||||
{
|
||||
JObject values = item.Value<JObject>("values");
|
||||
string id = item.Value<string>("id");
|
||||
var InspectItems = Inspect_InspectionService.GetInspectItemsById(id);
|
||||
if (InspectItems != null)
|
||||
{
|
||||
var evaluateResults = values.Value<string>("EvaluateResults");
|
||||
if (!string.IsNullOrEmpty(evaluateResults))
|
||||
{
|
||||
InspectItems.EvaluateResults = evaluateResults.Trim();
|
||||
if (evaluateResults == "合格")
|
||||
{
|
||||
InspectItems.States = "5"; //闭环
|
||||
}
|
||||
else if (evaluateResults == "不合格")
|
||||
{
|
||||
InspectItems.States = "2"; //已评价
|
||||
}
|
||||
//if (data.Count > 0)
|
||||
//{
|
||||
// foreach (var item in data)
|
||||
// {
|
||||
// JObject values = item.Value<JObject>("values");
|
||||
// string id = item.Value<string>("id");
|
||||
// var InspectItems = Inspect_InspectionService.GetInspectItemsById(id);
|
||||
// if (InspectItems != null)
|
||||
// {
|
||||
// var evaluateResults = values.Value<string>("EvaluateResults");
|
||||
// if (!string.IsNullOrEmpty(evaluateResults))
|
||||
// {
|
||||
// InspectItems.EvaluateResults = evaluateResults.Trim();
|
||||
// if (evaluateResults == "合格")
|
||||
// {
|
||||
// InspectItems.States = "5"; //闭环
|
||||
// }
|
||||
// else if (evaluateResults == "不合格")
|
||||
// {
|
||||
// InspectItems.States = "2"; //已评价
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
if (!string.IsNullOrEmpty(values.Value<string>("TimeLimited")))
|
||||
{
|
||||
InspectItems.TimeLimited = values.Value<DateTime>("TimeLimited");
|
||||
}
|
||||
else
|
||||
{
|
||||
InspectItems.TimeLimited = null;
|
||||
}
|
||||
// if (!string.IsNullOrEmpty(values.Value<string>("TimeLimited")))
|
||||
// {
|
||||
// InspectItems.TimeLimited = values.Value<DateTime>("TimeLimited");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// InspectItems.TimeLimited = null;
|
||||
// }
|
||||
|
||||
if (!string.IsNullOrEmpty(values.Value<string>("RectificationDescription")))
|
||||
{
|
||||
//有整改描述 是不合格的复查提交
|
||||
InspectItems.RectificationDescription =
|
||||
values.Value<string>("RectificationDescription").Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
InspectItems.RectificationDescription = "";
|
||||
}
|
||||
// //if (!string.IsNullOrEmpty(values.Value<string>("RectificationDescription")))
|
||||
// //{
|
||||
// // //有整改描述 是不合格的复查提交
|
||||
// // InspectItems.RectificationDescription =
|
||||
// // values.Value<string>("RectificationDescription").Trim();
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// // InspectItems.RectificationDescription = "";
|
||||
// //}
|
||||
|
||||
|
||||
// if (!string.IsNullOrEmpty(values.Value<string>("RectificationResults")))
|
||||
// {
|
||||
// InspectItems.RectificationResults = values.Value<string>("RectificationResults");
|
||||
// }
|
||||
// // if (!string.IsNullOrEmpty(values.Value<string>("RectificationResults")))
|
||||
// // {
|
||||
// // InspectItems.RectificationResults = values.Value<string>("RectificationResults");
|
||||
// // }
|
||||
|
||||
//编辑
|
||||
Inspect_InspectionService.UpdateInspectionItem(InspectItems);
|
||||
}
|
||||
// //编辑
|
||||
// Inspect_InspectionService.UpdateInspectionItem(InspectItems);
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
// 修改主表状态
|
||||
var InspectItemsList = Inspect_InspectionService.GetInspectItemsByInspectionId(this.InspectionId);
|
||||
// // 修改主表状态
|
||||
// var InspectItemsList = Inspect_InspectionService.GetInspectItemsByInspectionId(this.InspectionId);
|
||||
|
||||
HashSet<string> list = new HashSet<string>();
|
||||
foreach (var item in InspectItemsList)
|
||||
{
|
||||
list.Add(item.EvaluateResults);
|
||||
}
|
||||
// HashSet<string> list = new HashSet<string>();
|
||||
// foreach (var item in InspectItemsList)
|
||||
// {
|
||||
// list.Add(item.EvaluateResults);
|
||||
// }
|
||||
|
||||
if (val.States != "1")
|
||||
{
|
||||
var states = "3";
|
||||
if (list.Count() == 1)
|
||||
{
|
||||
if (list.Contains("合格"))
|
||||
{
|
||||
states = "5";
|
||||
}
|
||||
else if (list.Contains("不合格"))
|
||||
{
|
||||
states = "3";
|
||||
}
|
||||
else
|
||||
{
|
||||
states = "2";
|
||||
}
|
||||
}
|
||||
Inspect_InspectionService.UpdateInspectionStates(this.InspectionId,states);
|
||||
}
|
||||
// if (val.States != "1")
|
||||
// {
|
||||
// var states = "3";
|
||||
// if (list.Count() == 1)
|
||||
// {
|
||||
// if (list.Contains("合格"))
|
||||
// {
|
||||
// states = "5";
|
||||
// }
|
||||
// else if (list.Contains("不合格"))
|
||||
// {
|
||||
// states = "3";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// states = "2";
|
||||
// }
|
||||
// }
|
||||
// Inspect_InspectionService.UpdateInspectionStates(this.InspectionId,states);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// 修改主表状态
|
||||
if (!string.IsNullOrEmpty(this.InspectionId))
|
||||
{
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // 修改主表状态
|
||||
// if (!string.IsNullOrEmpty(this.InspectionId))
|
||||
// {
|
||||
|
||||
//编辑
|
||||
inspection.InspectionId = this.InspectionId;
|
||||
inspection.States = val.States;
|
||||
Inspect_InspectionService.UpdateInspection(inspection);
|
||||
}
|
||||
}
|
||||
// //编辑
|
||||
// inspection.InspectionId = this.InspectionId;
|
||||
// inspection.States = val.States;
|
||||
// Inspect_InspectionService.UpdateInspection(inspection);
|
||||
// }
|
||||
//}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
}
|
||||
@@ -402,11 +402,11 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
|
||||
{
|
||||
//获取当前数据的明细
|
||||
var register = Inspect_InspectionService.GetInspectItemsById(this.Grid1.SelectedRowID);
|
||||
if (register.EvaluateResults == "合格")
|
||||
{
|
||||
Alert.ShowInTop("当前项已合格,无需整改!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (register.EvaluateResults == "合格")
|
||||
//{
|
||||
// Alert.ShowInTop("当前项已合格,无需整改!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'0', "编辑 - ")));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user