public boolean addZcBm(ZcBmVo vo) throws Exception {
Connection conn = null;
DbTransaction trans = new DbTransaction();
trans.begin();
conn = DbSession.current().getConnection();
try {
ZcBmVo zVo = dao.getZcBmByWyBsm(conn, vo.getWyBsm());
if(zVo != null){//已存在唯一标识码
return true;
}
long id = dao.getNextSequ(conn, ZcBmVo.SEQUENCES);
vo.setId(id);
vo.setSfcz("N");
vo.setSfdj("N");
dao.addZcBm(conn, vo);
trans.commit();
return false;
} catch (Exception e) {
trans.rollback();
e.printStackTrace();
throw e;
}
}
大家看看有什么错误没