fix(printer): 解决图片类型设置逻辑问题

- 添加source为空时的图片类型判断逻辑
- 当source为空时将图片类型设置为PUZZLE
- 保持原有source不为空时的IPC类型设置逻辑
- 确保PHONE类型的设置逻辑不受影响
This commit is contained in:
2025-12-30 17:34:30 +08:00
parent 2a3b4ca19f
commit ab1e8cf7ef

View File

@@ -889,7 +889,11 @@ public class PrinterServiceImpl implements PrinterService {
SourceEntity source = null; SourceEntity source = null;
if (item.getSourceId() != null && item.getSourceId() > 0) { if (item.getSourceId() != null && item.getSourceId() > 0) {
source = sourceMapper.getEntity(item.getSourceId()); source = sourceMapper.getEntity(item.getSourceId());
context.setSource(ImageSource.IPC); if (source == null) {
context.setImageType(ImageType.PUZZLE); // 特殊
} else {
context.setSource(ImageSource.IPC);
}
} else if (item.getSourceId() == null) { } else if (item.getSourceId() == null) {
context.setSource(ImageSource.PHONE); context.setSource(ImageSource.PHONE);
} else { } else {