河北专项检查和移动端

This commit is contained in:
2025-04-06 23:26:22 +08:00
parent 64c7be5db4
commit 8aba5b01bc
204 changed files with 41904 additions and 3226 deletions
@@ -266,41 +266,41 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
}
else
{
InspectionItem=Inspect_InspectionService.GetInspectItemsById(id);
//InspectionItem=Inspect_InspectionService.GetInspectItemsById(id);
}
if (!string.IsNullOrEmpty(values.Value<string>("InspectionDescribe")))
{
InspectionItem.InspectionDescribe = values.Value<string>("InspectionDescribe");
//InspectionItem.InspectionDescribe = values.Value<string>("InspectionDescribe");
}
var file = AttachFileService.GetAttachFile(id + "_1", BLL.Const.ProjectSafetyInspectionMenuId);
if (file != null)
{
InspectionItem.PhotoUrl = file.AttachUrl.Trim();
//InspectionItem.PhotoUrl = file.AttachUrl.Trim();
}
var file1 = AttachFileService.GetAttachFile(id + "_2", BLL.Const.ProjectSafetyInspectionMenuId);
if (file1 != null)
{
InspectionItem.VideoUrl = file1.AttachUrl.Trim();
//InspectionItem.VideoUrl = file1.AttachUrl.Trim();
}
if (string.IsNullOrEmpty(InspectionItem.PhotoUrl) &&
string.IsNullOrEmpty(InspectionItem.VideoUrl) &&
string.IsNullOrEmpty(InspectionItem.InspectionDescribe))
{
ShowNotify("注意其中有检查项、图片、视频全是空!", MessageBoxIcon.Warning);
return;
}
//if (string.IsNullOrEmpty(InspectionItem.PhotoUrl) &&
// string.IsNullOrEmpty(InspectionItem.VideoUrl) &&
// string.IsNullOrEmpty(InspectionItem.InspectionDescribe))
//{
// ShowNotify("注意其中有检查项、图片、视频全是空!", MessageBoxIcon.Warning);
// return;
//}
if (!ids.Contains(id))
{
Inspect_InspectionService.AddInspectionItem(InspectionItem);
//Inspect_InspectionService.SaveInspection(InspectionItem);
}
else
{
Inspect_InspectionService.UpdateInspectionItem(InspectionItem);
//Inspect_InspectionService.UpdateInspectionItem(InspectionItem);
}
ids.Remove(id);
@@ -443,11 +443,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("ProjectSafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'0', "编辑 - ")));
}
@@ -86,51 +86,51 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
where x.InspectionItemId == this.InspectionItemId
select new
{
x.InspectionItemId,
x.InspectionDescribe,
x.PhotoUrl,
x.VideoUrl,
inspectionJoin.PersonResponsible,
x.EvaluateResults,
inspectionJoin.InspectMan,
x.TimeLimited,
x.RectificationDescription
//x.InspectionItemId,
//x.InspectionDescribe,
//x.PhotoUrl,
//x.VideoUrl,
//inspectionJoin.PersonResponsible,
//x.EvaluateResults,
//inspectionJoin.InspectMan,
//x.TimeLimited,
//x.RectificationDescription
}).FirstOrDefault();
if (registration != null)
{
this.txtInspectionDescribe.Text = registration.InspectionDescribe;
// this.UploadPhoto.Text = registration.PhotoUrl;
// this.UploadVideo.Text = registration.VideoUrl;
if (registration.InspectMan != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.InspectMan
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtCheckManName.Text = user.UserName;
}
}
this.txtEvaluateResults.Text = registration.EvaluateResults;
if (registration.PersonResponsible != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.PersonResponsible
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtResponsibleManName.Text = user.UserName;
}
}
if (registration.TimeLimited != null)
{
this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
}
this.txtRectificationDescription.Text = registration.RectificationDescription;
this.PersonResponsible = registration.PersonResponsible;
}
//if (registration != null)
//{
// this.txtInspectionDescribe.Text = registration.InspectionDescribe;
// // this.UploadPhoto.Text = registration.PhotoUrl;
// // this.UploadVideo.Text = registration.VideoUrl;
// if (registration.InspectMan != null)
// {
// //查询用户名
// var user = (from x in Funs.DB.Sys_User
// where x.UserId == registration.InspectMan
// select new { x.UserName }).FirstOrDefault();
// if (user != null)
// {
// this.txtCheckManName.Text = user.UserName;
// }
// }
// this.txtEvaluateResults.Text = registration.EvaluateResults;
// if (registration.PersonResponsible != null)
// {
// //查询用户名
// var user = (from x in Funs.DB.Sys_User
// where x.UserId == registration.PersonResponsible
// select new { x.UserName }).FirstOrDefault();
// if (user != null)
// {
// this.txtResponsibleManName.Text = user.UserName;
// }
// }
// if (registration.TimeLimited != null)
// {
// this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
// }
// this.txtRectificationDescription.Text = registration.RectificationDescription;
// this.PersonResponsible = registration.PersonResponsible;
//}
}
}
@@ -166,19 +166,19 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
var register = Inspect_InspectionService.GetInspectItemsById(this.InspectionItemId);
if (register != null)
{
var file = AttachFileService.GetAttachFile(register.InspectionItemId + "_3", BLL.Const.ProjectSafetyInspectionMenuId);
if (file != null && file.AttachUrl != "")
{
register.States = "3"; //已整改待复查
register.RectificationPhotoUrl = file.AttachUrl.Trim();
}
else
{
ShowNotify("请先上传整改后照片!", MessageBoxIcon.Warning);
return;
}
//var file = AttachFileService.GetAttachFile(register.InspectionItemId + "_3", BLL.Const.ProjectSafetyInspectionMenuId);
//if (file != null && file.AttachUrl != "")
//{
// register.States = "3"; //已整改待复查
// //register.RectificationPhotoUrl = file.AttachUrl.Trim();
//}
//else
//{
// ShowNotify("请先上传整改后照片!", MessageBoxIcon.Warning);
// return;
//}
Inspect_InspectionService.UpdateInspectionItem(register);
//Inspect_InspectionService.UpdateInspectionItem(register);
if (isClosed)
{
if (string.IsNullOrEmpty(Request.Params["Main"]))
@@ -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', "编辑 - ")));
}
@@ -79,49 +79,49 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
where x.InspectionItemId == this.InspectionItemId
select new
{
x.InspectionItemId,
x.InspectionDescribe,
x.PhotoUrl,
x.VideoUrl,
inspectionJoin.PersonResponsible,
x.EvaluateResults,
inspectionJoin.InspectMan,
x.TimeLimited,
x.RectificationDescription
//x.InspectionItemId,
//x.InspectionDescribe,
//x.PhotoUrl,
//x.VideoUrl,
//inspectionJoin.PersonResponsible,
//x.EvaluateResults,
//inspectionJoin.InspectMan,
//x.TimeLimited,
//x.RectificationDescription
}).FirstOrDefault();
if (registration != null)
{
this.txtInspectionDescribe.Text = registration.InspectionDescribe;
if (registration.InspectMan != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.InspectMan
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtCheckManName.Text = user.UserName;
}
}
this.txtEvaluateResults.Text = registration.EvaluateResults;
if (registration.PersonResponsible != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.PersonResponsible
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtResponsibleManName.Text = user.UserName;
}
}
if (registration.TimeLimited != null)
{
this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
}
this.txtRectificationDescription.Text = registration.RectificationDescription;
this.InspectMan = registration.InspectMan;
}
//if (registration != null)
//{
// this.txtInspectionDescribe.Text = registration.InspectionDescribe;
// if (registration.InspectMan != null)
// {
// //查询用户名
// var user = (from x in Funs.DB.Sys_User
// where x.UserId == registration.InspectMan
// select new { x.UserName }).FirstOrDefault();
// if (user != null)
// {
// this.txtCheckManName.Text = user.UserName;
// }
// }
// this.txtEvaluateResults.Text = registration.EvaluateResults;
// if (registration.PersonResponsible != null)
// {
// //查询用户名
// var user = (from x in Funs.DB.Sys_User
// where x.UserId == registration.PersonResponsible
// select new { x.UserName }).FirstOrDefault();
// if (user != null)
// {
// this.txtResponsibleManName.Text = user.UserName;
// }
// }
// if (registration.TimeLimited != null)
// {
// this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
// }
// this.txtRectificationDescription.Text = registration.RectificationDescription;
// this.InspectMan = registration.InspectMan;
//}
}
}
@@ -159,17 +159,17 @@ namespace FineUIPro.Web.OfficeCheck.Inspect
{
//获取ddlRectificationResults的值
var rectificationResults = this.ddlRectificationResults.SelectedValue;
if (rectificationResults == "1") //同意
{
register.EvaluateResults = "合格";
register.States = "5";
}
else if (rectificationResults == "2") //不同意
{
register.States = "2";
}
register.RectificationResults = rectificationResults;
Inspect_InspectionService.UpdateInspectionItem(register);
//if (rectificationResults == "1") //同意
//{
// register.EvaluateResults = "合格";
// register.States = "5";
//}
//else if (rectificationResults == "2") //不同意
//{
// register.States = "2";
//}
//register.RectificationResults = rectificationResults;
//Inspect_InspectionService.UpdateInspectionItem(register);
if (isClosed)
{
if (string.IsNullOrEmpty(Request.Params["Main"]))