fix: 更新微信配置、点阵ID及打印工具相关配置
1. 更新WebApi和WorkService的配置文件中的微信AppId、AppSecret 2. 修改WorkService的DotId配置为新的点阵ID 3. 新增打印工具所需的授权xml文件 4. 重构打印工具调用逻辑,修复路径问题并优化命令执行方式
This commit is contained in:
@ -16,6 +16,7 @@ namespace QYZH.InteractiveMagazine.WorkService.Consumers;
|
||||
/// </summary>
|
||||
public class AutoDotCodeConsumer(IConfiguration configuration,
|
||||
IServiceScopeFactory scopeFactory,
|
||||
IWebHostEnvironment webHostEnvironment,
|
||||
ILogger<AutoDotCodeConsumer> logger,
|
||||
IHttpClientFactory httpClientFactory,
|
||||
OssService ossService
|
||||
@ -78,7 +79,7 @@ public class AutoDotCodeConsumer(IConfiguration configuration,
|
||||
#region 调用铺码程序
|
||||
|
||||
// 从配置中获取点阵文件Id
|
||||
var dotId = configuration.GetValue("PrintConfig:DotId", 683790963662917);
|
||||
var dotId = configuration.GetValue("PrintConfig:DotId", 765837655859269);
|
||||
|
||||
var dotfile = await dBContext.Queryable<DotFile>().FirstAsync(x => x.Id == dotId, cancellationToken);
|
||||
if (dotfile == null)
|
||||
@ -87,9 +88,10 @@ public class AutoDotCodeConsumer(IConfiguration configuration,
|
||||
return;
|
||||
}
|
||||
|
||||
var exePath = AppDomain.CurrentDomain.BaseDirectory + "PrintToolV2.7\\PrintTool.exe";
|
||||
var printToolDirectory = Path.Combine(webHostEnvironment.ContentRootPath, "PrintToolV2.7");
|
||||
var exePath = Path.Combine(printToolDirectory, "PrintTool.exe");
|
||||
|
||||
var xmlPath = AppDomain.CurrentDomain.BaseDirectory + $"PrintToolV2.7\\{dotfile.FileName}";
|
||||
var xmlPath = Path.Combine(printToolDirectory, dotfile.FileName);
|
||||
|
||||
|
||||
#region 注释说明
|
||||
@ -151,7 +153,8 @@ public class AutoDotCodeConsumer(IConfiguration configuration,
|
||||
// 从第一个开始执行,连续铺码N条(N为书籍页数)
|
||||
string pageStr = "{" + $"[{dotFileDetailList[0].PageName},{pageNumMax}]" + "}";
|
||||
|
||||
var cmd = $"PrintTool.exe -sMode=Generate -sPDF={uploadFilePath} -sLIC={xmlPath} -pStart=1 -oPDF={downloadFilePath} -dPageAddr=1 -dPrint={dPrint} -dDotSize=40 -dType=0 -dOutFile=0 -dControlPageNum={pageStr}";
|
||||
var arguments = $"-sMode=Generate -sPDF=\"{uploadFilePath}\" -sLIC=\"{xmlPath}\" -pStart=1 -oPDF=\"{downloadFilePath}\" -dPageAddr=1 -dPrint={dPrint} -dDotSize=40 -dType=0 -dOutFile=0 -dControlPageNum={pageStr}";
|
||||
var cmd = $"\"{exePath}\" {arguments}";
|
||||
|
||||
logger.LogInformation($"执行PrintTool.exe 的命令: {cmd}");
|
||||
|
||||
@ -160,9 +163,9 @@ public class AutoDotCodeConsumer(IConfiguration configuration,
|
||||
{
|
||||
p.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory + "PrintToolV2.7",
|
||||
FileName = "cmd.exe",
|
||||
Arguments = "/c " + cmd, // /c参数表示执行后关闭
|
||||
WorkingDirectory = printToolDirectory,
|
||||
FileName = exePath,
|
||||
Arguments = arguments,
|
||||
UseShellExecute = false, //是否使用操作系统shell启动
|
||||
RedirectStandardInput = true, //接受来自调用程序的输入信息
|
||||
RedirectStandardOutput = true, //由调用程序获取输出信息
|
||||
@ -336,4 +339,4 @@ internal class CallbackUpdateJournalStatusResponse
|
||||
public bool Result { get; set; }
|
||||
|
||||
public bool IsSuccess { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user