forked from luyan/epmet-cloud-lingshan
3 changed files with 112 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
package com.epmet.commons.tools.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/9/26 17:04 |
|||
*/ |
|||
@Data |
|||
public class YtHsjcResDTO { |
|||
private int code = 200; |
|||
private String msg = "请求成功"; |
|||
/** |
|||
* 响应数据 |
|||
*/ |
|||
private List<YtHsjcResDetailDTO> data; |
|||
private int total; |
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.epmet.commons.tools.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/9/26 17:10 |
|||
*/ |
|||
@Data |
|||
public class YtHsjcResDetailDTO { |
|||
private String id; |
|||
private String name; |
|||
private String card_no; |
|||
private String telephone; |
|||
private String address; |
|||
private String test_time; |
|||
private String depart_name; |
|||
private String county; |
|||
private String upload_time; |
|||
private String sample_result_pcr; |
|||
private String sample_time; |
|||
private String sampling_org_pcr; |
|||
|
|||
/* { |
|||
"code":"200", |
|||
"msg":"请求成功", |
|||
"data":[ |
|||
{ |
|||
"id":"6a31eb2d38c011eda054fa163ebc7ff4", |
|||
"name":"杨冠中",// 姓名
|
|||
"card_no":"372527198404130813",// 证件号码
|
|||
"telephone":"13697890860",// 电话
|
|||
"address":"保利香榭里公馆18-1-302",// 联系地址
|
|||
"test_time":"2022-09-20 12:52:28",// 检测时间
|
|||
"depart_name":"天仁医学检验实验室有限公司",// varchar
|
|||
"county":"莱山区",// 所属区县
|
|||
"upload_time":"2022-09-20 21:23:10",// 时间戳
|
|||
"sample_result_pcr":"2",// 核酸检测结果 1:阳性,2:阴性
|
|||
"sample_time":"2022-09-20 06:48:28",// 采样时间
|
|||
"sampling_org_pcr":"采样点327"// 核酸采样机构
|
|||
}, |
|||
] |
|||
"total":1 |
|||
} |
|||
*/ |
|||
} |
|||
|
@ -0,0 +1,42 @@ |
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.dto.result.YtHsjcResDTO; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.ArrayList; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/9/26 16:56 |
|||
*/ |
|||
@Slf4j |
|||
public class YtHsResUtils { |
|||
static String url = "https://10.2.2.60:8191/sjzt/server/hsjcxx?appkey=DR4jF5Be7sCsqDmCamq2tmYCl"; |
|||
|
|||
/** |
|||
* desc:图片同步扫描 |
|||
* |
|||
* @return |
|||
*/ |
|||
public static YtHsjcResDTO hsjc(String cardNo, Integer rowNum, Integer pageSize) { |
|||
try { |
|||
String param = String.format("&card_no=%s&ROWNUM=%s&PAGESIZE=%s", cardNo, rowNum, pageSize); |
|||
String apiUrl = url.concat(param); |
|||
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(apiUrl, null); |
|||
if (result.success()) { |
|||
return JSON.parseObject(result.getData(), YtHsjcResDTO.class); |
|||
} |
|||
YtHsjcResDTO resultResult = new YtHsjcResDTO(); |
|||
resultResult.setData(new ArrayList<>()); |
|||
return resultResult; |
|||
} catch (Exception e) { |
|||
log.error(String.format("烟台核算检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); |
|||
} |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue