| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.Drawing.Printing;
- using System.IO;
- using System.Net;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Forms
- {
- public partial class QcmZbsLanguage : FrmBase
- {
- private string billNo = "";
- private string orderNo = "";
- private string ordLnDlyPk = "";
- private string metricSystem = "";
- private string languageCode = "";
- private string billNoSeq = "";
- private string tsMemo = "";
- private string address = "";
- private string customInfo = "";
- private string billName = "";
- private string laguageName = "";
- private string laguageCode = "";
- private string zbsTypeDesc = "";
- private string zbsTypeCode = "";
- private ArrayList parm = null;
- //string _laguageName, string _laguageCode, string _zbsTypeDesc, string _zbsTypeCode,
- 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)
- {
- InitializeComponent();
- ob = _ob;
- laguageName = _laguageName;
- laguageCode = _laguageCode;
- zbsTypeDesc = _zbsTypeDesc;
- zbsTypeCode = _zbsTypeCode;
- billNo = _billNo;
- orderNo = _orderNo;
- ordLnDlyPk = _ordLnDlyPk;
- metricSystem = _metricSystem;
- languageCode = _languageCode;
- billNoSeq = _billNoSeq;
- tsMemo = _tsMemo;
- address = _address;
- customInfo = _customInfo;
- billName = _billName;
- parm = _parm;
- }
- private void QcmZbsLanguage_Load(object sender, EventArgs e)
- {
- //查询语言要求
- DataTable dt1 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderAskSub", new object[] { "12100704" }, ob);
- comAsk.DataSource = dt1;
- comAsk.DisplayMember = "ASK_ITEM_DESC";
- comAsk.ValueMember = "ASK_ITEM_NO";
- //查询质保书类型
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getBaseInfo", new object[] { "4108", billNo }, ob);
- ultraZbsType.DataSource = dt2;
- ultraZbsType.DisplayMember = "BASENAME";
- ultraZbsType.ValueMember = "BASECODE";
- Query();
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void Query()
- {
- if (this.customInfo.Equals("xiaoshou"))
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage3", new object[] { billNo, ordLnDlyPk }, ob);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }else{
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage", new object[] { billNo, ordLnDlyPk }, ob);
- GridHelper.CopyDataToDatatable(dt, dataTable1, true);
- }
- }
- private ArrayList ingname = new ArrayList();
- //质保书
- private void craftImg1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- if (ordLnDlyPk.Length < 3) {
- return;
- }
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- string zbsTypeDesc = row.Cells["ZBS_TYPE_CODE"].Text.ToString();
- string zbsEdition = row.Cells["ZBS_EDITION"].Text.ToString();
- string isVehicleNo = row.Cells["IS_VEHICLE_NO"].Value.ToString();
- string orderNo = row.Cells["ORDER_NO"].Value.ToString();
- string acountCE = "0";
- string acountEAC = "0";
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- if (zbsTypeDesc.Equals(""))
- {
- MessageUtil.ShowTips("请选择质保书类型!");
- return;
- }
- string zbsTypeCode = row.Cells["ZBS_TYPE_CODE"].Value.ToString();
- if (zbsTypeCode.Equals("410803"))
- {
- if (parm.Count < 1)
- {
- MessageUtil.ShowTips("请选择招标质保书的炉号!");
- return;
- }
- }
- string JudgeStoveNoBatchNo = "";
- foreach (String a in parm)
- {
- JudgeStoveNoBatchNo += a + "','";
- }
- DataTable dtCE = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderCE", new object[] { ordLnPk }, ob);
- if (dtCE.Rows.Count > 0)
- {
- acountCE = dtCE.Rows[0]["ACOUNT"].ToString();
- }
- DataTable dtEAC = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderEAC", new object[] { ordLnPk }, ob);
- if (dtEAC.Rows.Count > 0)
- {
- acountEAC = dtEAC.Rows[0]["ACOUNT"].ToString();
- }
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getZbsEdition", new object[] { billNo, ordLnDlyPk }, ob);
- if (dt.Rows.Count > 0)
- {
- zbsEdition = dt.Rows[0]["zbsEdition"].ToString();
- }
- string strurl = "";
- if (zbsTypeCode.Equals("410801"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt"
- + "&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;
- if (int.Parse(acountCE) > 0 )
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityCE.cpt"
- + "&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;
- }
- if (int.Parse(acountEAC) > 0)
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityEAC.cpt"
- + "&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;
- }
- if ("xiaoshou".Equals(customInfo))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityXS.cpt"
- + "&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;
- }
-
- }
- else if (zbsTypeCode.Equals("410802"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt"
- + "&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;
- if ("xiaoshou".Equals(customInfo))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJGXS.cpt"
- + "&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;
- }
- }
- else if (zbsTypeCode.Equals("410803"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410804"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityGP.cpt"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410805"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410806"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityTH.cpt"
- + "&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;
- }
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- //if (!"xiaoshou".Equals(customInfo))
- //{
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- //}
-
- //销售的查看没有下载
- //if ("xiaoshou".Equals(customInfo))
- //{
- // askDown.CtrlFileDown1.Button5.Visible = false;
- //}
-
- }
- //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
- //askDown.Show();
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getZbsEdition", new object[] { billNo, ordLnDlyPk }, ob);
- if (dt.Rows.Count > 0)
- {
- zbsEdition = dt.Rows[0]["zbsEdition"].ToString();
- }
- string pdfName = billNoSeq + askSubItmeValNo + zbsEdition;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/";
- string craftPath = filePathNew + pdfName + ".pdf";
- //var serverFileList = FileHelper.Download(filePathNew);
- //if (serverFileList.Count > 0)
- //{
- // MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- // return;
- //}
- //保存
- ArrayList list = new ArrayList();
- list.Add(billNo);
- list.Add(askSubItmeValNo);
- list.Add(askSubItmeVal);
- list.Add(craftPath);
- list.Add(ordLnDlyPk);
- list.Add(pdfName);
- list.Add(metricSystemNo);
- list.Add(this.UserInfo.GetUserName());
- list.Add(zbsTypeCode);
- list.Add(zbsTypeDesc);
- list.Add(zbsEdition);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAddNew";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string strurl = "";
- if (zbsTypeCode.Equals("410801"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&format=pdf"
- + "&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;
- if (int.Parse(acountCE) > 0)
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityCE.cpt&format=pdf"
- + "&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;
- }
- if (int.Parse(acountEAC) > 0)
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityEAC.cpt&format=pdf"
- + "&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;
- }
- if ("xiaoshou".Equals(customInfo))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityXS.cpt&format=pdf"
- + "&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;
- }
- }
- else if (zbsTypeCode.Equals("410802"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&format=pdf"
- + "&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;
- if ("xiaoshou".Equals(customInfo))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJGXS.cpt&format=pdf"
- + "&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;
- }
- }
- else if (zbsTypeCode.Equals("410803"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&format=pdf"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410804"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityGP.cpt&format=pdf"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410805"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQuality.cpt&format=pdf"
- + "&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;
- }
- else if (zbsTypeCode.Equals("410806"))
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityTH.cpt&format=pdf"
- + "&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;
- }
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH"].Value = filePathNew;
- Query();
- }
- }
- }
- else if (e.Button.Key.ToLower().Equals("doprint"))
- {
- string zbsName = row.Cells["ZBS_PATH"].Text.ToString();
- if (zbsName.Equals("") || zbsName == null) return;
- List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
- ShowByListFileBean(list);
- string filePath1 = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
- pdfPrint(filePath1);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdatePrintData";
- ccp.ServerParams = new object[] { billNoSeq, this.UserInfo.GetUserName(), billName, billNo, ordLnDlyPk };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else if (e.Button.Key.ToLower().Equals("upload"))
- {
- //UltraGridRow row = ultraGrid1.ActiveRow;
- string billNo = row.Cells["BILL_NO"].Text.ToString();//提货单号
- //string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3); //合同主键
- // string zbsEdition = row.Cells["ZBS_EDITION"].Text.ToString(); //质保书语言
- string isVlid = row.Cells["IS_VALID"].Value.ToString();//是否生效
- if (!isVlid.Equals("有效"))
- {
- MessageUtil.ShowError("质保书无效,上传失败!!!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "uploadfile";
- ccp.ServerParams = new object[] { billNo, ordLnDlyPk, zbsEdition, "1" };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- //if (ccp.ReturnInfo.Equals("删除成功!"))
- //{
- // var a = FileHelper.Delete(filePath);
- // if (a)
- // {
- // Query();
- // }
- //}
- }
- else
- {
- //string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //作废
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doWaste";
- ccp.ServerParams = new object[] { billNo, ordLnDlyPk, zbsEdition, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("作废成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- int i = 0;
- int j = 0;
- bool fal = false;
- public string spathName = "";
- private List<Image> ing = new List<Image>();
- private List<FileBean> list = new List<FileBean>();
- private string currentFileName = "";
- public event FileChange FileChangeEvent;
- public void ShowByListFileBean(List<FileBean> list)
- {
- if (list == null) return;
- j = 0;
- i = 0;
- ing.Clear();
- ingname.Clear();
- this.list = list;
- ClearTmp();
- foreach (FileBean bean in list)
- {
- Image image;
- try
- {
- image = FileHelper.BytesToBitmap(bean.getFile());
- }
- catch
- {
- image = null;
- WriteBytesToTmp(bean.getFile(), bean.getFileName());
- }
- ing.Add(image);
- ingname.Add(bean.getFileName());
- //if (ing[0] != null)
- //{
- // PictureBoxHelper.LoadThumbnailImage((Bitmap)ing[0], pictureBox1);
- //}
- this.currentFileName = list[0].getFileName();
- if (FileChangeEvent != null)
- {
- FileChangeEvent(currentFileName);
- }
- //PictureBoxHelper.LoadThumbnailImage(pictureBox1);
- j = j + 1;
- }
- if (ing.Count == 0)
- {
- fal = false;
- this.currentFileName = "";
- if (FileChangeEvent != null)
- {
- FileChangeEvent(currentFileName);
- }
- }
- else
- {
- fal = true;
- }
- }
- private void WriteBytesToTmp(byte[] Bytes, string fileName)
- {
- try
- {
- string tmpPath = Environment.CurrentDirectory + "\\Tmp\\";
- FileStream fs = new FileStream(tmpPath + fileName, FileMode.Create);
- fs.Write(Bytes, 0, Bytes.Length);
- fs.Flush();
- fs.Close();
- }
- catch { }
- }
- private void ClearTmp()
- {
- string tmpPath = Environment.CurrentDirectory + "\\Tmp\\";
- DirectoryInfo di = new DirectoryInfo(tmpPath);
- if (di.Exists == fal)
- {
- di.Create();
- return;
- }
- foreach (FileInfo fi in di.GetFiles())
- {
- try
- {
- fi.Delete();
- }
- catch { continue; }
- }
- }
- private void pdfPrint(string filePath)
- {
- PrintDocument pd = new PrintDocument();
- Process p = new Process();
- //ProcessStartInfo startInfo = new ProcessStartInfo();
- //startInfo.CreateNoWindow = true;
- //startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- //startInfo.UseShellExecute = true;
- //startInfo.FileName = filePath;
- //startInfo.Verb = "print";
- //startInfo.Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
- //p.StartInfo = startInfo;
- //p.Start();
- //p.WaitForExit();
- //不现实调用程序窗口,但是对于某些应用无效
- p.StartInfo.CreateNoWindow = true;
- p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
- //采用操作系统自动识别的模式
- p.StartInfo.UseShellExecute = true;
- //要打印的文件路径,可以是WORD,EXCEL,PDF,TXT等等
- p.StartInfo.FileName = filePath;
- //指定执行的动作,是打印,即print,打开是 open
- p.StartInfo.Verb = "print";
- //pd.Print();
- p.StartInfo.Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
- //开始
- p.Start();
- p.WaitForExit(10000);
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null)
- {
- row.Cells["BILL_NO"].Value = billNo;
- row.Cells["ORDER_NO"].Value = orderNo;
- row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
- row.Cells["METRIC_SYSTEM"].Value = metricSystem;
- row.Cells["LANGUAGE_CODE"].Value = languageCode;
- row.Cells["ZBS_TYPE_CODE"].Value = "410801";
- row.Cells["ZBS_EDITION"].Value = "001";
- row.Cells["IS_VEHICLE_NO"].Value = "0";
- row.Cells["ZBS_TYPE_CODE"].Value = zbsTypeCode;
- row.Cells["LANGUAGE_CODE"].Value = laguageCode;
- }
- if (row.Cells["BILL_NO"].Text.Equals(""))
- {
- row.Cells["BILL_NO"].Value = billNo;
- row.Cells["ORDER_NO"].Value = orderNo;
- row.Cells["ORD_LN_DLY_PK"].Value = ordLnDlyPk;
- row.Cells["METRIC_SYSTEM"].Value = metricSystem;
- row.Cells["LANGUAGE_CODE"].Value = languageCode;
- row.Cells["ZBS_TYPE_CODE"].Value = "410801";
- row.Cells["IS_VEHICLE_NO"].Value = "0";
- // row.Cells["ZBS_EDITION"].Value = "001";
- row.Cells["ZBS_TYPE_CODE"].Value = zbsTypeCode;
- row.Cells["LANGUAGE_CODE"].Value = laguageCode;
- }
- }
- //接箍
- private void craftImgJG_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH_JG");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt"
- + "&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;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "接箍质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- //dlgOrderAskDown askDown = new dlgOrderAskDown(ob, filePath);
- //askDown.Show();
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string pdfName = "JG" + billNoSeq + askSubItmeValNo;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/JG/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAddJG";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string craftPath = filePathNew + pdfName + ".pdf";
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityJG.cpt&format=pdf"
- + "&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;
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME_JG"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH_JG"].Value = filePathNew;
- Query();
- }
- }
- }
- else
- {
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDeleteJG";
- ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_JG"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- /// <summary>
- /// 招标质保书
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void craftImgZB_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (row == null) return;
- if (parm.Count < 1)
- {
- MessageUtil.ShowTips("请选择招标质保书的炉号!");
- return;
- }
- string JudgeStoveNoBatchNo = "";
- foreach (String a in parm)
- {
- JudgeStoveNoBatchNo += a + "','";
- }
- string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3);
- string askSubItmeVal = row.Cells["LANGUAGE_CODE"].Text.ToString();
- string filePath = row.GetValue("ZBS_PATH_ZB");
- string metricSystem = row.Cells["METRIC_SYSTEM"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt"
- + "&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;
- FrmRepExcel down = new FrmRepExcel(ob, strurl);
- down.Text = "招标质保书";
- down.Visible = false;
- down.Size = new Size(740, this.Height);
- down.WindowState = FormWindowState.Maximized;
- down.ShowDialog();
- }
- else
- {
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["METRIC_SYSTEM"].Value.ToString();
- string pdfName = "ZB" + billNoSeq + askSubItmeValNo;
- string filePathNew = "Qcm/ZbsPdf/" + billNoSeq + "/" + orderNo + "/" + askSubItmeValNo + "/ZB/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAddZB";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo, askSubItmeVal };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("保存成功!"))
- {
- WebClient webClient = new WebClient();
- List<FileBean> listPdf = new List<FileBean>();
- string craftPath = filePathNew + pdfName + ".pdf";
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepCertificateOfProductQualityZB.cpt&format=pdf"
- + "&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;
- byte[] pdf = webClient.DownloadData(strurl);
- if (pdf.Length <= 10000)
- {
- MessageUtil.ShowError("生成PDF ,请重新生成!");
- return;
- }
- FileBean fileBean = new FileBean();
- fileBean.setFile(pdf);
- fileBean.setFileName(pdfName + ".pdf");
- fileBean.setPathName(filePathNew);
- listPdf.Add(fileBean);
- webClient.Dispose();
- var a = FileHelper.Upload(listPdf);
- if (a)
- {
- //MessageUtil.ShowTips("上传成功!");
- row.Cells["ZBS_NAME_ZB"].Value = pdfName + ".pdf";
- row.Cells["ZBS_PATH_ZB"].Value = filePathNew;
- Query();
- }
- }
- }
- else
- {
- string askSubItmeValNo = row.Cells["LANGUAGE_CODE"].Value.ToString();
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDeleteZB";
- ccp.ServerParams = new object[] { row.Cells["ZBS_NAME_ZB"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk, askSubItmeValNo };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("删除成功!"))
- {
- var a = FileHelper.Delete(filePath);
- if (a)
- {
- Query();
- }
- }
- }
- }
- private void craftupload_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
-
- }
- }
- }
|