合并最新
This commit is contained in:
@@ -249,19 +249,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
if (string.IsNullOrEmpty(jointInfo.DReportID))
|
||||
{
|
||||
string row0 = pds.Rows[i][0].ToString();
|
||||
var unit = units.Where(x => x.UnitCode == row0.Trim() && x.UnitId == this.CurrUser.UnitId).FirstOrDefault();
|
||||
Model.Base_Unit unit = new Model.Base_Unit();
|
||||
if (!string.IsNullOrEmpty(row0))
|
||||
{
|
||||
if (units.Where(x => x.UnitCode == row0.Trim()).FirstOrDefault() == null)
|
||||
unit = units.FirstOrDefault(x => x.UnitCode == row0.Trim());
|
||||
if (unit == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位代号" + "," + "[" + row0 + "]不存在!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
var area = workAreas.Where(x => x.UnitId == unit.UnitId && x.WorkAreaId == this.drpWorkArea.SelectedValue).FirstOrDefault();
|
||||
if (area == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "区域" + "," + "该单位没有此区域号!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "单位代号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
|
||||
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (!string.IsNullOrEmpty(row1))
|
||||
{
|
||||
@@ -275,17 +285,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "装置代号" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(row0))
|
||||
{
|
||||
if (unit != null)
|
||||
{
|
||||
var area = workAreas.Where(x => x.UnitId == unit.UnitId && x.WorkAreaId == this.drpWorkArea.SelectedValue).FirstOrDefault();
|
||||
if (area == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "区域" + "," + "该单位没有此区域号!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(pds.Rows[i][2].ToString()))
|
||||
{
|
||||
@@ -732,7 +732,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
report.DReportID = SQLHelper.GetNewID(typeof(Model.BO_WeldReportMain));
|
||||
report.ProjectId = this.CurrUser.LoginProjectId;
|
||||
report.InstallationId = Funs.DB.Project_Installation.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId && e.InstallationCode == pds.Rows[i][1].ToString().Trim()).InstallationId;
|
||||
report.UnitId = Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitCode == pds.Rows[i][0].ToString().Trim()&&e.UnitId == this.CurrUser.UnitId).UnitId;
|
||||
report.UnitId = Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitCode == pds.Rows[i][0].ToString().Trim()).UnitId;
|
||||
report.JOT_WeldDate = Convert.ToDateTime(pds.Rows[i][18].ToString().Trim());
|
||||
report.JOT_DailyReportNo = reportNo;
|
||||
report.CHT_Tabler = this.CurrUser.UserId;
|
||||
@@ -762,17 +762,20 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
jointInfo.WME_ID = methods.First(e => e.WeldingMethodCode == pds.Rows[i][12].ToString().Trim()).WeldingMethodId;
|
||||
}
|
||||
jointInfo.DReportID = dReportID;
|
||||
var unit = units.Where(x => x.UnitCode == pds.Rows[i][0].ToString().Trim()&&x.UnitId==this.CurrUser.UnitId).FirstOrDefault();
|
||||
if (string.IsNullOrEmpty(pds.Rows[i][14].ToString().Trim()))
|
||||
var unit = units.FirstOrDefault(x => x.UnitCode == pds.Rows[i][0].ToString().Trim());
|
||||
if (unit != null)
|
||||
{
|
||||
jointInfo.JOT_CellWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.WED_Code == pds.Rows[i][15].ToString().Trim()).WED_ID;
|
||||
jointInfo.JOT_FloorWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.WED_Code == pds.Rows[i][16].ToString().Trim()).WED_ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
var teamGroup = teamGroups.Where(x => x.UnitId == unit.UnitId && x.TeamGroupCode == pds.Rows[i][14].ToString().Trim()).FirstOrDefault();
|
||||
jointInfo.JOT_CellWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.TeamGroupId == teamGroup.TeamGroupId && e.WED_Code == pds.Rows[i][15].ToString().Trim()).WED_ID;
|
||||
jointInfo.JOT_FloorWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.TeamGroupId == teamGroup.TeamGroupId && e.WED_Code == pds.Rows[i][16].ToString().Trim()).WED_ID;
|
||||
if (string.IsNullOrEmpty(pds.Rows[i][14].ToString().Trim()))
|
||||
{
|
||||
jointInfo.JOT_CellWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.WED_Code == pds.Rows[i][15].ToString().Trim()).WED_ID;
|
||||
jointInfo.JOT_FloorWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.WED_Code == pds.Rows[i][16].ToString().Trim()).WED_ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
var teamGroup = teamGroups.Where(x => x.UnitId == unit.UnitId && x.TeamGroupCode == pds.Rows[i][14].ToString().Trim()).FirstOrDefault();
|
||||
jointInfo.JOT_CellWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.TeamGroupId == teamGroup.TeamGroupId && e.WED_Code == pds.Rows[i][15].ToString().Trim()).WED_ID;
|
||||
jointInfo.JOT_FloorWelder = welders.First(e => e.WED_Unit == unit.UnitId && e.TeamGroupId == teamGroup.TeamGroupId && e.WED_Code == pds.Rows[i][16].ToString().Trim()).WED_ID;
|
||||
}
|
||||
}
|
||||
jointInfo.JOT_Location = pds.Rows[i][17].ToString().Trim();
|
||||
jointInfo.JOT_Electricity = pds.Rows[i][19].ToString().Trim(); //电流
|
||||
|
||||
Reference in New Issue
Block a user