zjh
2 天以前 3982f0bc9ee436235ba546d356c5554250ed9963
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -269,6 +269,7 @@
//                    if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId()));
                    if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany());
                    if(null !=tjReservation.getDepartment())tjCustomer1.setDepartment(tjReservation.getDepartment());
//                    tjCustomerService.updateById(tjCustomer1);
@@ -304,7 +305,7 @@
                    tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),""));
                    if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId());
                    if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany());
                    if(null !=tjReservation.getDepartment())tjCustomer.setDepartment(tjReservation.getDepartment());
                    if (null != key && key.equals("Y")) {
                        AjaxResult result = controller.Outpincreateapply(tjCustomer);
                        String result1 = getAjaxResult(result);
@@ -329,18 +330,16 @@
                            }
                        }
                    } else if(null != s && s.equalsIgnoreCase("Y")) {
                        TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer);
                        if (null !=requestCommonHisApi){
                            tjCustomerService.save(requestCommonHisApi);
                        }
                    }else {
                        tjCustomerService.save(tjCustomer);
                        tjCustomer = isRequestCommonHisApi(tjCustomer);
                    }
                    tjCustomer.setTeamNo(tjReservation.getTeamNo());
                    tjCustomer.setCompId(tjReservation.getCompanyId());
                    tjCustomer.setReservationId(tjReservation.getId());
                    tjCustomer.setDiscount(tjReservation.getDiscount());
                    tjCustomer.setGroupingId(tjReservation.getGroupingId());
                    if(null != tjCustomer){
                        tjCustomerService.save(tjCustomer);
                        tjCustomer.setTeamNo(tjReservation.getTeamNo());
                        tjCustomer.setCompId(tjReservation.getCompanyId());
                        tjCustomer.setReservationId(tjReservation.getId());
                        tjCustomer.setDiscount(tjReservation.getDiscount());
                        tjCustomer.setGroupingId(tjReservation.getGroupingId());
                    }
                    return success(tjCustomer);
                }
@@ -353,16 +352,7 @@
            if (null == tjCustomerServiceOne) {
                return AjaxResult.error("该人员信息不存在请先进行登记!!!");
            }
//            if (null != key && key.equals("Y")) {
                String cardId = tjCustomerServiceOne.getCardId();
                if (null != cardId && !cardId.equals("0")) {
//                    int i = tjOrderService.selectTjOrderByCardId(cardId);
//                    if (i > 0) {
//                        return AjaxResult.error("不可重复签到");
//                    }
                }
//            }
            if(!tjCustomerServiceOne.getAge().equals(String.valueOf(DateUtil.ageOfNow(tjCustomerServiceOne.getCusBrithday())))){
                tjCustomerServiceOne.setAge(String.valueOf(DateUtil.ageOfNow(tjCustomerServiceOne.getCusBrithday())));
                tjCustomerService.updateById(tjCustomerServiceOne);
@@ -492,24 +482,24 @@
                if(sfjysfzh.equalsIgnoreCase("Y")){
                    if(cusIdcard.length()==18){
                        b = MatchUtils.isIdCard(cusIdcard);
                    }else {
                        return AjaxResult.error("请输入十八位号的证件号!");
                    }
                }
            }
//            else {
//                if(cusIdcard.length()==9){
//                    b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType());
//                }
//
//            }
        } else {
            return AjaxResult.error("请选择证件类型");
        }
        if (!b) return AjaxResult.error("证件号有误");
        if (!b) return AjaxResult.error("证件号有误,请检查证件号是否有效!");
        //判断身份证号格式是否正确
        if (tjCustomer.getCusPhone().length() != 11)
            return AjaxResult.error("请输入十一位号的手机号!");
        if(sfjysjh.equalsIgnoreCase("Y")){
            if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone())))
                return AjaxResult.error("手机号错误");
                return AjaxResult.error("手机号错误,请检查手机号是否有效!");
        }
        LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>();