コード例 #1
0
 @Override
 public void process(VisitLog visitLog) {
   visitLog.setArea(IPSeeker.getInstance().getArea(visitLog.getIp()));
   visitLog.setCountry(IPSeeker.getInstance().getCountry(visitLog.getIp()));
   VisitLog origin = null;
   if (VisitTypeEnum.INDEX.value().equals(visitLog.getPage())) {
     origin = visitLogDao.getVisitedIndexLog(visitLog);
   } else {
     origin = visitLogDao.getVisitedProdLog(visitLog);
   }
   if (origin != null) {
     Integer num = origin.getVisitNum();
     if (num == null) {
       num = 1;
     } else {
       num++;
     }
     origin.setVisitNum(num);
     origin.setDate(new Date());
     visitLogDao.updateVisitLog(origin);
   } else {
     visitLog.setVisitNum(1);
     visitLogDao.save(visitLog);
   }
 }
コード例 #2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.legendshop.business.service.VisitLogService#save(com.legendshop.model
  * .entity.VisitLog)
  */
 @Override
 public Long save(VisitLog visitLog) {
   if (!AppUtils.isBlank(visitLog.getVisitId())) {
     update(visitLog);
     return visitLog.getVisitId();
   }
   return (Long) visitLogDao.save(visitLog);
 }
コード例 #3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.legendshop.business.service.VisitLogService#update(com.legendshop
  * .model.entity.VisitLog)
  */
 @Override
 public void update(VisitLog visitLog) {
   visitLogDao.updateVisitLog(visitLog);
 }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.legendshop.business.service.VisitLogService#delete(java.lang.Long)
  */
 @Override
 public void delete(Long id) {
   visitLogDao.deleteVisitLogById(id);
 }
コード例 #5
0
 /*
  * (non-Javadoc)
  *
  * @see com.legendshop.business.service.VisitLogService#load(java.lang.Long)
  */
 @Override
 public VisitLog getVisitLogById(Long id) {
   return visitLogDao.get(VisitLog.class, id);
 }
コード例 #6
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.legendshop.business.service.VisitLogService#list(java.lang.String)
  */
 @Override
 public List<VisitLog> getVisitLogList(String userName) {
   return visitLogDao.findByHQL("from VisitLog where userName = ?", new Object[] {userName});
 }
コード例 #7
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.legendshop.business.service.VisitLogService#getDataByCriteriaQuery
  * (com.legendshop.core.dao.support.CriteriaQuery)
  */
 @Override
 public PageSupport getVisitLogList(CriteriaQuery cq) {
   return visitLogDao.find(cq);
 }