提交代码

This commit is contained in:
2024-12-24 19:04:32 +08:00
parent 2e3c34c38c
commit 189a020cc7
78 changed files with 9689 additions and 2214 deletions
@@ -156,47 +156,50 @@ namespace BLL
/// <param name="newtable"></param>
public static void AddProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
{
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TrainPersonNum = newtable.TrainPersonNum,
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
UseNum = newtable.UseNum,
OKNum = newtable.OKNum,
CompanyPersonNum = newtable.CompanyPersonNum,
BranchPersonNum = newtable.BranchPersonNum,
ProjectPersonNum = newtable.ProjectPersonNum,
ProblemNum = newtable.ProblemNum,
ProblemCompletedNum = newtable.ProblemCompletedNum,
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
SNum = newtable.SNum,
ANum = newtable.ANum,
BNum = newtable.BNum,
CNum = newtable.CNum,
KeyProcessNum = newtable.KeyProcessNum,
KeyProcessOKNum = newtable.KeyProcessOKNum,
SpecialProcessNum = newtable.SpecialProcessNum,
SpecialProcessOKNum = newtable.SpecialProcessOKNum,
ConcealedWorksNum = newtable.ConcealedWorksNum,
ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
UnitProjectOnesNum = newtable.UnitProjectOnesNum,
UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
MaterialInRecheckNum = newtable.MaterialInRecheckNum,
MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
SingleProjectNum = newtable.SingleProjectNum,
UnitProjectNum = newtable.UnitProjectNum,
SubProjectNum = newtable.SubProjectNum,
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
InspectionLotNum = newtable.InspectionLotNum,
};
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS
{
Id = newtable.Id,
ProjectId = newtable.ProjectId,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TrainPersonNum = newtable.TrainPersonNum,
TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum,
UseNum = newtable.UseNum,
OKNum = newtable.OKNum,
CompanyPersonNum = newtable.CompanyPersonNum,
BranchPersonNum = newtable.BranchPersonNum,
ProjectPersonNum = newtable.ProjectPersonNum,
ProblemNum = newtable.ProblemNum,
ProblemCompletedNum = newtable.ProblemCompletedNum,
ProblemNotCompletedNum = newtable.ProblemNotCompletedNum,
SNum = newtable.SNum,
ANum = newtable.ANum,
BNum = newtable.BNum,
CNum = newtable.CNum,
KeyProcessNum = newtable.KeyProcessNum,
KeyProcessOKNum = newtable.KeyProcessOKNum,
SpecialProcessNum = newtable.SpecialProcessNum,
SpecialProcessOKNum = newtable.SpecialProcessOKNum,
ConcealedWorksNum = newtable.ConcealedWorksNum,
ConcealedWorksOKNum = newtable.ConcealedWorksOKNum,
UnitProjectOnesNum = newtable.UnitProjectOnesNum,
UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum,
MaterialInRecheckNum = newtable.MaterialInRecheckNum,
MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum,
SingleProjectNum = newtable.SingleProjectNum,
UnitProjectNum = newtable.UnitProjectNum,
SubProjectNum = newtable.SubProjectNum,
SubdivisionalWorksNum = newtable.SubdivisionalWorksNum,
InspectionLotNum = newtable.InspectionLotNum,
};
db.Project_CQMSData_CQMS.InsertOnSubmit(table);
db.SubmitChanges();
}
}
/// <summary>
/// 修改
@@ -204,46 +207,48 @@ namespace BLL
/// <param name="newtable"></param>
public static void UpdateProject_CQMSData_CQMS(Model.Project_CQMSData_CQMS newtable)
{
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TrainPersonNum = newtable.TrainPersonNum;
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
table.UseNum = newtable.UseNum;
table.OKNum = newtable.OKNum;
table.CompanyPersonNum = newtable.CompanyPersonNum;
table.BranchPersonNum = newtable.BranchPersonNum;
table.ProjectPersonNum = newtable.ProjectPersonNum;
table.ProblemNum = newtable.ProblemNum;
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
table.SNum = newtable.SNum;
table.ANum = newtable.ANum;
table.BNum = newtable.BNum;
table.CNum = newtable.CNum;
table.KeyProcessNum = newtable.KeyProcessNum;
table.KeyProcessOKNum = newtable.KeyProcessOKNum;
table.SpecialProcessNum = newtable.SpecialProcessNum;
table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
table.ConcealedWorksNum = newtable.ConcealedWorksNum;
table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
table.SingleProjectNum = newtable.SingleProjectNum;
table.UnitProjectNum = newtable.UnitProjectNum;
table.SubProjectNum = newtable.SubProjectNum;
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
table.InspectionLotNum = newtable.InspectionLotNum;
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.ProjectId = newtable.ProjectId;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TrainPersonNum = newtable.TrainPersonNum;
table.TechnicalDisclosePersonNum = newtable.TechnicalDisclosePersonNum;
table.UseNum = newtable.UseNum;
table.OKNum = newtable.OKNum;
table.CompanyPersonNum = newtable.CompanyPersonNum;
table.BranchPersonNum = newtable.BranchPersonNum;
table.ProjectPersonNum = newtable.ProjectPersonNum;
table.ProblemNum = newtable.ProblemNum;
table.ProblemCompletedNum = newtable.ProblemCompletedNum;
table.ProblemNotCompletedNum = newtable.ProblemNotCompletedNum;
table.SNum = newtable.SNum;
table.ANum = newtable.ANum;
table.BNum = newtable.BNum;
table.CNum = newtable.CNum;
table.KeyProcessNum = newtable.KeyProcessNum;
table.KeyProcessOKNum = newtable.KeyProcessOKNum;
table.SpecialProcessNum = newtable.SpecialProcessNum;
table.SpecialProcessOKNum = newtable.SpecialProcessOKNum;
table.ConcealedWorksNum = newtable.ConcealedWorksNum;
table.ConcealedWorksOKNum = newtable.ConcealedWorksOKNum;
table.UnitProjectOnesNum = newtable.UnitProjectOnesNum;
table.UnitProjectOnesOKNum = newtable.UnitProjectOnesOKNum;
table.MaterialInRecheckNum = newtable.MaterialInRecheckNum;
table.MaterialInRecheckOKNum = newtable.MaterialInRecheckOKNum;
table.SingleProjectNum = newtable.SingleProjectNum;
table.UnitProjectNum = newtable.UnitProjectNum;
table.SubProjectNum = newtable.SubProjectNum;
table.SubdivisionalWorksNum = newtable.SubdivisionalWorksNum;
table.InspectionLotNum = newtable.InspectionLotNum;
db.SubmitChanges();
}
}
}
@@ -253,12 +258,14 @@ namespace BLL
/// <param name="Id"></param>
public static void DeleteProject_CQMSData_CQMSById(string Id)
{
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.Project_CQMSData_CQMS.DeleteOnSubmit(table);
db.SubmitChanges();
Model.Project_CQMSData_CQMS table = db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.Project_CQMSData_CQMS.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
@@ -412,7 +419,7 @@ namespace BLL
public static int GetTrainPersonNum(string projectid)
{
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate>Const.DtmarkTime
where x.ProjectId == projectid && x.IsTrain == true && x.CompileDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -422,7 +429,7 @@ namespace BLL
/// <returns></returns>
public static int GetTechnicalDisclosePersonNum(string projectid)
{
var result = (from x in Funs.DB.Comprehensive_DesignDetails
var result = (from x in Funs.DB.Comprehensive_DesignDetails
where x.ProjectId == projectid && x.CompileDate > Const.DtmarkTime
select x.JoinPersonNum).ToList().Sum(x => x.Value);
var q = Funs.GetNewIntOrZero(result.ToString());
@@ -488,7 +495,7 @@ namespace BLL
/// <returns></returns>
public static int GetProblemNum(string projectid)
{
int result = (from x in Funs.DB.Check_CheckControl
int result = (from x in Funs.DB.Check_CheckControl
where x.ProjectId == projectid && x.CheckDate > Const.DtmarkTime
select x).Count();
return result;
@@ -567,7 +574,7 @@ namespace BLL
{
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
where y.ProjectId == projectid && y.CheckAcceptType == "1" && x.CreateDate> Const.DtmarkTime
where y.ProjectId == projectid && y.CheckAcceptType == "1" && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -580,7 +587,7 @@ namespace BLL
int result = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals y.BreakdownProjectId
join z in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals z.InspectionId
where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate>Const.DtmarkTime
where y.ProjectId == projectid && y.CheckAcceptType == "1" && z.IsOnceQualified == true && x.CreateDate > Const.DtmarkTime
select x).Count();
return result;
}
@@ -691,7 +698,7 @@ namespace BLL
public static int GetSingleProjectNum(string projectid)
{
int result = (from x in Funs.DB.Project_Installation
where x.ProjectId == projectid && x.SuperInstallationId == "0"
where x.ProjectId == projectid && x.SuperInstallationId == "0"
select x).Count();
return result;
}
@@ -702,7 +709,7 @@ namespace BLL
public static int GetUnitProjectNum(string projectid)
{
int result = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == projectid && (x.SuperUnitWork == null || x.SuperUnitWork == "0")
where x.ProjectId == projectid
select x).Count();
return result;
}
@@ -735,11 +742,40 @@ namespace BLL
public static int GetInspectionLotNum(string projectid)
{
int result = (from x in Funs.DB.WBS_BreakdownProject
where x.ProjectId == projectid && x.IsSelected == true
where x.ProjectId == projectid && x.IsSelected == true
select x).Count();
return result;
}
#region
/// <summary>
/// 推送项目质量数据
/// </summary>
/// <returns></returns>
public static ReturnData PushProjectCQMSData()
{
var items = (from x in db.Project_CQMSData_CQMS
where x.ReportDate == DateTime.Now.Date
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/CQMSData/SaveProjectCQMSData";
responeData = ServerService.PushCNCEC(str, baseurl);
}
else
{
responeData.code = 0;
responeData.message = "当前没有项目质量数据";
}
return responeData;
}
#endregion
}
}