|
|
|
@ -6,6 +6,8 @@ import cn.hutool.http.HttpUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.docus.infrastructure.web.api.CommonResult;
|
|
|
|
|
import com.docus.infrastructure.web.api.ResultCode;
|
|
|
|
|
import com.docus.server.collection.entity.TBasic;
|
|
|
|
|
import com.docus.server.collection.service.ITBasicService;
|
|
|
|
|
import com.docus.server.report.api.DownPlatformService;
|
|
|
|
|
import com.docus.server.report.api.dto.ReportDownDto;
|
|
|
|
|
import com.docus.server.report.api.dto.ReportDownPatientDto;
|
|
|
|
@ -24,10 +26,7 @@ import sun.misc.BASE64Encoder;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上报下载监听
|
|
|
|
@ -43,12 +42,31 @@ public class ReportDownListener {
|
|
|
|
|
@Resource
|
|
|
|
|
private AfReportRecordMapper afReportRecordMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ITBasicService itBasicService;
|
|
|
|
|
|
|
|
|
|
@EventListener
|
|
|
|
|
@Async("threadPoolExecutor")
|
|
|
|
|
public void threePartyPushReportDown(ThreePartyPushReportDownEvent threePartyPushReportDownEvent) {
|
|
|
|
|
// 根据任务id获取上报记录信息
|
|
|
|
|
AfReportRecord afReportRecord = afReportRecordMapper.getReportRecordInfoByTaskId(threePartyPushReportDownEvent.getTaskId());
|
|
|
|
|
|
|
|
|
|
// 病案是否是婴儿
|
|
|
|
|
boolean isBaby = itBasicService.getIsBabyBasic(afReportRecord.getPatientId());
|
|
|
|
|
if (isBaby) {
|
|
|
|
|
// 如果是婴儿查找母亲的信息
|
|
|
|
|
TBasic parentPatientInfo = itBasicService.getSdRyParentPatientInfo(afReportRecord.getPatientId());
|
|
|
|
|
if (Objects.isNull(parentPatientInfo)) {
|
|
|
|
|
log.warn("住院号:{},住院次数:{},病案主键:{} 是婴儿病案,未关联查询到母亲信息,不进行下载!", afReportRecord.getInpatientNo(), afReportRecord.getAdmissTimes(), afReportRecord.getPatientId());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 婴儿的报告要推给母亲,修改为母亲信息
|
|
|
|
|
afReportRecord.setPatientId(parentPatientInfo.getPatientId());
|
|
|
|
|
afReportRecord.setInpatientNo(parentPatientInfo.getInpatientNo());
|
|
|
|
|
afReportRecord.setAdmissTimes(parentPatientInfo.getAdmissTimes());
|
|
|
|
|
afReportRecord.setJzh(parentPatientInfo.getJzh());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 组织基础信息数据
|
|
|
|
|
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto(afReportRecord);
|
|
|
|
|
|
|
|
|
@ -75,7 +93,6 @@ public class ReportDownListener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@EventListener
|
|
|
|
|
@Async("threadPoolExecutor")
|
|
|
|
|
public void taskConsumptionReporDown(TaskConsumptionReportDownEvent taskConsumptionReportDownEvent) {
|
|
|
|
@ -102,7 +119,6 @@ public class ReportDownListener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
|
|
|
BASE64Encoder encoder = new BASE64Encoder();
|
|
|
|
|
|
|
|
|
@ -130,7 +146,6 @@ public class ReportDownListener {
|
|
|
|
|
// scanfile1Map.put("serialnum","嘉时测试图片1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FileInputStream inputStream2 = new FileInputStream("d://jianli_02.jpg");
|
|
|
|
|
System.out.println(inputStream2.available());
|
|
|
|
|
byte[] bytes2 = new byte[inputStream2.available()];
|
|
|
|
|