feat(safety): 新增安全培训测评功能
- 添加了安全培训考核报告相关实体、控制器、服务和映射器
- 实现了测评任务管理功能,包括开始测评和提交测评结果
- 新增培训完成记录的增删改查接口
- 添加安全基础实体类和基础服务实现
- 更新应用配置文件并添加开发环境配置
- 在pom.xml中引入lombok依赖和编译插件配置
- 创建安全模块前端联调文档,详细说明接口规范和使用方式
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # safety模åå端èè°ææ¡£ |
| | | |
| | | æ´æ°æ¶é´ï¼2026-05-25 |
| | | |
| | | ## 1. å
Œ
±çº¦å® |
| | | |
| | | ### 1.1 è®¤è¯ |
| | | |
| | | - 请æ±å¤´ï¼`Authorization: Bearer ${token}` |
| | | - ç»å½æ¥å£ï¼`POST /login` |
| | | |
| | | ### 1.2 ç»ä¸è¿å |
| | | |
| | | æ®éæ¥å£ç»ä¸è¿å `AjaxResult`ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 200, |
| | | "msg": "æä½æå", |
| | | "data": {} |
| | | } |
| | | ``` |
| | | |
| | | ### 1.3 å页è¿å |
| | | |
| | | safety 模åå表æ¥å£è¿å MyBatis Plus `Page`ï¼æ ¸å¿åæ®µï¼ |
| | | |
| | | - `data.records` |
| | | - `data.total` |
| | | - `data.current` |
| | | - `data.size` |
| | | |
| | | åé¡µåæ°å»ºè®®ç»ä¸ä½¿ç¨ï¼ |
| | | |
| | | - `pageNum` |
| | | - `pageSize` |
| | | |
| | | ### 1.4 æ¥ææ ¼å¼ |
| | | |
| | | - `LocalDate`ï¼`yyyy-MM-dd` |
| | | - `LocalDateTime`ï¼`yyyy-MM-dd HH:mm:ss` |
| | | |
| | | ### 1.5 å
Œ
±å段 |
| | | |
| | | ææ safety å®ä½é½å
å«ä»¥ä¸å
Œ
±åæ®µï¼æ°å¢æ¶æ éä¼ ï¼ï¼ |
| | | |
| | | - `id` |
| | | - `createBy` |
| | | - `createTime` |
| | | - `updateBy` |
| | | - `updateTime` |
| | | - `remark` |
| | | - `delFlag`ï¼é»è¾å é¤ï¼ |
| | | - `tenantId` |
| | | |
| | | ## 2. æ¥å£æ¸
å |
| | | |
| | | ### 2.1 åºç¡æ¡£æ¡ |
| | | |
| | | - äººåæ¡£æ¡ |
| | | - `GET /safety/personnel/list` |
| | | - `POST /safety/personnel/add` |
| | | - `PUT /safety/personnel/update` |
| | | - `DELETE /safety/personnel/delete/{id}` |
| | | - `GET /safety/personnel/detail/{id}` |
| | | - å²ä½é£é© |
| | | - `GET /safety/risk/list` |
| | | - `POST /safety/risk/add` |
| | | - `PUT /safety/risk/update` |
| | | - `DELETE /safety/risk/delete/{id}` |
| | | - `GET /safety/risk/detail/{id}` |
| | | - ä½ä¸åºå |
| | | - `GET /safety/workArea/list` |
| | | - `GET /safety/workArea/all` |
| | | - `POST /safety/workArea/add` |
| | | - `PUT /safety/workArea/update` |
| | | - `DELETE /safety/workArea/delete/{id}` |
| | | - `GET /safety/workArea/detail/{id}` |
| | | - 设å¤è®¾æ½ |
| | | - `GET /safety/equipment/list` |
| | | - `POST /safety/equipment/add` |
| | | - `PUT /safety/equipment/update` |
| | | - `DELETE /safety/equipment/delete/{id}` |
| | | - `GET /safety/equipment/detail/{id}` |
| | | - åºæ¥èµæº |
| | | - `GET /safety/emergency/list` |
| | | - `POST /safety/emergency/add` |
| | | - `PUT /safety/emergency/update` |
| | | - `DELETE /safety/emergency/delete/{id}` |
| | | - `GET /safety/emergency/detail/{id}` |
| | | |
| | | ### 2.2 å·¡æ£ |
| | | |
| | | - å·¡æ£è®°å½ |
| | | - `GET /safety/inspection/record/list` |
| | | - `POST /safety/inspection/record/add` |
| | | - `PUT /safety/inspection/record/update` |
| | | - `DELETE /safety/inspection/record/delete/{id}` |
| | | - `POST /safety/inspection/record/sync`ï¼æ°å¢ï¼æ¨¡æåç³»ç»åæ¥ï¼èªå¨å建18æ¡ï¼ |
| | | - å·¡æ£ç»è®¡ |
| | | - `GET /safety/inspection/statistics/today` |
| | | - `GET /safety/inspection/statistics/trend` |
| | | - `GET /safety/inspection/statistics/type` |
| | | - `GET /safety/inspection/statistics/inspector` |
| | | |
| | | ### 2.3 å¹è®å¦ä¹ |
| | | |
| | | - å¹è®èµæ |
| | | - `GET /safety/training/material/list` |
| | | - `POST /safety/training/material/upload`ï¼ä¿åå
æ°æ®ï¼ |
| | | - `PUT /safety/training/material/update` |
| | | - `DELETE /safety/training/material/delete/{id}` |
| | | - `GET /safety/training/material/detail/{id}` |
| | | - å¹è®è®¡å |
| | | - `GET /safety/training/plan/list` |
| | | - `POST /safety/training/plan/add` |
| | | - `PUT /safety/training/plan/update` |
| | | - `DELETE /safety/training/plan/delete/{id}` |
| | | - `GET /safety/training/plan/detail/{id}` |
| | | - å¹è®å®æè®°å½ |
| | | - `GET /safety/training/record/list` |
| | | - `POST /safety/training/record/add` |
| | | - `PUT /safety/training/record/update` |
| | | - `DELETE /safety/training/record/delete/{id}` |
| | | - `GET /safety/training/record/detail/{id}` |
| | | - `GET /safety/training/record/export` |
| | | - åå·¥å¦ä¹ è®°å½ |
| | | - `GET /safety/learning/record/list` |
| | | - `GET /safety/learning/record/statistics` |
| | | |
| | | ### 2.4 æµè¯ä¸æ¥å |
| | | |
| | | - æµè¯ä»»å¡ |
| | | - `GET /safety/learning/assessment/list` |
| | | - `POST /safety/learning/assessment/start` |
| | | - `POST /safety/learning/assessment/submit` |
| | | - èæ ¸æ¥å |
| | | - `GET /safety/learning/report/list` |
| | | - `GET /safety/learning/report/detail/{id}` |
| | | |
| | | ## 3. å·¡æ£æ¨¡åèè°éç¹ |
| | | |
| | | ### 3.1 å·¡æ£è®°å½æ¥è¯¢ |
| | | |
| | | `GET /safety/inspection/record/list` |
| | | |
| | | å¯ç¨çéåæ°ï¼ |
| | | |
| | | - `startDate`ã`endDate`ï¼æå·¡æ£æ¶é´åºé´ï¼ |
| | | - `inspectorId`ã`inspector` |
| | | - `areaId`ã`area` |
| | | - `type` |
| | | - `status` |
| | | - `pageNum`ã`pageSize` |
| | | |
| | | å
³é®åæ®µï¼ |
| | | |
| | | - `inspectionTime` |
| | | - `inspectorId`ã`inspector` |
| | | - `areaId`ã`area` |
| | | - `type` |
| | | - `status` |
| | | - `abnormalDesc` |
| | | - `isMissed` |
| | | |
| | | ### 3.2 å·¡æ£ç¶æå£å¾ï¼å端ç»è®¡å£å¾ï¼ |
| | | |
| | | - `status=0`ï¼å·²å®æï¼æ£å¸¸ï¼ |
| | | - `status=1`ï¼å·²å®æï¼å¼å¸¸ï¼ |
| | | - `status=2`ï¼å·²å®æï¼æ¼æ£ï¼ |
| | | - `status=3`ï¼æªæ§è¡ |
| | | - `isMissed=1`ï¼ä¹è®¡å
¥æ¼æ£ç»è®¡ |
| | | |
| | | ### 3.3 åæ¥æ¨¡æåç³»ç»æ°æ®ï¼æ°å¢ï¼ |
| | | |
| | | æ¥å£ï¼`POST /safety/inspection/record/sync` |
| | | |
| | | ç¨éï¼å端ç¹å»âåæ¥æ°æ®âæé®æ¶è°ç¨ï¼ç³»ç»ä¼èªå¨çæ 18 æ¡æ¨¡æå·¡æ£æ°æ®åå
¥æ°æ®åºï¼å¹¶å°è¿ 18 æ¡è®°å½è¿åç»å端ã |
| | | |
| | | 请æ±åæ°ï¼æ |
| | | |
| | | è°ç¨éå¶ï¼æ¯å¤©åªè½æåè°ç¨ 1 次ï¼Redis æâç§æ·+æ¥æâæ§å¶ï¼ãåä¸å¤©éå¤è°ç¨ä¼è¿å失败æç¤ºï¼`仿¥å·²åæ¥ï¼æå¤©åè¯`ã |
| | | |
| | | è¿å示ä¾ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 200, |
| | | "msg": "æä½æå", |
| | | "data": { |
| | | "count": 18, |
| | | "records": [ |
| | | { |
| | | "inspectionTime": "2026-05-25 08:20:00", |
| | | "inspectorId": 101, |
| | | "inspector": "inspector-a", |
| | | "areaId": 1, |
| | | "area": "workshop-a", |
| | | "type": "daily", |
| | | "status": 0, |
| | | "abnormalDesc": null, |
| | | "isMissed": 0 |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | èè°å»ºè®®è°ç¨é¡ºåºï¼ |
| | | |
| | | 1. ç¹å»åæ¥æé®åå
è°ç¨ `POST /safety/inspection/record/sync` |
| | | 2. æååå·æ°å表ï¼`GET /safety/inspection/record/list` |
| | | 3. åå·æ°ç»è®¡å¡çåå¾è¡¨ï¼ |
| | | - `GET /safety/inspection/statistics/today` |
| | | - `GET /safety/inspection/statistics/trend` |
| | | - `GET /safety/inspection/statistics/type` |
| | | - `GET /safety/inspection/statistics/inspector` |
| | | |
| | | ### 3.4 å·¡æ£ç»è®¡é»è®¤æ¶é´èå´ |
| | | |
| | | `trend/type/inspector` ä¸ä¸ªç»è®¡æ¥å£è¥ä¸ä¼ `startDate/endDate`ï¼å端é»è®¤æè¿ 7 天ï¼å½å¤©å¾åæ¨ 6 天ï¼ã |
| | | |
| | | ## 4. å¹è®èµæä¸ä¼ 说æ |
| | | |
| | | `/safety/training/material/upload` åªä¿åèµæå
æ°æ®ï¼ä¸æ¥æ¶äºè¿å¶æä»¶ã |
| | | |
| | | æ¨èæµç¨ï¼ |
| | | |
| | | 1. å
è°ç¨ `POST /common/upload` ä¸ä¼ æä»¶ |
| | | 2. æ¿å° `url/fileName/originalFilename` åè°ç¨ `POST /safety/training/material/upload` ä¿åå
æ°æ® |
| | | |
| | | ## 5. å端å°è£
示ä¾ï¼å·¡æ£åæ¥ï¼ |
| | | |
| | | ```js |
| | | import request from '@/utils/request' |
| | | |
| | | export function syncInspectionData() { |
| | | return request({ |
| | | url: '/safety/inspection/record/sync', |
| | | method: 'post' |
| | | }) |
| | | } |
| | | ``` |
| | | |
| | | ## 6. å¹è®å®æè®°å½è¡¥å
ï¼å¢å æ¹æ¥ï¼ |
| | | |
| | | åºç¡å°åï¼`/safety/training/record` |
| | | |
| | | 已弿¾æ¥å£ï¼ |
| | | |
| | | 1. `GET /list`ï¼å页æ¥è¯¢ |
| | | 2. `POST /add`ï¼æ°å¢ |
| | | 3. `PUT /update`ï¼ä¿®æ¹ |
| | | 4. `DELETE /delete/{id}`ï¼å é¤ |
| | | 5. `GET /detail/{id}`ï¼è¯¦æ
|
| | | 6. `GET /export`ï¼å¯¼åº |
| | | |
| | | æ°å¢/ä¿®æ¹è¯·æ±ä½ç¤ºä¾ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "planId": 1, |
| | | "employeeId": 1001, |
| | | "employeeName": "å¼ ä¸", |
| | | "content": "ä¸çº§å®å
¨æè²å¹è®", |
| | | "completeTime": "2026-05-25 10:00:00", |
| | | "duration": 2.0, |
| | | "method": "çº¿ä¸æè¯¾", |
| | | "result": "éè¿", |
| | | "score": 92, |
| | | "status": 1, |
| | | "remark": "è¡¥å½" |
| | | } |
| | | ``` |
| | |
| | | <okhttp.version>4.9.0</okhttp.version>
|
| | | <logback.version>1.2.13</logback.version>
|
| | | <spring-security.version>5.7.12</spring-security.version>
|
| | | <spring-framework.version>5.3.39</spring-framework.version>
|
| | | <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
| | | </properties>
|
| | | <spring-framework.version>5.3.39</spring-framework.version> |
| | | <mybatis-plus.version>3.5.3.1</mybatis-plus.version> |
| | | <lombok.version>1.18.42</lombok.version> |
| | | </properties> |
| | |
|
| | | <dependencies>
|
| | | <dependency>
|
| | |
| | |
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.13.0</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${project.build.sourceEncoding}</encoding> |
| | | <proc>full</proc> |
| | | <annotationProcessorPaths> |
| | | <path> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>${lombok.version}</version> |
| | | </path> |
| | | </annotationProcessorPaths> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentReport; |
| | | import com.ruoyi.safety.service.SafetyAssessmentReportService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-èæ ¸æ¥åæ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-èæ ¸æ¥å") |
| | | @RequestMapping("/safety/learning/report") |
| | | public class SafetyAssessmentReportController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyAssessmentReportService reportService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢èæ ¸æ¥åã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-èæ ¸æ¥å-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢èæ ¸æ¥å") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyAssessmentReport> page, SafetyAssessmentReport query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(reportService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢èæ ¸æ¥å详æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-èæ ¸æ¥å-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢èæ ¸æ¥å详æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(reportService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTask; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTaskEmployee; |
| | | import com.ruoyi.safety.service.SafetyAssessmentTaskEmployeeService; |
| | | import com.ruoyi.safety.service.SafetyAssessmentTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-æµè¯ä»»å¡æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-æµè¯ä»»å¡") |
| | | @RequestMapping("/safety/learning/assessment") |
| | | public class SafetyAssessmentTaskController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyAssessmentTaskService taskService; |
| | | |
| | | @Autowired |
| | | private SafetyAssessmentTaskEmployeeService taskEmployeeService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æµè¯ä»»å¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-æµè¯ä»»å¡-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢æµè¯ä»»å¡") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyAssessmentTask> page, SafetyAssessmentTask query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(taskService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * å¼å§æµè¯ï¼çæå½åå工䏿µè¯ä»»å¡çå
³èè®°å½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-æµè¯ä»»å¡-å¼å§æµè¯", businessType = BusinessType.INSERT) |
| | | @ApiOperation("å¼å§æµè¯") |
| | | @PostMapping("/start") |
| | | public AjaxResult start(@RequestBody SafetyAssessmentTaskEmployee request) { |
| | | return toAjax(taskEmployeeService.start(request)); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤æµè¯ç»æã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-æµè¯ä»»å¡-æäº¤æµè¯", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("æäº¤æµè¯") |
| | | @PostMapping("/submit") |
| | | public AjaxResult submit(@RequestBody SafetyAssessmentTaskEmployee request) { |
| | | return toAjax(taskEmployeeService.submit(request)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç Controller å
Œ
±æ¹æ³ã |
| | | */ |
| | | public abstract class SafetyControllerSupport { |
| | | |
| | | /** |
| | | * å
¼å®¹ MyBatis Plus ç current/size ä¸ææ¡£ä¸ç pageNum/pageSize å页忰ã |
| | | */ |
| | | protected <T> Page<T> buildPage(Page<T> page, Long pageNum, Long pageSize) { |
| | | Page<T> result = page == null ? new Page<T>() : page; |
| | | if (pageNum != null) { |
| | | result.setCurrent(pageNum); |
| | | } |
| | | if (pageSize != null) { |
| | | result.setSize(pageSize); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * å°å¸å°å¤çç»æè½¬æ¢ä¸ºç»ä¸ååºã |
| | | */ |
| | | protected AjaxResult toAjax(boolean success) { |
| | | return success ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyEmergencyResource; |
| | | import com.ruoyi.safety.service.SafetyEmergencyResourceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-åºæ¥èµæºæ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-åºæ¥èµæº") |
| | | @RequestMapping("/safety/emergency") |
| | | public class SafetyEmergencyResourceController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyEmergencyResourceService emergencyResourceService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢åºæ¥èµæºã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åºæ¥èµæº-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢åºæ¥èµæº") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyEmergencyResource> page, SafetyEmergencyResource query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(emergencyResourceService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åºæ¥èµæºã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åºæ¥èµæº-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢åºæ¥èµæº") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyEmergencyResource resource) { |
| | | return toAjax(emergencyResourceService.saveSafety(resource)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åºæ¥èµæºã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åºæ¥èµæº-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹åºæ¥èµæº") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyEmergencyResource resource) { |
| | | return toAjax(emergencyResourceService.updateSafety(resource)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åºæ¥èµæºã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åºæ¥èµæº-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤åºæ¥èµæº") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(emergencyResourceService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åºæ¥èµæºè¯¦æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åºæ¥èµæº-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢åºæ¥èµæºè¯¦æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(emergencyResourceService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyEquipment; |
| | | import com.ruoyi.safety.service.SafetyEquipmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-设å¤è®¾æ½æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-设å¤è®¾æ½") |
| | | @RequestMapping("/safety/equipment") |
| | | public class SafetyEquipmentController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyEquipmentService equipmentService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤è®¾æ½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-设å¤è®¾æ½-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢è®¾å¤è®¾æ½") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyEquipment> page, SafetyEquipment query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(equipmentService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤è®¾æ½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-设å¤è®¾æ½-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢è®¾å¤è®¾æ½") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyEquipment equipment) { |
| | | return toAjax(equipmentService.saveSafety(equipment)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤è®¾æ½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-设å¤è®¾æ½-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹è®¾å¤è®¾æ½") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyEquipment equipment) { |
| | | return toAjax(equipmentService.updateSafety(equipment)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤è®¾æ½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-设å¤è®¾æ½-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤è®¾å¤è®¾æ½") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(equipmentService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è®¾æ½è¯¦æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-设å¤è®¾æ½-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢è®¾å¤è®¾æ½è¯¦æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(equipmentService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyInspectionRecord; |
| | | import com.ruoyi.safety.service.SafetyInspectionRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Safety inspection record APIs. |
| | | */ |
| | | @RestController |
| | | @Api(tags = "safety-inspection-record") |
| | | @RequestMapping("/safety/inspection/record") |
| | | public class SafetyInspectionRecordController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyInspectionRecordService recordService; |
| | | |
| | | @Log(title = "safety-inspection-record-list", businessType = BusinessType.OTHER) |
| | | @ApiOperation("query safety inspection records by page") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyInspectionRecord> page, |
| | | SafetyInspectionRecord query, |
| | | @RequestParam(value = "startDate", required = false) String startDate, |
| | | @RequestParam(value = "endDate", required = false) String endDate, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(recordService.queryPage(buildPage(page, pageNum, pageSize), query, startDate, endDate)); |
| | | } |
| | | |
| | | @Log(title = "safety-inspection-record-add", businessType = BusinessType.INSERT) |
| | | @ApiOperation("add safety inspection record") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyInspectionRecord record) { |
| | | return toAjax(recordService.saveSafety(record)); |
| | | } |
| | | |
| | | @Log(title = "safety-inspection-record-update", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("update safety inspection record") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyInspectionRecord record) { |
| | | return toAjax(recordService.updateSafety(record)); |
| | | } |
| | | |
| | | @Log(title = "safety-inspection-record-delete", businessType = BusinessType.DELETE) |
| | | @ApiOperation("delete safety inspection record") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(recordService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | @Log(title = "safety-inspection-record-sync", businessType = BusinessType.IMPORT) |
| | | @ApiOperation("sync mock subsystem inspection data") |
| | | @PostMapping("/sync") |
| | | public AjaxResult sync() { |
| | | List<SafetyInspectionRecord> records = recordService.syncMockSubsystemData(); |
| | | Map<String, Object> data = new HashMap<String, Object>(2); |
| | | data.put("count", records.size()); |
| | | data.put("records", records); |
| | | return AjaxResult.success(data); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.service.SafetyInspectionRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-å·¡æ£ç»è®¡æ¥è¡¨æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-å·¡æ£ç»è®¡æ¥è¡¨") |
| | | @RequestMapping("/safety/inspection/statistics") |
| | | public class SafetyInspectionStatisticsController { |
| | | |
| | | @Autowired |
| | | private SafetyInspectionRecordService recordService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»æ¥å·¡æ£ç»è®¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å·¡æ£ç»è®¡-仿¥ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢ä»æ¥å·¡æ£ç»è®¡") |
| | | @GetMapping("/today") |
| | | public AjaxResult todayStatistics() { |
| | | return AjaxResult.success(recordService.getTodayStatistics()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¡æ£è¶å¿ç»è®¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å·¡æ£ç»è®¡-è¶å¿ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å·¡æ£è¶å¿ç»è®¡") |
| | | @GetMapping("/trend") |
| | | public AjaxResult trendStatistics(@RequestParam(value = "startDate", required = false) String startDate, |
| | | @RequestParam(value = "endDate", required = false) String endDate) { |
| | | return AjaxResult.success(recordService.getTrendStatistics(startDate, endDate)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¡æ£ç±»ååå¸ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å·¡æ£ç»è®¡-ç±»ååå¸", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å·¡æ£ç±»ååå¸") |
| | | @GetMapping("/type") |
| | | public AjaxResult typeStatistics(@RequestParam(value = "startDate", required = false) String startDate, |
| | | @RequestParam(value = "endDate", required = false) String endDate) { |
| | | return AjaxResult.success(recordService.getTypeStatistics(startDate, endDate)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¡æ£äººåå±¥èç»è®¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å·¡æ£ç»è®¡-人åå±¥è", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å·¡æ£äººåå±¥èç»è®¡") |
| | | @GetMapping("/inspector") |
| | | public AjaxResult inspectorStatistics(@RequestParam(value = "startDate", required = false) String startDate, |
| | | @RequestParam(value = "endDate", required = false) String endDate) { |
| | | return AjaxResult.success(recordService.getInspectorStatistics(startDate, endDate)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyLearningRecord; |
| | | import com.ruoyi.safety.service.SafetyLearningRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-åå·¥å¦ä¹ è®°å½æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-åå·¥å¦ä¹ è®°å½") |
| | | @RequestMapping("/safety/learning/record") |
| | | public class SafetyLearningRecordController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyLearningRecordService learningRecordService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢åå·¥å¦ä¹ è®°å½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åå·¥å¦ä¹ è®°å½-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢åå·¥å¦ä¹ è®°å½") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyLearningRecord> page, SafetyLearningRecord query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(learningRecordService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå·¥å¦ä¹ ç»è®¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-åå·¥å¦ä¹ è®°å½-ç»è®¡", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢åå·¥å¦ä¹ ç»è®¡") |
| | | @GetMapping("/statistics") |
| | | public AjaxResult statistics() { |
| | | return AjaxResult.success(learningRecordService.getStatistics()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyPersonnel; |
| | | import com.ruoyi.safety.service.SafetyPersonnelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-äººåæ¡£æ¡æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-äººåæ¡£æ¡") |
| | | @RequestMapping("/safety/personnel") |
| | | public class SafetyPersonnelController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyPersonnelService personnelService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢äººåæ¡£æ¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-äººåæ¡£æ¡-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢äººåæ¡£æ¡") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyPersonnel> page, SafetyPersonnel query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(personnelService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢äººåæ¡£æ¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-äººåæ¡£æ¡-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢äººåæ¡£æ¡") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyPersonnel personnel) { |
| | | return toAjax(personnelService.saveSafety(personnel)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹äººåæ¡£æ¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-äººåæ¡£æ¡-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹äººåæ¡£æ¡") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyPersonnel personnel) { |
| | | return toAjax(personnelService.updateSafety(personnel)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤äººåæ¡£æ¡ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-äººåæ¡£æ¡-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤äººåæ¡£æ¡") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(personnelService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢äººåæ¡£æ¡è¯¦æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-äººåæ¡£æ¡-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢äººåæ¡£æ¡è¯¦æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(personnelService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyRisk; |
| | | import com.ruoyi.safety.service.SafetyRiskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-å²ä½é£é©æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-å²ä½é£é©") |
| | | @RequestMapping("/safety/risk") |
| | | public class SafetyRiskController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyRiskService riskService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å²ä½é£é©ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å²ä½é£é©-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢å²ä½é£é©") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyRisk> page, SafetyRisk query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(riskService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å²ä½é£é©ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å²ä½é£é©-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢å²ä½é£é©") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyRisk risk) { |
| | | return toAjax(riskService.saveSafety(risk)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å²ä½é£é©ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å²ä½é£é©-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹å²ä½é£é©") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyRisk risk) { |
| | | return toAjax(riskService.updateSafety(risk)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å²ä½é£é©ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å²ä½é£é©-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤å²ä½é£é©") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(riskService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å²ä½é£é©è¯¦æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å²ä½é£é©-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å²ä½é£é©è¯¦æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(riskService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingMaterial; |
| | | import com.ruoyi.safety.service.SafetyTrainingMaterialService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-å¹è®èµææ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-å¹è®èµæ") |
| | | @RequestMapping("/safety/training/material") |
| | | public class SafetyTrainingMaterialController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyTrainingMaterialService materialService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å¹è®èµæã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®èµæ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢å¹è®èµæ") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyTrainingMaterial> page, SafetyTrainingMaterial query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(materialService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ å¹è®èµæå
æ°æ®ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®èµæ-ä¸ä¼ ", businessType = BusinessType.INSERT) |
| | | @ApiOperation("ä¸ä¼ å¹è®èµæ") |
| | | @PostMapping("/upload") |
| | | public AjaxResult upload(@RequestBody SafetyTrainingMaterial material) { |
| | | return toAjax(materialService.saveSafety(material)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å¹è®èµæã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®èµæ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹å¹è®èµæ") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyTrainingMaterial material) { |
| | | return toAjax(materialService.updateSafety(material)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¹è®èµæã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®èµæ-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤å¹è®èµæ") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(materialService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¹è®èµæè¯¦æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®èµæ-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å¹è®èµæè¯¦æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(materialService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingPlan; |
| | | import com.ruoyi.safety.service.SafetyTrainingPlanService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-å¹è®è®¡åæ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-å¹è®è®¡å") |
| | | @RequestMapping("/safety/training/plan") |
| | | public class SafetyTrainingPlanController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyTrainingPlanService planService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å¹è®è®¡åã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®è®¡å-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢å¹è®è®¡å") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyTrainingPlan> page, SafetyTrainingPlan query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(planService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å¹è®è®¡åã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®è®¡å-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢å¹è®è®¡å") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyTrainingPlan plan) { |
| | | return toAjax(planService.saveSafety(plan)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å¹è®è®¡åã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®è®¡å-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹å¹è®è®¡å") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyTrainingPlan plan) { |
| | | return toAjax(planService.updateSafety(plan)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¹è®è®¡åã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®è®¡å-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤å¹è®è®¡å") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(planService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¹è®è®¡å详æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®è®¡å-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å¹è®è®¡å详æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(planService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingRecord; |
| | | import com.ruoyi.safety.service.SafetyTrainingRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-å¹è®å®æè®°å½æ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-å¹è®å®æè®°å½") |
| | | @RequestMapping("/safety/training/record") |
| | | public class SafetyTrainingRecordController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyTrainingRecordService recordService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å¹è®å®æè®°å½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®å®æè®°å½-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢å¹è®å®æè®°å½") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyTrainingRecord> page, SafetyTrainingRecord query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(recordService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * add training completion record. |
| | | */ |
| | | @Log(title = "safety-training-record-add", businessType = BusinessType.INSERT) |
| | | @ApiOperation("add safety training completion record") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyTrainingRecord record) { |
| | | return toAjax(recordService.saveSafety(record)); |
| | | } |
| | | |
| | | /** |
| | | * update training completion record. |
| | | */ |
| | | @Log(title = "safety-training-record-update", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("update safety training completion record") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyTrainingRecord record) { |
| | | return toAjax(recordService.updateSafety(record)); |
| | | } |
| | | |
| | | /** |
| | | * delete training completion record. |
| | | */ |
| | | @Log(title = "safety-training-record-delete", businessType = BusinessType.DELETE) |
| | | @ApiOperation("delete safety training completion record") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(recordService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * training completion record detail. |
| | | */ |
| | | @Log(title = "safety-training-record-detail", businessType = BusinessType.OTHER) |
| | | @ApiOperation("query safety training completion record detail") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(recordService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå¹è®å®æè®°å½ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-å¹è®å®æè®°å½-导åº", businessType = BusinessType.EXPORT) |
| | | @ApiOperation("导åºå¹è®å®æè®°å½") |
| | | @GetMapping("/export") |
| | | public void export(HttpServletResponse response, SafetyTrainingRecord query) { |
| | | List<SafetyTrainingRecord> records = recordService.queryPage(new Page<SafetyTrainingRecord>(1, -1), query) |
| | | .getRecords(); |
| | | ExcelUtil<SafetyTrainingRecord> util = new ExcelUtil<SafetyTrainingRecord>(SafetyTrainingRecord.class); |
| | | util.exportExcel(response, records, "safety_training_record"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.safety.pojo.SafetyWorkArea; |
| | | import com.ruoyi.safety.service.SafetyWorkAreaService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * å®ç¯ç®¡ç-ä½ä¸åºåæ¥å£ã |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®ç¯ç®¡ç-ä½ä¸åºå") |
| | | @RequestMapping("/safety/workArea") |
| | | public class SafetyWorkAreaController extends SafetyControllerSupport { |
| | | |
| | | @Autowired |
| | | private SafetyWorkAreaService workAreaService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä½ä¸åºåã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢ä½ä¸åºå") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<SafetyWorkArea> page, SafetyWorkArea query, |
| | | @RequestParam(value = "pageNum", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize", required = false) Long pageSize) { |
| | | return AjaxResult.success(workAreaService.queryPage(buildPage(page, pageNum, pageSize), query)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä½ä¸åºåã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢ä½ä¸åºå") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SafetyWorkArea workArea) { |
| | | return toAjax(workAreaService.saveSafety(workArea)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä½ä¸åºåã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹ä½ä¸åºå") |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody SafetyWorkArea workArea) { |
| | | return toAjax(workAreaService.updateSafety(workArea)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä½ä¸åºåã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤ä½ä¸åºå") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return toAjax(workAreaService.deleteSafetyById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä½ä¸åºå详æ
ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-详æ
", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢ä½ä¸åºå详æ
") |
| | | @GetMapping("/detail/{id}") |
| | | public AjaxResult detail(@PathVariable Long id) { |
| | | return AjaxResult.success(workAreaService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨ä½ä¸åºåï¼ç¨äºä¸æéæ©ã |
| | | */ |
| | | @Log(title = "å®ç¯ç®¡ç-ä½ä¸åºå-å
¨é¨æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("æ¥è¯¢å
¨é¨ä½ä¸åºå") |
| | | @GetMapping("/all") |
| | | public AjaxResult all() { |
| | | return AjaxResult.success(workAreaService.list(new QueryWrapper<SafetyWorkArea>().orderByDesc("create_time"))); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class SafetyInspectionTodayStatistics { |
| | | |
| | | private Long totalCount; |
| | | |
| | | private Long completedCount; |
| | | |
| | | private Long abnormalCount; |
| | | |
| | | private Long missedCount; |
| | | |
| | | private Long unexecutedCount; |
| | | |
| | | private BigDecimal completionRate; |
| | | |
| | | private Long inspectorCount; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class SafetyInspectionTrendStat { |
| | | |
| | | private LocalDate statDate; |
| | | |
| | | private Long totalCount; |
| | | |
| | | private Long completedCount; |
| | | |
| | | private Long abnormalCount; |
| | | |
| | | private Long missedCount; |
| | | |
| | | private Long unexecutedCount; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SafetyInspectionTypeStat { |
| | | |
| | | private String type; |
| | | |
| | | private Long count; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class SafetyInspectorStat { |
| | | |
| | | private Long inspectorId; |
| | | |
| | | private String inspector; |
| | | |
| | | private Long totalCount; |
| | | |
| | | private Long completedCount; |
| | | |
| | | private Long abnormalCount; |
| | | |
| | | private Long missedCount; |
| | | |
| | | private Long unexecutedCount; |
| | | |
| | | private BigDecimal completionRate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class SafetyLearningStatistics { |
| | | |
| | | private Long totalCount; |
| | | |
| | | private Long completedCount; |
| | | |
| | | private Long unfinishedCount; |
| | | |
| | | private BigDecimal totalDuration; |
| | | |
| | | private BigDecimal completionRate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentReport; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyAssessmentReportMapper extends BaseMapper<SafetyAssessmentReport> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTaskEmployee; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyAssessmentTaskEmployeeMapper extends BaseMapper<SafetyAssessmentTaskEmployee> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTask; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyAssessmentTaskMapper extends BaseMapper<SafetyAssessmentTask> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyEmergencyResource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyEmergencyResourceMapper extends BaseMapper<SafetyEmergencyResource> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyEquipment; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyEquipmentMapper extends BaseMapper<SafetyEquipment> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTodayStatistics; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTrendStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTypeStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectorStat; |
| | | import com.ruoyi.safety.pojo.SafetyInspectionRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface SafetyInspectionRecordMapper extends BaseMapper<SafetyInspectionRecord> { |
| | | |
| | | SafetyInspectionTodayStatistics selectTodayStatistics(@Param("statDate") LocalDate statDate); |
| | | |
| | | List<SafetyInspectionTrendStat> selectTrendStatistics(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | List<SafetyInspectionTypeStat> selectTypeStatistics(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | List<SafetyInspectorStat> selectInspectorStatistics(@Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.dto.SafetyLearningStatistics; |
| | | import com.ruoyi.safety.pojo.SafetyLearningRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyLearningRecordMapper extends BaseMapper<SafetyLearningRecord> { |
| | | |
| | | SafetyLearningStatistics selectStatistics(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyPersonnel; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyPersonnelMapper extends BaseMapper<SafetyPersonnel> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyRisk; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyRiskMapper extends BaseMapper<SafetyRisk> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingMaterial; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyTrainingMaterialMapper extends BaseMapper<SafetyTrainingMaterial> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingPlan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyTrainingPlanMapper extends BaseMapper<SafetyTrainingPlan> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyTrainingRecordMapper extends BaseMapper<SafetyTrainingRecord> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.safety.pojo.SafetyWorkArea; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SafetyWorkAreaMapper extends BaseMapper<SafetyWorkArea> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_assessment_report") |
| | | public class SafetyAssessmentReport extends SafetyBaseEntity { |
| | | |
| | | private Long employeeId; |
| | | |
| | | private String employeeName; |
| | | |
| | | private String name; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime assessTime; |
| | | |
| | | private BigDecimal score; |
| | | |
| | | private String grade; |
| | | |
| | | private Integer qualified; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_assessment_task") |
| | | public class SafetyAssessmentTask extends SafetyBaseEntity { |
| | | |
| | | private String title; |
| | | |
| | | private String description; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate deadline; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_assessment_task_employee") |
| | | public class SafetyAssessmentTaskEmployee extends SafetyBaseEntity { |
| | | |
| | | private Long taskId; |
| | | |
| | | private Long employeeId; |
| | | |
| | | private String employeeName; |
| | | |
| | | private Integer status; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime completeTime; |
| | | |
| | | private BigDecimal score; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class SafetyBaseEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @TableField(condition = "create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @TableField(condition = "update_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | private String remark; |
| | | |
| | | @TableField("del_flag") |
| | | @TableLogic(value = "0", delval = "1") |
| | | private Integer delFlag; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_emergency_resource") |
| | | public class SafetyEmergencyResource extends SafetyBaseEntity { |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private Integer quantity; |
| | | |
| | | private String location; |
| | | |
| | | private Long areaId; |
| | | |
| | | private String manager; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_equipment") |
| | | public class SafetyEquipment extends SafetyBaseEntity { |
| | | |
| | | private String name; |
| | | |
| | | private String model; |
| | | |
| | | private Long areaId; |
| | | |
| | | private String areaName; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_inspection_record") |
| | | public class SafetyInspectionRecord extends SafetyBaseEntity { |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime inspectionTime; |
| | | |
| | | private Long inspectorId; |
| | | |
| | | private String inspector; |
| | | |
| | | private Long areaId; |
| | | |
| | | private String area; |
| | | |
| | | private String type; |
| | | |
| | | private Integer status; |
| | | |
| | | private String abnormalDesc; |
| | | |
| | | private Integer isMissed; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_learning_record") |
| | | public class SafetyLearningRecord extends SafetyBaseEntity { |
| | | |
| | | private Long employeeId; |
| | | |
| | | private String employeeName; |
| | | |
| | | private String content; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime trainingTime; |
| | | |
| | | private BigDecimal duration; |
| | | |
| | | private String method; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_personnel") |
| | | public class SafetyPersonnel extends SafetyBaseEntity { |
| | | |
| | | private String name; |
| | | |
| | | private String dept; |
| | | |
| | | private String post; |
| | | |
| | | private String phone; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate entryDate; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_risk") |
| | | public class SafetyRisk extends SafetyBaseEntity { |
| | | |
| | | private String type; |
| | | |
| | | private String level; |
| | | |
| | | private String description; |
| | | |
| | | private String post; |
| | | |
| | | private String controlMeasures; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_training_material") |
| | | public class SafetyTrainingMaterial extends SafetyBaseEntity { |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String fileUrl; |
| | | |
| | | private String fileSize; |
| | | |
| | | private String uploader; |
| | | |
| | | private Long uploaderId; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime uploadTime; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_training_plan") |
| | | public class SafetyTrainingPlan extends SafetyBaseEntity { |
| | | |
| | | @TableField("`year`") |
| | | private String year; |
| | | |
| | | private String post; |
| | | |
| | | @TableField("`level`") |
| | | private String level; |
| | | |
| | | private String content; |
| | | |
| | | private BigDecimal hours; |
| | | |
| | | private String materialIds; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_training_record") |
| | | public class SafetyTrainingRecord extends SafetyBaseEntity { |
| | | |
| | | private Long planId; |
| | | |
| | | private Long employeeId; |
| | | |
| | | private String employeeName; |
| | | |
| | | private String content; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime completeTime; |
| | | |
| | | private BigDecimal duration; |
| | | |
| | | private String method; |
| | | |
| | | private String result; |
| | | |
| | | private BigDecimal score; |
| | | |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("safety_work_area") |
| | | public class SafetyWorkArea extends SafetyBaseEntity { |
| | | |
| | | private String name; |
| | | |
| | | private String location; |
| | | |
| | | private String manager; |
| | | |
| | | private Long managerId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentReport; |
| | | |
| | | public interface SafetyAssessmentReportService extends SafetyBaseService<SafetyAssessmentReport> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTaskEmployee; |
| | | |
| | | public interface SafetyAssessmentTaskEmployeeService extends SafetyBaseService<SafetyAssessmentTaskEmployee> { |
| | | |
| | | boolean start(SafetyAssessmentTaskEmployee request); |
| | | |
| | | boolean submit(SafetyAssessmentTaskEmployee request); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTask; |
| | | |
| | | public interface SafetyAssessmentTaskService extends SafetyBaseService<SafetyAssessmentTask> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.safety.pojo.SafetyBaseEntity; |
| | | |
| | | public interface SafetyBaseService<T extends SafetyBaseEntity> extends IService<T> { |
| | | |
| | | IPage<T> queryPage(Page<T> page, T query); |
| | | |
| | | boolean saveSafety(T entity); |
| | | |
| | | boolean updateSafety(T entity); |
| | | |
| | | boolean deleteSafetyById(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyEmergencyResource; |
| | | |
| | | public interface SafetyEmergencyResourceService extends SafetyBaseService<SafetyEmergencyResource> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyEquipment; |
| | | |
| | | public interface SafetyEquipmentService extends SafetyBaseService<SafetyEquipment> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTodayStatistics; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTrendStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTypeStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectorStat; |
| | | import com.ruoyi.safety.pojo.SafetyInspectionRecord; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface SafetyInspectionRecordService extends SafetyBaseService<SafetyInspectionRecord> { |
| | | |
| | | IPage<SafetyInspectionRecord> queryPage(Page<SafetyInspectionRecord> page, |
| | | SafetyInspectionRecord query, |
| | | String startDate, |
| | | String endDate); |
| | | |
| | | SafetyInspectionTodayStatistics getTodayStatistics(); |
| | | |
| | | List<SafetyInspectionTrendStat> getTrendStatistics(String startDate, String endDate); |
| | | |
| | | List<SafetyInspectionTypeStat> getTypeStatistics(String startDate, String endDate); |
| | | |
| | | List<SafetyInspectorStat> getInspectorStatistics(String startDate, String endDate); |
| | | |
| | | List<SafetyInspectionRecord> syncMockSubsystemData(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.dto.SafetyLearningStatistics; |
| | | import com.ruoyi.safety.pojo.SafetyLearningRecord; |
| | | |
| | | public interface SafetyLearningRecordService extends SafetyBaseService<SafetyLearningRecord> { |
| | | |
| | | SafetyLearningStatistics getStatistics(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyPersonnel; |
| | | |
| | | public interface SafetyPersonnelService extends SafetyBaseService<SafetyPersonnel> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyRisk; |
| | | |
| | | public interface SafetyRiskService extends SafetyBaseService<SafetyRisk> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyTrainingMaterial; |
| | | |
| | | public interface SafetyTrainingMaterialService extends SafetyBaseService<SafetyTrainingMaterial> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyTrainingPlan; |
| | | |
| | | public interface SafetyTrainingPlanService extends SafetyBaseService<SafetyTrainingPlan> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyTrainingRecord; |
| | | |
| | | public interface SafetyTrainingRecordService extends SafetyBaseService<SafetyTrainingRecord> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service; |
| | | |
| | | import com.ruoyi.safety.pojo.SafetyWorkArea; |
| | | |
| | | public interface SafetyWorkAreaService extends SafetyBaseService<SafetyWorkArea> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyAssessmentReportMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentReport; |
| | | import com.ruoyi.safety.service.SafetyAssessmentReportService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyAssessmentReportServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyAssessmentReportMapper, SafetyAssessmentReport> |
| | | implements SafetyAssessmentReportService { |
| | | |
| | | @Override |
| | | public IPage<SafetyAssessmentReport> queryPage(Page<SafetyAssessmentReport> page, SafetyAssessmentReport query) { |
| | | QueryWrapper<SafetyAssessmentReport> wrapper = |
| | | new QueryWrapper<SafetyAssessmentReport>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (query.getEmployeeId() != null) { |
| | | wrapper.eq("employee_id", query.getEmployeeId()); |
| | | } |
| | | if (hasText(query.getEmployeeName())) { |
| | | wrapper.like("employee_name", query.getEmployeeName()); |
| | | } |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (query.getQualified() != null) { |
| | | wrapper.eq("qualified", query.getQualified()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyAssessmentTaskEmployeeMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTask; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTaskEmployee; |
| | | import com.ruoyi.safety.service.SafetyAssessmentTaskEmployeeService; |
| | | import com.ruoyi.safety.service.SafetyAssessmentTaskService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Service |
| | | public class SafetyAssessmentTaskEmployeeServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyAssessmentTaskEmployeeMapper, SafetyAssessmentTaskEmployee> |
| | | implements SafetyAssessmentTaskEmployeeService { |
| | | |
| | | @Autowired |
| | | private SafetyAssessmentTaskService taskService; |
| | | |
| | | @Override |
| | | public IPage<SafetyAssessmentTaskEmployee> queryPage(Page<SafetyAssessmentTaskEmployee> page, |
| | | SafetyAssessmentTaskEmployee query) { |
| | | QueryWrapper<SafetyAssessmentTaskEmployee> wrapper = |
| | | new QueryWrapper<SafetyAssessmentTaskEmployee>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (query.getTaskId() != null) { |
| | | wrapper.eq("task_id", query.getTaskId()); |
| | | } |
| | | if (query.getEmployeeId() != null) { |
| | | wrapper.eq("employee_id", query.getEmployeeId()); |
| | | } |
| | | if (hasText(query.getEmployeeName())) { |
| | | wrapper.like("employee_name", query.getEmployeeName()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean start(SafetyAssessmentTaskEmployee request) { |
| | | if (request == null || request.getTaskId() == null) { |
| | | return false; |
| | | } |
| | | fillCurrentEmployeeIfMissing(request); |
| | | if (request.getEmployeeId() == null) { |
| | | return false; |
| | | } |
| | | SafetyAssessmentTaskEmployee existing = getOne(new QueryWrapper<SafetyAssessmentTaskEmployee>() |
| | | .eq("task_id", request.getTaskId()) |
| | | .eq("employee_id", request.getEmployeeId()) |
| | | .last("limit 1")); |
| | | if (existing != null) { |
| | | return true; |
| | | } |
| | | if (request.getStatus() == null) { |
| | | request.setStatus(0); |
| | | } |
| | | updateTaskStatus(request.getTaskId(), 1); |
| | | return saveSafety(request); |
| | | } |
| | | |
| | | @Override |
| | | public boolean submit(SafetyAssessmentTaskEmployee request) { |
| | | if (request == null) { |
| | | return false; |
| | | } |
| | | fillCurrentEmployeeIfMissing(request); |
| | | SafetyAssessmentTaskEmployee target = findSubmitTarget(request); |
| | | if (target == null) { |
| | | if (request.getTaskId() == null || request.getEmployeeId() == null) { |
| | | return false; |
| | | } |
| | | request.setStatus(1); |
| | | if (request.getCompleteTime() == null) { |
| | | request.setCompleteTime(LocalDateTime.now()); |
| | | } |
| | | boolean saved = saveSafety(request); |
| | | finishTaskWhenAllSubmitted(request.getTaskId()); |
| | | return saved; |
| | | } |
| | | target.setStatus(1); |
| | | target.setScore(request.getScore()); |
| | | target.setRemark(request.getRemark()); |
| | | target.setCompleteTime(request.getCompleteTime() == null ? LocalDateTime.now() : request.getCompleteTime()); |
| | | boolean updated = updateSafety(target); |
| | | finishTaskWhenAllSubmitted(target.getTaskId()); |
| | | return updated; |
| | | } |
| | | |
| | | private SafetyAssessmentTaskEmployee findSubmitTarget(SafetyAssessmentTaskEmployee request) { |
| | | if (request.getId() != null) { |
| | | SafetyAssessmentTaskEmployee byId = getById(request.getId()); |
| | | if (byId != null) { |
| | | return byId; |
| | | } |
| | | } |
| | | if (request.getTaskId() != null && request.getEmployeeId() != null) { |
| | | return getOne(new QueryWrapper<SafetyAssessmentTaskEmployee>() |
| | | .eq("task_id", request.getTaskId()) |
| | | .eq("employee_id", request.getEmployeeId()) |
| | | .last("limit 1")); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private void fillCurrentEmployeeIfMissing(SafetyAssessmentTaskEmployee request) { |
| | | if (request.getEmployeeId() == null) { |
| | | request.setEmployeeId(currentUserId()); |
| | | } |
| | | if (!hasText(request.getEmployeeName())) { |
| | | request.setEmployeeName(currentUsername()); |
| | | } |
| | | } |
| | | |
| | | private void updateTaskStatus(Long taskId, Integer status) { |
| | | SafetyAssessmentTask task = taskService.getById(taskId); |
| | | if (task != null && (task.getStatus() == null || task.getStatus() < status)) { |
| | | task.setStatus(status); |
| | | taskService.updateSafety(task); |
| | | } |
| | | } |
| | | |
| | | private void finishTaskWhenAllSubmitted(Long taskId) { |
| | | if (taskId == null) { |
| | | return; |
| | | } |
| | | long pending = count(new QueryWrapper<SafetyAssessmentTaskEmployee>() |
| | | .eq("task_id", taskId) |
| | | .eq("status", 0)); |
| | | if (pending == 0) { |
| | | updateTaskStatus(taskId, 2); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyAssessmentTaskMapper; |
| | | import com.ruoyi.safety.pojo.SafetyAssessmentTask; |
| | | import com.ruoyi.safety.service.SafetyAssessmentTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyAssessmentTaskServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyAssessmentTaskMapper, SafetyAssessmentTask> |
| | | implements SafetyAssessmentTaskService { |
| | | |
| | | @Override |
| | | public IPage<SafetyAssessmentTask> queryPage(Page<SafetyAssessmentTask> page, SafetyAssessmentTask query) { |
| | | QueryWrapper<SafetyAssessmentTask> wrapper = |
| | | new QueryWrapper<SafetyAssessmentTask>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getTitle())) { |
| | | wrapper.like("title", query.getTitle()); |
| | | } |
| | | if (query.getDeadline() != null) { |
| | | wrapper.eq("deadline", query.getDeadline()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.safety.pojo.SafetyBaseEntity; |
| | | import com.ruoyi.safety.service.SafetyBaseService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | public abstract class SafetyBaseServiceImpl<M extends BaseMapper<T>, T extends SafetyBaseEntity> |
| | | extends ServiceImpl<M, T> implements SafetyBaseService<T> { |
| | | |
| | | @Override |
| | | public boolean saveSafety(T entity) { |
| | | entity.setCreateBy(currentUsername()); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | if (entity.getDelFlag() == null) { |
| | | entity.setDelFlag(0); |
| | | } |
| | | return save(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateSafety(T entity) { |
| | | entity.setUpdateBy(currentUsername()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | return updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteSafetyById(Long id) { |
| | | return removeById(id); |
| | | } |
| | | |
| | | protected boolean hasText(String value) { |
| | | return StringUtils.isNotBlank(value); |
| | | } |
| | | |
| | | protected String currentUsername() { |
| | | try { |
| | | return SecurityUtils.getLoginUser().getNickName(); |
| | | } catch (Exception ignored) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | protected Long currentUserId() { |
| | | try { |
| | | return SecurityUtils.getUserId(); |
| | | } catch (Exception ignored) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyEmergencyResourceMapper; |
| | | import com.ruoyi.safety.pojo.SafetyEmergencyResource; |
| | | import com.ruoyi.safety.service.SafetyEmergencyResourceService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyEmergencyResourceServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyEmergencyResourceMapper, SafetyEmergencyResource> |
| | | implements SafetyEmergencyResourceService { |
| | | |
| | | @Override |
| | | public IPage<SafetyEmergencyResource> queryPage(Page<SafetyEmergencyResource> page, |
| | | SafetyEmergencyResource query) { |
| | | QueryWrapper<SafetyEmergencyResource> wrapper = |
| | | new QueryWrapper<SafetyEmergencyResource>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (hasText(query.getType())) { |
| | | wrapper.like("type", query.getType()); |
| | | } |
| | | if (query.getAreaId() != null) { |
| | | wrapper.eq("area_id", query.getAreaId()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyEquipmentMapper; |
| | | import com.ruoyi.safety.pojo.SafetyEquipment; |
| | | import com.ruoyi.safety.service.SafetyEquipmentService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyEquipmentServiceImpl extends SafetyBaseServiceImpl<SafetyEquipmentMapper, SafetyEquipment> |
| | | implements SafetyEquipmentService { |
| | | |
| | | @Override |
| | | public IPage<SafetyEquipment> queryPage(Page<SafetyEquipment> page, SafetyEquipment query) { |
| | | QueryWrapper<SafetyEquipment> wrapper = new QueryWrapper<SafetyEquipment>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (hasText(query.getModel())) { |
| | | wrapper.like("model", query.getModel()); |
| | | } |
| | | if (query.getAreaId() != null) { |
| | | wrapper.eq("area_id", query.getAreaId()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.framework.redis.RedisCache; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTodayStatistics; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTrendStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectionTypeStat; |
| | | import com.ruoyi.safety.dto.SafetyInspectorStat; |
| | | import com.ruoyi.safety.mapper.SafetyInspectionRecordMapper; |
| | | import com.ruoyi.safety.pojo.SafetyInspectionRecord; |
| | | import com.ruoyi.safety.service.SafetyInspectionRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | | public class SafetyInspectionRecordServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyInspectionRecordMapper, SafetyInspectionRecord> |
| | | implements SafetyInspectionRecordService { |
| | | |
| | | private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | private static final String SYNC_DAILY_KEY_PREFIX = "safety:inspection:sync:daily:"; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Override |
| | | public IPage<SafetyInspectionRecord> queryPage(Page<SafetyInspectionRecord> page, |
| | | SafetyInspectionRecord query, |
| | | String startDate, |
| | | String endDate) { |
| | | QueryWrapper<SafetyInspectionRecord> wrapper = |
| | | new QueryWrapper<SafetyInspectionRecord>().orderByDesc("inspection_time"); |
| | | if (query != null) { |
| | | if (query.getInspectorId() != null) { |
| | | wrapper.eq("inspector_id", query.getInspectorId()); |
| | | } |
| | | if (hasText(query.getInspector())) { |
| | | wrapper.like("inspector", query.getInspector()); |
| | | } |
| | | if (query.getAreaId() != null) { |
| | | wrapper.eq("area_id", query.getAreaId()); |
| | | } |
| | | if (hasText(query.getArea())) { |
| | | wrapper.like("area", query.getArea()); |
| | | } |
| | | if (hasText(query.getType())) { |
| | | wrapper.eq("type", query.getType()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | if (hasText(startDate)) { |
| | | wrapper.ge("inspection_time", startDate + " 00:00:00"); |
| | | } |
| | | if (hasText(endDate)) { |
| | | wrapper.le("inspection_time", endDate + " 23:59:59"); |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SafetyInspectionRecord> queryPage(Page<SafetyInspectionRecord> page, SafetyInspectionRecord query) { |
| | | return queryPage(page, query, null, null); |
| | | } |
| | | |
| | | @Override |
| | | public SafetyInspectionTodayStatistics getTodayStatistics() { |
| | | return baseMapper.selectTodayStatistics(LocalDate.now()); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafetyInspectionTrendStat> getTrendStatistics(String startDate, String endDate) { |
| | | String[] range = normalizeRange(startDate, endDate); |
| | | return baseMapper.selectTrendStatistics(range[0], range[1]); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafetyInspectionTypeStat> getTypeStatistics(String startDate, String endDate) { |
| | | String[] range = normalizeRange(startDate, endDate); |
| | | return baseMapper.selectTypeStatistics(range[0], range[1]); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafetyInspectorStat> getInspectorStatistics(String startDate, String endDate) { |
| | | String[] range = normalizeRange(startDate, endDate); |
| | | return baseMapper.selectInspectorStatistics(range[0], range[1]); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafetyInspectionRecord> syncMockSubsystemData() { |
| | | String todaySyncKey = buildTodaySyncKey(); |
| | | if (Boolean.TRUE.equals(redisCache.hasKey(todaySyncKey))) { |
| | | throw new ServiceException("仿¥å·²åæ¥ï¼æå¤©åè¯"); |
| | | } |
| | | List<SafetyInspectionRecord> mockRecords = buildMockRecords(); |
| | | saveBatch(mockRecords); |
| | | int secondsToEndOfDay = secondsToEndOfDay(); |
| | | redisCache.setCacheObject(todaySyncKey, "1", secondsToEndOfDay, TimeUnit.SECONDS); |
| | | return mockRecords; |
| | | } |
| | | |
| | | private String[] normalizeRange(String startDate, String endDate) { |
| | | LocalDate end = hasText(endDate) ? LocalDate.parse(endDate, DATE_FORMATTER) : LocalDate.now(); |
| | | LocalDate start = hasText(startDate) ? LocalDate.parse(startDate, DATE_FORMATTER) : end.minusDays(6); |
| | | return new String[]{start.format(DATE_FORMATTER), end.format(DATE_FORMATTER)}; |
| | | } |
| | | |
| | | private List<SafetyInspectionRecord> buildMockRecords() { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | String operator = currentUsername(); |
| | | |
| | | List<SafetyInspectionRecord> records = new ArrayList<SafetyInspectionRecord>(18); |
| | | records.add(createMockRecord(today.minusDays(6), LocalTime.of(8, 30), 101L, "æé", 1L, "大å
", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(6), LocalTime.of(10, 20), 102L, "æä¸æ°", 2L, "åå°", "fire", 1, 0, "\u706d\u706b\u5668\u538b\u529b\u4f4e", now, operator)); |
| | | records.add(createMockRecord(today.minusDays(5), LocalTime.of(9, 15), 101L, "çäºä¼", 3L, "大å
", "equipment", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(5), LocalTime.of(14, 0), 103L, "çäºä¼", 1L, "大å
", "daily", 3, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(4), LocalTime.of(8, 45), 102L, "æä¸æ°", 2L, "æºçµæ¿", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(4), LocalTime.of(15, 30), 104L, "顾å
¨", 4L, "æºæ¿", "night", 2, 1, "\u5de1\u68c0\u70b9A3\u6f0f\u68c0", now, operator)); |
| | | records.add(createMockRecord(today.minusDays(3), LocalTime.of(9, 5), 101L, "æé", 1L, "é
çæ¿", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(3), LocalTime.of(16, 20), 103L, "çäºä¼", 3L, "æºçµæ¿", "fire", 1, 0, "\u5e94\u6025\u901a\u9053\u5806\u653e\u5835\u585e", now, operator)); |
| | | records.add(createMockRecord(today.minusDays(2), LocalTime.of(8, 55), 102L, "æä¸æ°", 2L, "æºçµæ¿", "equipment", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(2), LocalTime.of(13, 40), 104L, "顾å
¨", 4L, "æºæ¿", "night", 3, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(1), LocalTime.of(8, 40), 101L, "æé", 1L, "æºæ¿", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(1), LocalTime.of(10, 5), 102L, "æä¸æ°", 2L, "å¨ç©é´", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today.minusDays(1), LocalTime.of(14, 35), 103L, "çäºä¼", 3L, "å¨ç©é´", "fire", 1, 0, "\u5b89\u5168\u6807\u8bc6\u7834\u635f", now, operator)); |
| | | records.add(createMockRecord(today.minusDays(1), LocalTime.of(17, 10), 104L, "顾å
¨", 4L, "å¨ç©é´", "equipment", 2, 1, "\u5de5\u5177\u7bb1\u70b9\u68c0\u6f0f\u68c0", now, operator)); |
| | | records.add(createMockRecord(today, LocalTime.of(8, 20), 101L, "æé", 1L, "äºæ¥¼æ¶é²é´", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today, LocalTime.of(10, 10), 102L, "æä¸æ°", 2L, "äºæ¥¼æ¶é²é´", "daily", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today, LocalTime.of(14, 25), 103L, "çäºä¼", 3L, "äºæ¥¼æ¶é²é´", "equipment", 0, 0, null, now, operator)); |
| | | records.add(createMockRecord(today, LocalTime.of(16, 50), 104L, "顾å
¨", 4L, "大å
", "night", 3, 0, null, now, operator)); |
| | | return records; |
| | | } |
| | | |
| | | private SafetyInspectionRecord createMockRecord(LocalDate date, |
| | | LocalTime time, |
| | | Long inspectorId, |
| | | String inspector, |
| | | Long areaId, |
| | | String area, |
| | | String type, |
| | | Integer status, |
| | | Integer isMissed, |
| | | String abnormalDesc, |
| | | LocalDateTime createTime, |
| | | String createBy) { |
| | | SafetyInspectionRecord record = new SafetyInspectionRecord(); |
| | | record.setInspectionTime(LocalDateTime.of(date, time)); |
| | | record.setInspectorId(inspectorId); |
| | | record.setInspector(inspector); |
| | | record.setAreaId(areaId); |
| | | record.setArea(area); |
| | | record.setType(type); |
| | | record.setStatus(status); |
| | | record.setIsMissed(isMissed); |
| | | record.setAbnormalDesc(abnormalDesc); |
| | | record.setRemark("mock-subsystem-sync"); |
| | | record.setCreateTime(createTime); |
| | | record.setCreateBy(createBy); |
| | | record.setDelFlag(0); |
| | | return record; |
| | | } |
| | | |
| | | private String buildTodaySyncKey() { |
| | | String tenantPart = "default"; |
| | | try { |
| | | Long tenantId = com.ruoyi.common.utils.SecurityUtils.getLoginUser().getTenantId(); |
| | | if (tenantId != null) { |
| | | tenantPart = String.valueOf(tenantId); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | return SYNC_DAILY_KEY_PREFIX + tenantPart + ":" + LocalDate.now().format(DATE_FORMATTER); |
| | | } |
| | | |
| | | private int secondsToEndOfDay() { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime endOfDay = LocalDateTime.of(LocalDate.now(), LocalTime.MAX); |
| | | long seconds = java.time.Duration.between(now, endOfDay).getSeconds(); |
| | | return (int) Math.max(seconds, 1L); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.dto.SafetyLearningStatistics; |
| | | import com.ruoyi.safety.mapper.SafetyLearningRecordMapper; |
| | | import com.ruoyi.safety.pojo.SafetyLearningRecord; |
| | | import com.ruoyi.safety.service.SafetyLearningRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyLearningRecordServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyLearningRecordMapper, SafetyLearningRecord> |
| | | implements SafetyLearningRecordService { |
| | | |
| | | @Override |
| | | public IPage<SafetyLearningRecord> queryPage(Page<SafetyLearningRecord> page, SafetyLearningRecord query) { |
| | | QueryWrapper<SafetyLearningRecord> wrapper = |
| | | new QueryWrapper<SafetyLearningRecord>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (query.getEmployeeId() != null) { |
| | | wrapper.eq("employee_id", query.getEmployeeId()); |
| | | } |
| | | if (hasText(query.getEmployeeName())) { |
| | | wrapper.like("employee_name", query.getEmployeeName()); |
| | | } |
| | | if (hasText(query.getContent())) { |
| | | wrapper.like("content", query.getContent()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public SafetyLearningStatistics getStatistics() { |
| | | return baseMapper.selectStatistics(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyPersonnelMapper; |
| | | import com.ruoyi.safety.pojo.SafetyPersonnel; |
| | | import com.ruoyi.safety.service.SafetyPersonnelService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyPersonnelServiceImpl extends SafetyBaseServiceImpl<SafetyPersonnelMapper, SafetyPersonnel> |
| | | implements SafetyPersonnelService { |
| | | |
| | | @Override |
| | | public IPage<SafetyPersonnel> queryPage(Page<SafetyPersonnel> page, SafetyPersonnel query) { |
| | | QueryWrapper<SafetyPersonnel> wrapper = new QueryWrapper<SafetyPersonnel>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (hasText(query.getDept())) { |
| | | wrapper.like("dept", query.getDept()); |
| | | } |
| | | if (hasText(query.getPost())) { |
| | | wrapper.like("post", query.getPost()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyRiskMapper; |
| | | import com.ruoyi.safety.pojo.SafetyRisk; |
| | | import com.ruoyi.safety.service.SafetyRiskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyRiskServiceImpl extends SafetyBaseServiceImpl<SafetyRiskMapper, SafetyRisk> |
| | | implements SafetyRiskService { |
| | | |
| | | @Override |
| | | public IPage<SafetyRisk> queryPage(Page<SafetyRisk> page, SafetyRisk query) { |
| | | QueryWrapper<SafetyRisk> wrapper = new QueryWrapper<SafetyRisk>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getType())) { |
| | | wrapper.like("type", query.getType()); |
| | | } |
| | | if (hasText(query.getLevel())) { |
| | | wrapper.eq("level", query.getLevel()); |
| | | } |
| | | if (hasText(query.getPost())) { |
| | | wrapper.like("post", query.getPost()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyTrainingMaterialMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingMaterial; |
| | | import com.ruoyi.safety.service.SafetyTrainingMaterialService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Service |
| | | public class SafetyTrainingMaterialServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyTrainingMaterialMapper, SafetyTrainingMaterial> |
| | | implements SafetyTrainingMaterialService { |
| | | |
| | | @Override |
| | | public IPage<SafetyTrainingMaterial> queryPage(Page<SafetyTrainingMaterial> page, |
| | | SafetyTrainingMaterial query) { |
| | | QueryWrapper<SafetyTrainingMaterial> wrapper = |
| | | new QueryWrapper<SafetyTrainingMaterial>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (hasText(query.getType())) { |
| | | wrapper.eq("type", query.getType()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveSafety(SafetyTrainingMaterial entity) { |
| | | if (entity.getUploadTime() == null) { |
| | | entity.setUploadTime(LocalDateTime.now()); |
| | | } |
| | | if (!hasText(entity.getUploader())) { |
| | | entity.setUploader(currentUsername()); |
| | | } |
| | | if (entity.getUploaderId() == null) { |
| | | entity.setUploaderId(currentUserId()); |
| | | } |
| | | return super.saveSafety(entity); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyTrainingPlanMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingPlan; |
| | | import com.ruoyi.safety.service.SafetyTrainingPlanService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyTrainingPlanServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyTrainingPlanMapper, SafetyTrainingPlan> |
| | | implements SafetyTrainingPlanService { |
| | | |
| | | @Override |
| | | public IPage<SafetyTrainingPlan> queryPage(Page<SafetyTrainingPlan> page, SafetyTrainingPlan query) { |
| | | QueryWrapper<SafetyTrainingPlan> wrapper = new QueryWrapper<SafetyTrainingPlan>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getYear())) { |
| | | wrapper.eq("`year`", query.getYear()); |
| | | } |
| | | if (hasText(query.getPost())) { |
| | | wrapper.like("post", query.getPost()); |
| | | } |
| | | if (hasText(query.getLevel())) { |
| | | wrapper.eq("`level`", query.getLevel()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyTrainingRecordMapper; |
| | | import com.ruoyi.safety.pojo.SafetyTrainingRecord; |
| | | import com.ruoyi.safety.service.SafetyTrainingRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyTrainingRecordServiceImpl |
| | | extends SafetyBaseServiceImpl<SafetyTrainingRecordMapper, SafetyTrainingRecord> |
| | | implements SafetyTrainingRecordService { |
| | | |
| | | @Override |
| | | public IPage<SafetyTrainingRecord> queryPage(Page<SafetyTrainingRecord> page, SafetyTrainingRecord query) { |
| | | QueryWrapper<SafetyTrainingRecord> wrapper = |
| | | new QueryWrapper<SafetyTrainingRecord>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (query.getPlanId() != null) { |
| | | wrapper.eq("plan_id", query.getPlanId()); |
| | | } |
| | | if (query.getEmployeeId() != null) { |
| | | wrapper.eq("employee_id", query.getEmployeeId()); |
| | | } |
| | | if (hasText(query.getEmployeeName())) { |
| | | wrapper.like("employee_name", query.getEmployeeName()); |
| | | } |
| | | if (query.getStatus() != null) { |
| | | wrapper.eq("status", query.getStatus()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.safety.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.safety.mapper.SafetyWorkAreaMapper; |
| | | import com.ruoyi.safety.pojo.SafetyWorkArea; |
| | | import com.ruoyi.safety.service.SafetyWorkAreaService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SafetyWorkAreaServiceImpl extends SafetyBaseServiceImpl<SafetyWorkAreaMapper, SafetyWorkArea> |
| | | implements SafetyWorkAreaService { |
| | | |
| | | @Override |
| | | public IPage<SafetyWorkArea> queryPage(Page<SafetyWorkArea> page, SafetyWorkArea query) { |
| | | QueryWrapper<SafetyWorkArea> wrapper = new QueryWrapper<SafetyWorkArea>().orderByDesc("create_time"); |
| | | if (query != null) { |
| | | if (hasText(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | if (hasText(query.getManager())) { |
| | | wrapper.like("manager", query.getManager()); |
| | | } |
| | | if (query.getManagerId() != null) { |
| | | wrapper.eq("manager_id", query.getManagerId()); |
| | | } |
| | | } |
| | | return page(page, wrapper); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # è¯å¯¼-ä»å¨ç©æµç³»ç»é¡¹ç®ç¸å
³é
ç½® |
| | | inspur: |
| | | appId: 1205971611543404544 |
| | | appSecret: VkyDMDYwMTIwMjYxNzQxNDM2OTItrv |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /center-lims/mis/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 7003 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: uploadPath |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/mis-ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | host: 127.0.0.1 |
| | | # host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | password: |
| | | # password: 123456 |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: false |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | file: |
| | | temp-dir: /center-lims/mis/file/temp/uploads |
| | | upload-dir: /center-lims/mis/file/prod/uploads |
| | |
| | | # Springé
ç½® |
| | | spring: |
| | | profiles: |
| | | active: yxglxt |
| | | active: dev |
| | | #10.136.58.65 è´¢å¡ç®¡çç³»ç» cwglxt |
| | | #10.136.58.66 设å¤ç®¡çç³»ç» sbglxt |
| | | #10.136.58.67 ç产管æ§ç³»ç» scgkxt |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safety.mapper.SafetyInspectionRecordMapper"> |
| | | |
| | | <select id="selectTodayStatistics" resultType="com.ruoyi.safety.dto.SafetyInspectionTodayStatistics"> |
| | | SELECT |
| | | COUNT(1) AS totalCount, |
| | | IFNULL(SUM(CASE WHEN status <> 3 THEN 1 ELSE 0 END), 0) AS completedCount, |
| | | IFNULL(SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END), 0) AS abnormalCount, |
| | | IFNULL(SUM(CASE WHEN status = 2 OR is_missed = 1 THEN 1 ELSE 0 END), 0) AS missedCount, |
| | | IFNULL(SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END), 0) AS unexecutedCount, |
| | | CASE |
| | | WHEN COUNT(1) = 0 THEN 0 |
| | | ELSE ROUND(IFNULL(SUM(CASE WHEN status <> 3 THEN 1 ELSE 0 END), 0) / COUNT(1) * 100, 2) |
| | | END AS completionRate, |
| | | COUNT(DISTINCT inspector_id) AS inspectorCount |
| | | FROM safety_inspection_record |
| | | WHERE del_flag = 0 |
| | | AND DATE(inspection_time) = #{statDate} |
| | | </select> |
| | | |
| | | <select id="selectTrendStatistics" resultType="com.ruoyi.safety.dto.SafetyInspectionTrendStat"> |
| | | SELECT |
| | | DATE(inspection_time) AS statDate, |
| | | COUNT(1) AS totalCount, |
| | | IFNULL(SUM(CASE WHEN status <> 3 THEN 1 ELSE 0 END), 0) AS completedCount, |
| | | IFNULL(SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END), 0) AS abnormalCount, |
| | | IFNULL(SUM(CASE WHEN status = 2 OR is_missed = 1 THEN 1 ELSE 0 END), 0) AS missedCount, |
| | | IFNULL(SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END), 0) AS unexecutedCount |
| | | FROM safety_inspection_record |
| | | WHERE del_flag = 0 |
| | | AND DATE(inspection_time) BETWEEN #{startDate} AND #{endDate} |
| | | GROUP BY DATE(inspection_time) |
| | | ORDER BY statDate ASC |
| | | </select> |
| | | |
| | | <select id="selectTypeStatistics" resultType="com.ruoyi.safety.dto.SafetyInspectionTypeStat"> |
| | | SELECT |
| | | IFNULL(type, 'unknown') AS type, |
| | | COUNT(1) AS count |
| | | FROM safety_inspection_record |
| | | WHERE del_flag = 0 |
| | | AND DATE(inspection_time) BETWEEN #{startDate} AND #{endDate} |
| | | GROUP BY IFNULL(type, 'unknown') |
| | | ORDER BY count DESC |
| | | </select> |
| | | |
| | | <select id="selectInspectorStatistics" resultType="com.ruoyi.safety.dto.SafetyInspectorStat"> |
| | | SELECT |
| | | inspector_id AS inspectorId, |
| | | inspector AS inspector, |
| | | COUNT(1) AS totalCount, |
| | | IFNULL(SUM(CASE WHEN status <> 3 THEN 1 ELSE 0 END), 0) AS completedCount, |
| | | IFNULL(SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END), 0) AS abnormalCount, |
| | | IFNULL(SUM(CASE WHEN status = 2 OR is_missed = 1 THEN 1 ELSE 0 END), 0) AS missedCount, |
| | | IFNULL(SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END), 0) AS unexecutedCount, |
| | | CASE |
| | | WHEN COUNT(1) = 0 THEN 0 |
| | | ELSE ROUND(IFNULL(SUM(CASE WHEN status <> 3 THEN 1 ELSE 0 END), 0) / COUNT(1) * 100, 2) |
| | | END AS completionRate |
| | | FROM safety_inspection_record |
| | | WHERE del_flag = 0 |
| | | AND DATE(inspection_time) BETWEEN #{startDate} AND #{endDate} |
| | | GROUP BY inspector_id, inspector |
| | | ORDER BY totalCount DESC |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.safety.mapper.SafetyLearningRecordMapper"> |
| | | |
| | | <select id="selectStatistics" resultType="com.ruoyi.safety.dto.SafetyLearningStatistics"> |
| | | SELECT |
| | | COUNT(1) AS totalCount, |
| | | IFNULL(SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END), 0) AS completedCount, |
| | | IFNULL(SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END), 0) AS unfinishedCount, |
| | | IFNULL(SUM(duration), 0) AS totalDuration, |
| | | CASE |
| | | WHEN COUNT(1) = 0 THEN 0 |
| | | ELSE ROUND(IFNULL(SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END), 0) / COUNT(1) * 100, 2) |
| | | END AS completionRate |
| | | FROM safety_learning_record |
| | | WHERE del_flag = 0 |
| | | </select> |
| | | </mapper> |