|
|
@ -148,11 +148,12 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
int picturesLength = jsonObjectOne.getJSONArray("pictures").length();//已经存在数据库的图片的长度
|
|
|
|
if (picturesLength>=10&&jsonObjectTwo.get("pictures")!=null){//如果数据长度大于等于10,对第十位进行替换
|
|
|
|
JSONArray pictures = jsonObjectOne.getJSONArray("pictures");//获取图片数组
|
|
|
|
pictures.put(9,jsonObjectTwo.getJSONArray("pictures").getString(0)); //替换第十个元素
|
|
|
|
pictures.put(picturesLength-1,jsonObjectTwo.getJSONArray("pictures").getString(0)); //替换第十个元素
|
|
|
|
jsonObjectOne.put("pictures", pictures);//更新 jsonObjectOne中的pictures 数组
|
|
|
|
if (jsonObjectOne.getJSONArray("videoList").length()>=10&&jsonObjectTwo.get("videoList")!=null){ |
|
|
|
int videoListLength = jsonObjectOne.getJSONArray("pictures").length();//已经存在数据库的视频的长度
|
|
|
|
if (videoListLength>=10&&jsonObjectTwo.get("videoList")!=null){ |
|
|
|
JSONArray videoList = jsonObjectOne.getJSONArray("videoList"); |
|
|
|
videoList.put(9,jsonObjectTwo.getJSONArray("videoList").getString(0)); |
|
|
|
videoList.put(videoListLength-1,jsonObjectTwo.getJSONArray("videoList").getString(0)); |
|
|
|
jsonObjectOne.put("videoList",videoList); |
|
|
|
} |
|
|
|
redisCache.setCacheObject(WARNINGDATA+key,dataId,Integer.parseInt(strategyTime),TimeUnit.MINUTES);//重新设置延迟时间
|
|
|
|