From 6a6b4069d80e87f1b91024b5e8ea8fa181cfc328 Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Fri, 6 Jun 2025 16:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=B7=AE=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessTripApprovalController.java | 12 ++++++----- .../interceptor/DictionaryInterceptor.java | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BusinessTripApprovalController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BusinessTripApprovalController.java index 8129f24..b955160 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BusinessTripApprovalController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BusinessTripApprovalController.java @@ -78,13 +78,15 @@ public class BusinessTripApprovalController extends BaseController { dto.setDepartment(user.getDept().getDeptName()); List togUserIdList = dto.getTogUserIdList(); StringBuilder ids = new StringBuilder(); - for (Long aLong : togUserIdList) { - if (ids.length() > 0) { - ids.append(","); + if (togUserIdList != null && !togUserIdList.isEmpty()) { + for (Long aLong : togUserIdList) { + if (ids.length() > 0) { + ids.append(","); + } + ids.append(aLong); } - ids.append(aLong); + dto.setTogUserIds(ids.toString()); } - dto.setTogUserIds(ids.toString()); return toAjax(businessTripApprovalService.save(dto)); } diff --git a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java index 4c34c29..2187110 100644 --- a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java +++ b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java @@ -60,6 +60,26 @@ public class DictionaryInterceptor implements Interceptor { } + if (StrUtil.equals(field.getName(), "startDate")) { + field.setAccessible(true); + Long passTime = (Long) field.get(obj); + try { + ReflectUtil.setFieldValue(obj, field.getName() + "Cn", DateUtil.format(DateUtil.date(passTime * 1000), DatePattern.NORM_DATETIME_PATTERN)); + } catch (Exception ignored) { + } + + } + + if (StrUtil.equals(field.getName(), "endDate")) { + field.setAccessible(true); + Long passTime = (Long) field.get(obj); + try { + ReflectUtil.setFieldValue(obj, field.getName() + "Cn", DateUtil.format(DateUtil.date(passTime * 1000), DatePattern.NORM_DATETIME_PATTERN)); + } catch (Exception ignored) { + } + + } + if (StrUtil.endWith(field.getName(), "Time") && field.getType().equals(Long.class)) { field.setAccessible(true); field.setAccessible(true);