20240419 NCR、图纸收发导入
This commit is contained in:
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 10);
|
||||
AddDatasetToSQL(ds.Tables[0], 13);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -173,6 +173,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
@@ -225,40 +230,72 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
string[] reunit = row5.Split(',');
|
||||
foreach (string unit in reunit)
|
||||
if (row5 != "过程监督不到位" && row5 != "质量缺陷" && row5 != "质量管理问题" && row5 != "不按设计要求施工" && row5 != "不按程序施工" && row5 != "成品保护不到位")
|
||||
{
|
||||
var u = units.Where(x => x.UnitName == unit).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "接收单位" + "," + "[" + unit + "]不存在!" + "|";
|
||||
}
|
||||
result += (i + 2).ToString() + "," + "问题类别" + "," + "[" + row5 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row7 = pds.Rows[i][7].ToString();
|
||||
if (!string.IsNullOrEmpty(row7))
|
||||
{
|
||||
try
|
||||
string[] reunit = row7.Split(',');
|
||||
foreach (string unitWork in reunit)
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row7.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "要求封闭日期" + "," + "[" + row7 + "]错误!" + "|";
|
||||
var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row8 = pds.Rows[i][8].ToString();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
string[] reunit = row8.Split(',');
|
||||
foreach (string unit in reunit)
|
||||
{
|
||||
var u = units.Where(x => x.UnitName == unit.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "接收单位" + "," + "[" + unit.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 != "整改中" && row9 != "已闭合")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "实施状态" + "," + "[" + row9 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString();
|
||||
if (!string.IsNullOrEmpty(row11))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row8.Trim());
|
||||
DateTime date = Convert.ToDateTime(row11.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "完成日期" + "," + "[" + row8 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "要求封闭日期" + "," + "[" + row11 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row12 = pds.Rows[i][12].ToString();
|
||||
if (!string.IsNullOrEmpty(row12))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row12.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "完成日期" + "," + "[" + row12 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,7 +403,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 10);
|
||||
AddDatasetToSQL2(ds.Tables[0], 13);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -405,6 +442,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_NCRManagement oldViewInfo = new Model.Comprehensive_NCRManagement();
|
||||
@@ -426,20 +468,27 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
des.IssuedDate = Convert.ToDateTime(pds.Rows[i][4].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
des.ReceiveUnit = BLL.UnitService.GetUnitIds(pds.Rows[i][5].ToString().Trim());
|
||||
}
|
||||
des.ImplementationFrontState = pds.Rows[i][6].ToString().Trim();
|
||||
des.Problem = pds.Rows[i][5].ToString().Trim();
|
||||
des.Measure = pds.Rows[i][6].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
|
||||
{
|
||||
des.ClosedDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
|
||||
des.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][7].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
|
||||
{
|
||||
des.CompleteDate = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());
|
||||
des.ReceiveUnit = BLL.UnitService.GetUnitIds(pds.Rows[i][8].ToString().Trim());
|
||||
}
|
||||
|
||||
des.ImplementationFrontState = pds.Rows[i][9].ToString().Trim();
|
||||
des.ResponsibleMan = pds.Rows[i][10].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][11].ToString().Trim()))
|
||||
{
|
||||
des.ClosedDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
{
|
||||
des.CompleteDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
}
|
||||
des.ResponsibleMan = pds.Rows[i][9].ToString().Trim();
|
||||
BLL.NCRManagementService.AddNCRManagement(des);
|
||||
}
|
||||
}
|
||||
@@ -454,7 +503,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region 下载模板
|
||||
/// <summary>
|
||||
/// 下载模板按钮
|
||||
|
||||
Reference in New Issue
Block a user