20240430 修改附件上传条件
This commit is contained in:
@@ -168,9 +168,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
var installations = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row0))
|
||||
@@ -181,22 +184,30 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row0 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (!string.IsNullOrEmpty(row1))
|
||||
else
|
||||
{
|
||||
var ins = installations.Where(x => x.UnitWorkName == row1.Trim()).FirstOrDefault();
|
||||
if (ins == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "装置/单元名称" + "," + "[" + row1 + "]不存在!" + "|";
|
||||
}
|
||||
result += (i + 2).ToString() + "," + "专业名称" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row2 = pds.Rows[i][2].ToString();
|
||||
if (string.IsNullOrEmpty(row2))
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (string.IsNullOrEmpty(row1))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "变更单号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
|
||||
string row2 = pds.Rows[i][2].ToString();
|
||||
if (!string.IsNullOrEmpty(row2))
|
||||
{
|
||||
string[] reunit = row2.Split(',');
|
||||
foreach (string unitWork in reunit)
|
||||
{
|
||||
var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (!string.IsNullOrEmpty(row5))
|
||||
@@ -233,16 +244,29 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
var u = units.Where(x => x.UnitName == unit).FirstOrDefault();
|
||||
if (u == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位名称" + "," + "[" + unit + "]不存在!" + "|";
|
||||
result += (i + 2).ToString() + "," + "接收单位" + "," + "[" + unit + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
string row8 = pds.Rows[i][8].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row8))
|
||||
{
|
||||
if (row8 != "实施中" && row8 != "已完成")
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "执行情况" + "," + "[" + row8 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 != "未实施" && row9 != "进行中" && row9 != "已完成")
|
||||
try
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "处理状态" + "," + "[" + row9 + "]错误!" + "|";
|
||||
DateTime date = Convert.ToDateTime(row9.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "施工完成日期" + "," + "[" + row9 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,6 +275,17 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int t = Convert.ToInt32(row10);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row10 + "]错误!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
@@ -390,13 +425,18 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
select x;
|
||||
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
var installations = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null
|
||||
select x;
|
||||
|
||||
var oldViewInfos = from x in Funs.DB.Comprehensive_DesignChangeOrder
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
for (int i = 1; i < ir; i++)
|
||||
{
|
||||
var oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][10].ToString().Trim()).FirstOrDefault();
|
||||
var oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt(pds.Rows[i][10].ToString().Trim())).FirstOrDefault();
|
||||
if (oldViewInfo == null)
|
||||
{
|
||||
Model.Comprehensive_DesignChangeOrder Ins = new Model.Comprehensive_DesignChangeOrder();
|
||||
@@ -405,13 +445,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
Ins.CNProfessionalId = Funs.DB.Base_CNProfessional.First(e => e.ProfessionalName == pds.Rows[i][0].ToString().Trim()).CNProfessionalId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][1].ToString().Trim()))
|
||||
Ins.ChangeOrderCode = pds.Rows[i][1].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim()))
|
||||
{
|
||||
Ins.UnitWorkId = Funs.DB.WBS_UnitWork.First(e => e.UnitWorkName == pds.Rows[i][1].ToString().Trim()).UnitWorkId;
|
||||
Ins.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][2].ToString().Trim());
|
||||
}
|
||||
|
||||
Ins.ChangeOrderCode = pds.Rows[i][2].ToString().Trim();
|
||||
Ins.ChangeReason = pds.Rows[i][3].ToString().Trim();
|
||||
Ins.Contents = pds.Rows[i][4].ToString().Trim();
|
||||
|
||||
@@ -429,26 +467,9 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
Ins.UnitId = UnitService.GetUnitIds(pds.Rows[i][7].ToString().Trim());
|
||||
}
|
||||
|
||||
Ins.ImplementationFrontState = pds.Rows[i][8].ToString().Trim();
|
||||
|
||||
string row9 = pds.Rows[i][9].ToString().Trim();
|
||||
if (!string.IsNullOrEmpty(row9))
|
||||
{
|
||||
if (row9 == "未实施")
|
||||
{
|
||||
Ins.HandleState = "1";
|
||||
}
|
||||
if (row9 == "进行中")
|
||||
{
|
||||
Ins.HandleState = "2";
|
||||
}
|
||||
if (row9 == "已完成")
|
||||
{
|
||||
Ins.HandleState = "3";
|
||||
}
|
||||
}
|
||||
Ins.RemarkCode = pds.Rows[i][10].ToString().Trim();
|
||||
Ins.CompleteDate = Funs.GetNewDateTime(pds.Rows[i][9].ToString().Trim());
|
||||
Ins.RemarkCode = Funs.GetNewInt(pds.Rows[i][10].ToString().Trim());
|
||||
Ins.DesignChangeOrderId = SQLHelper.GetNewID(typeof(Model.Comprehensive_DesignChangeOrder));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
@@ -467,7 +488,6 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region 下载模板
|
||||
/// <summary>
|
||||
/// 下载模板按钮
|
||||
|
||||
Reference in New Issue
Block a user