20250723 修改工厂预制管理
This commit is contained in:
@@ -251,11 +251,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
//删除原有数据
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(this.CurrUser.LoginProjectId,this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
//decimal totalDia = 0;
|
||||
//totalDia += Convert.ToDecimal(tb.Rows[i]["Dia"].ToString());//总达因
|
||||
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
if (plan == null)
|
||||
{
|
||||
@@ -296,7 +295,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
|
||||
//删除原有数据
|
||||
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNode.Text);
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
@@ -319,51 +319,51 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.tvControlItem.SelectedNodeID == "1" || this.tvControlItem.SelectedNodeID == "2")
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.hdUnitWorkId.Text))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.hdUnitWorkId.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@unitWorkId", null));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@caliber", this.txtSize.Text.Trim()));
|
||||
}
|
||||
//else if (this.tvControlItem.SelectedNodeID == "1" || this.tvControlItem.SelectedNodeID == "2")
|
||||
//{
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
// if (!string.IsNullOrEmpty(this.hdUnitWorkId.Text))
|
||||
// {
|
||||
// listStr.Add(new SqlParameter("@unitWorkId", this.hdUnitWorkId.Text));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// listStr.Add(new SqlParameter("@unitWorkId", null));
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
|
||||
// {
|
||||
// listStr.Add(new SqlParameter("@caliber", this.txtSize.Text.Trim()));
|
||||
// }
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
// SqlParameter[] parameter = listStr.ToArray();
|
||||
// DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
|
||||
|
||||
for (int i = 0; i < tb.Rows.Count; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tb.Rows[i]["FlowingSection"].ToString()))
|
||||
{
|
||||
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
if (plan == null)
|
||||
{
|
||||
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID
|
||||
newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString();
|
||||
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
newPlan.Material = tb.Rows[i]["Material"].ToString();
|
||||
newPlan.Caliber = tb.Rows[i]["Caliber"].ToString();
|
||||
newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString());
|
||||
newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString());
|
||||
newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString());
|
||||
newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString());
|
||||
newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString());
|
||||
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (int i = 0; i < tb.Rows.Count; i++)
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(tb.Rows[i]["FlowingSection"].ToString()))
|
||||
// {
|
||||
// var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, tb.Rows[i]["FlowingSection"].ToString(), tb.Rows[i]["UnitWorkId"].ToString(), tb.Rows[i]["Material"].ToString(), tb.Rows[i]["Caliber"].ToString());
|
||||
// if (plan == null)
|
||||
// {
|
||||
// Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
|
||||
// newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
|
||||
// newPlan.ProjectId = this.CurrUser.LoginProjectId;
|
||||
// newPlan.PipelineId = tb.Rows[i]["UnitWorkId"].ToString();//装置ID
|
||||
// newPlan.FlowNum = tb.Rows[i]["FlowingSection"].ToString();
|
||||
// newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
|
||||
// newPlan.Material = tb.Rows[i]["Material"].ToString();
|
||||
// newPlan.Caliber = tb.Rows[i]["Caliber"].ToString();
|
||||
// newPlan.Dain = Funs.GetNewDecimalOrZero(tb.Rows[i]["Dia"].ToString());
|
||||
// newPlan.TotalDyne = Funs.GetNewDecimalOrZero(tb.Rows[i]["TotalDia"].ToString());
|
||||
// newPlan.CompletedCount = Funs.GetNewIntOrZero(tb.Rows[i]["cTotalCount"].ToString());
|
||||
// newPlan.CompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["rate"].ToString());
|
||||
// newPlan.TotalCompletedRate = Funs.GetNewDecimalOrZero(tb.Rows[i]["Srate"].ToString());
|
||||
// BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -551,7 +551,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
if (lists != null)
|
||||
{
|
||||
newUrl = uploadfilepath.Replace("排产计划导出模板", "排产计划(" + DateTime.Now.ToString("yyyyMMdd") + ")");
|
||||
newUrl = uploadfilepath.Replace("排产计划导出模板", "排产计划-" + this.tvControlItem.SelectedNode.Text + "-" + DateTime.Now.ToString("yyyyMMdd"));
|
||||
if (File.Exists(newUrl))
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
@@ -707,7 +707,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
SaveProductionSchedulingPlan();
|
||||
}
|
||||
}
|
||||
else
|
||||
else //建筑工程/安装工程
|
||||
{
|
||||
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
|
||||
Reference in New Issue
Block a user