diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpApplyController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpApplyController.cs index ec4036ad..1680a5fb 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpApplyController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpApplyController.cs @@ -31,6 +31,8 @@ using DSWeb.MvcShipping.DAL.MsCodeOpTemplate; using DSWeb.MvcShipping.DAL.MsChFeeDAL; using DSWeb.Areas.MvcShipping.Models.Message.VGM; using DSWeb.Common.DB; +using DSWeb.Areas.MvcShipping.Helper; +using DSWeb.SoftMng.BLL; namespace DSWeb.MvcShipping.Controllers { @@ -167,6 +169,43 @@ namespace DSWeb.MvcShipping.Controllers return new ContentResult() { Content = json }; } + private readonly DecListBLL lbll = new DecListBLL(); + private readonly DecHeadBLL hbll = new DecHeadBLL(); + public ContentResult GetOpseaiData(string handle, string condition) + { + + MsOpApply_Opseai head = null; + + if (handle == "edit") + { + head = AutoMapperHelper.MapTo( MsOpApplyDAL.GetData(condition)); + + var decheadList = hbll.GetModelList(" BSNO='" + head.BSNO + "'"); + if (decheadList != null && decheadList.Count > 0) { + var dechead = decheadList[0]; + var Declist = lbll.GetModelList(0, 99, "PID='" + dechead.GID + "'", String.Format("{0}", "gNo", "")); + + head.商品名称 = Declist[0].GName; + head.单价 = Declist[0].DeclPrice.ToString(); + } + } + + if (head == null) + { + head = new MsOpApply_Opseai(); + head.OP = Convert.ToString(Session["SHOWNAME"]); + head.BSTYPE = "2"; + head.ETPS_CATEGORY = "A"; + head.CDNTYPE = 0; + } + + + var json = JsonConvert.Serialize( + new { Success = true, Message = "查询成功", data = head }); + return new ContentResult() { Content = json }; + } + + public ContentResult GetCopyData(string handle, string condition, string copyfee = "false") { MsOpApply head = null; diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpApply/MsOpApplyDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpApply/MsOpApplyDAL.cs index 6fa49e7c..78e07043 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpApply/MsOpApplyDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpApply/MsOpApplyDAL.cs @@ -82,6 +82,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpApplyDAL strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WITH (NOLOCK) WHERE BSNO=OP_APPLY.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS"); strSql.Append(",ETPS_CATEGORY,CDNTYPE,CUSTSERVICE,OPERATORCODE"); + strSql.Append(",(select top 1 AgentStatus from decHead where decHead.BSNO=OP_APPLY.BSNO) AgentStatus"); + strSql.Append(" from OP_APPLY "); strSql.Append(" LEFT JOIN v_op_gain_dr_INV I ON (I.BSNO=OP_APPLY.BSNO) "); @@ -221,6 +223,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpApplyDAL strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WITH (NOLOCK) WHERE BSNO=OP_APPLY.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS"); strSql.Append(",ETPS_CATEGORY,CDNTYPE,CUSTSERVICE,OPERATORCODE"); + strSql.Append(",(select top 1 AgentStatus from decHead where decHead.BSNO=OP_APPLY.BSNO) AgentStatus"); + + strSql.Append(" from OP_APPLY "); if (!string.IsNullOrEmpty(condition)) @@ -434,6 +439,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpApplyDAL if(reader["CDNTYPE"] != DBNull.Value) data.CDNTYPE = Convert.ToInt32(reader["CDNTYPE"]);// data.OPERATORCODE = Convert.ToString(reader["OPERATORCODE"]);// + data.AgentStatus = Convert.ToString(reader["AgentStatus"]);// #endregion headList.Add(data); diff --git a/DSWeb/Areas/MvcShipping/Models/MsOpApply/MsOpApply.cs b/DSWeb/Areas/MvcShipping/Models/MsOpApply/MsOpApply.cs index 9db7be8a..9c28a61a 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsOpApply/MsOpApply.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsOpApply/MsOpApply.cs @@ -1034,6 +1034,12 @@ namespace DSWeb.MvcShipping.Models.MsOpApply } #endregion + + #region 附加字段 + + public string AgentStatus { get; set; } = ""; + + #endregion public MsOpApply() { TableName = "op_apply"; @@ -1270,4 +1276,11 @@ namespace DSWeb.MvcShipping.Models.MsOpApply } #endregion } + + [JsonObject] + public class MsOpApply_Opseai : MsOpApply { + public string 商品名称 { get; set; } + public string 单价 { get; set; } + + } } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js index 3a6927ca..d3065032 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyIndex.js @@ -1011,6 +1011,28 @@ Ext.extend(Shipping.MsOpApplyIndex, Ext.Panel, { header: '报关单类型', hidden: true, width: 100 + }, { + sortable: true, + dataIndex: 'AgentStatus', + header: '单一窗口业务状态', + width: 120, + renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { + try { + + if (value == "查验通知") { + + return '查验通知'; + + } + else { + return value; + } + } + catch (e) { + return value; + } + return value; + } } ]; diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyModel.js index fa31cee6..2fe14027 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpApply/MsOpApplyModel.js @@ -2,13 +2,13 @@ extend: 'Ext.data.Model', idProperty: 'BSNO', fields: [ - { name: 'BSNO', type: 'string' }, - { name: 'BSSTATUS', type: 'boolean' }, - { name: 'FEESTATUS', type: 'boolean' }, - { name: 'BSSTATUSREF', type: 'string' }, - { name: 'FEESTATUSREF', type: 'string' }, - { name: 'DRFEESTATUS', type: 'string' }, - { name: 'CRFEESTATUS', type: 'string' }, + { name: 'BSNO', type: 'string' }, + { name: 'BSSTATUS', type: 'boolean' }, + { name: 'FEESTATUS', type: 'boolean' }, + { name: 'BSSTATUSREF', type: 'string' }, + { name: 'FEESTATUSREF', type: 'string' }, + { name: 'DRFEESTATUS', type: 'string' }, + { name: 'CRFEESTATUS', type: 'string' }, { name: 'DRINVSTATUS', type: 'string' }, { name: 'DRDUISTATUS', type: 'string' }, { name: 'CRINVSTATUS', type: 'string' }, @@ -130,8 +130,8 @@ { name: 'PREMIUMCURRENCY', type: 'string' },//易航线_保费币制,当premiumType是[率]时,不能填保费币制 { name: 'BillFeeStatus', type: 'string' }, { name: 'ETPS_CATEGORY', type: 'string' },//报关企业类别 用于保存 ACD - { name: 'CDNTYPE', type: 'decimal' }//报关单类型 0-4共5种 - + { name: 'CDNTYPE', type: 'decimal' },//报关单类型 0-4共5种 + { name: 'AgentStatus', type: 'string' } ] }); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js index 5fead958..aa3be588 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js @@ -4786,7 +4786,7 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, { var MBLNO = this.formHead.getForm().findField('MBLNO').getValue(); Ext.Ajax.request({ waitMsg: '正在查询主表数据...', - url: '/MvcShipping/MsOpApply/GetData', + url: '/MvcShipping/MsOpApply/GetOpseaiData', params: { handle: 'edit', condition: "MBLNO='" + MBLNO + "'" @@ -4852,7 +4852,12 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, { this.formEdit.getForm().findField('INSPECTIONNO').setValue(data.INSPECTIONNO); if (data.INSPECTIONDATE != '' && data.INSPECTIONDATE != null) this.formEdit.getForm().findField('INSPECTIONDATE').setValue(data.INSPECTIONDATE); - + + if (data.商品名称 != '' && data.商品名称 != null) + this.formEdit.getForm().findField('GOODSNAME').setValue(data.商品名称); + if (data.单价 != '' && data.单价 != null) + this.formEdit.getForm().findField('UNITPRICE').setValue(data.单价); + } diff --git a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs index 873319bb..5d0a7d25 100644 --- a/DSWeb/Areas/SoftMng/Controllers/ExportController.cs +++ b/DSWeb/Areas/SoftMng/Controllers/ExportController.cs @@ -2767,37 +2767,39 @@ namespace DSWeb.SoftMng.Controllers if (withdoc) { - JObject reqObj = new JObject(); - /*网站代号(sw) - 卡号 - 密码(md5加密后) - 报关单号 - 进出口标志(只有两个值) I(大写i): 进口, E: 出口 - 是否结关(只有两个值) 1:是,0:否 - string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" - */ + JObject reqObj = new JObject + { + /*网站代号(sw) +卡号 +密码(md5加密后) +报关单号 +进出口标志(只有两个值) I(大写i): 进口, E: 出口 +是否结关(只有两个值) 1:是,0:否 +string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" +*/ - reqObj.Add("yardid", yardid); - reqObj.Add("swcn", swcn); - reqObj.Add("swpw", swpw); - reqObj.Add("cdn", CUSTOMNO); - reqObj.Add("billno", MBLNO); - reqObj.Add("unicode", unicode); + { "yardid", yardid }, + { "swcn", swcn }, + { "swpw", swpw }, + { "cdn", CUSTOMNO }, + { "billno", MBLNO }, + { "unicode", unicode }, - reqObj.Add("ies", ies); + { "ies", ies }, - reqObj.Add("clearance", clearance);//未结关 + { "clearance", clearance },//未结关 - reqObj.Add("cdnType", cdntype);//单据类型 + { "cdnType", cdntype },//单据类型 - reqObj.Add("starttime", starttime);// + { "starttime", starttime },// - reqObj.Add("endtime", endtime);// + { "endtime", endtime },// + + { "etps_category", etps_category }// + }; - reqObj.Add("etps_category", etps_category);// - //reqObj.Add("billno", "KMTCSIN2287541"); //reqObj.Add("ies", "I"); @@ -2811,34 +2813,36 @@ namespace DSWeb.SoftMng.Controllers } if (!withdoc) { - JObject reqObj = new JObject(); - /*网站代号(sw) - 卡号 - 密码(md5加密后) - 报关单号 - 进出口标志(只有两个值) I(大写i): 进口, E: 出口 - 是否结关(只有两个值) 1:是,0:否 - string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" - */ + JObject reqObj = new JObject + { + /*网站代号(sw) + 卡号 + 密码(md5加密后) + 报关单号 + 进出口标志(只有两个值) I(大写i): 进口, E: 出口 + 是否结关(只有两个值) 1:是,0:否 + string swcn = "2020030084935", string swpw = "8a5889ea8e53b257e2a3ba053979ee64" + */ - reqObj.Add("card", swcn); - reqObj.Add("pwd", swpw); - reqObj.Add("ies", ies); - reqObj.Add("clear", clearance);//未结关 + { "card", swcn }, + { "pwd", swpw }, + { "ies", ies }, + { "clear", clearance },//未结关 - reqObj.Add("cdnType", cdntype);//单据类型 + { "cdnType", cdntype },//单据类型 - reqObj.Add("cdn", CUSTOMNO); - reqObj.Add("bill", MBLNO); - reqObj.Add("unicode", unicode); + { "cdn", CUSTOMNO }, + { "bill", MBLNO }, + { "unicode", unicode }, - reqObj.Add("start", starttime);// + { "start", starttime },// - reqObj.Add("end", endtime);// + { "end", endtime },// - reqObj.Add("startNumber", "0");// - reqObj.Add("endNumber", "1");// - reqObj.Add("etps_category", etps_category);// + { "startNumber", "0" },// + { "endNumber", "1" },// + { "etps_category", etps_category }// + }; reqObj.ToString(Newtonsoft.Json.Formatting.None); @@ -3048,13 +3052,54 @@ namespace DSWeb.SoftMng.Controllers //} - if (updateseai) { + + opapplyhead.VESSEL = preDecHeadVo.trafName; + opapplyhead.VOYNO = preDecHeadVo.cusVoyageNo; + opapplyhead.PORTDISCHARGE = preDecHeadVo.distinatePortName; + if (string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) + opapplyhead.ENTERP = preDecHeadVo.consigneeCname; + if (string.IsNullOrEmpty(opapplyhead.MBLNO.Trim())) + opapplyhead.MBLNO = preDecHeadVo.billNo; + if (string.IsNullOrEmpty(opapplyhead.CUSTOMNO.Trim())) + opapplyhead.CUSTOMNO = preDecHeadVo.entryId; + //opseaihead.GOODSNAME + opapplyhead.PKGS = Convert.ToInt32(preDecHeadVo.packNo); + opapplyhead.KGS = Convert.ToDecimal(preDecHeadVo.grossWt); + opapplyhead.NETWEIGHT = Convert.ToDecimal(preDecHeadVo.netWt); + opapplyhead.CONTRACTNO = DecHead_Local.ContrNo; + if (!string.IsNullOrWhiteSpace(preDecHeadVo.transMode)) + opapplyhead.TRADETERM = preDecHeadVo.transMode; + + + if (opapplyhead.ENTERP == null || string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) + opapplyhead.ENTERP = DecHead_Local.TradeName; + + if (!string.IsNullOrWhiteSpace(preDecHeadVo.iEDate)) { + if (ies == "E") { + if (string.IsNullOrWhiteSpace(opapplyhead.ETD)) { + opapplyhead.ETD= DateTime.ParseExact(preDecHeadVo.iEDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture).ToString("yyyy-MM-dd"); + } + + } + if (ies == "I") + { + if (string.IsNullOrWhiteSpace(opapplyhead.ETA)) + { + opapplyhead.ETA = DateTime.ParseExact(preDecHeadVo.iEDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture).ToString("yyyy-MM-dd"); + } + } + } + + + + if (updateseai) + { if (!string.IsNullOrWhiteSpace(preDecHeadVo.trafName)) - opseaihead.VESSEL = preDecHeadVo.trafName; + opseaihead.VESSEL = preDecHeadVo.trafName; if (!string.IsNullOrWhiteSpace(preDecHeadVo.cusVoyageNo)) opseaihead.VOYNO = preDecHeadVo.cusVoyageNo; if (!string.IsNullOrWhiteSpace(preDecHeadVo.iEDate)) - opseaihead.ETD = DateTime.ParseExact(preDecHeadVo.iEDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture).ToString("yyyy-MM-dd") ; + opseaihead.ETD = DateTime.ParseExact(preDecHeadVo.iEDate, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture).ToString("yyyy-MM-dd"); if (!string.IsNullOrWhiteSpace(preDecHeadVo.distinatePortName)) opseaihead.PORTLOAD = preDecHeadVo.distinatePortName; if (!string.IsNullOrWhiteSpace(preDecHeadVo.customMasterName)) @@ -3070,42 +3115,23 @@ namespace DSWeb.SoftMng.Controllers if (!string.IsNullOrWhiteSpace(preDecHeadVo.entryId)) opseaihead.CUSTOMNO = preDecHeadVo.entryId; //opseaihead.GOODSNAME - if (!string.IsNullOrWhiteSpace(preDecHeadVo.packNo )) + if (!string.IsNullOrWhiteSpace(preDecHeadVo.packNo)) opseaihead.PKGS = Convert.ToInt32(preDecHeadVo.packNo); if (!string.IsNullOrWhiteSpace(preDecHeadVo.wrapTypeName)) opseaihead.KINDPKGS = preDecHeadVo.wrapTypeName; if (!string.IsNullOrWhiteSpace(preDecHeadVo.grossWt)) opseaihead.KGS = Convert.ToDecimal(preDecHeadVo.grossWt); - if (!string.IsNullOrWhiteSpace(preDecHeadVo.netWt )) + if (!string.IsNullOrWhiteSpace(preDecHeadVo.netWt)) opseaihead.NETWEIGHT = Convert.ToDecimal(preDecHeadVo.netWt); if (!string.IsNullOrWhiteSpace(preDecHeadVo.transMode)) opseaihead.TRADETERM = preDecHeadVo.transMode; if (!string.IsNullOrWhiteSpace(preDecHeadVo.dDate)) opseaihead.UPDATETIME = preDecHeadVo.dDate; - - //opseaihead.CUSTOMDATE= + } - opapplyhead.VESSEL = preDecHeadVo.trafName; - opapplyhead.VOYNO = preDecHeadVo.cusVoyageNo; - opapplyhead.PORTDISCHARGE = preDecHeadVo.distinatePortName; - if (string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) - opapplyhead.ENTERP = preDecHeadVo.consigneeCname; - if (string.IsNullOrEmpty(opapplyhead.MBLNO.Trim())) - opapplyhead.MBLNO = preDecHeadVo.billNo; - if (string.IsNullOrEmpty(opapplyhead.CUSTOMNO.Trim())) - opapplyhead.CUSTOMNO = preDecHeadVo.entryId; - //opseaihead.GOODSNAME - opapplyhead.PKGS = Convert.ToInt32(preDecHeadVo.packNo); - opapplyhead.KGS = Convert.ToDecimal(preDecHeadVo.grossWt); - opapplyhead.NETWEIGHT = Convert.ToDecimal(preDecHeadVo.netWt); - opapplyhead.CONTRACTNO = DecHead_Local.ContrNo; - - if (opapplyhead.ENTERP == null || string.IsNullOrEmpty(opapplyhead.ENTERP.Trim())) - opapplyhead.ENTERP = DecHead_Local.TradeName; - //opapplyhead.RelId if (trueinfo) @@ -3296,6 +3322,8 @@ namespace DSWeb.SoftMng.Controllers } + opapplyhead.CARGOVALUE = goodsvalue.ToString(); + if (updateseai) { opseaihead.IMPORTVALUE = goodsvalue; diff --git a/DSWeb/Areas/SoftMng/Model/DecHead.cs b/DSWeb/Areas/SoftMng/Model/DecHead.cs index 6dadf04d..6a2491a7 100644 --- a/DSWeb/Areas/SoftMng/Model/DecHead.cs +++ b/DSWeb/Areas/SoftMng/Model/DecHead.cs @@ -2555,7 +2555,7 @@ namespace DSWeb.SoftMng.Model{ DecList.CodeTS = codeTs; DecList.CiqCode = ciqCode; DecList.CiqCode_Text = ciqName; - DecList.GName = gName; + DecList.GName = gName;//商品名称 DecList.GModel = gModel; DecList.GQty = Convert.ToDecimal( gQty); DecList.GUnit = gUnit; @@ -2673,13 +2673,13 @@ namespace DSWeb.SoftMng.Model{ DecHead.TradeCode = !string.IsNullOrWhiteSpace(cnsnTradeCode) ? cnsnTradeCode : rcvgdTradeCode; //10位检验检疫编码 //DecHead.TradeCiqCode = !string.IsNullOrWhiteSpace(consignorCode) ? consignorCode:consigneeCode; - DecHead.TradeCiqCode = !string.IsNullOrWhiteSpace(consigneeCode) ? consigneeCode : consignorCode; + DecHead.TradeCiqCode = !string.IsNullOrWhiteSpace(consignorCode) ? consignorCode : consignorCode; //企业名称(中文) DecHead.TradeName = !string.IsNullOrWhiteSpace(consignorCname)? consignorCname:consigneeCname; //境外收发货人 consigneeCode?? //DecHead.OverseasConsigneeCode = !string.IsNullOrWhiteSpace(consigneeCode)? consigneeCode: consignorCode; - DecHead.OverseasConsigneeCode = !string.IsNullOrWhiteSpace(consignorCode) ? consignorCode : consigneeCode; + DecHead.OverseasConsigneeCode = !string.IsNullOrWhiteSpace(consigneeCode) ? consigneeCode : consigneeCode; //企业名称(外文) DecHead.OverseasConsigneeEname = !string.IsNullOrWhiteSpace(consigneeEname)? consigneeEname:consignorEname;