zjh
2025-05-23 e8c5fd71396e1e30d2b99e66b67e6e815ac677fd
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjProjectController.java
@@ -9,6 +9,7 @@
import cn.hutool.extra.pinyin.PinyinUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.injector.methods.UpdateById;
import com.ltkj.common.core.domain.entity.SysDept;
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.common.utils.SecurityUtils;
@@ -157,6 +158,7 @@
        if (checkType != null) {
            wq.eq(TjProject::getProCheckType, checkType);
        }
        wq.orderByAsc(TjProject::getXh);
        List<TjProject> tjProjects = tjProjectService.list(wq);
//        List<TjProject> tjProjects = tjProjectService.getAllChildListById(proId);
        if (tjProjects != null) {
@@ -662,4 +664,102 @@
            throw new RuntimeException(e);
        }
    }
    @GetMapping("/getProListByBblx")
    @ApiOperation(value = "查询标本对应项目或未对应标本的项目")
    public AjaxResult getProListByBblx(@ApiParam(value = "标本类型")@RequestParam(required = false) String bblx) {
        try {
            List<TjProject> projectList =tjProjectService.getProListByBblx(bblx);
            return AjaxResult.success(projectList);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @GetMapping("/delProByBblx")
    @ApiOperation(value = "删除项目对应标本")
    @Transactional
    public AjaxResult delProByBblx(@ApiParam(value = "项目ID")@RequestParam(required = false) String proId) {
        try {
            TjProject tjProject = tjProjectService.getById(proId);
            tjProject.setSpecimenType(null);
            tjProjectService.updateById(tjProject);
            return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @PostMapping("/updateProByBblx")
    @ApiOperation(value = "修改所选项目的标本类型")
    @Transactional
    public AjaxResult updateProByBblx(@ApiParam(value = "项目ID集合")@RequestParam(required = false) List<String> proIds,
                                      @ApiParam(value = "标本类型")@RequestParam(required = false)String bblx) {
        try {
            if(null !=  proIds && !proIds.isEmpty()){
                for (String proId : proIds) {
                    TjProject tjProject = tjProjectService.getById(proId);
                    tjProject.setSpecimenType(bblx);
                    tjProjectService.updateById(tjProject);
                }
            }
            return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    @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);
        }
    }
}