|
|
@ -27,12 +27,23 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var account = seaComService.GetCodeThirdParty("BillTraceSubcribe", user.UserId, tenantDb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (account.IsNull())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未配置运踪订阅第三方账号信息!"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (account.AppSecret.IsNull()|| account.AppKey.IsNull()|| account.RegistContractName.IsNull())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("请检查运踪订阅第三方账号关键参数!"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BillTraceMain billdto = new BillTraceMain();
|
|
|
|
BillTraceMain billdto = new BillTraceMain();
|
|
|
|
List<BillTraceReq> billTraceList = new List<BillTraceReq>();
|
|
|
|
List<BillTraceReq> billTraceList = new List<BillTraceReq>();
|
|
|
|
foreach (var item in req)
|
|
|
|
foreach (var item in req)
|
|
|
@ -70,13 +81,27 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed($"场站代号配置未找到:{yardCode}"));
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed($"场站代号配置未找到:{yardCode}"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//var carrierMap = tenantDb.Queryable<MappingYard>().Where(x => x.Code == yardCode && x.Module == "BillTrace").First();
|
|
|
|
|
|
|
|
//if (yardMap.IsNull())
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// return await Task.FromResult(DataResult<string>.Failed($"船公司代号配置未找到:{yardCode}"));
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
var carrierName =string.Empty;
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(carrierCode))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
carrierName = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
carrierName = seaComService.GetCarrierMapper(item.CarrierId, tenantDb).MapName;
|
|
|
|
|
|
|
|
}
|
|
|
|
billTraceList.Add(new BillTraceReq
|
|
|
|
billTraceList.Add(new BillTraceReq
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BusinessId = item.BusinessId,
|
|
|
|
BusinessId = item.BusinessId,
|
|
|
|
MBLNO = item.MBLNO,
|
|
|
|
MBLNO = item.MBLNO,
|
|
|
|
YARD = item.Yard == "" ? null : item.Yard,
|
|
|
|
YARD = yardMap.MapName,
|
|
|
|
YardCode = yardMap.MapCode == "" ? null : yardMap.MapCode,
|
|
|
|
YardCode = yardMap.MapCode == "" ? null : yardMap.MapCode,
|
|
|
|
CARRIER = item.Carrier == "" ? null : item.Carrier,
|
|
|
|
CARRIER = carrierName,
|
|
|
|
CARRIERID = carrierCode == "" ? null : carrierCode,
|
|
|
|
CARRIERID = carrierCode == "" ? null : carrierCode,
|
|
|
|
isBook = item.isBook
|
|
|
|
isBook = item.isBook
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -110,10 +135,10 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
billdto.Children = billTraceList;
|
|
|
|
billdto.Children = billTraceList;
|
|
|
|
billdto.Key = userKey;
|
|
|
|
billdto.Key = account.AppKey;
|
|
|
|
billdto.PWD = userPwd;
|
|
|
|
billdto.PWD = account.AppSecret;
|
|
|
|
billdto.url = resUrl;
|
|
|
|
billdto.url = resUrl;
|
|
|
|
billdto.Gid = userId;
|
|
|
|
billdto.Gid = account.RegistContractName;
|
|
|
|
billdto.PushBackKey = user.TenantId;//根据回传的租户Id回调
|
|
|
|
billdto.PushBackKey = user.TenantId;//根据回传的租户Id回调
|
|
|
|
var json = billdto.ToJsonString();
|
|
|
|
var json = billdto.ToJsonString();
|
|
|
|
|
|
|
|
|
|
|
@ -124,7 +149,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
reqUrl += "/";
|
|
|
|
reqUrl += "/";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
reqUrl += "BillTrace/UpdateMblno";
|
|
|
|
reqUrl += "BillTrace/SubcribeOrUpdateBilltrace";
|
|
|
|
|
|
|
|
|
|
|
|
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
|
|
|
|
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
|
|
|
|
|
|
|
|
|
|
|
@ -136,7 +161,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return await Task.FromResult(DataResult<string>.Success(res.Data));
|
|
|
|
return await Task.FromResult(DataResult<string>.Success(res.Data.ToJsonString()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -152,18 +177,28 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
//var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
|
|
|
|
|
|
|
|
var account = seaComService.GetCodeThirdParty("BillTraceSubcribe", user.UserId, tenantDb);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (account.IsNull())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("未配置运踪订阅第三方账号信息!"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (account.AppSecret.IsNull() || account.AppKey.IsNull() || account.RegistContractName.IsNull())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("请检查运踪订阅第三方账号关键参数!"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BillTraceUnsubscribeDto reqDto = new BillTraceUnsubscribeDto()
|
|
|
|
BillTraceUnsubscribeDto reqDto = new BillTraceUnsubscribeDto()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Children = new List<BillTraceUnsubscribeList>(),
|
|
|
|
Children = new List<BillTraceUnsubscribeList>(),
|
|
|
|
Key = userKey,
|
|
|
|
Key = account.AppKey,
|
|
|
|
PWD = userPwd,
|
|
|
|
PWD = account.AppSecret,
|
|
|
|
Gid = userId,
|
|
|
|
Gid = account.RegistContractName,
|
|
|
|
PushBackKey= user.TenantId,
|
|
|
|
PushBackKey= user.TenantId,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
foreach (var item in req)
|
|
|
|
foreach (var item in req)
|
|
|
@ -191,7 +226,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
var postData = new { msg = json };
|
|
|
|
var postData = new { msg = json };
|
|
|
|
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
|
|
|
|
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
|
|
|
|
|
|
|
|
|
|
|
|
var res = JsonConvert.DeserializeObject<BillTraceRes>(result);
|
|
|
|
var res = JsonConvert.DeserializeObject<BillTraceUnsubscribeRes>(result);
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.Success)
|
|
|
|
if (!res.Success)
|
|
|
|
{
|
|
|
|
{
|
|
|
|