xiaoyi
4 天以前 05ab6e3f69a5e73624b2573db043f5923e8f7d8b
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/safety/SafetyInspectionController.java
@@ -64,6 +64,8 @@
    @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));
@@ -76,6 +78,7 @@
    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));
@@ -87,7 +90,9 @@
    @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);
@@ -128,6 +133,7 @@
    @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()));
@@ -141,6 +147,7 @@
    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);