20240125本部检查调整

This commit is contained in:
2024-01-25 17:24:20 +08:00
parent 6b5fb3a865
commit 2449c9fa32
14 changed files with 381 additions and 176 deletions
@@ -1,6 +1,8 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@@ -42,57 +44,89 @@ namespace FineUIPro.Web.OfficeCheck.Check
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//受检项目
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
///安全经理
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpSignPerson, this.CurrUser.LoginProjectId, Const.UnitId_SEDIN, true);
///检察人员
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpCheckMan, this.CurrUser.LoginProjectId, null, true);
{
string type = Request.Params["type"];
if (type == "1")
{
this.btnSave.Hidden = true;
this.btnAdd.Hidden = true;
this.btnSubmit.Hidden = true;
this.Grid1.Columns[8].Hidden = true;
}
this.CheckNoticeId = Request.Params["CheckNoticeId"];
if (!string.IsNullOrEmpty(this.CheckNoticeId))
var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (getRectify != null)
{
Model.ProjectSupervision_Rectify RectifyNotices = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (RectifyNotices != null)
SetDrop(getRectify.ProjectId);
this.hdRectifyNoticesId.Text = getRectify.RectifyId;
if (!string.IsNullOrEmpty(getRectify.ProjectId))
{
this.hdRectifyNoticesId.Text = RectifyNotices.RectifyId;
if (!string.IsNullOrEmpty(RectifyNotices.ProjectId))
{
this.drpProjectId.SelectedValue = RectifyNotices.ProjectId;
}
if (!string.IsNullOrEmpty(RectifyNotices.CheckManIds))
{
this.drpCheckMan.SelectedValueArray = RectifyNotices.CheckManIds.Split(',');
}
this.txtCheckPerson.Text = RectifyNotices.CheckManNames;
this.txtRectifyNoticesCode.Text = RectifyNotices.RectifyCode;
this.txtCheckedDate.Text = RectifyNotices.CheckedDate.ToString();
if (!string.IsNullOrEmpty(RectifyNotices.HiddenHazardType))
{
this.drpHiddenHazardType.SelectedValue = RectifyNotices.HiddenHazardType;
}
if (!string.IsNullOrEmpty(RectifyNotices.SignPerson))
{
this.drpSignPerson.SelectedValue = RectifyNotices.SignPerson;
}
BindGrid();
this.drpProjectId.SelectedValue = getRectify.ProjectId;
}
else
if (!string.IsNullOrEmpty(getRectify.CheckManIds))
{
this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.drpCheckMan.SelectedValueArray = getRectify.CheckManIds.Split(',');
}
this.txtCheckPerson.Text = getRectify.CheckManNames;
this.txtRectifyNoticesCode.Text = getRectify.RectifyCode;
this.txtCheckedDate.Text = getRectify.CheckedDate.ToString();
if (!string.IsNullOrEmpty(getRectify.HiddenHazardType))
{
this.drpHiddenHazardType.SelectedValue = getRectify.HiddenHazardType;
}
if (!string.IsNullOrEmpty(getRectify.SignPerson))
{
this.drpSignPerson.SelectedValue = getRectify.SignPerson;
}
BindGrid();
if (getRectify.States == Const.State_1 || getRectify.States == Const.State_2)
{
this.btnSure.Hidden = false;
}
rectifyItemLists.Clear();
}
else
{
var getCheckNotice = CheckNoticeService.GetCheckNoticeById(this.CheckNoticeId);
if (getCheckNotice != null)
{
SetDrop(getCheckNotice.SubjectProjectId);
if (!string.IsNullOrEmpty(getCheckNotice.SubjectProjectId))
{
this.drpProjectId.SelectedValue = getCheckNotice.SubjectProjectId;
}
if (!string.IsNullOrEmpty(getCheckNotice.CheckTeamLeader))
{
this.drpCheckMan.SelectedValueArray = getCheckNotice.CheckTeamLeader.Split(',');
}
var getTeam = CheckTeamService.GetCheckTeamListByCheckNoticeId(this.CheckNoticeId);
foreach (var item in getTeam)
{
this.txtCheckPerson.Text += item.UserName + "、";
}
string perfix = DateTime.Now.Year.ToString()+ DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + "-";
this.txtRectifyNoticesCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode3", "dbo.ProjectSupervision_Rectify", "RectifyCode", perfix);
}
this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
rectifyItemLists.Clear();
}
}
private void SetDrop(string projectId)
{
//受检项目
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
this.drpProjectId.SelectedValue = projectId;
///安全经理
BLL.Person_PersonsService.InitFlowOperateControlUserDropDownList(this.drpSignPerson, projectId, Const.UnitId_SEDIN, true);
///检察人员
BLL.Person_PersonsService.InitUserUnitIdDepartIdDropDownList(this.drpCheckMan, Const.UnitId_SEDIN, string.Empty, true);
}
/// <summary>
/// 绑定明细
/// </summary>
@@ -442,6 +476,17 @@ namespace FineUIPro.Web.OfficeCheck.Check
}
this.drpCheckMan.SelectedValueArray = str.ToArray();
}
#endregion
#endregion
protected void btnSure_Click(object sender, EventArgs e)
{
var getRectify = ProjectSupervision_RectifyService.GetRectifyByCheckNoticeId(this.CheckNoticeId);
if (getRectify != null)
{
saveNoticesItemDetail();//增加明细
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
}
}