dev
ddlucky 7 months ago
parent e4202f824e
commit 17a976d647

@ -212,21 +212,21 @@ namespace DSWeb.Areas.CommMng.Controllers
var sr = new StreamReader(Request.InputStream, Encoding.UTF8); var sr = new StreamReader(Request.InputStream, Encoding.UTF8);
var strJson = sr.ReadToEnd(); var strJson = sr.ReadToEnd();
//BasicDataRefDAL.SaveLog(strJson, "", "大简云比对", "删除业务"); //BasicDataRefDAL.SaveLog(strJson, "", "大简云比对", "删除业务");
var param = JsonConvert.Deserialize<DJYBILLDELETE_SEND>(strJson); var paramHead = JsonConvert.Deserialize<InterfaceParam_Base>(strJson);
try try
{ {
//param.Save(); //param.Save();
InterfaceLog.Save("PublicInterface", strJson); InterfaceLog.Save("PublicInterface", strJson);
Assembly assembly = Assembly.Load("DSWeb"); Assembly assembly = Assembly.Load("DSWeb");
var classname = "DSWeb.Areas.CommMng.PublicInterfaceDAL.DJYBILLDELETE"; var classname = "DSWeb.Areas.CommMng.PublicInterfaceDAL."+ paramHead.PORTNAME;
var type = assembly.GetType(classname); var type = assembly.GetType(classname);
Object obj = type.Assembly.CreateInstance(type.ToString()); Object obj = type.Assembly.CreateInstance(type.ToString());
var doset = type.GetMethod("DoSet"); var doset = type.GetMethod("DoSet");
var _param = new object[] { param }; var _param = new object[] { paramHead.Param };
DJYBILLDELETE_REPLY result = (DJYBILLDELETE_REPLY)doset.Invoke(obj, BindingFlags.Instance | BindingFlags.NonPublic, null, _param, null); DBResult result = (DBResult)doset.Invoke(obj, BindingFlags.Instance | BindingFlags.NonPublic, null, _param, null);
//var str = JsonConvert.Serialize(result); //var str = JsonConvert.Serialize(result);
@ -243,12 +243,8 @@ namespace DSWeb.Areas.CommMng.Controllers
var _r = new DJYINFOBASE(); var _r = new DJYINFOBASE();
_r.Code = 1; _r.Code = 1;
var msg = e.Message; var msg = JsonConvert.Serialize(e);
if (e.InnerException != null && e.InnerException.Message != null) var _rs = BasicDataRefDAL.SaveLog(msg, "", "PublicInterface", "错误");
{
msg += "//InnerException.Message:" + e.InnerException.Message;
}
var _rs = BasicDataRefDAL.SaveLog(msg, "", "大简云比对", "删除业务");
//var _rr = JsonConvert.Deserialize<DBResult>(_rs.Content); //var _rr = JsonConvert.Deserialize<DBResult>(_rs.Content);
_r.Message = msg; _r.Message = msg;
@ -290,6 +286,95 @@ namespace DSWeb.Areas.CommMng.Controllers
public string Param { get; set; } public string Param { get; set; }
} }
public class InterfaceParam_Base
{
public string PORTNAME { get; set; }
public string GID { get; set; }
public object Param { get; set; }
}
public class _Fee
{
/// <summary>
/// 单证费
/// </summary>
public string cost_name { get; set; }
/// <summary>
///
/// </summary>
public string cost_unit { get; set; }
/// <summary>
///
/// </summary>
public string cost_price { get; set; }
/// <summary>
///
/// </summary>
public string cost_count { get; set; }
/// <summary>
///
/// </summary>
public string cost_currency { get; set; }
/// <summary>
///
/// </summary>
public string cost_amount { get; set; }
}
public class _Bill
{
/// <summary>
///
/// </summary>
public string bill_no { get; set; }
/// <summary>
///
/// </summary>
public string bill_date { get; set; }
/// <summary>
/// 正本提单
/// </summary>
public string bill_type { get; set; }
/// <summary>
/// 已出单
/// </summary>
public string bill_status { get; set; }
/// <summary>
///
/// </summary>
public string bill_vessel { get; set; }
/// <summary>
///
/// </summary>
public string bill_voyage { get; set; }
/// <summary>
///
/// </summary>
public string bill_amount_usa { get; set; }
/// <summary>
///
/// </summary>
public string bill_amount_rmb { get; set; }
/// <summary>
///
/// </summary>
public string bill_container_type { get; set; }
/// <summary>
///
/// </summary>
public string bill_container_count { get; set; }
/// <summary>
///
/// </summary>
public string bill_remark { get; set; }
/// <summary>
///
/// </summary>
public List<_Fee> bill_details { get; set; }
}
public static class InterfaceLog public static class InterfaceLog
{ {
public static void Save(string PORTNAME, object c) public static void Save(string PORTNAME, object c)

@ -0,0 +1,185 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Entity.Migrations;
using System.Data.Entity.Validation;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Security.Permissions;
using System.ServiceModel.Configuration;
using System.Text;
using System.Web;
using System.Windows.Forms;
using DSWeb.Areas.CommMng.Controllers;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.Common.DB;
using DSWeb.EntityDA;
using DSWeb.MvcShipping.Comm.Cookie;
using DSWeb.MvcShipping.Controllers;
using DSWeb.MvcShipping.Helper;
using HcUtility.Comm;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Newtonsoft.Json.Linq;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace DSWeb.Areas.CommMng.PublicInterfaceDAL
{
public class InterfaceResult
{
public string errCode { get; set; }
public string errMsg { get; set; }
public InterfaceResult() { }
public InterfaceResult(DBResult dbresult)
{
if (dbresult.Success)
{
errCode = "0";
}
else
{
errCode = "1";
}
errMsg = dbresult.Message + ";Data:" + JsonConvert.Serialize(dbresult.Data);
}
}
public class InterfaceParam
{
public Interface_Header header { get; set; }
public object body { get; set; }
public t_PublicInterface_Log_md getsaverec()
{
var result = new t_PublicInterface_Log_md();
try
{
result.GID = Guid.NewGuid().ToString();
result.Param = body.ToString();
result.PORTNAME = header.serviceCode;
result.CreateTime = DateTime.Now;
}
catch (Exception e) {
}
return result;
}
public void Save()
{
var saverec = getsaverec();
if (!string.IsNullOrWhiteSpace(saverec.Param) && !string.IsNullOrWhiteSpace(saverec.PORTNAME))
{
var cdc = new CommonDataContext();
cdc.t_PublicInterface_Log.Add(saverec);
cdc.SaveChanges();
}
}
}
public class Interface_Header
{
public string serviceCode { get; set; }
}
public static class InterfaceLog {
public static void Save(string PORTNAME,object c) {
var saverec = getsaverec(PORTNAME,c);
if (!string.IsNullOrWhiteSpace(saverec.Param) && !string.IsNullOrWhiteSpace(saverec.PORTNAME))
{
var cdc = new CommonDataContext();
cdc.t_PublicInterface_Log.Add(saverec);
cdc.SaveChanges();
}
}
private static t_PublicInterface_Log_md getsaverec(string PORTNAME, object c)
{
var result = new t_PublicInterface_Log_md();
try
{
result.GID = Guid.NewGuid().ToString();
result.PORTNAME= PORTNAME;
result.Param = JsonConvert.Serialize(c);
result.CreateTime = DateTime.Now;
}
catch (Exception e)
{
}
return result;
}
}
public class InterfaceBase
{
public InterfaceBase() { }
public virtual InterfaceResult DoSet(JObject paramObject)
{
return new InterfaceResult();
}
//public static void SaveParam(InterfaceParam param) {
// param.Save();
//}
}
#region 全泰 账单拆分
/// <summary>
/// 全泰 账单拆分
/// </summary>
public class
{
public DBResult DoSet(object Objectparam)
{
var paramstr = Objectparam.ToString();
//paramstr = paramstr.Remove(0, 1);
//paramstr = paramstr.Remove(paramstr.Length - 1, 1);
var param = JsonConvert.Deserialize<List<_Bill>>(paramstr);
var result = new DBResult();
try
{
InterfaceLog.Save("全泰账单解析", param);
result.OK();
}
catch (Exception ex)
{
//var newerror = new t_sys_soft_error_md();
//newerror.针对版本 = 0;
//newerror.升级日期 = DateTime.Now;
//newerror.升级人 = "管理员";
//newerror.执行文件 = $"[{ex.Message}]" + errorstr;
//var ds62 = new DS6DataContext();
//ds62.t_sys_soft_error.Add(newerror);
//ds62.SaveChanges();
InterfaceLog.Save("全泰账单_Error", ex);
result.SetErrorInfo(JsonConvert.Serialize(ex));
return result;
}
return result;
}
}
#endregion
}

@ -991,7 +991,7 @@ namespace DSWeb.Areas.Dispatch.Controllers
var infofilepath = InfoFilesPath + "/" + timename; var infofilepath = InfoFilesPath + "/" + timename;
if (extension == ".asp" || extension == ".aspx" || extension == ".html") if (extension == ".asp" || extension == ".aspx" || extension == ".html")
{ {
return Json(new { Success = false, Message = "特定文件不允许上传", Data = JsonConvert.SerializeObject(newInfoFiles) }); return Json(new { Success = false, Message = "特定文件不允许上传", Data = JsonConvert.SerializeObject(uploadFile.FileName) });
} }
var savePath = upDir + filepath; var savePath = upDir + filepath;

@ -8244,6 +8244,7 @@
<Compile Include="Areas\CommMng\Controllers\DSWEBAPPInterfaceController.cs" /> <Compile Include="Areas\CommMng\Controllers\DSWEBAPPInterfaceController.cs" />
<Compile Include="Areas\CommMng\Controllers\PublicInterfaceController.cs" /> <Compile Include="Areas\CommMng\Controllers\PublicInterfaceController.cs" />
<Compile Include="Areas\CommMng\DAL\PDFHelper.cs" /> <Compile Include="Areas\CommMng\DAL\PDFHelper.cs" />
<Compile Include="Areas\CommMng\DAL\PublicInterfaceDAL.cs" />
<Compile Include="Areas\CommMng\DAL\PublicPortHelper.cs" /> <Compile Include="Areas\CommMng\DAL\PublicPortHelper.cs" />
<Compile Include="Areas\CommMng\DAL\PublicAPIDAL.cs" /> <Compile Include="Areas\CommMng\DAL\PublicAPIDAL.cs" />
<Compile Include="Areas\CommMng\DAL\PageHelperEIP.cs" /> <Compile Include="Areas\CommMng\DAL\PageHelperEIP.cs" />

Loading…
Cancel
Save