打印修改

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("HealthCheck", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("DownloadOpFileInfo", 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("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("GetOcrImg", StringComparison.InvariantCultureIgnoreCase) > -1
|| context.Request.Path.Value.IndexOf("DownloadBookingOrClosingEDI", StringComparison.InvariantCultureIgnoreCase) > -1 || context.Request.Path.Value.IndexOf("DownloadBookingOrClosingEDI", StringComparison.InvariantCultureIgnoreCase) > -1
) )

@ -41,7 +41,7 @@ if (!policyName.IsNullOrEmpty())
// if (app.Environment.IsDevelopment()) // 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 app
.UseSwagger() .UseSwagger()

@ -234,6 +234,39 @@
"Type": "RoundRobin" "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}", "DownstreamPathTemplate": "/PrintTempFile/{url}",
"DownstreamScheme": "http", "DownstreamScheme": "http",

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

@ -4,7 +4,7 @@
"windowsAuthentication": false, "windowsAuthentication": false,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:14242", "applicationUrl": "http://localhost:2999",
"sslPort": 0 "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. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
var documentName = AppSetting.Configuration["SwaggerDoc:ContactName"];
// app.UseHttpsRedirection(); // app.UseHttpsRedirection();
app.UseSwagger().UseSwaggerUI(c => app.UseSwagger().UseSwaggerUI(c =>
{ {
c.SwaggerEndpoint("/swagger/v1/swagger.json", AppSetting.Configuration["SwaggerDoc:Version"]); c.SwaggerEndpoint("/swagger/v1/swagger.json", documentName);
}); });
app.UseRouting(); app.UseRouting();
//¾²Ì¬Îļþ //¾²Ì¬Îļþ

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

Loading…
Cancel
Save