|
|
@@ -8,7 +8,6 @@ import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.web.controller.chenyanlogin.ChengYanAesUtil;
|
|
|
import com.ruoyi.web.controller.chenyanlogin.dto.*;
|
|
|
import com.ruoyi.web.controller.chenyanlogin.dto.HouseVillagerRelation;
|
|
|
@@ -84,13 +83,9 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, BASIC_DATA);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONObject) {
|
|
|
- JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
- BasicDataDto basicDataDto = JSONUtil.toBean(dataStr, BasicDataDto.class);
|
|
|
- return success(basicDataDto);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
+ BasicDataDto basicDataDto = JSONUtil.toBean(dataStr, BasicDataDto.class);
|
|
|
+ return success(basicDataDto);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -104,21 +99,10 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("nonce", UUID.randomUUID().toString());
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, CARE_PEOPLE_DATA);
|
|
|
- System.out.println(responseData);
|
|
|
-
|
|
|
-
|
|
|
-// String data = (String)responseData.get("data");
|
|
|
- Object data = responseData.get("data");
|
|
|
- if (responseData.get("code").equals(200) ) {
|
|
|
- if ( data instanceof JSONObject){
|
|
|
- JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
- CarePeopleData carePeopleData = JSONUtil.toBean(dataStr, CarePeopleData.class);
|
|
|
- return success(carePeopleData);
|
|
|
- }else {
|
|
|
- return success(null);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ if (responseData.get("code").equals(200)) {
|
|
|
+ JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
+ CarePeopleData carePeopleData = JSONUtil.toBean(dataStr, CarePeopleData.class);
|
|
|
+ return success(carePeopleData);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -132,13 +116,9 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, SNAPSHOT_REPORT_DATA);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONObject) {
|
|
|
- JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
- SnapshotReportDto snapshotReportDto = JSONUtil.toBean(dataStr, SnapshotReportDto.class);
|
|
|
- return success(snapshotReportDto);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
+ SnapshotReportDto snapshotReportDto = JSONUtil.toBean(dataStr, SnapshotReportDto.class);
|
|
|
+ return success(snapshotReportDto);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -153,13 +133,9 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, ZHWL_DEVICE_DATA);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONObject) {
|
|
|
- JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
- ZhwlDeviceDataDto snapshotReportDto = JSONUtil.toBean(dataStr, ZhwlDeviceDataDto.class);
|
|
|
- return success(snapshotReportDto);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
+ ZhwlDeviceDataDto snapshotReportDto = JSONUtil.toBean(dataStr, ZhwlDeviceDataDto.class);
|
|
|
+ return success(snapshotReportDto);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -188,6 +164,12 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
return success(response);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult getZhwlAlarmData(ZhwlCaller.AlarmRecordQueryVO queryVO) {
|
|
|
+ List<ZhwlCaller.AlarmRecordDTO> response = zhwlCaller.getAlarmList(queryVO);
|
|
|
+ return success(response);
|
|
|
+ }
|
|
|
+
|
|
|
//积分排行数据查询接口
|
|
|
@Override
|
|
|
public AjaxResult getPointRankData() {
|
|
|
@@ -196,14 +178,9 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("nonce", UUID.randomUUID().toString());
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, POINT_RANK_DATA);
|
|
|
- System.out.println(responseData);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONArray) {
|
|
|
- List<JSONObject> dataStr = (List<JSONObject>) responseData.get("data");
|
|
|
- return success(dataStr);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ List<JSONObject> dataStr = (List<JSONObject>) responseData.get("data");
|
|
|
+ return success(dataStr);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -218,13 +195,9 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, CIVILIZED_DATA);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONObject) {
|
|
|
- JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
- CivilizedDataDto civilizedDataDto = JSONUtil.toBean(dataStr, CivilizedDataDto.class);
|
|
|
- return success(civilizedDataDto);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ JSONObject dataStr = (JSONObject) responseData.get("data");
|
|
|
+ CivilizedDataDto civilizedDataDto = JSONUtil.toBean(dataStr, CivilizedDataDto.class);
|
|
|
+ return success(civilizedDataDto);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|
|
|
@@ -237,16 +210,12 @@ public class HuiCunServiceImpl implements HuiCunService {
|
|
|
requestParam.put("nonce", UUID.randomUUID().toString());
|
|
|
requestParam.put("timestamp", System.currentTimeMillis());
|
|
|
Map<String, Object> responseData = getMap(requestParam, VILLAGE_NEWS_DATA);
|
|
|
- System.out.println(responseData);
|
|
|
if (responseData.get("code").equals(200)) {
|
|
|
- Object data = responseData.get("data");
|
|
|
- if ( data instanceof JSONArray) {
|
|
|
+ System.out.println(responseData);
|
|
|
// List<VillageNewsDataDto> dataStr = (List<VillageNewsDataDto>) responseData.get("data");
|
|
|
- List<VillageNewsDataDto> dataStr = JSONUtil.toList((JSONArray) responseData.get("data"), VillageNewsDataDto.class
|
|
|
- );
|
|
|
- return success(dataStr);
|
|
|
- }
|
|
|
- return success(null);
|
|
|
+ List<VillageNewsDataDto> dataStr = JSONUtil.toList( (JSONArray) responseData.get("data"), VillageNewsDataDto.class
|
|
|
+ );
|
|
|
+ return success(dataStr);
|
|
|
} else {
|
|
|
return error("同步失败" + responseData.get("message"));
|
|
|
}
|