数据库变更CNPC_XJYJ

This commit is contained in:
2025-08-04 18:04:41 +08:00
parent bafbf97359
commit 79a7f35e22
679 changed files with 5590 additions and 3465 deletions
@@ -132,7 +132,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getDataList = new Model.SGGLDB(Funs.ConnString).QualityAudit_EquipmentQuality.Where(x => x.ProjectId == projectId);
var getDataList = new Model.CNPCDB(Funs.ConnString).QualityAudit_EquipmentQuality.Where(x => x.ProjectId == projectId);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
{
getDataList = getDataList.Where(x => x.UnitId == unitId);
@@ -170,7 +170,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.View_QualityAudit_EquipmentQuality> q = from x in new Model.SGGLDB(Funs.ConnString).View_QualityAudit_EquipmentQuality
IQueryable<Model.View_QualityAudit_EquipmentQuality> q = from x in new Model.CNPCDB(Funs.ConnString).View_QualityAudit_EquipmentQuality
where x.ProjectId == projectId
select x;
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
@@ -111,7 +111,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getDataList = new Model.SGGLDB(Funs.ConnString).QualityAudit_GeneralEquipmentQuality.Where(x => x.ProjectId == projectId);
var getDataList = new Model.CNPCDB(Funs.ConnString).QualityAudit_GeneralEquipmentQuality.Where(x => x.ProjectId == projectId);
if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(projectId, unitId))
{
getDataList = getDataList.Where(x => x.UnitId == unitId);
@@ -24,7 +24,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in new Model.SGGLDB(Funs.ConnString).Law_HSSEStandardsList
responeData.data = from x in new Model.CNPCDB(Funs.ConnString).Law_HSSEStandardsList
where x.StandardId == standardId
select new
{
@@ -57,7 +57,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_HSSEStandardsList> q = from x in new Model.SGGLDB(Funs.ConnString).Law_HSSEStandardsList
IQueryable<Model.Law_HSSEStandardsList> q = from x in new Model.CNPCDB(Funs.ConnString).Law_HSSEStandardsList
where x.TypeId == type && x.IsPass == true
select x;
int pageCount = q.Count();
@@ -100,7 +100,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_HSSEStandardsList> q = from x in new Model.SGGLDB(Funs.ConnString).Law_HSSEStandardsList
IQueryable<Model.Law_HSSEStandardsList> q = from x in new Model.CNPCDB(Funs.ConnString).Law_HSSEStandardsList
where x.TypeId == type && x.IsPass == true
select x;
if (!string.IsNullOrEmpty(strParam))
@@ -24,7 +24,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in new Model.SGGLDB(Funs.ConnString).Law_ManageRule
responeData.data = from x in new Model.CNPCDB(Funs.ConnString).Law_ManageRule
where x.ManageRuleId == manageRuleId && x.IsPass == true
select new
{
@@ -59,7 +59,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_ManageRule> q = from x in new Model.SGGLDB(Funs.ConnString).Law_ManageRule
IQueryable<Model.Law_ManageRule> q = from x in new Model.CNPCDB(Funs.ConnString).Law_ManageRule
where x.ManageRuleTypeId == type && x.IsPass == true
select x;
int pageCount = q.Count();
@@ -103,7 +103,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_ManageRule> q = from x in new Model.SGGLDB(Funs.ConnString).Law_ManageRule
IQueryable<Model.Law_ManageRule> q = from x in new Model.CNPCDB(Funs.ConnString).Law_ManageRule
where x.ManageRuleTypeId == type && x.IsPass == true
select x;
if (!string.IsNullOrEmpty(strParam))
@@ -24,7 +24,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in new Model.SGGLDB(Funs.ConnString).Law_LawRegulationList
responeData.data = from x in new Model.CNPCDB(Funs.ConnString).Law_LawRegulationList
where x.LawRegulationId == lawRegulationId
select new
{
@@ -59,7 +59,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_LawRegulationList> q = from x in new Model.SGGLDB(Funs.ConnString).Law_LawRegulationList
IQueryable<Model.Law_LawRegulationList> q = from x in new Model.CNPCDB(Funs.ConnString).Law_LawRegulationList
where x.LawsRegulationsTypeId == type && x.IsPass == true
select x;
int pageCount = q.Count();
@@ -104,7 +104,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_LawRegulationList> q = from x in new Model.SGGLDB(Funs.ConnString).Law_LawRegulationList
IQueryable<Model.Law_LawRegulationList> q = from x in new Model.CNPCDB(Funs.ConnString).Law_LawRegulationList
where x.LawsRegulationsTypeId == type && x.IsPass == true
select x;
if (!string.IsNullOrEmpty(strParam))
@@ -24,7 +24,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in new Model.SGGLDB(Funs.ConnString).Law_RulesRegulations
responeData.data = from x in new Model.CNPCDB(Funs.ConnString).Law_RulesRegulations
where x.RulesRegulationsId == rulesRegulationsId
select new
{
@@ -59,7 +59,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_RulesRegulations> q = from x in new Model.SGGLDB(Funs.ConnString).Law_RulesRegulations
IQueryable<Model.Law_RulesRegulations> q = from x in new Model.CNPCDB(Funs.ConnString).Law_RulesRegulations
where x.RulesRegulationsTypeId == type && x.IsPass == true
select x;
int pageCount = q.Count();
@@ -103,7 +103,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Law_RulesRegulations> q = from x in new Model.SGGLDB(Funs.ConnString).Law_RulesRegulations
IQueryable<Model.Law_RulesRegulations> q = from x in new Model.CNPCDB(Funs.ConnString).Law_RulesRegulations
where x.RulesRegulationsTypeId == type && x.IsPass == true
select x;
if (!string.IsNullOrEmpty(strParam))
@@ -24,7 +24,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString);
Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString);
var getProject = ProjectService.GetProjectByProjectId(projectId);
if (getProject != null)
{
@@ -79,7 +79,7 @@ namespace WebAPI.Controllers
try
{
//总数 0待提交;1待签发;2待批准;3待接收;4已闭环
var getDataList = new Model.SGGLDB(Funs.ConnString).Check_PauseNotice.Where(x => x.ProjectId == projectId && (x.UnitId == unitId || unitId == null));
var getDataList = new Model.CNPCDB(Funs.ConnString).Check_PauseNotice.Where(x => x.ProjectId == projectId && (x.UnitId == unitId || unitId == null));
if (!string.IsNullOrEmpty(strParam))
{
getDataList = getDataList.Where(x => x.PauseNoticeCode.Contains(strParam) || x.WrongContent.Contains(strParam) || x.PauseContent.Contains(strParam));
@@ -52,7 +52,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString);
Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString);
int tatalCount = 0, count1 = 0, count2 = 0, count3 = 0, count4 = 0;
bool isSub = !(unitId == Const.UnitId_TCC);
if (qualityType == "1")
@@ -128,7 +128,7 @@ namespace WebAPI.Controllers
var getInfo = ReceiveFileManagerService.GetReceiveFileManagerById(receiveFileManagerId);
if (getInfo != null && getInfo.FileType == "1")
{
var getF = new Model.SGGLDB(Funs.ConnString).InformationProject_ReceiveFileManager.FirstOrDefault(x => x.FromId == getInfo.ReceiveFileManagerId);
var getF = new Model.CNPCDB(Funs.ConnString).InformationProject_ReceiveFileManager.FirstOrDefault(x => x.FromId == getInfo.ReceiveFileManagerId);
if (getF == null)
{
ReceiveFileManagerService.IssueReceiveFile(getInfo.ReceiveFileManagerId);
@@ -326,7 +326,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
responeData.data = from x in new Model.SGGLDB(Funs.ConnString).Resources_SignManage
responeData.data = from x in new Model.CNPCDB(Funs.ConnString).Resources_SignManage
where x.SignManageId == signManageId
select new
{
@@ -341,7 +341,7 @@ namespace WebAPI.Controllers
x.SignArea,
x.SignType,
x.SignImage,
AttachUrl = new Model.SGGLDB(Funs.ConnString).AttachFile.First(z=>z.ToKeyId ==x.SignManageId).AttachUrl.Replace('\\', '/')
AttachUrl = new Model.CNPCDB(Funs.ConnString).AttachFile.First(z=>z.ToKeyId ==x.SignManageId).AttachUrl.Replace('\\', '/')
};
}
catch (Exception ex)
@@ -367,7 +367,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
IQueryable<Model.Resources_SignManage> q = from x in new Model.SGGLDB(Funs.ConnString).Resources_SignManage
IQueryable<Model.Resources_SignManage> q = from x in new Model.CNPCDB(Funs.ConnString).Resources_SignManage
where x.SignType == type
select x;
if (!string.IsNullOrEmpty(strParam))
@@ -196,7 +196,7 @@ namespace WebAPI.Controllers
try
{
int mTime = 0;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
var getTestRecord = db.Test_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecordId);
if (getTestRecord != null)
@@ -80,7 +80,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getTasks = new Model.SGGLDB(Funs.ConnString).Training_Task.FirstOrDefault(x => x.PlanId == trainingPlanId);
var getTasks = new Model.CNPCDB(Funs.ConnString).Training_Task.FirstOrDefault(x => x.PlanId == trainingPlanId);
if (getTasks != null)
{
if (CommonService.IsMainUnitOrAdmin(userId))
@@ -193,7 +193,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getTestPlan = new Model.SGGLDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
var getTestPlan = new Model.CNPCDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
if (getTestPlan != null)
{
var person = PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
@@ -202,7 +202,7 @@ namespace WebAPI.Controllers
//2-考试中;生成考试试卷
if (getTestPlan.States == "2" )
{
var testRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
var testRecord = new Model.CNPCDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
if (testRecord != null)
{
string testRecordId = APITestRecordService.CreateTestRecordItem(getTestPlan, testRecord.TestRecordId, person);
@@ -215,7 +215,7 @@ namespace WebAPI.Controllers
if (string.IsNullOrEmpty(getTestPlan.PlanId) && getTestPlan.UnitIds.Contains(person.UnitId) && (getTestPlan.WorkPostIds == null || getTestPlan.WorkPostIds.Contains(person.WorkPostId)))
{
//0-待提交;1-已发布未考试 将人员添加进考试记录
var testTRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
var testTRecord = new Model.CNPCDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
if ((getTestPlan.States == "0" || getTestPlan.States == "1") && testTRecord == null && !string.IsNullOrEmpty(personId))
{
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
@@ -262,7 +262,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
var getTestPlan = new Model.SGGLDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId);
var getTestPlan = new Model.CNPCDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId);
if (getTestPlan != null)
{
@@ -299,7 +299,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
using (var db = new Model.SGGLDB(Funs.ConnString))
using (var db = new Model.CNPCDB(Funs.ConnString))
{
var getCompanyTraining = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemCode == companyTrainingItemCode);
if (getCompanyTraining != null)
@@ -97,7 +97,7 @@ namespace WebAPI.Controllers
try
{
int mTime = 0;
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{
var getTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecordId);
if (getTestRecord != null)