FrmMilQualityEvaluationFeiPing.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using CoreFS.CA06;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using Core.StlMes.Client.ZGMil.Entity;
  11. using Core.StlMes.Client.ZGMil.Signature;
  12. using Core.Mes.Client.Comm.Server;
  13. using Core.Mes.Client.Comm.Control;
  14. using System.Collections;
  15. using Core.Mes.Client.Comm.Tool;
  16. using Core.StlMes.Client.ZGMil.ResultConrtrol;
  17. using Infragistics.Win.UltraWinGrid;
  18. using Core.StlMes.Client.ZGMil.Common;
  19. namespace Core.StlMes.Client.ZGMil.Report
  20. {
  21. /// <summary>
  22. /// 在线外观检验质量原始记录
  23. /// </summary>
  24. public partial class FrmMilQualityEvaluationFeiPing : FrmBase
  25. {
  26. private string departm = "";
  27. private string plineCode = "";
  28. private string[] plineCodes = { };
  29. private string heatNo = "";
  30. public FrmMilQualityEvaluationFeiPing()
  31. {
  32. InitializeComponent();
  33. this.IsLoadUserView = true;
  34. }
  35. private void FrmMilQualityEvaluationFeiPing_Load(object sender, EventArgs e)
  36. {
  37. NativeMethodNew na = new NativeMethodNew(this.ob);
  38. departm = UserInfo.GetDepartment();
  39. plineCode = na.GetPCode(departm);//获取 用户 对应的产线
  40. plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
  41. cmbEndDate.Value = DateTime.Parse(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 20:59:59"));
  42. cmbDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 21:00:00"));
  43. TubeRoll.SetComboItemHeight(cmbBc);
  44. TubeRoll.SetComboItemHeight(cmbBz);
  45. }
  46. /// <summary>
  47. /// 重写基类方法
  48. /// </summary>
  49. /// <param name="sender"></param>
  50. /// <param name="ToolbarKey"></param>
  51. public override void ToolBar_Click(object sender, string ToolbarKey)
  52. {
  53. switch (ToolbarKey)
  54. {
  55. case "Query":
  56. doQuery();
  57. break;
  58. case "Export":
  59. doExport();
  60. break;
  61. case "DoPrint":
  62. doPrint();
  63. break;
  64. case "Close":
  65. this.Close();
  66. break;
  67. }
  68. }
  69. /// <summary>
  70. /// 导出
  71. /// </summary>
  72. private void doPrint()
  73. {
  74. GridHelper.ulGridToExcel(ultraGrid1, "在线外观检验废品明细");
  75. }
  76. private void chkDate_CheckedChanged(object sender, EventArgs e)
  77. {
  78. if (chkDate.Checked) { cmbDate.Enabled = true; } else { cmbDate.Enabled = false; }
  79. if (chkBc.Checked) { cmbBc.Enabled = true; } else { cmbBc.Enabled = false; }
  80. if (chkBz.Checked) { cmbBz.Enabled = true; } else { cmbBz.Enabled = false; }
  81. if (chkJudgeStoveNo.Checked) { uteJudgeStoveNo.Enabled = true; } else { uteJudgeStoveNo.Enabled = false; }
  82. }
  83. /// <summary>
  84. /// 查询
  85. /// </summary>
  86. private void doQuery()
  87. {
  88. ArrayList list = new ArrayList();
  89. string date = "";
  90. string endDate = "";
  91. string bc = "";
  92. string bz = "";
  93. string JudgeStoveNo = "";
  94. if (chkDate.Checked)
  95. {
  96. if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0)
  97. {
  98. MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
  99. return;
  100. }
  101. else
  102. {
  103. date = cmbDate.Value.ToString();
  104. endDate = cmbEndDate.Value.ToString();
  105. }
  106. }
  107. if (chkBz.Checked)
  108. {
  109. if (cmbBz.Text.Trim() == "")
  110. {
  111. //MessageUtil.ShowTips("班组不能为空!");
  112. //return;
  113. bz = "";
  114. }
  115. else
  116. {
  117. bz = cmbBz.Value.ToString();
  118. }
  119. }
  120. if (chkBc.Checked)
  121. {
  122. if (cmbBc.Text.Trim() == "")
  123. {
  124. //MessageUtil.ShowTips("班次不能为空!");
  125. //return;
  126. bc = "";
  127. }
  128. else
  129. {
  130. bc = cmbBc.Value.ToString();
  131. }
  132. }
  133. if (chkJudgeStoveNo.Checked)
  134. {
  135. if (uteJudgeStoveNo.Text.Trim() == "")
  136. {
  137. //MessageUtil.ShowTips("班次不能为空!");
  138. //return;
  139. JudgeStoveNo = "";
  140. }
  141. else
  142. {
  143. JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
  144. }
  145. }
  146. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilQualityEvaluation.queryMinResultFeiPing", new Object[] { date, endDate, bc, bz, plineCodes, JudgeStoveNo }, this.ob);
  147. GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
  148. GridHelper.RefreshAndAutoSize(this.ultraGrid1);
  149. }
  150. /// <summary>
  151. /// 打印
  152. /// </summary>
  153. private void doExport()
  154. {
  155. string date = "";
  156. string endDate = "";
  157. string bc = "";
  158. string bz = "";
  159. //if (!chkDate.Checked)
  160. //{
  161. // MessageUtil.ShowTips("请选择生产日期!");
  162. // return;
  163. //}
  164. if (!chkBz.Checked)
  165. {
  166. MessageUtil.ShowTips("请选择班组!");
  167. return;
  168. }
  169. if (!chkBc.Checked)
  170. {
  171. MessageUtil.ShowTips("请选择班次!");
  172. return;
  173. }
  174. if (chkDate.Checked)
  175. {
  176. if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0)
  177. {
  178. MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
  179. return;
  180. }
  181. else
  182. {
  183. date = cmbDate.Value.ToString();
  184. endDate = cmbEndDate.Value.ToString();
  185. }
  186. }
  187. if (heatNo == null)
  188. {
  189. MessageUtil.ShowTips("请选择炉号!");
  190. return;
  191. }
  192. if (chkBz.Checked)
  193. {
  194. if (cmbBz.Text.Trim() == "")
  195. {
  196. //MessageUtil.ShowTips("班组不能为空!");
  197. //return;
  198. bz = "";
  199. }
  200. else
  201. {
  202. bz = cmbBz.Value.ToString();
  203. }
  204. }
  205. if (chkBc.Checked)
  206. {
  207. if (cmbBc.Text.Trim() == "")
  208. {
  209. //MessageUtil.ShowTips("班次不能为空!");
  210. //return;
  211. bc = "";
  212. }
  213. else
  214. {
  215. bc = cmbBc.Value.ToString();
  216. }
  217. }
  218. //doQuery();
  219. ColUserName colU = new ColUserName();
  220. colU.Ob = this.ob;
  221. colU.PlineCode = plineCode;
  222. colU.ColGroup = bz;
  223. colU.ColOrder = bc;
  224. colU.StationId = "9";
  225. if (plineCode.Equals("C017"))
  226. {
  227. colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation460.cpt&format=pdf&__bypagesize__=false&JUDGE_STOVE_NO=" + heatNo;
  228. }
  229. else if (plineCode.Equals("C010"))
  230. {
  231. colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation168.cpt&format=pdf&__bypagesize__=false&JUDGE_STOVE_NO=" + heatNo;
  232. }
  233. else if (plineCode.Equals("C009"))
  234. {
  235. colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation258.cpt&format=pdf&__bypagesize__=false&JUDGE_STOVE_NO=" + heatNo;
  236. //colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepTechOrderLineCraft.cpt&format=pdf&__bypagesize__=false&format=pdf&__embed__=true&desgin_key=8a4d6fd1109a46f892ed9882d91a5935";
  237. }
  238. else if (plineCode.Equals("C008"))
  239. {
  240. colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilQualityEvaluation250.cpt&format=pdf&__bypagesize__=false&JUDGE_STOVE_NO=" + heatNo;
  241. }
  242. colU.StartTim = date;
  243. colU.EndTim = endDate;
  244. colU.StrText = "在线外观检验质量原始记录报表";
  245. colU.Flag = "0";
  246. colU.ShowDialog();
  247. //string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFeedSawResult.cpt&__bypagesize__=false&SHIFT=" + bc + "&GROUP=" + bz + "&DATE=" + date + "&DATE2=" + endDate + "&PLINECODE=" + plineCode;
  248. //FrmRepExcel fre = new FrmRepExcel(this.ob,url);
  249. ////fre.AutoSize = true;
  250. //fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  251. //fre.Text = "上料锯切报表";
  252. //fre.ShowDialog();
  253. }
  254. ///// <summary>
  255. ///// 查询上料管号队列
  256. ///// </summary>
  257. //public void GetFeedRack()
  258. //{
  259. // UltraGridRow ugr = ultraGrid1.ActiveRow;
  260. // if (ugr != null)
  261. // {
  262. // string JudgeStoveNo = "";
  263. // JudgeStoveNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  264. // DataTable dt1 = ServerHelper.GetData("com.steering.mes.zgmil.report.SurfaceInspectionResult.getSurfaceRackSeq", new object[] { JudgeStoveNo, "1" }, this.ob);
  265. // dtMatSeq_3.Clear();
  266. // GridHelper.CopyDataToDatatable(ref dt1, ref dtMatSeq_3, true);
  267. // }
  268. // ChangeGridColor();
  269. //}
  270. /// <summary>
  271. /// 获取指定炉号的缺陷项
  272. /// </summary>
  273. //private void getDefectData()
  274. //{
  275. // UltraGridRow ugr = ultraGrid1.ActiveRow;
  276. // if (ugr != null)
  277. // {
  278. // string jugeNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  279. // DataTable ds = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilQualityEvaluation.getDefectData", new object[] { jugeNo }, this.ob);
  280. // this.dtDefectS.Clear();
  281. // GridHelper.CopyDataToDatatable(ref ds, ref this.dtDefectS, true);
  282. // }
  283. //}
  284. /// <summary>
  285. /// 查询抽检管记录
  286. /// </summary>
  287. /// <param name="JudgeStoveNo"></param>
  288. //private void SizeCheckQuery()
  289. //{
  290. // UltraGridRow ugr = ultraGrid1.ActiveRow;
  291. // if (ugr != null)
  292. // {
  293. // string jugeNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  294. // DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmMilQualityEvaluation.sizeCheckQuery", new object[] { jugeNo }, this.ob);
  295. // this.dtSize.Clear();
  296. // GridHelper.CopyDataToDatatable(ref dt, ref this.dtSize, true);
  297. // }
  298. //}
  299. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  300. {
  301. if (this.dataTable1.Rows.Count > 0)
  302. {
  303. UltraGridRow ugr = ultraGrid1.ActiveRow;
  304. if (ugr != null)
  305. {
  306. heatNo = ugr.Cells["JUDGE_STOVE_NO"].Value.ToString();
  307. }
  308. }
  309. }
  310. }
  311. }