文件上报通用逻辑
parent
31ab311259
commit
a88166cf58
@ -0,0 +1,35 @@
|
||||
package com.docus.server.collect.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 患者基础信息
|
||||
*
|
||||
* @author WYBDEV
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "患者基础信息")
|
||||
public class TBasic {
|
||||
@ApiModelProperty(value = "病案主键")
|
||||
private String patientId;
|
||||
@ApiModelProperty(value = "住院号")
|
||||
private String inpatientNo;
|
||||
@ApiModelProperty(value = "住院次数")
|
||||
private Integer admissTimes;
|
||||
@ApiModelProperty(value = "入院日期 yyyy-MM-dd HH:mm:ss")
|
||||
private String admissDate;
|
||||
@ApiModelProperty(value = "入院科室名称")
|
||||
private String admissDeptName;
|
||||
@ApiModelProperty(value = "出院日期 yyyy-MM-dd HH:mm:ss")
|
||||
private String disDate;
|
||||
@ApiModelProperty(value = "出院科室名称")
|
||||
private String disDeptName;
|
||||
@ApiModelProperty(value = "记账号")
|
||||
private String jzh;
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "住院id")
|
||||
private String admissId;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.docus.server.collect.enums;
|
||||
|
||||
/**
|
||||
* 下载方式
|
||||
*/
|
||||
public enum DownWayEnum {
|
||||
/**
|
||||
* http https ftp
|
||||
*/
|
||||
HTTP(1,"网络地址URL"),
|
||||
/**
|
||||
* base64
|
||||
*/
|
||||
BASE64(2,"BASE64内容文本"),
|
||||
/**
|
||||
* url返回base64内容
|
||||
*/
|
||||
BASE64URL(3,"BASE64内容地址"),
|
||||
/**
|
||||
* 共享文件夹
|
||||
*/
|
||||
SMB(4,"共享文件夹"),
|
||||
/**
|
||||
* 本地文件base64
|
||||
*/
|
||||
LocalBase64(5,"本地BAE64内容文件"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
private DownWayEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc=desc;
|
||||
}
|
||||
public Integer value() {
|
||||
return this.code;
|
||||
}
|
||||
public String desc(){
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.docus.server.collect.infrastructure.client;
|
||||
|
||||
import com.docus.infrastructure.web.api.CommonResult;
|
||||
import com.docus.server.collect.infrastructure.client.dto.ReportDownDto;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
/**
|
||||
* 下载平台服务
|
||||
* @author wyb
|
||||
*/
|
||||
@FeignClient(url = "${docus.url.downloadPlatform}",name = "download-platform")
|
||||
public interface DownloadPlatformService {
|
||||
|
||||
@ApiOperation("病案上报文件(通用)")
|
||||
@RequestMapping(value = "/api/downplatform/report",method = RequestMethod.POST)
|
||||
public CommonResult report(@RequestBody ReportDownDto resources);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.docus.server.collect.infrastructure.client.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ReportDownDto {
|
||||
@ApiModelProperty(value = "采集器id")
|
||||
private String collectorid;
|
||||
|
||||
@ApiModelProperty(value = "采集器ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String assortid;
|
||||
|
||||
@ApiModelProperty(value = "患者信息")
|
||||
private ReportDownPatientDto patient;
|
||||
|
||||
@ApiModelProperty(value = "文件信息")
|
||||
private List<ReportDownScanFileDto> scanfiles;
|
||||
|
||||
@ApiModelProperty(value = "扫描用户代码")
|
||||
private String scanusercode;
|
||||
@ApiModelProperty(value = "扫描用户名称")
|
||||
private String scanusername;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.docus.server.collect.infrastructure.dao.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.docus.core.util.Func;
|
||||
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
|
||||
import com.docus.server.collect.entity.DownloadTask;
|
||||
import com.docus.server.collect.entity.TBasic;
|
||||
import com.docus.server.collect.infrastructure.dao.DownloadTaskDao;
|
||||
import com.docus.server.collect.infrastructure.mapper.DownloadTaskMapper;
|
||||
import com.docus.server.collect.service.dto.ReportFileInfoDTO;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 下载任务表-数据访问实现类
|
||||
*
|
||||
* @author wyb
|
||||
*/
|
||||
@Repository
|
||||
public class DownloadTaskDaoImpl extends BaseDaoImpl<DownloadTaskMapper, DownloadTask> implements DownloadTaskDao {
|
||||
@Override
|
||||
public List<TBasic> getBasicInfo(ReportFileInfoDTO fileInfoDTO) {
|
||||
return baseMapper.getBasicInfo(fileInfoDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getDownloadTaskIdFromDownloadTask(DownloadTask downloadTask) {
|
||||
LambdaQueryWrapper<DownloadTask> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.select(DownloadTask::getId);
|
||||
wrapper.eq(Func.isNotBlank(downloadTask.getPatientId()), DownloadTask::getPatientId, downloadTask.getPatientId());
|
||||
wrapper.eq(Func.isNotBlank(downloadTask.getJzh()), DownloadTask::getJzh, downloadTask.getJzh());
|
||||
wrapper.eq(Func.isNotBlank(downloadTask.getInpatientNo()), DownloadTask::getInpatientNo, downloadTask.getInpatientNo());
|
||||
wrapper.eq(Func.isNotEmpty(downloadTask.getAdmissions()), DownloadTask::getAdmissions, downloadTask.getAdmissions());
|
||||
List<DownloadTask> downloadTasks = baseMapper.selectList(wrapper);
|
||||
if (Func.isNotEmpty(downloadTasks) && downloadTasks.size() == 1) {
|
||||
return downloadTasks.get(0).getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getDownloadTaskIdFromSanAssort(String patientId, String source, String serialNum) {
|
||||
return baseMapper.getDownloadTaskIdFromSanAssort(patientId, source, serialNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getDownloadTaskIdFromDownFile(String patientId, String source, String serialNum) {
|
||||
return baseMapper.getDownloadTaskIdFromDownFile(patientId, source, serialNum);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.docus.server.collect.infrastructure.mapper.DownloadTaskMapper">
|
||||
|
||||
<select id="getBasicInfo" resultType="com.docus.server.collect.entity.TBasic">
|
||||
select
|
||||
`patient_id` as patientId,
|
||||
`admiss_times` as admissTimes,
|
||||
`inpatient_no` as inpatientNo,
|
||||
`admiss_id` as admissId,
|
||||
`admiss_date` as admissDate,
|
||||
`dis_date` as disDate,
|
||||
`admiss_dept_name` as admissDeptName,
|
||||
`dis_dept_name` as disDeptName ,
|
||||
`jzh`,
|
||||
`name`
|
||||
FROM
|
||||
`docus_medicalrecord`.`t_basic`
|
||||
WHERE
|
||||
is_cancel=0
|
||||
<if test="dto.patientId != null and dto.patientId != ''">
|
||||
and `patient_id` = #{dto.patientId}
|
||||
</if>
|
||||
<if test="dto.jzh != null and dto.jzh != ''">
|
||||
and `jzh` = #{dto.jzh}
|
||||
</if>
|
||||
<if test="dto.inpatientNo != null and dto.inpatientNo != ''">
|
||||
and `inpatient_no` = #{dto.inpatientNo}
|
||||
</if>
|
||||
<if test="dto.admisstimes != null">
|
||||
and `admiss_times` = #{dto.admisstimes}
|
||||
</if>
|
||||
limit 2
|
||||
</select>
|
||||
<select id="getDownloadTaskIdFromSanAssort" resultType="java.lang.Long">
|
||||
SELECT
|
||||
`id`
|
||||
FROM
|
||||
`docus_archivefile`.`t_scan_assort`
|
||||
where
|
||||
`patient_id` = #{patientId}
|
||||
and `source`= #{source}
|
||||
and `file_column_1`= #{serialNum}
|
||||
</select>
|
||||
<select id="getDownloadTaskIdFromDownFile" resultType="java.lang.Long">
|
||||
SELECT
|
||||
`t_scan_assort_id`
|
||||
FROM
|
||||
`docus_archivefile`.`af_downfile`
|
||||
WHERE
|
||||
`patient_id` = #{patientId}
|
||||
and `collectorid` = #{source}
|
||||
and `serialnum` = #{serialNum}
|
||||
order by `create_time` desc limit 1
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue