using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Core.Mes.Client.Comm.Format;
using Core.Mes.Client.Comm.Tool;
using Core.StlMes.Client.PlnSaleOrd.炼钢计划.entity;
using CoreFS.CA06;
using Infragistics.Win.UltraWinGrid;
using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
using Core.StlMes.Client.PlnSaleOrd.工序排产;
using Core.Mes.Client.Comm.Server;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win;
using Core.Mes.Client.Comm.Control;
using System.IO;
using System.Runtime.InteropServices;
using Core.StlMes.Client.PlnSaleOrd.炼钢计划.control;
using Infragistics.Win.UltraWinMaskedEdit;
namespace Core.StlMes.Client.PlnSaleOrd.炼钢计划
{
public partial class FrmSteelMakingPlanChange : FrmBase
{
private string[] plineCode = null;
///
/// 订单编号
///
private string _ProPlanId = "";
private string _weightPerMeterFormula = string.Empty;
///
/// 排产序号
///
private string _GxPlanNo = "";
UltraCombo uceBatch = new UltraCombo();
DataTable dtBatch = new DataTable();
///
/// 行首背景色
///
private Color _BackColor = new Color();
///
/// 调整行集合
///
private ArrayList _EntityList = null;
///
/// 铸机最大流量
///
private int MaxFlow = 0;
private int MaxFurnaceNum = 0;
public FrmSteelMakingPlanChange()
{
this.IsLoadUserView = true;
InitializeComponent();
}
private string plineCodeBSelete = "";
private string plineCodeASelete = "";
void ultraGridCast_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
{
foreach (UltraGridRow uRow in ultraGridCast.Selected.Rows)
{
if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
{
uRow.Cells["CHC"].Value = true;
}
if (plineCodeBSelete.Equals(""))
{
plineCodeBSelete = uRow.Cells["PlineCode"].Value.ToString();
plineCodeASelete = uRow.Cells["PlineCodeA"].Value.ToString();
}
//if (!plineCodeBSelete.Equals("") && !plineCodeBSelete.Equals(uRow.Cells["PlineCode"].Value.ToString()))
//{
// MessageUtil.ShowTips("不能跨铸造产线预算/组浇!");
// uRow.Cells["CHC"].Value = false;
// return;
//}
}
chcChange(plineCodeBSelete, plineCodeASelete);
}
///
/// 初始化数据
///
///
///
private void FrmSteelMakingPlanChange_Load(object sender, EventArgs e)
{
//设置列头名称
EntityHelper.ShowGridCaption(ultraGridCast.DisplayLayout.Bands[0]);
BaseHelper.setOtherColumnReadOnly(ultraGridCast, new string[] { "CHC", "CanNum", "PlineCode", "PlineCodeA", "PlanTimeB", "PlanUsetime", "RepairType", "Memo", "ProgyMemo", "ManualNum", "CraftNo", "CutNumGp", "SteelJudgement" });
BaseHelper.InitCellPosition(ultraGridCast, new string[] { "GxPlanNo", "OrderSeq", "DeliveryNo", "PlanWtS", "PlanNumS", "PlanUsetime", "GxProSeq", "PlnDivideId", "DiameterLz", "LenGpSingle", "CutNumGp", "CutLoseLen", "LengthLz", "WtCastOne", "CastNumCalc", "FurnaceNumCalc", "FurnaceWt", "PlanedWt", "PlanedNum", "Finishweight", "FinishNum", "CastNum", "FurnaceNum", "AddWtBegin", "AddWtEnd", "AddWtAhead", "AddWtNext", "CanWgt", "CanNum", "GradeSort", "ProcessingCostA", "TotalCostA", "ProcessingCostB", "TotalCostB", "ManualNum","PlanWtSold", "PlanNumSold" });
BaseHelper.GridColumnSum(ultraGridCast, new string[] { "PlanWtS", "CanWgt" });
BaseHelper.GridColumnCount(ultraGridCast, new string[] { "PlanNumS", "CanNum" });
BaseHelper.setUltraGridColumnMaxInput(ultraGridCast, new string[] { "PlanWtS", "CanWgt", "PlanedWt", "PlanWtSold" });
BaseHelper.setUltraGridColumnBits(ultraGridCast, new string[] { "PlanNumS", "CanNum", "PlanedNum", "ManualNum" });
BaseHelper.setColumnBackColor(ultraGridCast, new string[] { "PlineCode", "PlineCodeA", "CHC", "Memo", "ProgyMemo", "ManualNum", "CraftNo", "CutNumGp", "SteelJudgement" });
//BaseHelper.InitCellPositionMiddle(ultraGridCast, new string[] { "IsRepairPln", "IsPlanOk", "IfConnectAhead", "IfConnectNext", "IfMonitorLg" });
PlanHelper.InitRepairType(ultraGridCast, this);
InitEditPline(ultraGridCast, this);
BaseHelper.ForbidSort(ultraGridCast);
SteelHelper.ForbidSort(ultraGridFurName);
BaseHelper.ForbidSort(ultraGrid1);
SteelHelper.ForbidSort(ugStove);
_BackColor = ultraGridCast.DisplayLayout.Override.RowSelectorAppearance.BackColor;
plineCode = PlanHelper.InitDropPlinePower("B", comBPline, this.ValidDataPurviewIds, this.ob);
InitPline();
InitGrade();
ultraGridCast.DisplayLayout.Bands[0].Columns["ProPlanId"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
ultraGridCast.DisplayLayout.Bands[0].Columns["Cic"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
#region 炉次信息
Controls.Add(uceBatch);
uceBatch.Visible = false;
EntityHelper.ShowGridCaption(ultraGridFurName.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ultraGridFurName.DisplayLayout.Bands[1]);
BaseHelper.setColumnReadOnly(ultraGridFurName, new string[] { "CHC", "BatchingCode", "LenGpSingle", "TotWeightM", "ChcMast", "PlanRoute" });
BaseHelper.InitCellPosition(ultraGridFurName, new string[] { "Quantity", "Weight", "AimSteelQty", "CastSeq", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum", "CastStoveSeq", "ConAmountNum" });
BaseHelper.InitCellPositionC(ultraGridFurName, new string[] { "Sequenceno", "Sequenceincast", "Diameter", "LenGpSingle", "CutNumGp", "LengthM", "WeightGpOne", "WeightM", "TotWeightM", "TotMumM","CutNum" });
BaseHelper.GridColumnSum(ultraGridFurName, new string[] { "Weight", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum", "AimSteelQty" });
BaseHelper.GridColumnCount(ultraGridFurName, new string[] { "Quantity", "ConAmountNum" });
//BaseHelper.GridColumnSum(ultraGridFurName, new string[] { "TotWeightM" });
//BaseHelper.GridColumnCount(ultraGridFurName, new string[] { "TotMumM" });
BaseHelper.setUltraGridColumnMaxInput(ultraGridFurName, new string[] { "Weight", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum", "AimSteelQty" });
//BaseHelper.setUltraGridColumnMaxInput(ultraGridFurName, new string[] { "TotWeightM", "WeightGpOne" });
//BaseHelper.setColumnBackColor(ultraGridFurName, new string[] { "TotWeightM", "LenGpSingle" });
BaseHelper.setColumnBackColor(ultraGridFurName, new string[] { "BatchingCode", "PlanRoute" });
UltraNumericEditor[] uneArr = new UltraNumericEditor[1];
uneArr[0] = new UltraNumericEditor();
uneArr[0].NumericType = NumericType.Double;
uneArr[0].MaskInput = "nnnnn";
uneArr[0].SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;
this.Controls.Add(uneArr[0]);
uneArr[0].Visible = false;
uneArr[0].SpinIncrement = 10;
ultraGridFurName.DisplayLayout.Bands[1].Columns["LenGpSingle"].EditorComponent = uneArr[0];
QueryBatch("");
#endregion
#region 浇次信息
EntityHelper.ShowGridCaption(ultraGrid1.DisplayLayout.Bands[0]);
BaseHelper.setOtherColumnReadOnly(ultraGrid1, new string[] { "CHC" });
BaseHelper.InitCellPosition(ultraGrid1, new string[] { "Furnacenumber", "TotWt", "TotNum", "AddWtBegin", "AddWtEnd", "Diameter", "AimSteelQty", "AverageQty" });
BaseHelper.setUltraGridColumnMaxInput(ultraGrid1, new string[] { "TotWt", "AddWtBegin", "AimSteelQty", "AverageQty" });
#endregion
#region 组浇tab页
EntityHelper.ShowGridCaption(ugCast.DisplayLayout.Bands[0]);
BaseHelper.setOtherColumnReadOnly(ugCast, new string[] { "CHC" });
BaseHelper.InitCellPosition(ugCast, new string[] { "CastSeq", "TotWt", "TotNum", "AddWtBegin", "AddWtEnd", "AddWtConnAhead", "AddWtConnNext" });
BaseHelper.GridColumnSum(ugCast, new string[] { "TotWt", "AddWtBegin", "AddWtEnd", "AddWtConnAhead", "AddWtConnNext" });
BaseHelper.GridColumnCount(ugCast, new string[] { "TotNum" });
EntityHelper.ShowGridCaption(ugStove.DisplayLayout.Bands[0]);
EntityHelper.ShowGridCaption(ugStove.DisplayLayout.Bands[1]);
BaseHelper.setColumnReadOnly(ugStove, new string[] { "CHC", "TotWeightM" });
BaseHelper.InitCellPositionC(ugStove, new string[] { "Sequenceno", "Sequenceincast", "Diameter", "LenGpSingle", "CutNumGp", "LengthM", "WeightGpOne", "WeightM", "TotWeightM", "TotMumM", "CutNum" });
BaseHelper.InitCellPosition(ugStove, new string[] { "Quantity", "Weight", "AimSteelQty", "CastSeq", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum", "CastStoveSeq", "FurnacenoSeq", "ConAmountNum" });
BaseHelper.GridColumnSum(ugStove, new string[] { "Weight", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum" });
BaseHelper.GridColumnCount(ugStove, new string[] { "Quantity" });
BaseHelper.setUltraGridColumnMaxInput(ugStove, new string[] { "Weight", "ConAmount", "ResAmount", "FirstAmount", "EndAmount", "HotmetalNum", "IronNum", "SteelscrapNum", "AimSteelQty" });
//设置可拖拽
//BaseHelper.SetGridDragDropRows(ugCast, AdjustCastSeq, GetMyCursor());
BaseHelper.SetGridDragDropRows(ugStove, AdjustStoveSeq, GetMyCursor());
BaseHelper.ForbidSort(ugCast);
BaseHelper.ForbidSort(ugStove);
#endregion
ugStove.DisplayLayout.Bands[0].Columns["PlnStarttime"].Format = "yyyy-MM-dd HH:mm:ss";
ugStove.DisplayLayout.Bands[0].Columns["PlnStarttime"].MaskInput = "yyyy-mm-dd hh:mm:ss";
ugStove.DisplayLayout.Bands[0].Columns["PlnStarttime"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime;
DateTime now = DateTime.Now;
DateTime d1 = new DateTime(now.Year, now.Month, now.Day);
txtPlanTimeB1.Value = d1;
endTimeB.Value = d1;
}
private void QueryBatch(string plineCode)
{
dtBatch = ServerHelper.GetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelMakingPlanChange.queryBatch", new object[] { plineCode }, ob);
uceBatch.DataSource = dtBatch;
uceBatch.ValueMember = "BATCHING_CODE";
uceBatch.DisplayMember = "配料方案";
ultraGridFurName.DisplayLayout.Bands[0].Columns["BatchingCode"].EditorComponent = uceBatch;
UltraComboEditor ucePath = new UltraComboEditor();
ultraGridFurName.DisplayLayout.Bands[0].Columns["PlanRoute"].EditorComponent = ucePath;
ultraGridFurName.DisplayLayout.Bands[0].Columns["PlanRoute"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
ValueList vlistSteel = new ValueList(); ;
vlistSteel.ValueListItems.Insert(0, "ELC", "ELC");
vlistSteel.ValueListItems.Insert(1, "ELVC", "ELVC");
vlistSteel.ValueListItems.Insert(2, "ELRC", "ELRC");
vlistSteel.ValueListItems.Insert(3, "ELVI", "ELVI");
vlistSteel.ValueListItems.Insert(4, "ELRI", "ELRI");
ultraGridFurName.DisplayLayout.Bands[0].Columns["PlanRoute"].ValueList = vlistSteel;
}
///
/// 初始化编辑区产线
///
/// 工序
/// UltraGrid
/// 窗体
public static void InitEditPline(UltraGrid ug, FrmBase from)
{
DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.BaseHelper.initPlinePowerB", new object[] { }, from.ob);
UltraComboEditor uce = new UltraComboEditor();
from.Controls.Add(uce);
uce.Visible = false;
uce.DropDownListWidth = -1;
uce.DropDownStyle = DropDownStyle.DropDownList;
uce.DataSource = dt1;
uce.DisplayMember = "PLINE_NAME";
uce.ValueMember = "PLINE_CODE";
ug.DisplayLayout.Bands[0].Columns["PlineCode"].EditorComponent = uce;
ug.DisplayLayout.Bands[0].Columns["PlineCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
DataTable dt2 = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.BaseHelper.initPlinePowerA", new object[] { }, from.ob);
UltraComboEditor uce2 = new UltraComboEditor();
from.Controls.Add(uce2);
uce2.Visible = false;
uce2.DropDownListWidth = -1;
uce2.DropDownStyle = DropDownStyle.DropDownList;
uce2.DataSource = dt2;
uce2.DisplayMember = "PLINE_NAME";
uce2.ValueMember = "PLINE_CODE";
ug.DisplayLayout.Bands[0].Columns["PlineCodeA"].EditorComponent = uce2;
ug.DisplayLayout.Bands[0].Columns["PlineCodeA"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
}
///
/// 初始化产线
///
private void InitPline()
{
SteelHelper.InitPline(comEfPlin, "A", this.ob);
//SteelHelper.InitPline(comBPline, "B", this.ob);
}
///
/// 初始化钢种
///
private void InitGrade()
{
SteelHelper.InitGrade(comGrade, this.ob);
}
///
/// 选择控制
///
///
///
private void chc_CheckedChanged(object sender, EventArgs e)
{
//if (chcAPline.Checked) { comAPline.Enabled = true; } else { comAPline.Enabled = false; }
if (chcBPline.Checked) { comBPline.Enabled = true; } else { comBPline.Enabled = false; }
if (chcGrade.Checked) { comGrade.Enabled = true; } else { comGrade.Enabled = false; }
if (chcProplanId.Checked) { txtProplanId.Enabled = true; } else { txtProplanId.Enabled = false; }
if (chkEfPlin.Checked) { comEfPlin.Enabled = true; } else { comEfPlin.Enabled = false; }
if (chcPlanTimeB.Checked) { txtPlanTimeB1.Enabled = true; endTimeB.Enabled = true; } else { txtPlanTimeB1.Enabled = false; endTimeB.Enabled = false; }
if (chcCastNo.Checked) { txtCastNo.Enabled = true; } else { txtCastNo.Enabled = false; }
if (chkStoveNo.Checked) { txtStoveNo.Enabled = true; } else { txtStoveNo.Enabled = false; }
if (chkJudgeNo.Checked) { txtJudgeNo.Enabled = true; } else { txtJudgeNo.Enabled = false; }
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
switch (ToolbarKey)
{
case "QueryOrder": // 订单产线
QueryOrder();
break;
case "Budget": // 预算
AddCast("0");
break;
case "AddCast": // 组浇
AddCast("1");
break;
case "Exchange": // 顺序交换
Exchange();
break;
case "Capacity"://产线能力维护
Capacity();
break;
case "AddRepairPlan"://检修计划
AddRepairPlan();
break;
case "DeleteRepairPlan"://删除检修计划
DeleteRepairPlan();
break;
case "PlineChange"://产线调整
PlineChange();
break;
case "TimeChange"://时间调整
TimeChange();
break;
case "StatusChange"://状态调整
StatusChange();
break;
case "InitData"://耗时初始化
Init();
break;
case "Spit"://拆分订单
Spit();
break;
case "Merge"://合并订单
Merge();
break;
case "SetPlanFinish"://设置关闭
SetPlanFinish();
break;
case "Issued"://下发
Issued("0");
break;
case "CancelIssued"://取消下发
Issued("1");
break;
case "Close":
this.Close();
break;
case "Export":
GridHelper.ulGridToExcel(ultraGridCast, "铸造排产信息");
break;
case "ProMemo"://工艺/计划备注修改
DoProMemo();
break;
case "QueryCast"://查询浇次
QueryCastTab();
break;
case "Down"://下发
ChangeSatusStove(true);
break;
case "Rollback"://撤销下发
ChangeSatusStove(false);
break;
case "TimeAdjust"://浇次时间调整
TimeAdjust();
break;
case "FillFurnace"://补炉
doFillFurnace();
break;
case "Confirm"://工艺确认
doConfirm("1");
break;
case "UnConfirm"://取消确认
doConfirm("0");
break;
case "ProcessAll"://获取工艺
doProcessAll();
break;
case "ClearProcess": //取消工艺
doClearProcess();
break;
case "UpdateNumGp"://调整倍尺
doUpdateNumGp();
break;
case "AddBlOrder"://一键生成备料合同
doAddBlOrder();
break;
case "Print"://炉次订单打印
doPrint();
break;
case "RefreshPln"://轧管炉计划刷新
doRefreshPln();
break;
case "LimitProcessAll"://加严工艺卡
doLimitProcessAll();
break;
default:
break;
}
}
///
/// 炉次订单打印
///
private void doPrint()
{
UltraGridRow row = ugStove.ActiveRow;
if (row == null)
{
MessageUtil.ShowTips("打印数据不能为空,请查询!");
return;
}
string efPlineCode = "";
string proMonth = "";
string proMonth1 = "";
if (chcPlanTimeB.Checked)
{
proMonth = txtPlanTimeB1.Text.ToString().Replace("-", "");
proMonth1 = endTimeB.Text.ToString().Replace("-", "");
}
if (proMonth.Equals(""))
{
MessageUtil.ShowTips("请选择生产年月!");
return;
}
foreach (UltraGridRow rows in ugStove.Rows)
{
if (efPlineCode.Equals(""))
{
efPlineCode = rows.Cells["EfPlineCode"].Text.ToString();
}
if (!efPlineCode.Equals(rows.Cells["EfPlineCode"].Text.ToString()))
{
MessageUtil.ShowTips("请选择同一电炉产线!");
return;
}
}
string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLgDatePlan.cpt&op=view" + "&EF_PLINE_CODE=" + efPlineCode + "&PRO_MONTH=" + proMonth + "&PRO_MONTH1=" + proMonth1;
FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
fBug.AutoSize = true;
fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
fBug.Text = "炼钢计划打印";
fBug.ShowDialog();
QueryFurnaceTab();
}
#region 铸造订单功能
///
/// 产线能力维护
///
private void Capacity()
{
UltraGridRow ugr = ultraGridCast.ActiveRow;
if (ugr == null)
{
return;
}
string inMaterialNo = ugr.Cells["WlidIn"].Text;
string outMaterialNo = ugr.Cells["MaterialNo"].Text;
string plineCode = ugr.Cells["PlineCode"].Value.ToString();
FrmBaseMaterialBPl frmBaseMaterialBPl = new FrmBaseMaterialBPl(inMaterialNo, outMaterialNo, plineCode, ob);
frmBaseMaterialBPl.ShowDialog();
}
///
/// 新增检修计划
///
private void AddRepairPlan()
{
if (comBPline.Value == null || comBPline.Value.ToString().Equals(""))
{
MessageUtil.ShowTips("请选择产线!");
return;
}
FrmJxjh frmJxjh = new FrmJxjh(this.ob, comBPline.Value.ToString(), "B");
frmJxjh.ShowDialog();
QueryOrder();
}
///
/// 删除检修计划
///
public void DeleteRepairPlan()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.DeleteRepairPlan(list, "B", this.ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 折分订单
///
private void Spit()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.SpitPlanOrder(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 合并订单
///
private void Merge()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.MergePlanOrder(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 产线调整
///
private void PlineChange()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.PlineChange(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 初始化
///
private void Init()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.InitData(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 状态调整
///
private void StatusChange()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.StatusChange(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 时间调整
///
private void TimeChange()
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.TimeChange(list, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 下发(取消)
///
private void Issued(string isFlag)
{
ArrayList list = ProducHelper.GetChcRows(ultraGridCast);
bool flag = ProducHelper.issuedPlanOrder(list, this.UserInfo.GetUserName(), isFlag, "B", ob);
if (flag)
{
_ProPlanId = ((PlnOrderCastSEntity)list[0]).ProPlanId;
_GxPlanNo = ((PlnOrderCastSEntity)list[0]).GxPlanNo.ToString();
QueryOrder();
}
}
///
/// 设置完成
///
private void SetPlanFinish()
{
ArrayList entityList = ProducHelper.GetChcRows(ultraGridCast);
if (entityList == null)
{
MessageUtil.ShowWarning("请选择订单!");
return;
}
ArrayList jsonlist = new ArrayList();
foreach (PlnOrderCastSEntity entity in entityList)
{
//ProducEntity entity = ProducHelper.GenerationProEntity(obj, "B");
if (entity.IsRepairPln.Equals("是"))
{
MessageUtil.ShowWarning("检修计划订单,不能设置关闭!");
return;
}
if (entity.GxProSeq.Equals("-2"))
{
MessageUtil.ShowWarning("铸造订单已经设置关闭!");
return;
}
//if (!entity.ExeStatusZg.Equals(""))
//{
// if (entity.ExeStatusZg.Equals("计划") || entity.ExeStatusZg.Equals("生产中"))
// {
// MessageUtil.ShowWarning("铸造订单对应轧管订单信息已" + entity.ExeStatusZg + "!");
// return;
// }
//}
jsonlist.Add(JSONFormat.Format(entity));
}
if (MessageUtil.ShowYesNoAndQuestion("是否设置关闭(此操作数据暂不可恢复)?") == DialogResult.No)
{
return;
}
string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.steelMarkingPlan.FrmSteelPlnZg.setPlanFinish", new object[] { jsonlist, this.UserInfo.GetUserName(), "B" }, ob);
if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return; }
else
{
MessageUtil.ShowTips(param[1]);
if ((bool.Parse(param[0]))) { QueryOrder(); } else { return; }
}
}
private void craftImg1_EditorButtonClick(object sender, EditorButtonEventArgs e)
{
UltraGridRow row = ultraGridCast.ActiveRow;
string craftNo = row.Cells["CraftNo"].Text.ToString();
string craftPath = row.Cells["CraftPath"].Text.ToString();
ArrayList list = new ArrayList();
list.Add(row.Cells["Cic"].Text.ToString());
list.Add(row.Cells["ProPlanId"].Text.ToString());
list.Add(row.Cells["PlineCodeA"].Value.ToString());
list.Add(row.Cells["PlineNameA"].Text.ToString());
list.Add(row.Cells["Gradecode"].Text.ToString());
list.Add(row.Cells["Gradename"].Text.ToString());
list.Add(row.Cells["StationDesc"].Text.ToString());
list.Add(row.Cells["PlineCode"].Value.ToString());
list.Add(row.Cells["GxPlanNo"].Value.ToString());
if (e.Button.Key.ToLower().Equals("select"))
{
//if (craftNo.Equals(""))
//{
// MessageUtil.ShowTips("");
// return;
//}
string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepLgSmeltingProcess.cpt&op=view" + "&CRAFT_NO=" + craftNo;
FrmRepExcel down = new FrmRepExcel(ob, strurl);
down.Text = "炼钢工艺卡打印";
down.Visible = false;
down.Size = new Size(740, this.Height);
down.WindowState = FormWindowState.Maximized;
down.ShowDialog();
}
else
{
FrmSteelProcessCard steCard = new FrmSteelProcessCard(craftNo, ob, list, "0");
steCard.ShowDialog();
bool flag = steCard.Falg;
if (flag) { QueryOrder(); }
}
}
#endregion
///
/// 计算首炉加量
///
/// 首炉切头长(m)
/// 管坯直径
/// 铸机流量
///
private double CalculateBeginAdd(double cutLenBegin, double dimater, double flow)
{
//计算米单重
double mSingleWeight = (7.8 * Math.PI / 4 * dimater * dimater) / 1000 / 1000;
//计算首炉加量
double beginAddWgt = mSingleWeight * flow * cutLenBegin;
return beginAddWgt;
}
///
/// 计算尾炉加量
///
/// 换中包切尾长(m)
/// 管坯直径
/// 铸机流量
/// 中包铸余量
///
private double CalculateEndAdd(double cutLenEnd, double dimater, double flow, double zbLeftWgt)
{
//计算米单重
double mSingleWeight = (7.8 * Math.PI / 4 * dimater * dimater) / 1000 / 1000;
//计算尾炉加量
double endAddWgt = mSingleWeight * cutLenEnd * flow + zbLeftWgt;
return endAddWgt;
}
///
/// 计算可组炉数
///
/// 可组炉量
/// 标准出钢量
///
private double CalculateCanFurnace(double sumWgt, double standardSteel)
{
double canNum = sumWgt / standardSteel;
return canNum;
}
private List listSourceCast = null;
///
/// 查询铸造订单
///
private void QueryOrder()
{
if (plineCode == null)
{
MessageUtil.ShowTips("该用户没有铸造产线查看权限!");
return;
}
//if (chcAPline.Checked && comAPline.Value != null) { plineA = comAPline.Value.ToString(); }
string[] plineB = null;
if (chcBPline.Checked && comBPline.Value != null)
{
plineB = (comBPline.Value as List