| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- package com.zd.security.controller;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.zd.common.core.annotation.Log;
- import com.zd.common.core.annotation.PreAuthorize;
- import com.zd.common.core.log.BusinessType;
- import com.zd.common.core.utils.FileConfigUtils;
- import com.zd.common.core.utils.StringUtils;
- import com.zd.common.core.web.controller.AbstractController;
- import com.zd.model.domain.ResultData;
- import com.zd.model.domain.per.PerFun;
- import com.zd.model.domain.per.PerPrefix;
- import com.zd.security.api.bo.CheckHazardBo;
- import com.zd.security.api.dto.CheckHazardApplyDto;
- import com.zd.security.api.dto.UploadDto;
- import com.zd.security.api.vo.CheckHazardApplyVo;
- import com.zd.security.api.vo.CheckHazardVo;
- import com.zd.security.api.vo.CheckManageVo;
- import com.zd.security.api.vo.CheckRectifyApplyVo;
- import com.zd.security.entity.*;
- import com.zd.security.scope.DataPermission;
- import com.zd.security.scope.DataPermissionAspect;
- import com.zd.security.service.*;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Collections;
- import java.util.List;
- import java.util.Optional;
- import java.util.function.Function;
- import java.util.stream.Collectors;
- /**
- * <p>
- * 隐患表 前端控制器
- * </p>
- *
- * @author cyl
- * @since 2023-04-19
- */
- @RestController
- @RequestMapping("/checkHazard")
- public class CheckHazardController extends AbstractController {
- @Autowired
- private CheckHazardService checkHazardService;
- @Autowired
- private CheckRectifyService checkRectifyService;
- @Autowired
- private CheckManageService checkManageService;
- @Autowired
- private UploadService uploadService;
- @Autowired
- private FileConfigUtils fileConfigUtils;
- @Autowired
- private CheckStaffUserService checkStaffUserService;
- @Autowired
- private CheckMemberService checkMemberService;
- /**
- * 通过巡查管理Id获取
- * @param checkHazard
- * @return
- */
- @GetMapping(value = "/findByCheckHazardList")
- public ResultData find(CheckHazard checkHazard) {
- //查询条件
- QueryWrapper <CheckHazard> wrapper = new QueryWrapper <>();
- //过滤物理删除数据及正序叙
- wrapper.lambda().eq(CheckHazard::getIsDeleted, Boolean.FALSE)
- .eq(CheckHazard::getCheckManageId,checkHazard.getCheckManageId()).orderByAsc(CheckHazard::getId);
- List <CheckHazard> checkHazardList = checkHazardService.list(wrapper);
- return ResultData.success(checkHazardList);
- }
- /**
- * 添加数据
- * @param checkHazardBo
- * @return
- */
- @Log(title = "安全服务-测试添加", businessType = BusinessType.INSERT)
- @PostMapping(value = "/add")
- public ResultData add(@RequestBody CheckHazardBo checkHazardBo) {
- Optional.ofNullable(checkHazardBo.getCheckHazardDtoList()).orElseGet(Collections::emptyList)
- .stream()
- .forEach(a->{
- //参数检查
- paramCheck.notNull(a)
- .notNull(a.getHazardLevel())
- .strNotEmpty(a.getHazardCheckPro())
- .strNotEmpty(a.getHazardDescribe());
- });
- checkHazardService.addHazard(checkHazardBo);
- return ResultData.success("操作成功");
- }
- /**
- * 获取数据列表list(院校巡查和实验室自查)
- * @param checkHazardBo
- * @return
- */
- @DataPermission()
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/list")
- public ResultData list(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.checkHazardList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(院校巡查和实验室自查)已完成
- * @param checkHazardBo
- * @return
- */
- @DataPermission()
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/overList")
- public ResultData overList(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.overList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(院校巡查和实验室自查)待整改
- * @param checkHazardBo
- * @return
- */
- @DataPermission(roleKey="rectifyGentle")
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/rectifyList")
- public ResultData rectifyList(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.rectifyList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(院校巡查和实验室自查)待复核
- * @param checkHazardBo
- * @return
- */
- @DataPermission(roleKey="checkGentle")
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/recheckList")
- public ResultData recheckList(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.recheckList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(小程序接口)
- * @param checkHazardBo
- * @return
- */
- @DataPermission()
- @GetMapping(value = "/appHazardList")
- public ResultData appHazardList(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.checkHazardList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(批量审批查询列表)
- * @param checkHazardBo
- * @return
- */
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.APPROVE)
- @GetMapping(value = "/batchApprovalList")
- public ResultData batchApprovalList(CheckHazardBo checkHazardBo) {
- checkHazardBo.setUserId(getCurrentUserId());
- Page <CheckHazardVo> page = checkHazardService.batchApprovalList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(院校巡查和实验室自查)
- * @param checkHazardBo
- * @return
- */
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/appList")
- public ResultData appList(CheckHazardBo checkHazardBo) {
- Page <CheckHazardVo> page = checkHazardService.checkHazardAppList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据列表list(小程序接口)
- * @param checkHazardBo
- * @return
- */
- @GetMapping(value = "/appCheckHazardList")
- public ResultData appCheckHazardList(CheckHazardBo checkHazardBo) {
- checkHazardBo.setAppFlag(1);
- Page <CheckHazardVo> page = checkHazardService.checkHazardAppList(checkHazardBo);
- return ResultData.success(page);
- }
- /**
- * 获取数据详情(院校巡查和实验室自查)
- * @param id
- * @return
- */
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.QUERY)
- @GetMapping(value = "/getHazardById")
- public ResultData getHazardById(Long id){
- CheckHazardApplyVo checkHazardApplyVo = new CheckHazardApplyVo();
- CheckHazard checkHazard = checkHazardService.getById(id);
- StringBuilder stringBuffer = new StringBuilder();
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode1())){
- stringBuffer.append(checkHazard.getHazardCheckCode1()+""+checkHazard.getHazardCheckName1());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode2())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode2()+""+checkHazard.getHazardCheckName2());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode3())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode3()+""+checkHazard.getHazardCheckName3());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode()+""+checkHazard.getHazardCheckName());
- }
- //查询巡查管理的基础数据
- CheckManageVo checkManageVo = checkManageService.findCheckManage(checkHazard.getCheckManageId());
- BeanUtils.copyProperties(checkManageVo,checkHazardApplyVo);
- //复制整改数据到大的对象里
- BeanUtils.copyProperties(checkHazard,checkHazardApplyVo.getCheckHazardApplyDto());
- CheckHazardBo checkHazardBo = new CheckHazardBo();
- checkHazardBo.setSubId(checkManageVo.getSubId());
- checkHazardBo.setHazardCheckPro(checkHazard.getHazardCheckPro());
- //这里需要统计检查项历史数据
- checkHazardApplyVo.getCheckHazardApplyDto().setHazardCheckCount(checkHazardService.countHazardNum(checkHazardBo));
- if(StringUtils.isNotNull(stringBuffer)){
- checkHazardApplyVo.getCheckHazardApplyDto().setHazardCheckProStr(stringBuffer.toString());
- }
- //这里需要查询身份
- getRectifyCheck(checkHazardApplyVo.getCheckHazardApplyDto(),checkManageVo.getSubId(),checkHazard.getHazardType(),checkManageVo.getCheckPlanId());
- //补全图片查询
- if(checkHazardApplyVo.getCheckHazardApplyDto()!=null){
- QueryWrapper <Upload> uploadWrap = new QueryWrapper <>();
- uploadWrap.lambda().eq(Upload::getSource,2).eq(Upload::getKeyId,checkHazardApplyVo.getCheckHazardApplyDto().getId());
- List<Upload> uploadList = uploadService.list(uploadWrap);
- Function <List<Upload>,List<UploadDto>> function = fun->Optional.ofNullable(fun).orElseGet(Collections::emptyList)
- .stream()
- .map(a->{
- UploadDto uploadDto = new UploadDto();
- BeanUtils.copyProperties(a,uploadDto);
- uploadDto.setFileUrl(uploadDto.getFileUrl());
- uploadDto.setViewFileUrl(fileConfigUtils.getFileDomainAdmin()+uploadDto.getFileUrl());
- return uploadDto;
- }).collect(Collectors.toList());
- checkHazardApplyVo.getCheckHazardApplyDto().setUploadDtoList(function.apply(uploadList));
- }
- //查询条件
- QueryWrapper <CheckRectify> wrapper = new QueryWrapper <>();
- if(StringUtils.isNotNull(checkHazard.getId())){
- wrapper.lambda().eq(CheckRectify::getIsDeleted,Boolean.FALSE)
- .eq(CheckRectify::getCheckHazardId,checkHazard.getId())
- .orderByAsc(CheckRectify::getId);
- List<CheckRectify> checkRectify = checkRectifyService.list(wrapper);
- if(checkRectify!=null && !checkRectify.isEmpty()){
- for(CheckRectify checkRectify1:checkRectify){
- if(StringUtils.isNotNull(checkRectify1.getReviewedBy())){
- //拆分整改内容
- CheckRectifyApplyVo checkRectifyApplyVo = new CheckRectifyApplyVo();
- checkRectifyApplyVo.setApplyFlag(1);
- checkRectifyApplyVo.setId(checkRectify1.getId());
- checkRectifyApplyVo.setRectifyType(checkRectify1.getRectifyType());
- checkRectifyApplyVo.setRectifyResult(checkRectify1.getRectifyResult());
- checkRectifyApplyVo.setRectifyMeasure(checkRectify1.getRectifyMeasure());
- checkRectifyApplyVo.setCreateBy(checkRectify1.getCreateBy());
- checkRectifyApplyVo.setCreateName(checkRectify1.getCreateName());
- checkRectifyApplyVo.setCreateTime(checkRectify1.getCreateTime());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyApplyVo);
- //查询整改图片
- checkRectifyApplyVo.setUploadDtoList(funDto(checkRectify1.getId()));
- //拆分复核内容
- CheckRectifyApplyVo checkRectifyExamineVo = new CheckRectifyApplyVo();
- checkRectifyExamineVo.setApplyFlag(2);
- checkRectifyExamineVo.setExamineResult(checkRectify1.getExamineResult());
- checkRectifyExamineVo.setExamineOpinion(checkRectify1.getExamineOpinion());
- checkRectifyExamineVo.setReviewedBy(checkRectify1.getReviewedBy());
- checkRectifyExamineVo.setReviewedName(checkRectify1.getReviewedName());
- checkRectifyExamineVo.setReviewedTime(checkRectify1.getReviewedTime());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyExamineVo);
- }else{
- //整改内容
- CheckRectifyApplyVo checkRectifyApplyVo = new CheckRectifyApplyVo();
- checkRectifyApplyVo.setApplyFlag(1);
- checkRectifyApplyVo.setId(checkRectify1.getId());
- checkRectifyApplyVo.setRectifyType(checkRectify1.getRectifyType());
- checkRectifyApplyVo.setRectifyResult(checkRectify1.getRectifyResult());
- checkRectifyApplyVo.setRectifyMeasure(checkRectify1.getRectifyMeasure());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyApplyVo);
- checkRectifyApplyVo.setCreateBy(checkRectify1.getCreateBy());
- checkRectifyApplyVo.setCreateName(checkRectify1.getCreateName());
- checkRectifyApplyVo.setCreateTime(checkRectify1.getCreateTime());
- //查询整改图片
- checkRectifyApplyVo.setUploadDtoList(funDto(checkRectify1.getId()));
- }
- }
- }
- }
- checkHazardApplyVo.setRectifyNotice(checkManageVo.getRectifyNotice());
- return ResultData.success(checkHazardApplyVo);
- }
- /**
- * 获取数据详情(小程序接口)
- * @param id
- * @return
- */
- @GetMapping(value = "/getAppHazardById")
- public ResultData getAppHazardById(Long id){
- CheckHazardApplyVo checkHazardApplyVo = new CheckHazardApplyVo();
- CheckHazard checkHazard = checkHazardService.getById(id);
- StringBuilder stringBuffer = new StringBuilder();
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode1())){
- stringBuffer.append(checkHazard.getHazardCheckCode1()+""+checkHazard.getHazardCheckName1());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode2())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode2()+""+checkHazard.getHazardCheckName2());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode3())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode3()+""+checkHazard.getHazardCheckName3());
- }
- if(StringUtils.isNotNull(checkHazard.getHazardCheckCode())){
- stringBuffer.append("—"+checkHazard.getHazardCheckCode()+""+checkHazard.getHazardCheckName());
- }
- //查询巡查管理的基础数据
- CheckManageVo checkManageVo = checkManageService.findCheckManage(checkHazard.getCheckManageId());
- BeanUtils.copyProperties(checkManageVo,checkHazardApplyVo);
- //复制整改数据到大的对象里
- BeanUtils.copyProperties(checkHazard,checkHazardApplyVo.getCheckHazardApplyDto());
- CheckHazardBo checkHazardBo = new CheckHazardBo();
- checkHazardBo.setSubId(checkManageVo.getSubId());
- checkHazardBo.setHazardCheckPro(checkHazard.getHazardCheckPro());
- //这里需要统计检查项历史数据
- checkHazardApplyVo.getCheckHazardApplyDto().setHazardCheckCount(checkHazardService.countHazardNum(checkHazardBo));
- if(StringUtils.isNotNull(stringBuffer)){
- checkHazardApplyVo.getCheckHazardApplyDto().setHazardCheckProStr(stringBuffer.toString());
- }
- //这里需要查询身份
- getRectifyCheck(checkHazardApplyVo.getCheckHazardApplyDto(),checkManageVo.getSubId(),checkHazard.getHazardType(),checkManageVo.getCheckPlanId());
- //补全图片查询
- if(checkHazardApplyVo.getCheckHazardApplyDto()!=null){
- QueryWrapper <Upload> uploadWrap = new QueryWrapper <>();
- uploadWrap.lambda().eq(Upload::getSource,2).eq(Upload::getKeyId,checkHazardApplyVo.getCheckHazardApplyDto().getId());
- List<Upload> uploadList = uploadService.list(uploadWrap);
- Function <List<Upload>,List<UploadDto>> function = fun->Optional.ofNullable(fun).orElseGet(Collections::emptyList)
- .stream()
- .map(a->{
- UploadDto uploadDto = new UploadDto();
- BeanUtils.copyProperties(a,uploadDto);
- uploadDto.setFileUrl(uploadDto.getFileUrl());
- uploadDto.setViewFileUrl(fileConfigUtils.getFileDomainAdmin()+uploadDto.getFileUrl());
- return uploadDto;
- }).collect(Collectors.toList());
- checkHazardApplyVo.getCheckHazardApplyDto().setUploadDtoList(function.apply(uploadList));
- }
- //查询条件
- QueryWrapper <CheckRectify> wrapper = new QueryWrapper <>();
- if(StringUtils.isNotNull(checkHazard.getId())){
- wrapper.lambda().eq(CheckRectify::getIsDeleted,Boolean.FALSE)
- .eq(CheckRectify::getCheckHazardId,checkHazard.getId())
- .orderByAsc(CheckRectify::getId);
- List<CheckRectify> checkRectify = checkRectifyService.list(wrapper);
- if(checkRectify!=null && !checkRectify.isEmpty()){
- for(CheckRectify checkRectify1:checkRectify){
- if(StringUtils.isNotNull(checkRectify1.getReviewedBy())){
- //拆分整改内容
- CheckRectifyApplyVo checkRectifyApplyVo = new CheckRectifyApplyVo();
- checkRectifyApplyVo.setApplyFlag(1);
- checkRectifyApplyVo.setId(checkRectify1.getId());
- checkRectifyApplyVo.setRectifyType(checkRectify1.getRectifyType());
- checkRectifyApplyVo.setRectifyResult(checkRectify1.getRectifyResult());
- checkRectifyApplyVo.setRectifyMeasure(checkRectify1.getRectifyMeasure());
- checkRectifyApplyVo.setCreateBy(checkRectify1.getCreateBy());
- checkRectifyApplyVo.setCreateName(checkRectify1.getCreateName());
- checkRectifyApplyVo.setCreateTime(checkRectify1.getCreateTime());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyApplyVo);
- //查询整改图片
- checkRectifyApplyVo.setUploadDtoList(funDto(checkRectify1.getId()));
- //拆分复核内容
- CheckRectifyApplyVo checkRectifyExamineVo = new CheckRectifyApplyVo();
- checkRectifyExamineVo.setApplyFlag(2);
- checkRectifyExamineVo.setExamineResult(checkRectify1.getExamineResult());
- checkRectifyExamineVo.setExamineOpinion(checkRectify1.getExamineOpinion());
- checkRectifyExamineVo.setReviewedBy(checkRectify1.getReviewedBy());
- checkRectifyExamineVo.setReviewedName(checkRectify1.getReviewedName());
- checkRectifyExamineVo.setReviewedTime(checkRectify1.getReviewedTime());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyExamineVo);
- }else{
- //整改内容
- CheckRectifyApplyVo checkRectifyApplyVo = new CheckRectifyApplyVo();
- checkRectifyApplyVo.setApplyFlag(1);
- checkRectifyApplyVo.setId(checkRectify1.getId());
- checkRectifyApplyVo.setRectifyType(checkRectify1.getRectifyType());
- checkRectifyApplyVo.setRectifyResult(checkRectify1.getRectifyResult());
- checkRectifyApplyVo.setRectifyMeasure(checkRectify1.getRectifyMeasure());
- checkHazardApplyVo.getCheckRectifyApplyList().add(checkRectifyApplyVo);
- checkRectifyApplyVo.setCreateBy(checkRectify1.getCreateBy());
- checkRectifyApplyVo.setCreateName(checkRectify1.getCreateName());
- checkRectifyApplyVo.setCreateTime(checkRectify1.getCreateTime());
- //查询整改图片
- checkRectifyApplyVo.setUploadDtoList(funDto(checkRectify1.getId()));
- }
- }
- }
- }
- return ResultData.success(checkHazardApplyVo);
- }
- //查询登录人当前的隐患是否有整改身份和检查身份
- private void getRectifyCheck(CheckHazardApplyDto applyDto,Long subId,Integer hazardType,Long checkPlanId){
- if(hazardType.intValue()==2){
- //查询自查检查身份
- List<CheckStaffUser> checkStaffUserAppList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
- .eq(CheckStaffUser::getUserId,getCurrentUserId()).eq(CheckStaffUser::getStaffType,1)
- .eq(CheckStaffUser::getSubId,subId));
- if(checkStaffUserAppList!=null && !checkStaffUserAppList.isEmpty()){
- applyDto.setApplyGentle(Boolean.TRUE);
- }
- }else{
- //查询院校巡查身份
- List<CheckMember> checkMemberList = checkMemberService.list(new LambdaQueryWrapper <CheckMember>()
- .eq(CheckMember::getCheckPlanId,checkPlanId).eq(CheckMember::getUserId,getCurrentUserId()));
- if(checkMemberList!=null && !checkMemberList.isEmpty()){
- applyDto.setApplyGentle(Boolean.TRUE);
- }
- }
- //查询整改身份
- List<CheckStaffUser> checkStaffUserRecList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
- .eq(CheckStaffUser::getUserId,getCurrentUserId()).eq(CheckStaffUser::getStaffType,2)
- .eq(CheckStaffUser::getSubId,subId));
- if(checkStaffUserRecList!=null && !checkStaffUserRecList.isEmpty()){
- applyDto.setRectifyGentle(Boolean.TRUE);
- }
- }
- public List<UploadDto> funDto(Long id){
- Function<List<Upload>,List<UploadDto>> function = fun->Optional.ofNullable(fun).orElseGet(Collections::emptyList)
- .stream()
- .map(a->{
- UploadDto uploadDto = new UploadDto();
- BeanUtils.copyProperties(a,uploadDto);
- return uploadDto;
- }).collect(Collectors.toList());
- QueryWrapper <Upload> uploadWrap = new QueryWrapper <>();
- uploadWrap.lambda().eq(Upload::getSource,3).eq(Upload::getKeyId,id);
- List<Upload> uploadList = uploadService.list(uploadWrap);
- return function.apply(uploadList);
- }
- /**
- * 获取数据列表list(暂无法整改)
- * @param checkHazardBo
- * @return
- */
- @DataPermission()
- @PreAuthorize(hasPermi = PerPrefix.SECURITY_CHECKHAZARD + PerFun.LIST)
- @GetMapping(value = "/unableRectifyList")
- public ResultData unableRectifyList(CheckHazardBo checkHazardBo) {
- //参数检查
- List<Long> userList = DataPermissionAspect.threadLocal.get(); // 获取数据
- checkHazardBo.setUserList(userList);
- DataPermissionAspect.threadLocal.remove();
- Page <CheckHazardVo> page = checkHazardService.unableRectifyList(checkHazardBo);;
- return ResultData.success(page);
- }
- /**
- * 统计隐患数量
- * @param checkHazardBo
- * @return
- */
- @GetMapping(value = "/countHazardNum")
- public ResultData countHazardNum(CheckHazardBo checkHazardBo) {
- return ResultData.success(checkHazardService.countHazardNum(checkHazardBo));
- }
- /**
- * 统计隐患数量
- * @param checkHazardBo
- * @return
- */
- @GetMapping(value = "/rectifySchedule")
- public ResultData rectifySchedule(CheckHazardBo checkHazardBo) {
- return ResultData.success(checkHazardService.rectifySchedule(checkHazardBo.getCheckManageId()));
- }
- /**
- * 安全隐患整改逾期数据标记
- * @return
- */
- @GetMapping(value = "/overdue")
- public ResultData overdue() {
- checkHazardService.overdue();
- return ResultData.success();
- }
- }
|