提交代码
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user