| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.Judge.Commons;
- using Core.StlMes.Client.Judge.ViewModels;
- using CoreFS.CA06;
- using Infragistics.Win;
- using Infragistics.Win.UltraWinEditors;
- 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 Spire.Pdf;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.Judge.Forms
- {
- public partial class QcmZbsQueryFrm : FrmBase
- {
- /// <summary>
- /// 登入用户的销售组织权限
- /// </summary>
- //private string[] _salgPermissions;
- public QcmZbsQueryFrm()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmPipeBillOfLadingClose_Load(object sender, EventArgs e)
- {
- InitDate();
- //_salgPermissions = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
- EntityHelper.ShowGridCaption<YdmZcBillMyEntity>(ultraGridOrder.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<YdmZcBillCyEntity>(ultraGridJustNo.DisplayLayout.Bands[0]);
- BaseMethod.setOtherColumnReadOnly(ultraGridOrder, new string[] { "CHC", "ZbsFlag", "AskSubItmeVal", "MetricSystem", "LicenseNo", "CraftNo", "CheckNo", "ZbsName", "ZbsOrderNo", "LanguageName", "ZbsTypeDesc" });
- BaseMethod.InitCellPosition(ultraGridOrder, new string[] { "PlanWt", "PlanNum", "ActWt", "ActNum", "DelvryQty", "WgtEstmt" });
- BaseMethod.InitCellPosition(ultraGridJustNo, new string[] { "ActLenMin", "ActLenMax", "ActCount", "ActWeight", "ActCountLoad", "ActWeightLoad", "ActCountKc", "ActWeightKc", "SendNum" });
- UltraComboEditor uceAbc = new UltraComboEditor();
- ultraGridOrder.DisplayLayout.Bands[0].Columns["ZbsFlag"].EditorComponent = uceAbc;
- ultraGridOrder.DisplayLayout.Bands[0].Columns["ZbsFlag"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ValueList vlistSteel = new ValueList();
- vlistSteel.ValueListItems.Insert(0, "2", "老系统打印");
- vlistSteel.ValueListItems.Insert(1, "0", "未打印");
- vlistSteel.ValueListItems.Insert(2, "1", "已打印");
- ultraGridOrder.DisplayLayout.Bands[0].Columns["ZbsFlag"].ValueList = vlistSteel;
- //查询语言要求
- 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";
- ultraLanguage.DataSource = dt1;
- ultraLanguage.DisplayMember = "ASK_ITEM_DESC";
- ultraLanguage.ValueMember = "ASK_ITEM_NO";
- ultraGridOrder.DisplayLayout.Bands[0].Columns["LanguageName"].EditorComponent = comAsk;
- ultraGridOrder.DisplayLayout.Bands[0].Columns["LanguageName"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- //查询许可证号
- DataTable dt2 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.querySendPlan", new object[] { "4102" }, ob);
- ultraComboEditor2.DataSource = dt2;
- ultraComboEditor2.DisplayMember = "BASENAME";
- ultraComboEditor2.ValueMember = "BASECODE";
- //查询检验号
- DataTable dt3 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.querySendPlan", new object[] { "4103" }, ob);
- ultraComboEditor4.DataSource = dt3;
- ultraComboEditor4.DisplayMember = "BASENAME";
- ultraComboEditor4.ValueMember = "BASECODE";
- //查询质保书类型
- DataTable dt4 = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getBaseInfo", new object[] { "4108", "" }, ob);
- comZbsType.DataSource = dt4;
- comZbsType.DisplayMember = "BASENAME";
- comZbsType.ValueMember = "BASECODE";
- ultraZbsType.DataSource = dt4;
- ultraZbsType.DisplayMember = "BASENAME";
- ultraZbsType.ValueMember = "BASECODE";
- ultraZbsTyp.DataSource = dt4;
- ultraZbsTyp.DisplayMember = "BASENAME";
- ultraZbsTyp.ValueMember = "BASECODE";
-
- ultraGridOrder.DisplayLayout.Bands[0].Columns["ZbsTypeDesc"].EditorComponent = comZbsType;
- ultraGridOrder.DisplayLayout.Bands[0].Columns["ZbsTypeDesc"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
-
- }
- private void ChcCheckedChanged(object sender, EventArgs e)
- {
- if (ChcLadingSeq.Checked)
- {
- TxtLadingSeq.Enabled = true;
- }
- else
- {
- TxtLadingSeq.Enabled = false;
- }
- if (ChcOrderNo.Checked)
- {
- TxtOrderNo.Enabled = true;
- }
- else
- {
- TxtOrderNo.Enabled = false;
- }
- if (ChcTime.Checked)
- {
- TimeBegin.Enabled = true;
- TimeEnd.Enabled = true;
- }
- else
- {
- TimeEnd.Enabled = false;
- TimeBegin.Enabled = false;
- }
- if (ChcStatus.Checked) { ComStatus.Enabled = true; } else { ComStatus.Enabled = false; }
- if (Checzbs.Checked) { ultraZbsType.Enabled = true; } else { ultraZbsType.Enabled = false; }
- }
- /// <summary>
- /// 初始时间
- /// </summary>
- private void InitDate()
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- TimeBegin.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- TimeEnd.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "Update":
- DoUpdate();
- break;
- case "Print":
- printData();
- break;
- case "batchPrint":
- batchPrint();
- break;
- case "batchView":
- batchView();
- break;
- case "UpdateLin":
- DoUpdateLin();
- break;
- case "RefreshSpotZbs":
- RefreshSpotZbs();
- break;
- case "UnLock":
- DoUnLock();
- break;
- case "UpdateOrderNno":
- DoUpdateOrderNno();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGridOrder, "出库合同信息");
- break;
- case "UpdateLanguageAndType":
- UpdateLanguageAndType();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private ArrayList ingname = new ArrayList();
- /// <summary>
- /// 修改质保书语言类型
- /// </summary>
- private void UpdateLanguageAndType()
- {
- ultraGridOrder.UpdateData();
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- if (!string.IsNullOrWhiteSpace(ultraLanguage.Value.ToString2()))
- {
- item.Cells["LanguageName"].Value = ultraLanguage.Value;
- }
- if (!string.IsNullOrWhiteSpace(ultraZbsTyp.Value.ToString2()))
- {
- item.Cells["ZbsTypeDesc"].Value = ultraZbsTyp.Value;
- }
- countM++;
- comAsk.Text = item.Cells["LanguageName"].Text.ToString2();
- comZbsType.Text = item.Cells["ZbsTypeDesc"].Text.ToString2();
- ArrayList list1 = new ArrayList();
- list1.Add(item.Cells["LanguageName"].Text.ToString().Trim());
- list1.Add(comAsk.Value.ToString().Trim());
- list1.Add(item.Cells["ZbsTypeDesc"].Text.ToString().Trim());
- list1.Add(comZbsType.Value.ToString().Trim());
- list1.Add(item.Cells["BillNoSeq"].Value.ToString().Trim());
- list.Add(list1);
- string billNo = item.Cells["BillNo"].Text.ToString();
- string billNoSeq = item.Cells["BillNoSeq"].Text.ToString();
- string orderNo = item.Cells["OrderSeqNo"].Text.ToString();
- string ordLnDlyPk = item.Cells["OrdLnDlyPk"].Text.ToString();
- string ordLnPk = item.Cells["OrdLnPk"].Text.ToString();
- string billName = item.Cells["ZbsName"].Text.ToString();
- string tsMemo = this.ultraOptionSet1.CheckedItem.DataValue.ToString();
- string address = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
- string laguageName = item.Cells["LanguageName"].Text.ToString();
- string laguageCode = comAsk.Value.ToString();
- string zbsTypeDesc = item.Cells["ZbsTypeDesc"].Text.ToString();
- string zbsTypeCode = comZbsType.Value.ToString();
- string askSubItmeValNo = comAsk.Value.ToString();
- string askSubItmeVal = item.Cells["LanguageName"].Text.ToString();
- string metricSystemNo = item.Cells["MetricSystem"].Value.ToString();
- string zbsEdition = "";
- string acountCE = "0";
- string acountEAC = "0";
- string isVehicleNo = "";
- 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 list2 = new ArrayList();
- list2.Add(billNo);
- list2.Add(askSubItmeValNo);
- list2.Add(askSubItmeVal);
- list2.Add(craftPath);
- list2.Add(ordLnDlyPk);
- list2.Add(pdfName);
- list2.Add(metricSystemNo);
- list2.Add(this.UserInfo.GetUserName());
- list2.Add(zbsTypeCode);
- list2.Add(zbsTypeDesc);
- list2.Add(zbsEdition);
- 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();
- }
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridJustNo.Rows.AsQueryable().Where(" CHK = 'True'");
- ArrayList JudgeStoveNoBatchNo = new ArrayList();
- if (checkMagRows.Count() > 0)
- {
- foreach (UltraGridRow row2 in checkMagRows)
- { //招标质保书选择的炉批
- row2.Cells["JudgeStoveNo"].Value.ToString();
- row2.Cells["BatchNo"].Value.ToString();
- JudgeStoveNoBatchNo.Add(row2.Cells["JudgeStoveNo"].Value.ToString() + row2.Cells["BatchNo"].Value.ToString());
- }
- }
- CoreClientParam ccp1 = new CoreClientParam();
- ccp1.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp1.MethodName = "doAddNew";
- ccp1.ServerParams = new object[] { list2 };
- ccp1 = ob.ExecuteNonQuery(ccp1, CoreInvokeType.Internal);
- if (ccp1.ReturnCode == -1) return;
- if (ccp1.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(this.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(this.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 (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的出库合同信息!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "UpdateLaguageAndType";
- ccp.ServerParams = new object[] { list };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 解锁
- /// </summary>
- private void DoUnLock()
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUnLock";
- ccp.ServerParams = new object[] { row.Cells["BillNoSeq"].Text.ToString().Trim() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("解锁成功!"))
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 质保书打印
- /// </summary>
- private void printData()
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- string billNo = row.Cells["BillNo"].Text.ToString();
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Text.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage", new object[] { billNo, ordLnDlyPk, "1" }, ob);
- if (dt.Rows.Count <= 0)
- {
- MessageUtil.ShowTips("请维护质保书!");
- return;
- }
- ArrayList list1 = new ArrayList();
- for (int k = 0; k < dt.Rows.Count; k++)
- {
- string zbsName = dt.Rows[k]["ZBS_PATH"].ToString();
- List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
- if (list.Count < 1)
- {
- MessageUtil.ShowTips("存在无效的质保书版本,请确认后打印!");
- return;
- }
- ShowByListFileBean(list);
- string filePath = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
- pdfPrint(filePath);
- list1.Add(dt.Rows[k]["ZBS_NAME"].ToString());
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdatePrintDataAll";
- ccp.ServerParams = new object[] { row.Cells["BillNoSeq"].Text.ToString().Trim(), this.UserInfo.GetUserName(), billNo, ordLnDlyPk, list1 };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("打印成功!"))
- {
- DoQuery();
- }
- }
- private void batchPrint()
- {
- foreach (UltraGridRow row in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHC"].Text) != true)
- {
- continue;
- }
- string billNo = row.Cells["BillNo"].Text.ToString();
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Text.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage3", new object[] { billNo, ordLnDlyPk }, ob);
- if (dt.Rows.Count <= 0)
- {
- MessageUtil.ShowTips("请维护质保书!");
- return;
- }
- ArrayList list1 = new ArrayList();
- for (int k = 0; k < dt.Rows.Count; k++)
- {
- string zbsName = dt.Rows[k]["ZBS_PATH"].ToString();
- List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
- if (list.Count < 1)
- {
- MessageUtil.ShowTips("存在无效的质保书版本,请确认后打印!");
- return;
- }
- ShowByListFileBean(list);
- string filePath = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
- pdfPrint(filePath);
- list1.Add(dt.Rows[k]["ZBS_NAME"].ToString());
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdatePrintDataAll";
- ccp.ServerParams = new object[] { row.Cells["BillNoSeq"].Text.ToString().Trim(), this.UserInfo.GetUserName(), billNo, ordLnDlyPk, list1 };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- }
- MessageUtil.ShowTips("打印成功!");
- DoQuery();
- }
- private void batchView()
- {
- foreach (UltraGridRow row in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHC"].Text) != true)
- {
- continue;
- }
- string billNo = row.Cells["BillNo"].Text.ToString();
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Text.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage3", new object[] { billNo, ordLnDlyPk}, ob);
- if (dt.Rows.Count <= 0)
- {
- MessageUtil.ShowTips("请维护质保书!");
- return;
- }
- ArrayList list1 = new ArrayList();
- for (int k = 0; k < dt.Rows.Count; k++)
- {
- string zbsName = dt.Rows[k]["ZBS_PATH"].ToString();
- List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
- if (list.Count < 1)
- {
- MessageUtil.ShowTips("存在无效的质保书版本,请确认后打印!");
- return;
- }
- ShowByListFileBean(list);
- string filePath = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
- pdfPrint(filePath, "open");
- }
- }
- }
- private void pdfPrint(string filePath)
- {
- pdfPrint(filePath,"print");
- }
- private void pdfPrint(string filePath, string startInfo)
- {
- 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 = startInfo;
- //pd.Print();
- p.StartInfo.Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
- //开始
- p.Start();
- p.WaitForExit(10000);
- }
- 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;
- /// <summary>
- /// 通过文件集合(图片)显示出来。
- /// </summary>
- /// <param name="list"></param>
- 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 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 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 { }
- }
- /// <summary>
- /// 质保书状态修改
- /// </summary>
- private void DoUpdate()
- {
- ultraGridOrder.UpdateData();
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- list1.Add(item.Cells["ZbsFlag"].Value.ToString().Trim());
- list1.Add(item.Cells["BillNoSeq"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的出库合同信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改打印状态?") ==
- DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdate";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 修改质保书合同
- /// </summary>
- private void DoUpdateOrderNno()
- {
- ultraGridOrder.UpdateData();
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- list1.Add(item.Cells["ZbsOrderNo"].Value.ToString().Trim());
- list1.Add(item.Cells["BillNoSeq"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的出库合同信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") ==
- DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdateOrderNno";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 修改许可证号
- /// </summary>
- private void DoUpdateLin()
- {
- ultraGridOrder.UpdateData();
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- int countM = 0;
- ArrayList list = new ArrayList();
- foreach (UltraGridRow item in ultraGridOrder.Rows)
- {
- if (Convert.ToBoolean(item.Cells["CHC"].Text) == true)
- {
- countM++;
- ArrayList list1 = new ArrayList();
- list1.Add(item.Cells["LicenseNo"].Value.ToString().Trim());
- list1.Add(item.Cells["CheckNo"].Value.ToString().Trim());
- list1.Add(item.Cells["BillNo"].Value.ToString().Trim());
- list1.Add(item.Cells["BillNoSeq"].Text.ToString().Trim());
- list.Add(list1);
- }
- }
- if (countM == 0)
- {
- MessageUtil.ShowTips("请勾选需要修改的出库合同信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") ==
- DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdateLin";
- ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- DoQuery();
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void DoQuery()
- {
- ArrayList param = new ArrayList();
- string billNo = "";
- if (ChcLadingSeq.Checked)
- {
- billNo = TxtLadingSeq.Text.Trim();
- }
- string orderNo = "";
- if (ChcOrderNo.Checked)
- {
- orderNo = TxtOrderNo.Text.Trim();
- }
- string strBegin = "1900-01-01 00:00:00";
- string strEnd = "9900-01-01 00:00:00";
- if (ChcTime.Checked)
- {
- if (TimeBegin.Value == null || TimeEnd.Value == null)
- {
- MessageUtil.ShowWarning("请选择正确的时间");
- return;
- }
- strBegin = TimeBegin.Value.ToString();
- strEnd = TimeEnd.Value.ToString();
- }
- string status = "";
- if (ChcStatus.Checked)
- {
- status = ComStatus.Value.ToString();
- }
- string strZbs = "";
- if (Checzbs.Checked)
- {
- strZbs = ultraZbsType.Text.ToString();
- }
- //string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,this.ob);
- //string[] arr = this.ValidDataPurviewIds;
- param.Add(billNo);
- param.Add(orderNo);
- param.Add(strBegin);
- param.Add(strEnd);
- List<YdmZcBillMyEntity> listSource = null;
- if (this.CustomInfo.Equals("xiaoshou"))
- {
- listSource = EntityHelper.GetData<YdmZcBillMyEntity>(
- "com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderInfoByBiltNo", new object[] { param, status, this.UserInfo.GetDeptid(), this.UserInfo.GetUserName(), strZbs }, this.ob);
- }
- else
- {
- listSource = EntityHelper.GetData<YdmZcBillMyEntity>(
- "com.steering.pss.judge.DAL.QcmZbsQueryFrm.getOrderInfoByBiltNo", new object[] { param, status, this.UserInfo.GetDeptid(), strZbs }, this.ob);
- }
- ydmZcBillMyEntityBindingSource.DataSource = listSource;
- //DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.getBiltNo", new Object[] { param, arr}, this.ob);
- //GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- //if (dt == null || dt.Rows.Count == 0)
- //{
- // QueryJustStoveInfo("");
- //}
- //BaseMethod.SetUltraGridRowColor(ultraGridBillNo, new string[] { "LOADVEHICLE_TYPE" }, new string[] { "虚拟" }, Color.GreenYellow);
- }
- private void QueryJustStoveInfo(string billNo, string ordLnDlyPk)
- {
- ultraGridJustNo.UpdateData();
- List<YdmZcBillCyEntity> listSource = EntityHelper.GetData<YdmZcBillCyEntity>(
- "com.steering.pss.judge.DAL.QcmZbsQueryFrm.getJustStoveNoInfoByBiltNo", new object[] { billNo }, this.ob);
- ydmZcBillCyEntityBindingSource.DataSource = listSource;
- foreach (UltraGridRow row in ultraGridJustNo.Rows)
- {
- //理货在途量
- row.Cells["ActCountKc"].Value = (double.Parse(row.Cells["ActTallCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
- if (double.Parse(row.Cells["ActCountKc"].Value.ToString()) != 0.0)
- {
- row.Cells["ActWeightKc"].Value = (double.Parse(row.Cells["ActTallWt"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
- }
- else
- {
- row.Cells["ActWeightKc"].Value = "0.000";
- }
- //提单在途量
- row.Cells["ActCountZy"].Value = (double.Parse(row.Cells["ActCount"].Value.ToString()) - double.Parse(row.Cells["ActCountLoad"].Value.ToString())).ToString();
- if (double.Parse(row.Cells["ActCountZY"].Value.ToString()) != 0.0)
- {
- row.Cells["ActWeightZy"].Value = (double.Parse(row.Cells["ActWeight"].Value.ToString()) - double.Parse(row.Cells["ActWeightLoad"].Value.ToString())).ToString("f3");
- }
- else
- {
- row.Cells["ActWeightZY"].Value = "0.000";
- }
- if (row.Cells["OrdLnDlyPk"].Text.Equals(ordLnDlyPk))
- {
- row.Appearance.BackColor = Color.Wheat;
- }
- else
- {
- row.Appearance.BackColor = Color.White;
- }
- }
- }
- DataTable dtzbs = new DataTable();
- private void ultraGridOrder_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGridOrder.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- QueryJustStoveInfo(ugr.Cells["BillNo"].Text.ToString(), ugr.Cells["OrdLnDlyPk"].Text.ToString());
- //接箍信息
- DataTable dt = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.QueryCoupling", new object[] { ugr.Cells["BillNo"].Text.ToString() }, this.ob);
- if (dt.Rows.Count > 0 && dt != null)
- {
- GridHelper.CopyDataToDatatable(dt, this.dataTable2, true);
- //GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- string billNo = ugr.Cells["BillNo"].Text.ToString();
- string ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Text.ToString();
- //查询多语言质保书
- dtzbs.Clear();
- dtzbs = ServerHelper.GetData("com.steering.pss.judge.DAL.QcmZbsQueryFrm.doQuerLanguage1", new object[] { billNo, ordLnDlyPk }, ob);
- ultraComboEditor3.DataSource = dtzbs;
- ultraComboEditor3.DisplayMember = "质保书";
- if (dtzbs.Rows.Count > 0)
- {
- ugr.Cells["ZbsName"].Value = dtzbs.Rows[0]["质保书"].ToString();
- }
- }
- /// <summary>
- /// 按回车键触发查询按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ContPublic_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- DoQuery();
- }
- }
- private int splitterDistance = 0;
- private void ultraExpandableGroupBox1_ExpandedStateChanged(object sender, EventArgs e)
- {
- if (ultraExpandableGroupBox1.Expanded == false)
- {
- this.splitContainer2.SplitterDistance = splitContainer2.Size.Height - 26;
- }
- else
- {
- this.splitContainer2.SplitterDistance = splitterDistance == 0 ? splitContainer2.Size.Height / 2 : splitterDistance;
- }
- }
- private void ultraGridOrder_AfterSelectChange(object sender, AfterSelectChangeEventArgs e)
- {
- foreach (UltraGridRow uRow in ultraGridOrder.Selected.Rows)
- {
- if (uRow.GetType() != typeof(Infragistics.Win.UltraWinGrid.UltraGridGroupByRow))
- {
- uRow.Cells["CHC"].Value = true;
- }
- }
- }
- /// <summary>
- /// 质保书查看,上传,删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void craftImg1_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- string billNo = row.Cells["BillNo"].Text.ToString();
- string billNoSeq = row.Cells["BillNoSeq"].Text.ToString();
- string orderNoSeq = row.Cells["OrderSeqNo"].Text.ToString();
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Text.ToString();
- string ordLnPk = row.Cells["OrdLnPk"].Text.ToString();
- string askSubItmeVal = row.Cells["AskSubItmeVal"].Text.ToString();
- string filePath = row.GetValue("ZbsPath");
- string metricSystem = row.Cells["MetricSystem"].Text.ToString();
- if (e.Button.Key.ToLower().Equals("select"))
- {
- if (filePath.Equals(""))
- {
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["AskSubItmeVal"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["MetricSystem"].Value.ToString();
- string 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() + "&ORD_LN_DLY_PK=" + ordLnDlyPk;
- 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"))
- {
- string pdfName = billNoSeq;
- string filePathNew = "Qcm/ZbsPdf/" + orderNoSeq + "/";
- var serverFileList = FileHelper.Download(filePathNew);
- if (serverFileList.Count > 0)
- {
- MessageUtil.ShowWarning("该记录已存在一份文件,请删除后再重新上传!");
- return;
- }
- if (askSubItmeVal.Equals(""))
- {
- MessageUtil.ShowTips("请选择语言要求!");
- return;
- }
- string askSubItmeValNo = row.Cells["AskSubItmeVal"].Value.ToString();
- if (metricSystem.Equals(""))
- {
- MessageUtil.ShowTips("请选择公英制!");
- return;
- }
- string metricSystemNo = row.Cells["MetricSystem"].Value.ToString();
- //保存
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doAdd";
- ccp.ServerParams = new object[] { pdfName, filePathNew, billNoSeq, billNo, ordLnDlyPk, this.UserInfo.GetUserName(), askSubItmeValNo, metricSystemNo };
- 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=RepCertificateOfProductQuality.cpt&format=pdf"
- + "&BILL_NO=" + billNo + "&ORD_LN_PK=" + ordLnPk + "&ASK_ITEM_NO=" + askSubItmeValNo + "&METRIC_SYSTEM=" + metricSystemNo + "&USER=" + this.UserInfo.GetUserID() + "&ORD_LN_DLY_PK=" + ordLnDlyPk;
- 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["ZbsName"].Value = pdfName + ".pdf";
- row.Cells["ZbsPath"].Value = filePathNew;
- DoQuery();
- }
- }
- }
- else
- {
- //删除
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doDelete";
- ccp.ServerParams = new object[] { row.Cells["ZbsName"].Text.ToString(), billNoSeq, billNo, ordLnDlyPk };
- 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)
- {
- DoQuery();
- }
- }
- }
- }
- private void ultraTextEditor1_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- string CraftPath = row.Cells["CraftPath"].Text.ToString();
- FormFileDown askDown = new FormFileDown(this.ob, CraftPath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- }
- private void ultraComboEditor3_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- string billNo = row.Cells["BillNo"].Text.ToString();
- string billNoSeq = row.Cells["BillNoSeq"].Text.ToString();
- string orderNo = row.Cells["OrderSeqNo"].Text.ToString();
- string ordLnDlyPk = row.Cells["OrdLnDlyPk"].Text.ToString();
- string ordLnPk = row.Cells["OrdLnPk"].Text.ToString();
- string billName = row.Cells["ZbsName"].Text.ToString();
- string tsMemo = this.ultraOptionSet1.CheckedItem.DataValue.ToString();
- string address = this.ultraOptionSet2.CheckedItem.DataValue.ToString();
- string laguageName = row.Cells["LanguageName"].Text.ToString();
- string laguageCode = row.Cells["LanguageCode"].Text.ToString();
- string zbsTypeDesc = row.Cells["ZbsTypeDesc"].Text.ToString();
- string zbsTypeCode = row.Cells["ZbsTypeCode"].Text.ToString();
- string askSubItmeVal = "";
- //if (laguageName.Equals("") || laguageName == null || laguageCode.Equals("") || laguageCode == null )
- //{
- // MessageUtil.ShowTips("请先维护质保书语言!");
- // return;
- //}
- //if (zbsTypeDesc.Equals("") || zbsTypeDesc == null || zbsTypeCode.Equals("") || zbsTypeCode == null)
- //{
- // MessageUtil.ShowTips("请先维护质保书类型!");
- // return;
- //}
- if (!row.Cells["AskSubItmeVal"].Text.ToString().Equals(""))
- {
- askSubItmeVal = row.Cells["AskSubItmeVal"].Value.ToString();
- }
- string metricSystem = "";
- if (!row.Cells["MetricSystem"].Text.ToString().Equals(""))
- {
- metricSystem = row.Cells["MetricSystem"].Value.ToString();
- }
- if (e.Button.Key.ToLower().Equals("select"))
- { //查看
- //if (!this.CustomInfo.Equals("xiaoshou"))
- //{
- string filePath = row.GetValue("ZbsPath");
- FormFileDown askDown = new FormFileDown(this.ob, filePath);
- askDown.CtrlFileDown1.Button3.Visible = false;
- askDown.Show();
- //}
- //销售的查看没有下载
- //if (this.CustomInfo.Equals("xiaoshou"))
- //{
- // askDown.CtrlFileDown1.Button5.Visible = false;
- //}
- }
- else if (e.Button.Key.ToLower().Equals("add"))
- { //维护
- IQueryable<UltraGridRow> checkMagRows = this.ultraGridJustNo.Rows.AsQueryable().Where(" CHK = 'True'");
- ArrayList parm = new ArrayList();
- if (checkMagRows.Count() > 0)
- {
- foreach (UltraGridRow row2 in checkMagRows)
- { //招标质保书选择的炉批
- row2.Cells["JudgeStoveNo"].Value.ToString();
- row2.Cells["BatchNo"].Value.ToString();
- parm.Add(row2.Cells["JudgeStoveNo"].Value.ToString() + row2.Cells["BatchNo"].Value.ToString());
- }
- }
- //laguageName,laguageCode,zbsTypeDesc,zbsTypeCode,
- QcmZbsLanguage lan = new QcmZbsLanguage(laguageName, laguageCode, zbsTypeDesc, zbsTypeCode, billNo, orderNo, ordLnDlyPk, metricSystem, askSubItmeVal, billNoSeq, parm, tsMemo, address, billName, this.CustomInfo, ob);
- lan.ShowDialog();
- }
- else
- { //打印
- if (row.Cells["ZbsName"].Text.ToString().Equals(""))
- {
- MessageUtil.ShowTips("质保书为空,请选择或维护!");
- return;
- }
- string zbsName = row.Cells["ZbsPath"].Text.ToString();
- List<FileBean> list = Core.Mes.Client.Comm.Server.FileHelper.Download(zbsName);
- ShowByListFileBean(list);
- string filePath = Environment.CurrentDirectory + "\\Tmp\\" + ingname[i];
- pdfPrint(filePath);
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.judge.DAL.QcmZbsQueryFrm";
- ccp.MethodName = "doUpdatePrintData";
- ccp.ServerParams = new object[] { row.Cells["BillNoSeq"].Text.ToString().Trim(), this.UserInfo.GetUserName(), row.Cells["ZbsName"].Text.ToString(), billNo, ordLnDlyPk };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("打印成功!"))
- {
- DoQuery();
- }
- }
- }
- private void ultraComboEditor3_ValueChanged(object sender, EventArgs e)
- {
- UltraGridRow row = ultraGridOrder.ActiveRow;
- if (row == null) return;
- if (row.Cells["ZbsName"].Text.Equals("")) return;
- if (dtzbs.Rows.Count > 0)
- {
- DataRow[] dr = dtzbs.Select("质保书='" + row.Cells["ZbsName"].Text.ToString() + "'");
- DataTable dt = ToDataTable(dr);
- if (dt.Rows.Count > 0)
- {
- row.Cells["ZbsPath"].Value = dt.Rows[0]["质保书路径"].ToString();
- }
- }
- }
- public DataTable ToDataTable(DataRow[] rows)
- {
- if (rows == null || rows.Length == 0) return null;
- DataTable tmp = rows[0].Table.Clone(); // 复制DataRow的表结构
- foreach (DataRow row in rows)
- tmp.Rows.Add(row.ItemArray); // 将DataRow添加到DataTable中
- return tmp;
- }
- private void ultraGridJustNo_ClickCellButton(object sender, CellEventArgs e)
- {
- this.ultraGridJustNo.UpdateData();
- if (e.Cell.Column.Key == "JudgeStoveNo")
- {
- string batchNo = ultraGridJustNo.ActiveRow.Cells["BatchNo"].Value.ToString();
- string judgeStoveNo = ultraGridJustNo.ActiveRow.Cells["JudgeStoveNo"].Value.ToString();
- FrmCoupling orderZg = new FrmCoupling(judgeStoveNo, batchNo, this.ob);
- orderZg.ShowDialog();
- }
- }
- private void RefreshSpotZbs()
- {
- if (ultraGridOrder.ActiveRow == null) return;
- var pRow = ultraGridOrder.ActiveRow;
- Dal d = new Dal(ob);
- DataRow drOrdHead = d.GetRowByXmlId("JdgSlmOrderHead.getByDlyPk", pRow.GetValue("OrdLnDlyPk"));
- if (drOrdHead != null && drOrdHead["orderTyp"].ToString() != "120102")
- {
- MessageUtil.ShowWarning("只能刷新现货提单!");
- return;
- }
- string process = d.GetRowByXmlId("JdgComBasePline.getProcessByPline", pRow.GetValue("PlineCode"))["processCode"].ToString();
- foreach (var row in ultraGridJustNo.Rows)
- {
- d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.saveSpotInfo", row.GetValue("JudgeStoveNo"),
- row.GetValue("BatchNo"), row.GetValue("GroupNo"), process, pRow.GetValue("OrdLnDlyPk"));
- }
- //DataTable dt = d.GetTableByXmlId("JdgQcmZbsInfo.getxh");
- //foreach (DataRow dr in dt.Rows)
- //{
- // d.Set("com.steering.pss.judge.Bll.BllCreateZbsInfo.saveSpotInfo", dr["judgeStoveNo"].ToString(),
- // dr["batchNo"], "001", dr["processCode"].ToString(), dr["ordLnDlyPk"].ToString());
- //}
- MessageUtil.ShowTips("刷新成功");
- }
- }
- }
|