病理检验报告接受推送bug修复

docus_webservice_1.1
lzy 4 years ago
parent 6430824e5d
commit 3eaec92a39

@ -22,6 +22,6 @@
//
"basicDirectory":["Msg","PatInfo"],
//
"doubleBasic":["TestItemInfo","BioTestInfo"],
"doubleBasic":["TestItemInfo","BioTestInfo"]
}

@ -7,6 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
public class DemoApplication {
public static void main(String[] args) {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
SpringApplication.run(DemoApplication.class, args);
}

@ -1,17 +1,20 @@
package com.docus.bgts.config;
import com.docus.bgts.enums.Codes;
import com.docus.bgts.handler.ITBasicWebService;
import com.docus.bgts.handler.TBasicWebService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
@Configuration
public class WebServiceConfig {
@Value("${system.code}")
private String systemCode;
@Value("${system.prop}")
private String systemProp;
//把实现类交给spring管理
@Bean
public ITBasicWebService tBasicWebService() {
@ -21,7 +24,8 @@ public class WebServiceConfig {
@Bean
public Endpoint endpoint() {
System.out.println("-----------------------web service服务已发布-------------------------");
String address = "http://"+"0.0.0.0"+":" + Codes.EXTERNAL.getCode()+"/" + Codes.EXTERNAL.getMessage();
// String address = "http://"+"0.0.0.0"+":" + Codes.EXTERNAL.getCode()+"/" + Codes.EXTERNAL.getMessage();
String address = "http://"+"0.0.0.0"+":" + systemProp+"/" + systemCode;
Endpoint publish = Endpoint.publish(address, tBasicWebService());
System.out.println(" "+address);
return publish;

@ -0,0 +1,64 @@
package com.docus.bgts.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-05-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="AfCollectTask对象", description="病案采集任务")
public class AfCollectTask implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id 雪花算法")
@TableId(value = "id", type = IdType.ID_WORKER_STR)
private Long id;
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "af_archive_detail表id")
private Long afArchiveDetailId;
@ApiModelProperty(value = "来源 1护理文书2 电子病历3 Pacs检查4心电图5手麻系统6 Lis检验7病案首页8长临医嘱")
private String sysflag;
@ApiModelProperty(value = "开始时间")
private Date startTime;
@ApiModelProperty(value = "结束时间")
private Date endTime;
@ApiModelProperty(value = "任务状态 0未开始1:完成2重新采集")
private String state;
@ApiModelProperty(value = "同步时间")
private Date syncTime;
@ApiModelProperty(value = "最新重新采集时间")
private Date recollectTime;
@ApiModelProperty(value = "最新重新采集人")
private String recollectName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty("报告唯一单号")
private String c1;
}

@ -18,4 +18,10 @@ public class ReportDownDto {
private ReportDownPatientDto patient;
@ApiModelProperty(value = "分类id")
private String assortid;
@ApiModelProperty(value = "任务id")
private Long taskid;
}

@ -5,8 +5,6 @@ import lombok.Data;
@Data
public class ReportDownScanFileDto {
@ApiModelProperty(value = "分类id")
private String assortid;
@ApiModelProperty(value = "文件标题")
private String filetitle;
@ApiModelProperty(value = "采集类型(文件来源 1:采集器2扫描生产软件)")

@ -0,0 +1,21 @@
package com.docus.bgts.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.docus.bgts.entity.AfCollectTask;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-05-07
*/
public interface IAfCollectTaskService extends IService<AfCollectTask> {
/**
* id
*/
public String getpatientIdByEmpId(String empId);
}

@ -2,16 +2,20 @@ package com.docus.bgts.handler;
import com.alibaba.fastjson.JSON;
import com.docus.bgts.entity.AfCollectTask;
import com.docus.bgts.entity.ReportDownDto;
import com.docus.bgts.entity.ReportDownPatientDto;
import com.docus.bgts.entity.ReportDownScanFileDto;
import com.docus.bgts.enums.Codes;
import com.docus.bgts.facade.IAfCollectTaskService;
import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.ResultUtils;
import com.docus.bgts.utils.XmlUtils;
import org.apache.bcel.classfile.Code;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import javax.jws.WebService;
import java.io.ByteArrayInputStream;
@ -20,9 +24,11 @@ import java.util.*;
@WebService
public class TBasicWebService implements ITBasicWebService {
@Autowired
IAfCollectTaskService afCollectTaskService;
@Override
public String pushSurveyReport(String xml) {
StringBuffer mesBuffer=new StringBuffer();
try {
//解析XML
XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
@ -47,7 +53,10 @@ public class TBasicWebService implements ITBasicWebService {
String assortid=String.valueOf(FileUtils.getJsonByName("assortid"));
reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorid);
reportDownDto.setIp("string");
reportDownDto.setAssortid(assortid);
//插入文件af_collect_task表数据
Long id=insertTask(empId,collectorid);
reportDownDto.setTaskid(id);
//获取基本数据信息
List<ReportDownScanFileDto> reportDownDtoArr=new ArrayList<>();
reportDownPatientDto=new ReportDownPatientDto();
@ -62,10 +71,8 @@ public class TBasicWebService implements ITBasicWebService {
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setAssortid(assortid);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
reportDownScanFileDto.setRecordid("临时医嘱");
reportDownDtoArr.add(reportDownScanFileDto);
}
if(reportDownDtoArr.size()<=0){
@ -92,4 +99,28 @@ public class TBasicWebService implements ITBasicWebService {
return ResultUtils.fail();
}
/**
* af_collect_task
* @param jzh jzh
* @param collectorid id
*/
private Long insertTask(String jzh, String collectorid) {
AfCollectTask afCollectTask=new AfCollectTask();
String patientId = afCollectTaskService.getpatientIdByEmpId(jzh);
if(StringUtils.isBlank(patientId)){
throw new RuntimeException("操作的病案信息不存在");
}
Date date = new Date();
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(collectorid);
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(jzh);
boolean save = afCollectTaskService.save(afCollectTask);
if(!save){
throw new RuntimeException("插入病案任务表数据出错");
}
return afCollectTask.getId();
}
}

@ -0,0 +1,23 @@
package com.docus.bgts.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.AfCollectTask;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper
* </p>
*
* @author
* @since 2021-05-07
*/
public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
/**
* id
* @param empId
* @return
*/
String getpatientIdByEmpId(@Param("jzh") String empId);
}

@ -0,0 +1,30 @@
package com.docus.bgts.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.bgts.entity.AfCollectTask;
import com.docus.bgts.facade.IAfCollectTaskService;
import com.docus.bgts.mapper.AfCollectTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
*
* </p>
*
* @author
* @since 2021-05-07
*/
@Service
public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, AfCollectTask> implements IAfCollectTaskService {
@Autowired
AfCollectTaskMapper afCollectTaskMapper;
@Override
public String getpatientIdByEmpId(String empId) {
String patientId=afCollectTaskMapper.getpatientIdByEmpId(empId);
return patientId;
}
}

@ -11,9 +11,13 @@ mybatis-plus:
field-strategy: NOT_EMPTY
db-type: MYSQL
system:
code: "201_P_WS_JYBGTS"
prop: 9202
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: docus
password: docus702
url: jdbc:mysql://db.docus.cn:3306/docus_medicalrecord?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
url: jdbc:mysql://db.docus.cn:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true

@ -0,0 +1,11 @@
<?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.bgts.mapper.AfCollectTaskMapper">
<select id="getpatientIdByEmpId" resultType="string">
select patient_id
from docus_medicalrecord.t_basic
where jzh=#{jzh}
</select>
</mapper>
Loading…
Cancel
Save