diff --git a/docus-ws-bgts/dataConfig/homeQualitySet.json b/docus-ws-bgts/dataConfig/homeQualitySet.json index d1de953..5a7170b 100644 --- a/docus-ws-bgts/dataConfig/homeQualitySet.json +++ b/docus-ws-bgts/dataConfig/homeQualitySet.json @@ -22,6 +22,6 @@ //基本数据存放处,根节点不填,最后一层为基本信息存放标签 "basicDirectory":["Msg","PatInfo"], //可能存在存储基本数据不同情况的标签 - "doubleBasic":["TestItemInfo","BioTestInfo"], + "doubleBasic":["TestItemInfo","BioTestInfo"] } \ No newline at end of file diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/DemoApplication.java b/docus-ws-bgts/src/main/java/com/docus/bgts/DemoApplication.java index 8d488e8..14f8d6e 100644 --- a/docus-ws-bgts/src/main/java/com/docus/bgts/DemoApplication.java +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/DemoApplication.java @@ -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); } diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/config/WebServiceConfig.java b/docus-ws-bgts/src/main/java/com/docus/bgts/config/WebServiceConfig.java index 2f803db..1e20d02 100644 --- a/docus-ws-bgts/src/main/java/com/docus/bgts/config/WebServiceConfig.java +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/config/WebServiceConfig.java @@ -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; diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/entity/AfCollectTask.java b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/AfCollectTask.java new file mode 100644 index 0000000..b9245e7 --- /dev/null +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/AfCollectTask.java @@ -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; + +/** + *

+ * 病案采集任务 + *

+ * + * @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; +} diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownDto.java b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownDto.java index 7b1ea47..01a45b2 100644 --- a/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownDto.java +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownDto.java @@ -18,4 +18,10 @@ public class ReportDownDto { private ReportDownPatientDto patient; + @ApiModelProperty(value = "分类id") + private String assortid; + + @ApiModelProperty(value = "任务id") + private Long taskid; + } diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java index c45f597..8ec9e2e 100644 --- a/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java @@ -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:扫描生产软件)") diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java b/docus-ws-bgts/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java new file mode 100644 index 0000000..e464e4e --- /dev/null +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java @@ -0,0 +1,21 @@ +package com.docus.bgts.facade; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.docus.bgts.entity.AfCollectTask; + +/** + *

+ * 病案采集任务 服务类 + *

+ * + * @author 曾文和 + * @since 2021-05-07 + */ +public interface IAfCollectTaskService extends IService { + /** + * 获取病案id通过报告唯一单号 + */ + public String getpatientIdByEmpId(String empId); + +} diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/handler/TBasicWebService.java b/docus-ws-bgts/src/main/java/com/docus/bgts/handler/TBasicWebService.java index ebf58e9..4f1ea80 100644 --- a/docus-ws-bgts/src/main/java/com/docus/bgts/handler/TBasicWebService.java +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/handler/TBasicWebService.java @@ -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 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(); + } } diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/mapper/AfCollectTaskMapper.java b/docus-ws-bgts/src/main/java/com/docus/bgts/mapper/AfCollectTaskMapper.java new file mode 100644 index 0000000..27f9246 --- /dev/null +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/mapper/AfCollectTaskMapper.java @@ -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; + +/** + *

+ * 病案采集任务 Mapper 接口 + *

+ * + * @author 曾文和 + * @since 2021-05-07 + */ +public interface AfCollectTaskMapper extends BaseMapper { + /** + * 获取病案id通过报告唯一单号 + * @param empId + * @return + */ + String getpatientIdByEmpId(@Param("jzh") String empId); +} diff --git a/docus-ws-bgts/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java b/docus-ws-bgts/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java new file mode 100644 index 0000000..ea573e9 --- /dev/null +++ b/docus-ws-bgts/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java @@ -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; + +/** + *

+ * 病案采集任务 服务实现类 + *

+ * + * @author 曾文和 + * @since 2021-05-07 + */ +@Service +public class AfCollectTaskServiceImpl extends ServiceImpl implements IAfCollectTaskService { + + @Autowired + AfCollectTaskMapper afCollectTaskMapper; + + @Override + public String getpatientIdByEmpId(String empId) { + String patientId=afCollectTaskMapper.getpatientIdByEmpId(empId); + return patientId; + } +} diff --git a/docus-ws-bgts/src/main/resources/application.yml b/docus-ws-bgts/src/main/resources/application.yml index 24ba993..092b217 100644 --- a/docus-ws-bgts/src/main/resources/application.yml +++ b/docus-ws-bgts/src/main/resources/application.yml @@ -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 \ No newline at end of file + url: jdbc:mysql://db.docus.cn:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true \ No newline at end of file diff --git a/docus-ws-bgts/src/main/resources/mapper/AfCollectTaskMapper.xml b/docus-ws-bgts/src/main/resources/mapper/AfCollectTaskMapper.xml new file mode 100644 index 0000000..3242789 --- /dev/null +++ b/docus-ws-bgts/src/main/resources/mapper/AfCollectTaskMapper.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file