package org.ts.ddcs.worker;

import com.alibaba.fastjson.JSONObject;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.Callable;

@SuppressWarnings("all")
public class LogCollectErrorWorker implements Callable<Integer> {

    private JSONObject log;

    LogCollectErrorWorker(JSONObject log) {
        this.log = log;
    }

    @Override
    public Integer call() throws Exception {
        try {

//            String logTime = log.getString("logTime");
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//            Date dt = sdf.parse(logTime);
//            String rtu = log.getString("rtu");
//            String datagram = log.getString("datagram");
//            String agreement = log.getString("agreement");
//            RedisTemplate redisTemplate = DataProcessHolder.newInstance().dataProcess.redisTemplate;
//            HashOperations<String, String, String> opsHash = redisTemplate.opsForHash();
//            if (agreement.equals("sw2014")) {
//
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }
}
