FrmPlnOrderZgS.cs 111 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522
  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 FrmPlnOrderZgS : 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 FrmPlnOrderZgS()
  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 "Capacity"://产线能力维护
  72. Capacity();
  73. break;
  74. case "AddRepairPlan"://检修计划
  75. AddRepairPlan();
  76. break;
  77. case "DeleteRepairPlan"://删除检修计划
  78. DeleteRepairPlan();
  79. break;
  80. case "PlineChange"://产线调整
  81. PlineChange();
  82. break;
  83. case "TimeChange"://时间调整
  84. TimeChange();
  85. break;
  86. case "StatusChange"://状态调整
  87. StatusChange();
  88. break;
  89. case "InitData"://耗时初始化
  90. InitData();
  91. break;
  92. case "Spit"://拆分订单
  93. Spit();
  94. break;
  95. case "Merge"://合并订单
  96. Merge();
  97. break;
  98. case "Issued"://确认下发
  99. Issued("0");
  100. break;
  101. case "CancelIssued"://取消下发
  102. Issued("1");
  103. break;
  104. case "SetPlanFinish"://设置合同完成
  105. SetPlanFinish();
  106. break;
  107. case "ModifyGpAimWall"://重算
  108. ModifyGpAimWall();
  109. break;
  110. case "UpdateCrop"://修改切头尾
  111. UpdateCrop();
  112. break;
  113. case "UpdateDiameM"://修改芯棒直径
  114. UpdateDiameM();
  115. break;
  116. case "ModifyThicknesWall"://修改控制壁厚
  117. ModifyThicknesWall();
  118. break;
  119. case "Recalculate"://重新计算
  120. Recalculate();
  121. break;
  122. case "Export": //导出
  123. GridHelper.ulGridToExcel(ultraGridZgS, "轧管排产信息");
  124. break;
  125. case "UpdateMonth"://修改排产月份
  126. UpdateMonth();
  127. break;
  128. case "ApplyApproval"://申请审批
  129. ApplyApproval();
  130. break;
  131. case "ModifyBatter"://修改坯子
  132. ModifyBatter();
  133. break;
  134. case "UpdateGroupGp"://修改索引码
  135. UpdateGroupGp();
  136. break;
  137. case "Confirm"://炉计划下发
  138. Issued("2");
  139. break;
  140. case "UinConfirm"://取消炉计划下发
  141. Issued("3");
  142. break;
  143. case "UpdateBatch"://修改轧批号
  144. UpdateBatch();
  145. break;
  146. case "Decision"://修改判定字头
  147. DoDecision();
  148. break;
  149. case "ProMemo"://工艺备注修改
  150. DoProMemo("0");
  151. break;
  152. case "UpdateMemo"://计划备注修改
  153. DoProMemo("1");
  154. break;
  155. case "Import"://导入
  156. DoImport();
  157. break;
  158. case "UpdatePase"://主被动修改
  159. DoUpdatePase();
  160. break;
  161. case "ModifyProcess"://手动获取工艺
  162. DoModifyProcess();
  163. break;
  164. case "AgainProcess"://重新获取工艺
  165. doAgainProcess();
  166. break;
  167. case "SortOrderZg":
  168. sortOrderZg();
  169. break;
  170. case"Print":
  171. printData();
  172. break;
  173. case"Notice":
  174. tabNotice();
  175. break;
  176. case "UpdateOrderTeam"://修改是否协同
  177. UpdateOrderTeam();
  178. break;
  179. case "Close": //关闭
  180. this.Close();
  181. break;
  182. default:
  183. break;
  184. }
  185. }
  186. private void UpdateOrderTeam()
  187. {
  188. this.ultraGridZgS.UpdateData();
  189. IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
  190. if (checkMagRows.Count() == 0)
  191. {
  192. MessageUtil.ShowTips("请选择需要操作的数据信息!");
  193. return;
  194. }
  195. ArrayList parmList = new ArrayList();
  196. foreach (UltraGridRow row in checkMagRows)
  197. {
  198. PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
  199. string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
  200. parmList.Add(plnOrderZgsEntity);
  201. }
  202. CoreClientParam ccp = new CoreClientParam();
  203. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  204. ccp.MethodName = "UpdateOrderTeam";
  205. ccp.ServerParams = new object[] { parmList, "D" };
  206. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  207. if (ccp.ReturnCode != -1)
  208. {
  209. if (ccp.ReturnInfo.Equals("修改成功!"))
  210. {
  211. Query();
  212. MessageUtil.ShowTips(ccp.ReturnInfo);
  213. }
  214. else
  215. {
  216. MessageUtil.ShowTips(ccp.ReturnInfo);
  217. }
  218. }
  219. }
  220. /// <summary>
  221. /// 标识监制信息
  222. /// </summary>
  223. private void tabNotice()
  224. {
  225. this.ultraGridZgS.UpdateData();
  226. IQueryable<UltraGridRow> checkMagRows = this.ultraGridZgS.Rows.AsQueryable().Where(" CHC = 'True'");
  227. if (checkMagRows.Count() == 0)
  228. {
  229. MessageUtil.ShowTips("请选择需要操作的监制信息!");
  230. return;
  231. }
  232. ArrayList parmList = new ArrayList();
  233. foreach (UltraGridRow row in checkMagRows)
  234. {
  235. PlnOrderZgSOEntity plnOrderZgsTity = (PlnOrderZgSOEntity)row.ListObject;
  236. string plnOrderZgsEntity = JSONFormat.Format(plnOrderZgsTity);
  237. parmList.Add(plnOrderZgsEntity);
  238. }
  239. CoreClientParam ccp = new CoreClientParam();
  240. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  241. ccp.MethodName = "tabNotice";
  242. ccp.ServerParams = new object[] { parmList, UserInfo.GetUserName(),"D" };
  243. ccp = ob.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 sortOrderZg()
  261. {
  262. string plineCode = "";
  263. plineCode = comPline.Value == null ? "" : comPline.Value.ToString();
  264. if (plineCode.Equals(""))
  265. {
  266. MessageUtil.ShowTips("请选择产线!");
  267. return;
  268. }
  269. CoreClientParam ccp = new CoreClientParam();
  270. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  271. ccp.MethodName = "sortOrderZg";
  272. ccp.ServerParams = new object[] { plineCode };
  273. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  274. if (ccp.ReturnCode != -1)
  275. {
  276. if (ccp.ReturnInfo.Equals("重新排序成功!"))
  277. {
  278. Query();
  279. MessageUtil.ShowTips(ccp.ReturnInfo);
  280. }
  281. else
  282. {
  283. MessageUtil.ShowTips(ccp.ReturnInfo);
  284. }
  285. }
  286. }
  287. /// <summary>
  288. /// 打印检验要点
  289. /// </summary>
  290. private void printData()
  291. {
  292. UltraGridRow row = ultraGridZgS.ActiveRow;
  293. if (row == null) return;
  294. if (row.Cells["ZyBatchId"].Text.Equals("")) return;
  295. 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();
  296. FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
  297. fBug.AutoSize = true;
  298. fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  299. fBug.Text = "检验要点打印";
  300. fBug.ShowDialog();
  301. }
  302. private void FrmPlnOrderZgS_Load(object sender, EventArgs e)
  303. {
  304. if (CustomInfo == null) { CustomInfo = ""; }
  305. //设置列头名称
  306. EntityHelper.ShowGridCaption<PlnOrderZgSOEntity>(ultraGridZgS.DisplayLayout.Bands[0]);
  307. EntityHelper.ShowGridCaption<PlnZyZgMCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  308. //EntityHelper.ShowGridCaption<PlnZyZgCEntity>(ultraGridZyD.DisplayLayout.Bands[1]);
  309. if (CustomInfo == "0")
  310. {
  311. PlanComm.setGridActivation(this.ultraGridZgS.DisplayLayout.Bands[0], "CHC", "ProMonth");//, "OutsBilletFl"
  312. }
  313. else
  314. {
  315. BaseHelper.setOtherColumnReadOnly(ultraGridZgS, new string[] { "CHC", "PlineCode", "PlanTimeB", "RepairType", "PlanUsetime", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
  316. BaseHelper.setColumnBackColor(ultraGridZgS, new string[] { "PlineCode", "Aimwallthick", "LenGpSingle", "LenCuthead", "LenCutend", "DiameterMandrel", "TubeEndRatio", "Memo", "LengthdiscN", "ZyBatchId", "Decision", "ProgyMemo" });
  317. EntityHelper.setColumnShowOrHidden(ultraGridZgS, new string[] { "OrderTeam" }, false);
  318. }
  319. BaseHelper.InitCellPosition(ultraGridZgS, new string[] { "GxPlanNo", "OrderSeq", "DeliveryNo", "Outdiameter", "Wallthick",
  320. "LenRollMax", "LenRollMin", "Aimoutdiameter", "Aimwallthick", "Aimlength", "DiameterGp", "LenGpSingle", "RollLength",
  321. "LenCuthead", "LenCutend", "OutnumCut", "DiameterMandrel", "InWeightS", "InNumS", "WeigthS", "NumS", "AddWtIn",
  322. "AddNumIn", "MatchWtIn", "MatchNumIn", "GxProSeq", "PlanUsetime", "BatchedWt", "BatchedNum", "Finishweight",
  323. "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" });
  324. BaseHelper.setUltraGridColumnMaxInput(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "InWeightS", "AddWtIn", "MatchWtIn", "BatchedWt", "AmountDifference", "UnfinishWgt", "LjWeight", "FurnaWeight", "CkWeight", "ExpectWt", "PendWeight", "ReducedWt", "LjWeightB" });
  325. plineCode= PlanHelper.InitDropPlinePower("D",comPline,this.ValidDataPurviewIds, this.ob);
  326. PlanHelper.InitRepairType(ultraGridZgS, this);
  327. PlanHelper.InitEditPline("D", "", ultraGridZgS, this);
  328. comPline.SelectedIndex = 0;
  329. if (CustomInfo != "0") { BaseHelper.ForbidSort(ultraGridZgS); }
  330. BaseHelper.GridColumnSum(ultraGridZgS, new string[] { "WeigthS", "WeigthSMin", "GpreqWeight", "PendWeight", "ReducedWt", "LjWeight", "ExpectWt", "FurnaWeight", "CkWeight", "LjWeightB" });
  331. BaseHelper.GridColumnCount(ultraGridZgS, new string[] { "NumS", "GpreqNum", "PlansNum", "PendNum", "LjNumB", "LjNum", "FurnaNum", "CkNum", });
  332. //BaseHelper.InitCellPositionMiddle(ultraGridZgS, new string[] { "IsRepairPln", "IsPlanOk", "IfMonitorZg", "GpreqIfOk", "Isendgx" });
  333. BaseHelper.setUltraGridColumnColor(ultraGridZgS, new string[] { "CraftFileNo", "CraftFileLv2G", "Gradename", "DiameterGp" }, Color.GreenYellow);
  334. //PlanHelper.InitEditGroup("1218", ultraGridZgS, this, "OutsBilletFl");
  335. PlanHelper.InitEditGroup("1219", ultraGridZgS, this, "OutsStlPipeFl");
  336. _backColor = ultraGridZgS.DisplayLayout.Override.RowSelectorAppearance.BackColor;
  337. InitTime();
  338. InitColorStyle();
  339. BaseHelper.setUltraGridColumnMaxInput(ultraGrid1, new string[] { "WtGpSingle", "PlnInsingleWt", "PlnOutsingleW", "ActuaWt", "TotWeightM", "CutWeight", "ReducedWt", "RealIndoubleWt" });
  340. BaseHelper.setUltraGridColumnBits(ultraGrid1, new string[] { "PlnInsingleNum", "PlnOutsingleNum", "ActuaNum", "TotMumM" });
  341. BaseHelper.InitCellPosition(ultraGrid1, new string[] { "GxProSeq", "GxPlanNo","OrderSeq", "DeliveryNo", "LenRollMax", "LenRollMin", "Aimoutdiameter","Aimwallthick","CcmGxPlanNo","Aimlength" ,"Diameter","LenGpSingle","WtGpSingle","PlnInsingleNum","PlnInsingleWt","PlnOutsingleNum",
  342. "PlnOutsingleW","Outdiameter", "Wallthick","OutdiameterZg","WallthickZg","RollLength","OutnumCut","LenCutend","LenCuthead","DiameterMandrel","CraftSeq","LenGpSingleD","LengthM","CutNumGp","ActuaWt","ActuaNum","TotMumM","TotWeightM","CutWeight","CutLength", "ReducedWt","RealIndoubleNum","RealIndoubleWt","ActCount"});
  343. //BaseHelper.InitCellPositionC(ultraGridZyD, new string[] { "Diameter", "LenGpSingle", "WtGpSingle", "CutNumGp", "LengthM", "WeightM", "PlanIndoubleNum", "PlanIndoubleWt", "RealIndoubleNum", "RealIndoubleWt", "GxPlanNo" });
  344. BaseHelper.GridColumnSum(ultraGrid1, new string[] { "ActuaWt", "CutWeight", "RealIndoubleWt" });
  345. BaseHelper.GridColumnCount(ultraGrid1, new string[] { "ActuaNum", "RealIndoubleNum" });
  346. StoveHelper.ForbidSort(ultraGrid1);
  347. BaseHelper.SetGroupBySum(ultraGrid1, new string[] { "PlnOutsingleNum", "PlnOutsingleW", "ReducedWt" }, "HeatPlanNo");
  348. }
  349. /// <summary>
  350. /// 初始化列状态
  351. /// </summary>
  352. private void InitColorStyle()
  353. {
  354. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Format = "yyyy-MM-dd HH:mm:ss";
  355. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].MaskInput = "yyyy-mm-dd hh:mm:ss";
  356. ultraGridZgS.DisplayLayout.Bands[0].Columns["PlanTimeB"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime;
  357. ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileLv2G"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  358. ultraGridZgS.DisplayLayout.Bands[0].Columns["CraftFileNo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  359. ultraGridZgS.DisplayLayout.Bands[0].Columns["Gradename"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  360. ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterGp"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  361. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  362. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfInfo"].CellAppearance.BackColor = Color.GreenYellow;
  363. ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  364. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].CellAppearance.BackColor = Color.GreenYellow;
  365. ultraGridZgS.DisplayLayout.Bands[0].Columns["TimeDiffer"].CellAppearance.BackColor = Color.GreenYellow;
  366. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProNum"].CellAppearance.BackColor = Color.GreenYellow;
  367. ultraGridZgS.DisplayLayout.Bands[0].Columns["AfProLin"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton;
  368. ultraGridZgS.DisplayLayout.Bands[0].Columns["ProdGradename"].CellAppearance.BackColor = Color.Wheat;
  369. UltraNumericEditor[] uneArr = new UltraNumericEditor[3];
  370. for (int i = 0; i < uneArr.Length; i++)
  371. {
  372. uneArr [i]= new UltraNumericEditor();
  373. uneArr[i].NumericType =NumericType.Double;
  374. if (i == 1)
  375. {
  376. uneArr[i].MaskInput = "nnnnn";
  377. }
  378. else
  379. {
  380. uneArr[i].MaskInput = "nnnnn.nn";
  381. }
  382. uneArr[i].SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;
  383. this.Controls.Add(uneArr[i]);
  384. uneArr[i].Visible = false;
  385. }
  386. uneArr[0].SpinIncrement = 0.01;
  387. uneArr[1].SpinIncrement = 50;
  388. uneArr[2].SpinIncrement =10;
  389. ultraGridZgS.DisplayLayout.Bands[0].Columns["Outdiameter"].EditorComponent = uneArr[0];
  390. ultraGridZgS.DisplayLayout.Bands[0].Columns["Wallthick"].EditorComponent = uneArr[0];
  391. ultraGridZgS.DisplayLayout.Bands[0].Columns["OutdiameterZg"].EditorComponent = uneArr[0];
  392. ultraGridZgS.DisplayLayout.Bands[0].Columns["WallthickZg"].EditorComponent = uneArr[0];
  393. //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMin"].EditorComponent = uneArr[0];
  394. //ultraGridZgS.DisplayLayout.Bands[0].Columns["PipeLengthMax"].EditorComponent = uneArr[0];
  395. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimoutdiameter"].EditorComponent = uneArr[0];
  396. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimwallthick"].EditorComponent = uneArr[0];
  397. ultraGridZgS.DisplayLayout.Bands[0].Columns["Aimlength"].EditorComponent = uneArr[0];
  398. ultraGridZgS.DisplayLayout.Bands[0].Columns["RollLength"].EditorComponent = uneArr[0];
  399. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenGpSingle"].EditorComponent = uneArr[2];
  400. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCuthead"].EditorComponent = uneArr[1];
  401. ultraGridZgS.DisplayLayout.Bands[0].Columns["LenCutend"].EditorComponent = uneArr[1];
  402. decisionFlsg(false);
  403. }
  404. private void decisionFlsg( Boolean b) {
  405. if (b)
  406. {
  407. UltraComboEditor uceAbc = new UltraComboEditor();
  408. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = uceAbc;
  409. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  410. ValueList vlistSteel = new ValueList(); ;
  411. vlistSteel.ValueListItems.Insert(0, "A", "A");
  412. vlistSteel.ValueListItems.Insert(1, "B", "B");
  413. vlistSteel.ValueListItems.Insert(2, "C", "C");
  414. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].ValueList = vlistSteel;
  415. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.AllowEdit;
  416. }
  417. else {
  418. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].EditorComponent = null;
  419. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Default;
  420. ultraGridZgS.DisplayLayout.Bands[0].Columns["Decision"].CellActivation = Activation.ActivateOnly;
  421. }
  422. }
  423. private void InitTime()
  424. {
  425. DateTime now = DateTime.Now;
  426. DateTime d1 = new DateTime(now.Year, now.Month, 1);
  427. DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
  428. txtPlanTimeB1.Value = d1;
  429. txtPlanTimeB2.Value = d2;
  430. txtPlanTimeE1.Value = d1;
  431. txtPlanTimeE2.Value = d2;
  432. }
  433. /// <summary>
  434. /// 初始化芯棒直径
  435. /// </summary>
  436. /// <param name="plineCode">产线</param>
  437. /// <param name="PassCode">孔型编码</param>
  438. /// <param name="aimoutdiameter">控制外径</param>
  439. /// <param name="aimwallthick">控制壁厚</param>
  440. //private void InitDimaM(string plineCode, string passCode, string aimoutdiameter, string aimwallthick)
  441. //{
  442. // DataTable dt1 = ServerHelper.GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryPlnMandrelId", new object[] { plineCode, passCode, aimoutdiameter,aimwallthick }, this.ob);
  443. // UltraComboEditor uce = new UltraComboEditor();
  444. // ultraGridZgS.Controls.Add(uce);
  445. // uce.Visible = false;
  446. // uce.DropDownListWidth = -1;
  447. // uce.DropDownStyle = DropDownStyle.DropDownList;
  448. // uce.DataSource = dt1;
  449. // uce.DisplayMember = "DIAMETER_MANDREL";
  450. // uce.ValueMember = "MANDREL_ID";
  451. // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].EditorComponent = uce;
  452. // ultraGridZgS.DisplayLayout.Bands[0].Columns["DiameterMandrel"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
  453. //}
  454. private void chcPline_CheckedChanged(object sender, EventArgs e)
  455. {
  456. if (chcPline.Checked) { comPline.ReadOnly = false; } else { comPline.ReadOnly = true; }
  457. if (chcOrderNo.Checked) { txtOrderNo.ReadOnly = false; } else { txtOrderNo.ReadOnly = true; }
  458. if (chcProPlanId.Checked) { txtProPlanId.ReadOnly = false; } else { txtProPlanId.ReadOnly = true; }
  459. if (chcPlanTimeB.Checked) { txtPlanTimeB1.ReadOnly = false; txtPlanTimeB2.ReadOnly = false; } else { txtPlanTimeB1.ReadOnly = true; txtPlanTimeB2.ReadOnly = true; }
  460. if (chcPlanTimeE.Checked) { txtPlanTimeE1.ReadOnly = false; txtPlanTimeE2.ReadOnly = false; } else { txtPlanTimeE1.ReadOnly = true; txtPlanTimeE2.ReadOnly = true; }
  461. }
  462. private void ultraGridZgS_InitializeRow(object sender, InitializeRowEventArgs e)
  463. {
  464. PlanHelper.ControlCellEdit(e.Row);
  465. }
  466. /// <summary>
  467. /// 查询
  468. /// </summary>
  469. private void Query()
  470. {
  471. //产线
  472. string comPlineCode = "";
  473. if (chcPline.Checked)
  474. {
  475. comPlineCode = comPline.Value == null ? "" : comPline.Value.ToString();
  476. }
  477. //如果是排产界面,则下拉框的产线不能为空,需要排序
  478. if (!CustomInfo.Equals("0") && comPlineCode.Equals(""))
  479. {
  480. MessageUtil.ShowTips("请选择产线!");
  481. return;
  482. }
  483. WaitingForm2 wf3 = new WaitingForm2("正在刷新,请稍候....");
  484. try
  485. {
  486. this.Cursor = Cursors.WaitCursor;
  487. //执行状态
  488. string[] statusArr = contorlPlanStatus1.statusArr;
  489. //合同号
  490. string orderNo = "";
  491. if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
  492. string proPlanId = "";
  493. if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
  494. string planTimeB1 = "";
  495. string planTimeB2 = "";
  496. if (chcPlanTimeB.Checked && txtPlanTimeB2.Value != null && txtPlanTimeB1.Value != null)
  497. {
  498. planTimeB1 = DateTime.Parse(txtPlanTimeB1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  499. planTimeB2 = DateTime.Parse(txtPlanTimeB2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  500. }
  501. string planTimeE1 = "";
  502. string planTimeE2 = "";
  503. if (chcPlanTimeE.Checked && txtPlanTimeE2.Value != null && txtPlanTimeE1.Value != null)
  504. {
  505. planTimeE1 = DateTime.Parse(txtPlanTimeE1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  506. planTimeE2 = DateTime.Parse(txtPlanTimeE2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
  507. }
  508. if (plineCode == null)
  509. {
  510. MessageUtil.ShowTips("该用户没有轧管产线查看权限!");
  511. return;
  512. }
  513. string lotNoS = "";
  514. string lotNoE = "";
  515. if(chkLotNo.Checked)
  516. {
  517. lotNoS = lotNoStart.Text.Trim();
  518. lotNoE = lotNoEnd.Text.Trim();
  519. }
  520. List<PlnOrderZgSOEntity> listSource = EntityHelper.GetData<PlnOrderZgSOEntity>
  521. ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlanOrderD", new object[] { plineCode, proPlanId, orderNo, statusArr, planTimeB1, planTimeB2, planTimeE1, planTimeE2, comPlineCode, lotNoS,lotNoE }, this.ob);
  522. plnOrderZgSOEntityBindingSource.DataSource = listSource;
  523. //ProducHelper.copyLZData(ultraGridZgS, "D", this.ob);
  524. //ProducHelper.copyLZDataZg(ultraGridZgS, "D", this.ob);
  525. dtPlinGroup = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlinCodeGroup", null, this.ob);
  526. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  527. {
  528. string str = ugr.Cells["AfInfo"].Text.Trim();
  529. if (str != null && str != "")
  530. {
  531. //string[] sArray = str.Split(new char[3] { '天', ',', '条' });
  532. string[] sArray = str.Split(new char[1]{','});
  533. ugr.Cells["TimeDiffer"].Value = String.Format("{0:N2} ", sArray[0]).Substring(0,sArray[0].IndexOf("天"));
  534. ugr.Cells["AfProLin"].Value = sArray[1];
  535. ugr.Cells["AfProNum"].Value = sArray[2].Substring(0, sArray[2].IndexOf("条"));
  536. if (dtPlinGroup.Rows.Count > 0)
  537. {
  538. //for (int i = 0; i < dtPlinGroup.Rows.Count; i++)
  539. //{
  540. string plinGroup = dtPlinGroup.Rows[0]["PLINE_NAME_M"].ToString() + "/" + dtPlinGroup.Rows[0]["PLINE_NAME_C"].ToString();
  541. DataRow[] dr = dtPlinGroup.Select("PLINE_NAME_M='" + ugr.Cells["PlineCode"].Text.ToString() + "' AND PLINE_NAME_C ='" + ugr.Cells["AfProLin"].Value.ToString() + "'", "");
  542. if (dr == null || dr.Length == 0) { }
  543. else
  544. {
  545. //DataTable tmp = dr.Table.Clone(); // 复制DataRow的表结构
  546. //if (tmp.Rows.Count > 0)
  547. //{
  548. ugr.Cells["StockGroupName"].Value = dr[0]["STOCK_GROUP_NAME"].ToString();
  549. //}
  550. }
  551. }
  552. }
  553. if (ultraGridZgS.DisplayLayout.Bands[0].Columns.Exists("CraftFileLv2GPath"))
  554. {
  555. string craftFileLv2G = ugr.Cells["CraftFileLv2G"].Text.Trim();
  556. string[] name = craftFileLv2G.Split(new char[1] { '/' });
  557. ugr.Cells["CraftFileLv2GPath"].Value = craftFileLv2G;
  558. ugr.Cells["CraftFileLv2G"].Value = name[name.Length - 1];
  559. }
  560. if (ugr.Cells["WeigthSMin"].Text.ToString().Equals("") || ugr.Cells["WeigthSMin"].Value.ToString().Equals("0"))
  561. {
  562. ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthS"].Value.ToString())).ToString();
  563. }
  564. else
  565. {
  566. ugr.Cells["AmountDifference"].Value = (double.Parse(ugr.Cells["ExpectWt"].Value.ToString()) - double.Parse(ugr.Cells["WeigthSMin"].Value.ToString())).ToString();
  567. }
  568. }
  569. //激活操作行代码
  570. //if ((!_ProPlanId.Equals("") && !_GxPlanNo.Equals("")) || _entityList != null)
  571. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  572. {
  573. if (!_ProPlanId.Equals("") && !_GxPlanNo.Equals(""))
  574. {
  575. if (ugr.Cells["ProPlanId"].Text.Trim().Equals(_ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(_GxPlanNo))
  576. {
  577. ugr.Activate();
  578. break;
  579. }
  580. }
  581. if (_entityList != null)
  582. {
  583. for (int i = 0; i < _entityList.Count; i++)
  584. {
  585. PlnOrderZgSEntity jgxsEntity = (PlnOrderZgSEntity)_entityList[i];
  586. if (ugr.Cells["ProPlanId"].Text.Trim().Equals(jgxsEntity.ProPlanId) && ugr.Cells["GxPlanNo"].Text.Trim().Equals(jgxsEntity.GxPlanNo))
  587. {
  588. ugr.Appearance.BackColor = Color.Wheat;
  589. ugr.Activate();
  590. }
  591. //if (!ugr.Cells["GxProSeq"].Text.Trim().Equals(jgxsEntity.GxProSeq))
  592. //{
  593. // ugr.Cells["GxProSeq"].Appearance.BackColor = Color.Wheat;
  594. // ugr.Activate();
  595. //}
  596. }
  597. }
  598. if (ugr.Cells["IsNoticeEp"].Text.Equals("已通知"))
  599. {
  600. ugr.Cells["IsNoticeEp"].Appearance.BackColor = Color.GreenYellow;
  601. ugr.Activate();
  602. }
  603. }
  604. _entityList = null;
  605. _ProPlanId = "";
  606. _ProPlanId = "";
  607. }
  608. finally
  609. {
  610. wf3.Close();
  611. this.Cursor = Cursors.Default;
  612. }
  613. }
  614. /// <summary>
  615. /// 修改切头尾数据
  616. /// </summary>
  617. private void UpdateCrop()
  618. {
  619. try
  620. {
  621. ArrayList messageErr = new ArrayList();
  622. ultraGridZgS.UpdateData();
  623. ArrayList list = new ArrayList();
  624. IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
  625. if (checkRows.Count() == 0)
  626. {
  627. MessageUtil.ShowWarning("请选择订单!");
  628. return;
  629. }
  630. PlanComm.WaitFromOpen(this.Cursor);
  631. foreach (UltraGridRow uRow in checkRows)
  632. {
  633. ArrayList param = new ArrayList();
  634. param.Add(UserInfo.GetUserName());
  635. param.Add(uRow.Cells["ProPlanId"].Value.ToString());
  636. param.Add(uRow.Cells["GxPlanNo"].Value.ToString());
  637. param.Add(uRow.Cells["InwlId"].Text);
  638. param.Add(uRow.Cells["OutwlId"].Text);
  639. param.Add(uRow.Cells["PlineCode"].Value.ToString());
  640. list.Add(param);
  641. }
  642. if (list.Count == 0)
  643. {
  644. PlanComm.WaitFromColse(this.Cursor);
  645. MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
  646. return;
  647. }
  648. CoreClientParam ccp = new CoreClientParam();
  649. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  650. ccp.MethodName = "updateCrop";
  651. ccp.ServerParams = new object[] { list, UserInfo.GetUserName() };
  652. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  653. PlanComm.WaitFromColse(this.Cursor);
  654. if (ccp.ReturnCode == -1) return;
  655. MessageUtil.ShowTips(ccp.ReturnInfo);
  656. if (ccp.ReturnInfo.Equals("批量获取切头尾成功!"))
  657. {
  658. Query();
  659. }
  660. }
  661. catch (Exception ex)
  662. {
  663. PlanComm.WaitFromColse(this.Cursor);
  664. if (!(ex is MESException))
  665. {
  666. MessageUtil.ShowError(ex.Message);
  667. }
  668. }
  669. }
  670. /// <summary>
  671. /// 产线能力维护
  672. /// </summary>
  673. private void Capacity()
  674. {
  675. UltraGridRow ugr = ultraGridZgS.ActiveRow;
  676. if (ugr == null)
  677. {
  678. return;
  679. }
  680. string inMaterialNo = ugr.Cells["InwlId"].Text;
  681. string outMaterialNo = ugr.Cells["OutwlId"].Text;
  682. string plineCode = ugr.Cells["PlineCode"].Value.ToString();
  683. FrmBaseMaterialDPl frmBaseMaterialDPl = new FrmBaseMaterialDPl(inMaterialNo, outMaterialNo, plineCode, this.ob);
  684. frmBaseMaterialDPl.ShowDialog();
  685. }
  686. /// <summary>
  687. /// 新增检修计划
  688. /// </summary>
  689. private void AddRepairPlan()
  690. {
  691. if (comPline.Value == null || comPline.Value.ToString().Equals(""))
  692. {
  693. MessageUtil.ShowTips("请选择产线!");
  694. return;
  695. }
  696. FrmJxjh frmJxjh = new FrmJxjh(this.ob, comPline.Value.ToString(), "D");
  697. frmJxjh.ShowDialog();
  698. Query();
  699. }
  700. /// <summary>
  701. /// 折分订单
  702. /// </summary>
  703. private void Spit()
  704. {
  705. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  706. bool flag = ProducHelper.SpitPlanOrder(list, "D", this.ob);
  707. if (flag)
  708. {
  709. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  710. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  711. Query();
  712. }
  713. }
  714. /// <summary>
  715. /// 合并订单
  716. /// </summary>
  717. private void Merge()
  718. {
  719. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  720. bool flag = ProducHelper.MergePlanOrder(list, "D", this.ob);
  721. if (flag)
  722. {
  723. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  724. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  725. Query();
  726. }
  727. }
  728. /// <summary>
  729. /// 产线调整
  730. /// </summary>
  731. private void PlineChange()
  732. {
  733. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  734. bool flag = ProducHelper.PlineChange(list, "D", this.ob);
  735. if (flag)
  736. {
  737. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  738. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  739. Query();
  740. }
  741. }
  742. /// <summary>
  743. /// 初始化
  744. /// </summary>
  745. private void InitData()
  746. {
  747. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  748. bool flag = ProducHelper.InitData(list, "D", this.ob);
  749. if (flag)
  750. {
  751. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  752. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  753. Query();
  754. }
  755. }
  756. /// <summary>
  757. /// 状态调整
  758. /// </summary>
  759. private void StatusChange()
  760. {
  761. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  762. bool flag = ProducHelper.StatusChange(list, "D", this.ob);
  763. if (flag)
  764. {
  765. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  766. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  767. Query();
  768. }
  769. }
  770. /// <summary>
  771. /// 时间调整
  772. /// </summary>
  773. private void TimeChange()
  774. {
  775. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  776. bool flag = ProducHelper.TimeChange(list, "D", this.ob);
  777. if (flag)
  778. {
  779. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  780. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  781. Query();
  782. }
  783. }
  784. /// <summary>
  785. /// 排序
  786. /// </summary>
  787. /// <param name="sender"></param>
  788. /// <param name="e"></param>
  789. private void ultraGridZgS_MouseDown(object sender, MouseEventArgs e)
  790. {
  791. //排产查询界面,不能排序
  792. if (CustomInfo.Equals("0"))
  793. { return; }
  794. try
  795. { ultraGridZgS.UpdateData(); }
  796. catch (Exception)
  797. {
  798. MessageUtil.ShowWarning("数据异常,请刷新数据!"); return;
  799. }
  800. if (e.Button == MouseButtons.Right)
  801. {
  802. //移动行
  803. ArrayList entityList = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  804. if (entityList == null || entityList.Count == 0)
  805. {
  806. return;
  807. }
  808. //定位行
  809. UIElement myUIElement = ultraGridZgS.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
  810. UltraGridCell myCell = (UltraGridCell)myUIElement.GetContext(typeof(UltraGridCell));
  811. if (myCell == null) { return; }
  812. UltraGridRow ugr = myCell.Row;
  813. if (ugr == null) { return; }
  814. PlnOrderZgSEntity entityD = (PlnOrderZgSEntity)ugr.ListObject;
  815. bool flag = ProducHelper.SortPlanOrder(entityList, entityD, "D", "", this.ob);
  816. if (flag)
  817. {
  818. _entityList = entityList;
  819. Query();
  820. }
  821. }
  822. }
  823. private void ultraGridZgS_AfterRowActivate(object sender, EventArgs e)
  824. {
  825. UltraGridRow ugrAc = ultraGridZgS.ActiveRow;
  826. if (ugrAc == null)
  827. {
  828. return;
  829. }
  830. foreach (UltraGridRow ugr in ultraGridZgS.Rows)
  831. {
  832. if (ugr.Cells["ProPlanId"].Text.Equals(ugrAc.Cells["ProPlanId"].Text))
  833. {
  834. ugr.RowSelectorAppearance.BackColor = Color.LightGreen;
  835. }
  836. else
  837. {
  838. ugr.RowSelectorAppearance.BackColor = _backColor;
  839. }
  840. if (ugr.Cells["PlanUsetime"].Value == null || ugr.Cells["PlanUsetime"].Value.ToString().Equals("") || Convert.ToDouble(ugr.Cells["PlanUsetime"].Value.ToString()) <= 0)
  841. {
  842. ugr.Cells["PlanUsetime"].Appearance.BackColor = Color.MistyRose;
  843. }
  844. if (ugr.Cells["ExeStatus"].Value.ToString().Equals("生产中"))
  845. {
  846. ugr.Cells["PlanTimeB"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  847. }
  848. if (ugr.Cells["IsRepairPln"].Text.Equals("是"))
  849. {
  850. ugr.Cells["PlanUsetime"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  851. ugr.Cells["RepairType"].Appearance.BackColor = System.Drawing.Color.FromArgb(255, 255, 128);
  852. }
  853. }
  854. proPlanId = ugrAc.Cells["ProPlanId"].Text.ToString();
  855. gxPlanNo = ugrAc.Cells["GxPlanNo"].Text.ToString();
  856. //doQueryVirtual(ugrAc.Cells["ProPlanId"].Text.ToString(), ugrAc.Cells["GxPlanNo"].Text.ToString());
  857. doQueryActual(proPlanId, gxPlanNo);
  858. }
  859. /// <summary>
  860. /// 虚拟炉计划
  861. /// </summary>
  862. /// <param name="proPlanId"></param>
  863. /// <param name="gxPlanNo"></param>
  864. private void doQueryVirtual(string proPlanId, string gxPlanNo)
  865. {
  866. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryVirtual",
  867. new object[] { proPlanId, gxPlanNo }, this.ob);
  868. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  869. }
  870. /// <summary>
  871. /// 实际炉计划
  872. /// </summary>
  873. /// <param name="proPlanId"></param>
  874. /// <param name="gxPlanNo"></param>
  875. private void doQueryActual(string proPlanId, string gxPlanNo)
  876. {
  877. List<PlnZyZgMCEntity> listSourceM = EntityHelper.GetData<PlnZyZgMCEntity>
  878. ("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryActual", new object[] { proPlanId, gxPlanNo }, ob);
  879. plnZyZgMCEntityBindingSource.DataSource = listSourceM;
  880. foreach (UltraGridRow ugr in ultraGrid1.Rows)
  881. {
  882. ugr.Cells["DELETE"].Value = "删除炉计划";
  883. //没有实际炉计划,主炉计划变颜色
  884. if (ugr.Cells["ActuaWt"].Value.ToString().Equals(""))
  885. {
  886. //ugr.RowSelectorAppearance.BackColor = Color.GreenYellow;
  887. ugr.Appearance.BackColor = Color.Orange;
  888. }
  889. if (!string.IsNullOrEmpty(ugr.Cells["ApplyDesc"].Value.ToString2()))
  890. {
  891. ugr.Appearance.BackColor = Color.Red;
  892. }
  893. //if (!ugr.Cells["Planstatus"].Value.ToString().Equals("计划") && ugr.Cells["Planstatus"].Value.ToString().Equals("下发"))
  894. //{
  895. // if (int.Parse(ugr.Cells["ActCount"].Value.ToString()) > 0)
  896. // {
  897. // ugr.Cells["ActCount"].Column.CellAppearance.BackColor = Color.;
  898. // }
  899. //}
  900. }
  901. }
  902. private void ultraGridZgS_CellChange(object sender, CellEventArgs e)
  903. {
  904. try
  905. {
  906. ultraGridZgS.UpdateData();
  907. if (e.Cell.Column.Key.Equals("CHC"))
  908. {
  909. IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
  910. if (chcRows != null && chcRows.Count() > 0)
  911. {
  912. decisionFlsg(true);
  913. }
  914. else {
  915. decisionFlsg(false);
  916. }
  917. }
  918. if (e.Cell.Column.Key.Equals("PlineCode"))
  919. {
  920. IQueryable<UltraGridRow> chcRows = ultraGridZgS.Rows.AsQueryable().Where(a => a.GetValue("CHC") == "True");
  921. if (CustomInfo.Equals("0"))
  922. {
  923. e.Cell.Row.Cells["PlineName"].Value = e.Cell.Text;
  924. }
  925. else
  926. {
  927. if (chcRows != null && chcRows.Count() > 0)
  928. {
  929. foreach (UltraGridRow ugr in chcRows)
  930. {
  931. ugr.Cells["PlineCode"].Value = e.Cell.Value.ToString();
  932. ugr.Cells["PlineName"].Value = e.Cell.Text;
  933. }
  934. }
  935. }
  936. }
  937. }
  938. catch (Exception)
  939. {
  940. }
  941. }
  942. /// <summary>
  943. /// 删除检修计划
  944. /// </summary>
  945. public void DeleteRepairPlan()
  946. {
  947. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  948. bool flag = ProducHelper.DeleteRepairPlan(list, "D", this.ob);
  949. if (flag)
  950. {
  951. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  952. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  953. Query();
  954. }
  955. }
  956. private void comPline_ValueChanged(object sender, EventArgs e)
  957. {
  958. if (comPline == null)
  959. { return; }
  960. else
  961. { if (!CustomInfo.Equals("0")) { } }
  962. }
  963. /// <summary>
  964. /// 下发(取消)
  965. /// </summary>
  966. private void Issued(string isFlag)
  967. {
  968. IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
  969. if (checkRows.Count() == 0)
  970. {
  971. MessageUtil.ShowWarning("请选择订单!");
  972. return;
  973. }
  974. if (isFlag.Equals("0"))
  975. {int count=0;
  976. foreach (UltraGridRow row in checkRows)
  977. {
  978. if (row.Cells["LenCuthead"].Text.Trim().Equals(""))
  979. {
  980. MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",切头无数据,不允许确认!");
  981. return;
  982. }
  983. if (row.Cells["LenCutend"].Text.Trim().Equals(""))
  984. {
  985. MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",切尾无数据,不允许确认!");
  986. return;
  987. }
  988. if (!row.Cells["Verify1"].Text.Trim().Equals(""))
  989. {
  990. string str = row.Cells["Verify1"].Text.Trim();
  991. string[] strArray = str.Split(new char[2] { ':', 'm' });
  992. double len = double.Parse(strArray[1].ToString());
  993. if (len - 4 > 0)
  994. {
  995. if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",管余长大于4m,是否确认!") == DialogResult.No) return;
  996. }
  997. if (len < 0)
  998. {
  999. if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",管余长小于0,是否确认!") == DialogResult.No) return;
  1000. }
  1001. }
  1002. if (double.Parse(row.Cells["Aimlength"].Value.ToString()) >= 13.5 && row.Cells["WholeBacklogDesc"].Text.Trim().Contains("热处理"))
  1003. {
  1004. if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",目标长度可能超限,需热处理确认长度,是否确认!") == DialogResult.No) return;
  1005. }
  1006. //if (!row.Cells["Verify2"].Text.Trim().Equals(""))
  1007. //{
  1008. // MessageUtil.ShowTips("长度超出范围!");
  1009. // return;
  1010. //}
  1011. int numS = 0;//排产支
  1012. int plansNum = 0;//计划产出支
  1013. if (!row.Cells["NumS"].Text.ToString().Trim().Equals(""))
  1014. {
  1015. numS = int.Parse(row.Cells["NumS"].Value.ToString());
  1016. }
  1017. if (!row.Cells["PlansNum"].Text.ToString().Trim().Equals(""))
  1018. {
  1019. plansNum = int.Parse(row.Cells["PlansNum"].Value.ToString());
  1020. }
  1021. if (numS <= 0)
  1022. {
  1023. MessageUtil.ShowTips("排产支数小于等于0!");
  1024. return;
  1025. }
  1026. int num = plansNum / numS;
  1027. if (!row.Cells["Verify3"].Text.Trim().Equals("") || num > 2)
  1028. {
  1029. count++;
  1030. //if (MessageUtil.ShowYesNoAndQuestion("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",连轧后长度小于托管机最短,脱不出或计划产出支除以排产支大于2,是否继续?") == DialogResult.No) return;
  1031. }
  1032. //if (row.Cells["CicGp"].Text.Trim().Equals(""))
  1033. //{
  1034. // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",钢种索引码为空!");
  1035. // return;
  1036. //}
  1037. if (!row.Cells["LengthdiscN"].Text.Trim().Equals("") && row.Cells["ApplyStatus"].Text.Trim().Equals(""))
  1038. {
  1039. MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",推荐合同长度未申请!");
  1040. return;
  1041. }
  1042. if (row.Cells["ApplyStatus"].Text.Trim().Equals("申请"))
  1043. {
  1044. MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",推荐合同长度未审核!");
  1045. return;
  1046. }
  1047. }
  1048. if (count>0)
  1049. {
  1050. if (MessageUtil.ShowYesNoAndQuestion("其中有" + count + "条,连轧后长度小于托管机最短,脱不出或计划产出支除以排产支大于2,是否继续?") == DialogResult.No) return;
  1051. }
  1052. }
  1053. else if (isFlag.Equals("2"))
  1054. {
  1055. string porderstatus = "";//合同状态
  1056. foreach (UltraGridRow row in checkRows)
  1057. {
  1058. DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.doQueryPorderstatus", new object[] { row.Cells["OrdLnDlyPk"].Text.Trim() }, ob);
  1059. if (dt.Rows.Count > 0)
  1060. {
  1061. porderstatus = dt.Rows[0]["PORDERSTATUS"].ToString();
  1062. }
  1063. if (porderstatus.Equals("4") || porderstatus.Equals("5"))
  1064. {
  1065. MessageUtil.ShowTips("该合同已生产完成或关闭,请联系销售!");
  1066. return;
  1067. }
  1068. //if (row.Cells["IsPlanOk"].Text.Trim().Equals("是"))
  1069. //{
  1070. // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",未确认,不允许炉计划下发!");
  1071. // return;
  1072. //}
  1073. //if (row.Cells["ZyBatchId"].Text.Equals(""))
  1074. //{
  1075. // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",轧批号不能为空!");
  1076. // return;
  1077. //}
  1078. }
  1079. }
  1080. //else if (isFlag.Equals("3"))
  1081. //{//取消炉计划下发
  1082. // foreach (UltraGridRow row in checkRows)
  1083. // {
  1084. // int numz = 0;
  1085. // double wtz = 0;
  1086. // if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
  1087. // {
  1088. // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
  1089. // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
  1090. // }
  1091. // int numLj = 0;
  1092. // double wtLj = 0;
  1093. // if (!row.Cells["LjNum"].Text.ToString().Equals(""))
  1094. // {
  1095. // numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
  1096. // wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
  1097. // }
  1098. // int batNum = 0;
  1099. // double batWt = 0;
  1100. // if (!row.Cells["CkNum"].Text.ToString().Equals(""))
  1101. // {
  1102. // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
  1103. // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
  1104. // }
  1105. // //int num = numz + numLj + batNum;
  1106. // if (numz > 0)
  1107. // {
  1108. // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已装炉,不能撤销下发!");
  1109. // return;
  1110. // }
  1111. // if (numLj > 0)
  1112. // {
  1113. // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已LJ,不能撤销下发!");
  1114. // return;
  1115. // }
  1116. // if (batNum > 0)
  1117. // {
  1118. // MessageUtil.ShowWarning("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已出库,不能撤销下发!");
  1119. // return;
  1120. // }
  1121. // }
  1122. //}
  1123. //else if (isFlag.Equals("1"))
  1124. //{
  1125. // foreach (UltraGridRow row in checkRows)
  1126. // {
  1127. // if (row.Cells["IfStoveIssued"].Text.Trim().Equals("是"))
  1128. // {
  1129. // MessageUtil.ShowTips("轧管订单:" + row.Cells["ProPlanId"].Text + "/" + row.Cells["GxPlanNo"].Text + ",已炉计划下发!");
  1130. // return;
  1131. // }
  1132. // }
  1133. //}
  1134. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1135. bool flag = ProducHelper.issuedPlanOrder(list, UserInfo.GetUserName(), isFlag, "D", this.ob);
  1136. if (flag)
  1137. {
  1138. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  1139. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  1140. Query();
  1141. }
  1142. }
  1143. private void ultraGridZgS_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
  1144. {
  1145. foreach (UltraGridRow uRow in ultraGridZgS.Selected.Rows)
  1146. {
  1147. if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
  1148. {
  1149. uRow.Cells["CHC"].Value = true;
  1150. }
  1151. }
  1152. }
  1153. private void ultraGridZgS_ClickCellButton(object sender, CellEventArgs e)
  1154. {
  1155. UltraGridRow row = ultraGridZgS.ActiveRow;
  1156. if (e.Cell.Column.Key.Equals("CraftFileNo"))
  1157. {
  1158. string filePath = row.GetValue("CraftPath");
  1159. dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, filePath);
  1160. askDown.Show();
  1161. }
  1162. else if (e.Cell.Column.Key.Equals("CraftFileLv2G"))
  1163. {
  1164. string craftFileLv2G = row.GetValue("CraftFileLv2GPath");
  1165. dlgOrderAskDown askDown = new dlgOrderAskDown(this.ob, craftFileLv2G);
  1166. askDown.Show();
  1167. }
  1168. else if (e.Cell.Column.Key.Equals("DiameterGp"))
  1169. {
  1170. string exeStatus = row.GetValue("ExeStatus");
  1171. if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
  1172. {
  1173. return;
  1174. }
  1175. string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
  1176. string proPlanId = row.GetValue("ProPlanId");
  1177. string gxPlanNo = row.GetValue("GxPlanNo");
  1178. string gradeCode = row.GetValue("GradeCode");
  1179. if (gradeCode.Equals(""))
  1180. {
  1181. return;
  1182. }
  1183. string[] groupCic = null;
  1184. if (!row.GetValue("GradeCode").Equals(""))
  1185. {
  1186. groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
  1187. }
  1188. string cicGp = row.GetValue("CicGp");
  1189. //int numz = 0;
  1190. //double wtz = 0;
  1191. //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
  1192. //{
  1193. // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
  1194. // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
  1195. //}
  1196. int numLj = 0;
  1197. double wtLj = 0;
  1198. //if (!row.Cells["LjNum"].Value.ToString().Equals("0"))
  1199. //{
  1200. numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
  1201. wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
  1202. //}
  1203. //else
  1204. //{
  1205. // numLj = int.Parse(row.Cells["MatchNumIn"].Value.ToString());
  1206. // wtLj = double.Parse(row.Cells["MatchWtIn"].Value.ToString());
  1207. //}
  1208. //int batNum = 0;
  1209. //double batWt = 0;
  1210. //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
  1211. //{
  1212. // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
  1213. // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
  1214. //}
  1215. //int num = numz + numLj + batNum;
  1216. int num = numLj;
  1217. FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
  1218. frmBomConfirm.ShowDialog();
  1219. bool flag = frmBomConfirm.Flag;
  1220. if (flag) { Query(); }//如果有修改数据,则刷新页面
  1221. }
  1222. else if (e.Cell.Column.Key.Equals("Gradename"))
  1223. {
  1224. string exeStatus = row.GetValue("ExeStatus");
  1225. if (!exeStatus.Equals("计划") && !exeStatus.Equals("生产中"))
  1226. {
  1227. return;
  1228. }
  1229. string ordLnDlyPk = row.GetValue("OrdLnDlyPk");
  1230. string proPlanId = row.GetValue("ProPlanId");
  1231. string gxPlanNo = row.GetValue("GxPlanNo");
  1232. string gradeCode = row.GetValue("GradeCode");
  1233. if (gradeCode.Equals(""))
  1234. {
  1235. return;
  1236. }
  1237. string[] groupCic = null;
  1238. if (!row.GetValue("GradeCode").Equals(""))
  1239. {
  1240. groupCic = row.Cells["CicGroupGp"].Text.ToString().Split(',');
  1241. }
  1242. string cicGp = row.GetValue("CicGp");
  1243. int numz = 0;
  1244. double wtz = 0;
  1245. //if (!row.Cells["FurnaNum"].Text.ToString().Equals(""))
  1246. //{
  1247. // numz = int.Parse(row.Cells["FurnaNum"].Value.ToString());
  1248. // wtz = double.Parse(row.Cells["FurnaWeight"].Value.ToString());
  1249. //}
  1250. int numLj = 0;
  1251. double wtLj = 0;
  1252. //if (!row.Cells["LjNum"].Text.ToString().Equals(""))
  1253. //{
  1254. numLj = int.Parse(row.Cells["LjNum"].Value.ToString());
  1255. wtLj = double.Parse(row.Cells["LjWeight"].Value.ToString());
  1256. //}
  1257. //int batNum = 0;
  1258. //double batWt = 0;
  1259. //if (!row.Cells["CkNum"].Text.ToString().Equals(""))
  1260. //{
  1261. // batNum = int.Parse(row.Cells["CkNum"].Value.ToString());
  1262. // batWt = double.Parse(row.Cells["CkWeight"].Value.ToString());
  1263. //}
  1264. int num = numLj ;
  1265. FrmBomConfirm frmBomConfirm = new FrmBomConfirm(ordLnDlyPk, proPlanId, gxPlanNo, this.ob, groupCic, cicGp,num);
  1266. frmBomConfirm.ShowDialog();
  1267. bool flag = frmBomConfirm.Flag;
  1268. if (flag) { Query(); }//如果有修改数据,则刷新页面
  1269. }
  1270. else if (e.Cell.Column.Key.Equals("AfProLin"))
  1271. {
  1272. string proPlanId = row.GetValue("ProPlanId");
  1273. string afInfo = row.GetValue("AfInfo");
  1274. if (afInfo == null || afInfo.Length == 0) { return; }
  1275. FrmPreGxInfo frmPreGxInfo = new FrmPreGxInfo(proPlanId, "D", "Af", this.ob);
  1276. frmPreGxInfo.ShowDialog();
  1277. }
  1278. else if (e.Cell.Column.Key.Equals("DiameterMandrel"))
  1279. {
  1280. //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());
  1281. FrmDiameterMandrel frmDm = new FrmDiameterMandrel(row.GetValue("PlineCode"), row.GetValue("PassCode"), row.GetValue("Aimoutdiameter"), row.GetValue("Aimwallthick"), this.ob);
  1282. frmDm.AutoSize = true;
  1283. //frmDm.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  1284. frmDm.Text = "芯棒直径";
  1285. frmDm.ShowDialog();
  1286. if (frmDm.DialogResult == System.Windows.Forms.DialogResult.OK)
  1287. {
  1288. //获取弹出窗体的属性值
  1289. row.Cells["DiameterMandrel"].Value = frmDm.DiameterMandrel;
  1290. if (!frmDm.LenSingerBill.Equals("0") && double.Parse(frmDm.LenSingerBill) < double.Parse(row.Cells["LenGpSingle"].Value.ToString()))
  1291. {
  1292. row.Cells["LenGpSingle"].Value = frmDm.LenSingerBill;
  1293. }
  1294. }
  1295. }
  1296. else if (e.Cell.Column.Key.Equals("ApplyNo"))
  1297. {
  1298. UndoApply();
  1299. }
  1300. else if (e.Cell.Column.Key.Equals("LengthdiscN"))
  1301. {
  1302. if (row.GetValue("OrdLnDlyPk").Contains("ZZBY-"))
  1303. {
  1304. MessageUtil.ShowTips("该合同是备料需求合同,不允许修改推荐长度描述!");
  1305. return;
  1306. }
  1307. if (row.GetValue("ApplyStatus") == "审批通过" || row.GetValue("ApplyStatus") == "审批不通过")
  1308. {
  1309. MessageUtil.ShowTips("该合同:" + row.GetValue("OrderNo") + ",已" + row.GetValue("ApplyStatus") + ",不允许修改推荐长度描述!");
  1310. return;
  1311. }
  1312. string len = row.GetValue("LenNo");//合同长度编码
  1313. string LenNoN = row.GetValue("LenNoN");//推荐长度编码
  1314. frmOrderLenPln lenPln = new frmOrderLenPln(ob, len, LenNoN);
  1315. lenPln.ShowDialog();
  1316. if (lenPln.DialogResult == System.Windows.Forms.DialogResult.OK)
  1317. {
  1318. //获取弹出窗体的属性值
  1319. row.Cells["LenNoN"].Value = lenPln.LenNo;
  1320. row.Cells["LengthdiscN"].Value = lenPln.LengthdiscN;
  1321. }
  1322. }
  1323. }
  1324. /// <summary>
  1325. /// 设置完成
  1326. /// </summary>
  1327. private void SetPlanFinish()
  1328. {
  1329. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1330. bool flag = ProducHelper.SetPlanFinish(list, UserInfo.GetUserName(), "D", this.ob);
  1331. if (flag)
  1332. {
  1333. _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  1334. _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  1335. Query();
  1336. }
  1337. }
  1338. /// <summary>
  1339. /// 调整单倍坯长
  1340. /// </summary>
  1341. private void ModifyGpAimWall()
  1342. {
  1343. this.ultraGridZgS.UpdateData();
  1344. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1345. if (list == null || list.Count == 0)
  1346. {
  1347. MessageUtil.ShowTips("请选择订单!");
  1348. return;
  1349. }
  1350. ArrayList jsonList = new ArrayList();
  1351. foreach (PlnOrderZgSEntity entity in list)
  1352. {
  1353. if (entity.IsRepairPln.Equals("是"))
  1354. {
  1355. MessageUtil.ShowTips("检修计划不能重算!");
  1356. return;
  1357. }
  1358. if (entity.LenCutend == null)
  1359. {
  1360. //entity.LenCutend = 0;
  1361. MessageUtil.ShowWarning("请输入切尾数据!");
  1362. return;
  1363. }
  1364. if (entity.LenCuthead == null)
  1365. {
  1366. //entity.LenCuthead = 0;
  1367. MessageUtil.ShowWarning("请输入切头数据!");
  1368. return;
  1369. }
  1370. if (entity.DiameterMandrel == null || entity.DiameterMandrel == 0)
  1371. {
  1372. MessageUtil.ShowWarning("未取到芯棒直径!");
  1373. return;
  1374. }
  1375. DataTable ds = ServerHelper.GetData("com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp.selectMangageLen", new object[] { entity.ProPlanId, entity.GxPlanNo }, ob);
  1376. if (Double.Parse(ds.Rows[0][0].ToString()) > 0)
  1377. {
  1378. if (entity.LenGpSingle > decimal.Parse(ds.Rows[0][0].ToString()))
  1379. {
  1380. MessageUtil.ShowTips("订单单倍坯长不允许大于芯棒对应最大单倍坯长!");
  1381. return;
  1382. }
  1383. }
  1384. //不是外购管的判断
  1385. if (!entity.PlineCode.Equals("C065") && !entity.PlineCode.Equals("C066"))
  1386. {
  1387. //判断基础信息是否有切头尾数据
  1388. string cutPlineH = "";//切头
  1389. string cutPlineE = "";//切尾
  1390. DataTable dt = ServerHelper
  1391. .GetData("com.steering.pss.plnsaleord.order.CorePlnProcessOrd.queryBaseMaterialDPl", new object[] { entity.InwlId, entity.OutwlId, entity.PlineCode }, this.ob);
  1392. if (dt.Rows.Count > 0)
  1393. {
  1394. cutPlineH = dt.Rows[0]["CROP_HEAD"].ToString();
  1395. cutPlineE = dt.Rows[0]["CROP_END"].ToString();
  1396. }
  1397. if (cutPlineH == null || cutPlineH.Equals(""))
  1398. {
  1399. MessageUtil.ShowWarning("基础信息无投入产出物料对应切头数据,请维护!");
  1400. return;
  1401. }
  1402. if (cutPlineE == null || cutPlineE.Equals(""))
  1403. {
  1404. MessageUtil.ShowWarning("基础信息无投入产出物料对应切尾数据,请维护!");
  1405. return;
  1406. }
  1407. }
  1408. if (entity.TubeEndRatio == null)
  1409. {
  1410. entity.TubeEndRatio = 0;
  1411. }
  1412. int lenGpSingle = Convert.ToInt32(entity.LenGpSingle);
  1413. if (lenGpSingle % 10 != 0)
  1414. {
  1415. MessageUtil.ShowWarning("单倍坯长个位数不是0,请重新调整!");
  1416. return;
  1417. }
  1418. jsonList.Add(JSONFormat.Format(entity));
  1419. }
  1420. if (MessageUtil.ShowYesNoAndQuestion("是否重算?") == DialogResult.No)
  1421. {
  1422. return;
  1423. }
  1424. CoreClientParam ccp = new CoreClientParam();
  1425. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1426. ccp.MethodName = "modifyGpAimWall";
  1427. ccp.ServerParams = new object[] { jsonList, "0" };
  1428. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1429. if (ccp.ReturnCode != -1)
  1430. {
  1431. if (ccp.ReturnObject != null)
  1432. {
  1433. List<string> message = (List<string>)JsonConvert.DeserializeObject(
  1434. ccp.ReturnObject.ToString(), typeof(List<string>));
  1435. if (message.Count == 0)
  1436. {
  1437. MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
  1438. + message.Count + "条修改失败。");
  1439. }
  1440. else
  1441. {
  1442. MessageUtil.ShowTips(list.Count - message.Count + "条修改成功,"
  1443. + message.Count + "条修改失败。\n" + message[0]);
  1444. }
  1445. if (list.Count - message.Count>0)
  1446. {
  1447. Query();
  1448. }
  1449. }
  1450. }
  1451. }
  1452. /// <summary>
  1453. /// 调整控制壁厚
  1454. /// </summary>
  1455. private void ModifyThicknesWall()
  1456. {
  1457. this.ultraGridZgS.UpdateData();
  1458. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1459. if (list == null || list.Count == 0)
  1460. {
  1461. MessageUtil.ShowTips("请选择订单!");
  1462. return;
  1463. }
  1464. ArrayList jsonList = new ArrayList();
  1465. foreach (PlnOrderZgSEntity entity in list)
  1466. {
  1467. if (entity.IsRepairPln.Equals("是"))
  1468. {
  1469. MessageUtil.ShowTips("检修计划不能调整控制壁厚!");
  1470. return;
  1471. }
  1472. jsonList.Add(JSONFormat.Format(entity));
  1473. }
  1474. if (MessageUtil.ShowYesNoAndQuestion("是否修改控制壁厚?") == DialogResult.No)
  1475. {
  1476. return;
  1477. }
  1478. CoreClientParam ccp = new CoreClientParam();
  1479. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1480. ccp.MethodName = "modifyThicknesWall";
  1481. ccp.ServerParams = new object[] { jsonList,this.UserInfo.GetUserName() };
  1482. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1483. if (ccp.ReturnCode == -1) return;
  1484. MessageUtil.ShowTips(ccp.ReturnInfo);
  1485. if (ccp.ReturnInfo.Equals("调整控制壁厚成功!"))
  1486. {
  1487. Query();
  1488. }
  1489. }
  1490. /// <summary>
  1491. /// 修改芯棒直接
  1492. /// </summary>
  1493. private void UpdateDiameM()
  1494. {
  1495. try
  1496. {
  1497. ArrayList messageErr = new ArrayList();
  1498. ultraGridZgS.UpdateData();
  1499. ArrayList list = new ArrayList();
  1500. //IQueryable<UltraGridRow> checkRows = ultraGridZgS.Rows.AsQueryable().Where("CHC = 'True'");
  1501. ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1502. if (list1 == null || list1.Count == 0)
  1503. {
  1504. MessageUtil.ShowTips("请选择订单!");
  1505. return;
  1506. }
  1507. foreach (PlnOrderZgSEntity entity in list1)
  1508. {
  1509. if (entity.IsRepairPln.Equals("是"))
  1510. {
  1511. MessageUtil.ShowTips("检修计划不能调整芯棒!");
  1512. return;
  1513. }
  1514. if (entity.DiameterMandrel==null||entity.DiameterMandrel.Equals(""))
  1515. {
  1516. PlanComm.WaitFromColse(this.Cursor);
  1517. MessageUtil.ShowWarning("芯棒不能为空,请选择芯棒!");
  1518. return;
  1519. }
  1520. ArrayList param = new ArrayList();
  1521. param.Add(entity.ProPlanId);
  1522. param.Add(entity.GxPlanNo);
  1523. param.Add(entity.DiameterMandrel.ToString());
  1524. list.Add(param);
  1525. }
  1526. if (list.Count == 0)
  1527. {
  1528. PlanComm.WaitFromColse(this.Cursor);
  1529. MessageUtil.ShowTips("0条修改成功," + messageErr.Count + "条修改失败。\n" + messageErr[0]);
  1530. return;
  1531. }
  1532. if (MessageUtil.ShowYesNoAndQuestion("是否调整芯棒直径?") == DialogResult.No)
  1533. {
  1534. return;
  1535. }
  1536. PlanComm.WaitFromOpen(this.Cursor);
  1537. CoreClientParam ccp = new CoreClientParam();
  1538. ccp.ServerName = "com.steering.pss.plnsaleord.processOrder.base.ProducHelper";
  1539. ccp.MethodName = "updateDimaM";
  1540. ccp.ServerParams = new object[] { list };
  1541. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1542. PlanComm.WaitFromColse(this.Cursor);
  1543. if (ccp.ReturnCode == -1) return;
  1544. MessageUtil.ShowTips(ccp.ReturnInfo);
  1545. if (ccp.ReturnInfo.Equals("芯棒直径调整成功!"))
  1546. {
  1547. Query();
  1548. }
  1549. }
  1550. catch (Exception ex)
  1551. {
  1552. PlanComm.WaitFromColse(this.Cursor);
  1553. if (!(ex is MESException))
  1554. {
  1555. MessageUtil.ShowError(ex.Message);
  1556. }
  1557. }
  1558. }
  1559. /// <summary>
  1560. /// 重新计算
  1561. /// </summary>
  1562. private void Recalculate()
  1563. {
  1564. try
  1565. {
  1566. ArrayList messageErr = new ArrayList();
  1567. ultraGridZgS.UpdateData();
  1568. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1569. if (list == null || list.Count == 0)
  1570. {
  1571. MessageUtil.ShowTips("请选择订单!");
  1572. return;
  1573. }
  1574. ArrayList jsonList = new ArrayList();
  1575. foreach (PlnOrderZgSEntity entity in list)
  1576. {
  1577. if (entity.IsRepairPln.Equals("是"))
  1578. {
  1579. MessageUtil.ShowTips("检修计划已确认不能重新计算!");
  1580. return;
  1581. }
  1582. //if (entity.OrderSource.Equals("排产补量"))
  1583. //{
  1584. // MessageUtil.ShowTips("排产补量不能重新计算!");
  1585. // return;
  1586. //}
  1587. //int numz = 0;
  1588. //double wtz = 0;
  1589. //if (entity.FurnaNum!=null&&!entity.FurnaNum.Equals(""))
  1590. //{
  1591. // numz = int.Parse(entity.FurnaNum.ToString());
  1592. // wtz = double.Parse(entity.FurnaWeight.ToString());
  1593. //}
  1594. //int numLj = 0;
  1595. //double wtLj = 0;
  1596. //if (entity.LjNum != null && !entity.LjNum.Equals(""))
  1597. //{
  1598. // numLj = int.Parse(entity.LjNum.ToString());
  1599. // wtLj = double.Parse(entity.LjWeight.ToString());
  1600. //}
  1601. //int batNum = 0;
  1602. //double batWt = 0;
  1603. //if (entity.CkNum != null && !entity.CkNum.Equals(""))
  1604. //{
  1605. // batNum = int.Parse(entity.CkNum.ToString());
  1606. // batWt = double.Parse(entity.CkWeight.ToString());
  1607. //}
  1608. //int num = numz + numLj + batNum;
  1609. //if (numz > 0)
  1610. //{
  1611. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo+ ",已装炉,不允许重头算!");
  1612. // return;
  1613. //}
  1614. //if (numLj > 0)
  1615. //{
  1616. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已Lj,不允许重头算!");
  1617. // return;
  1618. //}
  1619. //if (batNum > 0)
  1620. //{
  1621. // MessageUtil.ShowTips("轧管订单:" + entity.ProPlanId + "/" + entity.GxPlanNo + ",已出库,不允许重头算!");
  1622. // return;
  1623. //}
  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 = "recalculate";
  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. catch (Exception ex)
  1645. {
  1646. PlanComm.WaitFromColse(this.Cursor);
  1647. if (!(ex is MESException))
  1648. {
  1649. MessageUtil.ShowError(ex.Message);
  1650. }
  1651. }
  1652. }
  1653. /// <summary>
  1654. ///修改排产月份
  1655. /// </summary>
  1656. private void UpdateMonth()
  1657. {
  1658. try
  1659. {
  1660. ArrayList messageErr = new ArrayList();
  1661. ultraGridZgS.UpdateData();
  1662. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1663. if (list == null || list.Count == 0)
  1664. {
  1665. MessageUtil.ShowTips("请选择订单!");
  1666. return;
  1667. }
  1668. ArrayList jsonList = new ArrayList();
  1669. foreach (PlnOrderZgSEntity entity in list)
  1670. {
  1671. entity.ProMonth = DateTime.Parse(entity.ProMonth.ToString()).ToString("yyyy-MM");
  1672. jsonList.Add(JSONFormat.Format(entity));
  1673. }
  1674. if (MessageUtil.ShowYesNoAndQuestion("是否调整生产年月?") == DialogResult.No)
  1675. {
  1676. return;
  1677. }
  1678. PlanComm.WaitFromOpen(this.Cursor);
  1679. CoreClientParam ccp = new CoreClientParam();
  1680. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1681. ccp.MethodName = "updateMonth";
  1682. ccp.ServerParams = new object[] { jsonList };
  1683. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1684. PlanComm.WaitFromColse(this.Cursor);
  1685. if (ccp.ReturnCode == -1) return;
  1686. MessageUtil.ShowTips(ccp.ReturnInfo);
  1687. if (ccp.ReturnInfo.Equals("调整成功!"))
  1688. {
  1689. //ArrayList list1 = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1690. //bool flag =InitDataMonth(list1, "D", this.ob);
  1691. //if (flag)
  1692. //{
  1693. // _ProPlanId = ((PlnOrderZgSEntity)list[0]).ProPlanId;
  1694. // _GxPlanNo = ((PlnOrderZgSEntity)list[0]).GxPlanNo;
  1695. Query();
  1696. //}
  1697. }
  1698. }
  1699. catch (Exception ex)
  1700. {
  1701. MessageUtil.ShowTips("请输入正确的时间格式!");
  1702. }
  1703. }
  1704. public static bool InitDataMonth(ArrayList entityList, string processCode, OpeBase ob)
  1705. {
  1706. if (entityList == null)
  1707. {
  1708. MessageUtil.ShowWarning("请选择订单!");
  1709. return false;
  1710. }
  1711. ArrayList jsonlist = new ArrayList();
  1712. foreach (Object obj in entityList)
  1713. {
  1714. ProducEntity entity = ProducHelper.GenerationProEntity(obj, processCode);
  1715. if (entity.IfStoveIssued.Equals("是"))
  1716. {
  1717. MessageUtil.ShowWarning("订单编号(" + entity.ProPlanId + ") 炉计划下发!");
  1718. return false;
  1719. }
  1720. if (entity.PlanUseTime == null || entity.PlanUseTime.Equals(""))
  1721. {
  1722. MessageUtil.ShowWarning("计划耗时不能为空!");
  1723. return false;
  1724. }
  1725. jsonlist.Add(entity.JsonStr);
  1726. }
  1727. string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.initData", new object[] { jsonlist, processCode }, ob);
  1728. if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return false; }
  1729. else
  1730. {
  1731. //MessageUtil.ShowTips(param[1]);
  1732. if ((bool.Parse(param[0]))) { return true; } else { return false; }
  1733. }
  1734. }
  1735. /// <summary>
  1736. /// 申请审批
  1737. /// </summary>
  1738. private void ApplyApproval()
  1739. {
  1740. ArrayList messageErr = new ArrayList();
  1741. ultraGridZgS.UpdateData();
  1742. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1743. if (list == null || list.Count == 0)
  1744. {
  1745. MessageUtil.ShowTips("请选择订单!");
  1746. return;
  1747. }
  1748. ArrayList jsonList = new ArrayList();
  1749. foreach (PlnOrderZgSEntity entity in list)
  1750. {
  1751. if (entity.LenNoN == null)
  1752. {
  1753. MessageUtil.ShowTips("无推荐长度,不允许申请!");
  1754. return;
  1755. }
  1756. jsonList.Add(JSONFormat.Format(entity));
  1757. }
  1758. if (MessageUtil.ShowYesNoAndQuestion("是否申请?") == DialogResult.No)
  1759. {
  1760. return;
  1761. }
  1762. PlanComm.WaitFromOpen(this.Cursor);
  1763. CoreClientParam ccp = new CoreClientParam();
  1764. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1765. ccp.MethodName = "applyApproval";
  1766. ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
  1767. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1768. PlanComm.WaitFromColse(this.Cursor);
  1769. if (ccp.ReturnCode == -1) return;
  1770. MessageUtil.ShowTips(ccp.ReturnInfo);
  1771. if (ccp.ReturnInfo.Equals("申请成功!"))
  1772. {
  1773. Query();
  1774. }
  1775. }
  1776. /// <summary>
  1777. /// 撤销申请单
  1778. /// </summary>
  1779. private void UndoApply()
  1780. {
  1781. ultraGridZgS.UpdateData();
  1782. UltraGridRow ugrM = ultraGridZgS.ActiveRow;
  1783. if (ugrM == null)
  1784. {
  1785. return;
  1786. }
  1787. if (ugrM.Cells["ApplyNo"].Text.ToString().Equals(""))
  1788. {
  1789. MessageUtil.ShowTips("合同号:" + ugrM.Cells["OrderNo"].Value.ToString() + "未申请,不允许此操作!");
  1790. return;
  1791. }
  1792. ArrayList jsonList = new ArrayList();
  1793. jsonList.Add(ugrM.Cells["ApplyNo"].Value.ToString());
  1794. jsonList.Add(ugrM.Cells["OrdLnDlyPk"].Value.ToString());
  1795. jsonList.Add(ugrM.Cells["ProPlanId"].Value.ToString());
  1796. jsonList.Add(ugrM.Cells["GxPlanNo"].Value.ToString());
  1797. jsonList.Add(ugrM.Cells["LenNoN"].Value.ToString());
  1798. if (MessageUtil.ShowYesNoAndQuestion("是否撤销申请?") == DialogResult.No)
  1799. {
  1800. return;
  1801. }
  1802. PlanComm.WaitFromOpen(this.Cursor);
  1803. CoreClientParam ccp = new CoreClientParam();
  1804. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1805. ccp.MethodName = "undoApplyApproval";
  1806. ccp.ServerParams = new object[] { jsonList };
  1807. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1808. PlanComm.WaitFromColse(this.Cursor);
  1809. if (ccp.ReturnCode == -1) return;
  1810. MessageUtil.ShowTips(ccp.ReturnInfo);
  1811. if (ccp.ReturnInfo.Equals("撤销申请成功!"))
  1812. {
  1813. Query();
  1814. }
  1815. }
  1816. /// <summary>
  1817. /// 修改坯子
  1818. /// </summary>
  1819. private void ModifyBatter()
  1820. {
  1821. ArrayList messageErr = new ArrayList();
  1822. ultraGridZgS.UpdateData();
  1823. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1824. if (list == null || list.Count == 0)
  1825. {
  1826. MessageUtil.ShowTips("请选择订单!");
  1827. return;
  1828. }
  1829. ArrayList jsonList = new ArrayList();
  1830. foreach (PlnOrderZgSEntity entity in list)
  1831. {
  1832. entity.OutsBilletFl.ToString();
  1833. jsonList.Add(JSONFormat.Format(entity));
  1834. }
  1835. if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
  1836. {
  1837. return;
  1838. }
  1839. PlanComm.WaitFromOpen(this.Cursor);
  1840. CoreClientParam ccp = new CoreClientParam();
  1841. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1842. ccp.MethodName = "modifyBatter";
  1843. ccp.ServerParams = new object[] { jsonList, this.UserInfo.GetUserName() };
  1844. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1845. PlanComm.WaitFromColse(this.Cursor);
  1846. if (ccp.ReturnCode == -1) return;
  1847. MessageUtil.ShowTips(ccp.ReturnInfo);
  1848. if (ccp.ReturnInfo.Equals("修改成功!"))
  1849. {
  1850. Query();
  1851. }
  1852. }
  1853. private void ultraGridZgS_KeyUp(object sender, KeyEventArgs e)
  1854. {
  1855. PlanComm.setGridCopyActColumn(this.ultraGridZgS, "CHC", e,
  1856. "OutsBilletFl", "ProMonth");
  1857. }
  1858. /// <summary>
  1859. /// 修改索引码
  1860. /// </summary>
  1861. private void UpdateGroupGp()
  1862. {
  1863. ArrayList messageErr = new ArrayList();
  1864. ultraGridZgS.UpdateData();
  1865. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1866. if (list == null || list.Count == 0)
  1867. {
  1868. MessageUtil.ShowTips("请选择订单!");
  1869. return;
  1870. }
  1871. ArrayList jsonList = new ArrayList();
  1872. foreach (PlnOrderZgSEntity entity in list)
  1873. {
  1874. entity.OutsBilletFl.ToString();
  1875. jsonList.Add(JSONFormat.Format(entity));
  1876. }
  1877. if (MessageUtil.ShowYesNoAndQuestion("是否修改?") == DialogResult.No)
  1878. {
  1879. return;
  1880. }
  1881. PlanComm.WaitFromOpen(this.Cursor);
  1882. CoreClientParam ccp = new CoreClientParam();
  1883. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1884. ccp.MethodName = "updateGroupGp";
  1885. ccp.ServerParams = new object[] { jsonList };
  1886. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1887. PlanComm.WaitFromColse(this.Cursor);
  1888. if (ccp.ReturnCode == -1) return;
  1889. MessageUtil.ShowTips(ccp.ReturnInfo);
  1890. if (ccp.ReturnInfo.Equals("修改成功!"))
  1891. {
  1892. Query();
  1893. }
  1894. }
  1895. /// <summary>
  1896. /// 修改轧批号
  1897. /// </summary>
  1898. private void UpdateBatch()
  1899. {
  1900. ArrayList messageErr = new ArrayList();
  1901. ultraGridZgS.UpdateData();
  1902. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1903. if (list == null || list.Count == 0)
  1904. {
  1905. MessageUtil.ShowTips("请选择订单!");
  1906. return;
  1907. }
  1908. ArrayList jsonList = new ArrayList();
  1909. foreach (PlnOrderZgSEntity entity in list)
  1910. {
  1911. entity.ZyBatchId.ToString();
  1912. jsonList.Add(JSONFormat.Format(entity));
  1913. }
  1914. if (MessageUtil.ShowYesNoAndQuestion("是否轧批号修改?") == DialogResult.No)
  1915. {
  1916. return;
  1917. }
  1918. PlanComm.WaitFromOpen(this.Cursor);
  1919. CoreClientParam ccp = new CoreClientParam();
  1920. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1921. ccp.MethodName = "updateBatch";
  1922. ccp.ServerParams = new object[] { jsonList };
  1923. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1924. PlanComm.WaitFromColse(this.Cursor);
  1925. if (ccp.ReturnCode == -1) return;
  1926. MessageUtil.ShowTips(ccp.ReturnInfo);
  1927. if (ccp.ReturnInfo.Equals("修改成功!"))
  1928. {
  1929. Query();
  1930. }
  1931. }
  1932. /// <summary>
  1933. /// 修改判定字头
  1934. /// </summary>
  1935. private void DoDecision()
  1936. {
  1937. ArrayList messageErr = new ArrayList();
  1938. ultraGridZgS.UpdateData();
  1939. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1940. if (list == null || list.Count == 0)
  1941. {
  1942. MessageUtil.ShowTips("请选择订单!");
  1943. return;
  1944. }
  1945. ArrayList jsonList = new ArrayList();
  1946. foreach (PlnOrderZgSEntity entity in list)
  1947. {
  1948. entity.Decision.ToString();
  1949. jsonList.Add(JSONFormat.Format(entity));
  1950. }
  1951. if (MessageUtil.ShowYesNoAndQuestion("是否判定字头修改?") == DialogResult.No)
  1952. {
  1953. return;
  1954. }
  1955. PlanComm.WaitFromOpen(this.Cursor);
  1956. CoreClientParam ccp = new CoreClientParam();
  1957. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  1958. ccp.MethodName = "doDecision";
  1959. ccp.ServerParams = new object[] { jsonList };
  1960. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  1961. PlanComm.WaitFromColse(this.Cursor);
  1962. if (ccp.ReturnCode == -1) return;
  1963. MessageUtil.ShowTips(ccp.ReturnInfo);
  1964. if (ccp.ReturnInfo.Equals("修改成功!"))
  1965. {
  1966. Query();
  1967. }
  1968. }
  1969. /// <summary>
  1970. /// 导入
  1971. /// </summary>
  1972. private void DoImport()
  1973. {
  1974. try
  1975. {
  1976. OpenFileDialog dialog = new OpenFileDialog();
  1977. if (dialog.ShowDialog() == DialogResult.OK)
  1978. {
  1979. FrmImportSetPlnZg import = new FrmImportSetPlnZg(this.ob);
  1980. import.ModelPatch = dialog.FileName;
  1981. import.ShowDialog();
  1982. }
  1983. Query();
  1984. }
  1985. catch (Exception ex)
  1986. {
  1987. MessageBox.Show(ex.Message);
  1988. }
  1989. }
  1990. /// <summary>
  1991. /// 修改工艺备注
  1992. /// </summary>
  1993. private void DoProMemo(string falsg)
  1994. {
  1995. ArrayList messageErr = new ArrayList();
  1996. ultraGridZgS.UpdateData();
  1997. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  1998. if (list == null || list.Count == 0)
  1999. {
  2000. MessageUtil.ShowTips("请选择订单!");
  2001. return;
  2002. }
  2003. ArrayList jsonList = new ArrayList();
  2004. foreach (PlnOrderZgSEntity entity in list)
  2005. {
  2006. entity.Memo.ToString();
  2007. jsonList.Add(JSONFormat.Format(entity));
  2008. }
  2009. if (MessageUtil.ShowYesNoAndQuestion(falsg.Equals("0") ? "是否工艺备注修改?" : "是否计划备注修改?") == DialogResult.No)
  2010. {
  2011. return;
  2012. }
  2013. PlanComm.WaitFromOpen(this.Cursor);
  2014. CoreClientParam ccp = new CoreClientParam();
  2015. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  2016. ccp.MethodName = "doProMemo";
  2017. ccp.ServerParams = new object[] { jsonList, falsg };
  2018. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2019. PlanComm.WaitFromColse(this.Cursor);
  2020. if (ccp.ReturnCode == -1) return;
  2021. MessageUtil.ShowTips(ccp.ReturnInfo);
  2022. if (ccp.ReturnInfo.Equals("修改成功!"))
  2023. {
  2024. Query();
  2025. }
  2026. }
  2027. /// <summary>
  2028. /// 主被动修改
  2029. /// </summary>
  2030. private void DoUpdatePase()
  2031. {
  2032. ArrayList messageErr = new ArrayList();
  2033. ultraGridZgS.UpdateData();
  2034. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  2035. if (list == null || list.Count == 0)
  2036. {
  2037. MessageUtil.ShowTips("请选择订单!");
  2038. return;
  2039. }
  2040. ArrayList jsonList = new ArrayList();
  2041. foreach (PlnOrderZgSEntity entity in list)
  2042. {
  2043. entity.Passive.ToString();
  2044. jsonList.Add(JSONFormat.Format(entity));
  2045. }
  2046. if (MessageUtil.ShowYesNoAndQuestion("是否确认修改主被动?") == DialogResult.No)
  2047. {
  2048. return;
  2049. }
  2050. PlanComm.WaitFromOpen(this.Cursor);
  2051. CoreClientParam ccp = new CoreClientParam();
  2052. ccp.ServerName = "com.steering.pss.plnsaleord.GpOptimize.CorePlnZgMStoGp";
  2053. ccp.MethodName = "doUpdatePase";
  2054. ccp.ServerParams = new object[] { jsonList };
  2055. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2056. PlanComm.WaitFromColse(this.Cursor);
  2057. if (ccp.ReturnCode == -1) return;
  2058. MessageUtil.ShowTips(ccp.ReturnInfo);
  2059. if (ccp.ReturnInfo.Equals("修改成功!"))
  2060. {
  2061. Query();
  2062. }
  2063. }
  2064. private int splitterDistance = 0;
  2065. private void ultraExpandableGroupBox1_ExpandedStateChanged(object sender, EventArgs e)
  2066. {
  2067. if (ultraExpandableGroupBox1.Expanded == false)
  2068. {
  2069. this.splitContainer1.SplitterDistance = splitContainer1.Size.Height - 26;
  2070. }
  2071. else
  2072. {
  2073. this.splitContainer1.SplitterDistance = splitterDistance == 0 ? splitContainer1.Size.Height / 2 : splitterDistance;
  2074. }
  2075. }
  2076. private void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)
  2077. {
  2078. if (e.Cell.Column.Key.Equals("DELETE"))
  2079. {
  2080. UltraGridRow row = ultraGrid1.ActiveRow;
  2081. int countChc = 0;
  2082. if (!row.Cells["Planstatus"].Text.ToString().Trim().Equals("计划"))
  2083. {
  2084. MessageUtil.ShowTips("您选择轧管炉计划已不是计划状态,不能删除炉计划!");
  2085. return;
  2086. }
  2087. if (MessageUtil.ShowYesNoAndQuestion("是否确认删除炉计划?") ==DialogResult.No)
  2088. return;
  2089. PlanComm.WaitFromOpen(this.Cursor);
  2090. CoreClientParam ccp = new CoreClientParam();
  2091. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmRollTubeLibraryZg";
  2092. ccp.MethodName = "doDeleteZGC";
  2093. ccp.ServerParams = new object[] { row.Cells["HeatPlanNo"].Text.ToString().Trim(), row.Cells["HeatPlanSqe"].Text.ToString().Trim(), this.UserInfo.GetUserName() };
  2094. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2095. PlanComm.WaitFromColse(this.Cursor);
  2096. if (ccp.ReturnCode == -1) return;
  2097. MessageUtil.ShowTips(ccp.ReturnInfo);
  2098. if (ccp.ReturnInfo.Equals("删除成功!"))
  2099. {
  2100. doQueryActual(proPlanId, gxPlanNo);
  2101. }
  2102. }
  2103. }
  2104. private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  2105. {
  2106. StoveHelper.CustomMergedCellEvaluator merge = new StoveHelper.CustomMergedCellEvaluator("HeatPlanNo");
  2107. e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellStyle = MergedCellStyle.Always;
  2108. e.Layout.Bands[0].Columns["HeatPlanNo"].MergedCellEvaluator = merge;
  2109. e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellStyle = MergedCellStyle.Always;
  2110. e.Layout.Bands[0].Columns["JudgeStoveNo"].MergedCellEvaluator = merge;
  2111. e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellStyle = MergedCellStyle.Always;
  2112. e.Layout.Bands[0].Columns["FlagStoveNo"].MergedCellEvaluator = merge;
  2113. e.Layout.Bands[0].Columns["Memo"].MergedCellStyle = MergedCellStyle.Always;
  2114. e.Layout.Bands[0].Columns["Memo"].MergedCellEvaluator = merge;
  2115. e.Layout.Bands[0].Columns["StoveNo"].MergedCellStyle = MergedCellStyle.Always;
  2116. e.Layout.Bands[0].Columns["StoveNo"].MergedCellEvaluator = merge;
  2117. e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellStyle = MergedCellStyle.Always;
  2118. e.Layout.Bands[0].Columns["PlnInsingleNum"].MergedCellEvaluator = merge;
  2119. e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellStyle = MergedCellStyle.Always;
  2120. e.Layout.Bands[0].Columns["PlnInsingleWt"].MergedCellEvaluator = merge;
  2121. e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellStyle = MergedCellStyle.Always;
  2122. e.Layout.Bands[0].Columns["ZyBatchId"].MergedCellEvaluator = merge;
  2123. e.Layout.Bands[0].Columns["GxProSeq"].MergedCellStyle = MergedCellStyle.Always;
  2124. e.Layout.Bands[0].Columns["GxProSeq"].MergedCellEvaluator = merge;
  2125. e.Layout.Bands[0].Columns["TotMumM"].MergedCellStyle = MergedCellStyle.Always;
  2126. e.Layout.Bands[0].Columns["TotMumM"].MergedCellEvaluator = merge;
  2127. e.Layout.Bands[0].Columns["totWeightM"].MergedCellStyle = MergedCellStyle.Always;
  2128. e.Layout.Bands[0].Columns["totWeightM"].MergedCellEvaluator = merge;
  2129. e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellStyle = MergedCellStyle.Always;
  2130. e.Layout.Bands[0].Columns["FeedHeatNo"].MergedCellEvaluator = merge;
  2131. e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellStyle = MergedCellStyle.Always;
  2132. e.Layout.Bands[0].Columns["LenGpSingle"].MergedCellEvaluator = merge;
  2133. e.Layout.Bands[0].Columns["Planstatus"].MergedCellStyle = MergedCellStyle.Always;
  2134. e.Layout.Bands[0].Columns["Planstatus"].MergedCellEvaluator = merge;
  2135. e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellStyle = MergedCellStyle.Always;
  2136. e.Layout.Bands[0].Columns["PlnOutsingleNum"].MergedCellEvaluator = merge;
  2137. e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellStyle = MergedCellStyle.Always;
  2138. e.Layout.Bands[0].Columns["PlnOutsingleW"].MergedCellEvaluator = merge;
  2139. e.Layout.Bands[0].Columns["ReducedWt"].MergedCellStyle = MergedCellStyle.Always;
  2140. e.Layout.Bands[0].Columns["ReducedWt"].MergedCellEvaluator = merge;
  2141. }
  2142. /// <summary>
  2143. /// 订单层重新获取工艺
  2144. /// </summary>
  2145. private void DoModifyProcess()
  2146. {
  2147. ArrayList messageErr = new ArrayList();
  2148. ultraGridZgS.UpdateData();
  2149. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  2150. if (list == null || list.Count == 0)
  2151. {
  2152. MessageUtil.ShowTips("请选择订单!");
  2153. return;
  2154. }
  2155. ArrayList jsonList = new ArrayList();
  2156. foreach (PlnOrderZgSEntity entity in list)
  2157. {
  2158. entity.Passive.ToString();
  2159. jsonList.Add(JSONFormat.Format(entity));
  2160. }
  2161. if (MessageUtil.ShowYesNoAndQuestion("是否手动获取工艺?") == DialogResult.No)
  2162. {
  2163. return;
  2164. }
  2165. PlanComm.WaitFromOpen(this.Cursor);
  2166. CoreClientParam ccp = new CoreClientParam();
  2167. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  2168. ccp.MethodName = "DoModifyProcess";
  2169. ccp.ServerParams = new object[] { jsonList, "D" };
  2170. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2171. PlanComm.WaitFromColse(this.Cursor);
  2172. if (ccp.ReturnCode == -1) return;
  2173. MessageUtil.ShowTips(ccp.ReturnInfo);
  2174. if (ccp.ReturnInfo.Equals("获取成功!"))
  2175. {
  2176. Query();
  2177. }
  2178. }
  2179. /// <summary>
  2180. /// 订单终止
  2181. /// </summary>
  2182. private void doTermination()
  2183. {
  2184. ArrayList messageErr = new ArrayList();
  2185. ultraGridZgS.UpdateData();
  2186. ArrayList list = ProducHelper.GetChcRows<PlnOrderZgSEntity>(ultraGridZgS);
  2187. if (list == null || list.Count == 0)
  2188. {
  2189. MessageUtil.ShowTips("请选择订单!");
  2190. return;
  2191. }
  2192. ArrayList jsonList = new ArrayList();
  2193. foreach (PlnOrderZgSEntity entity in list)
  2194. {
  2195. entity.Passive.ToString();
  2196. if (!entity.ExeStatus.Equals("计划"))
  2197. {
  2198. MessageUtil.ShowTips("订单不是计划状态不能关闭!");
  2199. return;
  2200. }
  2201. jsonList.Add(JSONFormat.Format(entity));
  2202. }
  2203. if (MessageUtil.ShowYesNoAndQuestion("是否终止订单?") == DialogResult.No)
  2204. {
  2205. return;
  2206. }
  2207. PlanComm.WaitFromOpen(this.Cursor);
  2208. CoreClientParam ccp = new CoreClientParam();
  2209. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  2210. ccp.MethodName = "doTermination";
  2211. ccp.ServerParams = new object[] { jsonList, "D" };
  2212. ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2213. PlanComm.WaitFromColse(this.Cursor);
  2214. if (ccp.ReturnCode == -1) return;
  2215. MessageUtil.ShowTips(ccp.ReturnInfo);
  2216. if (ccp.ReturnInfo.Equals("终止成功!"))
  2217. {
  2218. Query();
  2219. }
  2220. }
  2221. #region 炉计划层操作
  2222. /// <summary>
  2223. /// 炉计划按钮点击事件
  2224. /// </summary>
  2225. /// <param name="sender"></param>
  2226. /// <param name="e"></param>
  2227. private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
  2228. {
  2229. switch (e.Tool.Key)
  2230. {
  2231. case "DeleteStatr"://删除剩余炉计划
  2232. doDeleteStatr();
  2233. break;
  2234. case "AgainProcess"://重新获取工艺
  2235. doAgainProcess();
  2236. break;
  2237. case "LuClose"://手动关闭炉计划
  2238. doLuClose();
  2239. break;
  2240. default:
  2241. break;
  2242. }
  2243. }
  2244. /// <summary>
  2245. /// 删除剩余炉计划
  2246. /// </summary>
  2247. private void doDeleteStatr()
  2248. {
  2249. UltraGridRow row = ultraGrid1.ActiveRow;
  2250. if (row == null) return;
  2251. int countM = 0;
  2252. int countC = 0;
  2253. ArrayList list = new ArrayList();
  2254. foreach (UltraGridRow item in ultraGrid1.Rows)
  2255. {
  2256. if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
  2257. {
  2258. countM++;
  2259. ArrayList list1 = new ArrayList();
  2260. if (item.Cells["Planstatus"].Text.ToString().Equals("计划") || item.Cells["Planstatus"].Text.ToString().Equals("下发"))
  2261. {
  2262. MessageUtil.ShowTips("选中该炉计划是计划/下发状态,不能删除!");
  2263. return;
  2264. }
  2265. list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
  2266. list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
  2267. list.Add(list1);
  2268. }
  2269. }
  2270. if (countM == 0)
  2271. {
  2272. MessageUtil.ShowTips("请勾选炉计划信息!");
  2273. return;
  2274. }
  2275. if (MessageUtil.ShowYesNoAndQuestion("是删除剩余炉计划?") == DialogResult.No) return;
  2276. PlanComm.WaitFromOpen(this.Cursor);
  2277. CoreClientParam ccp = new CoreClientParam();
  2278. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
  2279. ccp.MethodName = "doDeleteStatr";
  2280. ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
  2281. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2282. PlanComm.WaitFromColse(this.Cursor);
  2283. if (ccp.ReturnCode == -1) return ;
  2284. MessageUtil.ShowTips(ccp.ReturnInfo);
  2285. if (ccp.ReturnInfo.Equals("删除成功!"))
  2286. {
  2287. doQueryActual(proPlanId, gxPlanNo);
  2288. }
  2289. }
  2290. /// <summary>
  2291. /// 重新获取工艺
  2292. /// </summary>
  2293. private void doAgainProcess()
  2294. {
  2295. UltraGridRow row = ultraGrid1.ActiveRow;
  2296. if (row == null) return;
  2297. int countM = 0;
  2298. ArrayList list = new ArrayList();
  2299. foreach (UltraGridRow item in ultraGrid1.Rows)
  2300. {
  2301. if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
  2302. {
  2303. countM++;
  2304. ArrayList list1 = new ArrayList();
  2305. list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
  2306. list1.Add(item.Cells["HeatPlanSqe"].Text.ToString().Trim());
  2307. list.Add(list1);
  2308. }
  2309. }
  2310. if (countM == 0)
  2311. {
  2312. MessageUtil.ShowTips("请勾选炉计划信息!");
  2313. return;
  2314. }
  2315. if (MessageUtil.ShowYesNoAndQuestion("是否获取工艺?") == DialogResult.No) return;
  2316. PlanComm.WaitFromOpen(this.Cursor);
  2317. CoreClientParam ccp = new CoreClientParam();
  2318. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.StoveHelper";
  2319. ccp.MethodName = "doAgainProcess";
  2320. ccp.ServerParams = new object[] { list, proPlanId, gxPlanNo, "D" };
  2321. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2322. PlanComm.WaitFromColse(this.Cursor);
  2323. if (ccp.ReturnCode == -1) return;
  2324. MessageUtil.ShowTips(ccp.ReturnInfo);
  2325. if (ccp.ReturnInfo.Equals("获取成功!"))
  2326. {
  2327. doQueryActual(proPlanId, gxPlanNo);
  2328. }
  2329. }
  2330. /// <summary>
  2331. /// 手动关闭炉计划
  2332. /// </summary>
  2333. private void doLuClose()
  2334. {
  2335. UltraGridRow row = ultraGrid1.ActiveRow;
  2336. if (row == null) return;
  2337. int countM = 0;
  2338. ArrayList list = new ArrayList();
  2339. string heatPlanNo = "";
  2340. foreach (UltraGridRow item in ultraGrid1.Rows)
  2341. {
  2342. if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
  2343. {
  2344. countM++;
  2345. ArrayList list1 = new ArrayList();
  2346. if (item.Cells["Planstatus"].Text.ToString().Equals("关闭"))
  2347. {
  2348. MessageUtil.ShowTips("选中该炉计划是关闭状态,不能重复关闭!");
  2349. return;
  2350. }
  2351. if (!heatPlanNo.Equals(item.Cells["HeatPlanNo"].Text.ToString()))
  2352. {
  2353. heatPlanNo = item.Cells["HeatPlanNo"].Text.ToString().Trim();
  2354. list1.Add(item.Cells["HeatPlanNo"].Text.ToString().Trim());
  2355. list.Add(list1);
  2356. }
  2357. }
  2358. }
  2359. if (countM == 0)
  2360. {
  2361. MessageUtil.ShowTips("请勾选炉计划信息!");
  2362. return;
  2363. }
  2364. if (MessageUtil.ShowYesNoAndQuestion("是否关闭炉计划?") == DialogResult.No) return;
  2365. PlanComm.WaitFromOpen(this.Cursor);
  2366. CoreClientParam ccp = new CoreClientParam();
  2367. ccp.ServerName = "com.steering.pss.plnsaleord.planStove.FrmPlanStoveD";
  2368. ccp.MethodName = "doLuClose";
  2369. ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
  2370. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  2371. PlanComm.WaitFromColse(this.Cursor);
  2372. if (ccp.ReturnCode == -1) return;
  2373. MessageUtil.ShowTips(ccp.ReturnInfo);
  2374. if (ccp.ReturnInfo.Equals("关闭成功!"))
  2375. {
  2376. doQueryActual(proPlanId, gxPlanNo);
  2377. }
  2378. }
  2379. #endregion
  2380. private void chkLotNo_CheckedChanged(object sender, EventArgs e)
  2381. {
  2382. lotNoStart.Enabled = lotNoEnd.Enabled = chkLotNo.Checked;
  2383. }
  2384. private void cmbPro_EditorButtonClick(object sender, EditorButtonEventArgs e)
  2385. {
  2386. this.ultraGridZgS.UpdateData();
  2387. UltraGridRow row = this.ultraGridZgS.ActiveRow;
  2388. if (row == null)
  2389. {
  2390. return;
  2391. }
  2392. FrmProInformation fp = new FrmProInformation(ob, row.Cells["PrdcrNo"].Text, row.Cells["IndexSeq"].Text, "D");
  2393. fp.ShowDialog();
  2394. }
  2395. }
  2396. }