zhaowenxuan
2025-03-18 18e5f7bfe225b284dfc62033ef7963ead120a19f
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjReservationController.java
@@ -95,6 +95,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;
@@ -275,7 +281,11 @@
                    //年龄
                    tjReservation.setAge(String.valueOf(MatchUtils.getAgeByIdCard(tjReservation.getIdCard())));
                    //出生日期
                    tjReservation.setBirthday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
                    try {
                        tjReservation.setBirthday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
                    } catch (Exception e) {
                        return AjaxResult.error("身份证号不正确");
                    }
                    if (null != groupingMan && groupingMan.getSex().equals(String.valueOf(tjReservation.getSex()))) {
@@ -428,7 +438,11 @@
                        //年龄
                        tjReservation.setAge(String.valueOf(MatchUtils.getAgeByIdCard(tjReservation.getIdCard())));
                        //出生日期
                        tjReservation.setBirthday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
                        try {
                            tjReservation.setBirthday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd"));
                        } catch (Exception e) {
                            return AjaxResult.error("身份证号不正确");
                        }
                        TjDwDept dwDept = dwDeptService.getOne(new LambdaQueryWrapper<TjDwDept>().eq(TjDwDept::getDwDeptName, tjReservation.getDwxm()));
                        if (null != dwDept) {
@@ -952,7 +966,7 @@
                }
                reservation.setPacId(dwDept.getId());
                reservation.setPacId(dwGrouping.getId());
                compPay = compPay.add(dwGrouping.getYsPrice());
//                reservation.setTjType(String.valueOf(1));
                reservation.setTeamNo(teamNo);
@@ -1019,4 +1033,46 @@
        return AjaxResult.error("请选择预约对象");
    }
    /**
     * 团体预约体检信息 联动下拉框
     * @param pid
     * @param type
     * @return
     */
    @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;
    }
}