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
@@ -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);
}
}
}
}