Commit ee018c4a authored by 赵啸非's avatar 赵啸非

修改日志记录

parent 11339957
...@@ -22,5 +22,4 @@ public class ManagerApplication extends BaseWebApplication { ...@@ -22,5 +22,4 @@ public class ManagerApplication extends BaseWebApplication {
} }
} }
...@@ -16,6 +16,7 @@ import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders; ...@@ -16,6 +16,7 @@ import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader; import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceLogEntity; import com.mortals.xhx.module.device.model.DeviceLogEntity;
import com.mortals.xhx.module.device.model.DeviceLogQuery;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceLogService; import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
...@@ -77,7 +78,11 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService { ...@@ -77,7 +78,11 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService {
deviceLogService.save(deviceLogEntity, null); deviceLogService.save(deviceLogEntity, null);
} }
}); });
//定时删除日志 7天前
DeviceLogQuery contidion = new DeviceLogQuery();
DateUtils.addCurrDate(-7);
contidion.setCreateTimeEnd(DateUtils.getDateTimeStr(DateUtils.addCurrDate(-7),DateUtils.P_yyyy_MM_dd_HH_mm_ss));
deviceLogService.getDao().delete(contidion);
} }
...@@ -87,4 +92,9 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService { ...@@ -87,4 +92,9 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService {
} }
public static void main(String[] args) {
System.out.println(DateUtils.getDateTimeStr(DateUtils.addCurrDate(-7),DateUtils.P_yyyy_MM_dd_HH_mm_ss));
}
} }
package com.mortals.xhx.module.device.service; package com.mortals.xhx.module.device.service;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.device.dao.DeviceLogDao;
import com.mortals.xhx.module.device.model.DeviceLogEntity; import com.mortals.xhx.module.device.model.DeviceLogEntity;
/** /**
* DeviceLogService * DeviceLogService
...@@ -11,4 +12,6 @@ import com.mortals.xhx.module.device.model.DeviceLogEntity; ...@@ -11,4 +12,6 @@ import com.mortals.xhx.module.device.model.DeviceLogEntity;
*/ */
public interface DeviceLogService extends ICRUDService<DeviceLogEntity,Long>{ public interface DeviceLogService extends ICRUDService<DeviceLogEntity,Long>{
DeviceLogDao getDao();
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment