|
@@ -4,6 +4,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
+import com.fdkankan.contro.service.ICommonService;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
@@ -25,6 +26,8 @@ public class UpdateSceneStatusListener {
|
|
|
|
|
|
@Autowired
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonService commonService;
|
|
|
|
|
|
/**
|
|
|
* 更新场景status.json状态
|
|
@@ -43,12 +46,14 @@ public class UpdateSceneStatusListener {
|
|
|
Integer status = (Integer)map.get("status");
|
|
|
String statusJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num).concat("status.json");
|
|
|
try {
|
|
|
-
|
|
|
String fileContent = fYunFileService.getFileContent(statusJsonPath);
|
|
|
JSONObject jsonObject = JSON.parseObject(fileContent);
|
|
|
jsonObject.put("status", status);
|
|
|
FileUtil.writeUtf8String(jsonObject.toJSONString(),ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json");
|
|
|
fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", statusJsonPath);
|
|
|
+ if(status == 1){
|
|
|
+ commonService.sendEmail(num, "standar");
|
|
|
+ }
|
|
|
}catch (Exception e){
|
|
|
log.error("更新场景的的status.json状态, content:{}", msg, e);
|
|
|
}finally {
|