diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/CustomerNoticesController.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/CustomerNoticesController.java index 2069221..dc372f4 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/CustomerNoticesController.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/controller/CustomerNoticesController.java @@ -40,7 +40,7 @@ public class CustomerNoticesController extends BaseController { /** * 查询客户服务-通知公告列表 */ - @SaCheckPermission("domain:notices:list") + //@SaCheckPermission("domain:notices:list") @GetMapping("/list") public TableDataInfo list(CustomerNoticesBo bo, PageQuery pageQuery) { return customerNoticesService.queryPageList(bo, pageQuery); @@ -62,7 +62,7 @@ public class CustomerNoticesController extends BaseController { * * @param id 主键 */ - @SaCheckPermission("domain:notices:query") + //@SaCheckPermission("domain:notices:query") @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrderAnalysisVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrderAnalysisVo.java index 5941316..f3175d9 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrderAnalysisVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrderAnalysisVo.java @@ -22,7 +22,7 @@ public class ServiceWorkOrderAnalysisVo { public LineChartVo() {} - public LineChartVo(String date, String dayOfWeek, long count) { + public LineChartVo(String date, String dayOfWeek, long count,long weekCount) { this.date = date; this.dayOfWeek = dayOfWeek; this.count = count; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerNoticesServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerNoticesServiceImpl.java index 9c7918d..25a0607 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerNoticesServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/CustomerNoticesServiceImpl.java @@ -73,7 +73,7 @@ public class CustomerNoticesServiceImpl implements ICustomerNoticesService { String usernames = filteredList.stream() .map(ResidentPerson::getUserName) // 假设ResidentPerson类有一个getUserName方法 .collect(Collectors.joining(",")); - customerNoticesVo.setIssuersName(StringUtils.isNotBlank(usernames)?usernames:null); + customerNoticesVo.setNoticePersionName(StringUtils.isNotBlank(usernames)?usernames:null); } } return customerNoticesVo; diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MachineTypeServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MachineTypeServiceImpl.java index ce2e469..042a2a3 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MachineTypeServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/MachineTypeServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.property.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -147,7 +148,7 @@ public class MachineTypeServiceImpl implements IMachineTypeService { if (CollUtil.isEmpty(machineTypeVoList)) { return Collections.emptyList(); } - List machineTypeTreeVoList = MapstructUtils.convert(machineTypeVoList, MachineTypeTreeVo.class); + List machineTypeTreeVoList = BeanUtil.copyToList(machineTypeVoList, MachineTypeTreeVo.class); // 2. 构建树结构 return buildMachineTypeTree(machineTypeTreeVoList); diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java index 1f9f52a..c5d29d0 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java @@ -379,33 +379,52 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { dateList.add(today.minusDays(i)); } - Map workOrdersByDate = serviceWorkOrdersList.stream() - .filter(order -> { - try { - LocalDate createTime = LocalDate.parse((CharSequence) order.getCreateTime()); - return !createTime.isBefore(today.minusDays(7)); - } catch (Exception e) { - return false; - } - }) - .collect(Collectors.groupingBy( - order -> LocalDate.parse((CharSequence) order.getCreateTime()).format(DateTimeFormatter.ISO_LOCAL_DATE), - Collectors.counting() - )); + // 按日期分组:统计总数量 和 已处理数量 + Map totalWorkOrdersByDate = new HashMap<>(); + Map processedWorkOrdersByDate = new HashMap<>(); - DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; + + for (ServiceWorkOrders order : serviceWorkOrdersList) { + try { + LocalDate createTime = LocalDate.parse((CharSequence) order.getCreateTime()); + if (createTime.isBefore(today.minusDays(7))) { + continue; // 跳过超过7天的数据 + } + + String dateStr = createTime.format(dateFormatter); + + // 总数 +1 + totalWorkOrdersByDate.put(dateStr, totalWorkOrdersByDate.getOrDefault(dateStr, 0L) + 1); + + // 如果已处理,processed +1 + if (isProcessed(order)) { + processedWorkOrdersByDate.put(dateStr, processedWorkOrdersByDate.getOrDefault(dateStr, 0L) + 1); + } + + } catch (Exception e) { + // 忽略格式错误的日期 + } + } + + DateTimeFormatter dateFormatterFull = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter dayOfWeekFormatter = DateTimeFormatter.ofPattern("E"); List result = new ArrayList<>(); for (LocalDate date : dateList) { - String dateStr = date.format(dateFormatter); + String dateStr = date.format(dateFormatterFull); String dayOfWeek = date.format(dayOfWeekFormatter); - result.add(new ServiceWorkOrderAnalysisVo.LineChartVo(dateStr, dayOfWeek, workOrdersByDate.getOrDefault(dateStr, 0L))); + long total = totalWorkOrdersByDate.getOrDefault(dateStr, 0L); + long processed = processedWorkOrdersByDate.getOrDefault(dateStr, 0L); + result.add(new ServiceWorkOrderAnalysisVo.LineChartVo(dateStr, dayOfWeek, total, processed)); } return result; } - + private boolean isProcessed(ServiceWorkOrders order) { + // 假设有一个字段 status 表示状态,"COMPLETED" 表示已处理 + return "4".equalsIgnoreCase(order.getStatus()); + } // 计算工单类型分布 private List calculateWorkOrderTypeDistribution(List serviceWorkOrdersList) { // 按 typeId 分组统计数量