20240430 质量综合管理导入导出
This commit is contained in:
@@ -178,7 +178,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
if (string.IsNullOrEmpty(row0))
|
||||
@@ -215,9 +215,16 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (string.IsNullOrEmpty(row5))
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
|
||||
try
|
||||
{
|
||||
Int32 date = Convert.ToInt32(row5.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "页数" + "," + "[" + row5 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row6 = pds.Rows[i][6].ToString();
|
||||
@@ -225,11 +232,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
try
|
||||
{
|
||||
Int32 date = Convert.ToInt32(row6.Trim());
|
||||
DateTime date = Convert.ToDateTime(row6.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "页数" + "," + "[" + row6 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "接收日期" + "," + "[" + row6 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,27 +249,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "接收日期" + "," + "[" + row7 + "]错误!" + "|";
|
||||
result += (i + 2).ToString() + "," + "发送日期" + "," + "[" + row7 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row8 = pds.Rows[i][8].ToString();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = Convert.ToDateTime(row8.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "发送日期" + "," + "[" + row8 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
string[] reunit = row9.Split(',');
|
||||
string[] reunit = row8.Split(',');
|
||||
foreach (string unit in reunit)
|
||||
{
|
||||
var u = units.Where(x => x.UnitName == unit.Trim()).FirstOrDefault();
|
||||
@@ -272,6 +266,23 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row11 = pds.Rows[i][11].ToString();
|
||||
if (string.IsNullOrEmpty(row11))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row11);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row11 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
@@ -421,12 +432,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
Model.Comprehensive_DesignDrawings oldViewInfo = new Model.Comprehensive_DesignDrawings();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
var cn = cns.Where(y => y.ProfessionalName == row0).FirstOrDefault();
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][5].ToString().Trim()
|
||||
oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt(pds.Rows[i][11].ToString().Trim())
|
||||
).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
@@ -441,25 +452,25 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
des.DesignDrawingsContent = pds.Rows[i][3].ToString().Trim();//图纸内容
|
||||
des.Edition = pds.Rows[i][4].ToString().Trim();//版次
|
||||
des.RemarkCode = pds.Rows[i][5].ToString().Trim();//标志编号
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
des.PageNumber = Convert.ToInt32(pds.Rows[i][5].ToString().Trim());//页数
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
|
||||
{
|
||||
des.PageNumber = Convert.ToInt32(pds.Rows[i][6].ToString().Trim());//页数
|
||||
des.ReceiveDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());//接收日期
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
|
||||
{
|
||||
des.ReceiveDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());//接收日期
|
||||
des.SendDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());//发送日期
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
|
||||
{
|
||||
des.SendDate = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());//发送日期
|
||||
des.ReceiveUnits = UnitService.GetUnitIds(pds.Rows[i][8].ToString().Trim());//接收单位
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
|
||||
{
|
||||
des.ReceiveUnits = UnitService.GetUnitIds(pds.Rows[i][9].ToString().Trim());//接收单位
|
||||
}
|
||||
des.ReceiveMan = pds.Rows[i][10].ToString().Trim(); //接收人
|
||||
des.Remark = pds.Rows[i][11].ToString().Trim();//备注
|
||||
des.ReceiveMan = pds.Rows[i][9].ToString().Trim(); //接收人
|
||||
des.Remark = pds.Rows[i][10].ToString().Trim();//备注
|
||||
des.RemarkCode = Funs.GetNewInt(pds.Rows[i][11].ToString().Trim());//标志编号
|
||||
des.Status = BLL.Const.Comprehensive_Compile;
|
||||
des.CompileMan = this.CurrUser.UserId;
|
||||
BLL.DesignDrawingsService.AddDesignDrawings(des);
|
||||
@@ -474,25 +485,25 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
}
|
||||
oldViewInfo.DesignDrawingsContent = pds.Rows[i][3].ToString().Trim();//图纸内容
|
||||
oldViewInfo.Edition = pds.Rows[i][4].ToString().Trim();//版次
|
||||
oldViewInfo.RemarkCode = pds.Rows[i][5].ToString().Trim();//标志编号
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.PageNumber = Convert.ToInt32(pds.Rows[i][5].ToString().Trim());//页数
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.PageNumber = Convert.ToInt32(pds.Rows[i][6].ToString().Trim());//页数
|
||||
oldViewInfo.ReceiveDate = Convert.ToDateTime(pds.Rows[i][6].ToString().Trim());//接收日期
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][7].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.ReceiveDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());//接收日期
|
||||
oldViewInfo.SendDate = Convert.ToDateTime(pds.Rows[i][7].ToString().Trim());//发送日期
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][8].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.SendDate = Convert.ToDateTime(pds.Rows[i][8].ToString().Trim());//发送日期
|
||||
oldViewInfo.ReceiveUnits = UnitService.GetUnitIds(pds.Rows[i][8].ToString().Trim());//接收单位
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][9].ToString().Trim()))
|
||||
{
|
||||
oldViewInfo.ReceiveUnits = UnitService.GetUnitIds(pds.Rows[i][9].ToString().Trim());//接收单位
|
||||
}
|
||||
oldViewInfo.ReceiveMan = pds.Rows[i][10].ToString().Trim(); //接收人
|
||||
oldViewInfo.Remark = pds.Rows[i][11].ToString().Trim();//备注
|
||||
oldViewInfo.ReceiveMan = pds.Rows[i][9].ToString().Trim(); //接收人
|
||||
oldViewInfo.Remark = pds.Rows[i][10].ToString().Trim();//备注
|
||||
oldViewInfo.RemarkCode = Funs.GetNewInt(pds.Rows[i][11].ToString().Trim());//标志编号
|
||||
oldViewInfo.CompileMan = this.CurrUser.UserId;
|
||||
oldViewInfo.Status = BLL.Const.Comprehensive_Compile;
|
||||
BLL.DesignDrawingsService.UpdateDesignDrawings(oldViewInfo);
|
||||
|
||||
Reference in New Issue
Block a user