20240701 修改NCR
This commit is contained in:
@@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL(ds.Tables[0], 14);
|
||||
AddDatasetToSQL(ds.Tables[0], 15);
|
||||
hdCheckResult.Text = "1";
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -178,6 +178,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
var users = from x in Funs.DB.Project_ProjectUser
|
||||
join y in Funs.DB.Sys_User on x.UserId equals y.UserId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitId == BLL.Const.UnitId_CWCEC
|
||||
select y;
|
||||
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
@@ -214,16 +220,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
result += (i + 2).ToString() + "," + "NCR单号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row4 = pds.Rows[i][4].ToString();
|
||||
if (!string.IsNullOrEmpty(row4))
|
||||
string row3 = pds.Rows[i][3].ToString();
|
||||
if (!string.IsNullOrEmpty(row3))
|
||||
{
|
||||
try
|
||||
string[] reunit = row3.Split(',');
|
||||
foreach (string unitWork in reunit)
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row4.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "下发日期" + "," + "[" + row4 + "]错误!" + "|";
|
||||
var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,17 +246,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
string row7 = pds.Rows[i][7].ToString();
|
||||
if (!string.IsNullOrEmpty(row7))
|
||||
{
|
||||
string[] reunit = row7.Split(',');
|
||||
foreach (string unitWork in reunit)
|
||||
try
|
||||
{
|
||||
var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
DateTime date = Convert.ToDateTime(row7.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "下发日期" + "," + "[" + row7 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string row8 = pds.Rows[i][8].ToString();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
@@ -273,6 +280,19 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
}
|
||||
|
||||
string row10 = pds.Rows[i][10].ToString();
|
||||
if (!string.IsNullOrEmpty(row10))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row10.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "要求封闭日期" + "," + "[" + row10 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString();
|
||||
if (!string.IsNullOrEmpty(row11))
|
||||
{
|
||||
@@ -282,25 +302,22 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
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 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "完成日期" + "," + "[" + row11 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row13 = pds.Rows[i][13].ToString();
|
||||
if (string.IsNullOrEmpty(row13))
|
||||
if (!string.IsNullOrEmpty(row13))
|
||||
{
|
||||
var u = users.Where(x => x.UserName == row13).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "监督人" + "," + "[" + row13 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row14 = pds.Rows[i][14].ToString();
|
||||
if (string.IsNullOrEmpty(row14))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
@@ -308,11 +325,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row13);
|
||||
int t = Convert.ToInt32(row14);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row13 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row14 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,7 +437,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
|
||||
AddDatasetToSQL2(ds.Tables[0], 14);
|
||||
AddDatasetToSQL2(ds.Tables[0], 15);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -464,13 +481,19 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
var users = from x in Funs.DB.Project_ProjectUser
|
||||
join y in Funs.DB.Sys_User on x.UserId equals y.UserId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitId == BLL.Const.UnitId_CWCEC
|
||||
select y;
|
||||
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_NCRManagement oldViewInfo = new Model.Comprehensive_NCRManagement();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
string row1 = pds.Rows[i][1].ToString().Trim();
|
||||
var cn = cns.Where(y => y.ProfessionalName == row1).FirstOrDefault();
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt( pds.Rows[i][13].ToString().Trim())
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt( pds.Rows[i][14].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -480,33 +503,36 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
des.SendUnit = units.Where(x => x.UnitName == row0.Trim()).FirstOrDefault().UnitId;
|
||||
des.CNProfessionalId = cn.CNProfessionalId;
|
||||
des.NCRCode = pds.Rows[i][2].ToString().Trim();
|
||||
des.Contents = pds.Rows[i][3].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim()))
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim()))
|
||||
{
|
||||
des.IssuedDate = Convert.ToDateTime(pds.Rows[i][4].ToString().Trim());
|
||||
des.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][3].ToString().Trim());
|
||||
}
|
||||
des.Contents = pds.Rows[i][4].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.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][7].ToString().Trim());
|
||||
}
|
||||
des.IssuedDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(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][10].ToString().Trim()))
|
||||
{
|
||||
des.ClosedDate = Convert.ToDateTime(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());
|
||||
des.CompleteDate = Convert.ToDateTime(pds.Rows[i][11].ToString().Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][12].ToString().Trim()))
|
||||
des.ResponsibleMan = pds.Rows[i][12].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][13].ToString().Trim()))
|
||||
{
|
||||
des.CompleteDate = Convert.ToDateTime(pds.Rows[i][12].ToString().Trim());
|
||||
des.Supervisor = users.FirstOrDefault(x => x.UserName == pds.Rows[i][13].ToString().Trim()).UserId;
|
||||
}
|
||||
des.RemarkCode = Funs.GetNewInt(pds.Rows[i][13].ToString().Trim());
|
||||
des.RemarkCode = Funs.GetNewInt(pds.Rows[i][14].ToString().Trim());
|
||||
des.Status = BLL.Const.Comprehensive_Compile;
|
||||
des.CompileMan = this.CurrUser.UserId;
|
||||
BLL.NCRManagementService.AddNCRManagement(des);
|
||||
|
||||
Reference in New Issue
Block a user