打印修改

usertest
cjy 4 months ago
parent 13df02a721
commit 26d548d495

@ -47,6 +47,7 @@ public class MultiLanguageMiddleware
|| context.Request.Path.Value.IndexOf("HealthCheck", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("DownloadOpFileInfo", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("LinkAttach", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("PrintTempFile", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("GetOcrImg", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("DownloadBookingOrClosingEDI", StringComparison.InvariantCultureIgnoreCase) > -1
)

@ -41,7 +41,7 @@ if (!policyName.IsNullOrEmpty())
// if (app.Environment.IsDevelopment())
// {
var apis = new List<string> { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "TestApi" };
var apis = new List<string> { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "TestApi" };
app
.UseSwagger()

@ -234,6 +234,39 @@
"Type": "RoundRobin"
}
},
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 2999
}
],
"UpstreamPathTemplate": "/WmsPrintAPI/swagger.json",
"UpstreamHttpMethod": [
"Get",
"Post"
]
},
{
"DownstreamPathTemplate": "/printApi/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 2999
}
],
"UpstreamPathTemplate": "/printApi/{url}",
"UpstreamHttpMethod": [
"Get",
"Post"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
}
},
{
"DownstreamPathTemplate": "/PrintTempFile/{url}",
"DownstreamScheme": "http",

@ -152,30 +152,30 @@ namespace DS.WMS.MainApi.Controllers
{
return await _invokeService.GetOpenPrintTemplateList(req);
}
/// <summary>
/// 获取Json本地打印信息
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("GetJsonPrintInfoAsync")]
public async Task<DataResult<string>> GetJsonPrintInfoAsync([FromBody] OpenJsonPrintReq req)
{
///// <summary>
///// 获取Json本地打印信息
///// </summary>
///// <param name="req"></param>
///// <returns></returns>
//[HttpPost]
//[Route("GetJsonPrintInfoAsync")]
//public async Task<DataResult<string>> GetJsonPrintInfoAsync([FromBody] OpenJsonPrintReq req)
//{
var url = AppSetting.Configuration["PrintService:LocalPrintUrl"];
if (url.IsNull())
return await Task.FromResult(DataResult<string>.Failed("未配置本地打印地址"));
// var url = AppSetting.Configuration["PrintService:LocalPrintUrl"];
// if (url.IsNull())
// return await Task.FromResult(DataResult<string>.Failed("未配置本地打印地址"));
var res = await RequestHelper.PostJosnAsyncNoHeaders(url, req.ToJson());
var result = JsonConvert.DeserializeObject<DataResult<string>>(res);
if (result.Succeeded)
{
return await Task.FromResult(DataResult<string>.Success(result.Message));
}
else
{
return await Task.FromResult(DataResult<string>.Failed(result.Message));
}
}
// var res = await RequestHelper.PostJosnAsyncNoHeaders(url, req.ToJson());
// var result = JsonConvert.DeserializeObject<DataResult<string>>(res);
// if (result.Succeeded)
// {
// return await Task.FromResult(DataResult<string>.Success(result.Message));
// }
// else
// {
// return await Task.FromResult(DataResult<string>.Failed(result.Message));
// }
//}
}
}

@ -4,7 +4,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:14242",
"applicationUrl": "http://localhost:2999",
"sslPort": 0
}
},

@ -63,10 +63,11 @@ namespace DS.WMS.PrintApi
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
var documentName = AppSetting.Configuration["SwaggerDoc:ContactName"];
// app.UseHttpsRedirection();
app.UseSwagger().UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", AppSetting.Configuration["SwaggerDoc:Version"]);
c.SwaggerEndpoint("/swagger/v1/swagger.json", documentName);
});
app.UseRouting();
//¾²Ì¬Îļþ

@ -12,7 +12,7 @@
"Pro": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev"
},
"SwaggerDoc": {
"ContactName": "WmsPrint API.Core",
"ContactName": "WmsPrintAPI",
"ContactEmail": "WmsPrint API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",

Loading…
Cancel
Save