安眼接口对接
This commit is contained in:
+16
-1
@@ -3,6 +3,7 @@ package com.renkang.anyan.client;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.renkang.anyan.model.dto.HealthRoomDTO;
|
||||
import com.renkang.anyan.model.dto.HealthSignListParam;
|
||||
import com.renkang.anyan.model.dto.MedicalAbnormalDTO;
|
||||
import com.renkang.anyan.model.vo.*;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -27,7 +28,7 @@ public interface AnYanClient {
|
||||
void refreshToken();
|
||||
|
||||
/**
|
||||
* 体检人数统计查询
|
||||
* 体检医院人数统计查询
|
||||
* @param medicalYear 体检年份
|
||||
* @return
|
||||
*/
|
||||
@@ -80,4 +81,18 @@ public interface AnYanClient {
|
||||
* @return
|
||||
*/
|
||||
IPage<HealthPlaceHomDetailsVO> bloodSugarClockSList(HealthRoomDTO healthRoomDTO);
|
||||
|
||||
/**
|
||||
* 当年体检异常人数统计
|
||||
* @param medicalYear 年份
|
||||
* @return
|
||||
*/
|
||||
MedicalAbnormalStatisticsVO medicalAbnormalStatistics(Integer medicalYear);
|
||||
|
||||
/**
|
||||
* 当年体检异常人员列表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
IPage<MedicalAbnormalVO> medicalAbnormalList(MedicalAbnormalDTO param);
|
||||
}
|
||||
|
||||
+16
@@ -13,6 +13,7 @@ import com.renkang.anyan.enums.AnYanApiEnum;
|
||||
import com.renkang.anyan.model.dto.AuthParam;
|
||||
import com.renkang.anyan.model.dto.HealthRoomDTO;
|
||||
import com.renkang.anyan.model.dto.HealthSignListParam;
|
||||
import com.renkang.anyan.model.dto.MedicalAbnormalDTO;
|
||||
import com.renkang.anyan.model.vo.*;
|
||||
import com.renkang.anyan.utils.PageResultToBeanUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -147,4 +148,19 @@ public class AnYanClientExecutor implements AnYanClient {
|
||||
return new PageResultToBeanUtil<HealthPlaceHomDetailsVO>().transform(result,HealthPlaceHomDetailsVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MedicalAbnormalStatisticsVO medicalAbnormalStatistics(Integer medicalYear) {
|
||||
if(null == medicalYear){ medicalYear = DateUtil.year(new Date()); }
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("medicalYear",medicalYear);
|
||||
Result<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.MEDICAL_ABNORMAL_STATISTICS, buildTokenHeader(), param);
|
||||
return BeanUtil.toBean(result.getResult(),MedicalAbnormalStatisticsVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MedicalAbnormalVO> medicalAbnormalList(MedicalAbnormalDTO param) {
|
||||
Result<Object> result = RestTemplateUtil.postExchange(AnYanApiEnum.MEDICAL_ABNORMAL_LIST, buildTokenHeader(), param);
|
||||
return new PageResultToBeanUtil<MedicalAbnormalVO>().transform(result,MedicalAbnormalVO.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.renkang.anyan.model.dto;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class MedicalAbnormalDTO {
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String departName;
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(title = "检查日期起期 参数为空时,默认为今年第一天,如:2025-01-01")
|
||||
private Date checkInDateBegin;
|
||||
/**
|
||||
* 检查日期止期 参数为空时,默认为今天
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(title = "检查日期止期 参数为空时,默认为今天")
|
||||
private Date checkInDateEnd;
|
||||
/**
|
||||
* 查询类型 1:心血管异常/2:脑血管异常/3:冠脉CT异常
|
||||
*/
|
||||
@Schema(title = "查询类型 1:心血管异常/2:脑血管异常/3:冠脉CT异常")
|
||||
@NotNull
|
||||
private String queryType;
|
||||
/**
|
||||
* 页码 从1开始
|
||||
*/
|
||||
@Schema(title = "页码 从1开始")
|
||||
private Integer pageNo;
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
@Schema(title = "每页数量")
|
||||
private Integer pageSize;
|
||||
|
||||
public MedicalAbnormalDTO() {
|
||||
Date date = new Date();
|
||||
this.checkInDateBegin = DateUtil.beginOfYear(date);
|
||||
this.checkInDateEnd = DateUtil.endOfDay(date);
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.renkang.anyan.model.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MedicalAbnormalStatisticsVO {
|
||||
private Integer totalCount;
|
||||
// 心血管异常人数
|
||||
private Integer cardiovaAbCount;
|
||||
// 脑血管异常人数
|
||||
private Integer cerebrovAbCount;
|
||||
// 冠脉ct异常人数
|
||||
private Integer cctaAbCount;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.renkang.anyan.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
|
||||
@Data
|
||||
public class MedicalAbnormalVO {
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(title = "单位")
|
||||
private String departName;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(title = "姓名")
|
||||
private String name;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@Schema(title = "身份证号")
|
||||
private String idCard;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Schema(title = "性别")
|
||||
@Dict(dicCode = "sex2")
|
||||
private Integer sex;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@Schema(title = "年龄")
|
||||
private Integer age;
|
||||
/**
|
||||
* 体检医院
|
||||
*/
|
||||
@Schema(title = "体检医院")
|
||||
private String hospitalName;
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
@Schema(title = "检查日期")
|
||||
private String checkInDate;
|
||||
}
|
||||
+3
-3
@@ -68,10 +68,10 @@ public class Resource implements Serializable {
|
||||
@Schema(title = "纬度")
|
||||
private BigDecimal latitude;
|
||||
/**
|
||||
* 资源类型(1:油田医院 2:合作医院 3:医疗点 4: )
|
||||
* 资源类型(1:油田医院 3:健康小屋 5:救护车) 202508xj 项目字典发生变化 , 使用字典resource_type ,
|
||||
*/
|
||||
@Excel(name = "资源类型(1:油田医院 2:合作医院 3:医疗点 4: )", width = 15)
|
||||
@Schema(title = "资源类型(1:油田医院 2:合作医院 3:医疗点 4: )")
|
||||
@Excel(name = "资源类型(1:油田医院 3:健康小屋 5:救护车)", width = 15)
|
||||
@Schema(title = "资源类型(1:油田医院 3:健康小屋 5:救护车 )")
|
||||
private String type;
|
||||
/**
|
||||
* 救治范围
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class LargeScreenNewController {
|
||||
|
||||
private final ITbUserHelpMacService tbUserHelpMacService;
|
||||
private final YcLargeScreenService ycLargeScreenService;
|
||||
private final ITblAmbulanceGpsService tblAmbulanceGpsService;
|
||||
|
||||
+5
@@ -38,4 +38,9 @@ public interface ILargeScreenService extends IService<LargeScreenMap> {
|
||||
List<HospitalVO> hospital();
|
||||
|
||||
void runJob();
|
||||
|
||||
/**
|
||||
* 同步安眼系统中的油田医院数据和监控小屋数据定时任务
|
||||
*/
|
||||
void syncAnYanHospital();
|
||||
}
|
||||
|
||||
+10
@@ -26,11 +26,13 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.jeecg.common.api.dto.ServiceFakerData;
|
||||
import org.jeecg.common.api.dto.YcMedicalCenterFakerData;
|
||||
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;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
@@ -455,6 +457,7 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
||||
|
||||
@Override
|
||||
public void runJob(){
|
||||
|
||||
// 体检人数统计查询
|
||||
List<MedicalPeopleNumStatisticsVO> medicalPeopleNumStatisticsList = new ArrayList<>();
|
||||
redisClientUtil.set(MEDICAL,MEDICAL_PEOPLE_NUM_STATISTICS,medicalPeopleNumStatisticsList);
|
||||
@@ -483,6 +486,13 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
||||
redisClientUtil.set(MEDICAL,HEALTH_SIGN,healthSign);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncAnYanHospital() {
|
||||
//更新医院信息
|
||||
//更新健康小屋信息
|
||||
}
|
||||
|
||||
public static String[] generateRandomLocation() {
|
||||
Random random = new Random();
|
||||
|
||||
|
||||
+16
@@ -1,6 +1,8 @@
|
||||
package com.renkang.emergency.largeScreen.task;
|
||||
|
||||
import com.renkang.emergency.largeScreen.service.ILargeScreenService;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -16,4 +18,18 @@ public class LargeScreenJob {
|
||||
largeScreenService.runJob();
|
||||
log.info("========结束缓存大屏数据========");
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步安眼系统中的油田医院数据和监控小屋数据定时任务 ,回写至emergency_resource表
|
||||
* @return 执行状态
|
||||
*/
|
||||
@XxlJob(value = "syncAnYanHospital")
|
||||
public ReturnT<String> syncAnYanHospital() {
|
||||
try {
|
||||
largeScreenService.syncAnYanHospital();
|
||||
return ReturnT.SUCCESS;
|
||||
} catch (Exception e) {
|
||||
return ReturnT.FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user