This commit is contained in:
2025-04-07 17:43:30 +08:00
commit 8a2c192129
12175 changed files with 2742596 additions and 0 deletions
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 环评报告
/// </summary>
public static class EIAReportService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 根据主键获取环评报告
/// </summary>
/// <param name="EIAReportId"></param>
/// <returns></returns>
public static Model.Environmental_EIAReport GetEIAReportById(string fileId)
{
return Funs.DB.Environmental_EIAReport.FirstOrDefault(e => e.FileId == fileId);
}
/// <summary>
/// 添加环评报告
/// </summary>
/// <param name="EIAReport"></param>
public static void AddEIAReport(Model.Environmental_EIAReport EIAReport)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EIAReport newEIAReport = new Model.Environmental_EIAReport
{
FileId = EIAReport.FileId,
FileCode = EIAReport.FileCode,
ProjectId = EIAReport.ProjectId,
FileName = EIAReport.FileName,
FileContent = EIAReport.FileContent,
CompileMan = EIAReport.CompileMan,
CompileDate = EIAReport.CompileDate,
AttachUrl = EIAReport.AttachUrl,
States = EIAReport.States
};
db.Environmental_EIAReport.InsertOnSubmit(newEIAReport);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.EIAReportMenuId, EIAReport.ProjectId, null, EIAReport.FileId, EIAReport.CompileDate);
}
/// <summary>
/// 修改环评报告
/// </summary>
/// <param name="EIAReport"></param>
public static void UpdateEIAReport(Model.Environmental_EIAReport EIAReport)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EIAReport newEIAReport = db.Environmental_EIAReport.FirstOrDefault(e => e.FileId == EIAReport.FileId);
if (newEIAReport != null)
{
newEIAReport.FileCode = EIAReport.FileCode;
newEIAReport.FileName = EIAReport.FileName;
newEIAReport.FileContent = EIAReport.FileContent;
newEIAReport.CompileMan = EIAReport.CompileMan;
newEIAReport.CompileDate = EIAReport.CompileDate;
newEIAReport.AttachUrl = EIAReport.AttachUrl;
newEIAReport.States = EIAReport.States;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除环评报告
/// </summary>
/// <param name="FileId"></param>
public static void DeleteEIAReportById(string FileId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EIAReport EIAReport = db.Environmental_EIAReport.FirstOrDefault(e => e.FileId == FileId);
if (EIAReport != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(FileId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(EIAReport.FileId);
BLL.CommonService.DeleteFlowOperateByID(FileId);
db.Environmental_EIAReport.DeleteOnSubmit(EIAReport);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,57 @@
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 环境监测数据
/// </summary>
public static class EnvironmentalCheckService
{
public static Model.SUBQHSEDB db = Funs.DB;
#region 推送环境监测数据
/// <summary>
/// 推送环境监测数据
/// </summary>
/// <returns></returns>
public static ReturnData PushEnvironmentalCheckData()
{
var items = (from x in db.EnvironmentalCheck where x.IsPushed == false select x).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
var thisUnit = CommonService.GetIsThisUnit();
var newItem = new { CollCropCode = thisUnit.CollCropCode, Items = items };
var str = JsonConvert.SerializeObject(newItem);
var baseurl = "/api/Environmental/SaveEnvironmentalCheckData";
responeData = ServerService.PushCNCEC(str, baseurl);
if (responeData.code == 1)
{//推送成功后,修改数据状态
foreach (var item in items)
{
Model.EnvironmentalCheck envModel = db.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id);
if (envModel != null)
{
envModel.IsPushed = true;
db.SubmitChanges();
}
}
}
}
else
{
responeData.code = 0;
responeData.message = "当前没有环境监测数据";
}
return responeData;
}
#endregion
}
}
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 环境事件应急预案
/// </summary>
public static class EnvironmentalEmergencyPlanService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 根据主键获取环境事件应急预案
/// </summary>
/// <param name="EnvironmentalEmergencyPlanId"></param>
/// <returns></returns>
public static Model.Environmental_EnvironmentalEmergencyPlan GetEnvironmentalEmergencyPlanById(string fileId)
{
return Funs.DB.Environmental_EnvironmentalEmergencyPlan.FirstOrDefault(e => e.FileId == fileId);
}
/// <summary>
/// 添加环境事件应急预案
/// </summary>
/// <param name="EnvironmentalEmergencyPlan"></param>
public static void AddEnvironmentalEmergencyPlan(Model.Environmental_EnvironmentalEmergencyPlan EnvironmentalEmergencyPlan)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalEmergencyPlan newEnvironmentalEmergencyPlan = new Model.Environmental_EnvironmentalEmergencyPlan
{
FileId = EnvironmentalEmergencyPlan.FileId,
FileCode = EnvironmentalEmergencyPlan.FileCode,
ProjectId = EnvironmentalEmergencyPlan.ProjectId,
FileName = EnvironmentalEmergencyPlan.FileName,
FileContent = EnvironmentalEmergencyPlan.FileContent,
CompileMan = EnvironmentalEmergencyPlan.CompileMan,
CompileDate = EnvironmentalEmergencyPlan.CompileDate,
AttachUrl = EnvironmentalEmergencyPlan.AttachUrl,
States = EnvironmentalEmergencyPlan.States
};
db.Environmental_EnvironmentalEmergencyPlan.InsertOnSubmit(newEnvironmentalEmergencyPlan);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.EnvironmentalEmergencyPlanMenuId, EnvironmentalEmergencyPlan.ProjectId, null, EnvironmentalEmergencyPlan.FileId, EnvironmentalEmergencyPlan.CompileDate);
}
/// <summary>
/// 修改环境事件应急预案
/// </summary>
/// <param name="EnvironmentalEmergencyPlan"></param>
public static void UpdateEnvironmentalEmergencyPlan(Model.Environmental_EnvironmentalEmergencyPlan EnvironmentalEmergencyPlan)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalEmergencyPlan newEnvironmentalEmergencyPlan = db.Environmental_EnvironmentalEmergencyPlan.FirstOrDefault(e => e.FileId == EnvironmentalEmergencyPlan.FileId);
if (newEnvironmentalEmergencyPlan != null)
{
newEnvironmentalEmergencyPlan.FileCode = EnvironmentalEmergencyPlan.FileCode;
newEnvironmentalEmergencyPlan.FileName = EnvironmentalEmergencyPlan.FileName;
newEnvironmentalEmergencyPlan.FileContent = EnvironmentalEmergencyPlan.FileContent;
newEnvironmentalEmergencyPlan.CompileMan = EnvironmentalEmergencyPlan.CompileMan;
newEnvironmentalEmergencyPlan.CompileDate = EnvironmentalEmergencyPlan.CompileDate;
newEnvironmentalEmergencyPlan.AttachUrl = EnvironmentalEmergencyPlan.AttachUrl;
newEnvironmentalEmergencyPlan.States = EnvironmentalEmergencyPlan.States;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除环境事件应急预案
/// </summary>
/// <param name="FileId"></param>
public static void DeleteEnvironmentalEmergencyPlanById(string FileId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalEmergencyPlan EnvironmentalEmergencyPlan = db.Environmental_EnvironmentalEmergencyPlan.FirstOrDefault(e => e.FileId == FileId);
if (EnvironmentalEmergencyPlan != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(FileId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(EnvironmentalEmergencyPlan.FileId);
BLL.CommonService.DeleteFlowOperateByID(FileId);
db.Environmental_EnvironmentalEmergencyPlan.DeleteOnSubmit(EnvironmentalEmergencyPlan);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 环境监测数据
/// </summary>
public static class EnvironmentalMonitoringService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 根据主键获取环境监测数据
/// </summary>
/// <param name="EnvironmentalMonitoringId"></param>
/// <returns></returns>
public static Model.Environmental_EnvironmentalMonitoring GetEnvironmentalMonitoringById(string fileId)
{
return Funs.DB.Environmental_EnvironmentalMonitoring.FirstOrDefault(e => e.FileId == fileId);
}
/// <summary>
/// 添加环境监测数据
/// </summary>
/// <param name="EnvironmentalMonitoring"></param>
public static void AddEnvironmentalMonitoring(Model.Environmental_EnvironmentalMonitoring EnvironmentalMonitoring)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalMonitoring newEnvironmentalMonitoring = new Model.Environmental_EnvironmentalMonitoring
{
FileId = EnvironmentalMonitoring.FileId,
FileCode = EnvironmentalMonitoring.FileCode,
ProjectId = EnvironmentalMonitoring.ProjectId,
FileName = EnvironmentalMonitoring.FileName,
FileContent = EnvironmentalMonitoring.FileContent,
CompileMan = EnvironmentalMonitoring.CompileMan,
CompileDate = EnvironmentalMonitoring.CompileDate,
AttachUrl = EnvironmentalMonitoring.AttachUrl,
States = EnvironmentalMonitoring.States
};
db.Environmental_EnvironmentalMonitoring.InsertOnSubmit(newEnvironmentalMonitoring);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.EnvironmentalMonitoringMenuId, EnvironmentalMonitoring.ProjectId, null, EnvironmentalMonitoring.FileId, EnvironmentalMonitoring.CompileDate);
}
/// <summary>
/// 修改环境监测数据
/// </summary>
/// <param name="EnvironmentalMonitoring"></param>
public static void UpdateEnvironmentalMonitoring(Model.Environmental_EnvironmentalMonitoring EnvironmentalMonitoring)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalMonitoring newEnvironmentalMonitoring = db.Environmental_EnvironmentalMonitoring.FirstOrDefault(e => e.FileId == EnvironmentalMonitoring.FileId);
if (newEnvironmentalMonitoring != null)
{
newEnvironmentalMonitoring.FileCode = EnvironmentalMonitoring.FileCode;
newEnvironmentalMonitoring.FileName = EnvironmentalMonitoring.FileName;
newEnvironmentalMonitoring.FileContent = EnvironmentalMonitoring.FileContent;
newEnvironmentalMonitoring.CompileMan = EnvironmentalMonitoring.CompileMan;
newEnvironmentalMonitoring.CompileDate = EnvironmentalMonitoring.CompileDate;
newEnvironmentalMonitoring.AttachUrl = EnvironmentalMonitoring.AttachUrl;
newEnvironmentalMonitoring.States = EnvironmentalMonitoring.States;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除环境监测数据
/// </summary>
/// <param name="FileId"></param>
public static void DeleteEnvironmentalMonitoringById(string FileId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_EnvironmentalMonitoring EnvironmentalMonitoring = db.Environmental_EnvironmentalMonitoring.FirstOrDefault(e => e.FileId == FileId);
if (EnvironmentalMonitoring != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(FileId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(EnvironmentalMonitoring.FileId);
BLL.CommonService.DeleteFlowOperateByID(FileId);
db.Environmental_EnvironmentalMonitoring.DeleteOnSubmit(EnvironmentalMonitoring);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 突发环境事件
/// </summary>
public static class UnexpectedEnvironmentalService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 根据主键获取突发环境事件
/// </summary>
/// <param name="UnexpectedEnvironmentalId"></param>
/// <returns></returns>
public static Model.Environmental_UnexpectedEnvironmental GetUnexpectedEnvironmentalById(string fileId)
{
return Funs.DB.Environmental_UnexpectedEnvironmental.FirstOrDefault(e => e.FileId == fileId);
}
/// <summary>
/// 添加突发环境事件
/// </summary>
/// <param name="UnexpectedEnvironmental"></param>
public static void AddUnexpectedEnvironmental(Model.Environmental_UnexpectedEnvironmental UnexpectedEnvironmental)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_UnexpectedEnvironmental newUnexpectedEnvironmental = new Model.Environmental_UnexpectedEnvironmental
{
FileId = UnexpectedEnvironmental.FileId,
FileCode = UnexpectedEnvironmental.FileCode,
ProjectId = UnexpectedEnvironmental.ProjectId,
FileName = UnexpectedEnvironmental.FileName,
FileContent = UnexpectedEnvironmental.FileContent,
CompileMan = UnexpectedEnvironmental.CompileMan,
CompileDate = UnexpectedEnvironmental.CompileDate,
AttachUrl = UnexpectedEnvironmental.AttachUrl,
States = UnexpectedEnvironmental.States
};
db.Environmental_UnexpectedEnvironmental.InsertOnSubmit(newUnexpectedEnvironmental);
db.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.UnexpectedEnvironmentalMenuId, UnexpectedEnvironmental.ProjectId, null, UnexpectedEnvironmental.FileId, UnexpectedEnvironmental.CompileDate);
}
/// <summary>
/// 修改突发环境事件
/// </summary>
/// <param name="UnexpectedEnvironmental"></param>
public static void UpdateUnexpectedEnvironmental(Model.Environmental_UnexpectedEnvironmental UnexpectedEnvironmental)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_UnexpectedEnvironmental newUnexpectedEnvironmental = db.Environmental_UnexpectedEnvironmental.FirstOrDefault(e => e.FileId == UnexpectedEnvironmental.FileId);
if (newUnexpectedEnvironmental != null)
{
newUnexpectedEnvironmental.FileCode = UnexpectedEnvironmental.FileCode;
newUnexpectedEnvironmental.FileName = UnexpectedEnvironmental.FileName;
newUnexpectedEnvironmental.FileContent = UnexpectedEnvironmental.FileContent;
newUnexpectedEnvironmental.CompileMan = UnexpectedEnvironmental.CompileMan;
newUnexpectedEnvironmental.CompileDate = UnexpectedEnvironmental.CompileDate;
newUnexpectedEnvironmental.AttachUrl = UnexpectedEnvironmental.AttachUrl;
newUnexpectedEnvironmental.States = UnexpectedEnvironmental.States;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除突发环境事件
/// </summary>
/// <param name="FileId"></param>
public static void DeleteUnexpectedEnvironmentalById(string FileId)
{
Model.SUBQHSEDB db = Funs.DB;
Model.Environmental_UnexpectedEnvironmental UnexpectedEnvironmental = db.Environmental_UnexpectedEnvironmental.FirstOrDefault(e => e.FileId == FileId);
if (UnexpectedEnvironmental != null)
{
///删除编码表记录
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(FileId);
////删除附件表
BLL.CommonService.DeleteAttachFileById(UnexpectedEnvironmental.FileId);
BLL.CommonService.DeleteFlowOperateByID(FileId);
db.Environmental_UnexpectedEnvironmental.DeleteOnSubmit(UnexpectedEnvironmental);
db.SubmitChanges();
}
}
}
}