init:初始化文件数据采集,顺德人医手麻采集开发
commit
a83fc1c096
@ -0,0 +1,35 @@
|
|||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
docus-services/docus-services-system1/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
*.log
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
mvnw*
|
||||||
|
*.cmd
|
||||||
|
*.mvn
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
logs*
|
@ -0,0 +1,73 @@
|
|||||||
|
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
|
||||||
|
|
||||||
|
<id>exe</id>
|
||||||
|
<formats>
|
||||||
|
<format>dir</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
|
||||||
|
<fileSets>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/lib</outputDirectory>
|
||||||
|
<directory>${basedir}/target/lib</directory>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/config</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.xml</include>
|
||||||
|
<include>*.yml</include>
|
||||||
|
<include>*.properties</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/dataConfig</outputDirectory>
|
||||||
|
<directory>${basedir}/target/dataConfig</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.json</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources/bin</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.bat</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}/target/resources/bin</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.xml</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<directory>${basedir}</directory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>*.exe</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
<!-- 将项目启动jar打包到boot目录中 -->
|
||||||
|
<fileSet>
|
||||||
|
<directory>${basedir}/target</directory>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
<includes>
|
||||||
|
<include>${project.build.finalName}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
</assembly>
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.docus.server;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@SpringBootApplication(scanBasePackages ={"com.docus"})
|
||||||
|
@MapperScan("com.docus.server.**.mapper")
|
||||||
|
@EnableFeignClients(basePackages = {"com.docus"})
|
||||||
|
public class AppRunBootstrap {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
|
||||||
|
props.setProperty("UseSunHttpHandler", "true");
|
||||||
|
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
|
||||||
|
|
||||||
|
SpringApplication.run(AppRunBootstrap.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void testMysql(){
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.docus.server.archive.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TBasicMapper {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.docus.server.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/3/29 14:00
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Data
|
||||||
|
public class DocusServerUrlConfig {
|
||||||
|
@Value("${docus.url.viewcollect-server}")
|
||||||
|
private String viewCollectServerUrl;
|
||||||
|
|
||||||
|
@Value("${docus.url.downploadlatform-server}")
|
||||||
|
private String downloadPlatformServerUrl;
|
||||||
|
|
||||||
|
@Value("${docus.url.taskdistribute-server}")
|
||||||
|
private String taskDistributeServerUrl;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.docus.server.rpc;
|
||||||
|
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.server.rpc.dto.ReportDownDto;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载平台服务接口
|
||||||
|
*
|
||||||
|
* @author jiashi
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface DownPlatformService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载服务文件上报
|
||||||
|
*
|
||||||
|
* @param reportDownDto 下载服务上报参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
CommonResult report(ReportDownDto reportDownDto);
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.docus.server.rpc;
|
||||||
|
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.server.rpc.dto.ReportDownTwoDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无视图任务服务
|
||||||
|
*
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface TaskDistributeService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无视图-根据采集器类型获取任务信息
|
||||||
|
*
|
||||||
|
* @param collectorId 采集器类型
|
||||||
|
* @return 任务信息
|
||||||
|
*/
|
||||||
|
CommonResult<ReportDownTwoDto> getNoViewTaskByCollectorId(String collectorId);
|
||||||
|
|
||||||
|
CommonResult<String> cancel(Long taskId);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.docus.server.rpc.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者基础信息
|
||||||
|
*
|
||||||
|
* @author WYBDEV
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
@ApiModel(value = "患者信息")
|
||||||
|
public class PatientInfoDTO {
|
||||||
|
@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,30 @@
|
|||||||
|
package com.docus.server.rpc.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,29 @@
|
|||||||
|
package com.docus.server.rpc.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ReportDownTwoDto {
|
||||||
|
@ApiModelProperty(value = "档案编号")
|
||||||
|
private String patientId;
|
||||||
|
@ApiModelProperty(value = "记账号")
|
||||||
|
private String jzh;
|
||||||
|
@ApiModelProperty(value = "档案类型")
|
||||||
|
private String recordType;
|
||||||
|
@ApiModelProperty(value = "档案时间")
|
||||||
|
private String createTime;
|
||||||
|
@ApiModelProperty(value = "患者信息")
|
||||||
|
private ReportPatientTwoDto patient =new ReportPatientTwoDto();
|
||||||
|
@ApiModelProperty(value = "住院信息")
|
||||||
|
private List<ReportHospitalTwoDto> hospitals = new ArrayList<>();
|
||||||
|
@ApiModelProperty(value = "任务信息")
|
||||||
|
private List<ReportTaskTwoDto> tasks = new ArrayList<>();
|
||||||
|
@ApiModelProperty(value = "母亲基础信息")
|
||||||
|
private PatientInfoDTO parent;
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.docus.server.rpc.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportHospitalTwoDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "患者id")
|
||||||
|
private String patientId;
|
||||||
|
@ApiModelProperty(value = "住院次数")
|
||||||
|
private Integer admissTimes;
|
||||||
|
@ApiModelProperty(value = "住院日期")
|
||||||
|
private String admissDate;
|
||||||
|
@ApiModelProperty(value = "出院日期")
|
||||||
|
private String disDate;
|
||||||
|
@ApiModelProperty(value = "出院科室名称")
|
||||||
|
private String disDeptName;
|
||||||
|
@ApiModelProperty(value = "出院科室名称")
|
||||||
|
private String admissDeptName;
|
||||||
|
@ApiModelProperty(value = "卡号")
|
||||||
|
private String admissId;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.docus.server.rpc.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上报打印 患者信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportPatientTwoDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "住院号/就诊号")
|
||||||
|
private String inpatientNo;
|
||||||
|
@ApiModelProperty(value = "患者姓名")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty(value = "id号")
|
||||||
|
private String patientId;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.docus.server.rpc.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportTaskTwoDto {
|
||||||
|
@ApiModelProperty(value = "采集器标识")
|
||||||
|
private String collectorId;
|
||||||
|
@ApiModelProperty(value = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
@ApiModelProperty(value = "患者id")
|
||||||
|
private String patientId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.docus.server.rpc.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.docus.core.util.Func;
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.server.config.DocusServerUrlConfig;
|
||||||
|
import com.docus.server.rpc.TaskDistributeService;
|
||||||
|
import com.docus.server.rpc.dto.ReportDownTwoDto;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无视图任务服务
|
||||||
|
*
|
||||||
|
* @author wyb
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class TaskDistributeServiceImpl implements TaskDistributeService {
|
||||||
|
@Resource
|
||||||
|
private DocusServerUrlConfig serverUrlConfig;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<ReportDownTwoDto> getNoViewTaskByCollectorId(String collectorId) {
|
||||||
|
String getTaskUrl = serverUrlConfig.getTaskDistributeServerUrl() + "api/noviewtask/GetTask?collectid=" + collectorId;
|
||||||
|
String result = HttpUtil.get(getTaskUrl);
|
||||||
|
return Func.readJson(result, new TypeReference<CommonResult<ReportDownTwoDto>>() {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<String> cancel(Long taskId) {
|
||||||
|
String taskCancelUrl = serverUrlConfig.getTaskDistributeServerUrl() + "api/collector/task/cancel";
|
||||||
|
Map<String, Object> param = new HashMap<>(1);
|
||||||
|
param.put("taskId", taskId);
|
||||||
|
log.info("任务作废 地址{},参数:{}", taskCancelUrl, param);
|
||||||
|
String resp = HttpUtil.post(taskCancelUrl, Func.toJson(param));
|
||||||
|
log.info("任务作废结果:{}", resp);
|
||||||
|
return Func.readJson(resp, new TypeReference<CommonResult<String>>() {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.docus.server.sdry.collector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 14:26
|
||||||
|
*/
|
||||||
|
public class CollectResult {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.docus.server.sdry.collector;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集器
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 14:23
|
||||||
|
*/
|
||||||
|
public interface Collector<R extends CollectResult> {
|
||||||
|
/**
|
||||||
|
* 采集
|
||||||
|
* @return 返回采集结果
|
||||||
|
*/
|
||||||
|
List<R> collect();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.docus.server.sdry.collector;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.docus.core.util.Func;
|
||||||
|
import com.docus.infrastructure.core.exception.BaseException;
|
||||||
|
import com.docus.server.archive.dto.PatientInfoDto;
|
||||||
|
import com.docus.server.sdry.converter.ShouMaConverter;
|
||||||
|
import com.docus.server.sdry.entity.ShouMaView;
|
||||||
|
import com.docus.server.sdry.mapper.ShouMaViewMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 14:26
|
||||||
|
*/
|
||||||
|
public class ShouMaCollector implements Collector<ShouMaCollectResult> {
|
||||||
|
/**
|
||||||
|
* 访问数据库视图mapper
|
||||||
|
*/
|
||||||
|
private final ShouMaViewMapper shouMaViewMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者基础信息
|
||||||
|
*/
|
||||||
|
private final PatientInfoDto patientInfoDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问数据库附加的额外条件
|
||||||
|
*/
|
||||||
|
private final String extraCondition;
|
||||||
|
|
||||||
|
|
||||||
|
public ShouMaCollector(ShouMaViewMapper shouMaViewMapper, PatientInfoDto patientInfoDto, String extraCondition) {
|
||||||
|
if (StrUtil.isBlank(patientInfoDto.getInpatientNo())) {
|
||||||
|
throw new BaseException("患者基础信息病案号不能为空!");
|
||||||
|
}
|
||||||
|
if (Func.isEmpty(patientInfoDto.getAdmissTimes())) {
|
||||||
|
throw new BaseException("患者基础信息住院次数不能为空!");
|
||||||
|
}
|
||||||
|
this.shouMaViewMapper = shouMaViewMapper;
|
||||||
|
this.patientInfoDto = patientInfoDto;
|
||||||
|
this.extraCondition = extraCondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShouMaCollectResult> collect() {
|
||||||
|
List<ShouMaView> patientShouMaViewDataList = shouMaViewMapper.getPatientShouMaView(patientInfoDto, extraCondition);
|
||||||
|
return patientShouMaViewDataList.stream().map(ShouMaConverter::convertResult).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.docus.server.sdry.converter;
|
||||||
|
|
||||||
|
import com.docus.server.sdry.collector.ShouMaCollectResult;
|
||||||
|
import com.docus.server.sdry.entity.ShouMaView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 15:00
|
||||||
|
*/
|
||||||
|
public class ShouMaConverter {
|
||||||
|
public static ShouMaCollectResult convertResult(ShouMaView shouMaView) {
|
||||||
|
if (shouMaView == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ShouMaCollectResult result = new ShouMaCollectResult();
|
||||||
|
result.setFileNo(shouMaView.getFID());
|
||||||
|
result.setInpatientNo(shouMaView.getFBIHID());
|
||||||
|
result.setAdmissTimes(shouMaView.getFBINCU());
|
||||||
|
result.setFileTitle(shouMaView.getPDESC());
|
||||||
|
result.setFilePath(shouMaView.getPDFPATH());
|
||||||
|
result.setUpdateTime(shouMaView.getFUPDATE());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package com.docus.server.sdry.job;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.docus.core.util.Func;
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.infrastructure.web.api.ResultCode;
|
||||||
|
import com.docus.server.archive.dto.PatientInfoDto;
|
||||||
|
import com.docus.server.archive.mapper.TBasicMapper;
|
||||||
|
import com.docus.server.rpc.DownPlatformService;
|
||||||
|
import com.docus.server.rpc.TaskDistributeService;
|
||||||
|
import com.docus.server.rpc.dto.*;
|
||||||
|
import com.docus.server.sdry.collector.ShouMaCollectResult;
|
||||||
|
import com.docus.server.sdry.collector.ShouMaCollector;
|
||||||
|
import com.docus.server.sdry.mapper.ShouMaViewMapper;
|
||||||
|
import com.xxl.job.core.context.XxlJobHelper;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 15:22
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class CollectJob {
|
||||||
|
@Autowired
|
||||||
|
private DownPlatformService downPlatformService;
|
||||||
|
@Autowired
|
||||||
|
private TaskDistributeService taskDistributeService;
|
||||||
|
@Autowired
|
||||||
|
private TBasicMapper tBasicMapper;
|
||||||
|
@Autowired
|
||||||
|
private ShouMaViewMapper shouMaViewMapper;
|
||||||
|
|
||||||
|
@XxlJob("Sdry-ShouMa-Collect")
|
||||||
|
public void shouMaCollect() {
|
||||||
|
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));
|
||||||
|
|
||||||
|
ReportHospitalTwoDto hospitalTwoDto = downTwoDto.getHospitals().get(0);
|
||||||
|
ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient();
|
||||||
|
PatientInfoDto patientInfoDto = new PatientInfoDto();
|
||||||
|
patientInfoDto.setInpatientNo(reportPatientTwoDto.getInpatientNo());
|
||||||
|
patientInfoDto.setAdmissTimes(hospitalTwoDto.getAdmissTimes());
|
||||||
|
ShouMaCollector shouMaCollector = new ShouMaCollector(shouMaViewMapper, patientInfoDto, extraCondition);
|
||||||
|
List<ShouMaCollectResult> shouMaCollectResultList = shouMaCollector.collect();
|
||||||
|
int size = shouMaCollectResultList.size();
|
||||||
|
log.info("住院号:{},住院次数:{} 采集手麻数据:{} 条!", patientInfoDto.getInpatientNo(), patientInfoDto.getAdmissTimes(), size);
|
||||||
|
if (size <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
||||||
|
patient.setPatientid(downTwoDto.getPatientId());
|
||||||
|
|
||||||
|
ReportDownDto reportDownDto = new ReportDownDto();
|
||||||
|
reportDownDto.setAssortid(assortId);
|
||||||
|
reportDownDto.setCollectorid(collectorId);
|
||||||
|
reportDownDto.setIp("");
|
||||||
|
reportDownDto.setPatient(patient);
|
||||||
|
|
||||||
|
for (ShouMaCollectResult result : shouMaCollectResultList) {
|
||||||
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||||
|
reportDownScanFileDto.setDownurl(result.getFilePath());
|
||||||
|
reportDownScanFileDto.setFiletitle(result.getFileTitle());
|
||||||
|
reportDownScanFileDto.setSerialnum(result.getFileNo());
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 顺德人医手麻视图采集任务结束!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.docus.server.sdry.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.docus.server.archive.dto.PatientInfoDto;
|
||||||
|
import com.docus.server.sdry.entity.ShouMaView;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/7/12 14:37
|
||||||
|
*/
|
||||||
|
@DS("shouMa")
|
||||||
|
@Mapper
|
||||||
|
public interface ShouMaViewMapper {
|
||||||
|
/**
|
||||||
|
* 根据患者信息获取手麻视图的数据
|
||||||
|
*
|
||||||
|
* @param patientInfoDto 患者信息
|
||||||
|
* @param extraCondition 额外的sql条件
|
||||||
|
* @return 手麻视图数据
|
||||||
|
*/
|
||||||
|
List<ShouMaView> getPatientShouMaView(@Param("patient") PatientInfoDto patientInfoDto, @Param("ext") String extraCondition);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
|
||||||
|
echo %str%
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if %str%==Started (
|
||||||
|
echo "restart....."
|
||||||
|
winsw stop
|
||||||
|
PING 127.0.0.1 -n 10 -w 30000 >NUL
|
||||||
|
winsw start
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if %str%==Stopped (
|
||||||
|
echo "start....."
|
||||||
|
winsw start
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if %str%==NonExistent (
|
||||||
|
echo "deploy and start....."
|
||||||
|
winsw install
|
||||||
|
winsw start
|
||||||
|
echo c
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
set java_opts=-Xms512m -Xmx512m
|
||||||
|
set key="java_opts"
|
||||||
|
|
||||||
|
|
||||||
|
rem 文件不存在,就跳过
|
||||||
|
if not exist java-ops.ini goto end
|
||||||
|
|
||||||
|
for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do (
|
||||||
|
if "%%i"==%key% set java_opts=%%j)
|
||||||
|
echo java_opts is : %java_opts%
|
||||||
|
|
||||||
|
:end
|
||||||
|
|
||||||
|
rem 启动java
|
||||||
|
|
||||||
|
java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
|
||||||
|
echo %str%
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if %str%==Started (
|
||||||
|
winsw stop
|
||||||
|
@echo wait program stop .....
|
||||||
|
PING 127.0.0.1 -n 30 -w 10000 >NUL
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,19 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
set deployDir=%1\docus-collect-file-data
|
||||||
|
if %deployDir%=="" set deployDir=d:\webroot\docus-collect-file-data
|
||||||
|
|
||||||
|
set curr_file=%cd%
|
||||||
|
cd /d %deployDir%
|
||||||
|
call stop.bat
|
||||||
|
cd %curr_file%
|
||||||
|
sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
|
||||||
|
rd/s/q %deployDir%\lib
|
||||||
|
rd/s/q %deployDir%\dataConfig
|
||||||
|
rd/s/q %deployDir%\config
|
||||||
|
del /s/q %deployDir%\*.jar
|
||||||
|
xcopy /Y/E/I * %deployDir%
|
||||||
|
|
||||||
|
cd /d %deployDir%
|
||||||
|
call install.bat
|
||||||
|
|
@ -0,0 +1,8 @@
|
|||||||
|
<service>
|
||||||
|
<id>docus-collect-file-data</id>
|
||||||
|
<name>生产-嘉时-文件数据采集服务</name>
|
||||||
|
<description>生产-嘉时-文件数据采集服务</description>
|
||||||
|
<startmode>Automatic</startmode>
|
||||||
|
<executable>%BASE%\start.bat</executable>
|
||||||
|
<log mode="none"></log>
|
||||||
|
</service>
|
@ -0,0 +1,2 @@
|
|||||||
|
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||||
|
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
@ -0,0 +1,20 @@
|
|||||||
|
<?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.sdry.mapper.ShouMaViewMapper">
|
||||||
|
|
||||||
|
<select id="getPatientShouMaView" resultType="com.docus.server.sdry.entity.ShouMaView">
|
||||||
|
SELECT FID,FBIHID,FBINCU,PDESC,PDFPATH,FUPDATE FROM(
|
||||||
|
select FID,FBIHID,FBINCU,PDESC,PDFPATH,FUPDATE from t_itf_dcsm_1 where FBIHID=#{patient.inpatientNo} and FBINCU=#{patient.admissTimes}
|
||||||
|
union all
|
||||||
|
select FID,FBIHID,FBINCU,PDESC,PDFPATH,FUPDATE from t_itf_dcsm_2 where FBIHID=#{patient.inpatientNo} and FBINCU=#{patient.admissTimes}
|
||||||
|
union all
|
||||||
|
select FID,FBIHID,FBINCU,PDESC,PDFPATH,FUPDATE from t_itf_dcsm_3 where FBIHID=#{patient.inpatientNo} and FBINCU=#{patient.admissTimes}
|
||||||
|
) T
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="ext != null and ext != ''">
|
||||||
|
${ext}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?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.archive.mapper.TBasicMapper">
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue