public boolean insertPersonBank(PersonBankBean t) throws Exception { Long serNo = new Long(UUIDProxy.integerKey()); t.setSerNo(serNo); SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); if (t.getAcctNo() == null || t.getAcctNo().equals("")) { throw new RuntimeException("卡号不能为空!"); } if (t.getStartDate() == null || t.getStartDate().equals("")) { throw new RuntimeException("起始日期不能为空!"); } else { try { sf.parse(t.getStartDate()); } catch (ParseException e) { throw new RuntimeException("起始日期格式不正确!"); } } if (dao.isUnique(t)) { throw new RuntimeException("该银行账户已存在!"); } return dao.insertPersonBank(t); }