| | |
| | | public AjaxResult getInfoByIdCard(@RequestParam @ApiParam(value = "客户身份证号") String cusIdcard) { |
| | | if (!"".equals(cusIdcard) && cusIdcard != null) { |
| | | //判断身份证号格式是否正确 |
| | | // TODO: 2023/2/10 判断身份证号格式是否正确 |
| | | // if(cusIdcard.length()==18){ |
| | | // if (! MatchUtils.isIdCard(cusIdcard)) { |
| | | // return AjaxResult.error("身份证号码错误"); |
| | |
| | | LtkjTjPat tjPatByIdCard = testMapper.getTjPatByIdCard(cusIdcard); |
| | | if(null != tjPatByIdCard){ |
| | | String fcardNo = tjPatByIdCard.getFcardNo(); |
| | | if(null !=fcardNo){ |
| | | if(null !=fcardNo && !fcardNo.equals("")){ |
| | | fcardNo=fcardNo.trim(); |
| | | tjPatByIdCard.setFcardNo(fcardNo); |
| | | }else { |
| | | fcardNo=cusIdcard.trim(); |
| | | tjPatByIdCard.setFcardNo(fcardNo); |
| | | } |
| | | //根据身份证号从数据库拿信息 没有的话保存 |
| | |
| | | if(null !=tjCustomer.getIdType()){ |
| | | if(tjCustomer.getIdType().equals("1")){ |
| | | b = MatchUtils.isIdCard(cusIdcard); |
| | | }else { |
| | | b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); |
| | | } |
| | | // else { |
| | | // b = MatchUtils.cardValidate(cusIdcard, tjCustomer.getIdType()); |
| | | // } |
| | | }else { |
| | | return AjaxResult.error("请选择证件类型"); |
| | | } |
| | |
| | | String substring = cusIdcard.substring(cusIdcard.length() - 6); |
| | | substring = DigestUtils.md5DigestAsHex(substring.getBytes()); |
| | | tjCustomer.setCusPassword(substring); |
| | | tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd")); |
| | | if(tjCustomer.getIdType().equals("1")){ |
| | | tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd")); |
| | | } |
| | | tjCustomer.setCusNumber(0L); |
| | | if (tjCustomerService.save(tjCustomer)) { |
| | | return AjaxResult.success(tjCustomer); |