DS7_JinGang
hanxuntao 1 year ago
parent 2c83c244ee
commit 72ccee3461

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />

@ -15,6 +15,8 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, {
addstore: false, addstore: false,
PageSize: 30, PageSize: 30,
sqlcontext: '', sqlcontext: '',
sortfield: '',
sortdire: '',
initUIComponents: function () { initUIComponents: function () {
this.serialNo = 0; this.serialNo = 0;
@ -27,6 +29,8 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, {
this.myDate = new Date(); this.myDate = new Date();
this.canedit = false; this.canedit = false;
this.selectfeesql = ''; this.selectfeesql = '';
this.sortfield = '';
this.sortdire = '';
this.formname = "MsChRecvapplicationBLEdit"; //页面名称 this.formname = "MsChRecvapplicationBLEdit"; //页面名称
@ -769,6 +773,11 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, {
window.open(openUrl, openType, openSet); window.open(openUrl, openType, openSet);
}, this); }, 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 = DsTruck.GetGridPanel(USERID, this.formname + 'bill', this.girdbillcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.girdbillcolums.unshift(new Ext.grid.RowNumberer()); this.girdbillcolums.unshift(new Ext.grid.RowNumberer());
@ -3681,6 +3690,11 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, {
} }
var sortstr = ''; var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var billno = _this.formEdit.getForm().findField('BILLNO').getValue(); var billno = _this.formEdit.getForm().findField('BILLNO').getValue();
var sql = " BILLNO='" + billno + "' "; 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 }); Ext.Msg.show({ title: '错误', msg: '单据还没有保存,请保存后再打印', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return; return;
} }
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var printType = 'MSCHFEERECAPPLICATION'; 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 + "'"; 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.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 + " ,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 + " 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 sql3 = "";
var sql4 = ""; var sql4 = "";

@ -5,6 +5,7 @@ using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Web; using System.Web;
using System.Web.Script.Serialization; 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<string, string> dic, int timeout = 10000) public static string DoPost_DSWMS(string url, Dictionary<string, string> dic, int timeout = 10000)
{ {

@ -720,8 +720,10 @@ namespace DSWeb.MvcShipping.Controllers
} }
else if (ds.Tables[0].Rows[0]["FSOFTCODE"].ToString().Trim() == "13") else if (ds.Tables[0].Rows[0]["FSOFTCODE"].ToString().Trim() == "13")
{ {
var templatepath = Server.MapPath("../../EDIFiles");
strCondition = " 1=1 " + strCondition; 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 = ""; result.Data = "";
} }

@ -23,6 +23,11 @@ using SocialExplorer.IO.FastDBF;
using System.Linq; using System.Linq;
using DSWeb.Common; using DSWeb.Common;
using DSWeb.Areas.Dispatch.Helper; 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 namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
{ {
@ -3006,7 +3011,59 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
#region 浪潮inSuite #region 浪潮inSuite
public static string GenerateNewParamByRecursion(object param)
//public static Dictionary<string, object> ToDictionary(this object obj)
//{
// var dictionary = new Dictionary<string, object>();
// 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<object>))
{
foreach (var temp_dict in param as List<object>)
{
var d_order = (temp_dict.ToDictionary()).OrderBy(x => x.Key);
foreach (var kv in d_order)
{
if (!(kv.Value is List<object>))
{
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<object>))
{
newParam = newParam + kv.Key;
newParam = newParam + kv.Value.ToString();
newParam = newParam + "&";
}
}
}
return newParam;
}
public static string GenerateNewParamByRecursion2(object param)
{ {
var newParam =""; var newParam ="";
if (param is List<object>) if (param is List<object>)
@ -3043,7 +3100,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
return newParam; 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(); var result = new DBResult();
@ -3086,13 +3143,14 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
{ {
Param VoucherDetail = new Param(); Param VoucherDetail = new Param();
VoucherDetail.accting_org_number = ""; VoucherDetail.accting_org_number = INSUITECOMPANY;
VoucherDetail.acct_book_number = ""; VoucherDetail.acct_book_number = INSUITEACCOUNT;
VoucherDetail.voucher_word_name = vou.VKNO; VoucherDetail.voucher_word_name = vou.VKNO;
VoucherDetail.attachment_qty = vou.ATTACHS; VoucherDetail.attachment_qty = vou.ATTACHS;
VoucherDetail.number = vou.VOUNO.ToString(); 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 voudetaildataList = MsCwVouchersGlDAL.GetDataCwVVList(0, 1000, "ORDNO='" + vou.ORDNO + "'", userid, usercode, companyid, strCwSTARTGID);
var vouitemsList = new List<Line_ids>(); var vouitemsList = new List<Line_ids>();
foreach (var voudetail in voudetaildataList) foreach (var voudetail in voudetaildataList)
@ -3140,40 +3198,72 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
vouitemsList.Add(vouitems); vouitemsList.Add(vouitems);
} }
VoucherDetail.line_ids = vouitemsList; 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 var postObj = new
{ {
client_id = thirdpartyaccount.ACCOUNT, paramsendlangchao = paramsends
sign = signstr.ToMd5(),//固定
param= VoucherDetailList
}; };
var errstr = ""; var errstr = "";
var apiJson = JsonConvert.SerializeObject(postObj); var apiJson = JsonConvert.SerializeObject(postObj);
apiJson = apiJson.Replace("paramsendlangchao", "params");
var apiRtn = Areas.Dispatch.Helper.WebRequestHelper.DoPost(INSUITEWEB, apiJson); var apiRtn = Areas.Dispatch.Helper.WebRequestHelper.DoPost(INSUITEWEB, apiJson);
var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(apiRtn, new Root()); var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(apiRtn, new Root());
int voucount = 0; int voucount = 0;
int errvoucount = 0; int errvoucount = 0;
if (objRtn2.result.res != null) { if (objRtn2.result.res != null)
foreach (var res in objRtn2.result.res) { {
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); var vou = dataList.Find(x => x.VOUNO.ToString() == res.param.number);
if (vou != null) { if (vou != null)
sSql = " update cw_vouchers_gl set ISEXPORT=1 where ORDNO=" +vou.ORDNO ; {
sSql = " update cw_vouchers_gl set ISEXPORT=1 where ORDNO=" + vou.ORDNO;
SqlHelper.ExecuteSql(SqlHelper.ConnectionStringLocalTransaction, sSql); SqlHelper.ExecuteSql(SqlHelper.ConnectionStringLocalTransaction, sSql);
} }
voucount = voucount + 1; voucount = voucount + 1;
} }
else { else
{
errstr = errstr + res.msg; errstr = errstr + res.msg;
errvoucount = errvoucount + 1; errvoucount = errvoucount + 1;
} }
} }
} }
else {
errvoucount = dataList.Count;
errstr = errstr + dataList.Count + objRtn2.result.msg;
}
if (!string.IsNullOrEmpty(errstr)) errstr ="失败"+errvoucount+"票,提示:"+ errstr; if (!string.IsNullOrEmpty(errstr)) errstr ="失败"+errvoucount+"票,提示:"+ errstr;

@ -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<string, object> ToDictionary(this object obj)
{
var dictionary = new Dictionary<string, object>();
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;
}
}
}

@ -521,7 +521,10 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl
} }
#region 浪潮凭证 #region 浪潮凭证
public class Auxiliary
public class Auxiliary
{ {
} }
@ -590,7 +593,7 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime business_date { get; set; } public string business_date { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -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> param { get; set; }
}
public class Res public class Res
{ {
/// <summary> /// <summary>
@ -620,7 +631,7 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public int state { get; set; } public string state { get; set; }
/// <summary> /// <summary>
/// 记-00001 /// 记-00001
/// </summary> /// </summary>
@ -633,10 +644,11 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public int code { get; set; } public string code { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string msg { get; set; }///
public List<Res> res { get; set; } public List<Res> res { get; set; }
} }

@ -384,7 +384,7 @@ Ext.extend(Shipping.MsCodeFeeSetListIndex, Ext.Panel, {
}, { }, {
text: Zi.LAN.FeeNameModify, text: Zi.LAN.FeeNameModify,
handler: function (button, event) { handler: function (button, event) {
this.onShowModify(); this.winModifyShow.show();
}, },
scope: this scope: this
}, { }, {

@ -7399,6 +7399,7 @@
<Content Include="PT000147.pfx" /> <Content Include="PT000147.pfx" />
<Content Include="PTTEST17.pfx" /> <Content Include="PTTEST17.pfx" />
<Content Include="Reports\dbf\K3WISEModel_20210520.dbf" /> <Content Include="Reports\dbf\K3WISEModel_20210520.dbf" />
<Content Include="EDIFiles\smime.p7s" />
<None Include="Web References\ServiceReference1\WebInterFace.disco"> <None Include="Web References\ServiceReference1\WebInterFace.disco">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>
@ -7670,6 +7671,7 @@
<Compile Include="Areas\MvcShipping\DAL\MsContainerSetCtn\MsContainerSetCtnDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsContainerSetCtn\MsContainerSetCtnDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsContainerSet\MsContainerSetDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsContainerSet\MsContainerSetDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsCrmClient\MsCrmClientDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsCrmClient\MsCrmClientDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsCwVouchersGl\ObjectExtensions.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsOpPlan\MsOpPlanDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsOpPlan\MsOpPlanDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsOpSeaeModule\MsOpSeaeModuleDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsOpSeaeModule\MsOpSeaeModuleDAL.cs" />
<Compile Include="Areas\MvcShipping\DAL\MsOpSocCtn\MsOpSocCtnDAL.cs" /> <Compile Include="Areas\MvcShipping\DAL\MsOpSocCtn\MsOpSocCtnDAL.cs" />

@ -2,9 +2,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>H:\DS7_dev\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>配置文件1</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />
<IISExpressAnonymousAuthentication /> <IISExpressAnonymousAuthentication />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />

Loading…
Cancel
Save