zjh
2025-02-11 a5bbda30b568e9d72679da762166c40c9508b414
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -261,7 +261,7 @@
                    tjCustomer1.setGroupingId(tjReservation.getGroupingId());
//                    if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
//                    if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
                    if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
//                    tjCustomerService.updateById(tjCustomer1);
@@ -291,8 +291,8 @@
                    tjCustomer.setCusPassword(substring);
                    tjCustomer.setTjType(tjReservation.getTjType());
                    tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),""));
//                    if(null !=tjReservation.getCompanyId())tjCustomer.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
//                    if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
                    if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId());
                    if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
                    if (null != key && key.equals("Y")) {
                        AjaxResult result = controller.Outpincreateapply(tjCustomer);
@@ -483,12 +483,13 @@
                        b = MatchUtils.isIdCard(cusIdcard);
                    }
                }
            } else {
                if(cusIdcard.length()==9){
                    b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType());
                }
            }
//            else {
//                if(cusIdcard.length()==9){
//                    b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType());
//                }
//
//            }
        } else {
            return AjaxResult.error("请选择证件类型");
        }
@@ -504,20 +505,12 @@
        wq.eq(TjCustomer::getCusIdcard, cusIdcard);
        TjCustomer customer = tjCustomerService.getOne(wq);
        if (customer != null) {
//            BeanUtils.copyBeanProp(tjCustomer, customer);
//            String substring = cusIdcard.substring(cusIdcard.length() - 6);
//            substring = DigestUtils.md5DigestAsHex(substring.getBytes());
//            customer.setCusPassword(substring);
//            customer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
//            return AjaxResult.success(tjCustomerService.updateById(customer));
            return AjaxResult.error("该人员已存在");
        }
        String substring = cusIdcard.substring(cusIdcard.length() - 6);
        substring = DigestUtils.md5DigestAsHex(substring.getBytes());
        tjCustomer.setCusPassword(substring);
//        if (tjCustomer.getIdType().equals("1")) {
            tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
//        }
        if(cusIdcard.length()==18)tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd"));
        tjCustomer.setCusNumber(0L);
        tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),""));
        String config = sysConfigService.selectConfigByKey("sfkqdyhis");