You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/CommMng/Controllers/PublicAPIController.cs

104 lines
3.9 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DSWeb.EntityDA;
using DSWeb.Models;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using WebSqlHelper;
using System.Web.Configuration;
using System.IO;
using System.Web.UI.MobileControls.Adapters;
using System.Text;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Areas.MvcShipping.DAL;
namespace DSWeb.Areas.CommMng.Controllers
{
[JsonRequestBehavior]
public class PublicAPIController : Controller
{
[HttpPost]
public ContentResult SETTLE_DATA_POST()
{
//var jsonRespose = new JsonResponse { Success = false, Message = "" };
var sr = new StreamReader(Request.InputStream, Encoding.UTF8);
var strJson = sr.ReadToEnd();
BasicDataRefDAL.SaveLog(strJson, "", "关贸云_报关业务", "");
//var usercode = CookieConfig.GetCookie_UserCode(Request);
try
{
//20230129 改为将关贸云的报文解析后 不存入报关业务 而存入OP_TASK中其中报文存于OP_logicinfo执行任务时执行报文解析
//报关业务存于 OP_logicinfo.BSNO=OP_TASK.taskno PROPNAME='关贸云报关'
//报关业务费用存于 OP_logicinfo.BSNO=OP_TASK.taskno PROPNAME='关贸云费用'
//var headinfo = JsonConvert.Deserialize<GuanMaoYun_Head>(strJson);
//var jsonRespose = PublicAPIDAL.GuanMaoYun_Head_Save(headinfo);
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
var _r = MsOpTaskDAL.(strJson);
var jsonRespose = new JsonResponse { Success = _r.Success, Message = _r.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
catch (Exception e)
{
var jsonRespose = new JsonResponse { Success = false, Message = "" };
jsonRespose.Success = false;
jsonRespose.Message = "上传出错"+ e.Message + "//" + e.InnerException.Message;
BasicDataRefDAL.SaveLog(e.Message+"//"+e.InnerException.Message, "", "关贸云_报关业务", "报错");
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
}
[HttpPost]
public ContentResult SETTLE_FEE_POST()
{
//var jsonRespose = new JsonResponse { Success = false, Message = "" };
var sr = new StreamReader(Request.InputStream, Encoding.UTF8);
var strJson = sr.ReadToEnd();
BasicDataRefDAL.SaveLog(strJson, "", "关贸云_报关业务费用", "");
//var usercode = CookieConfig.GetCookie_UserCode(Request);
try
{
//var headinfo = JsonConvert.Deserialize<GuanMaoYun_Fee>(strJson);
//var jsonRespose = PublicAPIDAL.GuanMaoYun_Fee_Save(headinfo);
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
var _r = MsOpTaskDAL.(strJson);
var jsonRespose = new JsonResponse { Success = _r.Success, Message = _r.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
catch (Exception e)
{
var jsonRespose = new JsonResponse { Success = false, Message = "" };
jsonRespose.Success = false;
jsonRespose.Message = "上传出错:["+e.Message+"]" + e.InnerException.Message;
BasicDataRefDAL.SaveLog(e.Message + "//" + e.InnerException.Message, "", "关贸云_报关业务费用", "报错");
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
}
}
}