修改任务查询,减字段

master
zengwh 2 years ago
parent 7cb83976d2
commit 5efba25987

36
.gitignore vendored

@ -0,0 +1,36 @@
target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
docus-services/docus-services-system1/
### IntelliJ IDEA ###
*.log
.idea
*.iws
*.iml
*.ipr
mvnw*
*.cmd
*.mvn
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
logs*
rebel.xml

@ -0,0 +1,32 @@
package com.ann.entity.interfaceEntity.dto;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* @Description
* @Date 2020/7/1 9:00
* @Created by ljx
*/
@Table
@Entity
@Data
public class InterfaceHisCacheDto {
@Id
private String id;
private String inpNo;
private String visitId;
// 医嘱类型 0代表临时医嘱 1代表长期医嘱
private String type;
private String pdfPath;
}

@ -0,0 +1,14 @@
package com.ann.repository;
import com.ann.entity.interfaceEntity.InterfaceHisCache;
import com.ann.entity.interfaceEntity.dto.InterfaceHisCacheDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface InterfaceHisCacheDtoRepository extends JpaRepository<InterfaceHisCacheDto,String> {
@Query(value = "select id,inp_no,visit_id,pdf_path,type from Interface_His_Cache where state = 0 and pdf_path is not null",nativeQuery = true)
public List<InterfaceHisCacheDto> findAllByStateAndPdfPathIsNotNullDto();
}

@ -2,13 +2,14 @@ package com.ann.service;
import com.ann.entity.interfaceEntity.InterfaceHisCache;
import com.ann.entity.interfaceEntity.dto.InterfaceHisCacheDto;
import java.util.List;
public interface InterfaceHisCacheService {
//查询所有未处理的状态
public List<InterfaceHisCache> findInterfaceHisCacheByState();
public List<InterfaceHisCacheDto> findInterfaceHisCacheByState();
//修改状态
public boolean updateState(Integer state, String id, Integer type);

@ -1,6 +1,8 @@
package com.ann.service.impl;
import com.ann.entity.interfaceEntity.InterfaceHisCache;
import com.ann.entity.interfaceEntity.dto.InterfaceHisCacheDto;
import com.ann.repository.InterfaceHisCacheDtoRepository;
import com.ann.repository.InterfaceHisCacheRepository;
import com.ann.service.InterfaceHisCacheService;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,9 +17,12 @@ public class InterfaceHisCacheServiceImpl implements InterfaceHisCacheService {
private InterfaceHisCacheRepository interfaceHisCacheRepository;
@Autowired
private InterfaceHisCacheDtoRepository interfaceHisCacheDtoRepository;
@Override
public List<InterfaceHisCache> findInterfaceHisCacheByState() {
return interfaceHisCacheRepository.findAllByStateAndPdfPathIsNotNull("0");
public List<InterfaceHisCacheDto> findInterfaceHisCacheByState() {
return interfaceHisCacheDtoRepository.findAllByStateAndPdfPathIsNotNullDto();
}
@Override

@ -9,11 +9,14 @@ import com.ann.entity.filing.dto.MessageDto;
import com.ann.entity.interfaceEntity.ArchiveMaster;
import com.ann.entity.interfaceEntity.InterfaceHisCache;
import com.ann.entity.interfaceEntity.MessageLog;
import com.ann.entity.interfaceEntity.dto.InterfaceHisCacheDto;
import com.ann.repository.InterfaceHisCacheDtoRepository;
import com.ann.service.*;
import com.ann.utils.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -34,7 +37,6 @@ public class QueueService {
@Autowired
InterfaceHisCacheService interfaceHisCacheService;
@Autowired
MessageSubordinateService messageSubordinateService;
@Autowired
@ -377,11 +379,14 @@ public class QueueService {
}
public void doSomethingByHIS() {
try {
//循环开始处理 所有未处理的
List<InterfaceHisCache> interfaceHisCaches = interfaceHisCacheService.findInterfaceHisCacheByState();
for (InterfaceHisCache interfaceHisCache: interfaceHisCaches) {
List<InterfaceHisCacheDto> interfaceHisCaches = interfaceHisCacheService.findInterfaceHisCacheByState();
for (InterfaceHisCacheDto interfaceHisCacheDto: interfaceHisCaches) {
InterfaceHisCache interfaceHisCache = new InterfaceHisCache();
BeanUtils.copyProperties(interfaceHisCacheDto,interfaceHisCache);
String type = null,remark = null,title = null,pdfPath = null,state = "2";
ArchiveDetail archiveDetail = null;
try{

Loading…
Cancel
Save