主要利用了set会去重。

List<String> mobileList = new ArrayList<String>();
  for (PiaoHouFrontBookInfoFormViewModel p : model.getBookInfoList()) {
   mobileList.add(p.getMobile());
  }
  Set<String> set=new HashSet<String>(mobileList);
  boolean  mobileresult= mobileList.size() == set.size() ? true : false;
  if(!mobileresult) {
   //说明有重复手机号
   return JsonResult.jsonWsReturn(Status.ERROR.getCode(), "所有乘客手机号不能重复!",
     Status.ERROR_MSG_BY_SELF.getCode());
  }

 

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2019-10-31
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
相关资源
相似解决方案