替换部分vo的引用
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ public interface AnYanClient {
|
||||
* 健康小屋基础数据查询
|
||||
* @return
|
||||
*/
|
||||
List<HealthRoomVO> healthPlaceHomList();
|
||||
List<HealthRoomBaseVO> healthPlaceHomList();
|
||||
|
||||
/**
|
||||
* 健康小屋详细数据查询
|
||||
|
||||
+2
-2
@@ -136,10 +136,10 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthRoomVO> healthPlaceHomList() {
|
||||
public List<HealthRoomBaseVO> healthPlaceHomList() {
|
||||
Result<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.HEALTH_PLACE_ROOM_LIST, buildTokenHeader(),null);
|
||||
List<Object> listMaps = (List<Object>) result.getResult();
|
||||
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HealthRoomVO.class)).collect(Collectors.toList());
|
||||
return listMaps.stream().map(lMap -> BeanUtil.toBean(lMap, HealthRoomBaseVO.class)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(title="新疆健康小屋对象", description="新疆健康小屋对象")
|
||||
public class HealthRoomVO {
|
||||
public class HealthRoomBaseVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
+5
@@ -6,6 +6,11 @@ import lombok.Data;
|
||||
@Data
|
||||
@Schema(title="油田医院VO", description="油田医院VO")
|
||||
public class HospitalListVO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(title = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
|
||||
+3
@@ -1,7 +1,10 @@
|
||||
package com.renkang.emergency.largeScreen.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.renkang.anyan.model.vo.HealthRoomBaseVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalVO;
|
||||
import com.renkang.anyan.model.vo.MedicalPeopleNumStatisticsVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalStatisticsVO;
|
||||
import com.renkang.emergency.entity.dto.*;
|
||||
import com.renkang.emergency.entity.vo.DataDetailVO;
|
||||
import com.renkang.emergency.entity.vo.MedicalDataVO;
|
||||
|
||||
+3
@@ -2,7 +2,10 @@ package com.renkang.emergency.largeScreen.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.renkang.anyan.model.vo.HealthRoomBaseVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalVO;
|
||||
import com.renkang.anyan.model.vo.MedicalPeopleNumStatisticsVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalStatisticsVO;
|
||||
import com.renkang.emergency.largeScreen.entity.dto.*;
|
||||
import com.renkang.emergency.largeScreen.entity.vo.*;
|
||||
|
||||
|
||||
+29
-8
@@ -3,14 +3,18 @@ package com.renkang.emergency.largeScreen.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.renkang.anyan.client.AnYanClient;
|
||||
import com.renkang.anyan.model.vo.HealthSignStatVO;
|
||||
import com.renkang.anyan.model.vo.MedicalPeopleNumStatisticsVO;
|
||||
import com.renkang.anyan.config.AnYanProperties;
|
||||
import com.renkang.anyan.model.vo.*;
|
||||
import com.renkang.anyan.model.vo.HealthRoomBaseVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalStatisticsVO;
|
||||
import com.renkang.anyan.model.vo.MedicalAbnormalVO;
|
||||
import com.renkang.emergency.bean.response.XjHealthSignFakerData;
|
||||
import com.renkang.emergency.bean.response.XjMedicalCountFakerData;
|
||||
import com.renkang.emergency.bean.response.XjMedicalDataFakerData;
|
||||
@@ -26,7 +30,6 @@ import com.renkang.emergency.largeScreen.service.ILargeScreenService;
|
||||
import com.renkang.emergency.service.IResourceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.constant.FakerDataConstant;
|
||||
import org.jeecg.common.exception.ExceptionAssertsUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.util.RedisClientUtil;
|
||||
import org.jeecg.util.RedisKeyPrefix;
|
||||
@@ -58,7 +61,7 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
||||
private final RedisUtil redisUtil;
|
||||
private final ILargeScreenDataService screenDataService;
|
||||
private final AnYanClient anYanClient;
|
||||
|
||||
private final AnYanProperties anYanProperties;
|
||||
|
||||
private static final double MIN_LONGITUDE = 80.0;
|
||||
private static final double MAX_LONGITUDE = 100.0;
|
||||
@@ -117,10 +120,10 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
||||
baseVO.setLon(data[1]);
|
||||
baseVO.setLat(data[2]);
|
||||
baseVO.setDepartName("新疆大厂的单位");
|
||||
baseVO.setBuildDate(new Date());
|
||||
baseVO.setBuildDate(DateUtil.formatDate(new Date()));
|
||||
list.add(baseVO);
|
||||
}
|
||||
List<com.renkang.anyan.model.vo.HealthRoomVO> healthRoomVOS = anYanClient.healthPlaceHomList();
|
||||
List<com.renkang.anyan.model.vo.HealthRoomBaseVO> healthRoomVOS = anYanClient.healthPlaceHomList();
|
||||
// 查询第三方接口返回 此接口返回对象跟原有可能不太一样 要注意
|
||||
return list;
|
||||
}
|
||||
@@ -496,8 +499,26 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncAnYanHospital() {
|
||||
//更新医院信息
|
||||
//更新健康小屋信息
|
||||
//PS: 重要说明, 目前该同步逻辑只会向emergency_resource表中新增数据或者编辑已经存在的数据, 不会将历史存在且本次同步不存在的数据删除,若需要删除在此处理
|
||||
if(anYanProperties.isEnable()){
|
||||
//更新医院信息
|
||||
List<HospitalListVO> hospitalListVOList = anYanClient.hospitalList();
|
||||
if(ObjectUtil.isEmpty(hospitalListVOList)){
|
||||
LambdaQueryWrapper<Resource> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Resource::getType,1);
|
||||
wrapper.in(Resource::getId,hospitalListVOList.stream().map(HospitalListVO::getId).collect(Collectors.toList()));
|
||||
List<Resource> hospitalList = resourceService.list(wrapper);
|
||||
|
||||
}
|
||||
//更新健康小屋信息
|
||||
List<HealthRoomBaseVO> healthRoomVOList = anYanClient.healthPlaceHomList();
|
||||
if(ObjectUtil.isEmpty(healthRoomVOList)){
|
||||
LambdaQueryWrapper<Resource> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Resource::getType,2);
|
||||
wrapper.in(Resource::getId,healthRoomVOList.stream().map(HealthRoomBaseVO::getId).collect(Collectors.toList()));
|
||||
List<Resource> hospitalList = resourceService.list(wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] generateRandomLocation() {
|
||||
|
||||
Reference in New Issue
Block a user