|
|
@ -7,11 +7,17 @@ using System.Data.Entity.Migrations;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Web;
|
|
|
|
using System.Web;
|
|
|
|
using System.Web.Mvc;
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
|
|
using Aspose.Words.Drawing;
|
|
|
|
|
|
|
|
using Colo.Web;
|
|
|
|
using Colo.Web.admin.user;
|
|
|
|
using Colo.Web.admin.user;
|
|
|
|
using com.sun.org.apache.bcel.@internal.generic;
|
|
|
|
using com.sun.org.apache.bcel.@internal.generic;
|
|
|
|
|
|
|
|
using com.sun.org.apache.xerces.@internal.jaxp.validation;
|
|
|
|
|
|
|
|
using com.sun.tools.apt.util;
|
|
|
|
using DSWeb.Areas.CommMng.Models;
|
|
|
|
using DSWeb.Areas.CommMng.Models;
|
|
|
|
|
|
|
|
using DSWeb.Areas.Import.DAL.ReceiptDoc;
|
|
|
|
using DSWeb.Areas.MvcShipping.Helper;
|
|
|
|
using DSWeb.Areas.MvcShipping.Helper;
|
|
|
|
using DSWeb.Common.DB;
|
|
|
|
using DSWeb.Common.DB;
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
using DSWeb.EntityDA;
|
|
|
@ -21,7 +27,9 @@ using DSWeb.MvcShipping.Helper;
|
|
|
|
using DSWeb.MvcShipping.Helper.Repository;
|
|
|
|
using DSWeb.MvcShipping.Helper.Repository;
|
|
|
|
using DSWeb.MvcShipping.Models.MsInfoClient;
|
|
|
|
using DSWeb.MvcShipping.Models.MsInfoClient;
|
|
|
|
using DSWeb.MvcShipping.Models.MsOpApply;
|
|
|
|
using DSWeb.MvcShipping.Models.MsOpApply;
|
|
|
|
|
|
|
|
using DSWeb.MvcShipping.Models.WMSNew;
|
|
|
|
using DSWeb.ParameterSet;
|
|
|
|
using DSWeb.ParameterSet;
|
|
|
|
|
|
|
|
using DSWeb.SoftMng.BLL;
|
|
|
|
using DSWeb.SoftMng.Model;
|
|
|
|
using DSWeb.SoftMng.Model;
|
|
|
|
using DSWeb.TruckMng.Comm.Cookie;
|
|
|
|
using DSWeb.TruckMng.Comm.Cookie;
|
|
|
|
|
|
|
|
|
|
|
@ -29,12 +37,13 @@ using HcUtility.Comm;
|
|
|
|
using java.rmi.server;
|
|
|
|
using java.rmi.server;
|
|
|
|
using Microsoft.Practices.EnterpriseLibrary.Data;
|
|
|
|
using Microsoft.Practices.EnterpriseLibrary.Data;
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
|
|
|
using Quartz.Util;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class PublicAPIDAL
|
|
|
|
public class PublicAPIDAL
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public static JsonResponse GuanMaoYun_Head_Save(GuanMaoYun_Head head,string OP)
|
|
|
|
public static JsonResponse GuanMaoYun_Head_Save(GuanMaoYun_Head head,string OP,string userid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = new JsonResponse();
|
|
|
|
var result = new JsonResponse();
|
|
|
|
|
|
|
|
|
|
|
@ -201,6 +210,14 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
, ModelObjectConvert<MsOpCtn>.ToModelObjectList(delCtnList)
|
|
|
|
, ModelObjectConvert<MsOpCtn>.ToModelObjectList(delCtnList)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//20230308 增加对单一窗口模块的数据写入
|
|
|
|
|
|
|
|
if (_r.Success) {
|
|
|
|
|
|
|
|
var _r6= SaveDecHead(OpapplyHead.MASTERNO,userid);
|
|
|
|
|
|
|
|
if (_r6.Success == false) {
|
|
|
|
|
|
|
|
_r.OK(_r6.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result = new JsonResponse { Success = _r.Success, Message = _r.Message, Data = _r.Data };
|
|
|
|
result = new JsonResponse { Success = _r.Success, Message = _r.Message, Data = _r.Data };
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -460,14 +477,6 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
result.CUSTOMDATE = head.DECL_DATE.ToString("yyyy-MM-dd");
|
|
|
|
result.CUSTOMDATE = head.DECL_DATE.ToString("yyyy-MM-dd");
|
|
|
|
if (result.CUSTOMDATE == "0001-01-01") result.CUSTOMDATE = null;
|
|
|
|
if (result.CUSTOMDATE == "0001-01-01") result.CUSTOMDATE = null;
|
|
|
|
|
|
|
|
|
|
|
|
result.INSPECTIONNO = head.CORRELATION_DECL_NO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.BOOKNO = head.HAND_BOOK_NO;//手册备案号
|
|
|
|
result.BOOKNO = head.HAND_BOOK_NO;//手册备案号
|
|
|
|
|
|
|
|
|
|
|
|
result.CONTRACTNO = head.CONTR_NO;//合同号
|
|
|
|
result.CONTRACTNO = head.CONTR_NO;//合同号
|
|
|
@ -503,6 +512,17 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
|
|
|
|
|
|
|
result.OP = headinfo.BUSINESS_ORDER_INFO.PROJECT_NO;//操作 2023-1-13
|
|
|
|
result.OP = headinfo.BUSINESS_ORDER_INFO.PROJECT_NO;//操作 2023-1-13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.CURRENCY = headinfo.DECL_HEAD.CURRENCY_CODE;//---"CURRENCY_CODE_EN": "币种",目前未处理 改为写入 报关业务编辑页:币别
|
|
|
|
|
|
|
|
result.BSCUSTOMNO = headinfo.DECL_HEAD.RELATIVE_ENTRY_ID;//---"RELATIVE_ENTRY_ID": "关联报关单",目前未处理 改为写入 报关业务编辑页:关联报关单号
|
|
|
|
|
|
|
|
result.CUSTOMSLNO = headinfo.DECL_HEAD.RELATIVE_EMS_NO;//---"RELATIVE_ENTRY_ID": "关联报关单",目前未处理 改为写入 报关业务编辑页:关联报关单号
|
|
|
|
|
|
|
|
//result.INSPECTIONNO = head.CORRELATION_DECL_NO;
|
|
|
|
|
|
|
|
result.INSPECTIONNO = headinfo.DECL_HEAD.CUS_INSPE_NO;//---"CUS_INSPE_NO": "关检关联号",目前未处理写入商检单号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.EXPORT_CREDIT_CODE = headinfo.DECL_HEAD.EXPORT_CREDIT_CODE;
|
|
|
|
|
|
|
|
result.SHIP_CREDIT_CODE = headinfo.DECL_HEAD.SHIP_CREDIT_CODE;
|
|
|
|
|
|
|
|
result.ENTRY_VERSION = headinfo.DECL_HEAD.ENTRY_VERSION;
|
|
|
|
|
|
|
|
result.SOURCE_OP = headinfo.BUSINESS_ORDER_INFO.PROJECT_NO;
|
|
|
|
|
|
|
|
|
|
|
|
returnresult.OK("", result);
|
|
|
|
returnresult.OK("", result);
|
|
|
|
|
|
|
|
|
|
|
|
return returnresult;
|
|
|
|
return returnresult;
|
|
|
@ -536,6 +556,8 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
newrec.Total = BasicDataRefDAL.String2Decimal(goodinfo.AMOUNT);
|
|
|
|
newrec.Total = BasicDataRefDAL.String2Decimal(goodinfo.AMOUNT);
|
|
|
|
newrec.Currency = goodinfo.CURRENCY;
|
|
|
|
newrec.Currency = goodinfo.CURRENCY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newrec.GOODSNUM = BasicDataRefDAL.String2Decimal(goodinfo.QTY);
|
|
|
|
|
|
|
|
//newrec.GOODSSTANDARD = goodinfo.UNIT;
|
|
|
|
|
|
|
|
|
|
|
|
result.Add(newrec);
|
|
|
|
result.Add(newrec);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -622,6 +644,337 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
|
|
|
|
|
|
|
return chfee;
|
|
|
|
return chfee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DBResult SaveDecHead(string BSNO,string userid) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecHeadBLL bll = new DecHeadBLL();
|
|
|
|
|
|
|
|
ContainerBLL cbll = new ContainerBLL();
|
|
|
|
|
|
|
|
DecListBLL lbll = new DecListBLL();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.OK("");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var 报关业务logic = BasicDataRefDAL.GetLogicInfo(BSNO, "关贸云报关");
|
|
|
|
|
|
|
|
var 报关业务json = 报关业务logic["JSONSTR"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var GMYHead = JsonConvert.Deserialize<GuanMaoYun_Head>(报关业务json);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var GMYHelper = new GMYInfoHelper(GMYHead);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 单一窗口信息
|
|
|
|
|
|
|
|
var dealtype_detail = "edit";
|
|
|
|
|
|
|
|
var DecHead_Local = bll.GetModelList("BSNO='" + BSNO + "'").FirstOrDefault();
|
|
|
|
|
|
|
|
if (DecHead_Local == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DecHead_Local = new DecHead();
|
|
|
|
|
|
|
|
dealtype_detail = "insert";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//BasicDataRefDAL.SaveLog(OPAPPLY, USERID, "单一窗口批量读取", "保存3");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dealtype_detail == "insert")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecHead_Local.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
DecHead_Local.BSNO = BSNO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理数据
|
|
|
|
|
|
|
|
GMYHelper.GetJsonData(ref DecHead_Local);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bll.Add(DecHead_Local);
|
|
|
|
|
|
|
|
//BasicDataRefDAL.SaveLog(OPAPPLY, USERID, "单一窗口批量读取", "保存4.1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//处理数据
|
|
|
|
|
|
|
|
GMYHelper.GetJsonData(ref DecHead_Local);
|
|
|
|
|
|
|
|
bll.Update(DecHead_Local);
|
|
|
|
|
|
|
|
//BasicDataRefDAL.SaveLog(OPAPPLY, USERID, "单一窗口批量读取", "保存4.2");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 货物信息 项信息
|
|
|
|
|
|
|
|
var declist_List = lbll.GetModelList(0, 99, "PID='" + DecHead_Local.GID + "'", String.Format("{0}", "gNo", ""));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GMYHead.GOODS_LIST.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in GMYHead.GOODS_LIST)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var GMYgoods = item.DECL_GOODS;
|
|
|
|
|
|
|
|
var upd = false;
|
|
|
|
|
|
|
|
foreach (var gooditem in declist_List)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (gooditem.GNo.Trim() == GMYgoods.GOODS_SEQ.Trim())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
upd = true;
|
|
|
|
|
|
|
|
var newrec = GMYHelper.GetJsonData_goods(gooditem, GMYgoods);
|
|
|
|
|
|
|
|
lbll.Update(newrec);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!upd)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//var updcontainer = new Container();
|
|
|
|
|
|
|
|
//updcontainer = portContainer.getContainerValue(updcontainer);
|
|
|
|
|
|
|
|
//updcontainer.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
//updcontainer.PID = DecHead_Local.GID;
|
|
|
|
|
|
|
|
//cbll.Add(updcontainer);
|
|
|
|
|
|
|
|
var newrec = new DecList();
|
|
|
|
|
|
|
|
newrec = GMYHelper.GetJsonData_goods(newrec, GMYgoods);
|
|
|
|
|
|
|
|
newrec.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
newrec.PID = DecHead_Local.GID;
|
|
|
|
|
|
|
|
lbll.Add(newrec);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var Declist = lbll.GetModelList(0, 99, "PID='" + DecHead_Local.GID + "'", String.Format("{0}", "gNo", ""));
|
|
|
|
|
|
|
|
//var count = lbll.GetRecordCount("PID='" + DecHead_Local.GID + "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 集装箱信息
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var containerlist = cbll.GetModelList("PID='" + DecHead_Local.GID + "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GMYHead.CONTA_LIST.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in GMYHead.CONTA_LIST)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var portContainer = item.DECL_CONTA;
|
|
|
|
|
|
|
|
var upd = false;
|
|
|
|
|
|
|
|
foreach (var container in containerlist)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (container.ContainerId.Trim() == portContainer.CONTA_NO.Trim())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
upd = true;
|
|
|
|
|
|
|
|
var newrec = GMYHelper.GetJsonData_ctn(container, portContainer);
|
|
|
|
|
|
|
|
cbll.Update(newrec);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!upd)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//var updcontainer = new Container();
|
|
|
|
|
|
|
|
//updcontainer = portContainer.getContainerValue(updcontainer);
|
|
|
|
|
|
|
|
//updcontainer.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
//updcontainer.PID = DecHead_Local.GID;
|
|
|
|
|
|
|
|
//cbll.Add(updcontainer);
|
|
|
|
|
|
|
|
var newrec = new Container();
|
|
|
|
|
|
|
|
newrec = GMYHelper.GetJsonData_ctn(newrec, portContainer);
|
|
|
|
|
|
|
|
newrec.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
newrec.PID = DecHead_Local.GID;
|
|
|
|
|
|
|
|
cbll.Add(newrec);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//BasicDataRefDAL.SaveLog(OPAPPLY, USERID, "单一窗口批量读取", "保存6");
|
|
|
|
|
|
|
|
containerlist = cbll.GetModelList("PID='" + DecHead_Local.GID + "'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 电子文档信息
|
|
|
|
|
|
|
|
var cdc = new CommonDataContext();
|
|
|
|
|
|
|
|
var olddocList = cdc.LicenseDocu.Where(x => x.PID == DecHead_Local.GID).ToList();
|
|
|
|
|
|
|
|
var needsave = false;
|
|
|
|
|
|
|
|
foreach (var GMYDoc in GMYHead.DOC_LIST)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Receipt_Doc receipt = receiptContext.ReceiptDocs.FirstOrDefault(o => o.BSNO == bsno && o.URL == pdf.filename);
|
|
|
|
|
|
|
|
var doc = olddocList.Find(x => x.DocuCode_Text == GMYDoc.DECL_DOC.DOC_NAME);
|
|
|
|
|
|
|
|
if (doc == null || doc.PID == "")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var newdoc = new LicenseDocu_md();
|
|
|
|
|
|
|
|
newdoc.GID= Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
newdoc.PID= DecHead_Local.GID;
|
|
|
|
|
|
|
|
newdoc.DocuCode = GMYDoc.DECL_DOC.DOC_TYPE;
|
|
|
|
|
|
|
|
newdoc.DocuCode_Text= GMYDoc.DECL_DOC.DOC_NAME;
|
|
|
|
|
|
|
|
newdoc.CertCode = GMYDoc.DECL_DOC.DOC_NO;
|
|
|
|
|
|
|
|
cdc.LicenseDocu.Add(newdoc);
|
|
|
|
|
|
|
|
needsave = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doc.DocuCode = GMYDoc.DECL_DOC.DOC_TYPE;
|
|
|
|
|
|
|
|
doc.DocuCode_Text = GMYDoc.DECL_DOC.DOC_NAME;
|
|
|
|
|
|
|
|
doc.CertCode = GMYDoc.DECL_DOC.DOC_NO;
|
|
|
|
|
|
|
|
cdc.LicenseDocu.AddOrUpdate(doc);
|
|
|
|
|
|
|
|
needsave = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(needsave)
|
|
|
|
|
|
|
|
cdc.SaveChanges();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch(Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.SetErrorInfo(e.Message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class GMYInfoHelper {
|
|
|
|
|
|
|
|
public GuanMaoYun_Head GMYHead { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GMYInfoHelper() { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private EnumerableRowCollection<DataRow> emlistQuery { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GMYInfoHelper(GuanMaoYun_Head _GMYHead) {
|
|
|
|
|
|
|
|
GMYHead=_GMYHead;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys_EnumerationBLL bllEM = new sys_EnumerationBLL();
|
|
|
|
|
|
|
|
var emlistdataset = bllEM.GetList("");
|
|
|
|
|
|
|
|
var emlisttable = emlistdataset.Tables[0];
|
|
|
|
|
|
|
|
emlistQuery =
|
|
|
|
|
|
|
|
from emlist in emlisttable.AsEnumerable()
|
|
|
|
|
|
|
|
select emlist;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string 征免方式 { get; set; }
|
|
|
|
|
|
|
|
public void GetJsonData(ref DecHead dh)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var head = GMYHead.DECL_HEAD;
|
|
|
|
|
|
|
|
dh.EntryId = head.CUSTOMS_NO;//报关单海关编号 单一窗口编辑页:海关编号
|
|
|
|
|
|
|
|
dh.SeqNo = head.EPROT_NO;
|
|
|
|
|
|
|
|
dh.EntryType = head.DECL_TYPE;//---"DECL_TYPE": "报关单类型", 目前未处理 改为写入 单一窗口编辑页:报关单类型 dechead.EntryType
|
|
|
|
|
|
|
|
dh.IEDateStr = head.DECL_DATE == null ? "" : head.DECL_DATE.ToString("yyyy-MM-dd");//---IE_DATE 进出口日期, 目前未处理 改为写入 单一窗口编辑页:进(出)口日期 dechead.IEDateStr
|
|
|
|
|
|
|
|
dh.CustomMaster = head.DECL_PORT;//---"DECL_PORT": "申报口岸",目前未处理 改为写入 单一窗口编辑页:申报地海关 dechead.CustomMaster 同时需处理dechead.CustomMaster_Text
|
|
|
|
|
|
|
|
dh.CustomMaster_Text = GetTextByCode(emlistQuery, "关区代码", dh.CustomMaster);
|
|
|
|
|
|
|
|
dh.IEPort = head.IE_PORT;//---"IE_PORT": "进出口岸",目前未处理 改为写入 单一窗口编辑页:出(入)境关别 dechead.IEPort 同时需处理dechead.IEPort_Text
|
|
|
|
|
|
|
|
dh.IEPort_Text = GetTextByCode(emlistQuery, "关区代码", dh.IEPort);
|
|
|
|
|
|
|
|
dh.ManualNo = head.HAND_BOOK_NO;//---"HAND_BOOK_NO": "手册备案号",目前未处理 改为写入 报关业务编辑页:手册号 ,同时写入 单一窗口编辑页:备案号 dechead.ManualNo
|
|
|
|
|
|
|
|
dh.ContrNo = head.CONTR_NO;//---"CONTR_NO": "合同协议号",目前已写入 报关业务编辑页:合同号 ,同时写入 单一窗口编辑页:合同协议号 dechead.ContrNo
|
|
|
|
|
|
|
|
dh.TradeCode = head.SHIP_CODE;//---"SHIP_CODE": "收发货单位代码",目前未处理 改为写入 单一窗口编辑页:境内收发货人10位海关编码
|
|
|
|
|
|
|
|
dh.TradeName = head.SHIP_NAME;//---"SHIP_NAME": "收发货单位名称",目前未处理 改为写入 单一窗口编辑页:境内收发货人
|
|
|
|
|
|
|
|
dh.OverseasConsigneeCode = head.FC_CODE;//---"FC_CODE": "外商公司代码",目前未处理 改为写入 单一窗口编辑页:境外收发货人
|
|
|
|
|
|
|
|
dh.OverseasConsigneeEname = head.FC_NAME; //---"FC_NAME": "外商公司名称",目前未处理 改为写入 单一窗口编辑页: 境外收发货人企业名称
|
|
|
|
|
|
|
|
dh.AgentCode = head.DECL_COM_CODE; //---"DECL_COM_CODE": "申报单位代码",目前未处理 改为写入 单一窗口编辑页: 申报单位10位海关代码
|
|
|
|
|
|
|
|
dh.AgentName = head.DECL_COM_NAME; //---"DECL_COM_NAME": "申报单位名称",目前未处理 改为写入 单一窗口编辑页:申报单位企业名称
|
|
|
|
|
|
|
|
dh.TrafMode = head.TRANS_TYPE_CODE;//---"TRANS_TYPE_CODE": "运输方式代码",目前未处理 改为写入 单一窗口编辑页:运输方式
|
|
|
|
|
|
|
|
dh.TrafMode_Text = GetTextByCode(emlistQuery, "运输方式", dh.TrafMode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.TrafName = head.TRANS_TOOL_NAME; //---"TRANS_TOOL_NAME": "运输工具名称",目前已写入 报关业务编辑页:船名
|
|
|
|
|
|
|
|
dh.NativeVoyageNo = head.VOYAGE_NO;//--- "VOYAGE_NO": "航次号",目前已写入 报关业务编辑页:航次号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.BillNo = head.CONSIGN_REMARK;//---"CONSIGN_REMARK": "委托备注" 本来计划将此字段写入主提单号,但目前做例子的报文中没有此字段
|
|
|
|
|
|
|
|
dh.TradeCountry = head.COUNTRY_CODE_EN;//---"COUNTRY_CODE_EN": "启运国、运抵国",目前已写入 报关业务编辑页:货源国别 计划同时写入 单一窗口编辑页:运抵国(启运国)
|
|
|
|
|
|
|
|
dh.DistinatePort = head.DEST_PORT_CODE_EN;//---"DEST_PORT_CODE_EN": "装货港、指运港",目前未处理 改为写入 单一窗口编辑页:抵运港(启运港)
|
|
|
|
|
|
|
|
dh.TradeMode = head.TRANS_TYPE_CODE;//---"TRADE_TYPE_CODE": "贸易方式(监管方式)",目前未处理 改为写入 单一窗口编辑页:监管方式
|
|
|
|
|
|
|
|
dh.CutMode = head.TAX_KINDS_CODE;//---"TAX_KINDS_CODE": "征免性质",目前未处理 改为写入 单一窗口编辑页:征免性质
|
|
|
|
|
|
|
|
征免方式 = head.TAX_TYPE_CODE;//---"TAX_TYPE_CODE": "征免方式",目前未处理 改为写入 单一窗口编辑页-下方商品信息:征免方式
|
|
|
|
|
|
|
|
dh.TransMode= head.TRADE_TERMS_CODE;//---"TRADE_TERMS_CODE": "成交方式",目前未处理 改为写入 单一窗口编辑页:成交方式
|
|
|
|
|
|
|
|
dh.LicenseNo = head.LICENCE_NO;//---"LICENCE_NO": "许可证号",目前未处理 改为写入 单一窗口编辑页:许可证号
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.FeeMark= head.FEE_MARK;//---"FEE_MARK": "运费标记",目前未处理 改为写入 单一窗口编辑页:运费
|
|
|
|
|
|
|
|
dh.FeeRate = BasicDataRefDAL.String2Decimal( head.FEE_RATE );
|
|
|
|
|
|
|
|
dh.FeeCurr= head.FEE_CURR;
|
|
|
|
|
|
|
|
dh.FeeCurr_Text= GetTextByCode(emlistQuery, "币别", dh.FeeCurr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.InsurMark = head.INSUR_MARK; //---"INSUR_MARK": "保费标记",目前未处理 改为写入 单一窗口编辑页:保费
|
|
|
|
|
|
|
|
dh.InsurRate = BasicDataRefDAL.String2Decimal(head.INSUR_RATE);
|
|
|
|
|
|
|
|
dh.InsurCurr = head.INSUR_CURR;
|
|
|
|
|
|
|
|
dh.InsurCurr_Text = GetTextByCode(emlistQuery, "币别", dh.InsurCurr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.OtherMark = head.ADDIT_EXPEN_MARK; //---"ADDIT_EXPEN_MARK": "杂费标记","ADDIT_EXPEN_CURR_EN": "杂费币制",目前未处理 改为写入 单一窗口编辑页:杂费
|
|
|
|
|
|
|
|
dh.OtherRate = BasicDataRefDAL.String2Decimal(head.ADDIT_EXPEN_RATE);
|
|
|
|
|
|
|
|
dh.OtherCurr = head.ADDIT_EXPEN_CURR;
|
|
|
|
|
|
|
|
dh.OtherCurr_Text = GetTextByCode(emlistQuery, "币别", dh.OtherCurr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.WrapType = head.PACKAGE_TYPE_CODE_EN;//---"PACKAGE_TYPE_CODE_EN": "包装种类",目前未处理 改为写入 单一窗口编辑页:包装
|
|
|
|
|
|
|
|
dh.WrapType_Text = GetTextByCode(emlistQuery, "包装种类", dh.WrapType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.PackNo = BasicDataRefDAL.String2Int32(head.TOTAL_PACKEGES );
|
|
|
|
|
|
|
|
dh.GrossWet = BasicDataRefDAL.String2Decimal(head.TOTAL_GROSS_WEIGHT);
|
|
|
|
|
|
|
|
dh.NetWt = BasicDataRefDAL.String2Decimal(head.TOTAL_NET_WEIGHT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.AgentCodeScc = head.DECL_CREDIT_CODE;//--- "DECL_CREDIT_CODE": "申报单位信用代码",目前未处理 改为写入 单一窗口编辑页:申报单位18位社会信用代码
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.TradeAreaCode = head.TRADE_COUNTRY_CODE_EN;//---"TRADE_COUNTRY_CODE_EN": "贸易国别",目前未处理 改为写入 单一窗口编辑页:贸易国别(地区)
|
|
|
|
|
|
|
|
dh.TradeAreaCode_Text= GetTextByCode(emlistQuery, "国别地区", dh.TradeAreaCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.TradeCiqCode = head.EXPORT_ECIQ_CODE;//-- - "EXPORT_ECIQ_CODE": "境内收/发货人检疫代码",目前未处理 改为写入 单一窗口编辑页: 境内收发货人10位检验检疫编码
|
|
|
|
|
|
|
|
dh.OwnerCiqCode = head.SHIP_ECIQ_CODE;//---"SHIP_ECIQ_CODE": "消费使用单位/生产销售单位检疫代码",目前未处理 改为写入 单一窗口编辑页: 生产销售单位10位检验检疫编码
|
|
|
|
|
|
|
|
dh.DespPortCode = head.CIQ_ENTY_PORT_CODE;//---"CIQ_ENTY_PORT_CODE": "入境口岸/离境口岸",目前未处理 改为写入 单一窗口编辑页:离境口岸/入境口岸
|
|
|
|
|
|
|
|
dh.DespPortCode_Text = GetTextByCode(emlistQuery, "口岸代码", dh.DespPortCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.MarkNo = head.MARKS_NOS;//---"MARKS_NOS": "标记唛码",目前未处理 改为写入 单一窗口编辑页:标记唛码
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dh.GoodsPlace = head.GOODS_PLACE;//---"GOODS_PLACE": "货物存放地点",目前未处理 改为写入 单一窗口编辑页:货物存放地点
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DecList GetJsonData_goods(DecList oldrec, DECL_GOODS DECL_GOODS)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = oldrec;
|
|
|
|
|
|
|
|
result.GNo = DECL_GOODS.GOODS_SEQ;//---"GOODS_SEQ": "商品序号",目前写入 报关业务编辑页-商品明细:序号
|
|
|
|
|
|
|
|
result.ContrItem = DECL_GOODS.GOODS_ITEM;//---"GOODS_ITEM": "备案序号",目前未处理 改为写入 单一窗口编辑页-商品明细:备案序号
|
|
|
|
|
|
|
|
result.CodeTS = DECL_GOODS.HSCODE_TS;//---"HSCODE_TS": "商品编码",目前未处理 改为写入 单一窗口编辑页-商品明细:商品编号
|
|
|
|
|
|
|
|
result.GName = DECL_GOODS.GOODS_NAME;//---"GOODS_NAME": "商品名称",目前写入 报关业务编辑页-商品明细:序号;计划增加写入 单一窗口编辑页-商品明细:商品名称
|
|
|
|
|
|
|
|
result.GModel = DECL_GOODS.GOODS_MODEL;//---"GOODS_MODEL": "规格型号(申报要素)",目前写入 报关业务编辑页-商品明细:型号品牌;计划增加写入 单一窗口编辑页-商品明细:规格型号
|
|
|
|
|
|
|
|
result.GQty = BasicDataRefDAL.String2Decimal(DECL_GOODS.QTY);//---"QTY": "成交数量",目前未处理 改为写入 单一窗口编辑页-商品明细:成交数量 报关业务编辑页-商品明细:规格件数、报关件数
|
|
|
|
|
|
|
|
result.GUnit = DECL_GOODS.UNIT;//---"UNIT": "成交单位",目前未处理 改为写入 单一窗口编辑页-商品明细:成交单位
|
|
|
|
|
|
|
|
result.GUnit_Text = GetTextByCode(emlistQuery, "成交计量单位", result.GUnit);
|
|
|
|
|
|
|
|
result.DeclPrice = BasicDataRefDAL.String2Decimal(DECL_GOODS.PRICE);//---"PRICE": "成交单价",目前写入 报关业务编辑页-商品明细:单价;计划增加写入 单一窗口编辑页-商品明细:成交单价
|
|
|
|
|
|
|
|
result.DeclTotal = BasicDataRefDAL.String2Decimal(DECL_GOODS.AMOUNT);//---"AMOUNT": "成交总价",目前写入 报关业务编辑页-商品明细:总价;计划增加写入 单一窗口编辑页-商品明细:总价
|
|
|
|
|
|
|
|
result.DestinationCountry = DECL_GOODS.DESTINATION_CODE;
|
|
|
|
|
|
|
|
result.DutyMode = DECL_GOODS.TAX_TYPE;//---"TAX_TYPE": "征免方式代码",目前未处理 改为写入 单一窗口编辑页-商品明细:征免方式
|
|
|
|
|
|
|
|
result.DutyMode_Text = GetTextByCode(emlistQuery, "征免方式", result.DutyMode);
|
|
|
|
|
|
|
|
result.OriginCountry = DECL_GOODS.COUNTRY_OF_ORIGIN_CODE;//---"COUNTRY_OF_ORIGIN_CODE_EN": "消费国/原产国",目前未处理 改为写入 单一窗口编辑页-商品明细:原产国(地区)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Container GetJsonData_ctn(Container oldrec, DECL_CONTA DECL_CONTA)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = oldrec;
|
|
|
|
|
|
|
|
result.ContainerId = DECL_CONTA.CONTA_NO;// ---"CONTA_NO": "集装箱编号",目前未处理 改为写入 单一窗口编辑页-集装箱明细:集装箱号
|
|
|
|
|
|
|
|
result.ContainerMd = DECL_CONTA.CUS_CONTA_TYPE;// ---"CUS_CONTA_TYPE": "集装箱规格",目前未处理 不做处理 改为记入【集装箱规格】
|
|
|
|
|
|
|
|
result.ContainerMd_Text= GetTextByCode(emlistQuery, "集装箱规格", result.ContainerMd);
|
|
|
|
|
|
|
|
result.ContainerWt = BasicDataRefDAL.String2Decimal(DECL_CONTA.CONTA_GROSS_WEIGHT);//---"CONTA_GROSS_WEIGHT": "集装箱自重", 目前未处理 改为写入 单一窗口编辑页-集装箱明细:自重(KG)
|
|
|
|
|
|
|
|
result.LclFlag = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetTextByCode(EnumerableRowCollection<DataRow> emlistQuery, string emtype, string emcode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = "";
|
|
|
|
|
|
|
|
var emlists =
|
|
|
|
|
|
|
|
emlistQuery.Where(p => p.Field<string>("type") == emtype && p.Field<string>("Value") == emcode);
|
|
|
|
|
|
|
|
foreach (DataRow em in emlists)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = em.Field<string>("Name");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|