zhaowenxuan
2025-03-07 90fa38641a0f8e14bd065911da4ec8316914ca14
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReservationController.java
@@ -96,6 +96,12 @@
    private ISysDictDataService dictDataService;
    @Autowired
    private ISysConfigService configService;
    @Autowired
    private IDictCompService dictCompService;
    @Autowired
    private ITjDwDeptService tjDwDeptService;
    @Autowired
    private ITjDwGroupingService tjDwGroupingService;
    @Value("${path.filePath}")
    private String value;
@@ -1028,4 +1034,40 @@
        return AjaxResult.error("请选择预约对象");
    }
    @GetMapping("/linkage")
    public String linkage(@RequestParam("pid") String pid, @RequestParam("type") String type) {
        switch (type){
            case "1":
                List<DictComp> list = dictCompService.list();
                List<HashMap<String, Object>> collect = list.stream().map(i -> {
                    HashMap<String, Object> hashMap = new HashMap<>();
                    hashMap.put("value", i.getDrugManufacturerId());
                    hashMap.put("text", i.getCnName());
                    return hashMap;
                }).collect(Collectors.toList());
                return JSONUtil.toJsonStr(collect);
            case "2":
                List<TjDwDept> list1 = tjDwDeptService.getDwDeptListByTjDwDeptId(pid);
                List<HashMap<String, Object>> collect1 = list1.stream().map(i -> {
                    HashMap<String, Object> hashMap = new HashMap<>();
                    hashMap.put("value", i.getId());
                    hashMap.put("text", i.getDwDeptName());
                    return hashMap;
                }).collect(Collectors.toList());
                return JSONUtil.toJsonStr(collect1);
            case "3":
                LambdaQueryWrapper<TjDwGrouping> wrapper = new LambdaQueryWrapper<>();
                wrapper.eq(TjDwGrouping::getDwDeptId,pid);
                List<TjDwGrouping> list2 = tjDwGroupingService.list(wrapper);
                List<HashMap<String, Object>> collect2 = list2.stream().map(i -> {
                    HashMap<String, Object> hashMap = new HashMap<>();
                    hashMap.put("value", i.getId());
                    hashMap.put("text", i.getGroupingName());
                    return hashMap;
                }).collect(Collectors.toList());
                return JSONUtil.toJsonStr(collect2);
        }
        return null;
    }
}