public void txUpdate(T entity, Person oper) { saveOrUpdate(entity); Syslog syslog = new Syslog(); syslog.setUserid(oper.getName()); syslog.setName(OperEnum.UPDATE.toString()); syslog.setComment("用户" + oper.getName() + "修改" + className + "-->" + entity.getName()); syslog.setCreatetime(Utils.getNow()); syslog.setId(Utils.getNewUUID()); getSession().save(syslog); }
public void txDelete(String idList, Person oper) { delete(idList); Syslog syslog = new Syslog(); syslog.setUserid(oper.getName()); syslog.setName(OperEnum.DELETE.toString()); syslog.setComment("用户" + oper.getName() + "删除" + className); syslog.setCreatetime(Utils.getNow()); syslog.setId(Utils.getNewUUID()); getSession().save(syslog); }
public Serializable txSave(T entity, Person person) { String id = (String) save(entity); Syslog syslog = new Syslog(); syslog.setUserid(person.getName()); syslog.setName(OperEnum.CREATE.toString()); syslog.setComment("用户" + person.getName() + "添加" + className + "-->" + entity.getName()); syslog.setCreatetime(Utils.getNow()); syslog.setId(Utils.getNewUUID()); getSession().save(syslog); return id; }
@Override public Serializable save(T entity) { if (entity.getId() == null) entity.setId(Utils.getNewUUID()); if (entity.getCreatetime() == null) entity.setCreatetime(Utils.getNow()); return getSession().save(entity); }