diff --git a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/AsyncConfig.java b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/AsyncConfig.java index cd01e33d..d39652a0 100644 --- a/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/AsyncConfig.java +++ b/xinnengyuan/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/config/AsyncConfig.java @@ -5,11 +5,14 @@ import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.SpringUtils; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Bean; import org.springframework.core.task.VirtualThreadTaskExecutor; import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.Arrays; import java.util.concurrent.Executor; +import java.util.concurrent.ThreadPoolExecutor; /** * 异步配置 @@ -26,12 +29,36 @@ public class AsyncConfig implements AsyncConfigurer { */ @Override public Executor getAsyncExecutor() { - if(SpringUtils.isVirtual()) { + if (SpringUtils.isVirtual()) { return new VirtualThreadTaskExecutor("async-"); } return SpringUtils.getBean("scheduledExecutorService"); } + /** + * 新增:自定义线程池(可以在 @Async("capturePicExecutor") 使用) + */ + @Bean("capturePicExecutor") + public Executor customExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + // 核心线程数 + executor.setCorePoolSize(5); + // 最大线程数 + executor.setMaxPoolSize(10); + // 队列容量(超过核心线程数时,任务进入队列) + executor.setQueueCapacity(50); + // 空闲线程最大存活时间(秒) + executor.setKeepAliveSeconds(60); + // 线程名前缀,方便定位日志 + executor.setThreadNamePrefix("capturePic-async-"); + // 拒绝策略:当线程池满时 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + // CallerRunsPolicy:由调用线程执行任务(相对安全) + // 初始化 + executor.initialize(); + return executor; + } + /** * 异步执行异常处理 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/ai/chat/DashScopeChat.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/ai/chat/DashScopeChat.java index 7473cf25..b24f8d6d 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/ai/chat/DashScopeChat.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/ai/chat/DashScopeChat.java @@ -96,7 +96,7 @@ public class DashScopeChat { } // 构建生成标题的提示词 String prompt = String.format(""" - 请为下面这段用户与AI的对话生成一个简短的标题(不超过10个字),并且以陈述句的形式进行总结: + 请以陈述句的形式总结下面这段用户与AI的对话生成一个简短的标题(不超过10个字): 用户:%s AI:%s """, userMessage, aiResponse); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MilestoneVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MilestoneVo.java new file mode 100644 index 00000000..3b8e6dc4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MilestoneVo.java @@ -0,0 +1,70 @@ +package org.dromara.bigscreen.domain.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; + +import java.time.LocalDate; + +/** + * @author lilemy + * @date 2025-11-06 14:28 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class MilestoneVo { + + /** + * 主键ID + */ + private Long id; + + /** + * 节点名称 + */ + private String nodeName; + + /** + * 对应项目结构 + */ + private Long projectStructure; + + /** + * 对应项目结构名称 + */ + private String projectStructureName; + + /** + * 预计开始时间 + */ + private LocalDate planStartDate; + + /** + * 预计结束时间 + */ + private LocalDate planEndDate; + + /** + * 实际开始时间 + */ + private LocalDate practicalStartDate; + + /** + * 实际结束时间 + */ + private LocalDate practicalEndDate; + + /** + * 状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MyProjectInfoVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MyProjectInfoVo.java new file mode 100644 index 00000000..9bbd77ee --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/MyProjectInfoVo.java @@ -0,0 +1,55 @@ +package org.dromara.bigscreen.domain.vo; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +/** + * @author lilemy + * @date 2025-11-06 10:01 + */ +@Data +public class MyProjectInfoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 2737004515142334438L; + + /** + * 项目id + */ + private Long projectId; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 项目概括 + */ + private String projectGeneralize; + + /** + * 开始时间 + */ + private LocalDate StartTime; + + /** + * 结束时间 + */ + private LocalDate endTime; + + /** + * 里程碑 + */ + private List milestones; + + /** + * 进度 + */ + private BigDecimal progress; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/ProjectImageProgressDetailVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/ProjectImageProgressDetailVo.java index 55ffad16..8c113b3b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/ProjectImageProgressDetailVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/domain/vo/ProjectImageProgressDetailVo.java @@ -16,6 +16,11 @@ public class ProjectImageProgressDetailVo implements Serializable { @Serial private static final long serialVersionUID = -8317739851423164942L; + /** + * 主键 + */ + private Long id; + /** * 进度名称 */ @@ -36,4 +41,9 @@ public class ProjectImageProgressDetailVo implements Serializable { */ private BigDecimal totalProgress; + /** + * 单位 + */ + private String unit; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java index b12baeed..f66dc195 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/service/impl/ProjectBigScreenServiceImpl.java @@ -438,9 +438,15 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { Long projectId = req.getProjectId(); String progressName = req.getProgressName(); checkProject(projectId); + // 获取当前项目的所有子级 + List subProjects = projectService.lambdaQuery() + .eq(BusProject::getPId, projectId) + .list(); + Set projectIds = subProjects.stream().map(BusProject::getId).collect(Collectors.toSet()); + projectIds.add(projectId); // 获取对应进度 PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery() - .eq(PgsProgressCategory::getProjectId, projectId) + .in(PgsProgressCategory::getProjectId, projectIds) .eq(PgsProgressCategory::getName, progressName) .last("limit 1") .one(); @@ -491,6 +497,8 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { BigDecimal total = children.stream().map(PgsProgressCategory::getTotal) .reduce(BigDecimal.ZERO, BigDecimal::add); ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo(); + vo.setId(c.getId()); + vo.setUnit(c.getUnit()); vo.setProgressName(c.getName()); vo.setPlanProgress(plan); vo.setActualProgress(actual); @@ -711,7 +719,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService { // 获取当前时间 LocalDateTime now = LocalDateTime.now(); List voList = gpsEquipmentService.getUeClientList(startOfDay, now); - List appList = gpsEquipmentService.getUeUserListByProjectId( startOfDay, now); + List appList = gpsEquipmentService.getUeUserListByProjectId(startOfDay, now); // List anqmList = deviceService.getUeUserListByProjectId( startOfDay, now); // List othYs7DeviceList = othYs7DeviceService.lambdaQuery() // .list(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java index 315a23a9..1c60c0ee 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java @@ -49,10 +49,10 @@ public class IncSyncYs7DeviceCapturePicData { @Resource private Ys7Manager ys7Manager; - private final ExecutorService executorService = Executors.newFixedThreadPool(5); + private final ExecutorService executorService = Executors.newFixedThreadPool(8); // 每 15 分钟执行一次 - @Scheduled(cron = "0 */10 7-19 * * ?") + @Scheduled(cron = "0 */15 7-19 * * ?") public void run() { log.info("执行萤石设备抓拍图片"); // 获取所有项目的等级信息 @@ -60,9 +60,8 @@ public class IncSyncYs7DeviceCapturePicData { .select(HseViolationLevel::getId, HseViolationLevel::getProjectId) .list(); Set projectIds = allLevel.stream().map(HseViolationLevel::getProjectId).collect(Collectors.toSet()); - // 查询所有在线的摄像头设备,仅获取必要字段 + // 查询所有在线的摄像头设备 List deviceList = ys7DeviceService.lambdaQuery() - .select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName) .in(OthYs7Device::getProjectId, projectIds) // 仅获取设置了安全等级项目的摄像头 .eq(OthYs7Device::getStatus, OthDeviceStatusEnum.ONLINE.getValue()) .list(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/manager/recognizermanager/enums/RecognizerTypeEnum.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/manager/recognizermanager/enums/RecognizerTypeEnum.java index 7546d070..95c9da78 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/manager/recognizermanager/enums/RecognizerTypeEnum.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/manager/recognizermanager/enums/RecognizerTypeEnum.java @@ -13,10 +13,10 @@ import java.util.stream.Collectors; @Getter public enum RecognizerTypeEnum { - WEARING_ALL("穿戴安全帽反光衣", "wearingall", "1"), - NO_EQUIPMENT("没穿安全帽反光衣", "noequipment", "2"), - NO_HELMET("有反光衣没安全帽", "nohelmet", "3"), - NO_VEST("有安全帽没反光衣", "novest", "4"), +// WEARING_ALL("穿戴安全帽反光衣", "wearingall", "1"), +// NO_EQUIPMENT("没穿安全帽反光衣", "noequipment", "2"), + NO_HELMET("未戴安全帽", "nohelmet", "3"), + NO_VEST("未穿反光衣", "novest", "4"), SMOKE("吸烟", "smoke", "5"), FIRE("火焰", "fire", "6"), SMOGGY("烟雾", "smoggy", "7"), diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7DeviceImg.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7DeviceImg.java index b7890e33..4f193d10 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7DeviceImg.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7DeviceImg.java @@ -27,6 +27,11 @@ public class OthYs7DeviceImg implements Serializable { @TableId(value = "id") private Long id; + /** + * 项目id + */ + private Long projectId; + /** * 设备序列号 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/dto/ys7deviceimg/OthYs7DeviceImgQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/dto/ys7deviceimg/OthYs7DeviceImgQueryReq.java index 32cbae73..d9eccd44 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/dto/ys7deviceimg/OthYs7DeviceImgQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/dto/ys7deviceimg/OthYs7DeviceImgQueryReq.java @@ -18,6 +18,11 @@ public class OthYs7DeviceImgQueryReq implements Serializable { @Serial private static final long serialVersionUID = 5264959525029608917L; + /** + * 项目id + */ + private Long projectId; + /** * 设备序列号 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/vo/ys7deviceimg/OthYs7DeviceImgVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/vo/ys7deviceimg/OthYs7DeviceImgVo.java index 106ab445..9ebb39d6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/vo/ys7deviceimg/OthYs7DeviceImgVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/vo/ys7deviceimg/OthYs7DeviceImgVo.java @@ -32,6 +32,11 @@ public class OthYs7DeviceImgVo implements Serializable { @ExcelProperty(value = "主键id") private Long id; + /** + * 项目id + */ + private Long projectId; + /** * 设备序列号 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/service/impl/OthYs7DeviceImgServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/service/impl/OthYs7DeviceImgServiceImpl.java index cf6a172a..1dc0376d 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/service/impl/OthYs7DeviceImgServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/service/impl/OthYs7DeviceImgServiceImpl.java @@ -39,6 +39,7 @@ import org.dromara.safety.service.IHseViolationLevelService; import org.dromara.system.domain.vo.SysOssUploadVo; import org.dromara.system.service.ISysOssService; import org.springframework.beans.BeanUtils; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -146,9 +147,11 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl recTypeList = JSONUtil.toList(deviceImg.getRecType(), String.class); - List list = recTypeList.stream().map(recType -> Objects.requireNonNull(RecognizerTypeEnum.fromValue(recType)).getText()).toList(); + List list = recTypeList.stream() + .map(recType -> { + RecognizerTypeEnum type = RecognizerTypeEnum.fromValue(recType); + return type != null ? type.getText() : "未知类型"; + }) + .toList(); vo.setRecTypeList(list); return vo; }).toList(); @@ -208,6 +216,7 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl imgList) { List saveList = new ArrayList<>(); @@ -245,6 +254,7 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl 0) { BigDecimal allNumber = progressPlanService.getCurrentPlanAndFinishedNumber(progressCategory); total = PgsProgressUnitTypeEnum.PERCENTAGE.getValue().equals(progressCategory.getUnitType()) ? diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/domain/dto/vehicletrip/VehVehicleTripQueryReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/domain/dto/vehicletrip/VehVehicleTripQueryReq.java index 9cfd85ec..ae3f6c0a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/domain/dto/vehicletrip/VehVehicleTripQueryReq.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/domain/dto/vehicletrip/VehVehicleTripQueryReq.java @@ -71,4 +71,9 @@ public class VehVehicleTripQueryReq implements Serializable { */ private String tripStatus; + /** + * 车牌号 + */ + private String plateNumber; + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/service/impl/VehVehicleTripServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/service/impl/VehVehicleTripServiceImpl.java index 7a5c7e36..a1d81d2f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/service/impl/VehVehicleTripServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/vehicle/service/impl/VehVehicleTripServiceImpl.java @@ -198,6 +198,7 @@ public class VehVehicleTripServiceImpl extends ServiceImpl