fix:修复查询视图条件

master
wyb 2 months ago
parent 8eca5ee798
commit 704efdeb70

@ -257,58 +257,63 @@ public class MzZyyReportCollectJob {
@XxlJob("MzZyyXinDianCollectJob")
public void xinDianCollectJob() {
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务开始!");
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
String jobParam = XxlJobHelper.getJobParam();
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
String assortId = jobParamJsonObject.getString("assortId");
String collectorId = jobParamJsonObject.getString("collectorId");
String extraCondition = jobParamJsonObject.getString("extraCondition");
if (Func.isBlank(assortId) || Func.isBlank(collectorId)) {
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务,未配置心电采集器和采集文件分段");
return;
}
CommonResult<ReportDownTwoDto> commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId);
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())
&& commonResult.getData() != null) {
ReportDownTwoDto downTwoDto = commonResult.getData();
ReportTaskTwoDto task = downTwoDto.getTasks().get(0);
log.info("获取了任务:{}", Func.toJson(task));
String patientId = downTwoDto.getPatientId();
String jzh = downTwoDto.getJzh();
List<MzZyyXinDianView> xinDianViews = xinDianViewMapper.getPatientXinDianView(jzh, extraCondition);
int size = xinDianViews.size();
log.info("记账号:{} 采集心电数据:{} 条!", jzh, size);
if (size <= 0) {
determineAndCancelTask(patientId, collectorId);
try {
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
String jobParam = XxlJobHelper.getJobParam();
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
String assortId = jobParamJsonObject.getString("assortId");
String collectorId = jobParamJsonObject.getString("collectorId");
String extraCondition = jobParamJsonObject.getString("extraCondition");
if (Func.isBlank(assortId) || Func.isBlank(collectorId)) {
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务,未配置心电采集器和采集文件分段");
return;
}
tBasicMapper.invalidFileBySource(patientId, collectorId);
CommonResult<ReportDownTwoDto> commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId);
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())
&& commonResult.getData() != null) {
ReportDownTwoDto downTwoDto = commonResult.getData();
ReportTaskTwoDto task = downTwoDto.getTasks().get(0);
log.info("梅州中医院心电视图采集,获取了任务:{}", Func.toJson(task));
String patientId = downTwoDto.getPatientId();
String jzh = downTwoDto.getJzh();
List<MzZyyXinDianView> xinDianViews = xinDianViewMapper.getPatientXinDianView(jzh, extraCondition);
int size = xinDianViews.size();
log.info("梅州中医院心电视图采集,记账号:{} 采集心电数据:{} 条!", jzh, size);
if (size <= 0) {
determineAndCancelTask(patientId, collectorId);
return;
}
tBasicMapper.invalidFileBySource(patientId, collectorId);
ReportDownPatientDto patient = new ReportDownPatientDto();
patient.setPatientid(patientId);
ReportDownPatientDto patient = new ReportDownPatientDto();
patient.setPatientid(patientId);
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setAssortid(assortId);
reportDownDto.setCollectorid(collectorId);
reportDownDto.setIp("");
reportDownDto.setPatient(patient);
for (MzZyyXinDianView result : xinDianViews) {
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(result.getBgdz());
reportDownScanFileDto.setFiletitle(result.getBgmc());
reportDownScanFileDto.setSerialnum(result.getBgid());
reportDownScanFileDto.setFilesource(1);
reportDownScanFileDto.setFiletype(1);
reportDownScanFileDto.setFilestoragetype(1);
reportDownScanFileDto.setTaskid(task.getTaskId());
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
reportDownDto.setScanfiles(scanFiles);
downPlatformService.report(reportDownDto);
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setAssortid(assortId);
reportDownDto.setCollectorid(collectorId);
reportDownDto.setIp("");
reportDownDto.setPatient(patient);
for (MzZyyXinDianView result : xinDianViews) {
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(result.getBgdz());
reportDownScanFileDto.setFiletitle(result.getBgmc());
reportDownScanFileDto.setSerialnum(result.getBgid());
reportDownScanFileDto.setFilesource(1);
reportDownScanFileDto.setFiletype(1);
reportDownScanFileDto.setFilestoragetype(1);
reportDownScanFileDto.setTaskid(task.getTaskId());
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
reportDownDto.setScanfiles(scanFiles);
downPlatformService.report(reportDownDto);
}
}
} catch (Exception ex) {
log.error(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务出错了!" + ex.getMessage(), ex);
}
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州中医院心电视图采集任务结束!");
}

@ -2,16 +2,16 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.sdry.mapper.ShouMaViewMapper">
<mapper namespace="com.docus.server.mzzyy.mapper.MzZyyXinDianViewMapper">
<select id="getPatientShouMaView" resultType="com.docus.server.sdry.entity.ShouMaView">
<select id="getPatientXinDianView" resultType="com.docus.server.mzzyy.entity.MzZyyXinDianView">
SELECT
JZH as jzh,
BGID as bgid,
BGMC as bgmc,
BGDZ as bgdz
FROM dbo.V_JSWZH_XD
WHERE 1=1
WHERE 1=1 AND JZH = #{jzh}
<if test="ext != null and ext != ''">
${ext}
</if>

Loading…
Cancel
Save