zhaowenxuan
2025-03-21 b7f0fb8eda40b6761b35a37f72eb5e8a3c836bed
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;
@@ -276,7 +282,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()))) {
@@ -401,6 +411,7 @@
            int woManCount = 0;//女组人数
            List<String> ids=new ArrayList<>();
            String errMsg="";
            for (TjReservation tjReservation : tjReservations) {
                String idCard = tjReservation.getIdCard();
                String phoe = tjReservation.getPhoe();
@@ -421,6 +432,7 @@
                        if ((sfjysfzh.equalsIgnoreCase("Y") && !MatchUtils.isIdCard(idCard)) ||
                                (sfjysjh.equalsIgnoreCase("Y") && !MatchUtils.isMobileNO(phoe))) {
                            wrongList.add(tjReservation.getName());
                            errMsg="身份证号/手机号 格式不准确";
                            log.info(tjReservation.getName()+idCard+MatchUtils.isIdCard(idCard)+MatchUtils.isMobileNO(phoe));
                        }else {
@@ -430,9 +442,13 @@
                            //年龄
                            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()));
                            TjDwDept dwDept = dwDeptService.getOne(new LambdaQueryWrapper<TjDwDept>().eq(TjDwDept::getDwDeptName, tjReservation.getDwxm().trim()));
                            if (null != dwDept) {
                                for (TjDwGrouping groupingMan : groupingMans) {
                                    if (null != groupingMan && groupingMan.getSex().equals(String.valueOf(tjReservation.getSex())) && groupingMan.getDwDeptId().equals(dwDept.getId())) {
@@ -489,6 +505,7 @@
                                rightList.add(tjReservation);
                            } else {
                                wrongList.add(tjReservation.getName());
                                errMsg="所选项目名 不正确";
                            }
                        }
    //                }
@@ -564,6 +581,7 @@
                } else {
                    wrongList.add(tjReservation.getName());
                    errMsg="身份证号/手机号/项目名为空";
                }
            }
            if (!yyList.isEmpty()) {
@@ -575,7 +593,7 @@
            if (!wrongList.isEmpty()) {
                map.put("list", wrongList);
                map.put("hjMoney", hjMoney);
                return AjaxResult.error("操作失败, 请认真核对信息后重新导入!!!", map);
                return AjaxResult.error("操作失败, 请认真核对信息后重新导入!!!"+errMsg, map);
            } else {
                map.put("list", rightList);
                map.put("count", count);
@@ -1028,4 +1046,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;
    }
}