FrmPlnOrderZgS.cs 112 KB

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