移交,管道和仪表数据导入顺序不变

This commit is contained in:
2024-12-10 14:31:15 +08:00
parent f419dd641d
commit 1439da7cd6
12 changed files with 128 additions and 3 deletions
@@ -306,9 +306,19 @@ namespace FineUIPro.Web.Transfer
}
string result = string.Empty;
ir = pds.Rows.Count;
int Sn = 0;
if (pds != null && ir > 0)
{
List<Model.Transfer_Instrumentation> list = new List<Model.Transfer_Instrumentation>();
//根据项目id查询sn
var snModel = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault();
if (snModel == null && Sn == 0)
{
Sn = 1000;
}
else {
Sn = snModel.SN;
}
for (int i = 1; i < ir; i++)
{
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
@@ -322,6 +332,10 @@ namespace FineUIPro.Web.Transfer
model.Descriptions= pds.Rows[i][1].ToString().Trim();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
Sn += 1;
model.SN = Sn;
model.INSTRUMENTATION = pds.Rows[i][0].ToString().Trim();
model.SystemName = pds.Rows[i][1+1].ToString().Trim();
model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim();