初始化

master
linjj 1 year ago
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;
/**
* masterid
*/
@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,109 @@
package com.ann.demo.repository.primary;
import com.ann.demo.entity.filing.ArchiveDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* @Author: LeiJiaXin
* @Date: 2019/7/12 9:10
*/
@Transactional
@Repository
public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, String> {
@Query(value = "SELECT stuff(" +
" (SELECT ',' + CONVERT(VARCHAR,a.assort_name) " +
" FROM zd_assort a WHERE a.assort_id in ?1 " +
" and NOT EXISTS(SELECT id FROM archive_detail d WHERE a.assort_id = d.AssortID and d.MasterID = ?2 ) " +
" FOR XML PATH ('') " +
" ),1,1,'') ", nativeQuery = true)
String getTypeNotExits(List<String> type, String masterId);
@Query(value = "select * from archive_detail where MasterID = ?1 \n" +
" and Source !='电子病历系统采集服务-长临医嘱' and Source !='扫描上传' and Source !='手工上传' and flag =0 and id not in\n" +
" (select DID from archive_other_ext where MID = ?1) ",nativeQuery = true)
List<ArchiveDetail>getRepeatRecord(String mid);
@Query(value = " SELECT stuff( " +
" ( select ',' +name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e " +
" where not exists (select 1 from archive_detail a where source <> '后台' and a.apply_id = e.apply_id and a.assortid in ?1 ) " +
" and exists (select 1 from archive_master m " +
" where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id and " +
" m.ID = ?2 ) " +
" and e.report_type in ?1 " +
" and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
" group by name " +
" FOR XML PATH ('') " +
" ),1,1,'')", nativeQuery = true)
String getCheckReportNotExits( List<String> type,String masterId);
/**
*
* */
@Query(value = "SELECT stuff( " +
" ( select ',' +z.assort_name+'缺失' + cast(COUNT(report_type) as varchar)+'份' from exam_apply e , zd_assort z" +
" where z.assort_id = e.report_type and not exists (select 1 from archive_detail a where source <> '后台' and a.apply_id = e.apply_id and a.assortid in ?1 ) " +
" and exists (select 1 from archive_master m " +
" where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id and " +
" m.ID = ?2 ) " +
" and e.report_type in ?1 " +
" and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
" group by z.assort_name " +
" FOR XML PATH ('') " +
" ),1,1,'')", nativeQuery = true)
String getCheckReportNotExits1( List<String> type,String masterId);
@Query(value = "select pdf_path from archive_detail where MasterID in ( " +
"select id from Archive_Master WHERE name = '刘钰' ) and flag = 0 and AssortID in (9,113,10,54,57,59,52,30) " +
"",nativeQuery = true)
List<String> haha();
/**
*
* */
// @Query(value = " select '检验报告缺失' +cast( (select isnull((select count(e.apply_id) from exam_apply e " +
// " where e.report_type in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
// " and exists " +
// " (select 1 from archive_master m where m.inp_no = e.inp_no and m.visit_id = e.visit_id and m.patient_id = e.patient_id " +
// " and m.ID = ?2 ) ),0) " +
// " -" +
// " isnull((select COUNT(*) from exam_apply e,archive_detail d " +
// " where source <> '后台' and e.report_type in ?1 and d.AssortID = ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
// " and masterid = ?2 " +
// " and charindex( e.apply_id,d.apply_id ) > 0),0) )as varchar)+'份' ",nativeQuery = true)
// String getInspectionReportNotExits(List<String> type,String masterId);
// @Query(value = " select e.apply_id as applyId,e.name from exam_apply e,archive_detail d " +
// " where e.report_type in ?1 and d.AssortID in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
// " and masterid = ?2 and d.flag = 0 " +
// " and charindex( e.apply_id,d.apply_id ) > 0 ",nativeQuery = true)
// List<Map<Object, Object>> getInspectionApply(List<String> type,String masterId);
@Query(value = " select apply_id from archive_detail d where" +
" d.AssortID in ?1" +
" and masterid = ?2 " +
" and d.flag = 0 and source <> '后台' ",nativeQuery = true)
List<String> getInspectionApply(List<String> type,String masterId);
@Query(value = " select e.apply_id as applyId,e.name from exam_apply e " +
" where e.report_type in ?1 and e.is_valid = 0 and e.is_open_his = 'E' and e.is_open_other = 'E' " +
" and exists " +
" (select 1 from archive_master m where m.inp_no = e.inp_no and m.visit_id = e.visit_id " +
" and m.patient_id = e.patient_id " +
" and m.ID = ?2) ",nativeQuery = true)
List<Map<Object, Object>> getAllInspectionApply(List<String> type, String masterId);
}

@ -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,32 @@
spring:
datasource:
url: jdbc:sqlserver://10.36.116.108:1433;DatabaseName=emr_record
username: sa
password: AbcXyz123
# password: xjgs+docus911
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa:
hibernate:
dialect: org.hibernate.dialect.SQLServer2008Dialect
hikari:
#是否为只读数据库
read-only: false
# 等待连接池分配链接的最大时长
connection-timeout: 60000
# 一个链接idle状态最大时长
idle-timeout: 60000
validation-timeout: 3000
# 一个链接最长的生命时长,超时没有被使用则被释放掉 简易比数据库超时时长少 30s
max-lifetime: 70000
login-timeout: 5
# 连接池允许的最大连接数
maximum-pool-size: 60
# 连接池维护的最小空闲连接数
minimum-idle: 10
#完整性核查 必查项填类型id
mustCheckData: DA342ED81CEE4A8EA827424626F3F521,AFB9FBE656D7492C80AEDE6E685A851A,C70E8C427A3648B79BE80798C08F4D12,85DAE73A87D047D28C222E878C78C670,AC2C8F4A88884DC894630302C61C6A07,EABEEB5D628449A7930F4C0A9953A754,DE599D770E83479CB5126BC357D96F35
deathMustCheckData: DA342ED81CEE4A8EA827424626F3F521,AFB9FBE656D7492C80AEDE6E685A851A,C70E8C427A3648B79BE80798C08F4D12,85DAE73A87D047D28C222E878C78C670,AC2C8F4A88884DC894630302C61C6A07,EABEEB5D628449A7930F4C0A9953A754

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
<contextName>logback</contextName>
<!-- 格式化输出:%date表示日期%thread表示线程名%-5level级别从左显示5个字符宽度 %msg日志消息%n是换行符-->
<property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
<!-- 定义日志存储的路径,不要配置相对路径 D:/logs/spring-log.%d{yyyy-MM-dd}.%i.log -->
<property name="FILE_PATH" value="D:/logs/%d{yyyy-MM-dd}/WholeCheckInterface.%i.log"/>
<!-- 控制台输出日志 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<!-- 日志级别过滤INFO以下 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<!-- 按照上面配置的LOG_PATTERN来打印日志 -->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--每天生成一个日志文件保存30天的日志文件。rollingFile用来切分文件的 -->
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${FILE_PATH}</fileNamePattern>
<!-- keep 15 days' worth of history -->
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 日志文件的最大大小 -->
<maxFileSize>2MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 超出删除老文件 -->
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- project default level -->
<logger name="com.ann" level="ERROR"/>
<!-- 日志输出级别 -->
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="rollingFile"/>
</root>
</configuration>

@ -0,0 +1,9 @@
package com.ann.demo;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
}
Loading…
Cancel
Save