fix(common): 统一异常处理并迁移打印功能到hiprint

- 替换所有System.out.println和printStackTrace为slf4j日志记录
- 在BeanUtils、AuditFieldUtil、DateUtils、ServletUtils等工具类中添加Logger实例
- 在Flowable相关控制器和服务中统一错误日志记录格式
- 在代码生成器中添加日志记录功能
- 将前端打印组件从Lodop迁移到hiprint打印方案
- 更新体温单打印功能使用hiprint预览打印
- 移除调试用的console.log语句
- 修复打印模板中线条元素类型定义
This commit is contained in:
2026-03-06 22:16:44 +08:00
parent 8ef334ba1b
commit b65841c0cc
58 changed files with 678 additions and 888 deletions

View File

@@ -115,7 +115,7 @@ public class FlowDefinitionController extends BaseController {
ImageIO.write(image, "png", os);
}
} catch (Exception e) {
e.printStackTrace();
log.error("读取流程图片失败, deployId: {}", deployId, e);
} finally {
try {
if (os != null) {
@@ -123,7 +123,7 @@ public class FlowDefinitionController extends BaseController {
os.close();
}
} catch (IOException e) {
e.printStackTrace();
log.error("关闭输出流失败", e);
}
}

View File

@@ -211,7 +211,7 @@ public class FlowTaskController extends BaseController {
ImageIO.write(image, "png", os);
}
} catch (Exception e) {
e.printStackTrace();
log.error("读取流程图片失败", e);
} finally {
try {
if (os != null) {
@@ -219,7 +219,7 @@ public class FlowTaskController extends BaseController {
os.close();
}
} catch (IOException e) {
e.printStackTrace();
log.error("关闭输出流失败", e);
}
}
}

View File

@@ -722,7 +722,7 @@ public class FlowableUtils {
// 反射设置属性值
field.set(propertyDto, attribute.getValue());
} catch (IllegalAccessException e) {
e.printStackTrace();
log.warn("反射设置属性值失败", e);
// 如果反射设置失败则忽略该属性
}
});
@@ -730,7 +730,7 @@ public class FlowableUtils {
return propertyDto;
}).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
log.error("解析流程属性失败", e);
return Collections.emptyList(); // 如果发生异常则返回空列表
}
}

View File

@@ -209,7 +209,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
}
return AjaxResult.success("流程启动成功");
} catch (Exception e) {
e.printStackTrace();
log.error("流程启动错误", e);
return AjaxResult.error("流程启动错误");
}
}

View File

@@ -113,7 +113,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
runtimeService.startProcessInstanceById(procDefId, variables);
return AjaxResult.success("流程启动成功");
} catch (Exception e) {
e.printStackTrace();
log.error("流程启动错误, procDefId: {}", procDefId, e);
return AjaxResult.error("流程启动错误");
}
}