| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991 |
- 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;
- using Core.StlMes.Client.PlnSaleOrd.PopupWindow;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
- using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
- namespace Core.StlMes.Client.PlnSaleOrd
- {
- ///custominfo==0 表示轧管排产查询界面
- /// <summary>
- /// 轧制排产
- /// </summary>
- public partial class FrmPlnOrderCS : FrmBase
- {
- private string departm = "";//获取部门ID
- private string[] plineCode = null;//获取产线代码
- /// <summary>
- /// 订单编号
- /// </summary>
- private string _ProPlanId = "";
- DataTable dtPlinGroup = null;
- /// <summary>
- /// 排产序号
- /// </summary>
- private string _GxPlanNo = "";
- UltraComboEditor uceDimaM = new UltraComboEditor();//芯棒直径
- /// <summary>
- /// 行首背景色
- /// </summary>
- private Color _backColor = new Color();
- string proPlanId = "";
- string gxPlanNo = "";
- /// <summary>
- /// 调整行集合
- /// </summary>
- private ArrayList _entityList = null;
- public FrmPlnOrderCS()
- {
- 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 "DeleteRepairPlan"://删除检修计划
- DeleteRepairPlan();
- break;
-
- case "TimeChange"://时间调整
- TimeChange();
- break;
- case "StatusChange"://状态调整
- StatusChange();
- break;
- case "InitData"://耗时初始化
- InitData();
- 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 "UpdateBatch"://修改轧批号
- UpdateBatch();
- break;
- case "Decision"://修改判定字头
- DoDecision();
- break;
- case "ProMemo"://工艺备注修改
- DoProMemo("0");
- break;
- case "UpdateMemo"://计划备注修改
- DoProMemo("1");
- break;
- case "Import"://导入
- DoImport();
- break;
- case "UpdatePase"://主被动修改
- DoUpdatePase();
- break;
- case "ModifyProcess"://手动获取工艺
- DoModifyProcess();
- break;
-
- case "SortOrderZg":
- sortOrderZg();
- break;
- case"Print":
- printData();
- break;
- case"Notice":
- tabNotice();
- break;
- case "UpdateOrderTeam"://修改是否协同
- UpdateOrderTeam();
- break;
- case "Close": //关闭
- this.Close();
- break;
- default:
- break;
- }
- }
- private void UpdateOrderTeam()
- {
- this.ultraGridZgS.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要操作的数据信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
- string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
- parmList.Add(plnOrderZgsEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
- ccp.MethodName = "UpdateOrderTeam";
- ccp.ServerParams = new object[] { parmList, "D" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- Query();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 标识监制信息
- /// </summary>
- private void tabNotice()
- {
- this.ultraGridZgS.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要操作的监制信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
- string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
- parmList.Add(plnOrderZgsEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
- ccp.MethodName = "tabNotice";
- ccp.ServerParams = new object[] { parmList, UserInfo.GetUserName(),"D" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("标识监制成功!"))
- {
- Query();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 重新排序订单
- /// </summary>
- private void sortOrderZg()
- {
- string plineCode = "";
- plineCode = comPline.Value == null ? "" : comPline.Value.ToString();
- if (plineCode.Equals(""))
- {
- MessageUtil.ShowTips("请选择产线!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
- ccp.MethodName = "sortOrderZg";
- ccp.ServerParams = new object[] { plineCode };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("重新排序成功!"))
- {
- Query();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印检验要点
- /// </summary>
- private void printData()
- {
- UltraGridRow row = ultraGridZgS.ActiveRow;
- if (row == null) return;
- if (row.Cells["ZyBatchId"].Text.Equals("")) return;
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilTestKey2.cpt&PROCESS_CODE=D&ORDER_NO=" + row.Cells["OrderNo"].Value.ToString();
- 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();
- }
- 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"
- }
- else
- {
- BaseHelper.setOtherColumnReadOnly(ultraGridZgS, new string[] { "CHC", "PlineCode", "PlanTimeB", "RepairType", "PlanUsetime", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
- BaseHelper.setColumnBackColor(ultraGridZgS, new string[] { "PlineCode", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "DiameterMandrel", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
- EntityHelper.setColumnShowOrHidden(ultraGridZgS, new string[] { "OrderTeam" }, false);
- }
- 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","ReducedWt","LjWeightB","LjNumB" });
- BaseHelper.setUltraGridColumnMaxInput(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "InWeightS", "AddWtIn", "MatchWtIn", "BatchedWt", "AmountDifference", "UnfinishWgt", "LjWeight", "FurnaWeight", "CkWeight", "ExpectWt", "PendWeight", "ReducedWt", "LjWeightB" });
- plineCode= PlanHelper.InitDropPlinePower("D",comPline,this.ValidDataPurviewIds, this.ob);
- PlanHelper.InitRepairType(ultraGridZgS, this);
- PlanHelper.InitEditPline("D", "", ultraGridZgS, this);
- comPline.SelectedIndex = 0;
- if (CustomInfo != "0") { BaseHelper.ForbidSort(ultraGridZgS); }
- BaseHelper.GridColumnSum(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "PendWeight", "ReducedWt", "LjWeight", "ExpectWt", "FurnaWeight", "CkWeight", "LjWeightB" });
- BaseHelper.GridColumnCount(ultraGridZgS, new string[] { "NumS", "GpreqNum", "PlansNum", "PendNum", "LjNumB", "LjNum", "FurnaNum", "CkNum", });
- //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["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;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["ProdGradename"].CellAppearance.BackColor = Color.Wheat;
- 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];
- decisionFlsg(false);
-
- }
- private void decisionFlsg( Boolean b) {
- if (b)
- {
- UltraComboEditor uceAbc = new UltraComboEditor();
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = uceAbc;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ValueList vlistSteel = new ValueList(); ;
- vlistSteel.ValueListItems.Insert(0, "A", "A");
- vlistSteel.ValueListItems.Insert(1, "B", "B");
- vlistSteel.ValueListItems.Insert(2, "C", "C");
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].ValueList = vlistSteel;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.AllowEdit;
- }
- else {
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = null;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Default;
- ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.ActivateOnly;
- }
- }
- 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") && comPlineCode.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;
- }
- string lotNoS = "";
- string lotNoE = "";
- if(chkLotNo.Checked)
- {
- lotNoS = lotNoStart.Text.Trim();
- lotNoE = lotNoEnd.Text.Trim();
- }
- 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, lotNoS,lotNoE }, this.ob);
- plnOrderZgSOEntityBindingSource.DataSource = listSource;
-
- //ProducHelper.copyLZData(ultraGridZgS, "D", this.ob);
- //ProducHelper.copyLZDataZg(ultraGridZgS, "D", this.ob);
- dtPlinGroup = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlinCodeGroup", null, 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[3] { '天', ',', '条' });
- 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 (ultraGridZgS.DisplayLayout.Bands[0].Columns.Exists("CraftFileLv2GPath"))
- {
- string craftFileLv2G = ugr.Cells["CraftFileLv2G"].Text.Trim();
- string[] name = craftFileLv2G.Split(new char[1] { '/' });
- ugr.Cells["CraftFileLv2GPath"].Value = craftFileLv2G;
- ugr.Cells["CraftFileLv2G"].Value = name[name.Length - 1];
- }
- 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();
- //}
- }
- }
- if (ugr.Cells["IsNoticeEp"].Text.Equals("已通知"))
- {
- ugr.Cells["IsNoticeEp"].Appearance.BackColor = Color.GreenYellow;
- 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 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("是"))
- {
- ugr.Cells["PlanUsetime"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- ugr.Cells["RepairType"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
- }
- }
-
- proPlanId = ugrAc.Cells["ProPlanId"].Text.ToString();
- gxPlanNo = ugrAc.Cells["GxPlanNo"].Text.ToString();
- //doQueryVirtual(ugrAc.Cells["ProPlanId"].Text.ToString(), ugrAc.Cells["GxPlanNo"].Text.ToString());
- // doQueryActual(proPlanId, gxPlanNo);
- }
- /// <summary>
- /// 虚拟炉计划
- /// </summary>
- /// <param name="proPlanId"></param>
- /// <param name="gxPlanNo"></param>
- private void doQueryVirtual(string proPlanId, string gxPlanNo)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryVirtual",
- new object[] { proPlanId, gxPlanNo }, this.ob);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
-
- private void ultraGridZgS_CellChange(object sender, CellEventArgs e)
- {
- try
- {
- ultraGridZgS.UpdateData();
- if (e.Cell.Column.Key.Equals("CHC"))
- {
- IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
- if (chcRows != null && chcRows.Count() > 0)
- {
- decisionFlsg(true);
- }
- else {
- decisionFlsg(false);
- }
- }
- 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")) { } }
- }
-
- 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("CraftFileLv2GPath");
- 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;
- if (!frmDm.LenSingerBill.Equals("0") && double.Parse(frmDm.LenSingerBill) < double.Parse(row.Cells["LenGpSingle"].Value.ToString()))
- {
- row.Cells["LenGpSingle"].Value = frmDm.LenSingerBill;
- }
- }
- }
- else if (e.Cell.Column.Key.Equals("ApplyNo"))
- {
- UndoApply();
- }
- else if (e.Cell.Column.Key.Equals("LengthdiscN"))
- {
- if (row.GetValue("OrdLnDlyPk").Contains("ZZBY-"))
- {
- MessageUtil.ShowTips("该合同是备料需求合同,不允许修改推荐长度描述!");
- return;
- }
- 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("是"))
- {
- 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;
- }
- DataTable ds = ServerHelper.GetData("com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp.selectMangageLen", new object[] { entity.ProPlanId, entity.GxPlanNo }, ob);
- if (Double.Parse(ds.Rows[0][0].ToString()) > 0)
- {
- if (entity.LenGpSingle > decimal.Parse(ds.Rows[0][0].ToString()))
- {
- MessageUtil.ShowTips("订单单倍坯长不允许大于芯棒对应最大单倍坯长!");
- return;
- }
- }
- //不是外购管的判断
- if (!entity.PlineCode.Equals("C065") && !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("是"))
- {
- 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("是"))
- {
- 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("是"))
- {
- MessageUtil.ShowTips("检修计划已确认不能重新计算!");
- return;
- }
- //if (entity.OrderSource.Equals("排产补量"))
- //{
- // MessageUtil.ShowTips("排产补量不能重新计算!");
- // return;
- //}
- //int numz = 0;
- //double wtz = 0;
- //if (entity.FurnaNum!=null&&!entity.FurnaNum.Equals(""))
- //{
- // numz = int.Parse(entity.FurnaNum.ToString());
- // wtz = double.Parse(entity.FurnaWeight.ToString());
- //}
- //int numLj = 0;
- //double wtLj = 0;
- //if (entity.LjNum != null && !entity.LjNum.Equals(""))
- //{
- // numLj = int.Parse(entity.LjNum.ToString());
- // wtLj = double.Parse(entity.LjWeight.ToString());
- //}
- //int batNum = 0;
- //double batWt = 0;
- //if (entity.CkNum != null && !entity.CkNum.Equals(""))
- //{
- // batNum = int.Parse(entity.CkNum.ToString());
- // batWt = double.Parse(entity.CkWeight.ToString());
- //}
- //int num = numz + numLj + batNum;
- //if (numz > 0)
- //{
- // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo+ ",已装炉,不允许重头算!");
- // return;
- //}
- //if (numLj > 0)
- //{
- // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已Lj,不允许重头算!");
- // return;
- //}
- //if (batNum > 0)
- //{
- // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已出库,不允许重头算!");
- // 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("是"))
- {
- 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>
- /// 修改轧批号
- /// </summary>
- private void UpdateBatch()
- {
- 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.ZyBatchId.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 = "updateBatch";
- 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 DoDecision()
- {
- 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.Decision.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 = "doDecision";
- 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 DoImport()
- {
- try
- {
- OpenFileDialog dialog = new OpenFileDialog();
- if (dialog.ShowDialog() == DialogResult.OK)
- {
- FrmImportSetPlnZg import = new FrmImportSetPlnZg(this.ob);
- import.ModelPatch = dialog.FileName;
- import.ShowDialog();
-
- }
- Query();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
-
- }
- /// <summary>
- /// 修改工艺备注
- /// </summary>
- private void DoProMemo(string falsg)
- {
- 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.Memo.ToString();
- jsonList.Add(JSONFormat.Format(entity));
- }
- if (MessageUtil.ShowYesNoAndQuestion(falsg.Equals("0") ? "是否工艺备注修改?" : "是否计划备注修改?") == DialogResult.No)
- {
- return;
- }
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
- ccp.MethodName = "doProMemo";
- ccp.ServerParams = new object[] { jsonList, falsg };
- 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 DoUpdatePase()
- {
- 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();
- 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 = "doUpdatePase";
- 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();
- }
- }
- private int splitterDistance = 0;
-
-
- private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
- {
- StoveHelper.CustomMergedCellEvaluator merge = new StoveHelper.CustomMergedCellEvaluator("HeatPlanNo");
- e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["Memo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["Memo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["StoveNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["StoveNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["GxProSeq"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["GxProSeq"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["TotMumM"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["TotMumM"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["totWeightM"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["totWeightM"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["Planstatus"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["Planstatus"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellEvaluator = merge;
- e.Layout.Bands[0].Columns["ReducedWt"].MergedCellStyle = MergedCellStyle.Always;
- e.Layout.Bands[0].Columns["ReducedWt"].MergedCellEvaluator = merge;
- }
- /// <summary>
- /// 订单层重新获取工艺
- /// </summary>
- private void DoModifyProcess()
- {
- 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();
- 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 = "DoModifyProcess";
- 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();
- }
- }
- /// <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();
- }
- }
- #region 炉计划层操作
-
- #endregion
- private void chkLotNo_CheckedChanged(object sender, EventArgs e)
- {
- lotNoStart.Enabled = lotNoEnd.Enabled = chkLotNo.Checked;
- }
- private void cmbPro_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- this.ultraGridZgS.UpdateData();
- UltraGridRow row = this.ultraGridZgS.ActiveRow;
- if (row == null)
- {
- return;
- }
- FrmProInformation fp = new FrmProInformation(ob, row.Cells["PrdcrNo"].Text, row.Cells["IndexSeq"].Text, "D");
- fp.ShowDialog();
- }
- }
- }
|