|
|
@@ -11,6 +11,7 @@ import com.xunmei.common.core.constant.Constants;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotDailyCheckData;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotServerInfo;
|
|
|
import com.xunmei.common.core.domain.iot.vo.DailyCheckReq;
|
|
|
+import com.xunmei.common.core.domain.iot.vo.DailyCheckResultData;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.host.dayilcheck.mapper.IotDailyCheckDataMapper;
|
|
|
import com.xunmei.host.dayilcheck.service.IotDailyCheckDataService;
|
|
|
@@ -63,20 +64,20 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
JSONObject obj = JSON.parseObject(data.toString());
|
|
|
String type = obj.getString("id");
|
|
|
String excelData = obj.getString("excelData");
|
|
|
+ String resultData = obj.getString("resultData");
|
|
|
IotServerInfo serverInfo = iotServerInfoService.selectByToken(iotCode);
|
|
|
if (ObjectUtil.isEmpty(serverInfo)) {
|
|
|
LogUtils.SOCKET_DAILY_HEALTH.error("未查询到token为 {} 的服务器信息", iotCode);
|
|
|
return null;
|
|
|
}
|
|
|
- dealData(type, excelData, serverInfo);
|
|
|
+ dealData(type, excelData, resultData, serverInfo);
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void dealData(String id, String excelData, IotServerInfo serverInfo) {
|
|
|
-
|
|
|
+ public void dealData(String id, String excelData, String resultData, IotServerInfo serverInfo) {
|
|
|
if (ObjectUtil.hasEmpty(id, excelData)) {
|
|
|
LogUtils.SOCKET_DAILY_HEALTH.error("[网点客户端自检结果上报],存在参数为空,ID:{},excelData:{}", id, excelData);
|
|
|
return;
|
|
|
@@ -100,6 +101,10 @@ public class IotDailyCheckDataServiceImpl extends ServiceImpl<IotDailyCheckDataM
|
|
|
dailyCheckData.setRecordDate(DateUtils.toLocalDateTime(time));
|
|
|
dailyCheckData.setUserName(req.getUserName());
|
|
|
dailyCheckData.setFileName(serverInfo.getOrgName() + "检查日志" + LocalDateTimeUtil.format(dailyCheckData.getRecordDate(), Constants.HM_FORMAT));
|
|
|
+ if (ObjectUtil.isNotEmpty(resultData)) {
|
|
|
+ DailyCheckResultData resultData1 = JSON.parseObject(resultData, DailyCheckResultData.class);
|
|
|
+ dailyCheckData.setScore(resultData1.getScore());
|
|
|
+ }
|
|
|
|
|
|
this.saveOrUpdate(dailyCheckData);
|
|
|
LogUtils.SOCKET_DAILY_HEALTH.error("[网点客户端自检结果上报],入库成功,ID:{},excelData:{}", id, excelData);
|