QcmZbsLanguage.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using CoreFS.CA06;
  5. using Infragistics.Win.UltraWinGrid;
  6. using System;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using System.Data;
  10. using System.Diagnostics;
  11. using System.Drawing;
  12. using System.Drawing.Printing;
  13. using System.IO;
  14. using System.Net;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.Judge.Forms
  17. {
  18. public partial class QcmZbsLanguage : FrmBase
  19. {
  20. private string billNo = "";
  21. private string orderNo = "";
  22. private string ordLnDlyPk = "";
  23. private string metricSystem = "";
  24. private string languageCode = "";
  25. private string billNoSeq = "";
  26. private string tsMemo = "";
  27. private string address = "";
  28. private string customInfo = "";
  29. private string billName = "";
  30. private string laguageName = "";
  31. private string laguageCode = "";
  32. private string zbsTypeDesc = "";
  33. private string zbsTypeCode = "";
  34. private ArrayList parm = null;
  35. //string _laguageName, string _laguageCode, string _zbsTypeDesc, string _zbsTypeCode,
  36. public QcmZbsLanguage(string _laguageName, string _laguageCode, string _zbsTypeDesc, string _zbsTypeCode, string _billNo, string _orderNo, string _ordLnDlyPk, string _metricSystem, string _languageCode, string _billNoSeq, ArrayList _parm, string _tsMemo, string _address, string _billName, string _customInfo, OpeBase _ob)
  37. {
  38. InitializeComponent();
  39. ob = _ob;
  40. laguageName = _laguageName;
  41. laguageCode = _laguageCode;
  42. zbsTypeDesc = _zbsTypeDesc;
  43. zbsTypeCode = _zbsTypeCode;
  44. billNo = _billNo;
  45. orderNo = _orderNo;
  46. ordLnDlyPk = _ordLnDlyPk;
  47. metricSystem = _metricSystem;
  48. languageCode = _languageCode;
  49. billNoSeq = _billNoSeq;
  50. tsMemo = _tsMemo;
  51. address = _address;
  52. customInfo = _customInfo;
  53. billName = _billName;
  54. parm = _parm;
  55. }
  56. private void QcmZbsLanguage_Load(object sender, EventArgs e)
  57. {
  58. //查询语言要求
  59. DataTable dt1 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderAskSub", new object[] { "12100704" }, ob);
  60. comAsk.DataSource = dt1;
  61. comAsk.DisplayMember = "ASK_ITEM_DESC";
  62. comAsk.ValueMember = "ASK_ITEM_NO";
  63. //查询质保书类型
  64. DataTable dt2 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getBaseInfo", new object[] { "4108", billNo }, ob);
  65. ultraZbsType.DataSource = dt2;
  66. ultraZbsType.DisplayMember = "BASENAME";
  67. ultraZbsType.ValueMember = "BASECODE";
  68. Query();
  69. }
  70. /// <summary>
  71. /// 查询
  72. /// </summary>
  73. private void Query()
  74. {
  75. if (this.customInfo.Equals("xiaoshou"))
  76. {
  77. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage3", new object[] { billNo, ordLnDlyPk }, ob);
  78. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  79. }else{
  80. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage", new object[] { billNo, ordLnDlyPk }, ob);
  81. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  82. }
  83. }
  84. private ArrayList ingname = new ArrayList();
  85. //质保书
  86. private void craftImg1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  87. {
  88. UltraGridRow row = ultraGrid1.ActiveRow;
  89. if (row == null) return;
  90. if (ordLnDlyPk.Length < 3) {
  91. return;
  92. }
  93. string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
  94. string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
  95. string filePath = row.GetValue("ZBS_PATH");
  96. string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
  97. string zbsTypeDesc = row.Cells["ZBS_TYPE_CODE"].Text.ToString();
  98. string zbsEdition = row.Cells["ZBS_EDITION"].Text.ToString();
  99. string isVehicleNo = row.Cells["IS_VEHICLE_NO"].Value.ToString();
  100. string orderNo = row.Cells["ORDER_NO"].Value.ToString();
  101. string acountCE = "0";
  102. string acountEAC = "0";
  103. if (askSubItmeVal.Equals(""))
  104. {
  105. MessageUtil.ShowTips("请选择语言要求!");
  106. return;
  107. }
  108. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  109. if (metricSystem.Equals(""))
  110. {
  111. MessageUtil.ShowTips("请选择公英制!");
  112. return;
  113. }
  114. string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
  115. if (zbsTypeDesc.Equals(""))
  116. {
  117. MessageUtil.ShowTips("请选择质保书类型!");
  118. return;
  119. }
  120. string zbsTypeCode = row.Cells["ZBS_TYPE_CODE"].Value.ToString();
  121. if (zbsTypeCode.Equals("410803"))
  122. {
  123. if (parm.Count < 1)
  124. {
  125. MessageUtil.ShowTips("请选择招标质保书的炉号!");
  126. return;
  127. }
  128. }
  129. string JudgeStoveNoBatchNo = "";
  130. foreach (String a in parm)
  131. {
  132. JudgeStoveNoBatchNo += a + "','";
  133. }
  134. DataTable dtCE = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderCE", new object[] { ordLnPk }, ob);
  135. if (dtCE.Rows.Count > 0)
  136. {
  137. acountCE = dtCE.Rows[0]["ACOUNT"].ToString();
  138. }
  139. DataTable dtEAC = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderEAC", new object[] { ordLnPk }, ob);
  140. if (dtEAC.Rows.Count > 0)
  141. {
  142. acountEAC = dtEAC.Rows[0]["ACOUNT"].ToString();
  143. }
  144. if (e.Button.Key.ToLower().Equals("select"))
  145. {
  146. if (filePath.Equals(""))
  147. {
  148. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getZbsEdition", new object[] { billNo, ordLnDlyPk }, ob);
  149. if (dt.Rows.Count > 0)
  150. {
  151. zbsEdition = dt.Rows[0]["zbsEdition"].ToString();
  152. }
  153. string strurl = "";
  154. if (zbsTypeCode.Equals("410801"))
  155. {
  156. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt"
  157. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  158. if (int.Parse(acountCE) > 0 )
  159. {
  160. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityCE.cpt"
  161. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  162. }
  163. if (int.Parse(acountEAC) > 0)
  164. {
  165. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityEAC.cpt"
  166. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  167. }
  168. if ("xiaoshou".Equals(customInfo))
  169. {
  170. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityXS.cpt"
  171. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  172. }
  173. }
  174. else if (zbsTypeCode.Equals("410802"))
  175. {
  176. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt"
  177. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  178. if ("xiaoshou".Equals(customInfo))
  179. {
  180. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJGXS.cpt"
  181. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  182. }
  183. }
  184. else if (zbsTypeCode.Equals("410803"))
  185. {
  186. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt"
  187. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  188. }
  189. else if (zbsTypeCode.Equals("410804"))
  190. {
  191. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityGP.cpt"
  192. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  193. }
  194. else if (zbsTypeCode.Equals("410805"))
  195. {
  196. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt"
  197. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&WUCB=1" + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  198. }
  199. else if (zbsTypeCode.Equals("410806"))
  200. {
  201. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityTH.cpt"
  202. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  203. }
  204. FrmRepExcel down = new FrmRepExcel(ob, strurl);
  205. down.Text = "质保书";
  206. down.Visible = false;
  207. down.Size = new Size(740, this.Height);
  208. down.WindowState = FormWindowState.Maximized;
  209. down.ShowDialog();
  210. }
  211. else
  212. {
  213. //if (!"xiaoshou".Equals(customInfo))
  214. //{
  215. FormFileDown askDown = new FormFileDown(this.ob, filePath);
  216. askDown.CtrlFileDown1.Button3.Visible = false;
  217. askDown.Show();
  218. //}
  219. //销售的查看没有下载
  220. //if ("xiaoshou".Equals(customInfo))
  221. //{
  222. // askDown.CtrlFileDown1.Button5.Visible = false;
  223. //}
  224. }
  225. //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
  226. //askDown.Show();
  227. }
  228. else if (e.Button.Key.ToLower().Equals("add"))
  229. {
  230. DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getZbsEdition", new object[] { billNo, ordLnDlyPk }, ob);
  231. if (dt.Rows.Count > 0)
  232. {
  233. zbsEdition = dt.Rows[0]["zbsEdition"].ToString();
  234. }
  235. string pdfName = billNoSeq + askSubItmeValNo + zbsEdition;
  236. string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/";
  237. string craftPath = filePathNew + pdfName + ".pdf";
  238. //var serverFileList = FileHelper.Download(filePathNew);
  239. //if (serverFileList.Count > 0)
  240. //{
  241. // MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
  242. // return;
  243. //}
  244. //保存
  245. ArrayList list = new ArrayList();
  246. list.Add(billNo);
  247. list.Add(askSubItmeValNo);
  248. list.Add(askSubItmeVal);
  249. list.Add(craftPath);
  250. list.Add(ordLnDlyPk);
  251. list.Add(pdfName);
  252. list.Add(metricSystemNo);
  253. list.Add(this.UserInfo.GetUserName());
  254. list.Add(zbsTypeCode);
  255. list.Add(zbsTypeDesc);
  256. list.Add(zbsEdition);
  257. CoreClientParam ccp = new CoreClientParam();
  258. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  259. ccp.MethodName = "doAddNew";
  260. ccp.ServerParams = new object[] { list };
  261. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  262. if (ccp.ReturnCode == -1) return;
  263. MessageUtil.ShowTips(ccp.ReturnInfo);
  264. if (ccp.ReturnInfo.Equals("保存成功!"))
  265. {
  266. WebClient webClient = new WebClient();
  267. List<FileBean> listPdf = new List<FileBean>();
  268. string strurl = "";
  269. if (zbsTypeCode.Equals("410801"))
  270. {
  271. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&format=pdf"
  272. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  273. if (int.Parse(acountCE) > 0)
  274. {
  275. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityCE.cpt&format=pdf"
  276. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  277. }
  278. if (int.Parse(acountEAC) > 0)
  279. {
  280. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityEAC.cpt&format=pdf"
  281. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  282. }
  283. if ("xiaoshou".Equals(customInfo))
  284. {
  285. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityXS.cpt&format=pdf"
  286. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  287. }
  288. }
  289. else if (zbsTypeCode.Equals("410802"))
  290. {
  291. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&format=pdf"
  292. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  293. if ("xiaoshou".Equals(customInfo))
  294. {
  295. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJGXS.cpt&format=pdf"
  296. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  297. }
  298. }
  299. else if (zbsTypeCode.Equals("410803"))
  300. {
  301. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&format=pdf"
  302. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  303. }
  304. else if (zbsTypeCode.Equals("410804"))
  305. {
  306. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityGP.cpt&format=pdf"
  307. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  308. }
  309. else if (zbsTypeCode.Equals("410805"))
  310. {
  311. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&format=pdf"
  312. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&WUCB=1" + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  313. }
  314. else if (zbsTypeCode.Equals("410806"))
  315. {
  316. strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityTH.cpt&format=pdf"
  317. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ZBS_EDITION=" + zbsEdition + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&IS_VEHICLE_NO=" + isVehicleNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  318. }
  319. byte[] pdf = webClient.DownloadData(strurl);
  320. if (pdf.Length <= 10000)
  321. {
  322. MessageUtil.ShowError("生成PDF ,请重新生成!");
  323. return;
  324. }
  325. FileBean fileBean = new FileBean();
  326. fileBean.setFile(pdf);
  327. fileBean.setFileName(pdfName + ".pdf");
  328. fileBean.setPathName(filePathNew);
  329. listPdf.Add(fileBean);
  330. webClient.Dispose();
  331. var a = FileHelper.Upload(listPdf);
  332. if (a)
  333. {
  334. //MessageUtil.ShowTips("上传成功!");
  335. row.Cells["ZBS_NAME"].Value = pdfName + ".pdf";
  336. row.Cells["ZBS_PATH"].Value = filePathNew;
  337. Query();
  338. }
  339. }
  340. }
  341. else if (e.Button.Key.ToLower().Equals("doprint"))
  342. {
  343. string zbsName = row.Cells["ZBS_PATH"].Text.ToString();
  344. if (zbsName.Equals("") || zbsName == null) return;
  345. List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
  346. ShowByListFileBean(list);
  347. string filePath1 = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
  348. pdfPrint(filePath1);
  349. CoreClientParam ccp = new CoreClientParam();
  350. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  351. ccp.MethodName = "doUpdatePrintData";
  352. ccp.ServerParams = new object[] { billNoSeq, this.UserInfo.GetUserName(), billName, billNo, ordLnDlyPk };
  353. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  354. if (ccp.ReturnCode == -1) return;
  355. MessageUtil.ShowTips(ccp.ReturnInfo);
  356. }
  357. else if (e.Button.Key.ToLower().Equals("upload"))
  358. {
  359. //UltraGridRow row = ultraGrid1.ActiveRow;
  360. string billNo = row.Cells["BILL_NO"].Text.ToString();//提货单号
  361. //string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3); //合同主键
  362. // string zbsEdition = row.Cells["ZBS_EDITION"].Text.ToString(); //质保书语言
  363. string isVlid = row.Cells["IS_VALID"].Value.ToString();//是否生效
  364. if (!isVlid.Equals("有效"))
  365. {
  366. MessageUtil.ShowError("质保书无效,上传失败!!!");
  367. return;
  368. }
  369. CoreClientParam ccp = new CoreClientParam();
  370. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  371. ccp.MethodName = "uploadfile";
  372. ccp.ServerParams = new object[] { billNo, ordLnDlyPk, zbsEdition, "1" };
  373. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  374. if (ccp.ReturnCode == -1) return;
  375. MessageUtil.ShowTips(ccp.ReturnInfo);
  376. //if (ccp.ReturnInfo.Equals("删除成功!"))
  377. //{
  378. // var a = FileHelper.Delete(filePath);
  379. // if (a)
  380. // {
  381. // Query();
  382. // }
  383. //}
  384. }
  385. else
  386. {
  387. //string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  388. //作废
  389. CoreClientParam ccp = new CoreClientParam();
  390. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  391. ccp.MethodName = "doWaste";
  392. ccp.ServerParams = new object[] { billNo, ordLnDlyPk, zbsEdition, this.UserInfo.GetUserName() };
  393. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  394. if (ccp.ReturnCode == -1) return;
  395. MessageUtil.ShowTips(ccp.ReturnInfo);
  396. if (ccp.ReturnInfo.Equals("作废成功!"))
  397. {
  398. var a = FileHelper.Delete(filePath);
  399. if (a)
  400. {
  401. Query();
  402. }
  403. }
  404. }
  405. }
  406. int i = 0;
  407. int j = 0;
  408. bool fal = false;
  409. public string spathName = "";
  410. private List<Image> ing = new List<Image>();
  411. private List<FileBean> list = new List<FileBean>();
  412. private string currentFileName = "";
  413. public event FileChange FileChangeEvent;
  414. public void ShowByListFileBean(List<FileBean> list)
  415. {
  416. if (list == null) return;
  417. j = 0;
  418. i = 0;
  419. ing.Clear();
  420. ingname.Clear();
  421. this.list = list;
  422. ClearTmp();
  423. foreach (FileBean bean in list)
  424. {
  425. Image image;
  426. try
  427. {
  428. image = FileHelper.BytesToBitmap(bean.getFile());
  429. }
  430. catch
  431. {
  432. image = null;
  433. WriteBytesToTmp(bean.getFile(), bean.getFileName());
  434. }
  435. ing.Add(image);
  436. ingname.Add(bean.getFileName());
  437. //if (ing[0] != null)
  438. //{
  439. // PictureBoxHelper.LoadThumbnailImage((Bitmap)ing[0], pictureBox1);
  440. //}
  441. this.currentFileName = list[0].getFileName();
  442. if (FileChangeEvent != null)
  443. {
  444. FileChangeEvent(currentFileName);
  445. }
  446. //PictureBoxHelper.LoadThumbnailImage(pictureBox1);
  447. j = j + 1;
  448. }
  449. if (ing.Count == 0)
  450. {
  451. fal = false;
  452. this.currentFileName = "";
  453. if (FileChangeEvent != null)
  454. {
  455. FileChangeEvent(currentFileName);
  456. }
  457. }
  458. else
  459. {
  460. fal = true;
  461. }
  462. }
  463. private void WriteBytesToTmp(byte[] Bytes, string fileName)
  464. {
  465. try
  466. {
  467. string tmpPath = Environment.CurrentDirectory + "\\Tmp\\";
  468. FileStream fs = new FileStream(tmpPath + fileName, FileMode.Create);
  469. fs.Write(Bytes, 0, Bytes.Length);
  470. fs.Flush();
  471. fs.Close();
  472. }
  473. catch { }
  474. }
  475. private void ClearTmp()
  476. {
  477. string tmpPath = Environment.CurrentDirectory + "\\Tmp\\";
  478. DirectoryInfo di = new DirectoryInfo(tmpPath);
  479. if (di.Exists == fal)
  480. {
  481. di.Create();
  482. return;
  483. }
  484. foreach (FileInfo fi in di.GetFiles())
  485. {
  486. try
  487. {
  488. fi.Delete();
  489. }
  490. catch { continue; }
  491. }
  492. }
  493. private void pdfPrint(string filePath)
  494. {
  495. PrintDocument pd = new PrintDocument();
  496. Process p = new Process();
  497. //ProcessStartInfo startInfo = new ProcessStartInfo();
  498. //startInfo.CreateNoWindow = true;
  499. //startInfo.WindowStyle = ProcessWindowStyle.Hidden;
  500. //startInfo.UseShellExecute = true;
  501. //startInfo.FileName = filePath;
  502. //startInfo.Verb = "print";
  503. //startInfo.Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
  504. //p.StartInfo = startInfo;
  505. //p.Start();
  506. //p.WaitForExit();
  507. //不现实调用程序窗口,但是对于某些应用无效
  508. p.StartInfo.CreateNoWindow = true;
  509. p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
  510. //采用操作系统自动识别的模式
  511. p.StartInfo.UseShellExecute = true;
  512. //要打印的文件路径,可以是WORD,EXCEL,PDF,TXT等等
  513. p.StartInfo.FileName = filePath;
  514. //指定执行的动作,是打印,即print,打开是 open
  515. p.StartInfo.Verb = "print";
  516. //pd.Print();
  517. p.StartInfo.Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
  518. //开始
  519. p.Start();
  520. p.WaitForExit(10000);
  521. }
  522. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  523. {
  524. UltraGridRow row = ultraGrid1.ActiveRow;
  525. if (row == null)
  526. {
  527. row.Cells["BILL_NO"].Value = billNo;
  528. row.Cells["ORDER_NO"].Value = orderNo;
  529. row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
  530. row.Cells["METRIC_SYSTEM"].Value = metricSystem;
  531. row.Cells["LANGUAGE_CODE"].Value = languageCode;
  532. row.Cells["ZBS_TYPE_CODE"].Value = "410801";
  533. row.Cells["ZBS_EDITION"].Value = "001";
  534. row.Cells["IS_VEHICLE_NO"].Value = "0";
  535. row.Cells["ZBS_TYPE_CODE"].Value = zbsTypeCode;
  536. row.Cells["LANGUAGE_CODE"].Value = laguageCode;
  537. }
  538. if (row.Cells["BILL_NO"].Text.Equals(""))
  539. {
  540. row.Cells["BILL_NO"].Value = billNo;
  541. row.Cells["ORDER_NO"].Value = orderNo;
  542. row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
  543. row.Cells["METRIC_SYSTEM"].Value = metricSystem;
  544. row.Cells["LANGUAGE_CODE"].Value = languageCode;
  545. row.Cells["ZBS_TYPE_CODE"].Value = "410801";
  546. row.Cells["IS_VEHICLE_NO"].Value = "0";
  547. // row.Cells["ZBS_EDITION"].Value = "001";
  548. row.Cells["ZBS_TYPE_CODE"].Value = zbsTypeCode;
  549. row.Cells["LANGUAGE_CODE"].Value = laguageCode;
  550. }
  551. }
  552. //接箍
  553. private void craftImgJG_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  554. {
  555. UltraGridRow row = ultraGrid1.ActiveRow;
  556. if (row == null) return;
  557. string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
  558. string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
  559. string filePath = row.GetValue("ZBS_PATH_JG");
  560. string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
  561. if (e.Button.Key.ToLower().Equals("select"))
  562. {
  563. if (filePath.Equals(""))
  564. {
  565. if (askSubItmeVal.Equals(""))
  566. {
  567. MessageUtil.ShowTips("请选择语言要求!");
  568. return;
  569. }
  570. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  571. if (metricSystem.Equals(""))
  572. {
  573. MessageUtil.ShowTips("请选择公英制!");
  574. return;
  575. }
  576. string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
  577. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt"
  578. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  579. FrmRepExcel down = new FrmRepExcel(ob, strurl);
  580. down.Text = "接箍质保书";
  581. down.Visible = false;
  582. down.Size = new Size(740, this.Height);
  583. down.WindowState = FormWindowState.Maximized;
  584. down.ShowDialog();
  585. }
  586. else
  587. {
  588. FormFileDown askDown = new FormFileDown(this.ob, filePath);
  589. askDown.CtrlFileDown1.Button3.Visible = false;
  590. askDown.Show();
  591. }
  592. //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
  593. //askDown.Show();
  594. }
  595. else if (e.Button.Key.ToLower().Equals("add"))
  596. {
  597. if (askSubItmeVal.Equals(""))
  598. {
  599. MessageUtil.ShowTips("请选择语言要求!");
  600. return;
  601. }
  602. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  603. if (metricSystem.Equals(""))
  604. {
  605. MessageUtil.ShowTips("请选择公英制!");
  606. return;
  607. }
  608. string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
  609. string pdfName = "JG" + billNoSeq + askSubItmeValNo;
  610. string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/JG/";
  611. var serverFileList = FileHelper.Download(filePathNew);
  612. if (serverFileList.Count > 0)
  613. {
  614. MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
  615. return;
  616. }
  617. //保存
  618. CoreClientParam ccp = new CoreClientParam();
  619. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  620. ccp.MethodName = "doAddJG";
  621. ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
  622. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  623. if (ccp.ReturnCode == -1) return;
  624. MessageUtil.ShowTips(ccp.ReturnInfo);
  625. if (ccp.ReturnInfo.Equals("保存成功!"))
  626. {
  627. WebClient webClient = new WebClient();
  628. List<FileBean> listPdf = new List<FileBean>();
  629. string craftPath = filePathNew + pdfName + ".pdf";
  630. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&format=pdf"
  631. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=JG&ORD_LN_DLY_PK=" + ordLnDlyPk + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  632. byte[] pdf = webClient.DownloadData(strurl);
  633. if (pdf.Length <= 10000)
  634. {
  635. MessageUtil.ShowError("生成PDF ,请重新生成!");
  636. return;
  637. }
  638. FileBean fileBean = new FileBean();
  639. fileBean.setFile(pdf);
  640. fileBean.setFileName(pdfName + ".pdf");
  641. fileBean.setPathName(filePathNew);
  642. listPdf.Add(fileBean);
  643. webClient.Dispose();
  644. var a = FileHelper.Upload(listPdf);
  645. if (a)
  646. {
  647. //MessageUtil.ShowTips("上传成功!");
  648. row.Cells["ZBS_NAME_JG"].Value = pdfName + ".pdf";
  649. row.Cells["ZBS_PATH_JG"].Value = filePathNew;
  650. Query();
  651. }
  652. }
  653. }
  654. else
  655. {
  656. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  657. //删除
  658. CoreClientParam ccp = new CoreClientParam();
  659. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  660. ccp.MethodName = "doDeleteJG";
  661. ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_JG"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
  662. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  663. if (ccp.ReturnCode == -1) return;
  664. MessageUtil.ShowTips(ccp.ReturnInfo);
  665. if (ccp.ReturnInfo.Equals("删除成功!"))
  666. {
  667. var a = FileHelper.Delete(filePath);
  668. if (a)
  669. {
  670. Query();
  671. }
  672. }
  673. }
  674. }
  675. /// <summary>
  676. /// 招标质保书
  677. /// </summary>
  678. /// <param name="sender"></param>
  679. /// <param name="e"></param>
  680. private void craftImgZB_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  681. {
  682. UltraGridRow row = ultraGrid1.ActiveRow;
  683. if (row == null) return;
  684. if (parm.Count < 1)
  685. {
  686. MessageUtil.ShowTips("请选择招标质保书的炉号!");
  687. return;
  688. }
  689. string JudgeStoveNoBatchNo = "";
  690. foreach (String a in parm)
  691. {
  692. JudgeStoveNoBatchNo += a + "','";
  693. }
  694. string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
  695. string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
  696. string filePath = row.GetValue("ZBS_PATH_ZB");
  697. string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
  698. if (e.Button.Key.ToLower().Equals("select"))
  699. {
  700. if (filePath.Equals(""))
  701. {
  702. if (askSubItmeVal.Equals(""))
  703. {
  704. MessageUtil.ShowTips("请选择语言要求!");
  705. return;
  706. }
  707. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  708. if (metricSystem.Equals(""))
  709. {
  710. MessageUtil.ShowTips("请选择公英制!");
  711. return;
  712. }
  713. string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
  714. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt"
  715. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  716. FrmRepExcel down = new FrmRepExcel(ob, strurl);
  717. down.Text = "招标质保书";
  718. down.Visible = false;
  719. down.Size = new Size(740, this.Height);
  720. down.WindowState = FormWindowState.Maximized;
  721. down.ShowDialog();
  722. }
  723. else
  724. {
  725. FormFileDown askDown = new FormFileDown(this.ob, filePath);
  726. askDown.CtrlFileDown1.Button3.Visible = false;
  727. askDown.Show();
  728. }
  729. }
  730. else if (e.Button.Key.ToLower().Equals("add"))
  731. {
  732. if (askSubItmeVal.Equals(""))
  733. {
  734. MessageUtil.ShowTips("请选择语言要求!");
  735. return;
  736. }
  737. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  738. if (metricSystem.Equals(""))
  739. {
  740. MessageUtil.ShowTips("请选择公英制!");
  741. return;
  742. }
  743. string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
  744. string pdfName = "ZB" + billNoSeq + askSubItmeValNo;
  745. string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/ZB/";
  746. var serverFileList = FileHelper.Download(filePathNew);
  747. if (serverFileList.Count > 0)
  748. {
  749. MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
  750. return;
  751. }
  752. //保存
  753. CoreClientParam ccp = new CoreClientParam();
  754. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  755. ccp.MethodName = "doAddZB";
  756. ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
  757. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  758. if (ccp.ReturnCode == -1) return;
  759. MessageUtil.ShowTips(ccp.ReturnInfo);
  760. if (ccp.ReturnInfo.Equals("保存成功!"))
  761. {
  762. WebClient webClient = new WebClient();
  763. List<FileBean> listPdf = new List<FileBean>();
  764. string craftPath = filePathNew + pdfName + ".pdf";
  765. string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&format=pdf"
  766. + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&TYPE=ZB&ORD_LN_DLY_PK=" + ordLnDlyPk + "&JUDGE_STOVE_NO_BATCH_NO=" + JudgeStoveNoBatchNo + "&TS_MEMO=" + tsMemo + "&ADDRESS=" + address;
  767. byte[] pdf = webClient.DownloadData(strurl);
  768. if (pdf.Length <= 10000)
  769. {
  770. MessageUtil.ShowError("生成PDF ,请重新生成!");
  771. return;
  772. }
  773. FileBean fileBean = new FileBean();
  774. fileBean.setFile(pdf);
  775. fileBean.setFileName(pdfName + ".pdf");
  776. fileBean.setPathName(filePathNew);
  777. listPdf.Add(fileBean);
  778. webClient.Dispose();
  779. var a = FileHelper.Upload(listPdf);
  780. if (a)
  781. {
  782. //MessageUtil.ShowTips("上传成功!");
  783. row.Cells["ZBS_NAME_ZB"].Value = pdfName + ".pdf";
  784. row.Cells["ZBS_PATH_ZB"].Value = filePathNew;
  785. Query();
  786. }
  787. }
  788. }
  789. else
  790. {
  791. string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
  792. //删除
  793. CoreClientParam ccp = new CoreClientParam();
  794. ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
  795. ccp.MethodName = "doDeleteZB";
  796. ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_ZB"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
  797. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  798. if (ccp.ReturnCode == -1) return;
  799. MessageUtil.ShowTips(ccp.ReturnInfo);
  800. if (ccp.ReturnInfo.Equals("删除成功!"))
  801. {
  802. var a = FileHelper.Delete(filePath);
  803. if (a)
  804. {
  805. Query();
  806. }
  807. }
  808. }
  809. }
  810. private void craftupload_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  811. {
  812. }
  813. }
  814. }