全厂移交统计表

This commit is contained in:
2024-01-30 16:01:53 +08:00
parent fdf500e8d0
commit 183af3a610
15 changed files with 650 additions and 373 deletions
@@ -181,7 +181,7 @@ namespace FineUIPro.Web.Transfer
}
}
string row5 = pds.Rows[i][5].ToString();
if (!string.IsNullOrEmpty(row4))
if (!string.IsNullOrEmpty(row5))
{
try
{
@@ -329,41 +329,44 @@ namespace FineUIPro.Web.Transfer
List<Model.Transfer_Civil_Structure> list = new List<Model.Transfer_Civil_Structure>();
for (int i = 1; i < ir; i++)
{
//查询第一列,没查到的情况下作导入处理
var modelOnly = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Civil_Structure == pds.Rows[i][0].ToString().Trim()
if (!string.IsNullOrEmpty(pds.Rows[i][0].ToString().Trim()))
{
//查询第一列,没查到的情况下作导入处理
var modelOnly = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Civil_Structure == pds.Rows[i][0].ToString().Trim()
&& x.ProjectId == CurrUser.LoginProjectId);
if (modelOnly==null)
{
Model.Transfer_Civil_Structure model = new Model.Transfer_Civil_Structure();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
model.Civil_Structure = pds.Rows[i][0].ToString().Trim();
model.SystemName = pds.Rows[i][1].ToString().Trim();
model.Subsystem = pds.Rows[i][2].ToString().Trim();
model.Test_Package = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
model.Test_Package_START = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
model.Test_Package_FINISH = t2;
if (modelOnly == null)
{
Model.Transfer_Civil_Structure model = new Model.Transfer_Civil_Structure();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
model.Civil_Structure = pds.Rows[i][0].ToString().Trim();
model.SystemName = pds.Rows[i][1].ToString().Trim();
model.Subsystem = pds.Rows[i][2].ToString().Trim();
model.Test_Package = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
model.Test_Package_START = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
model.Test_Package_FINISH = t2;
model.FINAL_Status = pds.Rows[i][6].ToString().Trim();
list.Add(model);
}
else
{
//修改
modelOnly.Civil_Structure = pds.Rows[i][0].ToString().Trim();
modelOnly.SystemName = pds.Rows[i][1].ToString().Trim();
modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim();
modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
modelOnly.Test_Package_START = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
modelOnly.Test_Package_FINISH = t2;
modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim();
Funs.DB.SubmitChanges();
model.FINAL_Status = pds.Rows[i][6].ToString().Trim();
list.Add(model);
}
else
{
//修改
modelOnly.Civil_Structure = pds.Rows[i][0].ToString().Trim();
modelOnly.SystemName = pds.Rows[i][1].ToString().Trim();
modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim();
modelOnly.Test_Package = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
modelOnly.Test_Package_START = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
modelOnly.Test_Package_FINISH = t2;
modelOnly.FINAL_Status = pds.Rows[i][6].ToString().Trim();
Funs.DB.SubmitChanges();
}
}
}
if (list.Count > 0)