yxh
2 天以前 8c215c8be0f5076e8c95daf1b2203440ca7dfcad
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java
@@ -50,7 +50,7 @@
     * 查询捐献器官管理列表
     */
    @ApiOperation("捐献器官列表")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:list')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceDonateorgan serviceDonateorgan) {
        startPage();
@@ -82,7 +82,7 @@
     * 导出捐献器官管理列表
     */
    @ApiOperation("导出捐献器官列表")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:export')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:export')")
    @Log(title = "捐献器官管理", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceDonateorgan serviceDonateorgan) {
@@ -95,7 +95,7 @@
     * 获取捐献器官管理详细信息
     */
    @ApiOperation("通过id获得捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:query')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceDonateorganService.getById(id));
@@ -105,7 +105,7 @@
     * 新增捐献器官管理
     */
    @ApiOperation("新增捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
    @Log(title = "捐献器官管理", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @RepeatSubmit
@@ -131,7 +131,7 @@
     * 新增捐献器官管理
     */
    @ApiOperation("新增捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:add')")
    @Log(title = "捐献器官管理", businessType = BusinessType.INSERT)
    @PostMapping("/addData")
    @RepeatSubmit
@@ -145,7 +145,7 @@
     * 修改器官分配
     */
    @ApiOperation("修改器官分配信息")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
    @Log(title = "器官分配", businessType = BusinessType.UPDATE)
    @PostMapping("/editarraydata")
    @RepeatSubmit
@@ -157,7 +157,7 @@
     * 修改捐献器官管理
     */
    @ApiOperation("修改捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:edit')")
    @Log(title = "捐献器官管理", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @RepeatSubmit
@@ -169,7 +169,7 @@
     * 删除捐献器官管理
     */
    @ApiOperation("删除捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:remove')")
    //// @PreAuthorize("@ss.hasPermi('project:donateorgan:remove')")
    @Log(title = "捐献器官管理", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
@@ -297,13 +297,23 @@
        Boolean i = null;
        for (ServiceDonateorgan serviceDonateorgan : serviceDonateorganList) {
            log.info("捐献器官移植id是否为空 : {},基础表的id为 : {}", serviceDonateorgan.getId(), serviceDonateorgan.getInfoid());
            // 2026-10-22:同一案例、同一器官只保留一条未删除记录——已存在则更新,避免重复插入
            ServiceDonateorgan query = new ServiceDonateorgan();
            query.setInfoid(serviceDonateorgan.getInfoid());
            query.setOrganno(serviceDonateorgan.getOrganno());
            query.setDel_flag(0);
            List<ServiceDonateorgan> exist = serviceDonateorganService.queryList(query);
            if (!CollectionUtils.isEmpty(exist)) {
                serviceDonateorgan.setId(exist.get(0).getId());
            }
            if (serviceDonateorgan.getId() == null) {
                i = serviceDonateorganService.save(serviceDonateorgan);
            } else {
                i = serviceDonateorganService.updateById(serviceDonateorgan);
            }
        }
        return toAjax(i);
        // 回传带主键的列表,便于前端回填 id
        return AjaxResult.success(serviceDonateorganList);
    }
}