diff --git a/BookingJieFeng/BookingJieFeng.csproj.user b/BookingJieFeng/BookingJieFeng.csproj.user index a48b3371..28be9c4c 100644 --- a/BookingJieFeng/BookingJieFeng.csproj.user +++ b/BookingJieFeng/BookingJieFeng.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU FolderProfile true diff --git a/BookingWeb/BookingWeb.csproj.user b/BookingWeb/BookingWeb.csproj.user index 6bc24ada..4edb5e0f 100644 --- a/BookingWeb/BookingWeb.csproj.user +++ b/BookingWeb/BookingWeb.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU true diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_recvapplication/ChRecvapplicationBLEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_recvapplication/ChRecvapplicationBLEdit.js index 5dac8cfe..b3930ac2 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_recvapplication/ChRecvapplicationBLEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_recvapplication/ChRecvapplicationBLEdit.js @@ -15,6 +15,8 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { addstore: false, PageSize: 30, sqlcontext: '', + sortfield: '', + sortdire: '', initUIComponents: function () { this.serialNo = 0; @@ -27,6 +29,8 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { this.myDate = new Date(); this.canedit = false; this.selectfeesql = ''; + this.sortfield = ''; + this.sortdire = ''; this.formname = "MsChRecvapplicationBLEdit"; //页面名称 @@ -769,6 +773,11 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { window.open(openUrl, openType, openSet); }, this); + this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) { + this.sortfield = column.dataIndex; + this.sortdire = direction; + }, this); + this.girdbillcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bill', this.girdbillcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 this.girdbillcolums.unshift(new Ext.grid.RowNumberer()); @@ -3681,6 +3690,11 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { } var sortstr = ''; + if (this.sortfield != '' && this.sortdire != '') { + + sortstr = this.sortfield + ' ' + this.sortdire; + } + var billno = _this.formEdit.getForm().findField('BILLNO').getValue(); var sql = " BILLNO='" + billno + "' "; @@ -3778,6 +3792,11 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return; } + if (this.sortfield != '' && this.sortdire != '') { + + sortstr = this.sortfield + ' ' + this.sortdire; + } + var printType = 'MSCHFEERECAPPLICATION'; var sql1 = "SELECT p.*,(select ShowName from [user] where GID=p.APPLICANT) as APPLICANTNAME,(select DESCRIPTION from info_client where SHORTNAME=p.CUSTOMERNAME) CUSTFULLNAME FROM ch_fee_recvapplication p WHERE BILLNO='" + billNo + "'"; @@ -3785,7 +3804,7 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, { sql2 = sql2 + ",b.CUSTOMERNAME,b.VESSEL,b.VOYNO,b.ETD,b.PORTLOAD"; sql2 = sql2 + " ,b.PORTDISCHARGE,b.INPUTBY,b.OP,b.CUSTSERVICE,b.DOC,b.SALE,b.MBLNO,b.CUSTNO "; sql2 = sql2 + " FROM ch_fee_do c left join v_op_bill b on (b.bsno=c.bsno)"; - sql2 = sql2 + " WHERE C.BILLNO='" + billNo + "' ORDER BY b.VESSEL,b.VOYNO,b.MBLNO"; + sql2 = sql2 + " WHERE C.BILLNO='" + billNo + "' ORDER BY " + sortstr; var sql3 = ""; var sql4 = ""; diff --git a/DSWeb/Areas/Dispatch/Helper/WebRequestHelper.cs b/DSWeb/Areas/Dispatch/Helper/WebRequestHelper.cs index 58a0a9e2..a78ad89e 100644 --- a/DSWeb/Areas/Dispatch/Helper/WebRequestHelper.cs +++ b/DSWeb/Areas/Dispatch/Helper/WebRequestHelper.cs @@ -5,6 +5,7 @@ using System.IO; using System.IO.Compression; using System.Linq; using System.Net; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Web; using System.Web.Script.Serialization; @@ -129,6 +130,43 @@ namespace DSWeb.Areas.Dispatch.Helper } + public static string DoPost(string url, string json,string certificatepath,string password) + { + string responseString = "";//post返回的结果 + var req = (HttpWebRequest)WebRequest.Create(url); + var certificate = new X509Certificate2(certificatepath, password); + req.ClientCertificates.Add(certificate); + req.Method = "POST"; + + if (!string.IsNullOrWhiteSpace(json)) + { + byte[] postBytes = Encoding.UTF8.GetBytes(json); + req.ContentType = "application/json"; + req.ContentLength = postBytes.Length; + using (var stream = req.GetRequestStream()) + { + stream.Write(postBytes, 0, postBytes.Length); + } + //Stream stream = req.GetRequestStream(); + //stream.Write(postBytes, 0, postBytes.Length); + req.Timeout = 10000; + //stream.Close(); + } + else + { + req.ContentLength = 0; + } + var response = req.GetResponse(); + Stream streamResponse = response.GetResponseStream(); + StreamReader streamRead = new StreamReader(streamResponse); + responseString = streamRead.ReadToEnd(); + response.Close(); + streamRead.Close(); + + return responseString; + } + + public static string DoPost_DSWMS(string url, Dictionary dic, int timeout = 10000) { diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsCwVouchersGlController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsCwVouchersGlController.cs index 12105b1d..7a1cf598 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsCwVouchersGlController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsCwVouchersGlController.cs @@ -720,8 +720,10 @@ namespace DSWeb.MvcShipping.Controllers } else if (ds.Tables[0].Rows[0]["FSOFTCODE"].ToString().Trim() == "13") { + + var templatepath = Server.MapPath("../../EDIFiles"); strCondition = " 1=1 " + strCondition; - result = MsCwVouchersGlDAL.setExcelReportGlinSuite(strCondition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), strCwSTARTGID); + result = MsCwVouchersGlDAL.setExcelReportGlinSuite(strCondition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), strCwSTARTGID, templatepath); result.Data = ""; } diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/MsCwVouchersGlDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/MsCwVouchersGlDAL.cs index e380804f..fb674ab5 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/MsCwVouchersGlDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/MsCwVouchersGlDAL.cs @@ -23,6 +23,11 @@ using SocialExplorer.IO.FastDBF; using System.Linq; using DSWeb.Common; using DSWeb.Areas.Dispatch.Helper; +using DSWeb.Areas.MvcShipping.DAL.MsCwVouchersGlDAL; +using System.Net.Http; +using System.Security.Cryptography.X509Certificates; +using System.Net.Security; +using System.Security.Cryptography; namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL { @@ -3006,7 +3011,59 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL #region 浪潮inSuite - public static string GenerateNewParamByRecursion(object param) + + //public static Dictionary ToDictionary(this object obj) + //{ + // var dictionary = new Dictionary(); + // if (obj == null) return dictionary; + + // foreach (var property in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) + // { + // var value = property.GetValue(obj); + // dictionary.Add(property.Name, value); + // } + + // return dictionary; + //} + + static string GenerateNewParamByRecursion(object param) + { + var newParam = ""; + var tmpparam = param.GetType(); + if (param.GetType() == typeof(List)) + { + foreach (var temp_dict in param as List) + { + var d_order = (temp_dict.ToDictionary()).OrderBy(x => x.Key); + foreach (var kv in d_order) + { + if (!(kv.Value is List)) + { + newParam = newParam + kv.Key; + newParam = newParam + kv.Value.ToString(); + newParam = newParam + "&"; + } + } + } + } + else + { + var d_order = param.ToDictionary().OrderBy(x => x.Key); + + foreach (var kv in d_order) + { + if (kv.Key!= "line_ids" && !(kv.Value is List)) + { + newParam = newParam + kv.Key; + newParam = newParam + kv.Value.ToString(); + newParam = newParam + "&"; + } + } + } + return newParam; + } + + public static string GenerateNewParamByRecursion2(object param) { var newParam =""; if (param is List) @@ -3043,7 +3100,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL return newParam; } - public static DBResult setExcelReportGlinSuite(string strCondition, string userid, string usercode, string companyid, string strCwSTARTGID) + public static DBResult setExcelReportGlinSuite(string strCondition, string userid, string usercode, string companyid, string strCwSTARTGID,string templatepath) { var result = new DBResult(); @@ -3086,13 +3143,14 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL { Param VoucherDetail = new Param(); - VoucherDetail.accting_org_number = ""; - VoucherDetail.acct_book_number = ""; + VoucherDetail.accting_org_number = INSUITECOMPANY; + VoucherDetail.acct_book_number = INSUITEACCOUNT; VoucherDetail.voucher_word_name = vou.VKNO; VoucherDetail.attachment_qty = vou.ATTACHS; VoucherDetail.number = vou.VOUNO.ToString(); - VoucherDetail.business_date = Convert.ToDateTime(vou.VOUDATE); - + VoucherDetail.business_date = Convert.ToDateTime(vou.VOUDATE).ToString("yyyy-MM-dd")+ "T00:00:00"; + VoucherDetail.voucher_source = ""; + VoucherDetail.creator_phone = ""; var voudetaildataList = MsCwVouchersGlDAL.GetDataCwVVList(0, 1000, "ORDNO='" + vou.ORDNO + "'", userid, usercode, companyid, strCwSTARTGID); var vouitemsList = new List(); foreach (var voudetail in voudetaildataList) @@ -3140,40 +3198,72 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL vouitemsList.Add(vouitems); } VoucherDetail.line_ids = vouitemsList; + VoucherDetailList.Add(VoucherDetail); + } + var signstr = ""; + if (VoucherDetailList.Count == 1) + signstr = GenerateNewParamByRecursion(VoucherDetailList[0]) + thirdpartyaccount.ACCOUNTPSW; + else + signstr = GenerateNewParamByRecursion(VoucherDetailList) + thirdpartyaccount.ACCOUNTPSW; + byte[] utf8Bytes = Encoding.UTF8.GetBytes(signstr); + + byte[] hashBytes; + using (var md5 = MD5.Create()) + { + hashBytes = md5.ComputeHash(utf8Bytes); } - var signstr = GenerateNewParamByRecursion(VoucherDetailList)+ thirdpartyaccount.ACCOUNTPSW; + + string sign = BitConverter.ToString(hashBytes).Replace("-", "").ToLower(); + + paramsend paramsends = new paramsend(); + paramsends.client_id = thirdpartyaccount.ACCOUNT; + paramsends.sign = sign; + paramsends.param = VoucherDetailList; + + + var postObj = new { - client_id = thirdpartyaccount.ACCOUNT, - sign = signstr.ToMd5(),//固定 - param= VoucherDetailList + paramsendlangchao = paramsends }; var errstr = ""; var apiJson = JsonConvert.SerializeObject(postObj); + apiJson = apiJson.Replace("paramsendlangchao", "params"); + + var apiRtn = Areas.Dispatch.Helper.WebRequestHelper.DoPost(INSUITEWEB, apiJson); var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(apiRtn, new Root()); int voucount = 0; int errvoucount = 0; - if (objRtn2.result.res != null) { - foreach (var res in objRtn2.result.res) { + if (objRtn2.result.res != null) + { + foreach (var res in objRtn2.result.res) + { - if (res.state == 1) + if (res.state == "1") { var vou = dataList.Find(x => x.VOUNO.ToString() == res.param.number); - if (vou != null) { - sSql = " update cw_vouchers_gl set ISEXPORT=1 where ORDNO=" +vou.ORDNO ; + if (vou != null) + { + sSql = " update cw_vouchers_gl set ISEXPORT=1 where ORDNO=" + vou.ORDNO; SqlHelper.ExecuteSql(SqlHelper.ConnectionStringLocalTransaction, sSql); } voucount = voucount + 1; } - else { + else + { errstr = errstr + res.msg; errvoucount = errvoucount + 1; } } } + else { + errvoucount = dataList.Count; + errstr = errstr + dataList.Count + objRtn2.result.msg; + + } if (!string.IsNullOrEmpty(errstr)) errstr ="失败"+errvoucount+"票,提示:"+ errstr; diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/ObjectExtensions.cs b/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/ObjectExtensions.cs new file mode 100644 index 00000000..78064a9a --- /dev/null +++ b/DSWeb/Areas/MvcShipping/DAL/MsCwVouchersGl/ObjectExtensions.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Reflection; + +namespace DSWeb.Areas.MvcShipping.DAL.MsCwVouchersGlDAL +{ + public static class ObjectExtensions + { + public static Dictionary ToDictionary(this object obj) + { + var dictionary = new Dictionary(); + if (obj == null) return dictionary; + + foreach (var property in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + var value = property.GetValue(obj); + dictionary.Add(property.Name, value); + } + + return dictionary; + } + } +} \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Models/MsCwVouchersGl/MsCwVouchersGl.cs b/DSWeb/Areas/MvcShipping/Models/MsCwVouchersGl/MsCwVouchersGl.cs index 438f6d7a..7eb5fc78 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsCwVouchersGl/MsCwVouchersGl.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsCwVouchersGl/MsCwVouchersGl.cs @@ -521,7 +521,10 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl } #region 浪潮凭证 - public class Auxiliary + + + +public class Auxiliary { } @@ -590,7 +593,7 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl /// /// /// - public DateTime business_date { get; set; } + public string business_date { get; set; } /// /// /// @@ -611,6 +614,14 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl } + public class paramsend + { + public string client_id { get; set; } + + public string sign { get; set; } + public List param { get; set; } + } + public class Res { /// @@ -620,7 +631,7 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl /// /// /// - public int state { get; set; } + public string state { get; set; } /// /// 记-00001 /// @@ -633,10 +644,11 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl /// /// /// - public int code { get; set; } + public string code { get; set; } /// /// /// + public string msg { get; set; }/// public List res { get; set; } } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListIndex.js index b4cda0b3..29e1798a 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListIndex.js @@ -384,7 +384,7 @@ Ext.extend(Shipping.MsCodeFeeSetListIndex, Ext.Panel, { }, { text: Zi.LAN.FeeNameModify, handler: function (button, event) { - this.onShowModify(); + this.winModifyShow.show(); }, scope: this }, { diff --git a/DSWeb/DSWeb.csproj b/DSWeb/DSWeb.csproj index b2a451c0..0cf0c203 100644 --- a/DSWeb/DSWeb.csproj +++ b/DSWeb/DSWeb.csproj @@ -7399,6 +7399,7 @@ + Designer @@ -7670,6 +7671,7 @@ + diff --git a/DSWeb/DSWeb.csproj.user b/DSWeb/DSWeb.csproj.user index c976d660..5d714467 100644 --- a/DSWeb/DSWeb.csproj.user +++ b/DSWeb/DSWeb.csproj.user @@ -2,9 +2,9 @@ ShowAllFiles - H:\DS7_dev\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml + 配置文件1 true - Debug|Any CPU + Release|Any CPU diff --git a/DispatchWeb/DispatchWeb.csproj.user b/DispatchWeb/DispatchWeb.csproj.user index e6a8406a..af17a67a 100644 --- a/DispatchWeb/DispatchWeb.csproj.user +++ b/DispatchWeb/DispatchWeb.csproj.user @@ -1,7 +1,7 @@  - Debug|Any CPU + Release|Any CPU true