初始化
commit
b315ab9165
@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.2.1.RELEASE</version>
|
||||||
|
</parent>
|
||||||
|
<groupId>com.ann</groupId>
|
||||||
|
<artifactId>demo</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<name>demo</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--sqlserver驱动 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.microsoft.sqlserver</groupId>
|
||||||
|
<artifactId>sqljdbc4</artifactId>
|
||||||
|
<version>4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle</groupId>
|
||||||
|
<artifactId>ojdbc14</artifactId>
|
||||||
|
<version>14.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--commons-lang3-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.3.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- CXF webservice -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
|
||||||
|
<version>3.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.junit.vintage</groupId>
|
||||||
|
<artifactId>junit-vintage-engine</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<finalName>WholeCheckInterface</finalName>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.ann.demo;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class DemoApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(DemoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.ann.demo;
|
||||||
|
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
|
||||||
|
public class ServletInitializer extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
return application.sources(DemoApplication.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,100 @@
|
|||||||
|
package com.ann.demo;
|
||||||
|
|
||||||
|
import com.ann.demo.service.impl.ArchiveDetailServiceImpl;
|
||||||
|
import org.apache.cxf.endpoint.Client;
|
||||||
|
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/18 10:47
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/")
|
||||||
|
public class TestController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArchiveDetailServiceImpl archiveDetailService;
|
||||||
|
|
||||||
|
// @Autowired
|
||||||
|
// private ArchiveDetailService archiveDetailService;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// private ArchiveMasterService archiveMasterService;
|
||||||
|
//
|
||||||
|
// // pdf地址
|
||||||
|
// public static String mustCheckData;
|
||||||
|
//
|
||||||
|
// @Value("${mustCheckData}")
|
||||||
|
// public void setMustCheckData(String mustCheckData) {
|
||||||
|
// TestController.mustCheckData = mustCheckData;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static String getMustCheckData() {
|
||||||
|
// return mustCheckData;
|
||||||
|
// }
|
||||||
|
@RequestMapping("/haha1")
|
||||||
|
public String createJob1() {
|
||||||
|
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
|
||||||
|
Client client = dcf.createClient("http://localhost:57777/AppEngine3?wsdl");
|
||||||
|
Object[] objects = new Object[0];
|
||||||
|
// invoke("方法名",参数1,参数2,参数3....);
|
||||||
|
try {
|
||||||
|
objects = client.invoke("SearchFulltext", "护理");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return objects[0].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/haha")
|
||||||
|
public String createJob() {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
list.add("10");
|
||||||
|
// archiveDetailService.getInspectionReportNotExits(list,"02e4bec6-633f-49cf-9acd-a3d332376800");
|
||||||
|
|
||||||
|
return "123";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Integer result = archiveMasterService.countByIdAndIsValid(masterId);
|
||||||
|
//
|
||||||
|
// if (result == 0){
|
||||||
|
// return "没有该患者信息!";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 必须检查类型
|
||||||
|
// StringBuffer sb = new StringBuffer();
|
||||||
|
// if (mustCheckData != "") {
|
||||||
|
// String[] mustCheckDataArray = mustCheckData.split(",");
|
||||||
|
// List<String> types = Arrays.asList(mustCheckDataArray);
|
||||||
|
// String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
|
||||||
|
// if (typeIsExits != null) {
|
||||||
|
// sb.append(typeIsExits + "缺失");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 检查申请单
|
||||||
|
// String checkReportNotExits = archiveDetailService.getCheckReportNotExits(masterId);
|
||||||
|
// if(checkReportNotExits != null){
|
||||||
|
// if(sb.length() != 0){
|
||||||
|
// sb.append(",");
|
||||||
|
// }
|
||||||
|
// sb.append(checkReportNotExits);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 检验申请单
|
||||||
|
//
|
||||||
|
// //最后
|
||||||
|
// if (sb.length() == 0) {
|
||||||
|
// sb.append("完整");
|
||||||
|
// }
|
||||||
|
// return sb + "";
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
package com.ann.demo.entity.filing;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 病历文件表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author ly
|
||||||
|
* @since 2019-04-24
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
public class ArchiveDetail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pdf路径
|
||||||
|
*/
|
||||||
|
private String pdfPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* master表关联id
|
||||||
|
*/
|
||||||
|
@Column(name = "masterid")
|
||||||
|
private String masterID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抓取时间
|
||||||
|
*/
|
||||||
|
@Column(name = "uploaddatetime")
|
||||||
|
private Date upLoadDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分段id
|
||||||
|
*/
|
||||||
|
@Column(name = "assortid")
|
||||||
|
private String assortID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冗余字段
|
||||||
|
*/
|
||||||
|
@Column(name = "subassort")
|
||||||
|
private String subAssort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否显示 0显示 1不显示
|
||||||
|
*/
|
||||||
|
private String flag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统
|
||||||
|
*/
|
||||||
|
private String sys;
|
||||||
|
|
||||||
|
public ArchiveDetail(String id, String pdfPath, String masterID, Date upLoadDateTime, String assortID, String source, String subAssort, String title, String flag, String sys) {
|
||||||
|
this.id = id;
|
||||||
|
this.pdfPath = pdfPath;
|
||||||
|
this.masterID = masterID;
|
||||||
|
this.upLoadDateTime = upLoadDateTime;
|
||||||
|
this.assortID = assortID;
|
||||||
|
this.source = source;
|
||||||
|
this.subAssort = subAssort;
|
||||||
|
this.title = title;
|
||||||
|
this.flag = flag;
|
||||||
|
this.sys = sys;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArchiveDetail() {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,146 @@
|
|||||||
|
package com.ann.demo.entity.filing;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 病人基本信息表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author ly
|
||||||
|
* @since 2019-04-24
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
public class ArchiveMaster {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记帐号
|
||||||
|
*/
|
||||||
|
private String patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住院号
|
||||||
|
*/
|
||||||
|
private String inpNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住院次数
|
||||||
|
*/
|
||||||
|
private String visitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别
|
||||||
|
*/
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出院科室
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出院时间 not null '1801'开头为在院 非'1801'开头为出院
|
||||||
|
*/
|
||||||
|
private Date dischargeDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归档状态 仅质控流程使用
|
||||||
|
*/
|
||||||
|
@Column(name = "archivestate")
|
||||||
|
private String archiveState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入院时间
|
||||||
|
*/
|
||||||
|
private Date admissionDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入院科室
|
||||||
|
*/
|
||||||
|
private String deptAdmissionTo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核医生
|
||||||
|
*/
|
||||||
|
private String checkDoctor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核时间
|
||||||
|
*/
|
||||||
|
private Date checkDatetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终审医生
|
||||||
|
*/
|
||||||
|
private String checkedDoctor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终审时间
|
||||||
|
*/
|
||||||
|
private Date checkedDatetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Column(name = "lockinfo")
|
||||||
|
private String LockInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主管医生
|
||||||
|
*/
|
||||||
|
private String doctorInCharge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号
|
||||||
|
*/
|
||||||
|
private String idNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否死亡 死亡填5
|
||||||
|
*/
|
||||||
|
private String dischargeDisposition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离院方式
|
||||||
|
*/
|
||||||
|
private String deptCodeLend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退回人角色
|
||||||
|
*/
|
||||||
|
private String returntoRole;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退回人工号
|
||||||
|
*/
|
||||||
|
private String returnOperUsername;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 召回原因
|
||||||
|
*/
|
||||||
|
private String changeReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 床号
|
||||||
|
*/
|
||||||
|
private String bedId;
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.ann.demo.entity.filing;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExamApplyDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请单号
|
||||||
|
*/
|
||||||
|
private String applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.ann.demo.interfaces;
|
||||||
|
|
||||||
|
import javax.jws.WebMethod;
|
||||||
|
import javax.jws.WebParam;
|
||||||
|
import javax.jws.WebService;
|
||||||
|
|
||||||
|
@WebService
|
||||||
|
public interface HomepageDictionary {
|
||||||
|
|
||||||
|
@WebMethod
|
||||||
|
String CheckData(@WebParam(name = "masterId") String masterId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.ann.demo.interfaces.config;
|
||||||
|
|
||||||
|
import com.ann.demo.interfaces.HomepageDictionary;
|
||||||
|
import com.ann.demo.interfaces.impl.HomepageDictionaryImpl;
|
||||||
|
import org.apache.cxf.Bus;
|
||||||
|
import org.apache.cxf.bus.spring.SpringBus;
|
||||||
|
import org.apache.cxf.jaxws.EndpointImpl;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.xml.ws.Endpoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/6/11 17:13
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebServiceConfig {
|
||||||
|
|
||||||
|
/*//默认servlet路径/*,如果覆写则按照自己定义的来
|
||||||
|
@Bean
|
||||||
|
public ServletRegistrationBean dispatcherServlet() {
|
||||||
|
return new ServletRegistrationBean(new CXFServlet(), "/services/*");
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Bean(name = Bus.DEFAULT_BUS_ID)
|
||||||
|
public SpringBus springBus() {
|
||||||
|
return new SpringBus();
|
||||||
|
}
|
||||||
|
|
||||||
|
//把实现类交给spring管理
|
||||||
|
@Bean
|
||||||
|
public HomepageDictionary homepageDictionary() {
|
||||||
|
return new HomepageDictionaryImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Endpoint endpoint(){
|
||||||
|
System.out.println("-----------------------已发布-------------------------");
|
||||||
|
EndpointImpl endpoint = new EndpointImpl(springBus(),homepageDictionary());
|
||||||
|
endpoint.publish("HomepageDictionary");
|
||||||
|
return endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
package com.ann.demo.interfaces.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ann.demo.entity.filing.ArchiveMaster;
|
||||||
|
import com.ann.demo.interfaces.HomepageDictionary;
|
||||||
|
import com.ann.demo.service.ArchiveDetailService;
|
||||||
|
import com.ann.demo.service.ArchiveMasterService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
|
import javax.jws.WebService;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/6/11 17:01
|
||||||
|
*/
|
||||||
|
|
||||||
|
@WebService(serviceName = "HomepageDictionary", // 与接口中指定的name一致
|
||||||
|
targetNamespace = "http://interfaces.demo.ann.com/", // 与接口中的命名空间一致,一般是接口的包名倒
|
||||||
|
endpointInterface = "com.ann.demo.interfaces.HomepageDictionary"// 接口地址
|
||||||
|
)
|
||||||
|
public class HomepageDictionaryImpl implements HomepageDictionary {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(HomepageDictionaryImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArchiveDetailService archiveDetailService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArchiveMasterService archiveMasterService;
|
||||||
|
|
||||||
|
public static String mustCheckData;
|
||||||
|
|
||||||
|
@Value("${mustCheckData}")
|
||||||
|
public void setMustCheckData(String mustCheckData) {
|
||||||
|
HomepageDictionaryImpl.mustCheckData = mustCheckData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String deathMustCheckData;
|
||||||
|
|
||||||
|
@Value("${deathMustCheckData}")
|
||||||
|
public void setBabyMustCheckData(String deathMustCheckData) {
|
||||||
|
HomepageDictionaryImpl.deathMustCheckData = deathMustCheckData;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String CheckData(String masterId) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Optional<ArchiveMaster> archiveMaster = archiveMasterService.findById(masterId);
|
||||||
|
if (!archiveMaster.isPresent()) {
|
||||||
|
return "没有该患者信息!";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 必须检查类型
|
||||||
|
sb = new StringBuffer();
|
||||||
|
//判断是否是死亡病例
|
||||||
|
if(StringUtils.isNoneBlank(archiveMaster.get().getDischargeDisposition())){
|
||||||
|
if (archiveMaster.get().getDischargeDisposition().equalsIgnoreCase("5")){
|
||||||
|
if (!deathMustCheckData.equals("")) {
|
||||||
|
String[] mustCheckDataArray = deathMustCheckData.split(",");
|
||||||
|
List<String> types = Arrays.asList(mustCheckDataArray);
|
||||||
|
String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
|
||||||
|
if (typeIsExits != null) {
|
||||||
|
sb.append(typeIsExits + "缺失");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!mustCheckData.equals("")) {
|
||||||
|
String[] mustCheckDataArray = mustCheckData.split(",");
|
||||||
|
List<String> types = Arrays.asList(mustCheckDataArray);
|
||||||
|
String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
|
||||||
|
if (typeIsExits != null) {
|
||||||
|
sb.append(typeIsExits + "缺失");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (!mustCheckData.equals("")) {
|
||||||
|
String[] mustCheckDataArray = mustCheckData.split(",");
|
||||||
|
List<String> types = Arrays.asList(mustCheckDataArray);
|
||||||
|
String typeIsExits = archiveDetailService.getTypeNotExits(types, masterId);
|
||||||
|
if (typeIsExits != null) {
|
||||||
|
sb.append(typeIsExits + "缺失");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//最后
|
||||||
|
if (sb.length() == 0) {
|
||||||
|
sb.append("完整");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
sb.setLength(0);
|
||||||
|
sb.append("服务器正忙");
|
||||||
|
logger.error("出错了:", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb + "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.ann.demo.repository.primary;
|
||||||
|
|
||||||
|
import com.ann.demo.entity.filing.ArchiveMaster;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/11 20:55
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ArchiveMasterRepository extends JpaRepository<ArchiveMaster, String> {
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.ann.demo.service;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/12 9:12
|
||||||
|
*/
|
||||||
|
public interface ArchiveDetailService {
|
||||||
|
|
||||||
|
|
||||||
|
String getTypeNotExits(List<String> type, String masterId);
|
||||||
|
|
||||||
|
String getCheckReportNotExits(List<String> type,String masterId);
|
||||||
|
|
||||||
|
// public String getInspectionReportNotExits(List<String> type,String masterId);
|
||||||
|
|
||||||
|
String getCheckReportNotExits1(List<String> types, String masterId);
|
||||||
|
|
||||||
|
String getInspectionReportNotExits1(List<String> types, String masterId);
|
||||||
|
|
||||||
|
String getRepeatRecord(String mid);
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ann.demo.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ann.demo.entity.filing.ArchiveMaster;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/12 9:12
|
||||||
|
*/
|
||||||
|
public interface ArchiveMasterService {
|
||||||
|
|
||||||
|
Optional<ArchiveMaster> findById(String masterId);
|
||||||
|
}
|
@ -0,0 +1,148 @@
|
|||||||
|
package com.ann.demo.service.impl;
|
||||||
|
|
||||||
|
import com.ann.demo.entity.filing.ArchiveDetail;
|
||||||
|
import com.ann.demo.entity.filing.ExamApplyDto;
|
||||||
|
import com.ann.demo.repository.primary.ArchiveDetailRepository;
|
||||||
|
import com.ann.demo.service.ArchiveDetailService;
|
||||||
|
import com.ann.demo.util.MapObjUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/12 9:12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ArchiveDetailServiceImpl implements ArchiveDetailService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ArchiveDetailRepository archiveDetailRepository;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTypeNotExits(List<String> type, String masterId) {
|
||||||
|
return archiveDetailRepository.getTypeNotExits(type, masterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCheckReportNotExits(List<String> type,String masterId) {
|
||||||
|
return archiveDetailRepository.getCheckReportNotExits( type,masterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getInspectionReportNotExits1(List<String> type,String masterId) {
|
||||||
|
String result = null;
|
||||||
|
// 1、查出所有的检验申请单
|
||||||
|
List<Map<Object, Object>> examAllTempList = archiveDetailRepository.getAllInspectionApply(type, masterId);
|
||||||
|
if (examAllTempList == null || examAllTempList.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//转成对应的集合
|
||||||
|
List<ExamApplyDto> examAllList = new ArrayList<ExamApplyDto>();
|
||||||
|
for (Map<Object, Object> map: examAllTempList){
|
||||||
|
ExamApplyDto messageLogDto = MapObjUtil.map2Object(map,ExamApplyDto.class);
|
||||||
|
examAllList.add(messageLogDto);
|
||||||
|
}
|
||||||
|
// 2、查出所有的detail
|
||||||
|
List<String> applyIdTempList = archiveDetailRepository.getInspectionApply(type, masterId);
|
||||||
|
// 3、进行匹配
|
||||||
|
List<ExamApplyDto> resultList = new ArrayList<ExamApplyDto>(examAllList);
|
||||||
|
for (ExamApplyDto examApplyDto:examAllList) {
|
||||||
|
for (String applyId: applyIdTempList){
|
||||||
|
Pattern pattern = Pattern.compile(examApplyDto.getApplyId());
|
||||||
|
Matcher matcher = pattern.matcher(applyId);
|
||||||
|
if(matcher.find()){
|
||||||
|
resultList.remove(examApplyDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 4、统计集合里元素相同的名称及数量
|
||||||
|
Map<String, Integer> map = new HashMap<String, Integer>();
|
||||||
|
for(ExamApplyDto examApplyDto:
|
||||||
|
resultList){
|
||||||
|
String name = examApplyDto.getName() ==null ? "检验报告":examApplyDto.getName();
|
||||||
|
if(map.containsKey(name)){
|
||||||
|
map.put(name, map.get(name).intValue() + 1);
|
||||||
|
}else{
|
||||||
|
map.put(name, new Integer(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 5、开始拼装
|
||||||
|
Iterator<String> keys = map.keySet().iterator();
|
||||||
|
StringBuffer sb=new StringBuffer();
|
||||||
|
while(keys.hasNext()){
|
||||||
|
String key = keys.next();
|
||||||
|
int i = map.get(key).intValue();
|
||||||
|
sb.append(key + "缺失" + map.get(key).intValue() + "份, ");
|
||||||
|
}
|
||||||
|
if(sb.length() > 0){
|
||||||
|
result = sb.substring(0,sb.length()-2);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRepeatRecord(String mid) {
|
||||||
|
String result = null;
|
||||||
|
List<ArchiveDetail> repeatRecord = archiveDetailRepository.getRepeatRecord(mid);
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
repeatRecord.forEach(item ->{
|
||||||
|
String name = item.getTitle();
|
||||||
|
if(map.containsKey(name)){
|
||||||
|
map.put(name,map.get(name).intValue()+1);
|
||||||
|
}else{
|
||||||
|
map.put(name,new Integer(1));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Iterator<String> keys = map.keySet().iterator();
|
||||||
|
StringBuffer sb=new StringBuffer();
|
||||||
|
while(keys.hasNext()){
|
||||||
|
String key = keys.next();
|
||||||
|
sb.append(key + "重复" + map.get(key).intValue() + "份, ");
|
||||||
|
}
|
||||||
|
if(sb.length() > 0){
|
||||||
|
result = sb.substring(0,sb.length()-2);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public String getInspectionReportNotExits(List<String> type,String masterId) {
|
||||||
|
// return archiveDetailRepository.getInspectionReportNotExits( type,masterId);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCheckReportNotExits1(List<String> types, String masterId) {
|
||||||
|
return archiveDetailRepository.getCheckReportNotExits1( types,masterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// List<Map<Object, Object>> examAndDetailTempList = archiveDetailRepository.getInspectionApply(type, masterId);
|
||||||
|
// if (examAndDetailTempList == null || examAndDetailTempList.isEmpty()){
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// //转换成对应的集合
|
||||||
|
// List<ExamApplyDto> examAndDetailList = new ArrayList<ExamApplyDto>();
|
||||||
|
// for (Map<Object, Object> map: examAndDetailTempList){
|
||||||
|
// ExamApplyDto examApplyDto = MapObjUtil.map2Object(map,ExamApplyDto.class);
|
||||||
|
// examAndDetailList.add(examApplyDto);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // 3、取出两个集合的交集
|
||||||
|
// for (ExamApplyDto examApplyDto : examAndDetailList) {
|
||||||
|
// if (examAllList.contains(examApplyDto)) {
|
||||||
|
// examAllList.remove(examApplyDto);
|
||||||
|
// }
|
||||||
|
// }
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.ann.demo.service.impl;
|
||||||
|
|
||||||
|
import com.ann.demo.entity.filing.ArchiveMaster;
|
||||||
|
import com.ann.demo.repository.primary.ArchiveMasterRepository;
|
||||||
|
import com.ann.demo.service.ArchiveMasterService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LeiJiaXin
|
||||||
|
* @Date: 2019/7/12 9:12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ArchiveMasterServiceImpl implements ArchiveMasterService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ArchiveMasterRepository archiveMasterRepository;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<ArchiveMaster> findById(String masterId) {
|
||||||
|
return archiveMasterRepository.findById(masterId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.ann.demo.util;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class MapObjUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体对象转成Map
|
||||||
|
*
|
||||||
|
* @param obj 实体对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> object2Map(Object obj) {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
if (obj == null) {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
Class clazz = obj.getClass();
|
||||||
|
Field[] fields = clazz.getDeclaredFields();
|
||||||
|
try {
|
||||||
|
for (Field field : fields) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
map.put(field.getName(), field.get(obj));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map转成实体对象
|
||||||
|
*
|
||||||
|
* @param map map实体对象包含属性
|
||||||
|
* @param clazz 实体对象类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T map2Object(Map<Object, Object> map, Class<T> clazz) {
|
||||||
|
if (map == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
T obj = null;
|
||||||
|
try {
|
||||||
|
obj = clazz.newInstance();
|
||||||
|
Field[] fields = obj.getClass().getDeclaredFields();
|
||||||
|
for (Field field : fields) {
|
||||||
|
int mod = field.getModifiers();
|
||||||
|
if (Modifier.isStatic(mod) || Modifier.isFinal(mod)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
field.setAccessible(true);
|
||||||
|
String filedTypeName = field.getType().getName();
|
||||||
|
if (filedTypeName.equalsIgnoreCase("java.util.date")) {
|
||||||
|
String datetimestamp = String.valueOf(map.get(field.getName()));
|
||||||
|
if (datetimestamp.equalsIgnoreCase("null")) {
|
||||||
|
field.set(obj, null);
|
||||||
|
} else {
|
||||||
|
field.set(obj, new Date(Long.parseLong(datetimestamp)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
field.set(obj, map.get(field.getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.ann.demo;
|
||||||
|
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class DemoApplicationTests {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue