FrmPlnOrderCS.cs 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Core.Mes.Client.Comm.Control;
  11. using Core.Mes.Client.Comm.Format;
  12. using Core.Mes.Client.Comm.Server;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
  15. using Core.StlMes.Client.PlnSaleOrd.工序排产;
  16. using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
  17. using CoreFS.CA06;
  18. using Infragistics.Win;
  19. using Infragistics.Win.UltraWinEditors;
  20. using Infragistics.Win.UltraWinGrid;
  21. using Core.StlMes.Client.PlnSaleOrd.OrderManage.froms;
  22. using Newtonsoft.Json;
  23. using Core.StlMes.Client.PlnSaleOrd.窗体;
  24. using Core.Mes.Client.Comm;
  25. using Core.StlMes.Client.PlnSaleOrd.PopupWindow;
  26. using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
  27. using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
  28. namespace Core.StlMes.Client.PlnSaleOrd
  29. {
  30. ///custominfo==0 表示轧管排产查询界面
  31. /// <summary>
  32. /// 轧制排产
  33. /// </summary>
  34. public partial class FrmPlnOrderCS : FrmBase
  35. {
  36. private string departm = "";//获取部门ID
  37. private string[] plineCode = null;//获取产线代码
  38. /// <summary>
  39. /// 订单编号
  40. /// </summary>
  41. private string _ProPlanId = "";
  42. DataTable dtPlinGroup = null;
  43. /// <summary>
  44. /// 排产序号
  45. /// </summary>
  46. private string _GxPlanNo = "";
  47. UltraComboEditor uceDimaM = new UltraComboEditor();//芯棒直径
  48. /// <summary>
  49. /// 行首背景色
  50. /// </summary>
  51. private Color _backColor = new Color();
  52. string proPlanId = "";
  53. string gxPlanNo = "";
  54. /// <summary>
  55. /// 调整行集合
  56. /// </summary>
  57. private ArrayList _entityList = null;
  58. public FrmPlnOrderCS()
  59. {
  60. InitializeComponent();
  61. this.IsLoadUserView = true;
  62. }
  63. public override void ToolBar_Click(object sender, string ToolbarKey)
  64. {
  65. base.ToolBar_Click(sender, ToolbarKey);
  66. switch (ToolbarKey)
  67. {
  68. case "Query"://查询
  69. Query();
  70. break;
  71. case "DeleteRepairPlan"://删除检修计划
  72. DeleteRepairPlan();
  73. break;
  74. case "TimeChange"://时间调整
  75. TimeChange();
  76. break;
  77. case "StatusChange"://状态调整
  78. StatusChange();
  79. break;
  80. case "InitData"://耗时初始化
  81. InitData();
  82. break;
  83. case "SetPlanFinish"://设置合同完成
  84. SetPlanFinish();
  85. break;
  86. case "ModifyGpAimWall"://重算
  87. ModifyGpAimWall();
  88. break;
  89. case "UpdateCrop"://修改切头尾
  90. UpdateCrop();
  91. break;
  92. case "UpdateDiameM"://修改芯棒直径
  93. UpdateDiameM();
  94. break;
  95. case "ModifyThicknesWall"://修改控制壁厚
  96. ModifyThicknesWall();
  97. break;
  98. case "Recalculate"://重新计算
  99. Recalculate();
  100. break;
  101. case "Export": //导出
  102. GridHelper.ulGridToExcel(ultraGridZgS, "轧管排产信息");
  103. break;
  104. case "UpdateMonth"://修改排产月份
  105. UpdateMonth();
  106. break;
  107. case "ApplyApproval"://申请审批
  108. ApplyApproval();
  109. break;
  110. case "ModifyBatter"://修改坯子
  111. ModifyBatter();
  112. break;
  113. case "UpdateGroupGp"://修改索引码
  114. UpdateGroupGp();
  115. break;
  116. case "UpdateBatch"://修改轧批号
  117. UpdateBatch();
  118. break;
  119. case "Decision"://修改判定字头
  120. DoDecision();
  121. break;
  122. case "ProMemo"://工艺备注修改
  123. DoProMemo("0");
  124. break;
  125. case "UpdateMemo"://计划备注修改
  126. DoProMemo("1");
  127. break;
  128. case "Import"://导入
  129. DoImport();
  130. break;
  131. case "UpdatePase"://主被动修改
  132. DoUpdatePase();
  133. break;
  134. case "ModifyProcess"://手动获取工艺
  135. DoModifyProcess();
  136. break;
  137. case "SortOrderZg":
  138. sortOrderZg();
  139. break;
  140. case"Print":
  141. printData();
  142. break;
  143. case"Notice":
  144. tabNotice();
  145. break;
  146. case "UpdateOrderTeam"://修改是否协同
  147. UpdateOrderTeam();
  148. break;
  149. case "Close": //关闭
  150. this.Close();
  151. break;
  152. default:
  153. break;
  154. }
  155. }
  156. private void UpdateOrderTeam()
  157. {
  158. this.ultraGridZgS.UpdateData();
  159. IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
  160. if (checkMagRows.Count() == 0)
  161. {
  162. MessageUtil.ShowTips("请选择需要操作的数据信息!");
  163. return;
  164. }
  165. ArrayList parmList = new ArrayList();
  166. foreach (UltraGridRow row in checkMagRows)
  167. {
  168. PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
  169. string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
  170. parmList.Add(plnOrderZgsEntity);
  171. }
  172. CoreClientParam ccp = new CoreClientParam();
  173. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  174. ccp.MethodName = "UpdateOrderTeam";
  175. ccp.ServerParams = new object[] { parmList, "D" };
  176. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  177. if (ccp.ReturnCode != -1)
  178. {
  179. if (ccp.ReturnInfo.Equals("修改成功!"))
  180. {
  181. Query();
  182. MessageUtil.ShowTips(ccp.ReturnInfo);
  183. }
  184. else
  185. {
  186. MessageUtil.ShowTips(ccp.ReturnInfo);
  187. }
  188. }
  189. }
  190. /// <summary>
  191. /// 标识监制信息
  192. /// </summary>
  193. private void tabNotice()
  194. {
  195. this.ultraGridZgS.UpdateData();
  196. IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
  197. if (checkMagRows.Count() == 0)
  198. {
  199. MessageUtil.ShowTips("请选择需要操作的监制信息!");
  200. return;
  201. }
  202. ArrayList parmList = new ArrayList();
  203. foreach (UltraGridRow row in checkMagRows)
  204. {
  205. PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
  206. string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
  207. parmList.Add(plnOrderZgsEntity);
  208. }
  209. CoreClientParam ccp = new CoreClientParam();
  210. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  211. ccp.MethodName = "tabNotice";
  212. ccp.ServerParams = new object[] { parmList, UserInfo.GetUserName(),"D" };
  213. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  214. if (ccp.ReturnCode != -1)
  215. {
  216. if (ccp.ReturnInfo.Equals("标识监制成功!"))
  217. {
  218. Query();
  219. MessageUtil.ShowTips(ccp.ReturnInfo);
  220. }
  221. else
  222. {
  223. MessageUtil.ShowTips(ccp.ReturnInfo);
  224. }
  225. }
  226. }
  227. /// <summary>
  228. /// 重新排序订单
  229. /// </summary>
  230. private void sortOrderZg()
  231. {
  232. string plineCode = "";
  233. plineCode = comPline.Value == null ? "" : comPline.Value.ToString();
  234. if (plineCode.Equals(""))
  235. {
  236. MessageUtil.ShowTips("请选择产线!");
  237. return;
  238. }
  239. CoreClientParam ccp = new CoreClientParam();
  240. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  241. ccp.MethodName = "sortOrderZg";
  242. ccp.ServerParams = new object[] { plineCode };
  243. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  244. if (ccp.ReturnCode != -1)
  245. {
  246. if (ccp.ReturnInfo.Equals("重新排序成功!"))
  247. {
  248. Query();
  249. MessageUtil.ShowTips(ccp.ReturnInfo);
  250. }
  251. else
  252. {
  253. MessageUtil.ShowTips(ccp.ReturnInfo);
  254. }
  255. }
  256. }
  257. /// <summary>
  258. /// 打印检验要点
  259. /// </summary>
  260. private void printData()
  261. {
  262. UltraGridRow row = ultraGridZgS.ActiveRow;
  263. if (row == null) return;
  264. if (row.Cells["ZyBatchId"].Text.Equals("")) return;
  265. 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();
  266. FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
  267. fBug.AutoSize = true;
  268. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  269. fBug.Text = "检验要点打印";
  270. fBug.ShowDialog();
  271. }
  272. private void FrmPlnOrderZgS_Load(object sender, EventArgs e)
  273. {
  274. if (CustomInfo == null) { CustomInfo = ""; }
  275. //设置列头名称
  276. EntityHelper.ShowGridCaption<PlnOrderZgSOEntity>(ultraGridZgS.DisplayLayout.Bands[0]);
  277. if (CustomInfo == "0")
  278. {
  279. PlanComm.setGridActivation(this.ultraGridZgS.DisplayLayout.Bands[0], "CHC", "ProMonth");//, "OutsBilletFl"
  280. }
  281. else
  282. {
  283. BaseHelper.setOtherColumnReadOnly(ultraGridZgS, new string[] { "CHC", "PlineCode", "PlanTimeB", "RepairType", "PlanUsetime", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
  284. BaseHelper.setColumnBackColor(ultraGridZgS, new string[] { "PlineCode", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "DiameterMandrel", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
  285. EntityHelper.setColumnShowOrHidden(ultraGridZgS, new string[] { "OrderTeam" }, false);
  286. }
  287. BaseHelper.InitCellPosition(ultraGridZgS, new string[] { "GxPlanNo", "OrderSeq", "DeliveryNo", "Outdiameter", "Wallthick",
  288. "LenRollMax", "LenRollMin", "Aimoutdiameter", "Aimwallthick", "Aimlength", "DiameterGp", "LenGpSingle", "RollLength",
  289. "LenCuthead", "LenCutend", "OutnumCut", "DiameterMandrel", "InWeightS", "InNumS", "WeigthS", "NumS", "AddWtIn",
  290. "AddNumIn", "MatchWtIn", "MatchNumIn", "GxProSeq", "PlanUsetime", "BatchedWt", "BatchedNum", "Finishweight",
  291. "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" });
  292. BaseHelper.setUltraGridColumnMaxInput(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "InWeightS", "AddWtIn", "MatchWtIn", "BatchedWt", "AmountDifference", "UnfinishWgt", "LjWeight", "FurnaWeight", "CkWeight", "ExpectWt", "PendWeight", "ReducedWt", "LjWeightB" });
  293. plineCode= PlanHelper.InitDropPlinePower("D",comPline,this.ValidDataPurviewIds, this.ob);
  294. PlanHelper.InitRepairType(ultraGridZgS, this);
  295. PlanHelper.InitEditPline("D", "", ultraGridZgS, this);
  296. comPline.SelectedIndex = 0;
  297. if (CustomInfo != "0") { BaseHelper.ForbidSort(ultraGridZgS); }
  298. BaseHelper.GridColumnSum(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "PendWeight", "ReducedWt", "LjWeight", "ExpectWt", "FurnaWeight", "CkWeight", "LjWeightB" });
  299. BaseHelper.GridColumnCount(ultraGridZgS, new string[] { "NumS", "GpreqNum", "PlansNum", "PendNum", "LjNumB", "LjNum", "FurnaNum", "CkNum", });
  300. //BaseHelper.InitCellPositionMiddle(ultraGridZgS, new string[] { "IsRepairPln", "IsPlanOk", "IfMonitorZg", "GpreqIfOk", "Isendgx" });
  301. BaseHelper.setUltraGridColumnColor(ultraGridZgS, new string[] { "CraftFileNo", "CraftFileLv2G", "Gradename", "DiameterGp" }, Color.GreenYellow);
  302. //PlanHelper.InitEditGroup("1218", ultraGridZgS, this, "OutsBilletFl");
  303. PlanHelper.InitEditGroup("1219", ultraGridZgS, this, "OutsStlPipeFl");
  304. _backColor = ultraGridZgS.DisplayLayout.Override.RowSelectorAppearance.BackColor;
  305. InitTime();
  306. InitColorStyle();
  307. }
  308. /// <summary>
  309. /// 初始化列状态
  310. /// </summary>
  311. private void InitColorStyle()
  312. {
  313. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Format = "yyyy-MM-dd HH:mm:ss";
  314. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].MaskInput = "yyyy-mm-dd hh:mm:ss";
  315. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime;
  316. ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileLv2G"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  317. ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileNo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  318. ultraGridZgS.DisplayLayout.Bands[0].Columns["Gradename"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  319. ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterGp"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  320. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  321. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].CellAppearance.BackColor = Color.GreenYellow;
  322. ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  323. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].CellAppearance.BackColor = Color.GreenYellow;
  324. ultraGridZgS.DisplayLayout.Bands[0].Columns["TimeDiffer"].CellAppearance.BackColor = Color.GreenYellow;
  325. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProNum"].CellAppearance.BackColor = Color.GreenYellow;
  326. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  327. ultraGridZgS.DisplayLayout.Bands[0].Columns["ProdGradename"].CellAppearance.BackColor = Color.Wheat;
  328. UltraNumericEditor[] uneArr = new UltraNumericEditor[3];
  329. for (int i = 0; i < uneArr.Length; i++)
  330. {
  331. uneArr [i]= new UltraNumericEditor();
  332. uneArr[i].NumericType =NumericType.Double;
  333. if (i == 1)
  334. {
  335. uneArr[i].MaskInput = "nnnnn";
  336. }
  337. else
  338. {
  339. uneArr[i].MaskInput = "nnnnn.nn";
  340. }
  341. uneArr[i].SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;
  342. this.Controls.Add(uneArr[i]);
  343. uneArr[i].Visible = false;
  344. }
  345. uneArr[0].SpinIncrement = 0.01;
  346. uneArr[1].SpinIncrement = 50;
  347. uneArr[2].SpinIncrement =10;
  348. ultraGridZgS.DisplayLayout.Bands[0].Columns["Outdiameter"].EditorComponent = uneArr[0];
  349. ultraGridZgS.DisplayLayout.Bands[0].Columns["Wallthick"].EditorComponent = uneArr[0];
  350. ultraGridZgS.DisplayLayout.Bands[0].Columns["OutdiameterZg"].EditorComponent = uneArr[0];
  351. ultraGridZgS.DisplayLayout.Bands[0].Columns["WallthickZg"].EditorComponent = uneArr[0];
  352. //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMin"].EditorComponent = uneArr[0];
  353. //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMax"].EditorComponent = uneArr[0];
  354. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimoutdiameter"].EditorComponent = uneArr[0];
  355. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimwallthick"].EditorComponent = uneArr[0];
  356. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimlength"].EditorComponent = uneArr[0];
  357. ultraGridZgS.DisplayLayout.Bands[0].Columns["RollLength"].EditorComponent = uneArr[0];
  358. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenGpSingle"].EditorComponent = uneArr[2];
  359. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCuthead"].EditorComponent = uneArr[1];
  360. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCutend"].EditorComponent = uneArr[1];
  361. decisionFlsg(false);
  362. }
  363. private void decisionFlsg( Boolean b) {
  364. if (b)
  365. {
  366. UltraComboEditor uceAbc = new UltraComboEditor();
  367. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = uceAbc;
  368. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  369. ValueList vlistSteel = new ValueList(); ;
  370. vlistSteel.ValueListItems.Insert(0, "A", "A");
  371. vlistSteel.ValueListItems.Insert(1, "B", "B");
  372. vlistSteel.ValueListItems.Insert(2, "C", "C");
  373. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].ValueList = vlistSteel;
  374. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.AllowEdit;
  375. }
  376. else {
  377. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = null;
  378. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Default;
  379. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.ActivateOnly;
  380. }
  381. }
  382. private void InitTime()
  383. {
  384. DateTime now = DateTime.Now;
  385. DateTime d1 = new DateTime(now.Year, now.Month, 1);
  386. DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
  387. txtPlanTimeB1.Value = d1;
  388. txtPlanTimeB2.Value = d2;
  389. txtPlanTimeE1.Value = d1;
  390. txtPlanTimeE2.Value = d2;
  391. }
  392. /// <summary>
  393. /// 初始化芯棒直径
  394. /// </summary>
  395. /// <param name="plineCode">产线</param>
  396. /// <param name="PassCode">孔型编码</param>
  397. /// <param name="aimoutdiameter">控制外径</param>
  398. /// <param name="aimwallthick">控制壁厚</param>
  399. //private void InitDimaM(string plineCode, string passCode, string aimoutdiameter, string aimwallthick)
  400. //{
  401. // DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryPlnMandrelId", new object[] { plineCode, passCode, aimoutdiameter,aimwallthick }, this.ob);
  402. // UltraComboEditor uce = new UltraComboEditor();
  403. // ultraGridZgS.Controls.Add(uce);
  404. // uce.Visible = false;
  405. // uce.DropDownListWidth = -1;
  406. // uce.DropDownStyle = DropDownStyle.DropDownList;
  407. // uce.DataSource = dt1;
  408. // uce.DisplayMember = "DIAMETER_MANDREL";
  409. // uce.ValueMember = "MANDREL_ID";
  410. // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].EditorComponent = uce;
  411. // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  412. //}
  413. private void chcPline_CheckedChanged(object sender, EventArgs e)
  414. {
  415. if (chcPline.Checked) { comPline.ReadOnly = false; } else { comPline.ReadOnly = true; }
  416. if (chcOrderNo.Checked) { txtOrderNo.ReadOnly = false; } else { txtOrderNo.ReadOnly = true; }
  417. if (chcProPlanId.Checked) { txtProPlanId.ReadOnly = false; } else { txtProPlanId.ReadOnly = true; }
  418. if (chcPlanTimeB.Checked) { txtPlanTimeB1.ReadOnly = false; txtPlanTimeB2.ReadOnly = false; } else { txtPlanTimeB1.ReadOnly = true; txtPlanTimeB2.ReadOnly = true; }
  419. if (chcPlanTimeE.Checked) { txtPlanTimeE1.ReadOnly = false; txtPlanTimeE2.ReadOnly = false; } else { txtPlanTimeE1.ReadOnly = true; txtPlanTimeE2.ReadOnly = true; }
  420. }
  421. private void ultraGridZgS_InitializeRow(object sender, InitializeRowEventArgs e)
  422. {
  423. PlanHelper.ControlCellEdit(e.Row);
  424. }
  425. /// <summary>
  426. /// 查询
  427. /// </summary>
  428. private void Query()
  429. {
  430. //产线
  431. string comPlineCode = "";
  432. if (chcPline.Checked)
  433. {
  434. comPlineCode = comPline.Value == null ? "" : comPline.Value.ToString();
  435. }
  436. //如果是排产界面,则下拉框的产线不能为空,需要排序
  437. if (!CustomInfo.Equals("0") && comPlineCode.Equals(""))
  438. {
  439. MessageUtil.ShowTips("请选择产线!");
  440. return;
  441. }
  442. WaitingForm2 wf3 = new WaitingForm2("正在刷新,请稍候....");
  443. try
  444. {
  445. this.Cursor = Cursors.WaitCursor;
  446. //执行状态
  447. string[] statusArr = contorlPlanStatus1.statusArr;
  448. //合同号
  449. string orderNo = "";
  450. if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
  451. string proPlanId = "";
  452. if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
  453. string planTimeB1 = "";
  454. string planTimeB2 = "";
  455. if (chcPlanTimeB.Checked && txtPlanTimeB2.Value != null && txtPlanTimeB1.Value != null)
  456. {
  457. planTimeB1 = DateTime.Parse(txtPlanTimeB1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  458. planTimeB2 = DateTime.Parse(txtPlanTimeB2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  459. }
  460. string planTimeE1 = "";
  461. string planTimeE2 = "";
  462. if (chcPlanTimeE.Checked && txtPlanTimeE2.Value != null && txtPlanTimeE1.Value != null)
  463. {
  464. planTimeE1 = DateTime.Parse(txtPlanTimeE1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  465. planTimeE2 = DateTime.Parse(txtPlanTimeE2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  466. }
  467. if (plineCode == null)
  468. {
  469. MessageUtil.ShowTips("该用户没有轧管产线查看权限!");
  470. return;
  471. }
  472. string lotNoS = "";
  473. string lotNoE = "";
  474. if(chkLotNo.Checked)
  475. {
  476. lotNoS = lotNoStart.Text.Trim();
  477. lotNoE = lotNoEnd.Text.Trim();
  478. }
  479. List<PlnOrderZgSOEntity> listSource = EntityHelper.GetData<PlnOrderZgSOEntity>
  480. ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlanOrderD", new object[] { plineCode, proPlanId, orderNo, statusArr, planTimeB1, planTimeB2, planTimeE1, planTimeE2, comPlineCode, lotNoS,lotNoE }, this.ob);
  481. plnOrderZgSOEntityBindingSource.DataSource = listSource;
  482. //ProducHelper.copyLZData(ultraGridZgS, "D", this.ob);
  483. //ProducHelper.copyLZDataZg(ultraGridZgS, "D", this.ob);
  484. dtPlinGroup = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlinCodeGroup", null, this.ob);
  485. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  486. {
  487. string str = ugr.Cells["AfInfo"].Text.Trim();
  488. if (str != null && str != "")
  489. {
  490. //string[] sArray = str.Split(new char[3] { '天', ',', '条' });
  491. string[] sArray = str.Split(new char[1]{','});
  492. ugr.Cells["TimeDiffer"].Value = String.Format("{0:N2} ", sArray[0]).Substring(0,sArray[0].IndexOf("天"));
  493. ugr.Cells["AfProLin"].Value = sArray[1];
  494. ugr.Cells["AfProNum"].Value = sArray[2].Substring(0, sArray[2].IndexOf("条"));
  495. if (dtPlinGroup.Rows.Count > 0)
  496. {
  497. //for (int i = 0; i < dtPlinGroup.Rows.Count; i++)
  498. //{
  499. string plinGroup = dtPlinGroup.Rows[0]["PLINE_NAME_M"].ToString() + "/" + dtPlinGroup.Rows[0]["PLINE_NAME_C"].ToString();
  500. DataRow[] dr = dtPlinGroup.Select("PLINE_NAME_M='" + ugr.Cells["PlineCode"].Text.ToString() + "' AND PLINE_NAME_C ='" + ugr.Cells["AfProLin"].Value.ToString() + "'", "");
  501. if (dr == null || dr.Length == 0) { }
  502. else
  503. {
  504. //DataTable tmp = dr.Table.Clone(); // 复制DataRow的表结构
  505. //if (tmp.Rows.Count > 0)
  506. //{
  507. ugr.Cells["StockGroupName"].Value = dr[0]["STOCK_GROUP_NAME"].ToString();
  508. //}
  509. }
  510. }
  511. }
  512. if (ultraGridZgS.DisplayLayout.Bands[0].Columns.Exists("CraftFileLv2GPath"))
  513. {
  514. string craftFileLv2G = ugr.Cells["CraftFileLv2G"].Text.Trim();
  515. string[] name = craftFileLv2G.Split(new char[1] { '/' });
  516. ugr.Cells["CraftFileLv2GPath"].Value = craftFileLv2G;
  517. ugr.Cells["CraftFileLv2G"].Value = name[name.Length - 1];
  518. }
  519. if (ugr.Cells["WeigthSMin"].Text.ToString().Equals("") || ugr.Cells["WeigthSMin"].Value.ToString().Equals("0"))
  520. {
  521. ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthS"].Value.ToString())).ToString();
  522. }
  523. else
  524. {
  525. ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthSMin"].Value.ToString())).ToString();
  526. }
  527. }
  528. //激活操作行代码
  529. //if ((!_ProPlanId.Equals("") && !_GxPlanNo.Equals("")) || _entityList != null)
  530. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  531. {
  532. if (!_ProPlanId.Equals("") && !_GxPlanNo.Equals(""))
  533. {
  534. if (ugr.Cells["ProPlanId"].Text.Trim().Equals(_ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(_GxPlanNo))
  535. {
  536. ugr.Activate();
  537. break;
  538. }
  539. }
  540. if (_entityList != null)
  541. {
  542. for (int i = 0; i < _entityList.Count; i++)
  543. {
  544. PlnOrderZgSEntity jgxsEntity = (PlnOrderZgSEntity)_entityList[i];
  545. if (ugr.Cells["ProPlanId"].Text.Trim().Equals(jgxsEntity.ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(jgxsEntity.GxPlanNo))
  546. {
  547. ugr.Appearance.BackColor = Color.Wheat;
  548. ugr.Activate();
  549. }
  550. //if (!ugr.Cells["GxProSeq"].Text.Trim().Equals(jgxsEntity.GxProSeq))
  551. //{
  552. // ugr.Cells["GxProSeq"].Appearance.BackColor = Color.Wheat;
  553. // ugr.Activate();
  554. //}
  555. }
  556. }
  557. if (ugr.Cells["IsNoticeEp"].Text.Equals("已通知"))
  558. {
  559. ugr.Cells["IsNoticeEp"].Appearance.BackColor = Color.GreenYellow;
  560. ugr.Activate();
  561. }
  562. }
  563. _entityList = null;
  564. _ProPlanId = "";
  565. _ProPlanId = "";
  566. }
  567. finally
  568. {
  569. wf3.Close();
  570. this.Cursor = Cursors.Default;
  571. }
  572. }
  573. /// <summary>
  574. /// 修改切头尾数据
  575. /// </summary>
  576. private void UpdateCrop()
  577. {
  578. try
  579. {
  580. ArrayList messageErr = new ArrayList();
  581. ultraGridZgS.UpdateData();
  582. ArrayList list = new ArrayList();
  583. IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
  584. if (checkRows.Count() == 0)
  585. {
  586. MessageUtil.ShowWarning("请选择订单!");
  587. return;
  588. }
  589. PlanComm.WaitFromOpen(this.Cursor);
  590. foreach (UltraGridRow uRow in checkRows)
  591. {
  592. ArrayList param = new ArrayList();
  593. param.Add(UserInfo.GetUserName());
  594. param.Add(uRow.Cells["ProPlanId"].Value.ToString());
  595. param.Add(uRow.Cells["GxPlanNo"].Value.ToString());
  596. param.Add(uRow.Cells["InwlId"].Text);
  597. param.Add(uRow.Cells["OutwlId"].Text);
  598. param.Add(uRow.Cells["PlineCode"].Value.ToString());
  599. list.Add(param);
  600. }
  601. if (list.Count == 0)
  602. {
  603. PlanComm.WaitFromColse(this.Cursor);
  604. MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
  605. return;
  606. }
  607. CoreClientParam ccp = new CoreClientParam();
  608. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  609. ccp.MethodName = "updateCrop";
  610. ccp.ServerParams = new object[] { list, UserInfo.GetUserName() };
  611. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  612. PlanComm.WaitFromColse(this.Cursor);
  613. if (ccp.ReturnCode == -1) return;
  614. MessageUtil.ShowTips(ccp.ReturnInfo);
  615. if (ccp.ReturnInfo.Equals("批量获取切头尾成功!"))
  616. {
  617. Query();
  618. }
  619. }
  620. catch (Exception ex)
  621. {
  622. PlanComm.WaitFromColse(this.Cursor);
  623. if (!(ex is MESException))
  624. {
  625. MessageUtil.ShowError(ex.Message);
  626. }
  627. }
  628. }
  629. /// <summary>
  630. /// 初始化
  631. /// </summary>
  632. private void InitData()
  633. {
  634. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  635. bool flag = ProducHelper.InitData(list, "D", this.ob);
  636. if (flag)
  637. {
  638. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  639. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  640. Query();
  641. }
  642. }
  643. /// <summary>
  644. /// 状态调整
  645. /// </summary>
  646. private void StatusChange()
  647. {
  648. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  649. bool flag = ProducHelper.StatusChange(list, "D", this.ob);
  650. if (flag)
  651. {
  652. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  653. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  654. Query();
  655. }
  656. }
  657. /// <summary>
  658. /// 时间调整
  659. /// </summary>
  660. private void TimeChange()
  661. {
  662. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  663. bool flag = ProducHelper.TimeChange(list, "D", this.ob);
  664. if (flag)
  665. {
  666. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  667. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  668. Query();
  669. }
  670. }
  671. /// <summary>
  672. /// 排序
  673. /// </summary>
  674. /// <param name="sender"></param>
  675. /// <param name="e"></param>
  676. private void ultraGridZgS_MouseDown(object sender, MouseEventArgs e)
  677. {
  678. //排产查询界面,不能排序
  679. if (CustomInfo.Equals("0"))
  680. { return; }
  681. try
  682. { ultraGridZgS.UpdateData(); }
  683. catch (Exception)
  684. {
  685. MessageUtil.ShowWarning("数据异常,请刷新数据!"); return;
  686. }
  687. if (e.Button == MouseButtons.Right)
  688. {
  689. //移动行
  690. ArrayList entityList = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  691. if (entityList == null || entityList.Count == 0)
  692. {
  693. return;
  694. }
  695. //定位行
  696. UIElement myUIElement = ultraGridZgS.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
  697. UltraGridCell myCell = (UltraGridCell)myUIElement.GetContext(typeof(UltraGridCell));
  698. if (myCell == null) { return; }
  699. UltraGridRow ugr = myCell.Row;
  700. if (ugr == null) { return; }
  701. PlnOrderZgSEntity entityD = (PlnOrderZgSEntity)ugr.ListObject;
  702. bool flag = ProducHelper.SortPlanOrder(entityList, entityD, "D", "", this.ob);
  703. if (flag)
  704. {
  705. _entityList = entityList;
  706. Query();
  707. }
  708. }
  709. }
  710. private void ultraGridZgS_AfterRowActivate(object sender, EventArgs e)
  711. {
  712. UltraGridRow ugrAc = ultraGridZgS.ActiveRow;
  713. if (ugrAc == null)
  714. {
  715. return;
  716. }
  717. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  718. {
  719. if (ugr.Cells["ProPlanId"].Text.Equals(ugrAc.Cells["ProPlanId"].Text))
  720. {
  721. ugr.RowSelectorAppearance.BackColor = Color.LightGreen;
  722. }
  723. else
  724. {
  725. ugr.RowSelectorAppearance.BackColor = _backColor;
  726. }
  727. if (ugr.Cells["PlanUsetime"].Value == null || ugr.Cells["PlanUsetime"].Value.ToString().Equals("") || Convert.ToDouble(ugr.Cells["PlanUsetime"].Value.ToString()) <= 0)
  728. {
  729. ugr.Cells["PlanUsetime"].Appearance.BackColor = Color.MistyRose;
  730. }
  731. if (ugr.Cells["ExeStatus"].Value.ToString().Equals("生产中"))
  732. {
  733. ugr.Cells["PlanTimeB"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  734. }
  735. if (ugr.Cells["IsRepairPln"].Text.Equals("是"))
  736. {
  737. ugr.Cells["PlanUsetime"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  738. ugr.Cells["RepairType"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  739. }
  740. }
  741. proPlanId = ugrAc.Cells["ProPlanId"].Text.ToString();
  742. gxPlanNo = ugrAc.Cells["GxPlanNo"].Text.ToString();
  743. //doQueryVirtual(ugrAc.Cells["ProPlanId"].Text.ToString(), ugrAc.Cells["GxPlanNo"].Text.ToString());
  744. // doQueryActual(proPlanId, gxPlanNo);
  745. }
  746. /// <summary>
  747. /// 虚拟炉计划
  748. /// </summary>
  749. /// <param name="proPlanId"></param>
  750. /// <param name="gxPlanNo"></param>
  751. private void doQueryVirtual(string proPlanId, string gxPlanNo)
  752. {
  753. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryVirtual",
  754. new object[] { proPlanId, gxPlanNo }, this.ob);
  755. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  756. }
  757. private void ultraGridZgS_CellChange(object sender, CellEventArgs e)
  758. {
  759. try
  760. {
  761. ultraGridZgS.UpdateData();
  762. if (e.Cell.Column.Key.Equals("CHC"))
  763. {
  764. IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
  765. if (chcRows != null && chcRows.Count() > 0)
  766. {
  767. decisionFlsg(true);
  768. }
  769. else {
  770. decisionFlsg(false);
  771. }
  772. }
  773. if (e.Cell.Column.Key.Equals("PlineCode"))
  774. {
  775. IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
  776. if (CustomInfo.Equals("0"))
  777. {
  778. e.Cell.Row.Cells["PlineName"].Value = e.Cell.Text;
  779. }
  780. else
  781. {
  782. if (chcRows != null && chcRows.Count() > 0)
  783. {
  784. foreach (UltraGridRow ugr in chcRows)
  785. {
  786. ugr.Cells["PlineCode"].Value = e.Cell.Value.ToString();
  787. ugr.Cells["PlineName"].Value = e.Cell.Text;
  788. }
  789. }
  790. }
  791. }
  792. }
  793. catch (Exception)
  794. {
  795. }
  796. }
  797. /// <summary>
  798. /// 删除检修计划
  799. /// </summary>
  800. public void DeleteRepairPlan()
  801. {
  802. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  803. bool flag = ProducHelper.DeleteRepairPlan(list, "D", this.ob);
  804. if (flag)
  805. {
  806. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  807. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  808. Query();
  809. }
  810. }
  811. private void comPline_ValueChanged(object sender, EventArgs e)
  812. {
  813. if (comPline == null)
  814. { return; }
  815. else
  816. { if (!CustomInfo.Equals("0")) { } }
  817. }
  818. private void ultraGridZgS_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  819. {
  820. foreach (UltraGridRow uRow in ultraGridZgS.Selected.Rows)
  821. {
  822. if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
  823. {
  824. uRow.Cells["CHC"].Value = true;
  825. }
  826. }
  827. }
  828. private void ultraGridZgS_ClickCellButton(object sender, CellEventArgs e)
  829. {
  830. UltraGridRow row = ultraGridZgS.ActiveRow;
  831. if (e.Cell.Column.Key.Equals("CraftFileNo"))
  832. {
  833. string filePath = row.GetValue("CraftPath");
  834. dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, filePath);
  835. askDown.Show();
  836. }
  837. else if (e.Cell.Column.Key.Equals("CraftFileLv2G"))
  838. {
  839. string craftFileLv2G = row.GetValue("CraftFileLv2GPath");
  840. dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, craftFileLv2G);
  841. askDown.Show();
  842. }
  843. else if (e.Cell.Column.Key.Equals("DiameterGp"))
  844. {
  845. string exeStatus = row.GetValue("ExeStatus");
  846. if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
  847. {
  848. return;
  849. }
  850. string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
  851. string proPlanId = row.GetValue("ProPlanId");
  852. string gxPlanNo = row.GetValue("GxPlanNo");
  853. string gradeCode = row.GetValue("GradeCode");
  854. if (gradeCode.Equals(""))
  855. {
  856. return;
  857. }
  858. string[] groupCic = null;
  859. if (!row.GetValue("GradeCode").Equals(""))
  860. {
  861. groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
  862. }
  863. string cicGp = row.GetValue("CicGp");
  864. //int numz = 0;
  865. //double wtz = 0;
  866. //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
  867. //{
  868. // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
  869. // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
  870. //}
  871. int numLj = 0;
  872. double wtLj = 0;
  873. //if (!row.Cells["LjNum"].Value.ToString().Equals("0"))
  874. //{
  875. numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
  876. wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
  877. //}
  878. //else
  879. //{
  880. // numLj = int.Parse(row.Cells["MatchNumIn"].Value.ToString());
  881. // wtLj = double.Parse(row.Cells["MatchWtIn"].Value.ToString());
  882. //}
  883. //int batNum = 0;
  884. //double batWt = 0;
  885. //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
  886. //{
  887. // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
  888. // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
  889. //}
  890. //int num = numz + numLj + batNum;
  891. int num = numLj;
  892. FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
  893. frmBomConfirm.ShowDialog();
  894. bool flag = frmBomConfirm.Flag;
  895. if (flag) { Query(); }//如果有修改数据,则刷新页面
  896. }
  897. else if (e.Cell.Column.Key.Equals("Gradename"))
  898. {
  899. string exeStatus = row.GetValue("ExeStatus");
  900. if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
  901. {
  902. return;
  903. }
  904. string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
  905. string proPlanId = row.GetValue("ProPlanId");
  906. string gxPlanNo = row.GetValue("GxPlanNo");
  907. string gradeCode = row.GetValue("GradeCode");
  908. if (gradeCode.Equals(""))
  909. {
  910. return;
  911. }
  912. string[] groupCic = null;
  913. if (!row.GetValue("GradeCode").Equals(""))
  914. {
  915. groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
  916. }
  917. string cicGp = row.GetValue("CicGp");
  918. int numz = 0;
  919. double wtz = 0;
  920. //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
  921. //{
  922. // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
  923. // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
  924. //}
  925. int numLj = 0;
  926. double wtLj = 0;
  927. //if (!row.Cells["LjNum"].Text.ToString().Equals(""))
  928. //{
  929. numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
  930. wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
  931. //}
  932. //int batNum = 0;
  933. //double batWt = 0;
  934. //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
  935. //{
  936. // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
  937. // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
  938. //}
  939. int num = numLj ;
  940. FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
  941. frmBomConfirm.ShowDialog();
  942. bool flag = frmBomConfirm.Flag;
  943. if (flag) { Query(); }//如果有修改数据,则刷新页面
  944. }
  945. else if (e.Cell.Column.Key.Equals("AfProLin"))
  946. {
  947. string proPlanId = row.GetValue("ProPlanId");
  948. string afInfo = row.GetValue("AfInfo");
  949. if (afInfo == null || afInfo.Length == 0) { return; }
  950. FrmPreGxInfo frmPreGxInfo = new FrmPreGxInfo(proPlanId, "D", "Af", this.ob);
  951. frmPreGxInfo.ShowDialog();
  952. }
  953. else if (e.Cell.Column.Key.Equals("DiameterMandrel"))
  954. {
  955. //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());
  956. FrmDiameterMandrel frmDm = new FrmDiameterMandrel(row.GetValue("PlineCode"), row.GetValue("PassCode"), row.GetValue("Aimoutdiameter"), row.GetValue("Aimwallthick"), this.ob);
  957. frmDm.AutoSize = true;
  958. //frmDm.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  959. frmDm.Text = "芯棒直径";
  960. frmDm.ShowDialog();
  961. if (frmDm.DialogResult == System.Windows.Forms.DialogResult.OK)
  962. {
  963. //获取弹出窗体的属性值
  964. row.Cells["DiameterMandrel"].Value = frmDm.DiameterMandrel;
  965. if (!frmDm.LenSingerBill.Equals("0") && double.Parse(frmDm.LenSingerBill) < double.Parse(row.Cells["LenGpSingle"].Value.ToString()))
  966. {
  967. row.Cells["LenGpSingle"].Value = frmDm.LenSingerBill;
  968. }
  969. }
  970. }
  971. else if (e.Cell.Column.Key.Equals("ApplyNo"))
  972. {
  973. UndoApply();
  974. }
  975. else if (e.Cell.Column.Key.Equals("LengthdiscN"))
  976. {
  977. if (row.GetValue("OrdLnDlyPk").Contains("ZZBY-"))
  978. {
  979. MessageUtil.ShowTips("该合同是备料需求合同,不允许修改推荐长度描述!");
  980. return;
  981. }
  982. if (row.GetValue("ApplyStatus") == "审批通过" || row.GetValue("ApplyStatus") == "审批不通过")
  983. {
  984. MessageUtil.ShowTips("该合同:" + row.GetValue("OrderNo") + ",已" + row.GetValue("ApplyStatus") + ",不允许修改推荐长度描述!");
  985. return;
  986. }
  987. string len = row.GetValue("LenNo");//合同长度编码
  988. string LenNoN = row.GetValue("LenNoN");//推荐长度编码
  989. frmOrderLenPln lenPln = new frmOrderLenPln(ob, len, LenNoN);
  990. lenPln.ShowDialog();
  991. if (lenPln.DialogResult == System.Windows.Forms.DialogResult.OK)
  992. {
  993. //获取弹出窗体的属性值
  994. row.Cells["LenNoN"].Value = lenPln.LenNo;
  995. row.Cells["LengthdiscN"].Value = lenPln.LengthdiscN;
  996. }
  997. }
  998. }
  999. /// <summary>
  1000. /// 设置完成
  1001. /// </summary>
  1002. private void SetPlanFinish()
  1003. {
  1004. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1005. bool flag = ProducHelper.SetPlanFinish(list, UserInfo.GetUserName(), "D", this.ob);
  1006. if (flag)
  1007. {
  1008. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  1009. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  1010. Query();
  1011. }
  1012. }
  1013. /// <summary>
  1014. /// 调整单倍坯长
  1015. /// </summary>
  1016. private void ModifyGpAimWall()
  1017. {
  1018. this.ultraGridZgS.UpdateData();
  1019. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1020. if (list == null || list.Count == 0)
  1021. {
  1022. MessageUtil.ShowTips("请选择订单!");
  1023. return;
  1024. }
  1025. ArrayList jsonList = new ArrayList();
  1026. foreach (PlnOrderZgSEntity entity in list)
  1027. {
  1028. if (entity.IsRepairPln.Equals("是"))
  1029. {
  1030. MessageUtil.ShowTips("检修计划不能重算!");
  1031. return;
  1032. }
  1033. if (entity.LenCutend == null)
  1034. {
  1035. //entity.LenCutend = 0;
  1036. MessageUtil.ShowWarning("请输入切尾数据!");
  1037. return;
  1038. }
  1039. if (entity.LenCuthead == null)
  1040. {
  1041. //entity.LenCuthead = 0;
  1042. MessageUtil.ShowWarning("请输入切头数据!");
  1043. return;
  1044. }
  1045. if (entity.DiameterMandrel == null || entity.DiameterMandrel == 0)
  1046. {
  1047. MessageUtil.ShowWarning("未取到芯棒直径!");
  1048. return;
  1049. }
  1050. DataTable ds = ServerHelper.GetData("com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp.selectMangageLen", new object[] { entity.ProPlanId, entity.GxPlanNo }, ob);
  1051. if (Double.Parse(ds.Rows[0][0].ToString()) > 0)
  1052. {
  1053. if (entity.LenGpSingle > decimal.Parse(ds.Rows[0][0].ToString()))
  1054. {
  1055. MessageUtil.ShowTips("订单单倍坯长不允许大于芯棒对应最大单倍坯长!");
  1056. return;
  1057. }
  1058. }
  1059. //不是外购管的判断
  1060. if (!entity.PlineCode.Equals("C065") && !entity.PlineCode.Equals("C066"))
  1061. {
  1062. //判断基础信息是否有切头尾数据
  1063. string cutPlineH = "";//切头
  1064. string cutPlineE = "";//切尾
  1065. DataTable dt = ServerHelper
  1066. .GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryBaseMaterialDPl", new object[] { entity.InwlId, entity.OutwlId, entity.PlineCode }, this.ob);
  1067. if (dt.Rows.Count > 0)
  1068. {
  1069. cutPlineH = dt.Rows[0]["CROP_HEAD"].ToString();
  1070. cutPlineE = dt.Rows[0]["CROP_END"].ToString();
  1071. }
  1072. if (cutPlineH == null || cutPlineH.Equals(""))
  1073. {
  1074. MessageUtil.ShowWarning("基础信息无投入产出物料对应切头数据,请维护!");
  1075. return;
  1076. }
  1077. if (cutPlineE == null || cutPlineE.Equals(""))
  1078. {
  1079. MessageUtil.ShowWarning("基础信息无投入产出物料对应切尾数据,请维护!");
  1080. return;
  1081. }
  1082. }
  1083. if (entity.TubeEndRatio == null)
  1084. {
  1085. entity.TubeEndRatio = 0;
  1086. }
  1087. int lenGpSingle = Convert.ToInt32(entity.LenGpSingle);
  1088. if (lenGpSingle % 10 != 0)
  1089. {
  1090. MessageUtil.ShowWarning("单倍坯长个位数不是0,请重新调整!");
  1091. return;
  1092. }
  1093. jsonList.Add(JSONFormat.Format(entity));
  1094. }
  1095. if (MessageUtil.ShowYesNoAndQuestion("是否重算?") == DialogResult.No)
  1096. {
  1097. return;
  1098. }
  1099. CoreClientParam ccp = new CoreClientParam();
  1100. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1101. ccp.MethodName = "modifyGpAimWall";
  1102. ccp.ServerParams = new object[] { jsonList, "0" };
  1103. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1104. if (ccp.ReturnCode != -1)
  1105. {
  1106. if (ccp.ReturnObject != null)
  1107. {
  1108. List<string> message = (List<string>)JsonConvert.DeserializeObject(
  1109. ccp.ReturnObject.ToString(), typeof(List<string>));
  1110. if (message.Count == 0)
  1111. {
  1112. MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
  1113. + message.Count + "条修改失败。");
  1114. }
  1115. else
  1116. {
  1117. MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
  1118. + message.Count + "条修改失败。\n" + message[0]);
  1119. }
  1120. if (list.Count - message.Count>0)
  1121. {
  1122. Query();
  1123. }
  1124. }
  1125. }
  1126. }
  1127. /// <summary>
  1128. /// 调整控制壁厚
  1129. /// </summary>
  1130. private void ModifyThicknesWall()
  1131. {
  1132. this.ultraGridZgS.UpdateData();
  1133. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1134. if (list == null || list.Count == 0)
  1135. {
  1136. MessageUtil.ShowTips("请选择订单!");
  1137. return;
  1138. }
  1139. ArrayList jsonList = new ArrayList();
  1140. foreach (PlnOrderZgSEntity entity in list)
  1141. {
  1142. if (entity.IsRepairPln.Equals("是"))
  1143. {
  1144. MessageUtil.ShowTips("检修计划不能调整控制壁厚!");
  1145. return;
  1146. }
  1147. jsonList.Add(JSONFormat.Format(entity));
  1148. }
  1149. if (MessageUtil.ShowYesNoAndQuestion("是否修改控制壁厚?") == DialogResult.No)
  1150. {
  1151. return;
  1152. }
  1153. CoreClientParam ccp = new CoreClientParam();
  1154. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1155. ccp.MethodName = "modifyThicknesWall";
  1156. ccp.ServerParams = new object[] { jsonList,this.UserInfo.GetUserName() };
  1157. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1158. if (ccp.ReturnCode == -1) return;
  1159. MessageUtil.ShowTips(ccp.ReturnInfo);
  1160. if (ccp.ReturnInfo.Equals("调整控制壁厚成功!"))
  1161. {
  1162. Query();
  1163. }
  1164. }
  1165. /// <summary>
  1166. /// 修改芯棒直接
  1167. /// </summary>
  1168. private void UpdateDiameM()
  1169. {
  1170. try
  1171. {
  1172. ArrayList messageErr = new ArrayList();
  1173. ultraGridZgS.UpdateData();
  1174. ArrayList list = new ArrayList();
  1175. //IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
  1176. ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1177. if (list1 == null || list1.Count == 0)
  1178. {
  1179. MessageUtil.ShowTips("请选择订单!");
  1180. return;
  1181. }
  1182. foreach (PlnOrderZgSEntity entity in list1)
  1183. {
  1184. if (entity.IsRepairPln.Equals("是"))
  1185. {
  1186. MessageUtil.ShowTips("检修计划不能调整芯棒!");
  1187. return;
  1188. }
  1189. if (entity.DiameterMandrel==null||entity.DiameterMandrel.Equals(""))
  1190. {
  1191. PlanComm.WaitFromColse(this.Cursor);
  1192. MessageUtil.ShowWarning("芯棒不能为空,请选择芯棒!");
  1193. return;
  1194. }
  1195. ArrayList param = new ArrayList();
  1196. param.Add(entity.ProPlanId);
  1197. param.Add(entity.GxPlanNo);
  1198. param.Add(entity.DiameterMandrel.ToString());
  1199. list.Add(param);
  1200. }
  1201. if (list.Count == 0)
  1202. {
  1203. PlanComm.WaitFromColse(this.Cursor);
  1204. MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
  1205. return;
  1206. }
  1207. if (MessageUtil.ShowYesNoAndQuestion("是否调整芯棒直径?") == DialogResult.No)
  1208. {
  1209. return;
  1210. }
  1211. PlanComm.WaitFromOpen(this.Cursor);
  1212. CoreClientParam ccp = new CoreClientParam();
  1213. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  1214. ccp.MethodName = "updateDimaM";
  1215. ccp.ServerParams = new object[] { list };
  1216. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1217. PlanComm.WaitFromColse(this.Cursor);
  1218. if (ccp.ReturnCode == -1) return;
  1219. MessageUtil.ShowTips(ccp.ReturnInfo);
  1220. if (ccp.ReturnInfo.Equals("芯棒直径调整成功!"))
  1221. {
  1222. Query();
  1223. }
  1224. }
  1225. catch (Exception ex)
  1226. {
  1227. PlanComm.WaitFromColse(this.Cursor);
  1228. if (!(ex is MESException))
  1229. {
  1230. MessageUtil.ShowError(ex.Message);
  1231. }
  1232. }
  1233. }
  1234. /// <summary>
  1235. /// 重新计算
  1236. /// </summary>
  1237. private void Recalculate()
  1238. {
  1239. try
  1240. {
  1241. ArrayList messageErr = new ArrayList();
  1242. ultraGridZgS.UpdateData();
  1243. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1244. if (list == null || list.Count == 0)
  1245. {
  1246. MessageUtil.ShowTips("请选择订单!");
  1247. return;
  1248. }
  1249. ArrayList jsonList = new ArrayList();
  1250. foreach (PlnOrderZgSEntity entity in list)
  1251. {
  1252. if (entity.IsRepairPln.Equals("是"))
  1253. {
  1254. MessageUtil.ShowTips("检修计划已确认不能重新计算!");
  1255. return;
  1256. }
  1257. //if (entity.OrderSource.Equals("排产补量"))
  1258. //{
  1259. // MessageUtil.ShowTips("排产补量不能重新计算!");
  1260. // return;
  1261. //}
  1262. //int numz = 0;
  1263. //double wtz = 0;
  1264. //if (entity.FurnaNum!=null&&!entity.FurnaNum.Equals(""))
  1265. //{
  1266. // numz = int.Parse(entity.FurnaNum.ToString());
  1267. // wtz = double.Parse(entity.FurnaWeight.ToString());
  1268. //}
  1269. //int numLj = 0;
  1270. //double wtLj = 0;
  1271. //if (entity.LjNum != null && !entity.LjNum.Equals(""))
  1272. //{
  1273. // numLj = int.Parse(entity.LjNum.ToString());
  1274. // wtLj = double.Parse(entity.LjWeight.ToString());
  1275. //}
  1276. //int batNum = 0;
  1277. //double batWt = 0;
  1278. //if (entity.CkNum != null && !entity.CkNum.Equals(""))
  1279. //{
  1280. // batNum = int.Parse(entity.CkNum.ToString());
  1281. // batWt = double.Parse(entity.CkWeight.ToString());
  1282. //}
  1283. //int num = numz + numLj + batNum;
  1284. //if (numz > 0)
  1285. //{
  1286. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo+ ",已装炉,不允许重头算!");
  1287. // return;
  1288. //}
  1289. //if (numLj > 0)
  1290. //{
  1291. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已Lj,不允许重头算!");
  1292. // return;
  1293. //}
  1294. //if (batNum > 0)
  1295. //{
  1296. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已出库,不允许重头算!");
  1297. // return;
  1298. //}
  1299. jsonList.Add(JSONFormat.Format(entity));
  1300. }
  1301. if (MessageUtil.ShowYesNoAndQuestion("是否重头计算?") == DialogResult.No)
  1302. {
  1303. return;
  1304. }
  1305. PlanComm.WaitFromOpen(this.Cursor);
  1306. CoreClientParam ccp = new CoreClientParam();
  1307. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1308. ccp.MethodName = "recalculate";
  1309. ccp.ServerParams = new object[] { jsonList };
  1310. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1311. PlanComm.WaitFromColse(this.Cursor);
  1312. if (ccp.ReturnCode == -1) return;
  1313. MessageUtil.ShowTips(ccp.ReturnInfo);
  1314. if (ccp.ReturnInfo.Equals("重头计算完成!"))
  1315. {
  1316. Query();
  1317. }
  1318. }
  1319. catch (Exception ex)
  1320. {
  1321. PlanComm.WaitFromColse(this.Cursor);
  1322. if (!(ex is MESException))
  1323. {
  1324. MessageUtil.ShowError(ex.Message);
  1325. }
  1326. }
  1327. }
  1328. /// <summary>
  1329. ///修改排产月份
  1330. /// </summary>
  1331. private void UpdateMonth()
  1332. {
  1333. try
  1334. {
  1335. ArrayList messageErr = new ArrayList();
  1336. ultraGridZgS.UpdateData();
  1337. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1338. if (list == null || list.Count == 0)
  1339. {
  1340. MessageUtil.ShowTips("请选择订单!");
  1341. return;
  1342. }
  1343. ArrayList jsonList = new ArrayList();
  1344. foreach (PlnOrderZgSEntity entity in list)
  1345. {
  1346. entity.ProMonth = DateTime.Parse(entity.ProMonth.ToString()).ToString("yyyy-MM");
  1347. jsonList.Add(JSONFormat.Format(entity));
  1348. }
  1349. if (MessageUtil.ShowYesNoAndQuestion("是否调整生产年月?") == DialogResult.No)
  1350. {
  1351. return;
  1352. }
  1353. PlanComm.WaitFromOpen(this.Cursor);
  1354. CoreClientParam ccp = new CoreClientParam();
  1355. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1356. ccp.MethodName = "updateMonth";
  1357. ccp.ServerParams = new object[] { jsonList };
  1358. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1359. PlanComm.WaitFromColse(this.Cursor);
  1360. if (ccp.ReturnCode == -1) return;
  1361. MessageUtil.ShowTips(ccp.ReturnInfo);
  1362. if (ccp.ReturnInfo.Equals("调整成功!"))
  1363. {
  1364. //ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1365. //bool flag =InitDataMonth(list1, "D", this.ob);
  1366. //if (flag)
  1367. //{
  1368. // _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  1369. // _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  1370. Query();
  1371. //}
  1372. }
  1373. }
  1374. catch (Exception ex)
  1375. {
  1376. MessageUtil.ShowTips("请输入正确的时间格式!");
  1377. }
  1378. }
  1379. public static bool InitDataMonth(ArrayList entityList, string processCode, OpeBase ob)
  1380. {
  1381. if (entityList == null)
  1382. {
  1383. MessageUtil.ShowWarning("请选择订单!");
  1384. return false;
  1385. }
  1386. ArrayList jsonlist = new ArrayList();
  1387. foreach (Object obj in entityList)
  1388. {
  1389. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  1390. if (entity.IfStoveIssued.Equals("是"))
  1391. {
  1392. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  1393. return false;
  1394. }
  1395. if (entity.PlanUseTime == null || entity.PlanUseTime.Equals(""))
  1396. {
  1397. MessageUtil.ShowWarning("计划耗时不能为空!");
  1398. return false;
  1399. }
  1400. jsonlist.Add(entity.JsonStr);
  1401. }
  1402. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.initData", new object[] { jsonlist, processCode }, ob);
  1403. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  1404. else
  1405. {
  1406. //MessageUtil.ShowTips(param[1]);
  1407. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  1408. }
  1409. }
  1410. /// <summary>
  1411. /// 申请审批
  1412. /// </summary>
  1413. private void ApplyApproval()
  1414. {
  1415. ArrayList messageErr = new ArrayList();
  1416. ultraGridZgS.UpdateData();
  1417. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1418. if (list == null || list.Count == 0)
  1419. {
  1420. MessageUtil.ShowTips("请选择订单!");
  1421. return;
  1422. }
  1423. ArrayList jsonList = new ArrayList();
  1424. foreach (PlnOrderZgSEntity entity in list)
  1425. {
  1426. if (entity.LenNoN == null)
  1427. {
  1428. MessageUtil.ShowTips("无推荐长度,不允许申请!");
  1429. return;
  1430. }
  1431. jsonList.Add(JSONFormat.Format(entity));
  1432. }
  1433. if (MessageUtil.ShowYesNoAndQuestion("是否申请?") == DialogResult.No)
  1434. {
  1435. return;
  1436. }
  1437. PlanComm.WaitFromOpen(this.Cursor);
  1438. CoreClientParam ccp = new CoreClientParam();
  1439. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1440. ccp.MethodName = "applyApproval";
  1441. ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
  1442. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1443. PlanComm.WaitFromColse(this.Cursor);
  1444. if (ccp.ReturnCode == -1) return;
  1445. MessageUtil.ShowTips(ccp.ReturnInfo);
  1446. if (ccp.ReturnInfo.Equals("申请成功!"))
  1447. {
  1448. Query();
  1449. }
  1450. }
  1451. /// <summary>
  1452. /// 撤销申请单
  1453. /// </summary>
  1454. private void UndoApply()
  1455. {
  1456. ultraGridZgS.UpdateData();
  1457. UltraGridRow ugrM = ultraGridZgS.ActiveRow;
  1458. if (ugrM == null)
  1459. {
  1460. return;
  1461. }
  1462. if (ugrM.Cells["ApplyNo"].Text.ToString().Equals(""))
  1463. {
  1464. MessageUtil.ShowTips("合同号:" + ugrM.Cells["OrderNo"].Value.ToString() + "未申请,不允许此操作!");
  1465. return;
  1466. }
  1467. ArrayList jsonList = new ArrayList();
  1468. jsonList.Add(ugrM.Cells["ApplyNo"].Value.ToString());
  1469. jsonList.Add(ugrM.Cells["OrdLnDlyPk"].Value.ToString());
  1470. jsonList.Add(ugrM.Cells["ProPlanId"].Value.ToString());
  1471. jsonList.Add(ugrM.Cells["GxPlanNo"].Value.ToString());
  1472. jsonList.Add(ugrM.Cells["LenNoN"].Value.ToString());
  1473. if (MessageUtil.ShowYesNoAndQuestion("是否撤销申请?") == DialogResult.No)
  1474. {
  1475. return;
  1476. }
  1477. PlanComm.WaitFromOpen(this.Cursor);
  1478. CoreClientParam ccp = new CoreClientParam();
  1479. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1480. ccp.MethodName = "undoApplyApproval";
  1481. ccp.ServerParams = new object[] { jsonList };
  1482. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1483. PlanComm.WaitFromColse(this.Cursor);
  1484. if (ccp.ReturnCode == -1) return;
  1485. MessageUtil.ShowTips(ccp.ReturnInfo);
  1486. if (ccp.ReturnInfo.Equals("撤销申请成功!"))
  1487. {
  1488. Query();
  1489. }
  1490. }
  1491. /// <summary>
  1492. /// 修改坯子
  1493. /// </summary>
  1494. private void ModifyBatter()
  1495. {
  1496. ArrayList messageErr = new ArrayList();
  1497. ultraGridZgS.UpdateData();
  1498. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1499. if (list == null || list.Count == 0)
  1500. {
  1501. MessageUtil.ShowTips("请选择订单!");
  1502. return;
  1503. }
  1504. ArrayList jsonList = new ArrayList();
  1505. foreach (PlnOrderZgSEntity entity in list)
  1506. {
  1507. entity.OutsBilletFl.ToString();
  1508. jsonList.Add(JSONFormat.Format(entity));
  1509. }
  1510. if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
  1511. {
  1512. return;
  1513. }
  1514. PlanComm.WaitFromOpen(this.Cursor);
  1515. CoreClientParam ccp = new CoreClientParam();
  1516. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1517. ccp.MethodName = "modifyBatter";
  1518. ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
  1519. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1520. PlanComm.WaitFromColse(this.Cursor);
  1521. if (ccp.ReturnCode == -1) return;
  1522. MessageUtil.ShowTips(ccp.ReturnInfo);
  1523. if (ccp.ReturnInfo.Equals("修改成功!"))
  1524. {
  1525. Query();
  1526. }
  1527. }
  1528. private void ultraGridZgS_KeyUp(object sender, KeyEventArgs e)
  1529. {
  1530. PlanComm.setGridCopyActColumn(this.ultraGridZgS, "CHC", e,
  1531. "OutsBilletFl", "ProMonth");
  1532. }
  1533. /// <summary>
  1534. /// 修改索引码
  1535. /// </summary>
  1536. private void UpdateGroupGp()
  1537. {
  1538. ArrayList messageErr = new ArrayList();
  1539. ultraGridZgS.UpdateData();
  1540. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1541. if (list == null || list.Count == 0)
  1542. {
  1543. MessageUtil.ShowTips("请选择订单!");
  1544. return;
  1545. }
  1546. ArrayList jsonList = new ArrayList();
  1547. foreach (PlnOrderZgSEntity entity in list)
  1548. {
  1549. entity.OutsBilletFl.ToString();
  1550. jsonList.Add(JSONFormat.Format(entity));
  1551. }
  1552. if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
  1553. {
  1554. return;
  1555. }
  1556. PlanComm.WaitFromOpen(this.Cursor);
  1557. CoreClientParam ccp = new CoreClientParam();
  1558. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1559. ccp.MethodName = "updateGroupGp";
  1560. ccp.ServerParams = new object[] { jsonList };
  1561. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1562. PlanComm.WaitFromColse(this.Cursor);
  1563. if (ccp.ReturnCode == -1) return;
  1564. MessageUtil.ShowTips(ccp.ReturnInfo);
  1565. if (ccp.ReturnInfo.Equals("修改成功!"))
  1566. {
  1567. Query();
  1568. }
  1569. }
  1570. /// <summary>
  1571. /// 修改轧批号
  1572. /// </summary>
  1573. private void UpdateBatch()
  1574. {
  1575. ArrayList messageErr = new ArrayList();
  1576. ultraGridZgS.UpdateData();
  1577. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1578. if (list == null || list.Count == 0)
  1579. {
  1580. MessageUtil.ShowTips("请选择订单!");
  1581. return;
  1582. }
  1583. ArrayList jsonList = new ArrayList();
  1584. foreach (PlnOrderZgSEntity entity in list)
  1585. {
  1586. entity.ZyBatchId.ToString();
  1587. jsonList.Add(JSONFormat.Format(entity));
  1588. }
  1589. if (MessageUtil.ShowYesNoAndQuestion("是否轧批号修改?") == DialogResult.No)
  1590. {
  1591. return;
  1592. }
  1593. PlanComm.WaitFromOpen(this.Cursor);
  1594. CoreClientParam ccp = new CoreClientParam();
  1595. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1596. ccp.MethodName = "updateBatch";
  1597. ccp.ServerParams = new object[] { jsonList };
  1598. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1599. PlanComm.WaitFromColse(this.Cursor);
  1600. if (ccp.ReturnCode == -1) return;
  1601. MessageUtil.ShowTips(ccp.ReturnInfo);
  1602. if (ccp.ReturnInfo.Equals("修改成功!"))
  1603. {
  1604. Query();
  1605. }
  1606. }
  1607. /// <summary>
  1608. /// 修改判定字头
  1609. /// </summary>
  1610. private void DoDecision()
  1611. {
  1612. ArrayList messageErr = new ArrayList();
  1613. ultraGridZgS.UpdateData();
  1614. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1615. if (list == null || list.Count == 0)
  1616. {
  1617. MessageUtil.ShowTips("请选择订单!");
  1618. return;
  1619. }
  1620. ArrayList jsonList = new ArrayList();
  1621. foreach (PlnOrderZgSEntity entity in list)
  1622. {
  1623. entity.Decision.ToString();
  1624. jsonList.Add(JSONFormat.Format(entity));
  1625. }
  1626. if (MessageUtil.ShowYesNoAndQuestion("是否判定字头修改?") == DialogResult.No)
  1627. {
  1628. return;
  1629. }
  1630. PlanComm.WaitFromOpen(this.Cursor);
  1631. CoreClientParam ccp = new CoreClientParam();
  1632. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1633. ccp.MethodName = "doDecision";
  1634. ccp.ServerParams = new object[] { jsonList };
  1635. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1636. PlanComm.WaitFromColse(this.Cursor);
  1637. if (ccp.ReturnCode == -1) return;
  1638. MessageUtil.ShowTips(ccp.ReturnInfo);
  1639. if (ccp.ReturnInfo.Equals("修改成功!"))
  1640. {
  1641. Query();
  1642. }
  1643. }
  1644. /// <summary>
  1645. /// 导入
  1646. /// </summary>
  1647. private void DoImport()
  1648. {
  1649. try
  1650. {
  1651. OpenFileDialog dialog = new OpenFileDialog();
  1652. if (dialog.ShowDialog() == DialogResult.OK)
  1653. {
  1654. FrmImportSetPlnZg import = new FrmImportSetPlnZg(this.ob);
  1655. import.ModelPatch = dialog.FileName;
  1656. import.ShowDialog();
  1657. }
  1658. Query();
  1659. }
  1660. catch (Exception ex)
  1661. {
  1662. MessageBox.Show(ex.Message);
  1663. }
  1664. }
  1665. /// <summary>
  1666. /// 修改工艺备注
  1667. /// </summary>
  1668. private void DoProMemo(string falsg)
  1669. {
  1670. ArrayList messageErr = new ArrayList();
  1671. ultraGridZgS.UpdateData();
  1672. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1673. if (list == null || list.Count == 0)
  1674. {
  1675. MessageUtil.ShowTips("请选择订单!");
  1676. return;
  1677. }
  1678. ArrayList jsonList = new ArrayList();
  1679. foreach (PlnOrderZgSEntity entity in list)
  1680. {
  1681. entity.Memo.ToString();
  1682. jsonList.Add(JSONFormat.Format(entity));
  1683. }
  1684. if (MessageUtil.ShowYesNoAndQuestion(falsg.Equals("0") ? "是否工艺备注修改?" : "是否计划备注修改?") == DialogResult.No)
  1685. {
  1686. return;
  1687. }
  1688. PlanComm.WaitFromOpen(this.Cursor);
  1689. CoreClientParam ccp = new CoreClientParam();
  1690. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1691. ccp.MethodName = "doProMemo";
  1692. ccp.ServerParams = new object[] { jsonList, falsg };
  1693. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1694. PlanComm.WaitFromColse(this.Cursor);
  1695. if (ccp.ReturnCode == -1) return;
  1696. MessageUtil.ShowTips(ccp.ReturnInfo);
  1697. if (ccp.ReturnInfo.Equals("修改成功!"))
  1698. {
  1699. Query();
  1700. }
  1701. }
  1702. /// <summary>
  1703. /// 主被动修改
  1704. /// </summary>
  1705. private void DoUpdatePase()
  1706. {
  1707. ArrayList messageErr = new ArrayList();
  1708. ultraGridZgS.UpdateData();
  1709. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1710. if (list == null || list.Count == 0)
  1711. {
  1712. MessageUtil.ShowTips("请选择订单!");
  1713. return;
  1714. }
  1715. ArrayList jsonList = new ArrayList();
  1716. foreach (PlnOrderZgSEntity entity in list)
  1717. {
  1718. entity.Passive.ToString();
  1719. jsonList.Add(JSONFormat.Format(entity));
  1720. }
  1721. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改主被动?") == DialogResult.No)
  1722. {
  1723. return;
  1724. }
  1725. PlanComm.WaitFromOpen(this.Cursor);
  1726. CoreClientParam ccp = new CoreClientParam();
  1727. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1728. ccp.MethodName = "doUpdatePase";
  1729. ccp.ServerParams = new object[] { jsonList };
  1730. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1731. PlanComm.WaitFromColse(this.Cursor);
  1732. if (ccp.ReturnCode == -1) return;
  1733. MessageUtil.ShowTips(ccp.ReturnInfo);
  1734. if (ccp.ReturnInfo.Equals("修改成功!"))
  1735. {
  1736. Query();
  1737. }
  1738. }
  1739. private int splitterDistance = 0;
  1740. private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  1741. {
  1742. StoveHelper.CustomMergedCellEvaluator merge = new StoveHelper.CustomMergedCellEvaluator("HeatPlanNo");
  1743. e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellStyle = MergedCellStyle.Always;
  1744. e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellEvaluator = merge;
  1745. e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellStyle = MergedCellStyle.Always;
  1746. e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellEvaluator = merge;
  1747. e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellStyle = MergedCellStyle.Always;
  1748. e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellEvaluator = merge;
  1749. e.Layout.Bands[0].Columns["Memo"].MergedCellStyle = MergedCellStyle.Always;
  1750. e.Layout.Bands[0].Columns["Memo"].MergedCellEvaluator = merge;
  1751. e.Layout.Bands[0].Columns["StoveNo"].MergedCellStyle = MergedCellStyle.Always;
  1752. e.Layout.Bands[0].Columns["StoveNo"].MergedCellEvaluator = merge;
  1753. e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellStyle = MergedCellStyle.Always;
  1754. e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellEvaluator = merge;
  1755. e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellStyle = MergedCellStyle.Always;
  1756. e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellEvaluator = merge;
  1757. e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellStyle = MergedCellStyle.Always;
  1758. e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellEvaluator = merge;
  1759. e.Layout.Bands[0].Columns["GxProSeq"].MergedCellStyle = MergedCellStyle.Always;
  1760. e.Layout.Bands[0].Columns["GxProSeq"].MergedCellEvaluator = merge;
  1761. e.Layout.Bands[0].Columns["TotMumM"].MergedCellStyle = MergedCellStyle.Always;
  1762. e.Layout.Bands[0].Columns["TotMumM"].MergedCellEvaluator = merge;
  1763. e.Layout.Bands[0].Columns["totWeightM"].MergedCellStyle = MergedCellStyle.Always;
  1764. e.Layout.Bands[0].Columns["totWeightM"].MergedCellEvaluator = merge;
  1765. e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellStyle = MergedCellStyle.Always;
  1766. e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellEvaluator = merge;
  1767. e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellStyle = MergedCellStyle.Always;
  1768. e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellEvaluator = merge;
  1769. e.Layout.Bands[0].Columns["Planstatus"].MergedCellStyle = MergedCellStyle.Always;
  1770. e.Layout.Bands[0].Columns["Planstatus"].MergedCellEvaluator = merge;
  1771. e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellStyle = MergedCellStyle.Always;
  1772. e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellEvaluator = merge;
  1773. e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellStyle = MergedCellStyle.Always;
  1774. e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellEvaluator = merge;
  1775. e.Layout.Bands[0].Columns["ReducedWt"].MergedCellStyle = MergedCellStyle.Always;
  1776. e.Layout.Bands[0].Columns["ReducedWt"].MergedCellEvaluator = merge;
  1777. }
  1778. /// <summary>
  1779. /// 订单层重新获取工艺
  1780. /// </summary>
  1781. private void DoModifyProcess()
  1782. {
  1783. ArrayList messageErr = new ArrayList();
  1784. ultraGridZgS.UpdateData();
  1785. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1786. if (list == null || list.Count == 0)
  1787. {
  1788. MessageUtil.ShowTips("请选择订单!");
  1789. return;
  1790. }
  1791. ArrayList jsonList = new ArrayList();
  1792. foreach (PlnOrderZgSEntity entity in list)
  1793. {
  1794. entity.Passive.ToString();
  1795. jsonList.Add(JSONFormat.Format(entity));
  1796. }
  1797. if (MessageUtil.ShowYesNoAndQuestion("是否手动获取工艺?") == DialogResult.No)
  1798. {
  1799. return;
  1800. }
  1801. PlanComm.WaitFromOpen(this.Cursor);
  1802. CoreClientParam ccp = new CoreClientParam();
  1803. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  1804. ccp.MethodName = "DoModifyProcess";
  1805. ccp.ServerParams = new object[] { jsonList, "D" };
  1806. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1807. PlanComm.WaitFromColse(this.Cursor);
  1808. if (ccp.ReturnCode == -1) return;
  1809. MessageUtil.ShowTips(ccp.ReturnInfo);
  1810. if (ccp.ReturnInfo.Equals("获取成功!"))
  1811. {
  1812. Query();
  1813. }
  1814. }
  1815. /// <summary>
  1816. /// 订单终止
  1817. /// </summary>
  1818. private void doTermination()
  1819. {
  1820. ArrayList messageErr = new ArrayList();
  1821. ultraGridZgS.UpdateData();
  1822. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1823. if (list == null || list.Count == 0)
  1824. {
  1825. MessageUtil.ShowTips("请选择订单!");
  1826. return;
  1827. }
  1828. ArrayList jsonList = new ArrayList();
  1829. foreach (PlnOrderZgSEntity entity in list)
  1830. {
  1831. entity.Passive.ToString();
  1832. if (!entity.ExeStatus.Equals("计划"))
  1833. {
  1834. MessageUtil.ShowTips("订单不是计划状态不能关闭!");
  1835. return;
  1836. }
  1837. jsonList.Add(JSONFormat.Format(entity));
  1838. }
  1839. if (MessageUtil.ShowYesNoAndQuestion("是否终止订单?") == DialogResult.No)
  1840. {
  1841. return;
  1842. }
  1843. PlanComm.WaitFromOpen(this.Cursor);
  1844. CoreClientParam ccp = new CoreClientParam();
  1845. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  1846. ccp.MethodName = "doTermination";
  1847. ccp.ServerParams = new object[] { jsonList, "D" };
  1848. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1849. PlanComm.WaitFromColse(this.Cursor);
  1850. if (ccp.ReturnCode == -1) return;
  1851. MessageUtil.ShowTips(ccp.ReturnInfo);
  1852. if (ccp.ReturnInfo.Equals("终止成功!"))
  1853. {
  1854. Query();
  1855. }
  1856. }
  1857. #region 炉计划层操作
  1858. #endregion
  1859. private void chkLotNo_CheckedChanged(object sender, EventArgs e)
  1860. {
  1861. lotNoStart.Enabled = lotNoEnd.Enabled = chkLotNo.Checked;
  1862. }
  1863. private void cmbPro_EditorButtonClick(object sender, EditorButtonEventArgs e)
  1864. {
  1865. this.ultraGridZgS.UpdateData();
  1866. UltraGridRow row = this.ultraGridZgS.ActiveRow;
  1867. if (row == null)
  1868. {
  1869. return;
  1870. }
  1871. FrmProInformation fp = new FrmProInformation(ob, row.Cells["PrdcrNo"].Text, row.Cells["IndexSeq"].Text, "D");
  1872. fp.ShowDialog();
  1873. }
  1874. }
  1875. }