vgm接口直发增加对接口支持的船公司范围的支持

DS7_JinGang
ddlucky 2 years ago
parent bd1d0b5e92
commit 5f144a4ae9

@ -1630,4 +1630,18 @@ namespace DSWeb.Common.DB
} }
[Table("code_cust_edi")]
public partial class code_cust_edi_md
{
[Key]
public string GID { get; set; }
public string CUST { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
} }

@ -63,7 +63,7 @@ namespace DSWeb.Common.DB
public DbSet<op_status_md> op_status { get; set; } public DbSet<op_status_md> op_status { get; set; }
public DbSet<code_cust_edi_md> code_cust_edi { get; set; }
} }

@ -639,7 +639,6 @@ namespace DSWeb.Areas.CommMng.DAL
PropNameList = new Dictionary<string, string> PropNameList = new Dictionary<string, string>
{ {
{ "委托公司", "CUSTOMERNAME" }, { "委托公司", "CUSTOMERNAME" },
{ "联系人", "ATTN" }, { "联系人", "ATTN" },
{ "电话", "ATTNTEL" }, { "电话", "ATTNTEL" },
@ -679,6 +678,8 @@ namespace DSWeb.Areas.CommMng.DAL
{ "HSCODE", "HSCODE" } { "HSCODE", "HSCODE" }
}; };
var oldCustomerName= headdata.CUSTOMERNAME;
foreach (var item in PropNameList) foreach (var item in PropNameList)
{ {
//var value = _result.GetType().GetProperty("发货人").GetValue(_result, null); //var value = _result.GetType().GetProperty("发货人").GetValue(_result, null);
@ -710,6 +711,10 @@ namespace DSWeb.Areas.CommMng.DAL
if (_tempinfoclient == null || string.IsNullOrWhiteSpace(_tempinfoclient.SHORTNAME)) if (_tempinfoclient == null || string.IsNullOrWhiteSpace(_tempinfoclient.SHORTNAME))
{ {
//headdata.CUSTOMERNAME = "";
headdata.CUSTOMERNAME = oldCustomerName;
}
else {
headdata.CUSTOMERNAME = _tempinfoclient.SHORTNAME; headdata.CUSTOMERNAME = _tempinfoclient.SHORTNAME;
} }
} }
@ -1177,7 +1182,10 @@ namespace DSWeb.Areas.CommMng.DAL
//String secretUserid = rsa.encrypt(null, userid, null, "utf-8", spk, false); //String secretUserid = rsa.encrypt(null, userid, null, "utf-8", spk, false);
//heads.put("userid", secretUserid); //heads.put("userid", secretUserid);
//userid将会填在user.wechetaccount里面 //userid将会填在user.wechetaccount里面
var _userid = EncryptByPublicKey("cs1", SPK);
//var _userinfo = cdc.user
//var _userid = EncryptByPublicKey(_userinfo.w, SPK);
var _userid = EncryptByPublicKey("49", SPK);
var dic = new Dictionary<string, string> { var dic = new Dictionary<string, string> {
{ "token", token }, { "token", token },

@ -14127,11 +14127,22 @@ namespace DSWeb.MvcShipping.Controllers
} }
else if (!string.IsNullOrWhiteSpace(paramset.PARAMVALUE) && paramset.PARAMVALUE == "1") else if (!string.IsNullOrWhiteSpace(paramset.PARAMVALUE) && paramset.PARAMVALUE == "1")
{ {
//20221228 增加对船公司的判断 如在select * from code_cust_edi where EDINAME='接口直发VGM'中没有这个船公司 则还走原路径
var headlist = MsOpSeaeDAL.GetDataList(" BSNO='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"]));
var _carrier = headlist[0].CARRIER;
var cdc = new CommonDataContext();
var = cdc.code_cust_edi.Where(x => x.EDINAME == "接口直发VGM" && x.CUST == _carrier).ToList();
if ( == null || .Count() == 0) {
return DoCreateAndSendVGM(mblno, userid, type, bsno);
}
var carrierEdiCode = [0].EDICODE;
string companyid = Convert.ToString(Session["COMPANYID"]); string companyid = Convert.ToString(Session["COMPANYID"]);
var _r = MsOpSeaeDAL.SendVGM(bsno, userid, companyid); var _r = MsOpSeaeDAL.SendVGM(bsno, userid, companyid, carrierEdiCode);
if (_r.Success) if (_r.Success)
{ {
var headlist = MsOpSeaeDAL.GetDataList(" BSNO='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"])); //var headlist = MsOpSeaeDAL.GetDataList(" BSNO='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"]));
//9原始 2增加 3删除 4更新 //9原始 2增加 3删除 4更新
MakeFee_VGM(headlist, type); MakeFee_VGM(headlist, type);
} }

@ -7557,7 +7557,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
} }
public static DBResult SendVGM(string BSNO, string userid, string companyid) public static DBResult SendVGM(string BSNO, string userid, string companyid,string CarrierEDICode)
{ {
RespCommonData resp = new RespCommonData(); RespCommonData resp = new RespCommonData();
@ -7584,7 +7584,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
result.SetErrorInfo("提单号不能为空"); result.SetErrorInfo("提单号不能为空");
} }
if (string.IsNullOrEmpty(order.CARRIER)) if (string.IsNullOrEmpty(order.CARRIER) || string.IsNullOrEmpty(CarrierEDICode))
{ {
result.SetErrorInfo("船公司不能为空"); result.SetErrorInfo("船公司不能为空");
} }
@ -7635,7 +7635,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
customerName = $"{company.FULLNAME}+{vwuser.SHOWNAME}", //公司名称+用户姓名 customerName = $"{company.FULLNAME}+{vwuser.SHOWNAME}", //公司名称+用户姓名
customerId = order.CUSTOMERNAME, customerId = order.CUSTOMERNAME,
agentName = string.IsNullOrEmpty(order.FORWARDER) ? company.FULLNAME : order.FORWARDER, agentName = string.IsNullOrEmpty(order.FORWARDER) ? company.FULLNAME : order.FORWARDER,
carrierCode = order.CARRIER, carrierCode = CarrierEDICode,//注意 船公司采用code_cust_edi中ediname='接口直发VGM'的船公司的EDICODE
userName = accCfg.ACCOUNT, userName = accCfg.ACCOUNT,
userPassword = accCfg.ACCOUNTPSW, userPassword = accCfg.ACCOUNTPSW,
depotCode = yardset[0].YARDCODE, depotCode = yardset[0].YARDCODE,
@ -7676,7 +7676,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
var jobjRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn, new { code = 0, status = false, message = string.Empty, data = string.Empty }); var jobjRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn, new { code = 0, status = false, message = string.Empty, data = string.Empty });
if (!jobjRtn.status) if (!jobjRtn.status)
{ {
return result.SetErrorInfo($"VGM错误{jobjRtn.message}"); return result.SetErrorInfo($"发VGM错误{jobjRtn.message}");
} }
result.OK("发送完成"); result.OK("发送完成");

@ -4988,6 +4988,12 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
}, { }, {
text: '测试OCR', //快速录入, text: '测试OCR', //快速录入,
handler: function (button, event) { handler: function (button, event) {
if (this.formHead.getForm().findField('CUSTNO').getValue() == "") {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QingXianBaoCunYeWu, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });//'请先保存业务信息后再打开其他模块!'
} else {
this.tabtree.hide(); this.tabtree.hide();
//从后台获取一个拼好的包含token的url 将其打开 //从后台获取一个拼好的包含token的url 将其打开
@ -5029,7 +5035,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
scope: this scope: this
}); });
}
}, },
scope: this scope: this

@ -4,7 +4,7 @@
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>H:\DS7_dev\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>H:\DS7_dev\DSWeb\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress /> <Use64BitIISExpress />
<IISExpressSSLPort /> <IISExpressSSLPort />
<IISExpressAnonymousAuthentication /> <IISExpressAnonymousAuthentication />

Loading…
Cancel
Save