| | |
| | | package com.yeshi.fanli.service.impl.common;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.common.DataMonitorMapper;
|
| | | import com.yeshi.fanli.entity.common.DataMonitor;
|
| | | import com.yeshi.fanli.service.inter.common.DataMonitorService;
|
| | |
|
| | | @Service
|
| | | public class DataMonitorServiceImpl implements DataMonitorService {
|
| | | @Resource
|
| | | private DataMonitorMapper dataMonitorMapper;
|
| | |
|
| | | @Override
|
| | | public void parseTaoBaoOrderSuccess() {
|
| | | String key = "parse-taobao-order-success";
|
| | | DataMonitor dm = dataMonitorMapper.selectByKey(key);
|
| | | if (dm == null) {
|
| | | dataMonitorMapper.insertSelective(new DataMonitor("淘宝订单爬去成功", key, "1", new Date(), new Date()));
|
| | | } else {
|
| | | DataMonitor updateDM = new DataMonitor(dm.getId());
|
| | | updateDM.setUpdateTime(new Date());
|
| | | dataMonitorMapper.updateByPrimaryKeySelective(updateDM);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Date getLatestParseTaoBaoOrderSuccessTime() {
|
| | | String key = "parse-taobao-order-success";
|
| | | DataMonitor dm = dataMonitorMapper.selectByKey(key);
|
| | | if (dm != null)
|
| | | return dm.getUpdateTime();
|
| | | else
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.service.impl.common; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.common.DataMonitorMapper; |
| | | import com.yeshi.fanli.entity.common.DataMonitor; |
| | | import com.yeshi.fanli.service.inter.common.DataMonitorService; |
| | | |
| | | @Service |
| | | public class DataMonitorServiceImpl implements DataMonitorService { |
| | | @Resource |
| | | private DataMonitorMapper dataMonitorMapper; |
| | | |
| | | @Override |
| | | public void parseTaoBaoOrderSuccess() { |
| | | String key = "parse-taobao-order-success"; |
| | | DataMonitor dm = dataMonitorMapper.selectByKey(key); |
| | | if (dm == null) { |
| | | dataMonitorMapper.insertSelective(new DataMonitor("淘宝订单爬去成功", key, "1", new Date(), new Date())); |
| | | } else { |
| | | DataMonitor updateDM = new DataMonitor(dm.getId()); |
| | | updateDM.setUpdateTime(new Date()); |
| | | dataMonitorMapper.updateByPrimaryKeySelective(updateDM); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Date getLatestParseTaoBaoOrderSuccessTime() { |
| | | String key = "parse-taobao-order-success"; |
| | | DataMonitor dm = dataMonitorMapper.selectByKey(key); |
| | | if (dm != null) |
| | | return dm.getUpdateTime(); |
| | | else |
| | | return null; |
| | | } |
| | | |
| | | } |