报告到下载平台

segment2.0
beeajax 2 years ago
parent f5745e4d66
commit 17746be30a

@ -1,5 +1,6 @@
{
"icu": "重症文件分段id",
"sa": "手麻文件分段id",
"examination": "检验报告文件分段id",
"other": "其他文件分段id"
}

@ -11,7 +11,7 @@ import org.springframework.retry.annotation.EnableRetry;
@Slf4j
//@EnableFeignClients(basePackages = ("com.feign"))
//@EnableHystrix
//@MapperScan("com.docus.server")
//@MapperScan("com.docus.server.**.mapper")
@SpringBootApplication(scanBasePackages = {"com.docus"})
@EnableRetry
@EnableTrackGroup

@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.docus.core.util.Func;
import com.docus.core.util.XmlUtil;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.collect.infrastructure.pojo.dto.ReportDTO;
import com.docus.server.archivefile.pojo.dto.ReportDTO;
import com.docus.server.tool.ParamsUtils;
import com.docus.server.tool.TableJsonRead;
import com.docus.server.ws.convert.IConverter;

@ -12,21 +12,21 @@ spring:
datasource:
master:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: docus
password: docus702
username: root
password: root
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource
his:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/his?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: docus
password: docus702
username: root
password: root
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource
redis:
host: redis.docus.cn
password: JSdocus@702
# password: JSdocus@702
cloud:
nacos:
discovery:
@ -39,12 +39,12 @@ spring:
shared-configs:
- comm.${spring.cloud.nacos.config.file-extension}
docus:
dbtype: mysql
user:
# 用户默认密码
defpwd: fd29cd53ec12616e5f36b77d4afffbff
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
@ -80,4 +80,4 @@ xxl:
# replica:
# queueManager: MqManager02
# channel: chl_server02
# connName: 10.222.23.131(1414)
# connName: 10.222.23.131(1414)

@ -4,14 +4,14 @@ import com.docus.server.collect.infrastructure.enums.IIntegerEnum;
public enum CollectTypeEnum implements IIntegerEnum {
WEBSERVICE_XML_DEPT(0, "WEBSERVICE_XML_DEPT", "科室信息"),
WEBSERVICE_XML_USER(1, "WEBSERVICE_XML_USER", "用户信息"),
WEBSERVICE_XML_BASIC(2, "WEBSERVICE_XML_BASIC", "新增/修改基础数据"),
WEBSERVICE_XML_SA_REPORT(3, "WEBSERVICE_XML_SA_REPORT", "手麻报告信息"),
WEBSERVICE_XML_ICU_REPORT(4, "WEBSERVICE_XML_ICU_REPORT", "重症报告信息"),
WEBSERVICE_XML_EXAMINATION_REPORT(5, "WEBSERVICE_XML_EXAMINATION_REPORT", "检验报告信息"),
WEBSERVICE_XML_INSERT_INSPECTION_REPORT(6, "WEBSERVICE_XML_INSERT_INSPECTION_REPORT", "新增检查报告的信息"),
WEBSERVICE_XML_UPDATE_INSPECTION_REPORT(7, "WEBSERVICE_XML_UPDATE_INSPECTION_REPORT", "更新检查报告的信息");
WEBSERVICE_XML_DEPT(0, "WEBSERVICE_XML_DEPT", "新增/修改-科室信息"),
WEBSERVICE_XML_USER(1, "WEBSERVICE_XML_USER", "新增/修改-用户信息"),
WEBSERVICE_XML_BASIC(2, "WEBSERVICE_XML_BASIC", "新增/修改-基础数据"),
WEBSERVICE_XML_SA_REPORT(3, "WEBSERVICE_XML_SA_REPORT", "新增-手麻报告信息"),
WEBSERVICE_XML_ICU_REPORT(4, "WEBSERVICE_XML_ICU_REPORT", "新增-重症报告信息"),
WEBSERVICE_XML_EXAMINATION_REPORT(5, "WEBSERVICE_XML_EXAMINATION_REPORT", "新增-检验报告信息"),
WEBSERVICE_XML_INSERT_INSPECTION_REPORT(6, "WEBSERVICE_XML_INSERT_INSPECTION_REPORT", "新增-检查报告的信息"),
WEBSERVICE_XML_UPDATE_INSPECTION_REPORT(7, "WEBSERVICE_XML_UPDATE_INSPECTION_REPORT", "更新-检查报告的信息");
private Integer value;
private String display;

@ -36,8 +36,8 @@ public class TaskOriginalMessage implements Serializable {
private String name;
@ApiModelProperty(value = "采集描述")
@TableField("desc")
private String desc;
@TableField("memo")
private String memo;
@ApiModelProperty(value = "采集类型")
@TableField("collect_type")

@ -1,29 +0,0 @@
package com.docus.server.tool;
import lombok.Data;
@Data
public class ProcessorContext {
//线程变量,请求线程内有效
private static final ThreadLocal<ProcessorContext> current = new ThreadLocal<>();
private String jsonStr;
//初始化
public static void init(String jsonStr) {
current.remove();
ProcessorContext context = new ProcessorContext();
context.jsonStr = jsonStr;
current.set(context);
}
//获取当前现场request
public static ProcessorContext get() {
return current.get();
}
//清除线程变量
public static void clear() {
current.remove();
}
}

@ -55,17 +55,18 @@ public class VisitorProcessor extends AbstractProcessor {
String afterReturnResult = (String) params.get("jsonStr");
params.put("msg", context.getExMessageResult());
if (!context.isError()) {
log.info("=== AOP 后置通知 ===");
if (Func.isNotEmpty(afterReturnResult)) {
params.putAll(JSON.fromJSONWithGeneric(afterReturnResult, new TypeReference<Map<? extends String, ?>>() {
}));
}
if (!context.isError()) {
log.info("=== AOP 后置通知 ===");
params.put("msg", "操作成功!");
return wsResult.ok(params);
} else {
log.info("=== AOP 异常通知 ===");
messageService.updateTaskOriginalMessage(taskId, afterReturnResult, StateEnum.FAIL);
params.putAll(JSON.fromJSONWithGeneric(afterReturnResult, new TypeReference<Map<? extends String, ?>>() {
}));
return wsResult.fail(params);
}
} catch (Exception e) {

@ -48,6 +48,14 @@ public interface IWebServiceServer {
*/
String pushICUReport(String icuReportMessage);
/**
*
*
* @param examinationReportMessage
* @return
*/
String pushExaminationReport(String examinationReportMessage);
/**
* -
*

@ -18,7 +18,7 @@ public class TaskOriginalMessageConverter {
TaskOriginalMessage taskOriginalMessage = new TaskOriginalMessage();
taskOriginalMessage.setId(idService.getDateSeq());
taskOriginalMessage.setName(collectType.name());
taskOriginalMessage.setDesc(collectType.getDesc());
taskOriginalMessage.setMemo(collectType.getDesc());
taskOriginalMessage.setCollectType(collectType);
taskOriginalMessage.setJsonStr(json);
taskOriginalMessage.setSource(xml);

@ -19,13 +19,15 @@ import javax.annotation.Resource;
@Service
@Slf4j
public class ReportServerImpl implements IReportServer {
private static final String CONVERTER = "reportConverter";
private static final String WS_RESULT = "wsReportResultImpl";
@Resource
private IReportService reportService;
@Override
@TrackGroup(
group = "WEBSERVICE_XML_SA_REPORT",
beanNames = {"reportConverter", "wsReportResultImpl"},
beanNames = {CONVERTER, WS_RESULT},
processor = VisitorProcessor.class)
public String pushSAReport(String message) {
report();
@ -35,7 +37,7 @@ public class ReportServerImpl implements IReportServer {
@Override
@TrackGroup(
group = "WEBSERVICE_XML_ICU_REPORT",
beanNames = {"reportConverter", "wsReportResultImpl"},
beanNames = {CONVERTER, WS_RESULT},
processor = VisitorProcessor.class)
public String pushICUReport(String message) {
log.info("收到重症消息:{}", message);
@ -46,7 +48,7 @@ public class ReportServerImpl implements IReportServer {
@Override
@TrackGroup(
group = "WEBSERVICE_XML_EXAMINATION_REPORT",
beanNames = {"reportConverter", "wsReportResultImpl"},
beanNames = {CONVERTER, WS_RESULT},
processor = VisitorProcessor.class)
public String pushExaminationReport(String message) {
log.info("收到检验报告消息:{}", message);
@ -57,7 +59,7 @@ public class ReportServerImpl implements IReportServer {
@Override
@TrackGroup(
group = "WEBSERVICE_XML_INSERT_INSPECTION_REPORT",
beanNames = {"reportConverter", "wsReportResultImpl"},
beanNames = {CONVERTER, WS_RESULT},
processor = VisitorProcessor.class)
public String pushAddInspectionReport(String message) {
log.info("收到检查报告新增消息:{}", message);
@ -68,7 +70,7 @@ public class ReportServerImpl implements IReportServer {
@Override
@TrackGroup(
group = "WEBSERVICE_XML_UPDATE_INSPECTION_REPORT",
beanNames = {"reportConverter", "wsReportResultImpl"},
beanNames = {CONVERTER, WS_RESULT},
processor = VisitorProcessor.class)
public String pushUpdateInspectionReport(String message) {
log.info("收到检查报告更新消息:{}", message);

@ -73,6 +73,12 @@ public class WebServiceServer implements IWebServiceServer {
return reportServer.pushICUReport(icuReportMessage);
}
@Override
public String pushExaminationReport(String examinationReportMessage) {
return reportServer.pushICUReport(examinationReportMessage);
}
@Override
public String pushAddInspectionReport(String inspectionReportMessage) {
return reportServer.pushAddInspectionReport(inspectionReportMessage);

@ -63,8 +63,8 @@ public class ReportDownListener {
String requestParam = Func.toJson(reportDownDto);
try {
log.info("调用下载服务,地址:{} ,参数:{}", applicationBusinessConfig.getDownUrl(), requestParam);
String respBody = post(applicationBusinessConfig.getDownUrl(), requestParam);
log.info("调用下载服务,地址:{} ,参数:{}", "http://localhost:9291/api/downplatform/report", requestParam);
String respBody = post("http://localhost:9291/api/downplatform/report", requestParam);
log.info("调用下载服务成功,响应参数:{}", respBody);
CommonResult commonResult = Func.readJson(respBody, CommonResult.class);
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())) {
@ -101,8 +101,8 @@ public class ReportDownListener {
// 下面是调用下载服务
String requestParam = Func.toJson(reportDownDto);
try {
log.info("调用下载服务,地址:{} ,参数:{}", applicationBusinessConfig.getDownUrl(), requestParam);
String respBody = post(applicationBusinessConfig.getDownUrl(), requestParam);
log.info("调用下载服务,地址:{} ,参数:{}", "http://localhost:9291/api/downplatform/report", requestParam);
String respBody = post("http://localhost:9291/api/downplatform/report", requestParam);
log.info("调用下载服务成功,响应参数:{}", respBody);
} catch (Exception e) {
log.error("调用下载服务失败", e);

@ -1,6 +1,7 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfCollectTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
@ -8,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
*
* @author wyb
*/
@Mapper
public interface AfCollectTaskMapper {

@ -1,6 +1,7 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfJobTime;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -8,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
* job
* @author wyb
*/
@Mapper
public interface AfJobTimeMapper {
/**
*

@ -1,6 +1,7 @@
package com.docus.server.archivefile.mapper;
import com.docus.server.archivefile.pojo.entity.AfReportRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -10,6 +11,7 @@ import java.util.List;
*
* @author wyb
*/
@Mapper
public interface AfReportRecordMapper {
/**
*
@ -73,4 +75,4 @@ public interface AfReportRecordMapper {
* @return
*/
int updateReportRecordPatientId(@Param("patientId") String patientId, @Param("taskId") Long taskId);
}
}

@ -0,0 +1,4 @@
package com.docus.server.archivefile.service;
public interface B {
}

@ -1,7 +0,0 @@
package com.docus.server.record.service;
import com.docus.server.record.pojo.entity.MedicalRecord;
public interface IMedicalRecordService {
void receive(MedicalRecord medicalRecord);
}

@ -0,0 +1,4 @@
package com.docus.server.archivefile.service.impl;
public class A {
}

@ -1,54 +0,0 @@
package com.docus.server.record.service.impl;
import com.docus.server.record.pojo.dto.IdType;
import com.docus.server.record.pojo.entity.MedicalRecord;
import com.docus.server.record.service.IMedicalRecordService;
import org.springframework.stereotype.Service;
@Service
public class MedicalRecordServiceImpl implements IMedicalRecordService {
@Override
public void receive(MedicalRecord medicalRecord) {
//判断幂等,不要重复提交。 //判断业务是否正确,
if (isExist(medicalRecord)) {
return;
}
//保存数据内容到数据库。
this.saveMedicalRecord(medicalRecord);
//发起下载任务
}
public void createDownloadTask(MedicalRecord medicalRecord) {
//创建下载任务,改造文件服务,
//确保下载任务成功。
//完成任务,保存对应信息到病案系统。
}
public void saveFileInfo() {
}
public void saveMedicalRecord(MedicalRecord medicalRecord) {
}
public Boolean isExist(MedicalRecord medicalRecord) {
if (medicalRecord.getIdType() == IdType.JZH) {
//根据记账号查询
return true;
} else {
//根据住院号+住院次数
return true;
}
}
}
Loading…
Cancel
Save