| | |
| | | @PreAuthorize("@ss.hasPermission('safety:inspection-point:query')") |
| | | public CommonResult<SafetyInspectionPointRespVO> getPoint(@RequestParam("id") Long id) { |
| | | var point = inspectionService.getPoint(id); |
| | | // 单条查询也要回填主数据最新值,不能只返回快照 |
| | | inspectionService.fillPointRefs(java.util.List.of(point)); |
| | | var resp = BeanUtils.toBean(point, SafetyInspectionPointRespVO.class); |
| | | SafetyInspectionService.fillPointDisplay(point, resp); |
| | | resp.setLastInspectTime(inspectionService.getLastInspectTime(id)); |
| | |
| | | public CommonResult<PageResult<SafetyInspectionPointRespVO>> getPointPage( |
| | | @Valid SafetyInspectionPointPageReqVO reqVO) { |
| | | var page = inspectionService.getPointPage(reqVO); |
| | | inspectionService.fillPointRefs(page.getList()); |
| | | var result = BeanUtils.toBean(page, SafetyInspectionPointRespVO.class); |
| | | for (int i = 0; i < page.getList().size(); i++) { |
| | | SafetyInspectionService.fillPointDisplay(page.getList().get(i), result.getList().get(i)); |
| | |
| | | @Operation(summary = "获得启用中的巡检点位精简列表(移动端巡检选择)") |
| | | @PreAuthorize("@ss.hasPermission('safety:inspection-point:query')") |
| | | public CommonResult<List<SafetyInspectionPointRespVO>> getPointSimpleList() { |
| | | List<SafetyInspectionPointRespVO> list = inspectionService.getEnabledPointList().stream() |
| | | var points = inspectionService.getEnabledPointList(); |
| | | inspectionService.fillPointRefs(points); |
| | | List<SafetyInspectionPointRespVO> list = points.stream() |
| | | .map(point -> { |
| | | var resp = BeanUtils.toBean(point, SafetyInspectionPointRespVO.class); |
| | | SafetyInspectionService.fillPointDisplay(point, resp); |
| | |
| | | @PreAuthorize("@ss.hasPermission('safety:inspection:query')") |
| | | public CommonResult<SafetyInspectionRespVO> getRecord(@RequestParam("id") Long id) { |
| | | var record = inspectionService.getInspection(id); |
| | | inspectionService.fillInspectorNames(java.util.List.of(record)); |
| | | var resp = BeanUtils.toBean(record, SafetyInspectionRespVO.class); |
| | | resp.setPointTypeName(cn.iocoder.yudao.module.mes.enums.safety.SafetyInspectionPointTypeEnum |
| | | .getNameByType(record.getPointType())); |
| | |
| | | public CommonResult<PageResult<SafetyInspectionRespVO>> getRecordPage( |
| | | @Valid SafetyInspectionPageReqVO reqVO) { |
| | | var page = inspectionService.getInspectionPage(reqVO); |
| | | inspectionService.fillInspectorNames(page.getList()); |
| | | var result = BeanUtils.toBean(page, SafetyInspectionRespVO.class); |
| | | for (int i = 0; i < page.getList().size(); i++) { |
| | | var record = page.getList().get(i); |