| | |
| | | // @Log(title = "客户身份信息", businessType = BusinessType.EXPORT) |
| | | public AjaxResult getInfoByIdCard(@RequestParam @ApiParam(value = "客户身份证号") String cusIdcard) { |
| | | if (!"".equals(cusIdcard) && cusIdcard != null) { |
| | | |
| | | String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); |
| | | // String sfjysjh = configService.selectConfigByKey("sfjysjh"); |
| | | |
| | | //判断身份证号格式是否正确 |
| | | // if(cusIdcard.length()==18){ |
| | | // if (! MatchUtils.isIdCard(cusIdcard)) { |
| | | // return AjaxResult.error("身份证号码错误"); |
| | | // } |
| | | // } |
| | | // if(cusIdcard.length()==9){ |
| | | // if (!MatchUtils.cardValidates(cusIdcard)) { |
| | | // return AjaxResult.error("身份证号码错误"); |
| | | // } |
| | | // } |
| | | if(sfjysfzh.equalsIgnoreCase("Y")){ |
| | | if(cusIdcard.length()==18){ |
| | | if (! MatchUtils.isIdCard(cusIdcard)) { |
| | | return AjaxResult.error("身份证号码错误"); |
| | | } |
| | | } |
| | | if(cusIdcard.length()==9){ |
| | | if (!MatchUtils.cardValidates(cusIdcard)) { |
| | | return AjaxResult.error("身份证号码错误"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Date dates = new Date(); |
| | | // final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | |
| | |
| | | if (null == tjCustomer.getCusIdcard() || null == tjCustomer.getCusPhone()) { |
| | | return AjaxResult.error("请输入身份证号或手机号"); |
| | | } |
| | | HisApiGetMethodService hisApiGetMethodService = new HisApiGetMethodService(); |
| | | |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | |
| | | String cusIdcard = tjCustomer.getCusIdcard(); |
| | | |
| | | boolean b = true; |
| | | String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); |
| | | String sfjysjh = sysConfigService.selectConfigByKey("sfjysjh"); |
| | | if (null != tjCustomer.getIdType()) { |
| | | if (tjCustomer.getIdType().equals("1")) { |
| | | b = MatchUtils.isIdCard(cusIdcard); |
| | | //判断身份证号格式是否正确 |
| | | if(sfjysfzh.equalsIgnoreCase("Y")){ |
| | | if(cusIdcard.length()==18){ |
| | | b = MatchUtils.isIdCard(cusIdcard); |
| | | } |
| | | } |
| | | } else { |
| | | if(cusIdcard.length()==9){ |
| | | b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); |
| | | } |
| | | |
| | | } |
| | | // else { |
| | | // b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); |
| | | // } |
| | | } else { |
| | | return AjaxResult.error("请选择证件类型"); |
| | | } |
| | | if (!b) return AjaxResult.error("证件号有误"); |
| | | |
| | | //判断身份证号格式是否正确 |
| | | if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone()))) |
| | | return AjaxResult.error("手机号错误"); |
| | | if(sfjysjh.equalsIgnoreCase("Y")){ |
| | | if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone()))) |
| | | return AjaxResult.error("手机号错误"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | |
| | | if (null == cusPhone) { |
| | | return AjaxResult.error("手机号不能为空"); |
| | | } |
| | | /*LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjCustomer::getCusPhone, cusPhone); |
| | | TjCustomer customer = tjCustomerService.getOne(wq); |
| | | if (customer != null) { |
| | | return AjaxResult.error("该手机号已被使用!"); |
| | | }*/ |
| | | String sfjysfzh = sysConfigService.selectConfigByKey("sfjysfzh"); |
| | | String sfjysjh = sysConfigService.selectConfigByKey("sfjysjh"); |
| | | |
| | | //判断身份证号格式是否正确 |
| | | if(sfjysfzh.equalsIgnoreCase("Y")){ |
| | | if(tjCustomer.getCusIdcard().length()==18){ |
| | | if (!(MatchUtils.isIdCard(tjCustomer.getCusIdcard()))) |
| | | return AjaxResult.error("身份证号错误"); |
| | | } |
| | | |
| | | if(tjCustomer.getCusIdcard().length()==9){ |
| | | if (!MatchUtils.cardValidates(tjCustomer.getCusIdcard())) { |
| | | return AjaxResult.error("身份证号码错误"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //判断身份证号格式是否正确 |
| | | if(sfjysjh.equalsIgnoreCase("Y")){ |
| | | if (!(MatchUtils.isMobileNO(tjCustomer.getCusPhone()))) |
| | | return AjaxResult.error("手机号错误"); |
| | | } |
| | | |
| | | tjCustomer.setCusPhone(cusPhone); |
| | | tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),"")); |
| | | if (tjCustomerService.updateById(tjCustomer)) { |