fix: 更新微信配置、点阵ID及打印工具相关配置

1. 更新WebApi和WorkService的配置文件中的微信AppId、AppSecret
2. 修改WorkService的DotId配置为新的点阵ID
3. 新增打印工具所需的授权xml文件
4. 重构打印工具调用逻辑,修复路径问题并优化命令执行方式
This commit is contained in:
glz
2026-06-29 10:39:59 +08:00
parent f29802eb5a
commit d64b68abdd
4 changed files with 46 additions and 11 deletions

View File

@ -22,8 +22,8 @@
"ClientProvidedName": "Custom connection name"
},
"WeChatSettings": {
"AppId": "wx5d8f281c2fd6594c",
"AppSecret": "974f45e4a0aaa075278db0477d0bd8b6"
"AppId": "wx5d8f281c2fd6594c1",
"AppSecret": "974f45e4a0aaa075278db0477d0bd8b61"
},
"Serilog": {
"MinimumLevel": {

View File

@ -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; }
}
}

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<licensecontainer version="1.0">
<license level="0" name="Root license segment 1761" owner="WWZN" info="segment 1761" type="enterprise" guid="segment 1761" parentid="0">
<page width="11720" height="11720" />
<time expire="20341025" creation="20241025" />
<user id="0" />
<pattern category="enterprise">
<pageaddress start="1761.0.0.0" stop="1761.5725.52.107" pagesnum="32775624" />
</pattern>
<permissions nbrof="3">
<permission id="0" value="1" name="sublicense" />
<permission id="1" value="1" name="deallocate" />
<permission id="2" value="1" name="print" />
</permissions>
<signature value="846682277F67BD118D24382FBC6DD09AF3E0A921A677F96C34B69E46C951CAC4FDD373E3652EC8FEC18FABA8CA9FAACB19E544447023DAD11CBB6EBB8389A714756395E8CA882F980FB6ED3778DFF6108C90401A43D93CD68A26B362D243FA0F160221506ADA7D031126792DC494CB4CC99C099FC8E05C19CF365D1740B2C907D7393FB73E18642236936E43F2A8FAF21E970269A5ED76BA4231F08C690D4D5D425F637AF4A38FEA4F016609696153708983F373C12EC7533D4B2CDAA496A5FA3916497FA64524D56695C58E48C71F29008EE0BD4EC5B7DBA24BCB2395FAA0D36CFEF2B63C3BC230FBDF04A56F20712FB261F5EBBF1A9E18EF3A4DF998C810248ED7F94C13F5302496914896CD3EA05D92B2B784411796D1D3B5FB00B3B2E6ADDBD68E481A9306785C05C53088DE795CE2F46E1EEAE75E80CEA8F5FF4B08B9A356C543D34B036463D699A6E4131DE9B685364A78D66455A1173823B378CA64359497E8B7E52C7E60EEAC74C1C7F991FE9F62E55DE121010820611C61E70457B5FE12AA7A0DCEEF28AE369DFE6CFB6DE4B0DDE770A4262C209C163EB31DA1150D8AF5886A792438F91A1727DB71E8AEE4247E05ECD7A5C1392260E9CFD186989B71695F308C97EC6A1F7008D90BAA1746CABB60F7A078BBF347514CC98D1AEA380946F438C0B777128E5A72FEB85FDEF16F065C93E70884BB77536CC7DEEFF01F" />
</license>
<license level="2" name="license_1761.211.21.48_10000" owner="CQQY" info="segment 1761" type="CommonB2B" guid="1761.211.21.48_10000" parentid="1761.174.38.0_1000000">
<page width="8512" height="8512" />
<time expire="20360122" creation="20260122" />
<user id="1" />
<pattern category="enterprise">
<pageaddress start="1761.211.21.48" stop="1761.213.8.3" pagesnum="10000" />
</pattern>
<permissions nbrof="3">
<permission id="0" value="1" name="sublicense" />
<permission id="1" value="1" name="deallocate" />
<permission id="2" value="1" name="print" />
</permissions>
<signature value="0BA47A5B9A71CF0680CE1CA41A58FF4DAAA97CD168F331494142150E8BD5A8E93F1369FD8CF026EE577F041C1F8A95D408FC4286BEE366D967DD604D2D482E2105004048C0690D637983591893CE7DC7CEBAEEC9C9569ED62955D044F21769BFE060961413818202E5BDE0216215300BF75238A08A681461DDC539ADB11DA9C3DC5F0B1E3FCDBE70A8F3E39F9FB30F74468DDC93F5D1105B8B8B99F52E13DBAC2C828DF493852037A44B7E6D22D2EAE85942A4F45ECD26F3D17E94EC63226E5A5334DF61781F20B9B65A8B7055950BA15A55D935DFE4A76A8CB4C8C9EDCF7BDDA1C03B6C64CAB8BBECC51684B7F9FD39F17F747F954A8EC3C0D90409FEE30CF5" />
<publickey value="MIIBCgKCAQEAvKvG8GB+Q8GzBGalOEUlLKQlCQG1nmjX3n+ErjuclTUgpo7Ai0akc+77aZV3sbLgVEr1o6TuuHb+aijmJfq6raOW3W5GobAKt6i4QIGWBfzJ3V3YlpTadIWVMYcjSR2tCh4shT4mkQg4DDBT6CvuBSOLuEu8qKtBiNGAikm2Hn3kmeGM4Oy5fKam4GSO3cHEIKgWQES5AMae6KyQmcrxtlFNciFgO+/DfDGSo94QjvMURdyg+kysOAiANxXqEbH1SiDeiQEGeOCQROq2j8T6zJ96mxyYZCuaLxE2Uh5LSxYolLVKw1kq+ukeve23LXvvEV5miZmKQB5NUhRFvU6JIwIDAQAB" />
</license>
</licensecontainer>

View File

@ -68,6 +68,6 @@
//"CallBackApiUrl": "http://192.168.20.150:8000/api/icr/page/callbackupdatepageno", // 测试环境 打印成功回调API地址修改打印状态
//"CallBackApiUrl": "https://zyb.qyzhjy.com/zybback/api/icr/page/callbackupdatepageno", // 正式环境 打印成功回调API地址修改打印状态
//这个ID执行的xml文件是sublic_license_1761.172.8.16_1000.xml如果想执行sublic_license_1761.211.21.48_10000.xml 换成 765837655859269 ---暂时没有导入页码
"DotId": 683790963662917
"DotId": 765837655859269
}
}