ZhuDongming
2020-04-28 8aa815dd9fca6dc914c0cba72ada9af5c795a44c
src/main/java/com/moral/task/HistoryTableInsertTask.java
@@ -20,7 +20,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.moral.entity.History;
import com.moral.service.DeviceService;
import com.moral.service.HistoryDailyService;
import com.moral.service.HistoryHourlyService;
@@ -891,16 +890,13 @@
        Map macMap = JSON.parseObject(params);
        List<String> macList = (List<String>) macMap.get("mac");
        LocalDateTime value = LocalDateTime.now();
        LocalDateTime time = value.truncatedTo(ChronoUnit.SECONDS);
        LocalDateTime tenSecondsAgo = time.minusSeconds(10);
        Map<String, Object> devices = new HashMap<>();
        devices.put("macList", macList);
        devices.put("time", tenSecondsAgo);
        devices.put("time", value);
        try {
            List<History> historyData = historyService.selectByMacAndTime(devices);
            if (!CollectionUtils.isEmpty(historyData)) {
                int count = historyService.insertHistorySpecialTable(devices);
                XxlJobLogger.log("insertHistorySpecialTable:" + count);
            int count = historyService.insertHistorySpecialTable(devices);
            XxlJobLogger.log("insertHistorySpecialTable:" + count);
            if (count > 0) {
                ReturnT returnT = new ReturnT(200, "插入historySpecial表成功");
                return returnT;
            }