Commit 7a6d84cd authored by 赵啸非's avatar 赵啸非

添加设备上线和下线的业务日志记录

parent c555a673
......@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.ErrorLogPdu;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.message.MessageService;
......@@ -297,6 +298,28 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
} else {
this.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.STOP);
}
if(enabled==EnabledEnum.停止.getValue()){
ErrorLogPdu errorLogPdu = new ErrorLogPdu();
errorLogPdu.initAttrValue();
errorLogPdu.setTraceID(IdUtil.objectId());
errorLogPdu.setAppName(productEntity.getProductCode());
errorLogPdu.setMessage(deviceEntity.getDeviceName()+"设备停用!");
errorLogPdu.setPlatform("webos");
errorLogPdu.setCulprit("");
errorLogPdu.setTags("");
errorLogPdu.setLevel("INFO");
errorLogPdu.setEnvironment("");
errorLogPdu.setReleaseVersion("");
errorLogPdu.setFingerprint(LogTypeEnum.上报事件.name());
errorLogPdu.setThreadNo(Thread.currentThread().toString());
errorLogPdu.setErrorStack(Thread.currentThread()+deviceEntity.getDeviceName()+"设备停用!");
errorLogPdu.setContext("");
errorLogPdu.setExtra("");
errorLogPdu.setLogTime(new Date());
messageProducer.syncErrorSend(errorLogPdu);
}
}
@Override
......
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