代码无效引用清理,试压包资料界面看板修改

This commit is contained in:
2025-10-10 14:33:21 +08:00
parent 87fb529521
commit 55b798135c
933 changed files with 5897 additions and 7541 deletions
+10 -13
View File
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIHJGLIndexService
public class APIHJGLIndexService
{
public static Model.HJGLIndexItem GetJGLIndexItem(string projectid)
{
@@ -37,7 +33,8 @@ namespace BLL
UnitWorkName = z.UnitWorkName,
MaterialCode = z.MaterialCode
}).ToList();
var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new {
var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new
{
JointAttribute = x.Key,
Current_pass_film = x.Sum(m => m.CHT_PassFilm) ?? 0,
Cht_totalfilm = x.Sum(m => m.CHT_TotalFilm) ?? 0
@@ -46,16 +43,16 @@ namespace BLL
var XC_model = tb_type06.Where(x => x.JointAttribute == "安装口").FirstOrDefault();
double PassRate1 = 0;
double PassRate2 = 0;
if (GC_model!=null &&GC_model.Cht_totalfilm>0)
if (GC_model != null && GC_model.Cht_totalfilm > 0)
{
PassRate1 = Math.Round((100 * GC_model.Current_pass_film * 1.0) / GC_model.Cht_totalfilm, 1);
}
if (XC_model!=null&& XC_model.Cht_totalfilm > 0)
if (XC_model != null && XC_model.Cht_totalfilm > 0)
{
PassRate2 = Math.Round((100 * XC_model.Current_pass_film * 1.0) / XC_model.Cht_totalfilm, 1);
}
hJGLIndexItem.GCFirstPassRate = PassRate1.ToString()+" %";
hJGLIndexItem.XCFirstPassRate = PassRate2.ToString()+" %";
hJGLIndexItem.GCFirstPassRate = PassRate1.ToString() + " %";
hJGLIndexItem.XCFirstPassRate = PassRate2.ToString() + " %";
hJGLIndexItem.GCProgress = BLL.HJGL_WeldingReportService.GetGCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 1).ToString() + " DIN";
hJGLIndexItem.XCProgress = BLL.HJGL_WeldingReportService.GetXCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 2).ToString() + " DIN";
@@ -66,12 +63,12 @@ namespace BLL
}
else
{
hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString()+" %";
hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString() + " %";
}
hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString()+" DIN/天";
hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString()+" DIN/天";
hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString() + " DIN/天";
hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString() + " DIN/天";
return hJGLIndexItem;
}
+10 -11
View File
@@ -1,5 +1,4 @@
using FineUIPro;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -263,13 +262,13 @@ namespace BLL
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public static string ManualPointSave(string weldJointId)
public static string ManualPointSave(string weldJointId)
{
string res = "";
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var PointBatchItemModel = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.WeldJointId == weldJointId);
var PointBatchId= PointBatchItemModel.PointBatchId;
var PointBatchId = PointBatchItemModel.PointBatchId;
var batch = BLL.PointBatchService.GetPointBatchById(PointBatchId);
if (!batch.EndDate.HasValue)
{
@@ -290,7 +289,7 @@ namespace BLL
where z.PointBatchId == PointBatchId
select x).FirstOrDefault();
if (pipeline != null)
{
{
Model.Base_DetectionRate rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId);
if (rate != null)
{
@@ -310,13 +309,13 @@ namespace BLL
select x).Count();
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
res = "安装口已达检测标准,无需再点此安装口!";
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
res = "预制口已达检测标准,无需再点此预制口!";
return res;
return res;
}
}
}
@@ -354,7 +353,7 @@ namespace BLL
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
return res;
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
@@ -365,7 +364,7 @@ namespace BLL
}
}
PointBatchDetailService.UpdatePointBatchDetail(PointBatchItemModel.PointBatchItemId, "1", System.DateTime.Now);
}
else
@@ -375,7 +374,7 @@ namespace BLL
}
return res;
}
}
#region
/// <summary>
/// 点口调整
+80 -46
View File
@@ -1,43 +1,40 @@
using System;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIPackagingManageService
public class APIPackagingManageService
{
public static List<Model.PackagingManageDetailItem> GetPackagingManageList(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.HJGL_PackagingManage
join n in db.Base_Project on x.ProjectId equals n.ProjectId
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
from t in tt.DefaultIfEmpty()
where x.ProjectId == projectId
select new PackagingManageDetailItem
{
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State= x.State,
ReceiveMan=t.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
TrainNumber=x.TrainNumber,
}).Distinct();
join n in db.Base_Project on x.ProjectId equals n.ProjectId
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt
from t in tt.DefaultIfEmpty()
where x.ProjectId == projectId
select new PackagingManageDetailItem
{
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State = x.State,
ReceiveMan = t.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
TrainNumber = x.TrainNumber,
}).Distinct();
return q.ToList();
}
}
public static Model.PackagingManageItem GetPackagingInformationById(string projectId,string personId, string packagingManageId)
public static Model.PackagingManageItem GetPackagingInformationById(string projectId, string personId, string packagingManageId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
@@ -54,41 +51,41 @@ namespace BLL
PackagingManageId = x.PackagingManageId,
PackagingCode = x.PackagingCode,
ProjectName = n.ProjectName,
ProjectId = x.ProjectId,
ProjectId = x.ProjectId,
ContactName = x.ContactName,
ContactPhone = x.ContactPhone,
StackingPosition = x.StackingPosition,
State =x.State,
State = x.State,
ReceiveMan = t.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
TrainNumber = x.TrainNumber,
}).FirstOrDefault();
var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId==packagingManageId select x ).FirstOrDefault() ;
var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId == packagingManageId select x).FirstOrDefault();
var PipelineComponentIdList = tb_packing?.PipelineComponentId?.Split(',');
if (PipelineComponentIdList != null && PipelineComponentIdList.Count() > 0)
{
packagingPrepipeItem = (from x in db.HJGL_Pipeline_Component
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId
where PipelineComponentIdList.Contains(x.PipelineComponentId)
select new PackagingPrepipeItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = "1/个",
UnitWorkName = z.UnitWorkName,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.WBS_UnitWork on y.UnitWorkId equals z.UnitWorkId
where PipelineComponentIdList.Contains(x.PipelineComponentId)
select new PackagingPrepipeItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = "1/个",
UnitWorkName = z.UnitWorkName,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
}).ToList();
}).ToList();
}
bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId);
if (!isPower)
{
var roleList= Person_PersonsService.GetRoleListByProjectIdPersonId(projectId, personId);
var roleList = Person_PersonsService.GetRoleListByProjectIdPersonId(projectId, personId);
if (roleList.Contains(Const.CQEngineer))
{
isPower=true;
isPower = true;
}
}
packagingManageItem.packagingManageDetailItem = q;
@@ -99,10 +96,10 @@ namespace BLL
}
}
public static void GetPackingInfoConfirmArrival(string packagingManageId,string PersonId)
public static void GetPackingInfoConfirmArrival(string packagingManageId, string PersonId)
{
var q= BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
if (q!=null)
var q = BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(packagingManageId);
if (q != null)
{
q.State = HJGLPackagingmanageService.state_2;
q.ReceiveMan = PersonId;
@@ -152,7 +149,7 @@ namespace BLL
PackagingManageId = table.PackagingManageId,
PipelineId = ComponentModel.PipelineId,
PipelineComponentId = item,
CreateTime = DateTime.Now,
CreateTime = DateTime.Now,
};
newDetailList.Add(model);
}
@@ -160,7 +157,44 @@ namespace BLL
HJGLPackagingmanagedetailService.DeleteByPackagingManageId(table.PackagingManageId);
HJGLPackagingmanagedetailService.AddBulk(newDetailList);
}
}
}
/// <summary>
/// 新增或更新包装信息(Id为空则新增,否则更新),返回创建或更新后的Id。
/// </summary>
public static string AddOrUpdatePackaging(Model.HJGL_PackagingManage model)
{
if (model == null)
throw new ArgumentNullException(nameof(model));
if (string.IsNullOrEmpty(model.PackagingManageId))
{
// 新增
model.PackagingManageId = SQLHelper.GetNewID(typeof(Model.HJGL_PackagingManage));
HJGLPackagingmanageService.AddHJGL_PackagingManage(model);
return model.PackagingManageId;
}
else
{
// 修改
var exist = HJGLPackagingmanageService.GetHJGL_PackagingManageById(model.PackagingManageId);
if (exist == null)
{
HJGLPackagingmanageService.AddHJGL_PackagingManage(model);
return model.PackagingManageId;
}
else
{
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(model);
return model.PackagingManageId;
}
}
}
public static string GetNewPackagingCode(string projectId)
{
return HJGLPackagingmanageService.GetNewPackagingCode(projectId);
}
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace BLL
{
// 从数据库中获取符合条件的管线数据
var pipelines = db.HJGL_Pipeline
.Where(p =>p.ProjectId==projectid&& p.PipelineCode.Contains(pipelineCode))
.Where(p => p.ProjectId == projectid && p.PipelineCode.Contains(pipelineCode))
.OrderBy(p => p.PipelineCode)
.ToList();
return pipelines;
@@ -1,14 +1,11 @@
using NPOI.OpenXmlFormats.Shared;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace BLL
{
public class APIPipelineComponentService
public class APIPipelineComponentService
{
public static List<PipelineComponentItem> GetPackagingManageList(string projectid)
{
@@ -16,25 +13,25 @@ namespace BLL
{
var q = (from x in db.HJGL_Pipeline_Component
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Unit on x.PreUnit equals z.UnitId into tt
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into pp
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Unit on x.PreUnit equals z.UnitId into tt
join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into pp
from t in tt.DefaultIfEmpty()
from p in pp.DefaultIfEmpty()
where y.ProjectId == projectid
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate) ,
QRCode = x.QRCode,
ReceiveMan=p.PersonName,
ReceiveDate= string.Format("{0:g}", x.ReceiveDate)
}).Distinct();
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
QRCode = x.QRCode,
ReceiveMan = p.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate)
}).Distinct();
return q.ToList();
}
@@ -52,8 +49,8 @@ namespace BLL
from t in tt.DefaultIfEmpty()
from p in pp.DefaultIfEmpty()
join unitwork in db.WBS_UnitWork on y.UnitWorkId equals unitwork.UnitWorkId into unitworks
from unitwork in unitworks.DefaultIfEmpty()
where x.PipelineComponentId== PipelineComponentId
from unitwork in unitworks.DefaultIfEmpty()
where x.PipelineComponentId == PipelineComponentId
select new PipelineComponentItem
{
PipelineComponentId = x.PipelineComponentId,
@@ -61,12 +58,12 @@ namespace BLL
PreUnit = t.UnitName,
DrawingName = x.DrawingName,
BoxNumber = x.BoxNumber,
State = x.State,
State = x.State,
PlanStartDate = string.Format("{0:g}", y.PlanStartDate),
QRCode = x.QRCode,
ReceiveMan = p.PersonName,
ReceiveDate = string.Format("{0:g}", x.ReceiveDate),
UnitWorkName=unitwork.UnitWorkName,
UnitWorkName = unitwork.UnitWorkName,
Remark = x.Remark
}).FirstOrDefault();
if (q != null)
@@ -84,7 +81,7 @@ namespace BLL
}
}
public static void GetComponentConfirmArrival(string PipelineComponentId,string PersonId,string message)
public static void GetComponentConfirmArrival(string PipelineComponentId, string PersonId, string message)
{
var q = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(PipelineComponentId);
if (q != null)
@@ -92,7 +89,7 @@ namespace BLL
if (!string.IsNullOrEmpty(message))
{
q.State = HJGL_PipelineComponentService.StatePenRec;
q.Remark=message;
q.Remark = message;
}
else
{
+45 -48
View File
@@ -1,11 +1,7 @@
using NPOI.SS.Formula.Functions;
using System;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using static QRCoder.PayloadGenerator;
namespace BLL
{
@@ -237,7 +233,7 @@ namespace BLL
ProjectId = newItem.ProjectId,
UnitWorkId = newItem.UnitWorkId,
UnitId = newItem.UnitId,
WeldingDate = newItem.WeldingDate,
WeldingDate = newItem.WeldingDate,
Tabler = newItem.Tabler,
TableDate = newItem.TableDate,
Remark = newItem.Remark,
@@ -257,54 +253,55 @@ namespace BLL
}
#endregion
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
{
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try {
var peson=db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
try
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
var weldTask=db.HJGL_WeldTask.FirstOrDefault(x=>x.WeldJointId==joint.WeldJointId);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = weldTask?.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
var peson = db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date && x.UnitWorkId == joint.UnitWorkId);
var weldTask = db.HJGL_WeldTask.FirstOrDefault(x => x.WeldJointId == joint.WeldJointId);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = weldTask?.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
BLL.HJGL_PipelineComponentjointService.UpdateStateByWeldJointId(WeldJointId, (DateTime)weldingDaily.WeldingDate);//更改预制口实际时间和状态
PipelineService.UpdataDateByWeldJointId(WeldJointId);//更改安装口时间和状态
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
}
catch (Exception ex)
{
APICommonService.SaveSysAPILog("erro", ex.ToString(),"-1");
APICommonService.SaveSysAPILog("erro", ex.ToString(), "-1");
}
}
@@ -463,9 +460,9 @@ namespace BLL
/// <returns></returns>
private static string InsertWeldingDailyItem(string weldJointId, string coverWelderId, string backingWelderId, string jointAttribute, DateTime? weldingDate, string batchCondition, bool isSave, string weldingDailyId, string projectId)
{
string errlog = string.Empty;
string errlog = string.Empty;
var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId);
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId);
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(weldingDailyId);
if (newWeldJoint != null /*&& string.IsNullOrEmpty(newWeldJoint.WeldingDailyId)*/)
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
@@ -15,13 +12,17 @@ namespace BLL
/// <param name="PersonId"></param>
public static void SaveTrainInfoConfirmArrival(string id, string PersonId)
{
var model=TrainNumberManageService.GetModelById(id);
if (model!=null)
var model = TrainNumberManageService.GetModelById(id);
if (model != null)
{
model.ReceiveDate = DateTime.Now;
TrainNumberManageService.Update(model);
}
var packManagerList= HJGLPackagingmanageService.GetPackagingManage(id);
else
{
throw new Exception("车次信息有误,请检查!");
}
var packManagerList = HJGLPackagingmanageService.GetPackagingManage(id);
foreach (var item in packManagerList)
{
BLL.APIPackagingManageService.GetPackingInfoConfirmArrival(item.PackagingManageId, PersonId);
@@ -65,13 +66,52 @@ namespace BLL
{
throw new Exception("未找到对应的包装信息");
}
if (packModel.State != HJGLPackagingmanageService.state_0)
/*if (packModel.State != HJGLPackagingmanageService.state_0)
{
throw new Exception("当前包装状态不可修改车次号");
}
}*/
packModel.TrainNumberId = null;
packModel.TrainNumber = null;
HJGLPackagingmanageService.UpdateHJGL_PackagingManage(packModel);
}
/// <summary>
/// 新增或更新车次信息。若 model.Id 为空则新增,否则修改。返回创建或更新后的Id。
/// 新增时 State=0ReceiveDate=null;修改时保持原有 State 和 ReceiveDate。
/// </summary>
public static string AddOrUpdateTrainNumber(Model.HJGL_TrainNumberManage model)
{
if (model == null)
{
throw new ArgumentNullException(nameof(model));
}
if (string.IsNullOrEmpty(model.Id))
{
// 新增
model.Id = SQLHelper.GetNewID(typeof(Model.HJGL_TrainNumberManage));
model.ReceiveDate = null;
TrainNumberManageService.Add(model);
return model.Id;
}
else
{
// 修改
var exist = TrainNumberManageService.GetModelById(model.Id);
if (exist == null)
{
model.ReceiveDate = null;
TrainNumberManageService.Add(model);
return model.Id;
}
else
{
// 保持原有ReceiveDate
model.ReceiveDate = exist.ReceiveDate;
TrainNumberManageService.Update(model);
return model.Id;
}
}
}
}
}