| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800 |
- 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.Control;
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
- using Core.StlMes.Client.PlnSaleOrd.工序排产;
- using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using Core.StlMes.Client.PlnSaleOrd.OrderManage.froms;
- using Newtonsoft.Json;
- using Core.StlMes.Client.PlnSaleOrd.窗体;
- using Core.Mes.Client.Comm;
- namespace Core.StlMes.Client.PlnSaleOrd
- {
- ///custominfo==0 表示轧管排产查询界面
- /// <summary>
- /// 轧制排产
- /// </summary>
- public partial class FrmPlnOrderZgSL1 : FrmBase
- {
- DataTable dtPlinGroup = null;
- private string departm = "";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- /// <summary>
- /// 订单编号
- /// </summary>
- private string _ProPlanId = "";
- /// <summary>
- /// 排产序号
- /// </summary>
- private string _GxPlanNo = "";
- UltraComboEditor uceDimaM = new UltraComboEditor();//芯棒直径
- /// <summary>
- /// 行首背景色
- /// </summary>
- private Color _backColor = new Color();
- /// <summary>
- /// 调整行集合
- /// </summary>
- private ArrayList _entityList = null;
- public FrmPlnOrderZgSL1()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query"://查询
- Query();
- 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"://耗时初始化
- InitData();
- break;
- case "Spit"://拆分订单
- Spit();
- break;
- case "Merge"://合并订单
- Merge();
- break;
- case "Issued"://下发
- Issued("0");
- break;
- case "CancelIssued"://取消下发
- Issued("1");
- break;
- case "SetPlanFinish"://设置合同完成
- SetPlanFinish();
- break;
- case "ModifyGpAimWall"://重算
- ModifyGpAimWall();
- break;
- case "UpdateCrop"://修改切头尾
- UpdateCrop();
- break;
- case "UpdateDiameM"://修改芯棒直径
- UpdateDiameM();
- break;
- case "ModifyThicknesWall"://修改控制壁厚
- ModifyThicknesWall();
- break;
- case "Recalculate"://重新计算
- Recalculate();
- break;
- case "Export": //导出
- GridHelper.ulGridToExcel(ultraGridZgS, "轧管排产信息");
- break;
- case "UpdateMonth"://修改排产月份
- UpdateMonth();
- break;
- case "ApplyApproval"://申请审批
- ApplyApproval();
- break;
- case "ModifyBatter"://修改坯子
- ModifyBatter();
- break;
- case "UpdateGroupGp"://修改索引码
- UpdateGroupGp();
- break;
- case "UpdateGradeCode"://修改钢种
- UpdateGradeCode();
- break;
- case "DeleteGperId"://删除管坯需求号
- DeleteGperId();
- break;
- case "UpdateZz"://获取铸造产线
- UpdateZz();
- break;
- case "Termination": //订单终止
- doTermination();
- break;
- case "Close": //关闭
- this.Close();
- break;
- default:
- break;
- }
- }
- private void FrmPlnOrderZgS_Load(object sender, EventArgs e)
- {
- if (CustomInfo == null) { CustomInfo = ""; }
- //设置列头名称
- EntityHelper.ShowGridCaption<PlnOrderZgSOEntity>(ultraGridZgS.DisplayLayout.Bands[0]);
- if (CustomInfo == "0")
- {
- PlanComm.setGridActivation(this.ultraGridZgS.DisplayLayout.Bands[0], "CHC", "ProMonth");//, "OutsBilletFl"
- EntityHelper.setColumnShowOrHidden(ultraGridZgS, new string[] { "PenaltyDesc", "OrderDocumentaryName", "OrderCreateName" }, false);
- }
- else
- {
- BaseHelper.setOtherColumnReadOnly(ultraGridZgS, new string[] { "CHC", "PlineCode", "PlanTimeB", "RepairType", "PlanUsetime", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "TubeEndRatio", "Memo", "LengthdiscN" });
- BaseHelper.setColumnBackColor(ultraGridZgS, new string[] { "PlineCode", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "DiameterMandrel", "TubeEndRatio", "Memo", "LengthdiscN" });
- }
- BaseHelper.InitCellPosition(ultraGridZgS, new string[] { "GxPlanNo", "OrderSeq", "DeliveryNo", "Outdiameter", "Wallthick",
- "LenRollMax", "LenRollMin", "Aimoutdiameter", "Aimwallthick", "Aimlength", "DiameterGp", "LenGpSingle", "RollLength",
- "LenCuthead", "LenCutend", "OutnumCut", "DiameterMandrel", "InWeightS", "InNumS", "WeigthS", "NumS", "AddWtIn",
- "AddNumIn", "MatchWtIn", "MatchNumIn", "GxProSeq", "PlanUsetime", "BatchedWt", "BatchedNum", "Finishweight",
- "Finishnum", "ProcessingCost", "TotalCost" ,"FinishWgt","UnfinishWgt","UnfinishNum","OutdiameterZg","WallthickZg","GpreqNum","GpreqWeight","TubeEndRatio","WeigthSMin","PlansNum","TimeDiffer","AfProNum","AmountDifference","LjNum","LjWeight","FurnaNum","FurnaWeight" ,"CkNum","CkWeight","HrCapcty","ExpectWt","ExpectNum","PendNum","PendWeight","LjWeightB","LjNumB"});
- BaseHelper.setUltraGridColumnMaxInput(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "InWeightS", "AddWtIn", "MatchWtIn", "BatchedWt", "AmountDifference", "UnfinishWgt", "LjWeight", "FurnaWeight", "CkWeight", "ExpectWt", "PendWeight", "LjWeightB" });
- plineCode= PlanHelper.InitDropPlinePower("D",comPline,this.ValidDataPurviewIds, this.ob);
- PlanHelper.InitRepairType(ultraGridZgS, this);
- PlanHelper.InitEditPline("D", "", ultraGridZgS, this);
- if (CustomInfo != "0") { BaseHelper.ForbidSort(ultraGridZgS); }
- BaseHelper.GridColumnSum(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "PendWeight" });
- BaseHelper.GridColumnCount(ultraGridZgS, new string[] { "NumS", "GpreqNum", "PlansNum", "PendNum" });
- BaseHelper.InitCellPositionMiddle(ultraGridZgS, new string[] { "IsRepairPln", "IsPlanOk", "IfMonitorZg", "GpreqIfOk", "Isendgx" });
- BaseHelper.setUltraGridColumnColor(ultraGridZgS, new string[] { "CraftFileNo", "CraftFileLv2G", "Gradename", "DiameterGp" }, Color.GreenYellow);
- //PlanHelper.InitEditGroup("1218", ultraGridZgS, this, "OutsBilletFl");
- PlanHelper.InitEditGroup("1219", ultraGridZgS, this, "OutsStlPipeFl");
- _backColor = ultraGridZgS.DisplayLayout.Override.RowSelectorAppearance.BackColor;
- InitTime();
- InitColorStyle();
-
- }
- /// <summary>
- /// 初始化列状态
- /// </summary>
- private void InitColorStyle()
- {
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Gradename"].EditorComponent = ultraTextEditor1;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Gradename"].ButtonDisplayStyle
- = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Format = "yyyy-MM-dd HH:mm:ss";
- ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].MaskInput = "yyyy-mm-dd hh:mm:ss";
- ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileLv2G"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileNo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- //ultraGridZgS.DisplayLayout.Bands[0].Columns["Gradename"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterGp"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].CellAppearance.BackColor = Color.GreenYellow;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].CellAppearance.BackColor = Color.GreenYellow;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["TimeDiffer"].CellAppearance.BackColor = Color.GreenYellow;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProNum"].CellAppearance.BackColor = Color.GreenYellow;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
- UltraNumericEditor[] uneArr = new UltraNumericEditor[3];
- for (int i = 0; i < uneArr.Length; i++)
- {
- uneArr [i]= new UltraNumericEditor();
- uneArr[i].NumericType =NumericType.Double;
- if (i == 1)
- {
- uneArr[i].MaskInput = "nnnnn";
- }
- else
- {
- uneArr[i].MaskInput = "nnnnn.nn";
- }
-
- uneArr[i].SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;
- this.Controls.Add(uneArr[i]);
- uneArr[i].Visible = false;
- }
- uneArr[0].SpinIncrement = 0.01;
- uneArr[1].SpinIncrement = 50;
- uneArr[2].SpinIncrement =10;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Outdiameter"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Wallthick"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["OutdiameterZg"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["WallthickZg"].EditorComponent = uneArr[0];
- //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMin"].EditorComponent = uneArr[0];
- //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMax"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimoutdiameter"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimwallthick"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimlength"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["RollLength"].EditorComponent = uneArr[0];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["LenGpSingle"].EditorComponent = uneArr[2];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCuthead"].EditorComponent = uneArr[1];
- ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCutend"].EditorComponent = uneArr[1];
- }
- private void InitTime()
- {
- DateTime now = DateTime.Now;
- DateTime d1 = new DateTime(now.Year, now.Month, 1);
- DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
- txtPlanTimeB1.Value = d1;
- txtPlanTimeB2.Value = d2;
- txtPlanTimeE1.Value = d1;
- txtPlanTimeE2.Value = d2;
- }
-
- /// <summary>
- /// 初始化芯棒直径
- /// </summary>
- /// <param name="plineCode">产线</param>
- /// <param name="PassCode">孔型编码</param>
- /// <param name="aimoutdiameter">控制外径</param>
- /// <param name="aimwallthick">控制壁厚</param>
- //private void InitDimaM(string plineCode, string passCode, string aimoutdiameter, string aimwallthick)
- //{
- // DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryPlnMandrelId", new object[] { plineCode, passCode, aimoutdiameter,aimwallthick }, this.ob);
- // UltraComboEditor uce = new UltraComboEditor();
- // ultraGridZgS.Controls.Add(uce);
- // uce.Visible = false;
- // uce.DropDownListWidth = -1;
- // uce.DropDownStyle = DropDownStyle.DropDownList;
- // uce.DataSource = dt1;
- // uce.DisplayMember = "DIAMETER_MANDREL";
- // uce.ValueMember = "MANDREL_ID";
- // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].EditorComponent = uce;
- // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- //}
- private void chcPline_CheckedChanged(object sender, EventArgs e)
- {
- if (chcPline.Checked) { comPline.ReadOnly = false; } else { comPline.ReadOnly = true; }
- if (chcOrderNo.Checked) { txtOrderNo.ReadOnly = false; } else { txtOrderNo.ReadOnly = true; }
- if (chcProPlanId.Checked) { txtProPlanId.ReadOnly = false; } else { txtProPlanId.ReadOnly = true; }
- if (chcPlanTimeB.Checked) { txtPlanTimeB1.ReadOnly = false; txtPlanTimeB2.ReadOnly = false; } else { txtPlanTimeB1.ReadOnly = true; txtPlanTimeB2.ReadOnly = true; }
- if (chcPlanTimeE.Checked) { txtPlanTimeE1.ReadOnly = false; txtPlanTimeE2.ReadOnly = false; } else { txtPlanTimeE1.ReadOnly = true; txtPlanTimeE2.ReadOnly = true; }
- }
- private void ultraGridZgS_InitializeRow(object sender, InitializeRowEventArgs e)
- {
- PlanHelper.ControlCellEdit(e.Row);
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void Query()
- {
- //产线
- string comPlineCode = "";
- if (chcPline.Checked)
- {
- comPlineCode = comPline.Value == null ? "" : comPline.Value.ToString();
- }
-
- //如果是排产界面,则下拉框的产线不能为空,需要排序
- if (!CustomInfo.Equals("0") && comPline.Text.Equals(""))
- {
- MessageUtil.ShowTips("请选择产线!");
- return;
- }
-
- WaitingForm2 wf3 = new WaitingForm2("正在刷新,请稍候....");
- try
- {
- this.Cursor = Cursors.WaitCursor;
- //执行状态
- string[] statusArr = contorlPlanStatus1.statusArr;
- //合同号
- string orderNo = "";
- if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
- string proPlanId = "";
- if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
- string planTimeB1 = "";
- string planTimeB2 = "";
- if (chcPlanTimeB.Checked && txtPlanTimeB2.Value != null && txtPlanTimeB1.Value != null)
- {
- planTimeB1 = DateTime.Parse(txtPlanTimeB1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- planTimeB2 = DateTime.Parse(txtPlanTimeB2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- }
- string planTimeE1 = "";
- string planTimeE2 = "";
- if (chcPlanTimeE.Checked && txtPlanTimeE2.Value != null && txtPlanTimeE1.Value != null)
- {
- planTimeE1 = DateTime.Parse(txtPlanTimeE1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- planTimeE2 = DateTime.Parse(txtPlanTimeE2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
- }
- if (plineCode == null)
- {
- MessageUtil.ShowTips("该用户没有轧管产线查看权限!");
- return;
- }
- dtPlinGroup = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlinCodeGroup", null, this.ob);
- List<PlnOrderZgSOEntity> listSource = EntityHelper.GetData<PlnOrderZgSOEntity>
- ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlanOrderD", new object[] { plineCode, proPlanId, orderNo, statusArr, planTimeB1, planTimeB2, planTimeE1, planTimeE2, comPlineCode,"","" }, this.ob);
- plnOrderZgSOEntityBindingSource.DataSource = listSource;
- //ProducHelper.copyLZData(ultraGridZgS, "D", this.ob);
- //ProducHelper.copyLZDataZg(ultraGridZgS, "D", this.ob);
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- string str = ugr.Cells["AfInfo"].Text.Trim();
- if (str != null && str != "")
- {
- string[] sArray = str.Split(new char[1] { ','});
- ugr.Cells["TimeDiffer"].Value = String.Format("{0:N2} ", sArray[0]).Substring(0, sArray[0].IndexOf("天"));
- ugr.Cells["AfProLin"].Value = sArray[1];
- ugr.Cells["AfProNum"].Value = sArray[2].Substring(0, sArray[2].IndexOf("条"));
- if (dtPlinGroup.Rows.Count > 0)
- {
- //for (int i = 0; i < dtPlinGroup.Rows.Count; i++)
- //{
- string plinGroup = dtPlinGroup.Rows[0]["PLINE_NAME_M"].ToString() + "/" + dtPlinGroup.Rows[0]["PLINE_NAME_C"].ToString();
- DataRow[] dr = dtPlinGroup.Select("PLINE_NAME_M='" + ugr.Cells["PlineCode"].Text.ToString() + "' AND PLINE_NAME_C ='" + ugr.Cells["AfProLin"].Value.ToString() + "'", "");
- if (dr == null || dr.Length == 0) { }
- else
- {
- //DataTable tmp = dr.Table.Clone(); // 复制DataRow的表结构
- //if (tmp.Rows.Count > 0)
- //{
- ugr.Cells["StockGroupName"].Value = dr[0]["STOCK_GROUP_NAME"].ToString();
- //}
- }
- }
- }
-
- if (ugr.Cells["WeigthSMin"].Text.ToString().Equals("") || ugr.Cells["WeigthSMin"].Value.ToString().Equals("0"))
- {
- ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthS"].Value.ToString())).ToString();
- }
- else
- {
- ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthSMin"].Value.ToString())).ToString();
- }
-
- }
- //激活操作行代码
- //if ((!_ProPlanId.Equals("") && !_GxPlanNo.Equals("")) || _entityList != null)
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- if (!_ProPlanId.Equals("") && !_GxPlanNo.Equals(""))
- {
- if (ugr.Cells["ProPlanId"].Text.Trim().Equals(_ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(_GxPlanNo))
- {
- ugr.Activate();
- break;
- }
- }
- if (_entityList != null)
- {
- for (int i = 0; i < _entityList.Count; i++)
- {
- PlnOrderZgSEntity jgxsEntity = (PlnOrderZgSEntity)_entityList[i];
- if (ugr.Cells["ProPlanId"].Text.Trim().Equals(jgxsEntity.ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(jgxsEntity.GxPlanNo))
- {
- ugr.Appearance.BackColor = Color.Wheat;
- ugr.Activate();
- }
- //if (!ugr.Cells["GxProSeq"].Text.Trim().Equals(jgxsEntity.GxProSeq))
- //{
- // ugr.Cells["GxProSeq"].Appearance.BackColor = Color.Wheat;
- // ugr.Activate();
- //}
- }
- }
- }
- _entityList = null;
- _ProPlanId = "";
- _ProPlanId = "";
-
- }
- finally
- {
- wf3.Close();
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 修改切头尾数据
- /// </summary>
- private void UpdateCrop()
- {
- try
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = new ArrayList();
- IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择订单!");
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- foreach (UltraGridRow uRow in checkRows)
- {
- ArrayList param = new ArrayList();
- param.Add(UserInfo.GetUserName());
- param.Add(uRow.Cells["ProPlanId"].Value.ToString());
- param.Add(uRow.Cells["GxPlanNo"].Value.ToString());
- param.Add(uRow.Cells["InwlId"].Text);
- param.Add(uRow.Cells["OutwlId"].Text);
- param.Add(uRow.Cells["PlineCode"].Value.ToString());
- list.Add(param);
- }
- if (list.Count == 0)
- {
- PlanComm.WaitFromColse(this.Cursor);
- MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
- ccp.MethodName = "updateCrop";
- ccp.ServerParams = new object[] { list, UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("批量获取切头尾成功!"))
- {
- Query();
- }
- }
- catch (Exception ex)
- {
- PlanComm.WaitFromColse(this.Cursor);
- if (!(ex is MESException))
- {
- MessageUtil.ShowError(ex.Message);
- }
- }
- }
- /// <summary>
- /// 产线能力维护
- /// </summary>
- private void Capacity()
- {
- UltraGridRow ugr = ultraGridZgS.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- string inMaterialNo = ugr.Cells["InwlId"].Text;
- string outMaterialNo = ugr.Cells["OutwlId"].Text;
- string plineCode = ugr.Cells["PlineCode"].Value.ToString();
- FrmBaseMaterialDPl frmBaseMaterialDPl = new FrmBaseMaterialDPl(inMaterialNo, outMaterialNo, plineCode, this.ob);
- frmBaseMaterialDPl.ShowDialog();
- }
- /// <summary>
- /// 新增检修计划
- /// </summary>
- private void AddRepairPlan()
- {
- if (comPline.Value == null || comPline.Value.ToString().Equals(""))
- {
- MessageUtil.ShowTips("请选择产线!");
- return;
- }
- FrmJxjh frmJxjh = new FrmJxjh(this.ob, comPline.Value.ToString(), "D");
- frmJxjh.ShowDialog();
- Query();
- }
- /// <summary>
- /// 折分订单
- /// </summary>
- private void Spit()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.SpitPlanOrder(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 合并订单
- /// </summary>
- private void Merge()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.MergePlanOrder(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 产线调整
- /// </summary>
- private void PlineChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.PlineChange(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 初始化
- /// </summary>
- private void InitData()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.InitData(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 状态调整
- /// </summary>
- private void StatusChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.StatusChange(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 时间调整
- /// </summary>
- private void TimeChange()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.TimeChange(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraGridZgS_MouseDown(object sender, MouseEventArgs e)
- {
- //排产查询界面,不能排序
- if (CustomInfo.Equals("0"))
- { return; }
- try
- { ultraGridZgS.UpdateData(); }
- catch (Exception)
- {
- MessageUtil.ShowWarning("数据异常,请刷新数据!"); return;
- }
- if (e.Button == MouseButtons.Right)
- {
- //移动行
- ArrayList entityList = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (entityList == null || entityList.Count == 0)
- {
- return;
- }
- //定位行
- UIElement myUIElement = ultraGridZgS.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
- UltraGridCell myCell = (UltraGridCell)myUIElement.GetContext(typeof(UltraGridCell));
- if (myCell == null) { return; }
- UltraGridRow ugr = myCell.Row;
- if (ugr == null) { return; }
- PlnOrderZgSEntity entityD = (PlnOrderZgSEntity)ugr.ListObject;
- bool flag = ProducHelper.SortPlanOrder(entityList, entityD, "D", "", this.ob);
- if (flag)
- {
- _entityList = entityList;
- Query();
- }
- }
- }
- private void ultraGridZgS_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugrAc = ultraGridZgS.ActiveRow;
- if (ugrAc == null)
- {
- return;
- }
- foreach (UltraGridRow ugr in ultraGridZgS.Rows)
- {
- if (ugr.Cells["ProPlanId"].Text.Equals(ugrAc.Cells["ProPlanId"].Text))
- {
- ugr.RowSelectorAppearance.BackColor = Color.LightGreen;
- }
- else
- {
- ugr.RowSelectorAppearance.BackColor = _backColor;
- }
- if (ugr.Cells["PlanUsetime"].Value == null || ugr.Cells["PlanUsetime"].Value.ToString().Equals("") || Convert.ToDouble(ugr.Cells["PlanUsetime"].Value.ToString()) <= 0)
- {
- ugr.Cells["PlanUsetime"].Appearance.BackColor = Color.MistyRose;
- }
- if (ugr.Cells["ExeStatus"].Value.ToString().Equals("生产中"))
- {
- ugr.Cells["PlanTimeB"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- }
- if (ugr.Cells["IsRepairPln"].Text.Equals("Y"))
- {
- ugr.Cells["PlanUsetime"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- ugr.Cells["RepairType"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- }
- }
- }
- private void ultraGridZgS_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- ultraGridZgS.UpdateData();
- if (e.Cell.Column.Key.Equals("PlineCode"))
- {
- IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
- if (CustomInfo.Equals("0"))
- {
- e.Cell.Row.Cells["PlineName"].Value = e.Cell.Text;
- }
- else
- {
- if (chcRows != null && chcRows.Count() > 0)
- {
- foreach (UltraGridRow ugr in chcRows)
- {
- ugr.Cells["PlineCode"].Value = e.Cell.Value.ToString();
- ugr.Cells["PlineName"].Value = e.Cell.Text;
- }
- }
- }
- }
- }
- catch (Exception)
- {
- }
- }
- /// <summary>
- /// 删除检修计划
- /// </summary>
- public void DeleteRepairPlan()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.DeleteRepairPlan(list, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- private void comPline_ValueChanged(object sender, EventArgs e)
- {
- if (comPline == null)
- { return; }
- else
- { if (!CustomInfo.Equals("0")) { } }
- }
- /// <summary>
- /// 下发(取消)
- /// </summary>
- private void Issued(string isFlag)
- {
- IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
- if (checkRows.Count()==0)
- {
- MessageUtil.ShowWarning("请选择订单!");
- return;
- }
- if (isFlag.Equals("0"))
- {
- foreach (UltraGridRow row in checkRows)
- {
- if (row.Cells["LenCuthead"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("切头无数据,不允许确认!");
- return;
- }
- if (row.Cells["LenCutend"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("切尾无数据,不允许确认!");
- return;
- }
- //if (row.Cells["Verify1"].Text.Trim().Equals(""))
- //{
- // MessageUtil.ShowTips("长度需调整!");
- // return;
- //}
- //if (row.Cells["Verify2"].Text.Trim().Equals(""))
- //{
- // MessageUtil.ShowTips("长度超出范围!");
- // return;
- //}
- //if (row.Cells["Verify3"].Text.Trim().Equals(""))
- //{
- // MessageUtil.ShowTips("脱不出!");
- // return;
- //}
- if (row.Cells["CicGp"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("钢种索引码为空!");
- return;
- }
- }
- }
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.issuedPlanOrder(list, UserInfo.GetUserName(), isFlag, "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- private void ultraGridZgS_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGridZgS.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHC"].Value = true;
- }
- }
- }
- private void ultraGridZgS_ClickCellButton(object sender, CellEventArgs e)
- {
- UltraGridRow row = ultraGridZgS.ActiveRow;
- if (e.Cell.Column.Key.Equals("CraftFileNo"))
- {
- string filePath = row.GetValue("CraftPath");
- dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, filePath);
- askDown.Show();
- }
- else if (e.Cell.Column.Key.Equals("CraftFileLv2G"))
- {
- string craftFileLv2G = row.GetValue("CraftFileLv2G");
- dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, craftFileLv2G);
- askDown.Show();
- }
- else if (e.Cell.Column.Key.Equals("DiameterGp"))
- {
- string exeStatus = row.GetValue("ExeStatus");
- if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
- {
- return;
- }
- string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
- string proPlanId = row.GetValue("ProPlanId");
- string gxPlanNo = row.GetValue("GxPlanNo");
- string gradeCode = row.GetValue("GradeCode");
- if (gradeCode.Equals(""))
- {
- return;
- }
- string[] groupCic = null;
- if (!row.GetValue("GradeCode").Equals(""))
- {
- groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
- }
- string cicGp = row.GetValue("CicGp");
- //int numz = 0;
- //double wtz = 0;
- //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
- //{
- // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
- // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
- //}
- int numLj = 0;
- double wtLj = 0;
- //if (!row.Cells["LjNum"].Value.ToString().Equals("0"))
- //{
- numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
- wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
- //}
- //else
- //{
- // numLj = int.Parse(row.Cells["MatchNumIn"].Value.ToString());
- // wtLj = double.Parse(row.Cells["MatchWtIn"].Value.ToString());
- //}
- //int batNum = 0;
- //double batWt = 0;
- //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
- //{
- // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
- // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
- //}
- //int num = numz + numLj + batNum;
- int num = numLj;
- FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp, num);
- frmBomConfirm.ShowDialog();
- bool flag = frmBomConfirm.Flag;
- if (flag) { Query(); }//如果有修改数据,则刷新页面
- }
- else if (e.Cell.Column.Key.Equals("Gradename"))
- {
- string exeStatus = row.GetValue("ExeStatus");
- if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
- {
- return;
- }
- string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
- string proPlanId = row.GetValue("ProPlanId");
- string gxPlanNo = row.GetValue("GxPlanNo");
- string gradeCode = row.GetValue("GradeCode");
- if (gradeCode.Equals(""))
- {
- return;
- }
- string[] groupCic = null;
- if (!row.GetValue("GradeCode").Equals(""))
- {
- groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
- }
- string cicGp = row.GetValue("CicGp");
- int numz = 0;
- double wtz = 0;
- //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
- //{
- // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
- // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
- //}
- int numLj = 0;
- double wtLj = 0;
- //if (!row.Cells["LjNum"].Text.ToString().Equals(""))
- //{
- numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
- wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
- //}
- //int batNum = 0;
- //double batWt = 0;
- //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
- //{
- // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
- // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
- //}
- int num = numLj ;
- FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
- frmBomConfirm.ShowDialog();
- bool flag = frmBomConfirm.Flag;
- if (flag) { Query(); }//如果有修改数据,则刷新页面
- }
- else if (e.Cell.Column.Key.Equals("AfProLin"))
- {
- string proPlanId = row.GetValue("ProPlanId");
- string afInfo = row.GetValue("AfInfo");
- if (afInfo == null || afInfo.Length == 0) { return; }
- FrmPreGxInfo frmPreGxInfo = new FrmPreGxInfo(proPlanId, "D", "Af", this.ob);
- frmPreGxInfo.ShowDialog();
- }
- else if (e.Cell.Column.Key.Equals("DiameterMandrel"))
- {
- //InitDimaM(ugr.Cells["PlineCode"].Text.ToString().Trim(), ugr.Cells["PassCode"].Text.ToString().Trim(), ugr.Cells["Aimoutdiameter"].Text.ToString().Trim(), ugr.Cells["Aimwallthick"].Text.ToString().Trim());
- FrmDiameterMandrel frmDm = new FrmDiameterMandrel(row.GetValue("PlineCode"), row.GetValue("PassCode"), row.GetValue("Aimoutdiameter"), row.GetValue("Aimwallthick"), this.ob);
- frmDm.AutoSize = true;
- //frmDm.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- frmDm.Text = "芯棒直径";
- frmDm.ShowDialog();
- if (frmDm.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- //获取弹出窗体的属性值
- row.Cells["DiameterMandrel"].Value = frmDm.DiameterMandrel;
- }
- }
- else if (e.Cell.Column.Key.Equals("ApplyNo"))
- {
- UndoApply();
- }
- else if (e.Cell.Column.Key.Equals("LengthdiscN"))
- {
- if (row.GetValue("ApplyStatus") == "审批通过" || row.GetValue("ApplyStatus") == "审批不通过")
- {
- MessageUtil.ShowTips("该合同:" + row.GetValue("OrderNo") + ",已" + row.GetValue("ApplyStatus") + ",不允许修改推荐长度描述!");
- return;
- }
- string len = row.GetValue("LenNo");//合同长度编码
- string LenNoN = row.GetValue("LenNoN");//推荐长度编码
- frmOrderLenPln lenPln = new frmOrderLenPln(ob, len, LenNoN);
- lenPln.ShowDialog();
- if (lenPln.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- //获取弹出窗体的属性值
- row.Cells["LenNoN"].Value = lenPln.LenNo;
- row.Cells["LengthdiscN"].Value = lenPln.LengthdiscN;
- }
- }
- }
-
- /// <summary>
- /// 设置完成
- /// </summary>
- private void SetPlanFinish()
- {
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- bool flag = ProducHelper.SetPlanFinish(list, UserInfo.GetUserName(), "D", this.ob);
- if (flag)
- {
- _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- }
- }
- /// <summary>
- /// 调整单倍坯长
- /// </summary>
- private void ModifyGpAimWall()
- {
- this.ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- if (entity.IsRepairPln.Equals("Y"))
- {
- MessageUtil.ShowTips("检修计划不能重算!");
- return;
- }
- if (entity.LenCutend == null)
- {
- //entity.LenCutend = 0;
- MessageUtil.ShowWarning("请输入切尾数据!");
- return;
- }
- if (entity.LenCuthead == null)
- {
- //entity.LenCuthead = 0;
- MessageUtil.ShowWarning("请输入切头数据!");
- return;
- }
- if (entity.DiameterMandrel == null || entity.DiameterMandrel == 0)
- {
- MessageUtil.ShowWarning("未取到芯棒直径!");
- return;
- }
- //不是外购管的判断
- if (!entity.PlineCode.Equals("C065") && !entity.PlineCode.Equals("C072") && !entity.PlineCode.Equals("C066"))
- {
- //判断基础信息是否有切头尾数据
- string cutPlineH = "";//切头
- string cutPlineE = "";//切尾
- DataTable dt = ServerHelper
- .GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryBaseMaterialDPl", new object[] { entity.InwlId, entity.OutwlId, entity.PlineCode }, this.ob);
- if (dt.Rows.Count > 0)
- {
- cutPlineH = dt.Rows[0]["CROP_HEAD"].ToString();
- cutPlineE = dt.Rows[0]["CROP_END"].ToString();
- }
- if (cutPlineH == null || cutPlineH.Equals(""))
- {
- MessageUtil.ShowWarning("基础信息无投入产出物料对应切头数据,请维护!");
- return;
- }
- if (cutPlineE == null || cutPlineE.Equals(""))
- {
- MessageUtil.ShowWarning("基础信息无投入产出物料对应切尾数据,请维护!");
- return;
- }
- }
- if (entity.TubeEndRatio == null)
- {
- entity.TubeEndRatio = 0;
- }
- int lenGpSingle = Convert.ToInt32(entity.LenGpSingle);
- if (lenGpSingle % 10 != 0)
- {
- MessageUtil.ShowWarning("单倍坯长个位数不为0!");
- return;
- }
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否重算?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "modifyGpAimWall";
- ccp.ServerParams = new object[] { jsonList, "0" };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnObject != null)
- {
- List<string> message = (List<string>)JsonConvert.DeserializeObject(
- ccp.ReturnObject.ToString(), typeof(List<string>));
- if (message.Count == 0)
- {
- MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
- + message.Count + "条修改失败。");
- }
- else
- {
- MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
- + message.Count + "条修改失败。\n" + message[0]);
- }
- if (list.Count - message.Count>0)
- {
- Query();
- }
- }
- }
-
- }
- /// <summary>
- /// 调整控制壁厚
- /// </summary>
- private void ModifyThicknesWall()
- {
- this.ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- if (entity.IsRepairPln.Equals("Y"))
- {
- MessageUtil.ShowTips("检修计划不能调整控制壁厚!");
- return;
- }
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改控制壁厚?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "modifyThicknesWall";
- ccp.ServerParams = new object[] { jsonList,this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("调整控制壁厚成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 修改芯棒直接
- /// </summary>
- private void UpdateDiameM()
- {
- try
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = new ArrayList();
- //IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
- ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list1 == null || list1.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
-
- foreach (PlnOrderZgSEntity entity in list1)
- {
- if (entity.IsRepairPln.Equals("Y"))
- {
- MessageUtil.ShowTips("检修计划不能调整芯棒!");
- return;
- }
- if (entity.DiameterMandrel==null||entity.DiameterMandrel.Equals(""))
- {
- PlanComm.WaitFromColse(this.Cursor);
- MessageUtil.ShowWarning("芯棒不能为空,请选择芯棒!");
- return;
- }
- ArrayList param = new ArrayList();
- param.Add(entity.ProPlanId);
- param.Add(entity.GxPlanNo);
- param.Add(entity.DiameterMandrel.ToString());
- list.Add(param);
- }
- if (list.Count == 0)
- {
- PlanComm.WaitFromColse(this.Cursor);
- MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否调整芯棒直径?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
- ccp.MethodName = "updateDimaM";
- ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("芯棒直径调整成功!"))
- {
- Query();
- }
- }
- catch (Exception ex)
- {
- PlanComm.WaitFromColse(this.Cursor);
- if (!(ex is MESException))
- {
- MessageUtil.ShowError(ex.Message);
- }
- }
- }
- /// <summary>
- /// 重新计算
- /// </summary>
- private void Recalculate()
- {
- try
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
-
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- if (entity.IsRepairPln.Equals("Y"))
- {
- MessageUtil.ShowTips("检修计划不能重新计算!");
- return;
- }
- jsonList.Add(JSONFormat.Format(entity));
- }
-
- if (MessageUtil.ShowYesNoAndQuestion("是否重头计算?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "recalculate";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("重新计算完成!"))
- {
- Query();
- }
- }
- catch (Exception ex)
- {
- PlanComm.WaitFromColse(this.Cursor);
- if (!(ex is MESException))
- {
- MessageUtil.ShowError(ex.Message);
- }
- }
- }
- /// <summary>
- ///修改排产月份
- /// </summary>
- private void UpdateMonth()
- {
- try
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- entity.ProMonth = DateTime.Parse(entity.ProMonth.ToString()).ToString("yyyy-MM");
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否调整生产年月?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "updateMonth";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("调整成功!"))
- {
- //ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- //bool flag =InitDataMonth(list1, "D", this.ob);
- //if (flag)
- //{
- // _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
- // _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
- Query();
- //}
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("请输入正确的时间格式!");
- }
- }
- public static bool InitDataMonth(ArrayList entityList, string processCode, OpeBase ob)
- {
- if (entityList == null)
- {
- MessageUtil.ShowWarning("请选择订单!");
- return false;
- }
- ArrayList jsonlist = new ArrayList();
- foreach (Object obj in entityList)
- {
- ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
- if (entity.IfStoveIssued.Equals("Y"))
- {
- MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
- return false;
- }
- if (entity.PlanUseTime == null || entity.PlanUseTime.Equals(""))
- {
- MessageUtil.ShowWarning("计划耗时不能为空!");
- return false;
- }
- jsonlist.Add(entity.JsonStr);
- }
- string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.initData", new object[] { jsonlist, processCode }, ob);
- if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
- else
- {
- //MessageUtil.ShowTips(param[1]);
- if ((bool.Parse(param[0]))) { return true; } else { return false; }
- }
- }
- /// <summary>
- /// 申请审批
- /// </summary>
- private void ApplyApproval()
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- if (entity.LenNoN == null)
- {
- MessageUtil.ShowTips("无推荐长度,不允许申请!");
- return;
- }
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否申请?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "applyApproval";
- ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("申请成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 撤销申请单
- /// </summary>
- private void UndoApply()
- {
- ultraGridZgS.UpdateData();
- UltraGridRow ugrM = ultraGridZgS.ActiveRow;
- if (ugrM == null)
- {
- return;
- }
- if (ugrM.Cells["ApplyNo"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("合同号:" + ugrM.Cells["OrderNo"].Value.ToString() + "未申请,不允许此操作!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- jsonList.Add(ugrM.Cells["ApplyNo"].Value.ToString());
- jsonList.Add(ugrM.Cells["OrdLnDlyPk"].Value.ToString());
- jsonList.Add(ugrM.Cells["ProPlanId"].Value.ToString());
- jsonList.Add(ugrM.Cells["GxPlanNo"].Value.ToString());
- jsonList.Add(ugrM.Cells["LenNoN"].Value.ToString());
- if (MessageUtil.ShowYesNoAndQuestion("是否撤销申请?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "undoApplyApproval";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("撤销申请成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 修改坯子
- /// </summary>
- private void ModifyBatter()
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- entity.OutsBilletFl.ToString();
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "modifyBatter";
- ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- private void ultraGridZgS_KeyUp(object sender, KeyEventArgs e)
- {
- PlanComm.setGridCopyActColumn(this.ultraGridZgS, "CHC", e,
- "OutsBilletFl", "ProMonth");
- }
- /// <summary>
- /// 修改索引码
- /// </summary>
- private void UpdateGroupGp()
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- entity.OutsBilletFl.ToString();
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "updateGroupGp";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 换bom 换钢种
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraTextEditor1_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGridZgS.ActiveRow;
- string exeStatus = row.GetValue("ExeStatus");
- if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
- {
- return;
- }
- string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
- string proPlanId = row.GetValue("ProPlanId");
- string gxPlanNo = row.GetValue("GxPlanNo");
- string gradeCode = row.GetValue("GradeCode");
- string outSurst = "";
- if (gradeCode.Equals(""))
- {
- return;
- }
- if (row.GetValue("OutsBilletFl").Equals("121801"))
- {
- outSurst = "1";//外购
- }
- else
- {
- outSurst = "0";//自炼
- }
-
- if (e.Button.Key.ToLower().Equals("0"))
- {
- if (outSurst.Equals("0"))
- {
- FrmGradeChoose frmgradeC = new FrmGradeChoose(outSurst, this.ob, ordLnDlyPk, proPlanId, gxPlanNo, gradeCode);
- frmgradeC.ShowDialog();
- if (frmgradeC.DialogResult == System.Windows.Forms.DialogResult.OK)
- {
- //获取弹出窗体的属性值
- row.Cells["Gradename"].Value = frmgradeC.Gradename;
- row.Cells["GradeCode"].Value = frmgradeC.Gradecode;
- }
- }
- else
- {
- return;
- }
- }
- else
- {
- string[] groupCic = null;
- if (!row.GetValue("GradeCode").Equals(""))
- {
- groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
- }
- string cicGp = row.GetValue("CicGp");
- //int numz = 0;
- //double wtz = 0;
- //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
- //{
- // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
- // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
- //}
- int numLj = 0;
- double wtLj = 0;
- //if (!row.Cells["LjNum"].Text.ToString().Equals(""))
- //{
- numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
- wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
- //}
- //int batNum = 0;
- //double batWt = 0;
- //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
- //{
- // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
- // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
- //}
- int num =numLj ;
- FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
- frmBomConfirm.ShowDialog();
- bool flag = frmBomConfirm.Flag;
- if (flag) { Query(); }//如果有修改数据,则刷新页面
- }
- }
- /// <summary>
- /// 修改钢种
- /// </summary>
- private void UpdateGradeCode()
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- entity.Gradecode.ToString();
- entity.Gradename.ToString();
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否修改钢种?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "updateGradeCode";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 删除管坯需求号
- /// </summary>
- private void DeleteGperId()
- {
- ultraGridZgS.UpdateData();
- IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList list = new ArrayList();
-
- foreach (UltraGridRow ugr in checkRows)
- {
- ArrayList jsonList = new ArrayList();
- if (!ugr.Cells["LjNum"].Text.ToString().Equals("") && !ugr.Cells["LjNum"].Value.ToString().Equals("0"))
- {
- MessageUtil.ShowTips("有LJ支吨不允许删除管坯需求号!");
- return;
- }
- //if (!ugr.Cells["FurnaNum"].Text.ToString().Equals("") && !ugr.Cells["FurnaNum"].Value.ToString().Equals("0"))
- //{
- // MessageUtil.ShowTips("有装炉支吨不允许删除管坯需求号!");
- // return;
- //}
- //if (!ugr.Cells["CkNum"].Text.ToString().Equals("") && !ugr.Cells["CkNum"].Value.ToString().Equals("0"))
- //{
- // MessageUtil.ShowTips("有出库支吨不允许删除管坯需求号!");
- // return;
- //}
- jsonList.Add(ugr.Cells["ProPlanId"].Value.ToString());
- jsonList.Add(ugr.Cells["GxPlanNo"].Value.ToString());
- list.Add(jsonList);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否删除管坯需求号?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "deleteGperId";
- ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 获取铸造产线
- /// </summary>
- private void UpdateZz()
- {
- ultraGridZgS.UpdateData();
- IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (UltraGridRow entity in checkRows)
- {
- ArrayList List = new ArrayList();
- List.Add(entity.Cells["ProPlanId"].Value.ToString());
- List.Add(entity.Cells["GxPlanNo"].Value.ToString());
- jsonList.Add(List);
- }
- //if (MessageUtil.ShowYesNoAndQuestion("是否修改钢种?") == DialogResult.No)
- //{
- // return;
- //}
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "doUpdateZz";
- ccp.ServerParams = new object[] { jsonList };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- }
- }
- /// <summary>
- /// 订单终止
- /// </summary>
- private void doTermination()
- {
- ArrayList messageErr = new ArrayList();
- ultraGridZgS.UpdateData();
- ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
- if (list == null || list.Count == 0)
- {
- MessageUtil.ShowTips("请选择订单!");
- return;
- }
- ArrayList jsonList = new ArrayList();
- foreach (PlnOrderZgSEntity entity in list)
- {
- entity.Passive.ToString();
- if (!entity.ExeStatus.Equals("计划"))
- {
- MessageUtil.ShowTips("订单不是计划状态不能关闭!");
- return;
- }
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否终止订单?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
- ccp.MethodName = "doTermination";
- ccp.ServerParams = new object[] { jsonList, "D" };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("终止成功!"))
- {
- Query();
- }
- }
- }
- }
|