zouyu
2026-01-29 68d6ddbe1610b66e75ee05ad75998ce1a3caadba
不合格管理:重新提交oa功能调整
已修改3个文件
31 ■■■■ 文件已修改
inspect-server/src/main/java/com/ruoyi/inspect/controller/InsUnqualifiedHandlerController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsUnqualifiedHandlerServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsUnqualifiedHandlerMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/controller/InsUnqualifiedHandlerController.java
@@ -91,20 +91,17 @@
        unqualifiedHandlerFileService.downloadOAFile(handlerFileId,response);
    }
    @ApiOperation(value = "新增不合格处理")
    @PostMapping("/addUnqualifiedHandler")
    public Result addUnqualifiedHandler(@RequestBody UnqualifiedHandlerDto unqualifiedHandlerDto){
        return Result.success(unqualifiedHandlerService.addUnqualifiedHandler(unqualifiedHandlerDto));
    }
    @ApiOperation(value = "编辑不合格处理")
    @PostMapping("/updateUnqualifiedHandler")
    @ApiOperation(value = "编辑不合格处理并且推送OA")
    @PostMapping("/reSubmitPushOa")
    public Result updateUnqualifiedHandler(@RequestBody UnqualifiedHandlerDto unqualifiedHandlerDto){
        return Result.success(unqualifiedHandlerService.updateUnqualifiedHandler(unqualifiedHandlerDto));
    }
    @ApiOperation(value = "查看oa流程")
    @GetMapping("/getOaFlow")
@@ -112,14 +109,11 @@
        return Result.success(unqualifiedHandlerService.getOaFlow(id));
    }
    @ApiOperation(value = "查看不合格处理界面")
    @GetMapping("/getUnqualifiedHandler")
    public Result getUnqualifiedHandler(Integer id){
        return Result.success(unqualifiedHandlerService.getUnqualifiedHandler(id));
    }
    @ApiOperation(value = "删除不合格处理")
    @DeleteMapping("/deleteUnqualifiedHandler")
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsUnqualifiedHandlerServiceImpl.java
@@ -42,6 +42,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@@ -137,9 +138,10 @@
        //获取不合格处理记录
        UnqualifiedHandlerVO vo = baseMapper.findById(pushOADto.getHandlerId());
        if (vo.getRequestId() != null) {
            throw new ErrorException("该不合格处理已提交过OA");
        }
        System.out.println(vo);
//        if (vo.getRequestId() != null) {
//            throw new ErrorException("该不合格处理已提交过OA");
//        }
        //提交oa相关字段赋值
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -295,6 +297,7 @@
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
    public boolean updateUnqualifiedHandler(UnqualifiedHandlerDto unqualifiedHandlerDto) {
        // 删除附件, 重新添加
        insUnqualifiedHandlerFileService.remove(Wrappers.<InsUnqualifiedHandlerFile>lambdaQuery()
@@ -305,8 +308,14 @@
            }
            insUnqualifiedHandlerFileService.updateBatchById(unqualifiedHandlerDto.getUnqualifiedHandlerFiles());
        }
        return this.updateById(unqualifiedHandlerDto);
        boolean isUpdated = this.updateById(unqualifiedHandlerDto);
        if(isUpdated){
            //推送OA
            PushOADto pushOADto = new PushOADto();
            pushOADto.setHandlerId(unqualifiedHandlerDto.getId());
            pushOA(pushOADto);
        }
        return true;
    }
    /**
inspect-server/src/main/resources/mapper/InsUnqualifiedHandlerMapper.xml
@@ -44,7 +44,7 @@
            LEFT JOIN (
            SELECT
            *,
            ROW_NUMBER() OVER (PARTITION BY workflow_id ORDER BY approval_time DESC, id DESC) AS rn
            ROW_NUMBER() OVER (PARTITION BY workflow_id ORDER BY approval_date DESC,approval_time DESC, id DESC) AS rn
            FROM
            common_oa
            ) AS coa ON iuh.request_id = coa.workflow_id AND coa.rn = 1