安全
This commit is contained in:
@ -1,27 +1,27 @@
|
|||||||
package org.dromara.safety.controller;
|
package org.dromara.safety.controller;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.quality.domain.dto.fileFolder.SafeListQueryDto;
|
import org.dromara.quality.domain.dto.fileFolder.SafeListQueryDto;
|
||||||
import org.dromara.safety.domain.HseFileFolder;
|
import org.dromara.safety.domain.HseFileFolder;
|
||||||
import org.dromara.safety.domain.dto.fileFolder.FileFolderCreateDTO;
|
import org.dromara.safety.domain.dto.fileFolder.FileFolderCreateDTO;
|
||||||
import org.dromara.safety.domain.dto.fileFolder.FileFolderMoveDTO;
|
import org.dromara.safety.domain.dto.fileFolder.FileFolderMoveDTO;
|
||||||
import org.dromara.safety.domain.vo.fileFolder.FileFolderTreeVO;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.safety.domain.vo.HseFileFolderVo;
|
import org.dromara.safety.domain.vo.HseFileFolderVo;
|
||||||
|
import org.dromara.safety.domain.vo.fileFolder.FileFolderTreeVO;
|
||||||
import org.dromara.safety.service.IHseFileFolderService;
|
import org.dromara.safety.service.IHseFileFolderService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会议纪要
|
* 会议纪要
|
||||||
*
|
*
|
||||||
@ -39,7 +39,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询会议纪要列表
|
* 查询会议纪要列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:fileFolder:listAll")
|
@SaCheckPermission("safety:fileFolder:list")
|
||||||
@GetMapping("/list-all")
|
@GetMapping("/list-all")
|
||||||
public R<List<HseFileFolderVo>> listAll(SafeListQueryDto dto) {
|
public R<List<HseFileFolderVo>> listAll(SafeListQueryDto dto) {
|
||||||
return R.ok(hseFileFolderService.listAll(dto));
|
return R.ok(hseFileFolderService.listAll(dto));
|
||||||
@ -47,6 +47,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询指定目录的树形结构(一次性加载所有层级)
|
* 查询指定目录的树形结构(一次性加载所有层级)
|
||||||
|
*
|
||||||
* @return 树形结构列表
|
* @return 树形结构列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/tree-all")
|
@GetMapping("/tree-all")
|
||||||
@ -56,7 +57,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
List<HseFileFolder> allItems = hseFileFolderService.list(new LambdaQueryWrapper<HseFileFolder>()
|
List<HseFileFolder> allItems = hseFileFolderService.list(new LambdaQueryWrapper<HseFileFolder>()
|
||||||
.eq(HseFileFolder::getProjectId, dto.getProjectId())
|
.eq(HseFileFolder::getProjectId, dto.getProjectId())
|
||||||
.like(HseFileFolder::getPath, "," + dto.getParentId() + ",") // 包含父ID的所有子项
|
.like(HseFileFolder::getPath, "," + dto.getParentId() + ",") // 包含父ID的所有子项
|
||||||
.eq(dto.getType()!=null,HseFileFolder::getType, dto.getType())
|
.eq(dto.getType() != null, HseFileFolder::getType, dto.getType())
|
||||||
.orderByDesc(HseFileFolder::getId)
|
.orderByDesc(HseFileFolder::getId)
|
||||||
.orderByAsc(HseFileFolder::getSort)
|
.orderByAsc(HseFileFolder::getSort)
|
||||||
);
|
);
|
||||||
@ -93,7 +94,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 创建文件或文件夹
|
* 创建文件或文件夹
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:fileFolder:create")
|
@SaCheckPermission("safety:fileFolder:add")
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public R<HseFileFolder> create(@RequestBody FileFolderCreateDTO dto) {
|
public R<HseFileFolder> create(@RequestBody FileFolderCreateDTO dto) {
|
||||||
return R.ok(hseFileFolderService.createFileOrFolder(dto));
|
return R.ok(hseFileFolderService.createFileOrFolder(dto));
|
||||||
@ -103,7 +104,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
* 删除文件或文件夹(级联删除子项)
|
* 删除文件或文件夹(级联删除子项)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@SaCheckPermission("safety:fileFolder:delete")
|
@SaCheckPermission("safety:fileFolder:remove")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@Transactional
|
@Transactional
|
||||||
public R<Boolean> delete(@PathVariable List<Long> ids) {
|
public R<Boolean> delete(@PathVariable List<Long> ids) {
|
||||||
@ -116,7 +117,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 移动文件或文件夹到指定目录
|
* 移动文件或文件夹到指定目录
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:fileFolder:move")
|
@SaCheckPermission("safety:fileFolder:edit")
|
||||||
@PostMapping("/move")
|
@PostMapping("/move")
|
||||||
@Transactional
|
@Transactional
|
||||||
public R<Boolean> move(@RequestBody FileFolderMoveDTO dto) {
|
public R<Boolean> move(@RequestBody FileFolderMoveDTO dto) {
|
||||||
@ -126,7 +127,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 上传ZIP文件并自动解压到指定目录(支持多层级)
|
* 上传ZIP文件并自动解压到指定目录(支持多层级)
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:fileFolder:create")
|
@SaCheckPermission("safety:fileFolder:add")
|
||||||
@PostMapping("/uploadAndUnzip")
|
@PostMapping("/uploadAndUnzip")
|
||||||
public R<String> uploadAndUnzip(
|
public R<String> uploadAndUnzip(
|
||||||
@RequestParam("file") MultipartFile file,
|
@RequestParam("file") MultipartFile file,
|
||||||
@ -154,7 +155,7 @@ public class HseFileFolderController extends BaseController {
|
|||||||
@PutMapping("/reName")
|
@PutMapping("/reName")
|
||||||
public R<Boolean> reName(@RequestParam("id") Long id,
|
public R<Boolean> reName(@RequestParam("id") Long id,
|
||||||
@RequestParam("name") String name) {
|
@RequestParam("name") String name) {
|
||||||
return R.ok(hseFileFolderService.reName(id,name));
|
return R.ok(hseFileFolderService.reName(id, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -163,8 +164,4 @@ public class HseFileFolderController extends BaseController {
|
|||||||
public void download(@PathVariable Long id, HttpServletResponse response) throws IOException {
|
public void download(@PathVariable Long id, HttpServletResponse response) throws IOException {
|
||||||
hseFileFolderService.download(id, response);
|
hseFileFolderService.download(id, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,21 @@
|
|||||||
package org.dromara.safety.controller;
|
package org.dromara.safety.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.safety.domain.dto.safetyinspection.*;
|
import org.dromara.safety.domain.dto.safetyinspection.*;
|
||||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo;
|
|
||||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||||
import org.dromara.safety.service.IHseSafetyInspectionService;
|
import org.dromara.safety.service.IHseSafetyInspectionService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -36,6 +37,18 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
|
|
||||||
private final IHseSafetyInspectionService safetyInspectionService;
|
private final IHseSafetyInspectionService safetyInspectionService;
|
||||||
|
|
||||||
|
private final IBusProjectTeamService projectTeamService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id查询项目班组班组长信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission(value = {"project:projectTeam:add", "safety:safetyInspection:edit"}, mode = SaMode.OR)
|
||||||
|
@GetMapping("/listForeman/{projectId}")
|
||||||
|
public R<List<BusProjectTeamForemanVo>> listForeman(@NotNull(message = "项目id不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(projectTeamService.queryForemanListByProjectId(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询安全巡检工单列表
|
* 查询安全巡检工单列表
|
||||||
*/
|
*/
|
||||||
@ -45,21 +58,10 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
return safetyInspectionService.queryPageListWeb(req, pageQuery);
|
return safetyInspectionService.queryPageListWeb(req, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出安全巡检工单列表
|
|
||||||
*/
|
|
||||||
@SaCheckPermission("safety:safetyInspection:export")
|
|
||||||
@Log(title = "安全巡检工单", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HseSafetyInspectionQueryReq req, HttpServletResponse response) {
|
|
||||||
List<HseSafetyInspectionVo> list = safetyInspectionService.queryList(req);
|
|
||||||
ExcelUtil.exportExcel(list, "安全巡检工单", HseSafetyInspectionVo.class, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据主键导出安全巡检工单
|
* 根据主键导出安全巡检工单
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:safetyInspection:export")
|
@SaCheckPermission("safety:safetyInspection:query")
|
||||||
@Log(title = "安全巡检工单", businessType = BusinessType.EXPORT)
|
@Log(title = "安全巡检工单", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export/word")
|
@PostMapping("/export/word")
|
||||||
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
||||||
@ -67,14 +69,6 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
safetyInspectionService.exportWordById(id, response);
|
safetyInspectionService.exportWordById(id, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询大屏安全信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/gis")
|
|
||||||
public R<HseSafetyInspectionListGisVo> queryGisList(HseSafetyInspectionGisReq req) {
|
|
||||||
return R.ok(safetyInspectionService.queryGisList(req));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取安全巡检工单详细信息
|
* 获取安全巡检工单详细信息
|
||||||
*
|
*
|
||||||
@ -101,7 +95,7 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增安全巡检工单整改
|
* 新增安全巡检工单整改
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:safetyInspection:rectification")
|
@SaCheckPermission("safety:safetyInspection:edit")
|
||||||
@Log(title = "安全巡检工单", businessType = BusinessType.INSERT)
|
@Log(title = "安全巡检工单", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/rectification")
|
@PostMapping("/rectification")
|
||||||
@ -112,7 +106,7 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增安全巡检工单复查
|
* 新增安全巡检工单复查
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:safetyInspection:review")
|
@SaCheckPermission("safety:safetyInspection:edit")
|
||||||
@Log(title = "安全巡检工单", businessType = BusinessType.INSERT)
|
@Log(title = "安全巡检工单", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/review")
|
@PostMapping("/review")
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
package org.dromara.safety.controller;
|
package org.dromara.safety.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
@ -46,17 +44,6 @@ public class HseSafetyLogController extends BaseController {
|
|||||||
return safetyLogService.queryPageList(req, pageQuery);
|
return safetyLogService.queryPageList(req, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出安全日志列表
|
|
||||||
*/
|
|
||||||
@SaCheckPermission("safety:safetyLog:export")
|
|
||||||
@Log(title = "安全日志", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HseSafetyLogQueryReq req, HttpServletResponse response) {
|
|
||||||
List<HseSafetyLogVo> list = safetyLogService.queryList(req);
|
|
||||||
ExcelUtil.exportExcel(list, "安全日志", HseSafetyLogVo.class, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取安全日志详细信息
|
* 获取安全日志详细信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
@ -49,17 +48,6 @@ public class HseSafetyWeeklyReportController extends BaseController {
|
|||||||
return safetyWeeklyReportService.queryPageList(req, pageQuery);
|
return safetyWeeklyReportService.queryPageList(req, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出安全周报列表
|
|
||||||
*/
|
|
||||||
@SaCheckPermission("safety:safetyWeeklyReport:export")
|
|
||||||
@Log(title = "安全周报", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HseSafetyWeeklyReportQueryReq req, HttpServletResponse response) {
|
|
||||||
List<HseSafetyWeeklyReportVo> list = safetyWeeklyReportService.queryList(req);
|
|
||||||
ExcelUtil.exportExcel(list, "安全周报", HseSafetyWeeklyReportVo.class, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取安全周报详细信息
|
* 获取安全周报详细信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.safety.controller;
|
package org.dromara.safety.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -47,7 +48,7 @@ public class HseTeamMeetingController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 根据 id 查询项目以及项目下的分包公司、班组列表
|
* 根据 id 查询项目以及项目下的分包公司、班组列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:teamMeeting:add")
|
@SaCheckPermission(value = {"safety:teamMeeting:add", "safety:teamMeeting:edit"}, mode = SaMode.OR)
|
||||||
@GetMapping("/contractorTeamList/{id}")
|
@GetMapping("/contractorTeamList/{id}")
|
||||||
public R<BusProjectContractorTeamListVo> listContractorListById(@NotNull(message = "主键不能为空")
|
public R<BusProjectContractorTeamListVo> listContractorListById(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
@ -57,7 +58,7 @@ public class HseTeamMeetingController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询项目班组下的成员列表
|
* 查询项目班组下的成员列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:teamMeeting:add")
|
@SaCheckPermission(value = {"safety:teamMeeting:add", "safety:teamMeeting:edit"}, mode = SaMode.OR)
|
||||||
@GetMapping("/teamMember/list")
|
@GetMapping("/teamMember/list")
|
||||||
public TableDataInfo<BusProjectTeamMemberVo> list(BusProjectTeamMemberQueryReq req, PageQuery pageQuery) {
|
public TableDataInfo<BusProjectTeamMemberVo> list(BusProjectTeamMemberQueryReq req, PageQuery pageQuery) {
|
||||||
return teamMemberService.queryPageList(req, pageQuery);
|
return teamMemberService.queryPageList(req, pageQuery);
|
||||||
|
|||||||
Reference in New Issue
Block a user