From b65841c0cc533433a4df8ed6f416691c287b2fbf Mon Sep 17 00:00:00 2001 From: chenqi Date: Fri, 6 Mar 2026 22:16:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(common):=20=E7=BB=9F=E4=B8=80=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86=E5=B9=B6=E8=BF=81=E7=A7=BB=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E5=8A=9F=E8=83=BD=E5=88=B0hiprint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 替换所有System.out.println和printStackTrace为slf4j日志记录 - 在BeanUtils、AuditFieldUtil、DateUtils、ServletUtils等工具类中添加Logger实例 - 在Flowable相关控制器和服务中统一错误日志记录格式 - 在代码生成器中添加日志记录功能 - 将前端打印组件从Lodop迁移到hiprint打印方案 - 更新体温单打印功能使用hiprint预览打印 - 移除调试用的console.log语句 - 修复打印模板中线条元素类型定义 --- .../com/core/common/utils/AuditFieldUtil.java | 10 +- .../java/com/core/common/utils/DateUtils.java | 11 +- .../com/core/common/utils/ServletUtils.java | 9 +- .../com/core/common/utils/bean/BeanUtils.java | 8 +- .../controller/FlowDefinitionController.java | 4 +- .../controller/FlowTaskController.java | 4 +- .../com/core/flowable/flow/FlowableUtils.java | 4 +- .../impl/FlowDefinitionServiceImpl.java | 2 +- .../service/impl/FlowInstanceServiceImpl.java | 2 +- .../generator/controller/GenController.java | 6 +- .../impl/SysUserConfigServiceImpl.java | 11 +- .../impl/CheckMethodAppServiceImpl.java | 2 +- .../impl/CheckPartAppServiceImpl.java | 2 +- .../appservice/impl/CommonServiceImpl.java | 6 +- .../appservice/IDiagTreatMAppService.java | 9 + .../impl/DiagTreatMAppServiceImpl.java | 33 ++ .../DiagnosisTreatmentController.java | 12 + .../web/doctorstation/utils/AdviceUtils.java | 6 +- .../impl/ThreePartPayServiceImpl.java | 8 +- .../openhis/common/aspectj/DictAspect.java | 10 +- .../openhis/common/utils/HisQueryUtils.java | 8 +- .../com/openhis/common/utils/RedisUtil.java | 54 ++- openhis-ui-vue3/src/api/cardRenewal/api.js | 5 +- .../Auto/printBills/changeShiftBill.vue | 47 +- .../Auto/printBills/exeOrderSheet.vue | 59 ++- .../Auto/printBills/injectLabel.vue | 106 ++-- .../Auto/printBills/injectOrderSheet.vue | 45 +- .../Auto/printBills/temperatureSheet.vue | 6 +- .../Auto/printBills/triageTicketNew.vue | 60 +-- .../components/Auto/printBills/wristBill.vue | 51 +- .../OpenHis/TraceNoDialog/index.vue | 1 - .../components/Print/OutpatientBilling.json | 459 ++++-------------- .../Print/OutpatientSurgeryCharge.json | 6 +- .../src/components/Print/README.md | 2 +- openhis-ui-vue3/src/main.js | 6 +- .../src/template/ProgressNoteform.vue | 12 +- .../src/template/inHospitalSurgicalRecord.vue | 11 +- .../src/template/inHosptialCommunicate.vue | 11 +- .../src/template/tySurgicalRecord.vue | 12 +- .../appoinmentmanage/clinicRoom/index.vue | 8 +- .../basicmanage/implementDepartment/index.vue | 10 +- .../components/diagnosistreatment.js | 10 + .../catalog/diagnosistreatment/index.vue | 39 ++ .../charge/cliniccharge/components/api.js | 2 +- .../cliniccharge/components/chargeDialog.vue | 8 +- .../charge/outpatientregistration/index.vue | 6 +- .../consultationapplication/index.vue | 22 +- .../consultationconfirmation/index.vue | 22 +- .../inspection/inspectionApplication.vue | 70 +-- .../components/inAssessmentForm.vue | 29 +- .../components/depositQuery.vue | 41 +- .../components/feeDetailQuery.vue | 36 +- .../components/newfeeDetailQuery.vue | 39 +- .../views/inpatientNurse/tprChart/index.vue | 66 +-- .../components/inventoryReceiptDialog.vue | 5 + .../requisitionManagement/index.vue | 15 +- .../returningInventory/index.vue | 17 +- .../inhospital/register/index.vue | 1 - 58 files changed, 678 insertions(+), 888 deletions(-) diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/AuditFieldUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AuditFieldUtil.java index 30c81e93..1379734b 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/AuditFieldUtil.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AuditFieldUtil.java @@ -2,6 +2,8 @@ package com.core.common.utils; import com.core.common.core.domain.model.LoginUser; import com.core.common.utils.SecurityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import java.lang.reflect.Field; @@ -13,6 +15,8 @@ import java.util.Date; */ @Component public class AuditFieldUtil { + + private static final Logger log = LoggerFactory.getLogger(AuditFieldUtil.class); /** * 为实体设置创建相关的审计字段 @@ -65,8 +69,7 @@ public class AuditFieldUtil { } } catch (Exception e) { - System.err.println("设置创建审计字段时发生异常: " + e.getMessage()); - e.printStackTrace(); + log.error("设置创建审计字段时发生异常", e); } } @@ -110,8 +113,7 @@ public class AuditFieldUtil { } } catch (Exception e) { - System.err.println("设置更新审计字段时发生异常: " + e.getMessage()); - e.printStackTrace(); + log.error("设置更新审计字段时发生异常", e); } } diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java index 33ffdda3..74e396e5 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java @@ -1,6 +1,8 @@ package com.core.common.utils; import org.apache.commons.lang3.time.DateFormatUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.lang.management.ManagementFactory; import java.text.ParseException; @@ -13,10 +15,13 @@ import java.util.Date; /** * 时间工具类 - * + * * @author system */ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { + + private static final Logger log = LoggerFactory.getLogger(DateUtils.class); + public static String YYYY = "yyyy"; public static String YYYY_MM = "yyyy-MM"; @@ -227,7 +232,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { return endTime; } } catch (DateTimeParseException e) { - e.printStackTrace(); + log.warn("日期解析失败: {}", strDate, e); } return null; } @@ -250,7 +255,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { // 检查日期是否是未来的时间 return dateToCheck.isAfter(currentDate); } catch (Exception e) { - e.printStackTrace(); + log.warn("日期解析失败: {}", dateString, e); // 解析失败或其他异常,返回 false 或根据需要处理异常 return false; } diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java index ed5db953..40bfbed4 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java @@ -2,6 +2,8 @@ package com.core.common.utils; import com.core.common.constant.Constants; import com.core.common.core.text.Convert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -20,10 +22,13 @@ import java.util.Map; /** * 客户端工具类 - * + * * @author system */ public class ServletUtils { + + private static final Logger log = LoggerFactory.getLogger(ServletUtils.class); + /** * 获取String参数 */ @@ -130,7 +135,7 @@ public class ServletUtils { response.setCharacterEncoding("utf-8"); response.getWriter().print(string); } catch (IOException e) { - e.printStackTrace(); + log.error("渲染响应字符串失败", e); } } diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java index 87d88227..eb1c1156 100644 --- a/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java @@ -1,5 +1,8 @@ package com.core.common.utils.bean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; @@ -12,6 +15,9 @@ import java.util.regex.Pattern; * @author system */ public class BeanUtils extends org.springframework.beans.BeanUtils { + + private static final Logger log = LoggerFactory.getLogger(BeanUtils.class); + /** * Bean方法名中属性名开始的下标 */ @@ -37,7 +43,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils { try { copyProperties(src, dest); } catch (Exception e) { - e.printStackTrace(); + log.error("Bean属性复制失败", e); } } diff --git a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java index 9e24aac2..4e6ecb1a 100644 --- a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java +++ b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java @@ -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); } } diff --git a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java index 4853f4d2..f6f4cdca 100644 --- a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java +++ b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java @@ -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); } } } diff --git a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java index 63d2e9fa..4a7d633f 100644 --- a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java +++ b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java @@ -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(); // 如果发生异常则返回空列表 } } diff --git a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java index 996fbdfa..5ca73c9b 100644 --- a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java +++ b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java @@ -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("流程启动错误"); } } diff --git a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java index 324e3e24..250ccab5 100644 --- a/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java +++ b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java @@ -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("流程启动错误"); } } diff --git a/openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java index e7e66445..42e8f203 100644 --- a/openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java +++ b/openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java @@ -19,6 +19,8 @@ import com.core.generator.service.IGenTableColumnService; import com.core.generator.service.IGenTableService; import org.apache.commons.io.IOUtils; import org.apache.poi.ss.usermodel.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -43,6 +45,8 @@ import java.util.Map; @RestController @RequestMapping("/tool/gen") public class GenController extends BaseController { + + private static final Logger log = LoggerFactory.getLogger(GenController.class); @Autowired private IGenTableService genTableService; @@ -436,7 +440,7 @@ public class GenController extends BaseController { try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) { writer.write(str); } catch (IOException e) { - e.printStackTrace(); + log.error("写入文件失败: {}", filePath, e); } finally { is.close(); } diff --git a/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserConfigServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserConfigServiceImpl.java index e78a8acb..5bf1702d 100644 --- a/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserConfigServiceImpl.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserConfigServiceImpl.java @@ -6,6 +6,8 @@ import com.core.system.domain.SysUserConfig; import com.core.common.utils.StringUtils; import com.core.system.mapper.SysUserConfigMapper; import com.core.system.service.ISysUserConfigService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -13,13 +15,15 @@ import java.util.List; /** * 用户配置Service业务层处理 - * - * @author + * + * @author * @date 2026-01-30 */ @Service public class SysUserConfigServiceImpl extends ServiceImpl implements ISysUserConfigService { + private static final Logger log = LoggerFactory.getLogger(SysUserConfigServiceImpl.class); + @Autowired private SysUserConfigMapper sysUserConfigMapper; @@ -170,8 +174,7 @@ public class SysUserConfigServiceImpl extends ServiceImpl validateActivityEdit(Long activityId); + + /** + * 批量设置划价标记 + * + * @param ids 诊疗目录ID列表 + * @param pricingFlag 划价标记(1:允许, 0:不允许) + * @return 结果 + */ + R updatePricingFlag(List ids, Integer pricingFlag); } \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java index 9efa9ed6..8f863e5e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java @@ -626,6 +626,39 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { return R.ok(); } + /** + * 批量设置划价标记 + * + * @param ids 诊疗目录ID列表 + * @param pricingFlag 划价标记(1:允许, 0:不允许) + * @return 结果 + */ + @Override + public R updatePricingFlag(List ids, Integer pricingFlag) { + if (ids == null || ids.isEmpty()) { + return R.fail(null, "请选择要设置的诊疗项目"); + } + + List activityDefinitionList = new CopyOnWriteArrayList<>(); + + // 取得更新值 + for (Long id : ids) { + ActivityDefinition activityDefinition = new ActivityDefinition(); + activityDefinition.setId(id); + activityDefinition.setPricingFlag(pricingFlag); + activityDefinitionList.add(activityDefinition); + } + + // 插入操作记录 + operationRecordService.addIdsOperationRecord(DbOpType.UPDATE.getCode(), + CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids); + + // 更新诊疗信息 + return activityDefinitionService.updateBatchById(activityDefinitionList) + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"划价标记"})) + : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + /** * 导入信息校验 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 279957de..86defc5f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -176,4 +176,16 @@ public class DiagnosisTreatmentController { public R getClinicItems(@RequestParam(required = false) Long orgId) { return diagTreatMAppService.getClinicItems(orgId); } + + /** + * 批量设置划价标记 + * + * @param ids 诊疗目录ID列表 + * @param pricingFlag 划价标记(1:允许, 0:不允许) + * @return 结果 + */ + @PutMapping("/pricing-flag") + public R updatePricingFlag(@RequestBody List ids, @RequestParam Integer pricingFlag) { + return diagTreatMAppService.updatePricingFlag(ids, pricingFlag); + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java index e9f6e26d..f8baa916 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/utils/AdviceUtils.java @@ -25,6 +25,8 @@ import com.openhis.workflow.service.IActivityDefinitionService; import com.openhis.workflow.service.IDeviceDispenseService; import com.openhis.workflow.service.IDeviceRequestService; import com.openhis.workflow.service.IServiceRequestService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -40,6 +42,8 @@ import java.util.stream.Collectors; @Component public class AdviceUtils { + private static final Logger log = LoggerFactory.getLogger(AdviceUtils.class); + @Resource AssignSeqUtil assignSeqUtil; @@ -396,7 +400,7 @@ public class AdviceUtils { iChargeItemService.updateById(mainChargeItem); } } catch (JsonProcessingException e) { - e.printStackTrace(); + log.error("JSON处理失败", e); } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/ThreePartPayServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/ThreePartPayServiceImpl.java index 4402cd94..742ee90e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/ThreePartPayServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/paymentmanage/appservice/impl/ThreePartPayServiceImpl.java @@ -560,13 +560,13 @@ public class ThreePartPayServiceImpl implements ThreePartPayService { System.out.println("回复信息:" + JSON.toJSONString(response)); resultString = EntityUtils.toString(response.getEntity(), "utf-8"); } catch (Exception e) { - e.printStackTrace(); + log.error("Http请求异常, url: {}", url, e); throw new ServiceException("Http请求异常,请稍后再试。"); } finally { try { response.close(); } catch (IOException e) { - e.printStackTrace(); + log.error("关闭响应失败", e); } } return resultString; @@ -596,13 +596,13 @@ public class ThreePartPayServiceImpl implements ThreePartPayService { response = httpClient.execute(httpPost); resultString = EntityUtils.toString(response.getEntity(), "utf-8"); } catch (Exception e) { - e.printStackTrace(); + log.error("Http请求异常, url: {}", url, e); throw new ServiceException("Http请求异常,请稍后再试。"); } finally { try { response.close(); } catch (IOException e) { - e.printStackTrace(); + log.error("关闭响应失败", e); } } return resultString; diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java index 4ee026fb..8aba6c51 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/aspectj/DictAspect.java @@ -7,6 +7,8 @@ import com.openhis.common.annotation.Dict; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; @@ -20,6 +22,8 @@ import java.util.List; @Component public class DictAspect { + private static final Logger log = LoggerFactory.getLogger(DictAspect.class); + @Autowired private JdbcTemplate jdbcTemplate; // 使用 JdbcTemplate 执行 SQL @@ -99,15 +103,15 @@ public class DictAspect { // 查询字典值 String dictLabel = queryDictLabel(dictTable, dictCode, dictText, deleteFlag, fieldValue.toString()); if (dictLabel != null) { + // 动态生成 _dictText 字段名 + String textFieldName = field.getName() + "_dictText"; try { - // 动态生成 _dictText 字段名 - String textFieldName = field.getName() + "_dictText"; Field textField = dto.getClass().getDeclaredField(textFieldName); textField.setAccessible(true); textField.set(dto, dictLabel); // 设置 _dictText 字段的值 } catch (NoSuchFieldException e) { // 如果 _dictText 字段不存在,忽略错误 - e.printStackTrace(); + log.debug("字段 {} 不存在,跳过字典翻译", textFieldName); } } } else { diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/HisQueryUtils.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/HisQueryUtils.java index 9c378623..82ed0412 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/HisQueryUtils.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/HisQueryUtils.java @@ -5,6 +5,8 @@ import com.core.common.utils.DateUtils; import com.core.common.utils.SecurityUtils; import com.core.framework.config.TenantContext; import com.openhis.common.constant.CommonConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import java.lang.reflect.Field; @@ -21,6 +23,8 @@ import java.util.Map; */ public class HisQueryUtils { + private static final Logger log = LoggerFactory.getLogger(HisQueryUtils.class); + /** * 条件查询构造器 * @@ -72,7 +76,7 @@ public class HisQueryUtils { queryWrapper.ge(dbFieldName, startDate); // 大于等于 STime queryWrapper.le(dbFieldName, endDate); // 小于等于 ETime } catch (ParseException e) { - e.printStackTrace(); + log.warn("日期解析失败: startValue={}, endValue={}", startValue, endValue, e); } } } @@ -100,7 +104,7 @@ public class HisQueryUtils { queryWrapper.eq(fieldName, value); } } catch (IllegalAccessException e) { - e.printStackTrace(); + log.warn("反射获取字段值失败: field={}", field.getName(), e); } } currentClass = currentClass.getSuperclass(); diff --git a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/RedisUtil.java b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/RedisUtil.java index a57d7bf5..1aeea9ad 100644 --- a/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/RedisUtil.java +++ b/openhis-server-new/openhis-common/src/main/java/com/openhis/common/utils/RedisUtil.java @@ -1,5 +1,7 @@ package com.openhis.common.utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.*; import org.springframework.stereotype.Component; @@ -16,6 +18,8 @@ import java.util.concurrent.TimeUnit; @Component public class RedisUtil { + private static final Logger log = LoggerFactory.getLogger(RedisUtil.class); + @Autowired private RedisTemplate redisTemplate; @Autowired @@ -35,7 +39,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -60,7 +64,7 @@ public class RedisUtil { try { return redisTemplate.hasKey(key); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -104,7 +108,7 @@ public class RedisUtil { redisTemplate.opsForValue().set(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } @@ -127,7 +131,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -194,7 +198,7 @@ public class RedisUtil { redisTemplate.opsForHash().putAll(key, map); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -215,7 +219,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -233,7 +237,7 @@ public class RedisUtil { redisTemplate.opsForHash().put(key, item, value); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -255,7 +259,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -316,7 +320,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().members(key); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return null; } } @@ -332,7 +336,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().isMember(key, value); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -348,7 +352,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().add(key, values); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -369,7 +373,7 @@ public class RedisUtil { } return count; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -384,7 +388,7 @@ public class RedisUtil { try { return redisTemplate.opsForSet().size(key); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -401,7 +405,7 @@ public class RedisUtil { Long count = redisTemplate.opsForSet().remove(key, values); return count; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -419,7 +423,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().range(key, start, end); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return null; } } @@ -434,7 +438,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().size(key); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -450,7 +454,7 @@ public class RedisUtil { try { return redisTemplate.opsForList().index(key, index); } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return null; } } @@ -468,7 +472,7 @@ public class RedisUtil { redisTemplate.opsForList().rightPush(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -489,7 +493,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -507,7 +511,7 @@ public class RedisUtil { redisTemplate.opsForList().rightPushAll(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -528,7 +532,7 @@ public class RedisUtil { } return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -546,7 +550,7 @@ public class RedisUtil { redisTemplate.opsForList().set(key, index, value); return true; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis expire操作失败, key: {}", key, e); return false; } } @@ -564,7 +568,7 @@ public class RedisUtil { Long remove = redisTemplate.opsForList().remove(key, count, value); return remove; } catch (Exception e) { - e.printStackTrace(); + log.error("Redis操作失败, key: {}", key, e); return 0; } } @@ -590,7 +594,7 @@ public class RedisUtil { return binaryKeys; }); } catch (Throwable e) { - e.printStackTrace(); + log.error("Redis scan操作失败, keyPrefix: {}", keyPrefix, e); } return null; @@ -605,7 +609,7 @@ public class RedisUtil { Set keys = keys(keyPrefix); redisTemplate.delete(keys); } catch (Throwable e) { - e.printStackTrace(); + log.error("Redis删除操作失败, keyPrefix: {}", keyPrefix, e); } } diff --git a/openhis-ui-vue3/src/api/cardRenewal/api.js b/openhis-ui-vue3/src/api/cardRenewal/api.js index cbc63f62..0b7e8059 100644 --- a/openhis-ui-vue3/src/api/cardRenewal/api.js +++ b/openhis-ui-vue3/src/api/cardRenewal/api.js @@ -7,10 +7,7 @@ import request from '@/utils/request'; * @returns {Promise} 请求结果 */ export function getPatientList(query) { - // 打印日志便于调试 - console.log('调用患者查询API,参数:', query); - - // 直接复用门诊挂号模块完全相同的实现方式 + // 直接复用门诊挂号模块完全相同的实现方式 // 不做额外的参数处理,直接将query传递给后端 return request({ url: '/charge-manage/register/patient-metadata', diff --git a/openhis-ui-vue3/src/components/Auto/printBills/changeShiftBill.vue b/openhis-ui-vue3/src/components/Auto/printBills/changeShiftBill.vue index b97ce595..8c8aa627 100644 --- a/openhis-ui-vue3/src/components/Auto/printBills/changeShiftBill.vue +++ b/openhis-ui-vue3/src/components/Auto/printBills/changeShiftBill.vue @@ -61,7 +61,8 @@