FrmStoreSummary.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Core.Mes.Client.Comm.Server;
  11. using Core.Mes.Client.Comm.Control;
  12. using System.Collections;
  13. using Core.Mes.Client.Comm.Tool;
  14. using Core.StlMes.Client.YdmStuffReport.Entity;
  15. using Core.StlMes.Client.YdmStuffManage;
  16. using Infragistics.Win.UltraWinGrid;
  17. namespace Core.StlMes.Client.YdmStuffReport
  18. {
  19. public partial class FrmStoreSummary : FrmBase
  20. {
  21. public FrmStoreSummary()
  22. {
  23. InitializeComponent();
  24. }
  25. ArrayList alistChecked = null;
  26. private string[] arr = null;//仓库权限
  27. private string[] belongArr = null;//所属权权限
  28. private void FrmStoreSummary_Load(object sender, EventArgs e)
  29. {
  30. //getStoreAll();
  31. InitBindColumn();
  32. arr = BaseMethod.WarehousePermissionsStore(this.ValidDataPurviewIds, this.ob);
  33. belongArr = this.ValidDataPurviewIds;
  34. EntityHelper.ShowGridCaption<MatGpMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
  35. try
  36. {
  37. alistChecked = new ArrayList();
  38. alistChecked.Add("StoveNo");
  39. alistChecked.Add("JudgeStoveNo");
  40. alistChecked.Add("MaterialName");
  41. alistChecked.Add("FixNum");
  42. alistChecked.Add("ActLen");
  43. alistChecked.Add("SoureName");
  44. alistChecked.Add("Dimater");
  45. alistChecked.Add("Gradename");
  46. alistChecked.Add("OrderNo");
  47. alistChecked.Add("MatStatus");
  48. alistChecked.Add("StorageName");
  49. alistChecked.Add("IsDealer");
  50. alistChecked.Add("BackFlag");
  51. alistChecked.Add("LocationName");
  52. alistChecked.Add("JudgeResultCode");
  53. alistChecked.Add("InstockTime");
  54. alistChecked.Add("Memo");
  55. alistChecked.Add("BelongName");
  56. alistChecked.Add("PlineName");
  57. alistChecked.Add("PlanMemo");
  58. }
  59. catch { }
  60. try
  61. {
  62. ArrayList alist = new ArrayList();
  63. alist.Add("ActCount");
  64. alist.Add("ActWeight");
  65. CommonMethod.GeneralCheckedListboxItems(ref this.myCheckedListBox1, ref this.ultraGrid1, alist, alistChecked);
  66. }
  67. catch { }
  68. }
  69. /// <summary>
  70. /// 字段绑定
  71. /// </summary>
  72. private void InitBindColumn()
  73. {
  74. //材料状态
  75. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出等待");
  76. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
  77. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
  78. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
  79. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
  80. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
  81. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
  82. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
  83. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
  84. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
  85. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编计划(发运控制)");
  86. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编计划(发运控制)");
  87. this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
  88. //材料类别
  89. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
  90. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
  91. this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
  92. DataTable ds = ClsLoad.GetValueListDataTable("8014", this.ob);
  93. this.ultraGrid1.DisplayLayout.Bands[0].Columns["ProductFlag"].ValueList = ClsLoad.GeneralValuelist(ref ds, "BASECODE", "BASENAME");
  94. string[] arr = new string[3] { "801501", "801502", "801503" };
  95. DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
  96. this.ultraGrid1.DisplayLayout.Bands[0].Columns["MatStatus"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
  97. }
  98. /// <summary>
  99. /// 获取仓库
  100. /// </summary>
  101. private void getStoreAll()
  102. {
  103. string storeNo = "800201";
  104. //string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo, this.ValidDataPurviewIds, this.ob);
  105. //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.Stuffmanage.FrmStuffBase.getStoreAll", new object[] { storeNo, arr }, this.ob);
  106. //if (dt.Rows.Count > 0)
  107. //{
  108. //cmbStorgeNo.DataSource = dt;
  109. //cmbStorgeNo.DisplayMember = "STORAGE_NAME";
  110. //cmbStorgeNo.ValueMember = "STORAGE_NO";
  111. //}
  112. }
  113. /// <summary>
  114. /// 重写基类方法
  115. /// </summary>
  116. /// <param name="sender"></param>
  117. /// <param name="ToolbarKey"></param>
  118. public override void ToolBar_Click(object sender, string ToolbarKey)
  119. {
  120. switch (ToolbarKey)
  121. {
  122. case "Query":
  123. QueryData();
  124. break;
  125. case "SavePlanMemo":
  126. SavePlanMemo();
  127. break;
  128. case "Export":
  129. ExportData();
  130. break;
  131. case "Close":
  132. this.Close();
  133. break;
  134. }
  135. }
  136. /// <summary>
  137. /// 保存计划备注
  138. /// </summary>
  139. private void SavePlanMemo()
  140. {
  141. }
  142. /// <summary>
  143. /// 查询
  144. /// </summary>
  145. private void QueryData()
  146. {
  147. List<MatGpMEntity> listSource = null;
  148. if (chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text))
  149. {
  150. MessageUtil.ShowTips("请输入熔炼炉号!");
  151. this.txtStoveNo.Focus();
  152. return;
  153. }
  154. if (chkJudgeNo.Checked && string.IsNullOrEmpty(this.txtJudgeNo.Text))
  155. {
  156. MessageUtil.ShowTips("请输入判定炉号!");
  157. this.txtJudgeNo.Focus();
  158. return;
  159. }
  160. string stoveNo = "";
  161. string judgeNo = "";
  162. string orderNo = "";
  163. string grade = "";
  164. string dimter = "";
  165. string sourceName = "";
  166. ArrayList list = new ArrayList();
  167. string strSql = "";
  168. string strGroup = "";
  169. string strOut = "";
  170. if (chkStoveNo.Checked)
  171. {
  172. stoveNo = this.txtStoveNo.Text.Trim();
  173. strOut += " AND T1.STOVE_NO = '" + stoveNo + "'";
  174. }
  175. if(chkJudgeNo.Checked)
  176. {
  177. judgeNo = this.txtJudgeNo.Text.Trim();
  178. strOut += " AND T1.JUDGE_STOVE_NO = '" + judgeNo + "'";
  179. }
  180. if (chkOrder.Checked)
  181. {
  182. orderNo = this.txtOrder.Text.Trim();
  183. strOut += " AND S1.ORDER_NO||'/'||S1.ORDER_SEQ LIKE '%" + orderNo + "'";
  184. }
  185. if(chkSource.Checked)
  186. {
  187. sourceName = this.txtSource.Text.Trim();
  188. strOut += " AND T1.SOURE_NAME LIKE '%" + sourceName + "'";
  189. }
  190. if(chkDimter.Checked)
  191. {
  192. dimter = this.txtDimter.Text.Trim();
  193. strOut += " AND T1.DIMATER LIKE '%" + dimter + "'";
  194. }
  195. if(chkGrade.Checked)
  196. {
  197. grade = this.txtGrade.Text.Trim();
  198. strOut += " AND T1.GRADENAME LIKE '%" + grade + "'";
  199. }
  200. string strKey = "";
  201. CheckBox item;
  202. for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
  203. {
  204. try
  205. {
  206. item = this.myCheckedListBox1.Controls[i] as CheckBox;
  207. if (item != null && item.Checked)
  208. {
  209. strKey = item.Name;
  210. if (strKey.Equals("StoveNo"))
  211. {
  212. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.STOVE_NO";
  213. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.STOVE_NO";
  214. }
  215. else if (strKey.Equals("PlanMemo"))
  216. {
  217. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(T1.PLAN_MEMO) PLAN_MEMO";
  218. // strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "MAX(T1.PLAN_MEMO) PLAN_MEMO";
  219. }
  220. else if (strKey.Equals("JudgeStoveNoLg"))
  221. {
  222. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_STOVE_NO_LG";
  223. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_STOVE_NO_LG";
  224. }
  225. else if (strKey.Equals("JudgeStoveNo"))
  226. {
  227. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_STOVE_NO";
  228. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_STOVE_NO";
  229. }
  230. else if (strKey.Equals("MaterialName"))
  231. {
  232. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MATERIAL_NAME";
  233. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MATERIAL_NAME";
  234. }
  235. else if (strKey.Equals("Gradename"))
  236. {
  237. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.GRADENAME";
  238. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.GRADENAME";
  239. }
  240. else if (strKey.Equals("StdName"))
  241. {
  242. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.STD_NAME";
  243. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.STD_NAME";
  244. }
  245. else if (strKey.Equals("Dimater"))
  246. {
  247. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.DIMATER";
  248. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.DIMATER";
  249. }
  250. else if (strKey.Equals("FixNum"))
  251. {
  252. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.FIX_NUM";
  253. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.FIX_NUM";
  254. }
  255. else if (strKey.Equals("FixLen"))
  256. {
  257. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.FIX_LEN";
  258. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.FIX_LEN";
  259. }
  260. else if (strKey.Equals("ActLen"))
  261. {
  262. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.ACT_LEN";
  263. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.ACT_LEN";
  264. }
  265. else if (strKey.Equals("CutNum1"))
  266. {
  267. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/2,1)CUT_NUM1";
  268. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/2,1)";
  269. }
  270. else if (strKey.Equals("CutNum2"))
  271. {
  272. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/3,1)CUT_NUM2";
  273. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/3,1)";
  274. }
  275. else if (strKey.Equals("CutNum3"))
  276. {
  277. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/4,1)CUT_NUM3";
  278. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/4,1)";
  279. }
  280. else if (strKey.Equals("CutNum4"))
  281. {
  282. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/5,1)CUT_NUM4";
  283. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/5,1)";
  284. }
  285. else if (strKey.Equals("BelongName"))
  286. {
  287. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.BELONG_NAME";
  288. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.BELONG_NAME";
  289. }
  290. else if (strKey.Equals("JudgeResultCode"))
  291. {
  292. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T2.BASENAME FROM COM_BASE_INFO T2 WHERE T2.BASECODE = T1.JUDGE_RESULT_CODE )JUDGE_RESULT_CODE";
  293. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE";
  294. }
  295. else if (strKey.Equals("InstockTime"))
  296. {
  297. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(TO_CHAR(T1.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS'))INSTOCK_TIME";
  298. //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE";
  299. }
  300. else if (strKey.Equals("ProductFlag"))
  301. {
  302. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PRODUCT_FLAG";
  303. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PRODUCT_FLAG";
  304. }
  305. else if (strKey.Equals("MatStatus"))
  306. {
  307. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MAT_STATUS";
  308. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MAT_STATUS";
  309. }
  310. else if (strKey.Equals("PlineName"))
  311. {
  312. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PLINE_NAME";
  313. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PLINE_NAME";
  314. }
  315. else if (strKey.Equals("QcmStaus"))
  316. {
  317. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.QCM_STAUS,'00','合格','11','待处理','22','废品')QCM_STAUS";
  318. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.QCM_STAUS";
  319. }
  320. else if (strKey.Equals("StorageName"))
  321. {
  322. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T3.STORAGE_NAME FROM YDM_BS_STORAGE T3 WHERE T3.STORAGE_NO = T2.STORAGE_NO)STORAGE_NAME";
  323. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.STORAGE_NO";
  324. }
  325. else if (strKey.Equals("LocationName"))
  326. {
  327. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T2.LOCATION_NAME";
  328. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LOCATION_NAME";
  329. }
  330. else if (strKey.Equals("LaryNo"))
  331. {
  332. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T2.LARY_NO";
  333. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LARY_NO";
  334. }
  335. else if (strKey.Equals("OrderNo"))
  336. {
  337. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "S1.ORDER_NO||'/'||S1.ORDER_SEQ AS ORDER_NO";
  338. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
  339. }
  340. //else if (strKey.Equals("QcmMemo"))
  341. //{
  342. // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.MEMO))QCM_MEMO";
  343. // //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
  344. //}
  345. //else if (strKey.Equals("JudgeMemo"))
  346. //{
  347. // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.JUDGE_MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.JUDGE_MEMO))JUDGE_MEMO";
  348. // //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
  349. //}
  350. else if (strKey.Equals("PlineNameNext"))
  351. {
  352. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT S1.PLINE_NAME FROM PLN_ORDER_ZG_S S1 WHERE S1.PRO_PLAN_ID = T1.PRO_PLAN_ID_ZG AND S1.GX_PLAN_NO = T1.GX_PLAN_NO_ZG))PLINE_NAME_NEXT";
  353. }
  354. else if (strKey.Equals("PlanTimeB"))
  355. {
  356. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(S1.PLAN_TIME_B) PLAN_TIME_B";
  357. }else if(strKey.Equals("Memo"))
  358. {
  359. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MEMO";
  360. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MEMO";
  361. }else if(strKey.Equals("SoureName"))
  362. {
  363. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.SOURE_NAME";
  364. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.SOURE_NAME";
  365. }
  366. else if (strKey.Equals("IsDealer"))
  367. {
  368. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.IS_DEALER,'0','自用','1','双经销','2','来料加工','3','定销订购')IS_DEALER";
  369. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.IS_DEALER";
  370. }
  371. else if(strKey.Equals("BackFlag"))
  372. {
  373. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + " DECODE(T1.BACK_FLAG,'0','正常坯','1','回炉坯','2','套尺坯','3','掉队坯')BACK_FLAG";
  374. strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.BACK_FLAG";
  375. }
  376. else
  377. {
  378. strSql += (string.IsNullOrEmpty(strSql) ? "t." : ",t.") + strKey;
  379. strGroup += (string.IsNullOrEmpty(strGroup) ? "t." : ",t.") + strKey;
  380. }
  381. }
  382. }
  383. catch { }
  384. }
  385. strSql += (string.IsNullOrEmpty(strSql) ? "" : ",");
  386. strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup;
  387. string _sql = strOut + strGroup;
  388. list.Add(strSql);
  389. list.Add(strOut);
  390. list.Add(strGroup);
  391. switch (this.CustomInfo)
  392. {
  393. case "STORAGE_NO":
  394. listSource = EntityHelper.GetData<MatGpMEntity>(
  395. "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryData", new object[] { list, arr }, this.ob);
  396. break;
  397. case "BELONG_CODE":
  398. listSource = EntityHelper.GetData<MatGpMEntity>(
  399. "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataBelong", new object[] { list, belongArr }, this.ob);
  400. break;
  401. case "120501":
  402. listSource = EntityHelper.GetData<MatGpMEntity>(
  403. "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataAll", new object[] { list,this.CustomInfo}, this.ob);
  404. break;
  405. case "120504":
  406. listSource = EntityHelper.GetData<MatGpMEntity>(
  407. "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataAll", new object[] { list, this.CustomInfo }, this.ob);
  408. break;
  409. }
  410. MatGpMEntitybindingSource.DataSource = listSource;
  411. bool bContains = false, bChecked = false;
  412. for (int i = 0; i < this.ultraGrid1.DisplayLayout.Bands[0].Columns.Count; i++)
  413. {
  414. try
  415. {
  416. bContains = false;
  417. strKey = this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Key;
  418. for (int j = 0; j < this.myCheckedListBox1.Controls.Count; j++)
  419. {
  420. try
  421. {
  422. item = this.myCheckedListBox1.Controls[j] as CheckBox;
  423. if (item.Name.Equals(strKey))
  424. {
  425. bContains = true;
  426. bChecked = item.Checked;
  427. break;
  428. }
  429. }
  430. catch { }
  431. }
  432. if (bContains)
  433. {
  434. this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Hidden = !bChecked;
  435. }
  436. }
  437. catch { }
  438. }
  439. this.SetStaticsInfo();
  440. CommonMethod.SetGridSumArea(this.ultraGrid1);
  441. }
  442. private void SetStaticsInfo()
  443. {
  444. try
  445. {
  446. if (this.ultraGrid1.Rows.Count == 0)
  447. {
  448. this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear();
  449. }
  450. else
  451. {
  452. ArrayList alist = new ArrayList();
  453. alist.Add("ActCount");
  454. alist.Add("ActWeight");
  455. CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true);
  456. }
  457. }
  458. catch { }
  459. }
  460. /// <summary>
  461. /// 导出
  462. /// </summary>
  463. private void ExportData()
  464. {
  465. GridHelper.ulGridToExcel(ultraGrid1, "管坯库存汇总");
  466. }
  467. /// <summary>
  468. /// 全选
  469. /// </summary>
  470. /// <param name="sender"></param>
  471. /// <param name="e"></param>
  472. private void myLinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  473. {
  474. this.myCheckedListBox1.CheckAll();
  475. }
  476. /// <summary>
  477. /// 清除
  478. /// </summary>
  479. /// <param name="sender"></param>
  480. /// <param name="e"></param>
  481. private void myLinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  482. {
  483. this.myCheckedListBox1.UnCheckAll();
  484. }
  485. /// <summary>
  486. /// 默认
  487. /// </summary>
  488. /// <param name="sender"></param>
  489. /// <param name="e"></param>
  490. private void myLinkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  491. {
  492. CheckBox items;
  493. for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
  494. {
  495. try
  496. {
  497. items = this.myCheckedListBox1.Controls[i] as CheckBox;
  498. if (alistChecked.Contains(items.Name))
  499. {
  500. items.Checked = true;
  501. }
  502. else
  503. {
  504. items.Checked = false;
  505. }
  506. }
  507. catch { }
  508. }
  509. }
  510. private void cbx_GroupBy_CheckedChanged(object sender, EventArgs e)
  511. {
  512. CommonMethod.SetGridGroupBy(ref this.ultraGrid1, cbx_GroupBy.Checked);
  513. CommonMethod.SetGridSumArea(this.ultraGrid1);
  514. }
  515. private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
  516. {
  517. this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
  518. }
  519. private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
  520. {
  521. this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
  522. }
  523. private void txtStoveNo_KeyDown(object sender, KeyEventArgs e)
  524. {
  525. if (e.KeyValue == 13)
  526. {
  527. QueryData();
  528. }
  529. }
  530. private void txtJudgeNo_KeyDown(object sender, KeyEventArgs e)
  531. {
  532. if (e.KeyValue == 13)
  533. {
  534. QueryData();
  535. }
  536. }
  537. private void txtOrder_KeyDown(object sender, KeyEventArgs e)
  538. {
  539. if (e.KeyValue == 13)
  540. {
  541. QueryData();
  542. }
  543. }
  544. private void chkOrder_CheckedChanged(object sender, EventArgs e)
  545. {
  546. this.txtOrder.Enabled = this.chkOrder.Checked;
  547. }
  548. private void chkSource_CheckedChanged(object sender, EventArgs e)
  549. {
  550. this.txtSource.Enabled = this.chkSource.Checked;
  551. }
  552. private void chkGrade_CheckedChanged(object sender, EventArgs e)
  553. {
  554. this.txtGrade.Enabled = this.chkGrade.Checked;
  555. }
  556. private void chkDimter_CheckedChanged(object sender, EventArgs e)
  557. {
  558. this.txtDimter.Enabled = this.chkDimter.Checked;
  559. }
  560. private void txtSource_KeyDown(object sender, KeyEventArgs e)
  561. {
  562. if (e.KeyValue == 13)
  563. {
  564. QueryData();
  565. }
  566. }
  567. private void txtGrade_KeyDown(object sender, KeyEventArgs e)
  568. {
  569. if (e.KeyValue == 13)
  570. {
  571. QueryData();
  572. }
  573. }
  574. private void txtDimter_KeyDown(object sender, KeyEventArgs e)
  575. {
  576. if (e.KeyValue == 13)
  577. {
  578. QueryData();
  579. }
  580. }
  581. private void ultraGrid1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  582. {
  583. if (e.Cell.Column.Key.Equals("PlanMemo"))
  584. {
  585. UltraGridRow row = ultraGrid1.ActiveRow;
  586. if (MessageUtil.ShowYesNoAndQuestion("是否保存当前计划备注?") == DialogResult.No)
  587. return;
  588. CoreClientParam ccp = new CoreClientParam();
  589. string matStatus = row.Cells["matStatus"].Text.ToString().Trim().Equals("材料产出待判")?"80150101":
  590. row.Cells["matStatus"].Text.ToString().Trim().Equals("材料产出(已判定)")? "80150102":
  591. row.Cells["matStatus"].Text.ToString().Trim().Equals("材料已编计划")?"80150103":"";
  592. ccp.ServerName = "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary";
  593. ccp.MethodName = "updatePlanMemo";
  594. ccp.ServerParams = new object[] { row.Cells["judgeStoveNo"].Text.ToString().Trim(),
  595. row.Cells["fixNum"].Text.ToString().Trim(),
  596. row.Cells["actLen"].Text.ToString().Trim(),
  597. row.Cells["actCount"].Text.ToString().Trim(),
  598. row.Cells["planMemo"].Text.ToString().Trim(),
  599. row.Cells["locationName"].Text.ToString().Trim(),
  600. row.Cells["memo"].Text.ToString().Trim(),
  601. row.Cells["orderNo"].Text.ToString().Trim(),
  602. matStatus,
  603. row.Cells["stoveNo"].Text.ToString().Trim()
  604. };
  605. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  606. if (ccp.ReturnCode == -1) return;
  607. MessageUtil.ShowTips(ccp.ReturnInfo);
  608. if (ccp.ReturnInfo.Equals("修改成功!"))
  609. {
  610. QueryData();
  611. // doQueryActual(proPlanId, gxPlanNo);
  612. }
  613. }
  614. }
  615. }
  616. }