日期:2014-05-20 浏览次数:20784 次
/** * 添加操作记录 */ public Statistics saveStatistics(Integer status, List<BlogStatus> batchProcess) { Statistics stat = new Statistics(); Article article = getArticle(); User user = getLoggedOnUser(); stat.setType(2);//文章 stat.setUserId(user.getId()); Date date = new Date(); SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd"); dateformat.format(date); stat.setStatisticsTime(date); if(status != null) { switch (status) { case 0://重申 stat.setDescribe(user.getUsername() + "重申了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle()); break; case 1://通过 stat.setDescribe(user.getUsername() +article.getCommUser().getUserName()); //article.getTitle() break; case 2://屏蔽 stat.setDescribe(user.getUsername() + "屏蔽了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle()); break; case 3://删除 stat.setDescribe(user.getUsername() + "删除了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle()); break; } } if(batchProcess != null) { stat.setDescribe(user.getUsername() + "处理了"+article.getCommUser().getUserName()+"发表的文章" + article.getTitle()); } [color=#FF0000statisticsManager.save(stat);][/color] //这里执行走不了 this.saveStatisticsDesc(stat,article); return stat; }
SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd"); Date date = new Date(); date = dateformat.parse(dateformat.format(date)); 这样试试。。。