批量打印

This commit is contained in:
tangw 2026-07-16 17:10:47 +08:00
parent 8bb3c834a4
commit 61687b4b4a
2 changed files with 47 additions and 52 deletions

View File

@ -91,7 +91,7 @@ public class PrintReportService {
// // 每5份或最后一份推送一次进度,减少消息风暴
// if ((i + 1) % 5 == 0 || i == total - 1) {
int currProgress = (i + 1) * 100 / total;
if(currProgress==100)currProgress=99;
if (currProgress == 100) currProgress = 99;
progressDTO.setProgress(currProgress);
progressDTO.setStatus(bg.getFlag());
progressDTO.setDesc("正在生成第" + (i + 1) + "/" + total + "份报告");
@ -103,19 +103,13 @@ public class PrintReportService {
sendPrintWsMsg(clientSid, progressDTO);
// }
}
if(mergeBgdhList.size()==0){
if (mergeBgdhList==null||mergeBgdhList.size() == 0) {
progressDTO.setErrorMsg("任务执行失败:");
progressDTO.setDesc("报告为空,结束打印");
progressDTO.setProgress(100);
progressDTO.setYbh(null);
sendPrintWsMsg(clientSid, progressDTO);
return ;
}
// 全部单份PDF生成完成,开始合并
// progressDTO.setDesc("正在合并全部PDF文件...");
// progressDTO.setProgress(99);
// sendPrintWsMsg(clientSid, progressDTO);
} else {
String pdfName = UUID.randomUUID().toString();
String path = staticPath + pdfName + ".pdf";
// 合并文件
@ -137,8 +131,8 @@ public class PrintReportService {
progressDTO.setSuccCount(ok);
progressDTO.setFailCount(fall);
sendPrintWsMsg(clientSid, progressDTO);
} catch (Exception e) {
}
} catch(Exception e){
log.error("批量打印任务异常 taskId:{}", taskId, e);
// 推送异常消息
progressDTO.setStatus("error");
@ -147,5 +141,6 @@ public class PrintReportService {
progressDTO.setDesc("批量打印出现异常");
sendPrintWsMsg(clientSid, progressDTO);
}
}
}

View File

@ -827,14 +827,14 @@ public class LisUtil {
eqSb.append(String.format("%s = %s", code, eqList.get(0)));
} else {
// 多个in:code IN (#{p1},#{p2},...)
eqSb.append(code).append(" IN (");
eqSb.append(code).append(" IN ('");
for (int i = 0; i < eqList.size(); i++) {
if (i > 0) {
eqSb.append(",");
eqSb.append("','");
}
eqSb.append(eqList.get(i));
}
eqSb.append(")");
eqSb.append("')");
}
}