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
@@ -59,26 +59,9 @@ namespace FineUIPro.Web.ZHGL.Information
if (!String.IsNullOrEmpty(MillionsMonthlyReportId))
{
items = BLL.MillionsMonthlyReportItemService.GetItemsNoSum(MillionsMonthlyReportId);
//int i = items.Count * 10;
//int count = items.Count;
//if (items.Count < 10)
//{
// for (int j = 0; j < (10 - count); j++)
// {
// i += 10;
// Model.Information_MillionsMonthlyReportItem newItem = new Information_MillionsMonthlyReportItem
// {
// MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
// Affiliation = string.Empty,
// Name = string.Empty,
// SortIndex = i
// };
// items.Add(newItem);
// }
//}
this.Grid1.DataSource = items;
this.Grid1.DataBind();
Model.Information_MillionsMonthlyReport report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(MillionsMonthlyReportId);
var report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(MillionsMonthlyReportId);
if (report != null)
{
this.btnSave.Hidden = true;
@@ -216,7 +199,7 @@ namespace FineUIPro.Web.ZHGL.Information
if (String.IsNullOrEmpty(MillionsMonthlyReportId))
{
Model.Information_MillionsMonthlyReport old = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
Information_MillionsMonthlyReport old = MillionsMonthlyReportService.GetMillionsMonthlyReportByUnitIdDate(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (old == null)
{
report.MillionsMonthlyReportId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReport));
@@ -248,6 +231,7 @@ namespace FineUIPro.Web.ZHGL.Information
}
MillionsMonthlyReportId = report.MillionsMonthlyReportId;
BLL.MillionsMonthlyReportItemService.DeleteMillionsMonthlyReportItemByMillionsMonthlyReportId(report.MillionsMonthlyReportId);
List<Model.Information_MillionsMonthlyReportItem> mReportItemList = new List<Information_MillionsMonthlyReportItem>();
GetItems(report.MillionsMonthlyReportId);
foreach (var item in items)
{
@@ -255,25 +239,36 @@ namespace FineUIPro.Web.ZHGL.Information
{
item.Affiliation = System.Web.HttpUtility.HtmlDecode(item.Affiliation);
item.Name = System.Web.HttpUtility.HtmlDecode(item.Name);
BLL.MillionsMonthlyReportItemService.AddMillionsMonthlyReportItem(item);
MillionsMonthlyReportItemService.AddMillionsMonthlyReportItem(item);
mReportItemList.Add(item);
}
}
if (type == "updata") //保存并上报
if (type == "updata") //数据同步
{
Update(report.MillionsMonthlyReportId);
if (report.UpState == BLL.Const.UpState_2)
{
string code = CNCECHSSEWebService.UpMillionsMonthlyReport(report.MillionsMonthlyReportId, this.CurrUser);
if (code == "1")
{
ShowNotify("同步成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
}
}
else
{
ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
return;
}
}
if (type == "submit")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=MillionsMonthlyReport&Id={0}", report.MillionsMonthlyReportId, "编辑 - ")));
}
// 2. 关闭本窗体,然后刷新父窗体
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
// 2. 关闭本窗体,然后回发父窗体
//if (type != "submit")
//{
// PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
//}
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(wedId) + ActiveWindow.GetHideReference());
}
protected void btnSave_Click(object sender, EventArgs e)
@@ -291,120 +286,7 @@ namespace FineUIPro.Web.ZHGL.Information
Save("submit");
}
#endregion
#region
/// <summary>
/// 同步数据
/// </summary>
/// <param name="millionsMonthlyReportId"></param>
private void Update(string millionsMonthlyReportId)
{
/////创建客户端服务
//var poxy = Web.ServiceProxy.CreateServiceClient();
//poxy.DataInsertInformation_MillionsMonthlyReportTableCompleted += new EventHandler<HSSEService.DataInsertInformation_MillionsMonthlyReportTableCompletedEventArgs>(poxy_DataInsertInformation_MillionsMonthlyReportTableCompleted);
//var report = from x in Funs.DB.Information_MillionsMonthlyReport
// where x.MillionsMonthlyReportId == millionsMonthlyReportId && x.UpState == BLL.Const.UpState_2
// select new HSSEService.Information_MillionsMonthlyReport
// {
// MillionsMonthlyReportId = x.MillionsMonthlyReportId,
// UnitId = x.UnitId,
// Year = x.Year,
// Month = x.Month,
// FillingMan = x.FillingMan,
// FillingDate = x.FillingDate,
// DutyPerson = x.DutyPerson,
// RecordableIncidentRate = x.RecordableIncidentRate,
// LostTimeRate = x.LostTimeRate,
// LostTimeInjuryRate = x.LostTimeInjuryRate,
// DeathAccidentFrequency = x.DeathAccidentFrequency,
// AccidentMortality = x.AccidentMortality,
// };
//var reportItem = from x in Funs.DB.Information_MillionsMonthlyReportItem
// where x.MillionsMonthlyReportId == millionsMonthlyReportId
// select new HSSEService.Information_MillionsMonthlyReportItem
// {
// MillionsMonthlyReportItemId = x.MillionsMonthlyReportItemId,
// MillionsMonthlyReportId = x.MillionsMonthlyReportId,
// SortIndex = x.SortIndex,
// Affiliation = x.Affiliation,
// Name = x.Name,
// PostPersonNum = x.PostPersonNum,
// SnapPersonNum = x.SnapPersonNum,
// ContractorNum = x.ContractorNum,
// SumPersonNum = x.SumPersonNum,
// TotalWorkNum = x.TotalWorkNum,
// SeriousInjuriesNum = x.SeriousInjuriesNum,
// SeriousInjuriesPersonNum = x.SeriousInjuriesPersonNum,
// SeriousInjuriesLossHour = x.SeriousInjuriesLossHour,
// MinorAccidentNum = x.MinorAccidentNum,
// MinorAccidentPersonNum = x.MinorAccidentPersonNum,
// MinorAccidentLossHour = x.MinorAccidentLossHour,
// OtherAccidentNum = x.OtherAccidentNum,
// OtherAccidentPersonNum = x.OtherAccidentPersonNum,
// OtherAccidentLossHour = x.OtherAccidentLossHour,
// RestrictedWorkPersonNum = x.RestrictedWorkPersonNum,
// RestrictedWorkLossHour = x.RestrictedWorkLossHour,
// MedicalTreatmentPersonNum = x.MedicalTreatmentPersonNum,
// MedicalTreatmentLossHour = x.MedicalTreatmentLossHour,
// FireNum = x.FireNum,
// ExplosionNum = x.ExplosionNum,
// TrafficNum = x.TrafficNum,
// EquipmentNum = x.EquipmentNum,
// QualityNum = x.QualityNum,
// OtherNum = x.OtherNum,
// FirstAidDressingsNum = x.FirstAidDressingsNum,
// AttemptedEventNum = x.AttemptedEventNum,
// LossDayNum = x.LossDayNum,
// };
//poxy.DataInsertInformation_MillionsMonthlyReportTableAsync(report.ToList(), reportItem.ToList());
}
#region
/// <summary>
/// 百万工时安全统计月报表
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void poxy_DataInsertInformation_MillionsMonthlyReportTableCompleted(object sender, HSSEService.DataInsertInformation_MillionsMonthlyReportTableCompletedEventArgs e)
//{
// if (e.Error == null)
// {
// var idList = e.Result;
// foreach (var item in idList)
// {
// var report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByMillionsMonthlyReportId(item);
// if (report != null)
// {
// report.UpState = BLL.Const.UpState_3;
// BLL.MillionsMonthlyReportService.UpdateMillionsMonthlyReport(report);
// ////更新 当前人要处理的意见
// Model.ProjectData_FlowOperate updateUnFlowOperate = BLL.ProjectDataFlowSetService.GetFlowOperateOpinion(BLL.Const.MillionsMonthlyReportMenuId, item);
// if (updateUnFlowOperate != null)
// {
// updateUnFlowOperate.OperaterTime = System.DateTime.Now;
// updateUnFlowOperate.IsClosed = true;
// BLL.ProjectDataFlowSetService.UpdateFlowOperateOpinion(updateUnFlowOperate);
// }
// ////更新催报信息
// var urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == report.UnitId && x.ReprotType == BLL.Const.ReportType_1 && x.YearId == report.Year.ToString() && x.MonthId == report.Month.ToString());
// if (urgeReport != null)
// {
// urgeReport.IsComplete = true;
// Funs.DB.SubmitChanges();
// }
// }
// }
// BLL.LogService.AddSys_Log(this.CurrUser, "【百万工时安全统计月报表】上传到服务器" + idList.Count.ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
// }
// else
// {
// BLL.LogService.AddSys_Log(this.CurrUser, "【百万工时安全统计月报表】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
// }
//}
#endregion
#endregion
#region
private void GetItems(string millionsMonthlyReportId)
{
@@ -673,7 +555,7 @@ namespace FineUIPro.Web.ZHGL.Information
i += 10;
}
Model.Information_MillionsMonthlyReportItem totalItem = new Information_MillionsMonthlyReportItem
Information_MillionsMonthlyReportItem totalItem = new Information_MillionsMonthlyReportItem
{
MillionsMonthlyReportItemId = SQLHelper.GetNewID(typeof(Model.Information_MillionsMonthlyReportItem)),
MillionsMonthlyReportId = millionsMonthlyReportId,