Merge branch 'master' of http://47.104.102.122:3000/lpf/SGGL_SeDin_New
This commit is contained in:
@@ -56,6 +56,9 @@
|
||||
<Reference Include="EmitMapper, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EmitMapper.1.0.0\lib\EmitMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FastReport">
|
||||
<HintPath>E:\工作\天辰施工平台\SGGL_TCC\SGGL\BLL\bin\Debug\FastReport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FineUIPro, Version=6.3.0.0, Culture=neutral, PublicKeyToken=9cbe753c029f291a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\FineUIPro\FineUIPro.dll</HintPath>
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Data;
|
||||
using System.Web;
|
||||
using FastReport;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class FastReportService
|
||||
@@ -30,5 +36,58 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合并报表后打印
|
||||
/// </summary>
|
||||
/// <param name="fastReportItems">报表实体集</param>
|
||||
/// <param name="path">导出的路径</param>
|
||||
public static void ExportMergeReport(List<Model.FastReportItem> fastReportItems, string path, string printType)
|
||||
{
|
||||
Report report = new Report();
|
||||
report.PrintSettings.ShowDialog = false; //隐藏弹窗
|
||||
FastReport.EnvironmentSettings settings = new EnvironmentSettings();
|
||||
settings.ReportSettings.ShowProgress = false; //隐藏进度条
|
||||
for (int i = 0; i < fastReportItems.Count; i++)
|
||||
{
|
||||
report.Load(Funs.RootPath + fastReportItems[i].ReportPath); //加载报表
|
||||
|
||||
List<DataTable> dataTables = fastReportItems[i].DataTables;
|
||||
Dictionary<string, string> ParameterValues = fastReportItems[i].ParameterValues;
|
||||
if (dataTables != null && dataTables.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < dataTables.Count; j++)
|
||||
{
|
||||
report.RegisterData(dataTables[j], dataTables[j].TableName);//绑定数据源
|
||||
}
|
||||
}
|
||||
if (ParameterValues.Count > 0)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> kvp in ParameterValues)
|
||||
{
|
||||
report.SetParameterValue(kvp.Key, kvp.Value);//绑定参数
|
||||
}
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
report.Prepare();
|
||||
}
|
||||
else
|
||||
{
|
||||
report.Prepare(true);
|
||||
}
|
||||
}
|
||||
if (printType == "1")
|
||||
{
|
||||
FastReport.Export.Pdf.PDFExport exp = new FastReport.Export.Pdf.PDFExport();
|
||||
report.Export(exp, path);
|
||||
}
|
||||
else if (printType == "2")
|
||||
{
|
||||
FastReport.Export.OoXML.Word2007Export exportBase = new FastReport.Export.OoXML.Word2007Export();
|
||||
report.Export(export: exportBase, fileName: path.Replace(oldValue: "pdf", newValue: "docx"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,5 +144,21 @@ namespace BLL
|
||||
return isShow;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据委托Id删除明细
|
||||
/// </summary>
|
||||
/// <param name="trustBatchId"></param>
|
||||
public static void DeleteTrustItemByTrustBatchId(string trustBatchId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var trustBatchItems = from x in db.HJGL_Batch_BatchTrustItem where x.TrustBatchId == trustBatchId select x;
|
||||
if (trustBatchItems != null)
|
||||
{
|
||||
db.HJGL_Batch_BatchTrustItem.DeleteAllOnSubmit(trustBatchItems);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BLL
|
||||
var result = new List<Model.PipelinePrefabricatedComponentsItem>();
|
||||
if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制散件)
|
||||
{
|
||||
var q = from detail in Funs.DB.HJGL_PackagingManageDetail
|
||||
var q = from detail in Funs.DB.HJGL_PackagingManageDetail
|
||||
join lib in Funs.DB.HJGL_MaterialCodeLib on detail.MaterialCode equals lib.MaterialCode into libJoin
|
||||
from libItem in libJoin.DefaultIfEmpty()
|
||||
join line in Funs.DB.HJGL_Pipeline on detail.PipelineId equals line.PipelineId into lineJoin
|
||||
@@ -152,7 +152,8 @@ namespace BLL
|
||||
Number = detail.Number,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
PipelineCode = lineItem.PipelineCode,
|
||||
UnitWorkId=lineItem.UnitWorkId,
|
||||
UnitWorkId = lineItem.UnitWorkId,
|
||||
FlowingSection = lineItem.FlowingSection,
|
||||
|
||||
};
|
||||
result= q.ToList();
|
||||
@@ -177,6 +178,7 @@ namespace BLL
|
||||
Number = detail.Number,
|
||||
PipelineId = lineItem.PipelineId,
|
||||
PipelineCode = lineItem.PipelineCode,
|
||||
FlowingSection = lineItem.FlowingSection,
|
||||
|
||||
};
|
||||
result = q.ToList();
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace BLL
|
||||
State = x.State,
|
||||
TypeInt = x.TypeInt,
|
||||
TypeString = GetTypeString(x.TypeInt),
|
||||
ReceiveMan = t.PersonName,
|
||||
ReceiveMan = train.ContactName,//t.PersonName,
|
||||
ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "",
|
||||
PlanStartDate = GetMinPlanStartDate(x.PackagingManageId),
|
||||
TrainNumberOld = x.TrainNumber,
|
||||
@@ -179,7 +179,7 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(model.PipelineComponentId))
|
||||
{
|
||||
var PipelineComponentIds = model.PipelineComponentId.Split(',');
|
||||
string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,isnull(pipe.PlanStartDate,getdate()) as PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU
|
||||
string strSql = @"select com.PipelineComponentId, com.PipelineComponentCode,isnull(pipe.PlanStartDate,getdate()) as PlanStartDate,unitwork.UnitWorkName,'1' as num ,'个' as CU,pipe.FlowingSection
|
||||
from HJGL_Pipeline_Component com
|
||||
left join HJGL_Pipeline pipe on com.PipelineId=pipe.PipelineId
|
||||
left join WBS_UnitWork unitwork on pipe.UnitWorkId=unitwork.UnitWorkId
|
||||
@@ -252,6 +252,8 @@ namespace BLL
|
||||
TrainNumber = newtable.TrainNumber,
|
||||
TrainNumberId = newtable.TrainNumberId,
|
||||
TypeInt = newtable.TypeInt,
|
||||
CompileMan=newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate
|
||||
};
|
||||
var db1 = Funs.DB;
|
||||
db1.HJGL_PackagingManage.InsertOnSubmit(table);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace BLL
|
||||
|
||||
public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlan(string loginProjectId, string flowingSection, string unitWorkId, string material, string caliber)
|
||||
{
|
||||
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.PipelineId == unitWorkId && e.Caliber == caliber);
|
||||
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == loginProjectId && e.FlowNum == flowingSection && e.PipelineId == unitWorkId && e.Material == material && e.Caliber == caliber);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -85,6 +85,8 @@ namespace BLL
|
||||
newPlan.CompletedCount = plan.CompletedCount;
|
||||
newPlan.CompletedRate = plan.CompletedRate;
|
||||
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
|
||||
newPlan.OnDayCompleteDyne = plan.OnDayCompleteDyne;
|
||||
newPlan.NextDayCompleteDyne = plan.NextDayCompleteDyne;
|
||||
try
|
||||
{
|
||||
db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
|
||||
@@ -122,5 +124,38 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程删除排产计划
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitWorkName"></param>
|
||||
public static void DeleteProductionSchedulingPlanByUnitWork(string projectId,string unitWorkName)
|
||||
{
|
||||
SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_ProductionSchedulingPlan where x.ProjectId == projectId && x.MainItemName == unitWorkName select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
db.HJGL_ProductionSchedulingPlan.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程、流水号删除排产计划
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitWorkName"></param>
|
||||
/// <param name="flowNum"></param>
|
||||
public static void DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(string projectId, string unitWorkName, string flowNum)
|
||||
{
|
||||
SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_ProductionSchedulingPlan where x.ProjectId == projectId && x.MainItemName == unitWorkName && x.FlowNum == flowNum select x).ToList();
|
||||
if (q.Count > 0)
|
||||
{
|
||||
db.HJGL_ProductionSchedulingPlan.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.SS.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -435,7 +437,7 @@ namespace BLL
|
||||
{
|
||||
foreach (var pipeline in oldPipeline)
|
||||
{
|
||||
DeletePipelineListByPTP_ID(pipeline.PTP_ID);
|
||||
DeletePipelineListByPTP_ID(pipeline.PTP_ID);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -455,5 +457,28 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddPipelineLists(List<Model.PTP_PipelineList> pipelineList)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
db.PTP_PipelineList.InsertAllOnSubmit(pipelineList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改试压包打印状态
|
||||
/// </summary>
|
||||
/// <param name="testPackage"></param>
|
||||
public static void UpdateTestPackagePrintState(Model.PTP_TestPackage testPackage)
|
||||
{
|
||||
Model.PTP_TestPackage newTestPackage = Funs.DB.PTP_TestPackage.FirstOrDefault(e => e.PTP_ID == testPackage.PTP_ID);
|
||||
if (newTestPackage != null)
|
||||
{
|
||||
newTestPackage.PrintState = testPackage.PrintState;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,13 +485,13 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(model.WeldJointCode))
|
||||
baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode));
|
||||
|
||||
return baseQuery.ToList() ;
|
||||
return baseQuery.ToList();
|
||||
}
|
||||
public static (List<Model.View_HJGL_WeldJoint> Data, int Total)GetDataBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20)
|
||||
public static (List<Model.View_HJGL_WeldJoint> Data, int Total) GetDataBymodel(Model.View_HJGL_WeldJoint model, int pageIndex = 0, int pageSize = 20)
|
||||
{
|
||||
// 阶段一:构建基础查询
|
||||
var baseQuery = Funs.DB.View_HJGL_WeldJoint.AsQueryable();
|
||||
|
||||
|
||||
// 阶段二:构建动态查询条件
|
||||
if (!string.IsNullOrEmpty(model.ProjectId))
|
||||
baseQuery = baseQuery.Where(x => x.ProjectId == model.ProjectId);
|
||||
@@ -500,16 +500,16 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(model.PipelineId))
|
||||
baseQuery = baseQuery.Where(x => x.PipelineId == model.PipelineId);
|
||||
if (!string.IsNullOrEmpty(model.PipelineCode))
|
||||
baseQuery = baseQuery.Where(x => x.PipelineCode .Contains(model.PipelineCode));
|
||||
baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(model.PipelineCode));
|
||||
if (!string.IsNullOrEmpty(model.WeldJointCode))
|
||||
baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains( model.WeldJointCode));
|
||||
|
||||
baseQuery = baseQuery.Where(x => x.WeldJointCode.Contains(model.WeldJointCode));
|
||||
|
||||
// 阶段三:排序与分页控制(索引优化关键)
|
||||
var orderedQuery = baseQuery.OrderBy(x=>x.PipelineId).ThenBy(x => x.WeldJointCode);
|
||||
var orderedQuery = baseQuery.OrderBy(x => x.PipelineId).ThenBy(x => x.WeldJointCode);
|
||||
|
||||
// 阶段四:分页执行(数据库层面分页)
|
||||
var pagedData = orderedQuery
|
||||
.Skip((pageIndex ) * pageSize)
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
|
||||
@@ -542,7 +542,7 @@ namespace BLL
|
||||
var pagedData = orderedQuery
|
||||
.Skip((pageIndex) * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToList();
|
||||
.ToList();
|
||||
|
||||
return pagedData;
|
||||
}
|
||||
@@ -629,5 +629,103 @@ namespace BLL
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程、流水号、材质、口径获取达因数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitWorkId">单位工程</param>
|
||||
/// <param name="flowingSection">流水段</param>
|
||||
/// <param name="steelType">材质</param>
|
||||
/// <param name="caliber">口径</param>
|
||||
/// <param name="type">1-总达因,2-完成总达因</param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber,string type)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
int c = 0;
|
||||
if (!string.IsNullOrEmpty(caliber))
|
||||
{
|
||||
c = Convert.ToInt32(caliber.Substring(1, caliber.Length - 1));
|
||||
var weldjoints = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
//&& Convert.ToInt32(x.DNDia.Substring(2, x.DNDia.Length - 2)) < c
|
||||
select x);
|
||||
|
||||
foreach (var item in weldjoints)
|
||||
{
|
||||
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
|
||||
if (caliber.Substring(0, 1) == "<" && s < c)
|
||||
{
|
||||
if (type == "1")
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (caliber.Substring(0, 1) == "≥" && s >= c)
|
||||
{
|
||||
if (type == "1")
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.WeldingDailyId))
|
||||
{
|
||||
sizeSum += item.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sizeSum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位工程、流水段获取总达因
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目id</param>
|
||||
/// <param name="unitWorkId">单位工程</param>
|
||||
/// <param name="flowingSection">流水段</param>
|
||||
/// <param name="type">1-总达因,2-完成总达因</param>
|
||||
/// <returns></returns>
|
||||
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection,string type)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
decimal? sizeSum = 0;
|
||||
if (type == "1")
|
||||
{
|
||||
sizeSum = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
select x.Size).Sum();
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeSum = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
|
||||
join z in db.Base_Material on y.MaterialId equals z.MaterialId
|
||||
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
|
||||
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
|
||||
&& x.WeldingDailyId != "" && x.WeldingDailyId != null
|
||||
select x.Size).Sum();
|
||||
}
|
||||
return sizeSum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,12 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getInPersonListData(string projectId, string unitId, string personName, string identityCard, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.SitePerson_Person> getInPersonList = getInPersonLists.Where(x => x.ProjectId == projectId);
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
|
||||
IQueryable<Model.SitePerson_Person> getInPersonList = from x in db.SitePerson_Person
|
||||
where x.States == Const.ProjectPersonStates_1
|
||||
select x;
|
||||
getInPersonList = getInPersonList.Where(x => x.ProjectId == projectId);
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
{
|
||||
if (unitId == "0")
|
||||
@@ -171,7 +176,7 @@ namespace BLL
|
||||
x.CardNo,
|
||||
x.PersonName,
|
||||
x.UnitId,
|
||||
Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName,
|
||||
db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName,
|
||||
x.IdentityCard,
|
||||
IsInName = "",
|
||||
InOuDate = DateTime.Now.ToShortDateString(),
|
||||
@@ -194,7 +199,7 @@ namespace BLL
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_PersonInOutNow> getNowPersonLists = from x in Funs.DB.SitePerson_PersonInOutNow
|
||||
select x;
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
@@ -204,7 +209,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getNowPersonListData(string projectId, string unitId, string workPostId, string personName, string identityCard, DateTime dateValue, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.SitePerson_PersonInOutNow> getDayAll = getNowPersonLists.Where(x=>x.ProjectId == projectId
|
||||
IQueryable<Model.SitePerson_PersonInOutNow> getDayAll = getNowPersonLists.Where(x => x.ProjectId == projectId
|
||||
&& x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
|
||||
&& x.ChangeTime.Value.Day == dateValue.Day);
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
@@ -230,7 +235,7 @@ namespace BLL
|
||||
group x by x.PersonId into g
|
||||
select new
|
||||
{
|
||||
ProjectId = g.First().ProjectId,
|
||||
ProjectId = g.First().ProjectId,
|
||||
PersonId = g.First().PersonId,
|
||||
personName = g.First().PersonName,
|
||||
identityCard = g.First().IdentityCard,
|
||||
@@ -260,18 +265,18 @@ namespace BLL
|
||||
x.PersonId,
|
||||
x.personName,
|
||||
x.identityCard,
|
||||
CardNo =Funs.DB.SitePerson_Person.First(p=>p.PersonId == x.PersonId && p.ProjectId ==x.ProjectId).CardNo,
|
||||
CardNo = Funs.DB.SitePerson_Person.First(p => p.PersonId == x.PersonId && p.ProjectId == x.ProjectId).CardNo,
|
||||
x.UnitName,
|
||||
x.UnitId,
|
||||
x.WorkPostId,
|
||||
x.WorkPostName,
|
||||
TeamGroupName=TeamGroupService.GetTeamGroupNameByPersonId(x.ProjectId,x.PersonId),
|
||||
TeamGroupName = TeamGroupService.GetTeamGroupNameByPersonId(x.ProjectId, x.PersonId),
|
||||
x.ChangeTime,
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
inCount =0;
|
||||
inCount = 0;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -739,7 +744,7 @@ namespace BLL
|
||||
var getSitePerson = GetSitePersonByProjectIdPersonId(projectId, personId);
|
||||
if (getSitePerson != null && string.IsNullOrEmpty(getSitePerson.CardNo))
|
||||
{
|
||||
cardNo= SendCarNobySiteperson(getSitePerson.SitePersonId);
|
||||
cardNo = SendCarNobySiteperson(getSitePerson.SitePersonId);
|
||||
}
|
||||
|
||||
return cardNo;
|
||||
@@ -754,13 +759,13 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string carNo = string.Empty;
|
||||
string carNo = string.Empty;
|
||||
var item = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId);
|
||||
if (item != null)
|
||||
{
|
||||
bool isok = false;
|
||||
int getPassScores = SysConstSetService.getPassScore();
|
||||
var getTestT = db.Training_TestRecord.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.TestScores >= getPassScores && x.TestManId==item.PersonId);
|
||||
var getTestT = db.Training_TestRecord.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.TestScores >= getPassScores && x.TestManId == item.PersonId);
|
||||
if (getTestT != null)
|
||||
{
|
||||
isok = true;
|
||||
@@ -776,7 +781,7 @@ namespace BLL
|
||||
isok = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isok) ////参加过培训的人员
|
||||
{
|
||||
string prefix = UnitService.GetUnitCodeByUnitId(item.UnitId) + "-";
|
||||
@@ -839,6 +844,7 @@ namespace BLL
|
||||
Isprint = "0",
|
||||
States = person.States,
|
||||
IsSafetyMonitoring = person.IsSafetyMonitoring,
|
||||
IsCQMSCheck=person.IsCQMSCheck,
|
||||
};
|
||||
|
||||
if (newPerson.WorkPostId == Const.WorkPost_Welder)
|
||||
@@ -920,6 +926,7 @@ namespace BLL
|
||||
setPersonItemInOut = true;
|
||||
}
|
||||
newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring;
|
||||
newPerson.IsCQMSCheck = person.IsCQMSCheck;
|
||||
db.SubmitChanges();
|
||||
|
||||
if (!setPersonItemInOut)
|
||||
@@ -931,7 +938,7 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDatePItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.ProjectId == person.ProjectId && x.IdentityCard == person.IdentityCard && x.OutTime .HasValue && x.OutTime < person.InTime);
|
||||
var getDatePItem = db.SitePerson_PersonItem.FirstOrDefault(x => x.ProjectId == person.ProjectId && x.IdentityCard == person.IdentityCard && x.OutTime.HasValue && x.OutTime < person.InTime);
|
||||
if (getDatePItem != null)
|
||||
{
|
||||
setPersonItemInOut = true;
|
||||
@@ -949,13 +956,13 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (setPersonItemInOut)
|
||||
{
|
||||
{
|
||||
////现场人员项目出入场记录
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson,newlog);
|
||||
SitePerson_PersonItemService.SetPersonItemInOut(newPerson, newlog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1096,7 +1103,7 @@ namespace BLL
|
||||
info += "卡号应为单位代码+'-'+五位流水号!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string personId, Grid Grid1)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
IQueryable<Model.Person_PersonTrain> getDataLists = from x in Funs.DB.Person_PersonTrain
|
||||
select x;
|
||||
IQueryable<Model.Person_PersonTrain> getDataList = getDataLists.Where(x => x.PersonId == personId);
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
@@ -45,7 +48,7 @@ namespace BLL
|
||||
x.PersonTrainId,
|
||||
x.PersonId,
|
||||
x.TrainTypeId,
|
||||
Funs.DB.Base_TrainType.First(u => u.TrainTypeId == x.TrainTypeId).TrainTypeName,
|
||||
db.Base_TrainType.First(u => u.TrainTypeId == x.TrainTypeId).TrainTypeName,
|
||||
x.TrainDate,
|
||||
x.TrainPlace,
|
||||
x.TrainResult,
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
UnitId = x.UnitId,
|
||||
Year = x.Year,
|
||||
Month = x.Month,
|
||||
FillingMan = x.FillingMan,
|
||||
FillingMan = x.FillingMan + "|" + (x.KeyWorkNum ?? 0).ToString() + "|" + (x.KeyWorkOKNum ?? 0).ToString() + "|" + (x.KeyWorkOKRate ?? ""),
|
||||
FillingDate = x.FillingDate,
|
||||
DutyPerson = x.DutyPerson,
|
||||
RecordableIncidentRate = x.RecordableIncidentRate,
|
||||
@@ -1679,6 +1679,9 @@
|
||||
Quarter = x.Quarter,
|
||||
YearId = x.YearId,
|
||||
CompileMan = x.CompileMan,
|
||||
KeyWorkNum = x.KeyWorkNum,
|
||||
KeyWorkOKNum = x.KeyWorkOKNum,
|
||||
KeyWorkOKRate = x.KeyWorkOKRate,
|
||||
};
|
||||
|
||||
var upReportItem = from x in db.Information_ActionWorkLedgerItem
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace BLL
|
||||
from projectType in projectTypeJoin.DefaultIfEmpty()
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where project.ProjectState == "1"
|
||||
where project.ProjectState == "1" && project.MasterSysId != null
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace BLL
|
||||
public static class CQMSDataService
|
||||
{
|
||||
public static SGGLDB db = Funs.DB;
|
||||
public static List<string> BeUnderConstructionList = ProjectService.GetProjectWorkList().Select(x => x.ProjectId).ToList();
|
||||
public static List<string> BeUnderConstructionList = BaseDataService.BeUnderConstructionList;
|
||||
|
||||
#region 获取列表
|
||||
|
||||
@@ -592,6 +592,7 @@ namespace BLL
|
||||
var subdivisionalWorksNuTask = CQMSDataService.GetSubdivisionalWorksNumAsync(); //获取分项工程个数
|
||||
var inspectionLotNumTask = CQMSDataService.GetInspectionLotNumAsync(); //获取检验批个数
|
||||
var constructSolutionTask = CQMSDataService.GetConstructSolutionAsync(); //施工方案数量
|
||||
var comprehensiveMajorPlanTask = CQMSDataService.GetComprehensive_MajorPlanApprovalAsync(); //危大工程、超危大工程施工方案数量
|
||||
var cqmsProblemTask = CQMSDataService.GetCQMSProblemAsync(); //获取企业级、项目级质量问题
|
||||
var cqmsBranchMajorCheckTask = CQMSDataService.GetBranchMajorCheckAsync(); //获取分支机构质量大检查次数
|
||||
var cqmsCompanyMajorCheckTask = CQMSDataService.GetCompanyMajorCheckAsync(); //获取企业质量大检查次数
|
||||
@@ -621,7 +622,7 @@ namespace BLL
|
||||
inspectionEquipmentTask, inspectionPersonTask, inspectionMachineTask,
|
||||
useNumTask, okNumTask,
|
||||
singleProjectNumTask, unitProjectNumTask, subProjectNuTask, subdivisionalWorksNuTask, inspectionLotNumTask,
|
||||
constructSolutionTask,
|
||||
constructSolutionTask, comprehensiveMajorPlanTask,
|
||||
cqmsProblemTask, cqmsBranchMajorCheckTask, cqmsCompanyMajorCheckTask,
|
||||
keyProcessNumTask, keyProcessOKNumTask, specialProcessNumTask, specialProcessOKNumTask, concealedWorksNumTask, concealedWorksOKNumTask,
|
||||
unitProjectAcceptNumTask, unitProjectAcceptOKNumTask, subProjectAcceptNumTask, subProjectAcceptOKNumTask, subdivisionalWorksAcceptNumTask, subdivisionalWorksAcceptOKNumTask,
|
||||
@@ -651,6 +652,7 @@ namespace BLL
|
||||
var inspectionLotNum = await inspectionLotNumTask;
|
||||
|
||||
var constructSolutionList = await constructSolutionTask;
|
||||
var comprehensiveMajorPlanList = await comprehensiveMajorPlanTask;
|
||||
var cqmsProblemList = await cqmsProblemTask;
|
||||
var cqmsBranchMajorCheckList = await cqmsBranchMajorCheckTask;
|
||||
var cqmsCompanyMajorCheckList = await cqmsCompanyMajorCheckTask;
|
||||
@@ -692,7 +694,7 @@ namespace BLL
|
||||
EquipmentInspectionNum = inspectionEquipmentList.Count(),
|
||||
EquipmentInspectionQualifiedNum = inspectionEquipmentList.Count(),
|
||||
PersonInspectionNum = inspectionPersonList.Count(),
|
||||
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true).Count(),
|
||||
PersonInspectionQualifiedNum = inspectionPersonList.Count(),
|
||||
MachineInspectionNum = inspectionMachineList.Count(),
|
||||
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true).Count(),
|
||||
|
||||
@@ -708,9 +710,9 @@ namespace BLL
|
||||
|
||||
ConstructSolutionNum = constructSolutionList.Count(),
|
||||
ConstructSolutionProjectApproveNum = constructSolutionList.Where(x => x.State == "1").Count(),
|
||||
ConstructSolutionUnitApproveNum = 0,//
|
||||
ConstructSolutionUnitApproveNum = comprehensiveMajorPlanList.Count(),
|
||||
SpecialEquipmentQualityAssuranceSystemNum = qualityAssuranceNum.Count(),
|
||||
DesignDetailsNum = technicalDisclosePersonList.Sum(x => x.TrainPersonNum),
|
||||
DesignDetailsNum = technicalDisclosePersonList.Count(),
|
||||
|
||||
ProblemNum = cqmsProblemList.Count(),
|
||||
ProblemCompletedNum = cqmsProblemList.Where(x => x.State == "7").Count(),
|
||||
@@ -765,7 +767,7 @@ namespace BLL
|
||||
EquipmentInspectionNum = inspectionEquipmentList.Count(x => x.ProjectId == projectid),
|
||||
EquipmentInspectionQualifiedNum = inspectionEquipmentList.Where(x => x.ProjectId == projectid).Count(),
|
||||
PersonInspectionNum = inspectionPersonList.Count(x => x.ProjectId == projectid),
|
||||
PersonInspectionQualifiedNum = inspectionPersonList.Where(x => x.IsOnSite.HasValue && x.IsOnSite == true && x.ProjectId == projectid).Count(),
|
||||
PersonInspectionQualifiedNum = inspectionPersonList.Count(x => x.ProjectId == projectid),
|
||||
MachineInspectionNum = inspectionMachineList.Count(x => x.ProjectId == projectid),
|
||||
MachineInspectionQualifiedNum = inspectionMachineList.Where(x => x.IsCheckCertificate == true && x.ProjectId == projectid).Count(),
|
||||
MaterialInspectionNum = 0,
|
||||
@@ -780,9 +782,9 @@ namespace BLL
|
||||
|
||||
ConstructSolutionNum = constructSolutionList.Count(x => x.ProjectId == projectid),
|
||||
ConstructSolutionProjectApproveNum = constructSolutionList.Where(x => x.State == "1" && x.ProjectId == projectid).Count(),
|
||||
ConstructSolutionUnitApproveNum = 0,//
|
||||
ConstructSolutionUnitApproveNum = comprehensiveMajorPlanList.Count(x => x.ProjectId == projectid),
|
||||
SpecialEquipmentQualityAssuranceSystemNum = qualityAssuranceNum.Count(x => x.ProjectId == projectid),
|
||||
DesignDetailsNum = technicalDisclosePersonList.Where(x => x.ProjectId == projectid).Sum(x => x.TrainPersonNum),
|
||||
DesignDetailsNum = technicalDisclosePersonList.Where(x => x.ProjectId == projectid).Count(),
|
||||
|
||||
ProblemNum = cqmsProblemList.Count(x => x.ProjectId == projectid),
|
||||
ProblemCompletedNum = cqmsProblemList.Where(x => x.State == "7" && x.ProjectId == projectid).Count(),
|
||||
@@ -1158,7 +1160,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.EduTrainOutput> GetTechnicalDisclosePerson()
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_DesignDetails
|
||||
var result = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure
|
||||
join p in Funs.DB.Base_Project on x.ProjectId equals p.ProjectId into pGroup
|
||||
from p in pGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId) && x.CompileDate > Const.DtmarkTime
|
||||
@@ -1167,11 +1169,11 @@ namespace BLL
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectName = p.ProjectName,
|
||||
UnitName = "",
|
||||
Id = x.DesignDetailsId,
|
||||
Id = x.ConTechnologyDisclosureId,
|
||||
TrainTitle = "",
|
||||
TrainStartDate = null,
|
||||
TrainEndDate = null,
|
||||
TrainPersonNum = x.JoinPersonNum ?? 0,
|
||||
TrainPersonNum = x.DisclosurePersonNum ?? 0,
|
||||
}).ToList();
|
||||
return result;
|
||||
}
|
||||
@@ -1210,10 +1212,10 @@ namespace BLL
|
||||
/// 获取人员报验
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Comprehensive_InspectionPerson> GetComprehensive_InspectionPerson()
|
||||
public static List<Model.SitePerson_Person> GetComprehensive_InspectionPerson()
|
||||
{
|
||||
var result = (from x in Funs.DB.Comprehensive_InspectionPerson
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.CompileDate > Const.DtmarkTime
|
||||
var result = (from x in Funs.DB.SitePerson_Person
|
||||
where BeUnderConstructionList.Contains(x.ProjectId) && x.IsCQMSCheck.HasValue && x.IsCQMSCheck == true
|
||||
select x).ToList();
|
||||
return result;
|
||||
}
|
||||
@@ -1222,7 +1224,7 @@ namespace BLL
|
||||
/// 获取人员报验(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Comprehensive_InspectionPerson>> GetComprehensive_InspectionPersonAsync()
|
||||
public static async Task<List<SitePerson_Person>> GetComprehensive_InspectionPersonAsync()
|
||||
{
|
||||
return await Task.Run(GetComprehensive_InspectionPerson);
|
||||
}
|
||||
@@ -1423,6 +1425,26 @@ namespace BLL
|
||||
return await Task.Run(GetConstructSolution);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 危大(超危大)工程施工方案数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Solution_LargerHazard> GetComprehensive_MajorPlanApproval()
|
||||
{
|
||||
var result = (from x in Funs.DB.Solution_LargerHazard
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
select x).ToList();
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 危大(超危大)工程施工方案数量(异步)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static async Task<List<Solution_LargerHazard>> GetComprehensive_MajorPlanApprovalAsync()
|
||||
{
|
||||
return await Task.Run(GetComprehensive_MajorPlanApproval);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工技术交底
|
||||
/// </summary>
|
||||
|
||||
@@ -2988,7 +2988,7 @@ namespace BLL
|
||||
from projectType in projectTypeJoin.DefaultIfEmpty()
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = "", GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where project.ProjectState == "1"
|
||||
where project.ProjectState == "1" && project.MasterSysId != null
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -3050,7 +3050,7 @@ namespace BLL
|
||||
ConstructionMoney = project.ConstructionMoney,
|
||||
ProjectStateName = project.ProjectState == BLL.Const.ProjectState_2 ? "暂停中" : (project.ProjectState == BLL.Const.ProjectState_3 ? "已完工" : "施工中"),
|
||||
ProjectState = project.ProjectState,
|
||||
ProjectAttributeName = "工程",
|
||||
ProjectAttributeName = "工程",
|
||||
ProjectMoney = project.ProjectMoney,
|
||||
DayCount = DateTime.Now.Subtract(project.StartDate.Value).Days,
|
||||
ProjectTypeName = projectType.ProjectTypeName,
|
||||
@@ -4016,7 +4016,7 @@ namespace BLL
|
||||
from y in yGroup.DefaultIfEmpty()
|
||||
join z in Funs.DB.Base_RiskLevel on y.HazardLevel equals z.RiskLevelId into zGroup
|
||||
from z in zGroup.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
where BeUnderConstructionList.Contains(x.ProjectId)
|
||||
group new { y, z } by new { x.ProjectId, x.ProjectName, x.ProjectCode } into gg
|
||||
select new SecurityRiskOutput
|
||||
{
|
||||
@@ -4063,6 +4063,8 @@ namespace BLL
|
||||
SuperConstructionNum = gg.Count(x => x.States == "2" && x.IsSuperLargerHazard == true),
|
||||
SuperFinishedNum = gg.Count(x => x.States == "3" && x.IsSuperLargerHazard == true),
|
||||
SuperArgumentNum = gg.Count(x => x.IsArgument == true && x.IsSuperLargerHazard == true),
|
||||
OperativesNum = gg.Where(x => x.IsSuperLargerHazard == false).Sum(x => x.OperativesNum) ?? 0,
|
||||
SuperOperativesNum = gg.Where(x => x.IsSuperLargerHazard == true).Sum(x => x.OperativesNum) ?? 0,
|
||||
}).ToList();
|
||||
return query;
|
||||
|
||||
@@ -4232,7 +4234,7 @@ namespace BLL
|
||||
from bc in bcGroup.DefaultIfEmpty()
|
||||
join su1 in Funs.DB.Person_Persons on q.AuditorId equals su1.PersonId into su1Group
|
||||
from su1 in su1Group.DefaultIfEmpty()
|
||||
where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2
|
||||
where BeUnderConstructionList.Contains(p.ProjectId) && m.PostType == Const.PostType_2
|
||||
select new Model.OfSafetySupervisorsOutput
|
||||
{
|
||||
ProjectId = p.ProjectId,
|
||||
|
||||
@@ -81,6 +81,9 @@ namespace BLL
|
||||
newActionWorkLedger.UpState = ActionWorkLedger.UpState;
|
||||
newActionWorkLedger.HandleState = ActionWorkLedger.HandleState;
|
||||
newActionWorkLedger.HandleMan = ActionWorkLedger.HandleMan;
|
||||
newActionWorkLedger.KeyWorkNum = ActionWorkLedger.KeyWorkNum;
|
||||
newActionWorkLedger.KeyWorkOKNum = ActionWorkLedger.KeyWorkOKNum;
|
||||
newActionWorkLedger.KeyWorkOKRate = ActionWorkLedger.KeyWorkOKRate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace BLL
|
||||
BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum,
|
||||
ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum,
|
||||
RTLicenseNum = MillionsMonthlyReport.RTLicenseNum,
|
||||
KeyWorkNum = MillionsMonthlyReport.KeyWorkNum,
|
||||
KeyWorkOKNum = MillionsMonthlyReport.KeyWorkOKNum,
|
||||
KeyWorkOKRate = MillionsMonthlyReport.KeyWorkOKRate,
|
||||
NightLicenseNum = MillionsMonthlyReport.NightLicenseNum,
|
||||
CommissionerNum = MillionsMonthlyReport.CommissionerNum,
|
||||
SoleDutyNum = MillionsMonthlyReport.SoleDutyNum,
|
||||
@@ -120,6 +123,9 @@ namespace BLL
|
||||
newMillionsMonthlyReport.NightLicenseNum = MillionsMonthlyReport.NightLicenseNum;
|
||||
newMillionsMonthlyReport.CommissionerNum = MillionsMonthlyReport.CommissionerNum;
|
||||
newMillionsMonthlyReport.SoleDutyNum = MillionsMonthlyReport.SoleDutyNum;
|
||||
newMillionsMonthlyReport.KeyWorkNum = MillionsMonthlyReport.KeyWorkNum;
|
||||
newMillionsMonthlyReport.KeyWorkOKNum = MillionsMonthlyReport.KeyWorkOKNum;
|
||||
newMillionsMonthlyReport.KeyWorkOKRate = MillionsMonthlyReport.KeyWorkOKRate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user