| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.EditHiddenDangerResponsiblePersonDto; |
| | | import com.ruoyi.system.enums.DeviceType; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.model.Record; |
| | | import com.ruoyi.system.query.*; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | private PositionService positionService; |
| | | |
| | | |
| | | @Autowired |
| | | private PlanService planService; |
| | | |
| | | @Autowired |
| | | private ScreenAccountService screenAccountService; |
| | | |
| | | |
| | | @ApiOperation(value = "获取项目/委托方列表",response = LoginNameVo.class) |
| | | @GetMapping("/getLoginNameVoList") |
| | | public R<List<LoginNameVo>> getProjectList(@RequestParam Integer userId) { |
| | | ScreenAccount screenAccount = screenAccountService.getById(userId); |
| | | String clientProjectIds = screenAccount.getClientProjectIds(); |
| | | if(screenAccount.getType()==1){ |
| | | // 委托方 |
| | | List<LoginNameVo> list = screenAccountService.getLoginClient(clientProjectIds); |
| | | return R.ok(list); |
| | | }else { |
| | | // 项目 |
| | | List<LoginNameVo> list = screenAccountService.getLoginProject(clientProjectIds); |
| | | return R.ok(list); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | if(task!=null){ |
| | | projectVo.setCheckTime(task.getUpdateTime()); |
| | | } |
| | | List<DeviceCountVo> list = deviceUsageService.getProjectDeviceCount(id); |
| | | projectVo.setDeviceCountVos(list); |
| | | return R.ok(projectVo); |
| | | } |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取项目重大风险源详情") |
| | | @GetMapping("/getProjectDangerousSourceDetail/{id}") |
| | | public R<?> getProjectDangerousSourceDetail(@PathVariable Integer id) { |
| | | ProjectInfo projectInfo = projectInfoService.getById(id); |
| | | return R.ok(projectInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备类型") |
| | | @GetMapping("/deviceTypes") |
| | | public R<?> deviceTypeOptions(@RequestParam(value = "title", required = false) String title) { |
| | | return R.ok(SelectOptionVo.buildOptions(title, DeviceType.values())); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "各分项隐患趋势") |
| | | @GetMapping("/getProjectHiddenDangerTrend") |
| | | public R<List<ProjectHiddenDangerTrendVo>> getProjectHiddenDangerTrend(@RequestParam Integer projectId,@RequestParam(value = "desc", required = true) Boolean desc,@RequestParam(value = "type", required = true)Integer type) { |
| | | List<ProjectHiddenDangerTrendVo> list = projectInfoService.getProjectHiddenDangerTrend(projectId); |
| | | if(type==1){ |
| | | if(desc){ |
| | | list = list.stream().sorted(Comparator.comparingInt(ProjectHiddenDangerTrendVo::getThisMonth).reversed()).toList(); |
| | | }else { |
| | | list = list.stream().sorted(Comparator.comparingInt(ProjectHiddenDangerTrendVo::getThisMonth)).toList(); |
| | | } |
| | | }else { |
| | | if(desc){ |
| | | list = list.stream().sorted(Comparator.comparingDouble(ProjectHiddenDangerTrendVo::getRate).reversed()).toList(); |
| | | }else { |
| | | list = list.stream().sorted(Comparator.comparingDouble(ProjectHiddenDangerTrendVo::getRate)).toList(); |
| | | } |
| | | } |
| | | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "各分项隐患趋势列表") |
| | | @PostMapping("/getProjectHiddenDangerTrendList") |
| | | public R<List<ProjectHiddenDangerList>> getProjectHiddenDangerTrendList(@RequestBody @Valid ProjectHiddenDangerTrendListQuery query) { |
| | | List<ProjectHiddenDangerList> list = projectInfoService.getProjectHiddenDangerTrendList(query); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "大屏风险趋势") |
| | | @PostMapping("/getProjectDangerousTrend") |
| | | public R<List<ProjectDangerousTrendVo>> getProjectDangerousTrend(@RequestBody @Valid ProjectDangerousTrendQuery query) { |
| | | List<ProjectDangerousTrendVo> list = projectInfoService.getProjectDangerousTrend(query); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |