diff --git a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml index 40d0586e..064567a6 100644 --- a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml +++ b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml @@ -326,7 +326,7 @@ ys7: app-key: 3acf9f1a43dc4209841e0893003db0a2 app-secret: 09e29c70ae1161fbc3ce2030fc09ba2e job: - capture-enabled: true # 控制是否启用萤石抓拍任务 + capture-enabled: false # 控制是否启用萤石抓拍任务 device-sync-enabled: true # 控制是否同步萤石设备 # 斯巴达算法 sparta: diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java index c6f51585..e31a2a30 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java @@ -186,14 +186,6 @@ public class ProjectBigScreenController extends BaseController { @GetMapping("/news/{projectId}") public R> getProjectNews(@NotNull(message = "主键不能为空") @PathVariable Long projectId) { -// List busCorporateEvents = projectBigScreenMapper.getBusCorporateEvents(); -// return R.ok(busCorporateEvents.stream().map(event -> { -// BusProjectNewsVo vo = new BusProjectNewsVo(); -// vo.setId(event.getId()); -// vo.setTitle(event.getHeadline()); -// vo.setContent(event.getContent()); -// return vo; -// }).toList()); return R.ok(projectBigScreenService.getProjectNews(projectId)); } @@ -204,23 +196,6 @@ public class ProjectBigScreenController extends BaseController { @GetMapping("/safetyInspection/{projectId}") public R> getProjectSafetyInspection(@NotNull(message = "主键不能为空") @PathVariable Long projectId) { -/* BusProject project = projectService.getById(projectId); - projectId = project.getGoId(); - String pic; - if (projectId == 60) { - pic = "http://xny.yj-3d.com:7464"; - } else { - pic = "http://xny.yj-3d.com:7363"; - } - List busTours = projectBigScreenMapper.selectTourByProjectId(projectId); - return R.ok(busTours.stream().map(tour -> { - ProjectSafetyInspectionVo vo = new ProjectSafetyInspectionVo(); - vo.setId(tour.getId()); - vo.setViolationType(tour.getTourType()); - vo.setPicture(pic + tour.getPicture()); - vo.setCreateTime(tour.getCreatedAt()); - return vo; - }).toList());*/ return R.ok(projectBigScreenService.getProjectSafetyInspection(projectId)); } @@ -231,51 +206,6 @@ public class ProjectBigScreenController extends BaseController { @GetMapping("/people/{projectId}") public R getProjectPeople(@NotNull(message = "主键不能为空") @PathVariable Long projectId) { -// BusProject project = projectService.getById(projectId); -// projectId = project.getGoId(); -// Integer projectUserCount = projectBigScreenMapper.getProjectUserCount(projectId); -// ProjectPeopleVo vo = new ProjectPeopleVo(); -// vo.setPeopleCount(BigDecimal.valueOf(projectUserCount)); -// Integer attendanceCount = projectBigScreenMapper.getAttendanceCount(projectId, DateUtils.getDate()); -// vo.setAttendanceCount(BigDecimal.valueOf(attendanceCount)); -// vo.setAttendanceRate(BigDecimalUtil.toPercentage(BigDecimal.valueOf(attendanceCount), BigDecimal.valueOf(projectUserCount))); -// List projectUserList = projectBigScreenMapper.getProjectUserList(projectId); -// List teamList = projectBigScreenMapper.getTeamList(projectId); -// -// List teamAttendanceList = new ArrayList<>(); -// String punchRange = project.getPunchRange(); -// String punchTime = ""; -// if (punchRange != null) { -// String start = punchRange.split(",")[0]; -// punchTime = LocalDate.now() + " " + start; -// } -// if (projectUserList != null && teamList != null) { -// projectUserList = projectUserList.stream().filter(user -> user.getTeamId() != null).toList(); -// Map> userMap = projectUserList.stream() -// .collect(Collectors.groupingBy(BusConstructionUser::getTeamId)); -// for (BusProjectTeamByGo team : teamList) { -// ProjectTeamAttendanceVo vo1 = new ProjectTeamAttendanceVo(); -// vo1.setId(team.getId()); -// vo1.setTeamName(team.getName()); -// vo1.setAttendanceTime(punchTime); -// vo1.setAttendanceNumber(BigDecimal.ZERO); -// List userList = userMap.get(team.getId()); -// if (CollUtil.isNotEmpty(userList)) { -// List list = userList.stream().map(BusConstructionUser::getOpenid).distinct().toList(); -// Integer aCount = projectBigScreenMapper.getAttendanceCountByOpenIds(list, LocalDate.now()); -// vo1.setAttendanceNumber(BigDecimal.valueOf(aCount)); -// } -// vo1.setAllNumber(BigDecimal.valueOf(userMap.getOrDefault(team.getId(), List.of()).size())); -// if (vo1.getAttendanceNumber() != null && vo1.getAllNumber() != null && vo1.getAllNumber().compareTo(BigDecimal.ZERO) != 0) { -// vo1.setAttendanceRate(BigDecimalUtil.toPercentage(vo1.getAttendanceNumber(), vo1.getAllNumber())); -// } else { -// vo1.setAttendanceRate(BigDecimal.ZERO); -// } -// teamAttendanceList.add(vo1); -// } -// } -// vo.setTeamAttendanceList(teamAttendanceList); -// return R.ok(vo); return R.ok(projectBigScreenService.getProjectPeople(projectId)); } @@ -296,18 +226,7 @@ public class ProjectBigScreenController extends BaseController { @GetMapping("/generalize/{projectId}") public R getProjectGeneralize(@NotNull(message = "主键不能为空") @PathVariable Long projectId) { -// BusProject project = projectService.getById(projectId); -// if (project != null) { -// Long goId = project.getGoId(); -// if (goId != null) { -// List sysProjectIntroduces = projectBigScreenMapper.selectByProjectId(goId); -// if (CollUtil.isNotEmpty(sysProjectIntroduces)) { -// return R.ok(sysProjectIntroduces.getFirst().getRichText()); -// } -// } -// } return R.ok(projectBigScreenService.getProjectGeneralize(projectId)); -// return R.ok(); } /** @@ -347,11 +266,11 @@ public class ProjectBigScreenController extends BaseController { if (count > 0) { throw new ServiceException("已存在同名萤石摄像头", HttpStatus.CONFLICT); } - // todo 更新云端名称 -/* Boolean result = ys7Manager.updateDeviceName(one.getDeviceSerial(), deviceName); + // 更新云端名称 + Boolean result = ys7Manager.updateDeviceName(one.getDeviceSerial(), deviceName); if (!result) { throw new ServiceException("更新云端萤石摄像头名称异常", HttpStatus.ERROR); - }*/ + } } return toAjax(othYs7DeviceService.updateById(ys7Device)); } @@ -409,7 +328,7 @@ public class ProjectBigScreenController extends BaseController { @SaCheckPermission("project:big:screen") @PostMapping("/updatePosition") public R updatePosition(@RequestBody ProjectUpdateDto dto) { - return toAjax(projectService.updatePosition(dto)); + return toAjax(projectService.updatePosition(dto)); } @@ -437,7 +356,7 @@ public class ProjectBigScreenController extends BaseController { */ // @SaCheckPermission("project:big:screen") @GetMapping("/setWrjHc") - public void setWrjHc(){ + public void setWrjHc() { projectBigScreenService.setWrjHc(); } @@ -446,7 +365,7 @@ public class ProjectBigScreenController extends BaseController { */ // @SaCheckPermission("project:big:screen") @GetMapping("/getInfoData") - public R>> getInfoData(TanchuangInfoReq req){ + public R>> getInfoData(TanchuangInfoReq req) { return R.ok(projectBigScreenService.getInfoData(req)); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionAllValueVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionAllValueVo.java index 99e375f9..21b73cf2 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionAllValueVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionAllValueVo.java @@ -25,4 +25,19 @@ public class OutConstructionAllValueVo implements Serializable { * 对甲产值 */ private BigDecimal ownerValue; + + /** + * 人工填报数量 + */ + private BigDecimal artificialNum; + + /** + * 无人机识别数量 + */ + private BigDecimal uavNum; + + /** + * 确认数量 + */ + private BigDecimal confirmNum; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java index 2116e848..9f52a4bc 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java @@ -171,4 +171,9 @@ public class OutConstructionValueVo implements Serializable { * 工作类型 */ private String workType; + + /** + * 计量方式(0无 1数量 2百分比) + */ + private String unitType; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/impl/OutConstructionValueServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/impl/OutConstructionValueServiceImpl.java index e51c2ece..87e5e8b8 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/impl/OutConstructionValueServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/impl/OutConstructionValueServiceImpl.java @@ -275,6 +275,27 @@ public class OutConstructionValueServiceImpl extends ServiceImpl correctList; + + /** + * 整改总数 */ private Long correctSituation; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/quality/service/impl/QltQualityInspectionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/quality/service/impl/QltQualityInspectionServiceImpl.java index 0942f58e..50d8ec4f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/quality/service/impl/QltQualityInspectionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/quality/service/impl/QltQualityInspectionServiceImpl.java @@ -36,10 +36,8 @@ import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionListG import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo; import org.dromara.quality.mapper.QltQualityInspectionMapper; import org.dromara.quality.service.IQltQualityInspectionService; -import org.dromara.system.domain.vo.SysDictDataVo; import org.dromara.system.domain.vo.SysOssVo; import org.dromara.system.service.ISysDictDataService; -import org.dromara.system.service.ISysDictTypeService; import org.dromara.system.service.ISysOssService; import org.dromara.system.service.ISysUserService; import org.dromara.websocket.ChatServerHandler; @@ -83,9 +81,6 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl dictDataVoList = dictTypeService.selectDictDataByType(QltQualityConstant.QUALITY_INSPECTION_CHECK_TYPE); - Map dictDataMap = dictDataVoList.stream().collect(Collectors.toMap(SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel)); - // 获取最新的检查工单 - List topList = qualityInspectionList.stream() - .sorted(Comparator.comparing(QltQualityInspection::getCreateTime).reversed()) - .limit(Optional.ofNullable(req.getPageSize()).orElse(20)) - .toList(); - // 转换为 GIS 对象,并设置标签 - List gisList = topList.stream().map(qualityInspection -> { - QltQualityInspectionGis gis = new QltQualityInspectionGis(); - BeanUtils.copyProperties(qualityInspection, gis); - String label = dictDataMap.get(qualityInspection.getInspectionType()); - if (label != null) { - gis.setInspectionTypeLabel(label); - } - return gis; - }).toList(); - // 获取整改情况 - long passCount = 0L; - for (QltQualityInspection qualityInspection : qualityInspectionList) { - if ("1".equals(qualityInspection.getIsReply())) { - if (!qualityInspection.getInspectionStatus().equals(QltQualityInspectionStatusEnum.INFORM.getValue())) { - passCount++; - } - } - } - gisVo.setList(gisList); - gisVo.setCount((long) qualityInspectionList.stream() + // 获取巡检情况 + List list = qualityInspectionList.stream() .filter(q -> "2".equals(q.getIsReply())) - .toList() - .size()); - gisVo.setCorrectSituation(passCount); + .toList().stream().map(q -> { + QltQualityInspectionGis gis = new QltQualityInspectionGis(); + BeanUtils.copyProperties(q, gis); + return gis; + }).toList(); + gisVo.setList(list.stream() + .sorted(Comparator.comparing(QltQualityInspectionGis::getCreateTime).reversed()) + .limit(Optional.ofNullable(req.getPageSize()).orElse(20)) + .toList()); + gisVo.setCount((long) list.size()); + // 获取整改情况 + List correctList = qualityInspectionList.stream() + .filter(q -> "1".equals(q.getIsReply())) + .filter(q -> !q.getInspectionStatus().equals(QltQualityInspectionStatusEnum.INFORM.getValue())) + .toList().stream().map(q -> { + QltQualityInspectionGis gis = new QltQualityInspectionGis(); + BeanUtils.copyProperties(q, gis); + return gis; + }).toList(); + gisVo.setCorrectSituation((long) correctList.size()); + gisVo.setCorrectList(correctList.stream() + .sorted(Comparator.comparing(QltQualityInspectionGis::getCreateTime).reversed()) + .limit(Optional.ofNullable(req.getPageSize()).orElse(20)) + .toList()); // gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size())); return gisVo; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseRecognizeRecordController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseRecognizeRecordController.java index 3daaadf7..10325a9e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseRecognizeRecordController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HseRecognizeRecordController.java @@ -3,7 +3,6 @@ package org.dromara.safety.controller; import cn.dev33.satoken.annotation.SaCheckPermission; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import org.dromara.common.core.domain.R; import org.dromara.common.excel.utils.ExcelUtil; @@ -74,7 +73,7 @@ public class HseRecognizeRecordController extends BaseController { @SaCheckPermission("safety:recognizeRecord:remove") @Log(title = "识别记录", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") - public R remove(@NotEmpty(message = "主键不能为空") + public R remove(@NotNull(message = "主键不能为空") @PathVariable Long id) { return toAjax(recognizeRecordService.deleteById(id)); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionGis.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionGis.java new file mode 100644 index 00000000..9c0fff89 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionGis.java @@ -0,0 +1,53 @@ +package org.dromara.safety.domain.vo.safetyinspection; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-10-17 09:26 + */ +@Data +public class HseSafetyInspectionGis implements Serializable { + + @Serial + private static final long serialVersionUID = 3098473090533804934L; + + /** + * 主键ID + */ + private Long id; + + /** + * 项目ID + */ + private Long projectId; + + /** + * 检查类型 + */ + private String checkType; + + /** + * 检查项目 + */ + private String checkProject; + + /** + * 违章类型 + */ + private String violationType; + + /** + * 巡检结果 + */ + private String inspectionResult; + + /** + * 工单状态(1通知 2整改 3复查) + */ + private String status; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionListGisVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionListGisVo.java index 415e1407..157f4ace 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionListGisVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/safetyinspection/HseSafetyInspectionListGisVo.java @@ -27,11 +27,21 @@ public class HseSafetyInspectionListGisVo implements Serializable { */ private Long teamMeetingCount; + /** + * 安全巡检列表 + */ + private List safetyInspectionList; + /** * 安全巡检总数 */ private Long safetyInspectionCount; + /** + * 整改情况列表 + */ + private List correctSituationList; + /** * 整改情况总数 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java index 49a563d6..f53ad932 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java @@ -35,6 +35,7 @@ import org.dromara.safety.domain.HseSafetyInspection; import org.dromara.safety.domain.HseTeamMeeting; import org.dromara.safety.domain.dto.safetyinspection.*; import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum; +import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionGis; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo; import org.dromara.safety.domain.vo.teammeeting.HseTeamMeetingGis; @@ -229,11 +230,28 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl passList = safetyInspectionList.stream() + .filter(q -> "1".equals(q.getIsReply())) + .filter(q -> !q.getStatus().equals(HseSafetyInspectionStatusEnum.INFORM.getValue())) + .toList(); + List pass = passList.stream().map(s -> { + HseSafetyInspectionGis gis = new HseSafetyInspectionGis(); + BeanUtils.copyProperties(s, gis); + return gis; + }).toList(); gisVo.setTeamMeetingCount((long) teamMeetings.size()); - gisVo.setSafetyInspectionCount((long) safetyInspectionList.stream() + List inspections = safetyInspectionList.stream() .filter(q -> "2".equals(q.getIsReply())) - .toList().size()); + .toList() + .stream().map(p -> { + HseSafetyInspectionGis gis = new HseSafetyInspectionGis(); + BeanUtils.copyProperties(p, gis); + return gis; + }).toList(); + gisVo.setSafetyInspectionCount((long) inspections.size()); + gisVo.setSafetyInspectionList(inspections); gisVo.setCorrectSituationCount(passCount); + gisVo.setCorrectSituationList(pass); gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size())); return gisVo; }