提交代码
This commit is contained in:
@@ -3451,6 +3451,10 @@ namespace BLL
|
||||
/// 公司平均工效统计模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string CompanyConstructionLogWorkEfficiencyTemplateUrl = "File\\Excel\\ConstructionLog\\公司平均工效统计.xlsx";
|
||||
/// <summary>
|
||||
/// 焊口二次设计信息模板文件原始虚拟路径
|
||||
/// </summary>
|
||||
public const string JotTwoDesignTemplateUrl = "File\\Excel\\DataOut\\焊口二次设计信息.xlsx";
|
||||
#endregion
|
||||
|
||||
#region 初始化上传路径
|
||||
|
||||
@@ -65,10 +65,10 @@ namespace BLL
|
||||
/// <param name="welderId"></param>
|
||||
/// <param name="welderCode"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExisWelderCode(string welderId, string welderCode)
|
||||
public static bool IsExisWelderCode(string welderId, string welderCode, string projectId)
|
||||
{
|
||||
bool isExitCode = false;
|
||||
var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId select x;
|
||||
var q = from x in Funs.DB.SitePerson_Person where x.WelderCode == welderCode && x.PersonId != welderId && x.ProjectId == projectId select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
isExitCode = true;
|
||||
|
||||
@@ -100,31 +100,31 @@ namespace BLL
|
||||
{
|
||||
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
|
||||
|
||||
if (newWeldJoint != null )
|
||||
if (newWeldJoint != null)
|
||||
{
|
||||
var isTrust = from x in Funs.DB.HJGL_Batch_BatchTrustItem
|
||||
where x.WeldJointId == weldJointId
|
||||
select x; ;
|
||||
if (!isTrust.Any())
|
||||
{
|
||||
var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x;
|
||||
string pointBatchId = pointBatchItems.FirstOrDefault()?.PointBatchId;
|
||||
{
|
||||
var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x;
|
||||
string pointBatchId = pointBatchItems.FirstOrDefault()?.PointBatchId;
|
||||
|
||||
// 删除焊口所在批明细信息
|
||||
BLL.PointBatchDetailService.DeleteBatchDetail(weldJointId);
|
||||
// 删除焊口所在批明细信息
|
||||
BLL.PointBatchDetailService.DeleteBatchDetail(weldJointId);
|
||||
|
||||
// 删除批信息
|
||||
var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x;
|
||||
if (!string.IsNullOrEmpty(pointBatchId) && !batch.Any())
|
||||
{
|
||||
DeleteBatch(pointBatchId);
|
||||
}
|
||||
//BLL.Batch_NDEItemService.DeleteAllNDEInfoToWeldJoint(item.WeldJointId);
|
||||
|
||||
// 删除批信息
|
||||
var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x;
|
||||
if (!string .IsNullOrEmpty(pointBatchId) && !batch.Any())
|
||||
{
|
||||
DeleteBatch(pointBatchId);
|
||||
}
|
||||
//BLL.Batch_NDEItemService.DeleteAllNDEInfoToWeldJoint(item.WeldJointId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// errlog += "焊口【" + newWeldJoint.WeldJointCode + "】已进委托单了,不能删除。";
|
||||
// errlog += "焊口【" + newWeldJoint.WeldJointCode + "】已进委托单了,不能删除。";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ namespace BLL
|
||||
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
|
||||
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(pipeline.ProjectId);
|
||||
var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(pipeline.UnitWorkId);
|
||||
var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(pipeline.UnitWorkId);
|
||||
var WeldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(newWeldJoint.WeldingDailyId);
|
||||
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(pipeline.DetectionType);
|
||||
var ndtr = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId);
|
||||
@@ -236,8 +236,33 @@ namespace BLL
|
||||
batch.PointBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_PointBatch));
|
||||
batchId = batch.PointBatchId;
|
||||
string perfix = project.ProjectCode + "-" + unitWork.UnitWorkCode + "-GD-DK-" + ndt.DetectionTypeCode + "-" + ndtr.DetectionRateValue.ToString() + "%-";
|
||||
batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix);
|
||||
|
||||
//batch.PointBatchCode = BLL.SQLHelper.RunProcNewIdByProjectId("SpGetNewCode4ByProjectId", "dbo.HJGL_Batch_PointBatch", "PointBatchCode", project.ProjectId, perfix);
|
||||
var maxBatch = (from x in Funs.DB.HJGL_Batch_PointBatch where x.ProjectId == project.ProjectId && x.PointBatchCode.Contains(perfix) select x).FirstOrDefault();
|
||||
if (maxBatch == null)
|
||||
{
|
||||
batch.PointBatchCode = perfix + "0001";
|
||||
}
|
||||
else
|
||||
{
|
||||
int code = Funs.GetNewIntOrZero(maxBatch.PointBatchCode.Substring(maxBatch.PointBatchCode.Length - 4));
|
||||
code = code + 1;
|
||||
if (code < 10)
|
||||
{
|
||||
batch.PointBatchCode = perfix + "000" + code.ToString();
|
||||
}
|
||||
else if (code >= 10 && code < 100)
|
||||
{
|
||||
batch.PointBatchCode = perfix + "00" + code.ToString();
|
||||
}
|
||||
else if (code >= 100 && code < 1000)
|
||||
{
|
||||
batch.PointBatchCode = perfix + "0" + code.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
batch.PointBatchCode = perfix + code.ToString();
|
||||
}
|
||||
}
|
||||
batch.ProjectId = project.ProjectId;
|
||||
batch.UnitWorkId = pipeline.UnitWorkId;
|
||||
batch.BatchCondition = batchCondition;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace BLL
|
||||
{
|
||||
public static class WeldJointService
|
||||
{
|
||||
public static List<Model.HJGL_WeldJoint> hJGL_WeldJoints
|
||||
public static List<Model.HJGL_WeldJoint> hJGL_WeldJoints
|
||||
{
|
||||
|
||||
get;
|
||||
@@ -66,14 +66,14 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.HJGL_WeldJoint> GetWeldJointsByPipelineId(string PipelineId)
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId select x).ToList();
|
||||
var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
public static Model.HJGL_WeldJoint GetWeldJointsByWeldJointCode(string PipelineId, string WeldJointCode)
|
||||
{
|
||||
var q=(from x in Funs.DB.HJGL_WeldJoint where x.PipelineId==PipelineId && x.WeldJointCode==WeldJointCode select x ).FirstOrDefault();
|
||||
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId && x.WeldJointCode == WeldJointCode select x).FirstOrDefault();
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ namespace BLL
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_WeldJoint newWeldJoint = new Model.HJGL_WeldJoint
|
||||
{
|
||||
WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint)),
|
||||
ProjectId = weldJoint.ProjectId,
|
||||
PipelineId = weldJoint.PipelineId,
|
||||
PipelineCode = weldJoint.PipelineCode,
|
||||
@@ -97,7 +96,7 @@ namespace BLL
|
||||
Material2Id = weldJoint.Material2Id,
|
||||
Thickness = weldJoint.Thickness,
|
||||
Dia = weldJoint.Dia,
|
||||
DNDia=weldJoint.DNDia,
|
||||
DNDia = weldJoint.DNDia,
|
||||
Size = weldJoint.Size,
|
||||
DetectionTypeId = weldJoint.DetectionTypeId,
|
||||
JointArea = weldJoint.JointArea,
|
||||
@@ -120,9 +119,16 @@ namespace BLL
|
||||
Remark = weldJoint.Remark,
|
||||
IsTwoJoint = weldJoint.IsTwoJoint,
|
||||
SubmitMan = weldJoint.SubmitMan,
|
||||
TwoJointType=weldJoint.TwoJointType
|
||||
TwoJointType = weldJoint.TwoJointType
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(weldJoint.WeldJointId))
|
||||
{
|
||||
newWeldJoint.WeldJointId = weldJoint.WeldJointId;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWeldJoint.WeldJointId = SQLHelper.GetNewID(typeof(Model.HJGL_WeldJoint));
|
||||
}
|
||||
db.HJGL_WeldJoint.InsertOnSubmit(newWeldJoint);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -285,7 +291,7 @@ namespace BLL
|
||||
public static void DeleteWeldJointByPipelineId(string pipelineId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var weldline = db.HJGL_WeldJoint.Where(e => e.PipelineId == pipelineId);
|
||||
var weldline = db.HJGL_WeldJoint.Where(e => e.PipelineId == pipelineId);
|
||||
if (weldline != null)
|
||||
{
|
||||
db.HJGL_WeldJoint.DeleteAllOnSubmit(weldline);
|
||||
@@ -297,7 +303,7 @@ namespace BLL
|
||||
/// 根据unitworkid删除焊口
|
||||
/// </summary>
|
||||
/// <param name="unitworkId"></param>
|
||||
public static void DeleteWeldJointByUnitWorkId(string unitworkId)
|
||||
public static void DeleteWeldJointByUnitWorkId(string unitworkId)
|
||||
{
|
||||
var oldPipeline = BLL.PipelineService.GetPipelinesByUnitWordId(unitworkId);
|
||||
if (oldPipeline != null)
|
||||
@@ -353,14 +359,14 @@ namespace BLL
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId into tt
|
||||
from g in tt.DefaultIfEmpty()
|
||||
where g.UnitWorkId == UnitWorkId
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId into tt
|
||||
from g in tt.DefaultIfEmpty()
|
||||
where g.UnitWorkId == UnitWorkId
|
||||
select x).ToList();
|
||||
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HJGL_WeldJoint> GetWeldJointByProjectid(string ProjectId)
|
||||
public static List<Model.HJGL_WeldJoint> GetWeldJointByProjectid(string ProjectId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
|
||||
@@ -368,7 +374,7 @@ namespace BLL
|
||||
where x.ProjectId == ProjectId
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊口Id获取插入焊口数
|
||||
@@ -445,13 +451,14 @@ namespace BLL
|
||||
public static List<Model.View_HJGL_WeldJoint> GetViewWeldJointsBymodel(Model.View_HJGL_WeldJoint model)
|
||||
{
|
||||
var q = (from x in Funs.DB.View_HJGL_WeldJoint
|
||||
where
|
||||
where
|
||||
(string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId))
|
||||
&& (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId))
|
||||
&& (string.IsNullOrEmpty(model.PipelineId) || x.PipelineId.Contains(model.PipelineId))
|
||||
&& (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode))
|
||||
&& (string.IsNullOrEmpty(model.WeldJointCode) || x.WeldJointCode.Contains(model.WeldJointCode))
|
||||
orderby x.WeldJointCode select x).AsParallel().ToList();
|
||||
orderby x.WeldJointCode
|
||||
select x).AsParallel().ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user