| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563 |
- 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 FrmPlnOrderZgS : 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 FrmPlnOrderZgS()
- {
- 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 "Confirm"://炉计划下发
- Issued("2");
- break;
- case "UinConfirm"://取消炉计划下发
- Issued("3");
- 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 "AgainProcess"://重新获取工艺
- doAgainProcess();
- break;
- case "SortOrderZg":
- sortOrderZg();
- break;
- case"Print":
- printData();
- break;
- case"Notice":
- tabNotice();
- break;
- case "UpdateOrderTeam"://修改是否协同
- UpdateOrderTeam();
- break;
- case "UpdateOrderRollLen"://修改转移长度下限和上限
- UpdateOrderRollLen();
- 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);
- }
- }
- }
- private void UpdateOrderRollLen()
- {
- 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 = "UpdateOrderRollLen";
- ccp.ServerParams = new object[] { parmList };
- 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]);
- EntityHelper.ShowGridCaption<PlnZyZgMCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- //EntityHelper.ShowGridCaption<PlnZyZgCEntity>(ultraGridZyD.DisplayLayout.Bands[1]);
- 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", "LenRollMin", "LenRollMax" });
- BaseHelper.setColumnBackColor(ultraGridZgS, new string[] { "PlineCode", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "DiameterMandrel", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo", "LenRollMin", "LenRollMax" });
- 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();
- BaseHelper.setUltraGridColumnMaxInput(ultraGrid1, new string[] { "WtGpSingle", "PlnInsingleWt", "PlnOutsingleW", "ActuaWt", "TotWeightM", "CutWeight", "ReducedWt", "RealIndoubleWt" });
- BaseHelper.setUltraGridColumnBits(ultraGrid1, new string[] { "PlnInsingleNum", "PlnOutsingleNum", "ActuaNum", "TotMumM" });
- BaseHelper.InitCellPosition(ultraGrid1, new string[] { "GxProSeq", "GxPlanNo","OrderSeq", "DeliveryNo", "LenRollMax", "LenRollMin", "Aimoutdiameter","Aimwallthick","CcmGxPlanNo","Aimlength" ,"Diameter","LenGpSingle","WtGpSingle","PlnInsingleNum","PlnInsingleWt","PlnOutsingleNum",
- "PlnOutsingleW","Outdiameter", "Wallthick","OutdiameterZg","WallthickZg","RollLength","OutnumCut","LenCutend","LenCuthead","DiameterMandrel","CraftSeq","LenGpSingleD","LengthM","CutNumGp","ActuaWt","ActuaNum","TotMumM","TotWeightM","CutWeight","CutLength", "ReducedWt","RealIndoubleNum","RealIndoubleWt","ActCount"});
- //BaseHelper.InitCellPositionC(ultraGridZyD, new string[] { "Diameter", "LenGpSingle", "WtGpSingle", "CutNumGp", "LengthM", "WeightM", "PlanIndoubleNum", "PlanIndoubleWt", "RealIndoubleNum", "RealIndoubleWt", "GxPlanNo" });
- BaseHelper.GridColumnSum(ultraGrid1, new string[] { "ActuaWt", "CutWeight", "RealIndoubleWt" });
- BaseHelper.GridColumnCount(ultraGrid1, new string[] { "ActuaNum", "RealIndoubleNum" });
- StoveHelper.ForbidSort(ultraGrid1);
- BaseHelper.SetGroupBySum(ultraGrid1, new string[] { "PlnOutsingleNum", "PlnOutsingleW", "ReducedWt" }, "HeatPlanNo");
- }
- /// <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 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("是"))
- {
- 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);
- }
- /// <summary>
- /// 实际炉计划
- /// </summary>
- /// <param name="proPlanId"></param>
- /// <param name="gxPlanNo"></param>
- private void doQueryActual(string proPlanId, string gxPlanNo)
- {
- List<PlnZyZgMCEntity> listSourceM = EntityHelper.GetData<PlnZyZgMCEntity>
- ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryActual", new object[] { proPlanId, gxPlanNo }, ob);
- plnZyZgMCEntityBindingSource.DataSource = listSourceM;
- foreach (UltraGridRow ugr in ultraGrid1.Rows)
- {
- ugr.Cells["DELETE"].Value = "删除炉计划";
- //没有实际炉计划,主炉计划变颜色
- if (ugr.Cells["ActuaWt"].Value.ToString().Equals(""))
- {
- //ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
- ugr.Appearance.BackColor = Color.Orange;
- }
- if (!string.IsNullOrEmpty(ugr.Cells["ApplyDesc"].Value.ToString2()))
- {
- ugr.Appearance.BackColor = Color.Red;
- }
- //if (!ugr.Cells["Planstatus"].Value.ToString().Equals("计划") && ugr.Cells["Planstatus"].Value.ToString().Equals("下发"))
- //{
- // if (int.Parse(ugr.Cells["ActCount"].Value.ToString()) > 0)
- // {
- // ugr.Cells["ActCount"].Column.CellAppearance.BackColor = Color.;
- // }
- //}
- }
- }
- 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")) { } }
- }
- /// <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"))
- {int count=0;
- foreach (UltraGridRow row in checkRows)
- {
-
- if (row.Cells["LenCuthead"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",切头无数据,不允许确认!");
- return;
- }
- if (row.Cells["LenCutend"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",切尾无数据,不允许确认!");
- return;
- }
- if (!row.Cells["Verify1"].Text.Trim().Equals(""))
- {
- string str = row.Cells["Verify1"].Text.Trim();
- string[] strArray = str.Split(new char[2] { ':', 'm' });
- double len = double.Parse(strArray[1].ToString());
- if (len - 4 > 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",管余长大于4m,是否确认!") == DialogResult.No) return;
- }
- if (len < 0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",管余长小于0,是否确认!") == DialogResult.No) return;
- }
- }
- if (double.Parse(row.Cells["Aimlength"].Value.ToString()) >= 13.5 && row.Cells["WholeBacklogDesc"].Text.Trim().Contains("热处理"))
- {
- if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",目标长度可能超限,需热处理确认长度,是否确认!") == DialogResult.No) return;
-
- }
- //if (!row.Cells["Verify2"].Text.Trim().Equals(""))
- //{
- // MessageUtil.ShowTips("长度超出范围!");
- // return;
- //}
- int numS = 0;//排产支
- int plansNum = 0;//计划产出支
- if (!row.Cells["NumS"].Text.ToString().Trim().Equals(""))
- {
- numS = int.Parse(row.Cells["NumS"].Value.ToString());
- }
- if (!row.Cells["PlansNum"].Text.ToString().Trim().Equals(""))
- {
- plansNum = int.Parse(row.Cells["PlansNum"].Value.ToString());
- }
- if (numS <= 0)
- {
- MessageUtil.ShowTips("排产支数小于等于0!");
- return;
- }
- int num = plansNum / numS;
- if (!row.Cells["Verify3"].Text.Trim().Equals("") || num > 2)
- {
- count++;
- //if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",连轧后长度小于托管机最短,脱不出或计划产出支除以排产支大于2,是否继续?") == DialogResult.No) return;
- }
- //if (row.Cells["CicGp"].Text.Trim().Equals(""))
- //{
- // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",钢种索引码为空!");
- // return;
- //}
- if (!row.Cells["LengthdiscN"].Text.Trim().Equals("") && row.Cells["ApplyStatus"].Text.Trim().Equals(""))
- {
- MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",推荐合同长度未申请!");
- return;
- }
- if (row.Cells["ApplyStatus"].Text.Trim().Equals("申请"))
- {
- MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",推荐合同长度未审核!");
- return;
- }
- }
- if (count>0)
- {
- if (MessageUtil.ShowYesNoAndQuestion("其中有" + count + "条,连轧后长度小于托管机最短,脱不出或计划产出支除以排产支大于2,是否继续?") == DialogResult.No) return;
- }
- }
- else if (isFlag.Equals("2"))
- {
- string porderstatus = "";//合同状态
- foreach (UltraGridRow row in checkRows)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryPorderstatus", new object[] { row.Cells["OrdLnDlyPk"].Text.Trim() }, ob);
- if (dt.Rows.Count > 0)
- {
- porderstatus = dt.Rows[0]["PORDERSTATUS"].ToString();
- }
- if (porderstatus.Equals("4") || porderstatus.Equals("5"))
- {
- MessageUtil.ShowTips("该合同已生产完成或关闭,请联系销售!");
- return;
- }
- //if (row.Cells["IsPlanOk"].Text.Trim().Equals("是"))
- //{
- // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",未确认,不允许炉计划下发!");
- // return;
- //}
- //if (row.Cells["ZyBatchId"].Text.Equals(""))
- //{
- // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",轧批号不能为空!");
- // return;
- //}
- }
- }
- //else if (isFlag.Equals("3"))
- //{//取消炉计划下发
- // foreach (UltraGridRow row in checkRows)
- // {
- // 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 = numz + numLj + batNum;
- // if (numz > 0)
- // {
- // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已装炉,不能撤销下发!");
- // return;
- // }
- // if (numLj > 0)
- // {
- // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已LJ,不能撤销下发!");
- // return;
- // }
- // if (batNum > 0)
- // {
- // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已出库,不能撤销下发!");
- // return;
- // }
- // }
- //}
- //else if (isFlag.Equals("1"))
- //{
- // foreach (UltraGridRow row in checkRows)
- // {
- // if (row.Cells["IfStoveIssued"].Text.Trim().Equals("是"))
- // {
- // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已炉计划下发!");
- // 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("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;
- //JGI202407013130
- 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 ultraExpandableGroupBox1_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (ultraExpandableGroupBox1.Expanded == false)
- {
- this.splitContainer1.SplitterDistance = splitContainer1.Size.Height - 26;
- }
- else
- {
- this.splitContainer1.SplitterDistance = splitterDistance == 0 ? splitContainer1.Size.Height / 2 : splitterDistance;
- }
- }
- private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
- {
- if (e.Cell.Column.Key.Equals("DELETE"))
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- int countChc = 0;
- if (!row.Cells["Planstatus"].Text.ToString().Trim().Equals("计划"))
- {
- MessageUtil.ShowTips("您选择轧管炉计划已不是计划状态,不能删除炉计划!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认删除炉计划?") ==DialogResult.No)
- return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmRollTubeLibraryZg";
- ccp.MethodName = "doDeleteZGC";
- ccp.ServerParams = new object[] { row.Cells["HeatPlanNo"].Text.ToString().Trim(), row.Cells["HeatPlanSqe"].Text.ToString().Trim(), this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- doQueryActual(proPlanId, gxPlanNo);
- }
- }
- }
- 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 炉计划层操作
- /// <summary>
- /// 炉计划按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "DeleteStatr"://删除剩余炉计划
- doDeleteStatr();
- break;
- case "AgainProcess"://重新获取工艺
- doAgainProcess();
- break;
- case "LuClose"://手动关闭炉计划
- doLuClose();
- break;
- default:
- break;
- }
- }
- /// <summary>
- /// 删除剩余炉计划
- /// </summary>
- private void doDeleteStatr()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- int countM = 0;
- int countC = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (item.Cells["Planstatus"].Text.ToString().Equals("计划") || item.Cells["Planstatus"].Text.ToString().Equals("下发"))
- {
- MessageUtil.ShowTips("选中该炉计划是计划/下发状态,不能删除!");
- return;
- }
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选炉计划信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是删除剩余炉计划?") == DialogResult.No) return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doDeleteStatr";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return ;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- doQueryActual(proPlanId, gxPlanNo);
- }
- }
- /// <summary>
- /// 重新获取工艺
- /// </summary>
- private void doAgainProcess()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选炉计划信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否获取工艺?") == DialogResult.No) return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
- ccp.MethodName = "doAgainProcess";
- ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, "D" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("获取成功!"))
- {
- doQueryActual(proPlanId, gxPlanNo);
- }
- }
- /// <summary>
- /// 手动关闭炉计划
- /// </summary>
- private void doLuClose()
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- string heatPlanNo = "";
- foreach (UltraGridRow item in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- if (item.Cells["Planstatus"].Text.ToString().Equals("关闭"))
- {
- MessageUtil.ShowTips("选中该炉计划是关闭状态,不能重复关闭!");
- return;
- }
- if (!heatPlanNo.Equals(item.Cells["HeatPlanNo"].Text.ToString()))
- {
- heatPlanNo = item.Cells["HeatPlanNo"].Text.ToString().Trim();
- list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选炉计划信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否关闭炉计划?") == DialogResult.No) return;
- PlanComm.WaitFromOpen(this.Cursor);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
- ccp.MethodName = "doLuClose";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- PlanComm.WaitFromColse(this.Cursor);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("关闭成功!"))
- {
- doQueryActual(proPlanId, gxPlanNo);
- }
- }
- #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();
- }
- }
- }
|