You've already forked FrameTour-BE
fix(printer):修复打印机选择逻辑并优化查询
- 调整打印机选择逻辑,确保正确获取打印机ID - 优化SourceMapper查询,按创建时间倒序并限制结果数量- 修复可能因逻辑错误导致的打印机选择异常问题
This commit is contained in:
@@ -490,12 +490,10 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
List<PrinterResp> printerList = printerMapper.listByScenicId(scenicId);
|
||||
if (printerList.size() != 1) {
|
||||
throw new BaseException("请选择打印机");
|
||||
} else {
|
||||
printerId = printerList.getFirst().getId();
|
||||
}
|
||||
} else {
|
||||
printer = printerMapper.getById(printerId);
|
||||
printerId = printerList.getFirst().getId();
|
||||
}
|
||||
printer = printerMapper.getById(printerId);
|
||||
if (printer == null) {
|
||||
throw new BaseException("打印机不存在");
|
||||
}
|
||||
|
||||
@@ -358,5 +358,7 @@
|
||||
select *
|
||||
from source
|
||||
where face_sample_id = #{faceSampleId} and type = #{type}
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user