zjh
2025-05-23 e8c5fd71396e1e30d2b99e66b67e6e815ac677fd
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjProjectController.java
@@ -713,4 +713,53 @@
    @GetMapping("/getProListByBwwh")
    @ApiOperation(value = "查询部位对应项目或未对应部位的项目")
    public AjaxResult getProListByBwwh(@ApiParam(value = "标本类型")@RequestParam(required = false) String bw) {
        try {
            List<TjProject> projectList =tjProjectService.getProListByBwwh(bw);
            return AjaxResult.success(projectList);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @GetMapping("/delProByBbwwh")
    @ApiOperation(value = "删除项目对应部位")
    @Transactional
    public AjaxResult delProByBbwwh(@ApiParam(value = "项目ID")@RequestParam(required = false) String proId) {
        try {
            TjProject tjProject = tjProjectService.getById(proId);
            tjProject.setCheckBw(null);
            tjProjectService.updateById(tjProject);
            return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @PostMapping("/updateProByBwwh")
    @ApiOperation(value = "修改所选项目的部位")
    @Transactional
    public AjaxResult updateProByBwwh(@ApiParam(value = "项目ID集合")@RequestParam(required = false) List<String> proIds,
                                      @ApiParam(value = "标本类型")@RequestParam(required = false)String bw) {
        try {
            if(null !=  proIds && !proIds.isEmpty()){
                for (String proId : proIds) {
                    TjProject tjProject = tjProjectService.getById(proId);
                    tjProject.setCheckBw(bw);
                    tjProjectService.updateById(tjProject);
                }
            }
            return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}