提交代码
This commit is contained in:
@@ -169,7 +169,16 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||
var drawings = from x in Funs.DB.QuantityManagement_Drawing
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
|
||||
var changes = from x in Funs.DB.QuantityManagement_Change
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var teamGroups = from x in Funs.DB.ProjectData_TeamGroup
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var projectUsers = from x in Funs.DB.Sys_User
|
||||
join y in Funs.DB.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var cns = from x in Funs.DB.Base_CNProfessional select x;
|
||||
|
||||
for (int i = 0; i < ir; i++)
|
||||
@@ -177,7 +186,8 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||
Model.QuantityManagement_Base oldViewInfo = new Model.QuantityManagement_Base();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
var drawing = drawings.Where(y => y.DrawingNo == row0).FirstOrDefault();
|
||||
if (drawing != null && !string.IsNullOrEmpty(row0))
|
||||
var change = changes.Where(y => y.ChangeNo == row0).FirstOrDefault();
|
||||
if ((drawing != null || change != null) && !string.IsNullOrEmpty(row0))
|
||||
{
|
||||
string row1 = pds.Rows[i][1].ToString();
|
||||
if (string.IsNullOrEmpty(row1))
|
||||
@@ -217,7 +227,24 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||
string row5 = pds.Rows[i][5].ToString();
|
||||
if (string.IsNullOrEmpty(row5))
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "作业队" + "," + "此项为必填项!" + "|";
|
||||
result += (i + 2).ToString() + "," + "计划作业队" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
var teamGroup = teamGroups.Where(y => y.TeamGroupName == row5).FirstOrDefault();
|
||||
if (teamGroup == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "计划作业队" + "," + "[" + row5 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
string row6 = pds.Rows[i][6].ToString();
|
||||
if (!string.IsNullOrEmpty(row6))
|
||||
{
|
||||
var projectUser = projectUsers.Where(y => y.UserName == row6).FirstOrDefault();
|
||||
if (projectUser == null)
|
||||
{
|
||||
result += (i + 2).ToString() + "," + "审核人" + "," + "[" + row6 + "]不存在!" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,16 +395,35 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||
var drawings = from x in Funs.DB.QuantityManagement_Drawing
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var changes = from x in Funs.DB.QuantityManagement_Change
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var teamGroups = from x in Funs.DB.ProjectData_TeamGroup
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
var projectUsers = from x in Funs.DB.Sys_User
|
||||
join y in Funs.DB.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
Model.QuantityManagement_Base oldViewInfo = new Model.QuantityManagement_Base();
|
||||
string row0 = pds.Rows[i][0].ToString().Trim();
|
||||
string row6 = pds.Rows[i][6].ToString().Trim();
|
||||
var drawing = drawings.Where(y => y.DrawingNo == row0).FirstOrDefault();
|
||||
if (drawing != null && !string.IsNullOrEmpty(row0))
|
||||
var change = changes.Where(y => y.ChangeNo == row0).FirstOrDefault();
|
||||
if ((drawing != null || change != null) && !string.IsNullOrEmpty(row0))
|
||||
{
|
||||
Model.QuantityManagement_Base Ins = new Model.QuantityManagement_Base();
|
||||
Ins.ProjectId = this.CurrUser.LoginProjectId;
|
||||
Ins.DrawingId = drawing.DrawingId;
|
||||
if (drawing != null)
|
||||
{
|
||||
Ins.DrawingId = drawing.DrawingId;
|
||||
}
|
||||
else
|
||||
{
|
||||
Ins.DrawingId = change.ChangeId;
|
||||
}
|
||||
Ins.Part = pds.Rows[i][1].ToString().Trim();
|
||||
Ins.ProjectContent = pds.Rows[i][2].ToString().Trim();
|
||||
Ins.Unit = pds.Rows[i][3].ToString().Trim();
|
||||
@@ -385,11 +431,41 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||
{
|
||||
Ins.Amount = Convert.ToDecimal(pds.Rows[i][4].ToString().Trim());
|
||||
}
|
||||
Ins.WorkTeam = pds.Rows[i][5].ToString().Trim();
|
||||
var teamGroup = teamGroups.Where(y => y.TeamGroupName == pds.Rows[i][5].ToString().Trim()).FirstOrDefault();
|
||||
if (teamGroup != null)
|
||||
{
|
||||
Ins.WorkTeam = teamGroup.TeamGroupId;
|
||||
}
|
||||
Ins.BaseId = SQLHelper.GetNewID(typeof(Model.QuantityManagement_Base));
|
||||
Ins.CompileMan = this.CurrUser.UserId;
|
||||
Ins.CompileDate = DateTime.Now.Date;
|
||||
BLL.BaseService.AddBase(Ins);
|
||||
|
||||
Model.QuantityManagement_BaseApprove approve1 = new Model.QuantityManagement_BaseApprove();
|
||||
approve1.BaseId = Ins.BaseId;
|
||||
approve1.ApproveMan = this.CurrUser.UserId;
|
||||
approve1.ApproveType = BLL.Const.Base_Compile;
|
||||
if (!string.IsNullOrEmpty(row6))
|
||||
{
|
||||
Ins.State = BLL.Const.Base_Audit1;
|
||||
BLL.BaseService.AddBase(Ins);
|
||||
approve1.ApproveDate = DateTime.Now;
|
||||
Model.QuantityManagement_BaseApprove approve = new Model.QuantityManagement_BaseApprove();
|
||||
approve.BaseId = Ins.BaseId;
|
||||
var projectUser = projectUsers.Where(y => y.UserName == row6).FirstOrDefault();
|
||||
if (projectUser != null)
|
||||
{
|
||||
approve.ApproveMan = projectUser.UserId;
|
||||
}
|
||||
approve.ApproveType = BLL.Const.Base_Audit1;
|
||||
BLL.BaseApproveService.AddBaseApprove(approve);
|
||||
}
|
||||
else
|
||||
{
|
||||
Ins.State = BLL.Const.Base_Compile;
|
||||
BLL.BaseService.AddBase(Ins);
|
||||
approve1.ApproveDate = null;
|
||||
}
|
||||
BLL.BaseApproveService.AddBaseApprove(approve1);
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user