20211202 与集团安全信息报表及检查对接接口实现

This commit is contained in:
2021-12-02 10:44:15 +08:00
parent 8932645f54
commit 39cd93e266
43 changed files with 3072 additions and 2026 deletions
@@ -63,8 +63,10 @@
<f:Button ID="btnFind" Text="安全监督检查管理办法" Icon="Find" runat="server" OnClick="btnFind_Click">
</f:Button>
<f:HiddenField runat="server" ID="hdCheckInfoId"></f:HiddenField>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Label runat="server" Text="数据来源于集团下发到各企业查看并准备检查资料。" CssClass="lab"></f:Label>
<f:Button ID="btnGet" Text="获取" ToolTip="从集团获取安全监督检查信息" Icon="FolderPage" runat="server" OnClick="btnGet_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -334,5 +334,23 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
this.BindGrid1();
this.BindGrid2();
}
/// <summary>
/// 从集团获取
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnGet_Click(object sender, EventArgs e)
{
var returnValue= CNCECHSSEWebService.getCheck_CheckInfo_Table8Item();
if (returnValue.code == 1)
{
ShowNotify(returnValue.message, MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop(returnValue.message, MessageBoxIcon.Success);
}
}
}
}
@@ -138,6 +138,15 @@ namespace FineUIPro.Web.ZHGL.ServerCheck {
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnGet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGet;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -4,120 +4,121 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>监督检查整改</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.f-grid-row .f-grid-cell-inner {
white-space: normal;
word-break: break-all;
}
.f-grid-row.yellow
{
}
.f-grid-row.yellow {
background-color: YellowGreen;
background-image: none;
}
.f-grid-row.red
{
.f-grid-row.red {
background-color: Yellow;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="安全监督检查整改" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CheckRectifyId" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="CheckRectifyId" AllowSorting="true" SortField="CheckDate"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:GroupField HeaderText="检查对象" TextAlign="Center" HeaderTextAlign="Center">
<Columns>
<f:TemplateField Width="240px" HeaderText="检查单位" ColumnID="UnitName" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUnit" runat="server" Text='<%# Bind("UnitName") %>' ToolTip='<%# Bind("UnitName") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField Width="250px" HeaderText="项目" ColumnID="ProjectId" HeaderTextAlign="Center"
TextAlign="Left" ExpandUnusedSpace="true">
<ItemTemplate>
<asp:Label ID="lblProjectId" runat="server" Text='<%# Bind("ProjectId") %>' ToolTip='<%# Bind("ProjectId") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:GroupField>
<f:RenderField Width="100px" ColumnID="CheckDate" DataField="CheckDate" SortField="CheckDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="受检时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="IssueMan" DataField="IssueMan" SortField="IssueMan"
FieldType="String" HeaderText="签发人" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="IssueDate" DataField="IssueDate" SortField="IssueDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="签发时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="75px" ColumnID="HandleState" DataField="HandleState" FieldType="String"
HeaderText="状态" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="70px" ColumnID="TotalCount" DataField="TotalCount" FieldType="String"
HeaderText="总项" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="75px" ColumnID="CompleteCount" DataField="CompleteCount" FieldType="String"
HeaderText="完成项" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑安全监督检查整改" EnableIFrame="true" Height="600px" Width="1300px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TabEdit">
</f:MenuButton>
</f:Menu>
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="安全监督检查整改" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CheckRectifyId" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="CheckRectifyId" AllowSorting="true" SortField="CheckDate"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnGet" Text="获取" ToolTip="从集团获取安全监督检查整改" Icon="FolderPage" runat="server" OnClick="btnGet_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:GroupField HeaderText="检查对象" TextAlign="Center" HeaderTextAlign="Center">
<Columns>
<f:TemplateField Width="240px" HeaderText="检查单位" ColumnID="UnitName" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lblUnit" runat="server" Text='<%# Bind("UnitName") %>' ToolTip='<%# Bind("UnitName") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField Width="250px" HeaderText="项目" ColumnID="ProjectId" HeaderTextAlign="Center"
TextAlign="Left" ExpandUnusedSpace="true">
<ItemTemplate>
<asp:Label ID="lblProjectId" runat="server" Text='<%# Bind("ProjectId") %>' ToolTip='<%# Bind("ProjectId") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
</f:GroupField>
<f:RenderField Width="100px" ColumnID="CheckDate" DataField="CheckDate" SortField="CheckDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="受检时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="IssueMan" DataField="IssueMan" SortField="IssueMan"
FieldType="String" HeaderText="签发人" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="IssueDate" DataField="IssueDate" SortField="IssueDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="签发时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="75px" ColumnID="HandleState" DataField="HandleState" FieldType="String"
HeaderText="状态" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="70px" ColumnID="TotalCount" DataField="TotalCount" FieldType="String"
HeaderText="总项" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="75px" ColumnID="CompleteCount" DataField="CompleteCount" FieldType="String"
HeaderText="完成项" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑安全监督检查整改" EnableIFrame="true" Height="600px" Width="1300px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TabEdit">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
@@ -359,6 +359,25 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
}
}
#endregion
#endregion
/// <summary>
/// 从集团获取
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnGet_Click(object sender, EventArgs e)
{
var returnValue = CNCECHSSEWebService.getCheck_CheckRectify();
if (returnValue.code == 1)
{
ShowNotify(returnValue.message, MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop(returnValue.message, MessageBoxIcon.Success);
}
}
}
}
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.ZHGL.ServerCheck {
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// btnGet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGet;
/// <summary>
/// btnOut 控件。
/// </summary>
@@ -75,11 +75,11 @@
</ItemTemplate>
</f:TemplateField>
<f:WindowField TextAlign="Center" Width="70px" WindowID="WindowAtt" HeaderText="整改前" Text="查看"
ToolTip="相关照片附件" DataIFrameUrlFields="Table5ItemId" DataIFrameUrlFormatString="../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&type=-1"
ToolTip="相关照片附件" DataIFrameUrlFields="Table5ItemId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&type=-1"
Title="相关照片" ColumnID="WindowAtt">
</f:WindowField>
<f:WindowField TextAlign="Center" Width="70px" WindowID="WindowAtt" HeaderText="整改后" Text="查看"
ToolTip="相关照片附件" DataIFrameUrlFields="CheckRectifyItemId" DataIFrameUrlFormatString="../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&menuId=4A87774E-FEA5-479A-97A3-9BBA09E4862E"
ToolTip="相关照片附件" DataIFrameUrlFields="CheckRectifyItemId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&menuId=4A87774E-FEA5-479A-97A3-9BBA09E4862E"
Title="相关照片" ColumnID="WindowAtt1">
</f:WindowField>
<f:RenderField Width="75px" ColumnID="ConfirmMan" DataField="ConfirmMan" FieldType="String"
@@ -114,10 +114,19 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
newCheckRectify.HandleState = BLL.Const.State_2; //待上报
BLL.CheckRectifyService.UpdateCheckRectify(newCheckRectify);
}
if (type == BLL.Const.BtnSaveUp)
{
this.SynchData();
string code = CNCECHSSEWebService.UpCheck_CheckRectify(newCheckRectify.CheckRectifyId, this.CurrUser);
if (code == "1")
{
ShowNotify("同步成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
}
}
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.CheckRectifyMenuId, BLL.Const.BtnModify);
@@ -174,85 +183,5 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
#region
/// <summary>
/// 同步方法
/// </summary>
private void SynchData()
{
//string unitId = string.Empty;
//var unit = BLL.CommonService.GetIsThisUnit();
//if (unit != null)
//{
// unitId = unit.UnitId;
//}
///////创建客户端服务
//var poxy = Web.ServiceProxy.CreateServiceClient();
//poxy.DataInsertCheck_CheckRectifyTableCompleted += new EventHandler<HSSEService.DataInsertCheck_CheckRectifyTableCompletedEventArgs>(poxy_DataInsertCheck_CheckRectifyTableCompleted);
//var rectify = from x in Funs.DB.View_CheckRectifyListFromSUB
// where x.RealEndDate.HasValue && x.CheckRectifyId == this.CheckRectifyId
// select new HSSEService.Check_CheckRectify
// {
// CheckRectifyId = x.CheckRectifyId,
// CheckRectifyCode = x.CheckRectifyCode,
// ProjectId = x.ProjectId,
// UnitId = x.UnitId,
// CheckDate = x.CheckDate,
// IssueMan = x.IssueMan,
// IssueDate = x.IssueDate,
// HandleState = x.HandleState,
// CheckRectifyItemId = x.CheckRectifyItemId,
// ConfirmMan = x.ConfirmMan,
// ConfirmDate = x.ConfirmDate,
// OrderEndDate = x.OrderEndDate,
// OrderEndPerson = x.OrderEndPerson,
// RealEndDate = x.RealEndDate,
// Verification = x.Verification,
// AttachFileId = x.AttachFileId2,
// ToKeyId = x.ToKeyId2,
// AttachSource = x.AttachSource2,
// AttachUrl = x.AttachUrl2,
// ////附件转为字节传送
// FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2),
// };
//poxy.DataInsertCheck_CheckRectifyTableAsync(rectify.ToList());
}
/// <summary>
/// 安全监督检查整改
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void poxy_DataInsertCheck_CheckRectifyTableCompleted(object sender, HSSEService.DataInsertCheck_CheckRectifyTableCompletedEventArgs e)
//{
// if (e.Error == null)
// {
// var idList = e.Result;
// foreach (var item in idList)
// {
// var newCheckRectify = BLL.CheckRectifyService.GetCheckRectifyByCheckRectifyId(item);
// if (newCheckRectify != null)
// {
// var itme = Funs.DB.Check_CheckRectifyItem.FirstOrDefault(x => x.CheckRectifyId == item && !x.RealEndDate.HasValue);
// if (itme == null)
// {
// newCheckRectify.HandleState = BLL.Const.State_3; //已完成
// BLL.CheckRectifyService.UpdateCheckRectify(newCheckRectify);
// }
// }
// }
// BLL.LogService.AddSys_Log(this.CurrUser, "【集团检查整改】上传到服务器" + idList.Count.ToString() + "条数据;", string.Empty, BLL.Const.CheckRectifyMenuId, BLL.Const.BtnUploadResources);
// }
// else
// {
// BLL.LogService.AddSys_Log(this.CurrUser, "【集团检查整改】上传到服务器失败;", string.Empty, BLL.Const.CheckRectifyMenuId, BLL.Const.BtnUploadResources);
// }
//}
#endregion
}
}
@@ -15,7 +15,15 @@
<Items>
<f:Panel runat="server" ID="panelLeftRegion" Width="250px" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Layout="HBox" Title="企业安全文件上报" TitleToolTip="企业安全文件上报"
ShowBorder="true" ShowHeader="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
ShowBorder="true" ShowHeader="false" BodyPadding="5px" IconFont="ArrowCircleLeft">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnGet" Text="获取" ToolTip="从集团获取企业安全文件" Icon="FolderPage" runat="server" OnClick="btnGet_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Tree ID="trSubUnitReport" EnableCollapse="true" ShowHeader="true"
Title="企业安全文件上报" OnNodeCommand="trSubUnitReport_NodeCommand" AutoLeafIdentification="true"
@@ -240,7 +240,17 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
if (!string.IsNullOrEmpty(this.trSubUnitReport.SelectedNodeID))
{
SaveData(BLL.Const.UpState_2);
this.UpSubUnitReport(SubUnitReportId);//上报
string code = CNCECHSSEWebService.UpSupervise_SubUnitReportItem(this.SubUnitReportId, this.CurrUser);
if (code == "1")
{
ShowNotify("同步成功!", MessageBoxIcon.Success);
this.InitTreeMenu();
this.EmptyText();
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
}
this.InitTreeMenu();
this.EmptyText();
}
@@ -275,77 +285,7 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
}
}
#endregion
#region
/// <summary>
/// 上报方法
/// </summary>
/// <param name="SubUnitReportId"></param>
/// <param name="p"></param>
private void UpSubUnitReport(string SubUnitReportId)
{
///创建客户端服务
//var poxy = Web.ServiceProxy.CreateServiceClient();
//poxy.DataInsertSupervise_SubUnitReportItemItemTableCompleted += new EventHandler<HSSEService.DataInsertSupervise_SubUnitReportItemItemTableCompletedEventArgs>(poxy_DataInsertSupervise_SubUnitReportTableCompleted);
//var subUnitReport = from x in Funs.DB.View_Supervise_SubUnitReportItem
// // join y in Funs.DB.AttachFile on x.SubUnitReportItemId equals y.ToKeyId
// where x.SubUnitReportId == SubUnitReportId && (x.UpState == BLL.Const.UpState_2 || x.UpState == BLL.Const.UpState_4 || x.UpState == null)
// select new HSSEService.Supervise_SubUnitReportItem
// {
// SubUnitReportItemId = x.SubUnitReportItemId,
// ReportTitle = x.ReportTitle,
// ReportContent = x.ReportContent,
// // AttachUrl = x.AttachUrl,
// ReportDate = x.ReportDate,
// State = x.State,
// ////附件转为字节传送
// //FileContext = FileStructService.GetFileStructByAttachUrl(x.AttachUrl),
// AttachFileId = x.AttachFileId,
// ToKeyId = x.ToKeyId,
// AttachSource = x.AttachSource,
// AttachUrl = x.AttachUrl,
// ////附件转为字节传送
// FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl),
// };
//poxy.DataInsertSupervise_SubUnitReportItemItemTableAsync(subUnitReport.ToList());
}
/// <summary>
/// 企业安全文件上报到集团公司
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void poxy_DataInsertSupervise_SubUnitReportTableCompleted(object sender, HSSEService.DataInsertSupervise_SubUnitReportItemItemTableCompletedEventArgs e)
//{
// if (e.Error == null)
// {
// var idList = e.Result;
// foreach (var item in idList)
// {
// var subUnitReportItem = BLL.SubUnitReportItemService.GetSubUnitReportItemById(item);
// if (subUnitReportItem != null)
// {
// subUnitReportItem.UpState = BLL.Const.UpState_3;
// subUnitReportItem.State = BLL.Const.UpState_3;
// BLL.SubUnitReportItemService.UpdateSubUnitReportItem(subUnitReportItem);
// }
// }
// this.InitTreeMenu();
// this.EmptyText();
// ShowNotify("【企业安全文件上报】上报到集团公司成功!", MessageBoxIcon.Success);
// BLL.LogService.AddSys_Log(this.CurrUser, "【企业安全文件上报】上报到集团公司" + idList.Count.ToString() + "条数据;", string.Empty, BLL.Const.SubUnitReportMenuId, BLL.Const.BtnUploadResources);
// }
// else
// {
// ShowNotify("【企业安全文件上报】上报到集团公司失败!", MessageBoxIcon.Warning);
// BLL.LogService.AddSys_Log(this.CurrUser, "【企业安全文件上报】上报到集团公司失败;", string.Empty, BLL.Const.SubUnitReportMenuId, BLL.Const.BtnUploadResources);
// }
//}
#endregion
#region
/// <summary>
/// 上传附件资源
@@ -407,5 +347,24 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
}
}
#endregion
/// <summary>
/// 从集团获取
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnGet_Click(object sender, EventArgs e)
{
var returnValue = CNCECHSSEWebService.getSupervise_SubUnitReport();
if (returnValue.code == 1)
{
ShowNotify(returnValue.message, MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop(returnValue.message, MessageBoxIcon.Success);
}
}
}
}
@@ -48,6 +48,24 @@ namespace FineUIPro.Web.ZHGL.ServerCheck {
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// btnGet 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGet;
/// <summary>
/// trSubUnitReport 控件。
/// </summary>
@@ -241,88 +241,88 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
Model.Supervise_UpCheckReport newUpCheckReport = new Model.Supervise_UpCheckReport
{
UnitId = BLL.Const.UnitId_CWCEC,//thisUnit.UnitId,
Values1 = this.txtValues1.Text.Trim(),
Values2 = this.txtValues2.Text.Trim(),
Values3 = this.txtValues3.Text.Trim(),
Values4 = this.txtValues4.Text.Trim(),
Values5 = this.txtValues5.Text.Trim(),
Values6 = this.txtValues6.Text.Trim(),
Values7 = this.txtValues7.Text.Trim(),
UpState = state,
CheckStartTime = Funs.GetNewDateTime(this.txtCheckStartTime.Text),
CheckEndTime = Funs.GetNewDateTime(this.txtCheckEndTime.Text),
CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text),
AuditDate = Funs.GetNewDateTime(this.txtAuditDate.Text)
};
if (!string.IsNullOrEmpty(this.UpCheckReportId))
{
newUpCheckReport.UpCheckReportId = this.UpCheckReportId;
BLL.UpCheckReportService.UpdateUpCheckReport(newUpCheckReport);
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, newUpCheckReport.UpCheckReportId, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnModify);
}
else
{
this.UpCheckReportId = newUpCheckReport.UpCheckReportId = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReport));
BLL.UpCheckReportService.AddUpCheckReport(newUpCheckReport);
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, newUpCheckReport.UpCheckReportId, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnAdd);
}
Values1 = this.txtValues1.Text.Trim(),
Values2 = this.txtValues2.Text.Trim(),
Values3 = this.txtValues3.Text.Trim(),
Values4 = this.txtValues4.Text.Trim(),
Values5 = this.txtValues5.Text.Trim(),
Values6 = this.txtValues6.Text.Trim(),
Values7 = this.txtValues7.Text.Trim(),
UpState = state,
CheckStartTime = Funs.GetNewDateTime(this.txtCheckStartTime.Text),
CheckEndTime = Funs.GetNewDateTime(this.txtCheckEndTime.Text),
CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text),
AuditDate = Funs.GetNewDateTime(this.txtAuditDate.Text)
};
if (!string.IsNullOrEmpty(this.UpCheckReportId))
{
newUpCheckReport.UpCheckReportId = this.UpCheckReportId;
BLL.UpCheckReportService.UpdateUpCheckReport(newUpCheckReport);
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, newUpCheckReport.UpCheckReportId, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnModify);
}
else
{
this.UpCheckReportId = newUpCheckReport.UpCheckReportId = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReport));
BLL.UpCheckReportService.AddUpCheckReport(newUpCheckReport);
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, newUpCheckReport.UpCheckReportId, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnAdd);
}
if (gvItem.GetModifiedData().Count > 0 && !string.IsNullOrEmpty(newUpCheckReport.UpCheckReportId))
if (gvItem.GetModifiedData().Count > 0 && !string.IsNullOrEmpty(newUpCheckReport.UpCheckReportId))
{
BLL.UpCheckReportService.DeleteUpCheckReportItemByUpCheckReportId(newUpCheckReport.UpCheckReportId);
JArray teamGroupData = gvItem.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
BLL.UpCheckReportService.DeleteUpCheckReportItemByUpCheckReportId(newUpCheckReport.UpCheckReportId);
JArray teamGroupData = gvItem.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
//string status = teamGroupRow.Value<string>("status");
JObject values = teamGroupRow.Value<JObject>("values");
Model.Supervise_UpCheckReportItem newItem = new Model.Supervise_UpCheckReportItem
{
//string status = teamGroupRow.Value<string>("status");
JObject values = teamGroupRow.Value<JObject>("values");
Model.Supervise_UpCheckReportItem newItem = new Model.Supervise_UpCheckReportItem
{
UpCheckReportItemId = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReportItem)),
UpCheckReportId = newUpCheckReport.UpCheckReportId,
SortIndex = values.Value<string>("SortIndex"),
Name = values.Value<string>("Name"),
Sex = values.Value<string>("Sex"),
UnitName = values.Value<string>("UnitName"),
PostName = values.Value<string>("PostName"),
WorkTitle = values.Value<string>("WorkTitle"),
CheckPostName = values.Value<string>("CheckPostName"),
CheckDate = Funs.GetNewDateTime(values.Value<string>("CheckDate"))
};
Funs.DB.Supervise_UpCheckReportItem.InsertOnSubmit(newItem);
Funs.DB.SubmitChanges();
}
UpCheckReportItemId = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReportItem)),
UpCheckReportId = newUpCheckReport.UpCheckReportId,
SortIndex = values.Value<string>("SortIndex"),
Name = values.Value<string>("Name"),
Sex = values.Value<string>("Sex"),
UnitName = values.Value<string>("UnitName"),
PostName = values.Value<string>("PostName"),
WorkTitle = values.Value<string>("WorkTitle"),
CheckPostName = values.Value<string>("CheckPostName"),
CheckDate = Funs.GetNewDateTime(values.Value<string>("CheckDate"))
};
Funs.DB.Supervise_UpCheckReportItem.InsertOnSubmit(newItem);
Funs.DB.SubmitChanges();
}
}
if (gvItem2.GetModifiedData().Count > 0 && !string.IsNullOrEmpty(newUpCheckReport.UpCheckReportId))
if (gvItem2.GetModifiedData().Count > 0 && !string.IsNullOrEmpty(newUpCheckReport.UpCheckReportId))
{
BLL.UpCheckReportService.DeleteUpCheckReportItem2ByUpCheckReportId(newUpCheckReport.UpCheckReportId);
JArray teamGroupData2 = gvItem2.GetMergedData();
foreach (JObject teamGroupRow2 in teamGroupData2)
{
BLL.UpCheckReportService.DeleteUpCheckReportItem2ByUpCheckReportId(newUpCheckReport.UpCheckReportId);
JArray teamGroupData2 = gvItem2.GetMergedData();
foreach (JObject teamGroupRow2 in teamGroupData2)
//string status = teamGroupRow.Value<string>("status");
JObject values = teamGroupRow2.Value<JObject>("values");
Model.Supervise_UpCheckReportItem2 newItem2 = new Model.Supervise_UpCheckReportItem2
{
//string status = teamGroupRow.Value<string>("status");
JObject values = teamGroupRow2.Value<JObject>("values");
Model.Supervise_UpCheckReportItem2 newItem2 = new Model.Supervise_UpCheckReportItem2
{
UpCheckReportItem2Id = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReportItem2)),
UpCheckReportId = newUpCheckReport.UpCheckReportId,
SortIndex = values.Value<string>("SortIndex"),
SubjectObject = values.Value<string>("SubjectObject"),
SubjectObjectInfo = values.Value<string>("SubjectObjectInfo"),
UnitMan = values.Value<string>("UnitMan"),
UnitManTel = values.Value<string>("UnitManTel"),
UnitHSSEMan = values.Value<string>("UnitHSSEMan"),
UnitHSSEManTel = values.Value<string>("UnitHSSEManTel"),
CheckDate = Funs.GetNewDateTime(values.Value<string>("CheckDate")),
UpCheckReportItem2Id = SQLHelper.GetNewID(typeof(Model.Supervise_UpCheckReportItem2)),
UpCheckReportId = newUpCheckReport.UpCheckReportId,
SortIndex = values.Value<string>("SortIndex"),
SubjectObject = values.Value<string>("SubjectObject"),
SubjectObjectInfo = values.Value<string>("SubjectObjectInfo"),
UnitMan = values.Value<string>("UnitMan"),
UnitManTel = values.Value<string>("UnitManTel"),
UnitHSSEMan = values.Value<string>("UnitHSSEMan"),
UnitHSSEManTel = values.Value<string>("UnitHSSEManTel"),
CheckDate = Funs.GetNewDateTime(values.Value<string>("CheckDate")),
RectifyCount = Funs.GetNewIntOrZero(values.Value<string>("RectifyCount")),
CompRectifyCount = Funs.GetNewIntOrZero(values.Value<string>("CompRectifyCount")),
TotalGetScore = Funs.GetNewDecimalOrZero(values.Value<string>("TotalGetScore")),
ResultLevel = values.Value<string>("ResultLevel")
};
Funs.DB.Supervise_UpCheckReportItem2.InsertOnSubmit(newItem2);
Funs.DB.SubmitChanges();
}
RectifyCount = Funs.GetNewIntOrZero(values.Value<string>("RectifyCount")),
CompRectifyCount = Funs.GetNewIntOrZero(values.Value<string>("CompRectifyCount")),
TotalGetScore = Funs.GetNewDecimalOrZero(values.Value<string>("TotalGetScore")),
ResultLevel = values.Value<string>("ResultLevel")
};
Funs.DB.Supervise_UpCheckReportItem2.InsertOnSubmit(newItem2);
Funs.DB.SubmitChanges();
}
}
//}
//else
//{
@@ -353,106 +353,19 @@ namespace FineUIPro.Web.ZHGL.ServerCheck
protected void btnSaveUp_Click(object sender, EventArgs e)
{
SaveData(BLL.Const.UpState_2);
var unit = BLL.Const.UnitId_CWCEC;//BLL.CommonService.GetIsThisUnit();
if (unit != null && !string.IsNullOrEmpty(unit))
string code = CNCECHSSEWebService.UpCheckReport(this.UpCheckReportId, this.CurrUser);
if (code == "1")
{
Update(this.UpCheckReportId);//上报
ShowNotify("同步成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
}
ShowNotify("保存并上报完成!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#region
private void Update(string upCheckReportId)
{
/////创建客户端服务
//var poxy = Web.ServiceProxy.CreateServiceClient();
//poxy.DataInsertSupervise_UpCheckReportTableCompleted += new EventHandler<HSSEService.DataInsertSupervise_UpCheckReportTableCompletedEventArgs>(poxy_DataInsertSupervise_UpCheckReportTableCompleted);
//var upCheckReport = from x in Funs.DB.Supervise_UpCheckReport
// where x.UpCheckReportId == upCheckReportId
// select new HSSEService.Supervise_UpCheckReport
// {
// UpCheckReportId = x.UpCheckReportId,
// UnitId = x.UnitId,
// CheckStartTime = x.CheckStartTime,
// CheckEndTime = x.CheckEndTime,
// Values1 = x.Values1,
// Values2 = x.Values2,
// Values3 = x.Values3,
// Values4 = x.Values4,
// Values5 = x.Values5,
// Values6 = x.Values6,
// Values7 = x.Values7,
// CompileDate = x.CompileDate,
// AuditDate = x.AuditDate,
// };
//var upCheckReportItem = from x in Funs.DB.Supervise_UpCheckReportItem
// where x.UpCheckReportId == upCheckReportId
// select new HSSEService.Supervise_UpCheckReportItem
// {
// UpCheckReportItemId = x.UpCheckReportItemId,
// UpCheckReportId = x.UpCheckReportId,
// SortIndex = x.SortIndex,
// Name = x.Name,
// Sex = x.Sex,
// UnitName = x.UnitName,
// PostName = x.PostName,
// WorkTitle = x.WorkTitle,
// CheckPostName = x.CheckPostName,
// CheckDate = x.CheckDate,
// };
//var upCheckReportItem2 = from x in Funs.DB.Supervise_UpCheckReportItem2
// where x.UpCheckReportId == upCheckReportId
// select new HSSEService.Supervise_UpCheckReportItem2
// {
// UpCheckReportItem2Id = x.UpCheckReportItem2Id,
// UpCheckReportId = x.UpCheckReportId,
// SortIndex = x.SortIndex,
// SubjectObject = x.SubjectObject,
// SubjectObjectInfo = x.SubjectObjectInfo,
// UnitMan = x.UnitMan,
// UnitManTel = x.UnitManTel,
// UnitHSSEMan = x.UnitHSSEMan,
// UnitHSSEManTel = x.UnitHSSEManTel,
// CheckDate = x.CheckDate,
// RectifyCount = x.RectifyCount,
// CompRectifyCount = x.CompRectifyCount,
// TotalGetScore = x.TotalGetScore,
// ResultLevel = x.ResultLevel,
// };
//poxy.DataInsertSupervise_UpCheckReportTableAsync(upCheckReport.ToList(), upCheckReportItem.ToList(), upCheckReportItem2.ToList());
}
#region
/// <summary>
/// 安全监督检查评价报告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void poxy_DataInsertSupervise_UpCheckReportTableCompleted(object sender, HSSEService.DataInsertSupervise_UpCheckReportTableCompletedEventArgs e)
//{
// if (e.Error == null)
// {
// var idList = e.Result;
// foreach (var item in idList)
// {
// var report = BLL.UpCheckReportService.GetUpCheckReportById(item);
// if (report != null)
// {
// report.UpState = BLL.Const.UpState_3;
// report.UpDateTime = System.DateTime.Now;
// BLL.UpCheckReportService.UpdateUpCheckReport(report);
// }
// }
// BLL.LogService.AddSys_Log(this.CurrUser, "【安全监督检查评价报告】上传到服务器" + idList.Count.ToString() + "条数据;", string.Empty, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnUploadResources);
// }
// else
// {
// BLL.LogService.AddSys_Log(this.CurrUser, "【安全监督检查评价报告】上传到服务器失败;", string.Empty, BLL.Const.UpCheckReportMenuId, BLL.Const.BtnUploadResources);
// }
//}
#endregion
#endregion
}
}