Compare commits

..

3 Commits

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docus-report-manager</artifactId>
<artifactId>docus-report-unblocking</artifactId>
<dependencies>
<dependency>

@ -1,12 +1,11 @@
package com.docus.server;
import com.docus.server.reportmanager.webservice.ReportManagerService;
import com.docus.server.reportmanager.service.ReportSealedService;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
@ -18,8 +17,8 @@ import javax.xml.ws.Endpoint;
@Configuration
public class CxfConfig {
@Autowired
@Qualifier("YdZyyReportManagerService")
private ReportManagerService reportManagerService;
@Qualifier("SzyReportSealedService")
private ReportSealedService reportSealedService;
/**
* ServletbeanNamedispatcherServlet
@ -40,7 +39,7 @@ public class CxfConfig {
@Bean
@Qualifier("reportEndPoint")
public Endpoint reportEndPoint() {
EndpointImpl endpoint = new EndpointImpl(springBus(), reportManagerService);
EndpointImpl endpoint = new EndpointImpl(springBus(), reportSealedService);
endpoint.publish("/report");
return endpoint;
}

@ -1,20 +0,0 @@
package com.docus.server.reportmanager.dto;
import lombok.Data;
/**
* @author YongBin Wen
* @date 2024/3/19 14:00
*/
@Data
public class BasicQrDto {
private String inpatientNo;
private Integer admissTimes;
private String admissDateBegin;
private String admissDateEnd;
private String disDateBegin;
private String disDateEnd;
private String name;
private String idCard;
private String jzh;
}

@ -8,10 +8,6 @@ import java.util.Date;
public class AfCollectTask {
private Long id;
private String patientId;
/**
*id
*
*/
private Long afArchiveDetailId;
private String sysflag;
private Date startTime;
@ -29,15 +25,7 @@ public class AfCollectTask {
private String C4;
private String C5;
private String C6;
/**
*
* id
*/
private String C7;
/**
*
*
*/
private String C8;
private String C9;
private String C10;

@ -1,19 +0,0 @@
package com.docus.server.reportmanager.entity;
import lombok.Data;
import java.util.Date;
/**
* @author YongBin Wen
* @date 2024/3/20 9:38
*/
@Data
public class AfReportDeleteLog {
private Long id;
private String patientId;
private String deleteContent;
private String type;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,58 @@
package com.docus.server.reportmanager.entity;
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 jiashi
* @since 2023-05-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TSeal对象", description="在院封存")
public class TSeal implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "在院封存病案主键")
private String patientId;
@ApiModelProperty(value = "封存id")
private String sealId;
@ApiModelProperty(value = "住院号")
private String inpatientNo;
@ApiModelProperty(value = "住院就诊号")
private String jzh;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "住院时间")
private Date admissDate;
@ApiModelProperty(value = "封存时间")
private Date sealDate;
@ApiModelProperty(value = "文件来源")
private Integer fileSource;
@ApiModelProperty(value = "就诊次数")
private Integer admissTimes;
@ApiModelProperty(value = "纸质是否签名 0否 1是")
private Integer signinfo;
@ApiModelProperty(value = "备注")
private String remark;
}

@ -31,12 +31,4 @@ public interface CollectTaskMapper {
* @author YongBin Wen
*/
int cancel(@Param("ids") List<Long> ids);
int del(@Param("ids") List<Long> ids);
String getCollectionState();
void updateTaskForRecollect(@Param("taskIds") List<Long> taskIds, @Param("operator") String operator,@Param("state") String state);
int moveCancel(@Param("ids") List<Long> ids);
}

@ -1,7 +1,6 @@
package com.docus.server.reportmanager.mapper;
import com.docus.server.reportmanager.entity.AfReportDeleteLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -33,9 +32,12 @@ public interface ScanAssortMapper {
*/
List<Long> getIdByPatientTask(@Param("patientId") String patientId, @Param("taskId") Long taskId);
int updateDleteLog(@Param("delLog") AfReportDeleteLog deleteLog);
int insertDeleteLog(@Param("delLog") AfReportDeleteLog reportDeleteLog);
int cancelBySerialNum(@Param("serials") List<String> serialNum,@Param("patientId")String patientId,@Param("source")String source);
/**
*
* @date 2024/1/10 11:25
* @author YongBin Wen
* @param patientId
* @return int
*/
int unblocking(@Param("patientId")String patientId);
}

@ -0,0 +1,14 @@
package com.docus.server.reportmanager.mapper;
import com.docus.server.reportmanager.entity.TSeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author wyb
*/
@Mapper
public interface TSealMapper {
TSeal findByCondition(@Param("condition") TSeal condition);
}

@ -1,16 +0,0 @@
package com.docus.server.reportmanager.mapper;
import com.docus.server.reportmanager.dto.BasicQrDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author YongBin Wen
* @date 2024/3/19 13:57
*/
@Mapper
public interface TbasicMapper {
List<String> getPatientIds(@Param("qrDto") BasicQrDto basicQrDto,@Param("offset") int offset,@Param("size") int size);
}

@ -1,4 +1,4 @@
package com.docus.server.reportmanager.webservice;
package com.docus.server.reportmanager.service;
import javax.jws.WebService;

@ -0,0 +1,21 @@
package com.docus.server.reportmanager.service;
import javax.jws.WebService;
/**
*
*
* @author YongBin Wen
* @date 2024/1/3 16:11
*/
@WebService
public interface ReportSealedService {
/**
*
*
* @param message
* @return
*/
String Q_WS_JFHZBL(String message);
}

@ -1,4 +1,4 @@
package com.docus.server.reportmanager.webservice;
package com.docus.server.reportmanager.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
@ -6,6 +6,7 @@ import com.docus.infrastructure.core.utils.SpringUtil;
import com.docus.server.reportmanager.entity.AfCollectTask;
import com.docus.server.reportmanager.mapper.CollectTaskMapper;
import com.docus.server.reportmanager.mapper.ScanAssortMapper;
import com.docus.server.reportmanager.service.ReportManagerService;
import com.docus.server.reportmanager.util.XmlUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -63,7 +64,7 @@ public class SzyReportManagerServiceImpl implements ReportManagerService {
task.setSysflag(sysFlag);
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
throw new BaseException("无纸化系统没有可作废的电生理报告任务:" + reportNo);
throw new BaseException("无纸化系统没有可作废的电生理报告:" + reportNo);
}
ArrayList<Long> taskIds = new ArrayList<>();
ArrayList<Long> scanAssortIds = new ArrayList<>();
@ -79,12 +80,8 @@ public class SzyReportManagerServiceImpl implements ReportManagerService {
@Transactional(rollbackFor = Exception.class)
public void cancelReportTaskAndFile(List<Long> taskIds, List<Long> scanAssortIds) {
if (Func.isNotEmpty(taskIds)) {
collectTaskMapper.cancel(taskIds);
}
if (Func.isNotEmpty(scanAssortIds)) {
scanAssortMapper.cancel(scanAssortIds);
}
collectTaskMapper.cancel(taskIds);
scanAssortMapper.cancel(scanAssortIds);
}
private String error(String msg) {

@ -0,0 +1,81 @@
package com.docus.server.reportmanager.service.impl;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.reportmanager.entity.TSeal;
import com.docus.server.reportmanager.mapper.ScanAssortMapper;
import com.docus.server.reportmanager.mapper.TSealMapper;
import com.docus.server.reportmanager.service.ReportSealedService;
import com.docus.server.reportmanager.util.XmlUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.w3c.dom.Node;
import javax.annotation.Resource;
import java.util.Objects;
/**
* 广
*
* @author YongBin Wen
* @date 2024/1/3 16:11
*/
@Service("SzyReportSealedService")
@Slf4j
public class SzyReportSealedServiceImpl implements ReportSealedService {
@Resource
private ScanAssortMapper scanAssortMapper;
@Resource
private TSealMapper sealMapper;
@Override
public String Q_WS_JFHZBL(String message) {
log.info("广东省中医报告解封,收到解封患者病历的信息:{}", message);
try {
XmlUtil xmlUtil = XmlUtil.of(message);
// 住院流水号
Node jzhNode = xmlUtil.getNode("/Request/INHOSP_NO");
String jzh = jzhNode.getTextContent();
// 封存id
Node sealIdNode = xmlUtil.getNode("/Request/SEAL_ID");
String sealId = sealIdNode.getTextContent();
TSeal condition = new TSeal();
condition.setJzh(jzh);
condition.setSealId(sealId);
TSeal seal = sealMapper.findByCondition(condition);
if (Objects.isNull(seal)) {
log.error("不存在封存患者信息");
return error("不存在封存患者信息");
}
scanAssortMapper.unblocking(seal.getPatientId());
return success();
} catch (BaseException baseException) {
log.error(baseException.getMessage(), baseException);
return error(baseException.getMessage());
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
return error("系统内部错误,请联系开发人员");
}
}
private String error(String msg) {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>1</RetCode>\n" +
" <RetCon>" + msg + "</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
private String success() {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>0</RetCode>\n" +
" <RetCon>成功</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
}

@ -1,457 +0,0 @@
package com.docus.server.reportmanager.webservice;
import cn.hutool.core.util.StrUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.core.utils.SpringUtil;
import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.reportmanager.dto.BasicQrDto;
import com.docus.server.reportmanager.entity.AfCollectTask;
import com.docus.server.reportmanager.entity.AfReportDeleteLog;
import com.docus.server.reportmanager.mapper.CollectTaskMapper;
import com.docus.server.reportmanager.mapper.ScanAssortMapper;
import com.docus.server.reportmanager.mapper.TbasicMapper;
import com.docus.server.reportmanager.util.XmlUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.w3c.dom.Node;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
*
*
* @author YongBin Wen
* @date 2024/1/3 16:11
*/
@Service("YdZyyReportManagerService")
@Slf4j
public class YingDeZyyReportManagerServiceImpl implements ReportManagerService {
private final static String operator = "yingde-ws-delete";
@Resource
private CollectTaskMapper collectTaskMapper;
@Resource
private ScanAssortMapper scanAssortMapper;
@Resource
private IdService idService;
@Resource
private TbasicMapper tbasicMapper;
@Override
public String DeleteReport(String message) {
log.info("英德中医报告管理,收到作废报告的信息:{}", message);
try {
AfReportDeleteLog deleteLog = insertDeleteLog(message);
String inpatientNo = null;
Integer admissTimes = null;
String admissDateBegin = null;
String admissDateEnd = null;
String disDateBegin = null;
String disDateEnd = null;
String name = null;
String idCard = null;
String jzh = null;
XmlUtil xmlUtil = XmlUtil.of(message);
Node inpatientNoNode = xmlUtil.getNode("/Request/Msg/INPATIENT_NO");
if (Func.isNotEmpty(inpatientNoNode)) {
inpatientNo = inpatientNoNode.getTextContent();
}
Node admissionsNode = xmlUtil.getNode("/Request/Msg/ADMISSIONS");
if (Func.isNotEmpty(admissionsNode)) {
String admissions = admissionsNode.getTextContent();
if (Func.isNotBlank(admissions)) {
admissTimes = Integer.parseInt(admissions);
}
}
Node admissionDateNode = xmlUtil.getNode("/Request/Msg/ADMISSION_DATE");
if (Func.isNotEmpty(admissionDateNode)) {
String admissDate = admissionDateNode.getTextContent();
if (Func.isNotBlank(admissDate)) {
Date parseAdmissDate = Func.parseDate(admissDate, "yyyy-MM-dd HH:mm:ss");
String formatAdmissDate = Func.formatDate(parseAdmissDate);
admissDateBegin = formatAdmissDate + " 00:00:00";
admissDateEnd = formatAdmissDate + " 23:59:59";
}
}
// Node disDateNode = xmlUtil.getNode("/Request/Msg/DIS_DATE");
// if (Func.isNotEmpty(disDateNode)) {
// String disDate = disDateNode.getTextContent();
// if (Func.isNotBlank(disDate)) {
// Date parseDisDate = Func.parseDate(disDate, "yyyy-MM-dd HH:mm:ss");
// String formatDisDate = Func.formatDate(parseDisDate);
// disDateBegin = formatDisDate + " 00:00:00";
// disDateEnd = formatDisDate + " 23:59:59";
// }
// }
Node nameNode = xmlUtil.getNode("/Request/Msg/NAME");
if (Func.isNotEmpty(nameNode)) {
name = nameNode.getTextContent();
}
Node idCardNode = xmlUtil.getNode("/Request/Msg/ID_CARD");
if (Func.isNotEmpty(idCardNode)) {
idCard = idCardNode.getTextContent();
}
Node jzhNode = xmlUtil.getNode("/Request/Msg/JZH");
if (Func.isNotEmpty(jzhNode)) {
jzh = jzhNode.getTextContent();
}
BasicQrDto basicQrDto = new BasicQrDto();
basicQrDto.setInpatientNo(inpatientNo);
basicQrDto.setAdmissTimes(admissTimes);
basicQrDto.setAdmissDateBegin(admissDateBegin);
basicQrDto.setAdmissDateEnd(admissDateEnd);
basicQrDto.setDisDateBegin(disDateBegin);
basicQrDto.setDisDateEnd(disDateEnd);
basicQrDto.setName(name);
basicQrDto.setIdCard(idCard);
basicQrDto.setJzh(jzh);
String patientId = getPatientId(basicQrDto);
deleteLog.setPatientId(patientId);
scanAssortMapper.updateDleteLog(deleteLog);
cancelReport(patientId, xmlUtil);
return success();
} catch (BaseException baseException) {
log.error(baseException.getMessage(), baseException);
return error(baseException.getMessage());
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
return error("系统内部错误,请联系开发人员");
}
}
private void cancelReport(String patientId, XmlUtil xmlUtil) {
String reportNo = null;
String bcjlType = null;
String bcjlDelete = null;
String reportName = null;
String reportSource = null;
Node reportNoNode = xmlUtil.getNode("/Request/Msg/REPORT_NO");
if (Func.isNotEmpty(reportNoNode)) {
reportNo = reportNoNode.getTextContent();
}
// 当报告是病程记录或者术后病程记录时,此字段为必传 1、病程记录2、术后病程记录
Node bcjlTypeNode = xmlUtil.getNode("/Request/Msg/BCJL_TYPE");
if (Func.isNotEmpty(bcjlTypeNode)) {
bcjlType = bcjlTypeNode.getTextContent();
}
Node bcjlDeleteNode = xmlUtil.getNode("/Request/Msg/BCJL_DELETE");
if (Func.isNotEmpty(bcjlDeleteNode)) {
bcjlDelete = bcjlDeleteNode.getTextContent();
}
Node reportNameNode = xmlUtil.getNode("/Request/Msg/CATALOG_NAME");
if (Func.isNotEmpty(reportNameNode)) {
reportName = reportNameNode.getTextContent();
}
// 报告来源类型,为空默认电子病历
Node reportSourceNode = xmlUtil.getNode("/Request/Msg/REPORT_SOURCE");
if (Func.isNotEmpty(reportSourceNode)) {
reportSource = reportSourceNode.getTextContent();
}
if (Objects.isNull(reportNo) || Func.isBlank(reportNo)) {
throw new BaseException("病历报告号不能为空!");
}
if (Objects.isNull(reportName) || Func.isBlank(reportName)) {
throw new BaseException("病历报告名称不能为空!");
}
// 电子病历
if (Func.isBlank(reportSource) || isEmrSource(reportSource)) {
// 病程记录和术后病程记录
final String bcjl = "1";
final String shubcjl = "2";
// 病程记录
if (bcjl.equals(bcjlType)) {
cancelBcjlEMRReport(patientId,bcjlDelete);
return;
}
// 术后病程记录
if (shubcjl.equals(bcjlType)) {
cancelShuBcjlEMRReport(patientId,bcjlDelete);
return;
}
// 体温单
if (isTiWenDan(reportName)) {
cancelTiWenDanEMRReport(patientId, reportName);
return;
}
// 医嘱
if (isYiZhu(reportName)) {
cancelYiZhuEMRReport(patientId, reportName);
return;
}
// 会诊申请
if (isHuiZhen(reportName)) {
cancelHuiZhenEMRReport(patientId, reportName);
return;
}
// 普通的电子病历
cancelNormalEMRReport(patientId, reportNo);
return;
}
// 其他来源类型
if (isOtherSource(reportSource)) {
log.warn("该来源:{} 未实现功能!", reportSource);
}
}
private void cancelNormalEMRReport(String patientId, String reportNo) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC7(reportNo);
task.setSysflag("2");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> fileIds = tasks.stream().map(AfCollectTask::getAfArchiveDetailId).collect(Collectors.toList());
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
scanAssortMapper.cancel(fileIds);
// 任务移动作废表,删除任务
moveTaskAndDel(taskIds);
}
private void cancelHuiZhenEMRReport(String patientId, String reportName) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC6(reportName);
task.setSysflag("12");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
List<String> serialNum = tasks.stream().map(t -> patientId + t.getC6()).collect(Collectors.toList());
scanAssortMapper.cancelBySerialNum(serialNum, patientId, "-2");
collectTaskMapper.cancel(taskIds);
}
private void cancelYiZhuEMRReport(String patientId, String reportName) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC6(reportName);
task.setSysflag("12");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
List<String> serialNum = tasks.stream().map(t -> patientId + t.getC6()).collect(Collectors.toList());
scanAssortMapper.cancelBySerialNum(serialNum, patientId, "-2");
collectTaskMapper.cancel(taskIds);
}
private void cancelTiWenDanEMRReport(String patientId, String reportName) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC6(reportName);
task.setSysflag("12");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
List<String> serialNum = tasks.stream().map(t -> patientId + t.getC6()).collect(Collectors.toList());
scanAssortMapper.cancelBySerialNum(serialNum, patientId, "-2");
collectTaskMapper.cancel(taskIds);
}
/**
*
*
* @param patientId
*/
private void cancelBcjlEMRReport(String patientId,String delete) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC6("病程记录");
task.setSysflag("2");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> fileIds = tasks.stream().map(AfCollectTask::getAfArchiveDetailId).collect(Collectors.toList());
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
scanAssortMapper.cancel(fileIds);
if("1".equals(delete)){
moveTaskAndDel(taskIds);
}else {
updateTaskForRecollect(taskIds);
}
}
/**
*
*
* @param patientId
*/
private void cancelShuBcjlEMRReport(String patientId,String delete) {
AfCollectTask task = new AfCollectTask();
task.setPatientId(patientId);
task.setC6("术后病程记录");
task.setSysflag("2");
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
return;
}
List<Long> fileIds = tasks.stream().map(AfCollectTask::getAfArchiveDetailId).collect(Collectors.toList());
List<Long> taskIds = tasks.stream().map(AfCollectTask::getId).collect(Collectors.toList());
scanAssortMapper.cancel(fileIds);
if("1".equals(delete)){
moveTaskAndDel(taskIds);
}else {
updateTaskForRecollect(taskIds);
}
}
/**
*
*/
private boolean isHuiZhen(String reportName) {
return reportName.contains("会诊申请");
}
/**
*
*/
private boolean isTiWenDan(String reportName) {
return reportName.contains("体温单");
}
/**
*
*/
private boolean isYiZhu(String reportName) {
return reportName.contains("长期医嘱") ||
reportName.contains("中药医嘱") ||
reportName.contains("临时医嘱");
}
private boolean isOtherSource(String reportSource) {
return true;
}
private boolean isEmrSource(String reportSource) {
return true;
}
private String getPatientId(BasicQrDto basicQrDto) {
List<String> patientIds = tbasicMapper.getPatientIds(basicQrDto, 0, 10);
if (Func.isEmpty(patientIds)) {
throw new BaseException("系统中无此患者,请确认患者信息!");
}
if (patientIds.size() > 1) {
throw new BaseException("系统中找到多条患者信息,请确认患者信息!");
}
return patientIds.get(0);
}
private AfReportDeleteLog insertDeleteLog(String message) {
Date now = new Date();
long id = idService.getDateSeq();
AfReportDeleteLog reportDeleteLog = new AfReportDeleteLog();
reportDeleteLog.setId(id);
reportDeleteLog.setPatientId("");
reportDeleteLog.setType(operator);
reportDeleteLog.setDeleteContent(message);
reportDeleteLog.setCreateTime(now);
reportDeleteLog.setUpdateTime(now);
scanAssortMapper.insertDeleteLog(reportDeleteLog);
return reportDeleteLog;
}
/**
*
*/
private void moveTaskAndDel(List<Long> taskIds) {
collectTaskMapper.moveCancel(taskIds);
collectTaskMapper.del(taskIds);
}
/**
*
*/
private void updateTaskForRecollect(List<Long> taskIds) {
String collectionState = collectTaskMapper.getCollectionState();
String state = "0";
if (StrUtil.isNotBlank(collectionState)) {
state = collectionState;
}
collectTaskMapper.updateTaskForRecollect(taskIds, operator, state);
}
/**
* id 13
*
* @param reportNo
* @date 2024/1/3 17:19
* @author YongBin Wen
*/
private void cancelReport(String reportNo) {
final String sysFlag = "13";
AfCollectTask task = new AfCollectTask();
task.setC1(reportNo);
task.setSysflag(sysFlag);
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
throw new BaseException("无纸化系统没有可作废的电生理报告任务:" + reportNo);
}
ArrayList<Long> taskIds = new ArrayList<>();
ArrayList<Long> scanAssortIds = new ArrayList<>();
for (AfCollectTask collectTask : tasks) {
taskIds.add(collectTask.getId());
List<Long> scanAssortIdsByTask = scanAssortMapper.getIdByPatientTask(collectTask.getPatientId(), collectTask.getId());
scanAssortIds.addAll(scanAssortIdsByTask);
}
YingDeZyyReportManagerServiceImpl service = SpringUtil.getBean(YingDeZyyReportManagerServiceImpl.class);
service.cancelReportTaskAndFile(taskIds, scanAssortIds);
}
@Transactional(rollbackFor = Exception.class)
public void cancelReportTaskAndFile(List<Long> taskIds, List<Long> scanAssortIds) {
if (Func.isNotEmpty(taskIds)) {
collectTaskMapper.cancel(taskIds);
}
if (Func.isNotEmpty(scanAssortIds)) {
scanAssortMapper.cancel(scanAssortIds);
}
}
private String error(String msg) {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>1</RetCode>\n" +
" <RetCon>" + msg + "</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
private String success() {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>0</RetCode>\n" +
" <RetCon>成功</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
}

@ -1,7 +1,7 @@
@echo off
set deployDir=%1\docus-report-manager
if %deployDir%=="" set deployDir=d:\webroot\docus-report-manager
set deployDir=%1\docus-report-unblocking
if %deployDir%=="" set deployDir=d:\webroot\docus-report-unblocking
set curr_file=%cd%
cd /d %deployDir%

@ -1,7 +1,7 @@
<service>
<id>docus-report-manager</id>
<name>生产-嘉时-报告管理服务</name>
<description>生产-嘉时-报告管理服务</description>
<id>docus-report-unblocking</id>
<name>生产-嘉时-报告解封</name>
<description>生产-嘉时-报告解封</description>
<startmode>Automatic</startmode>
<executable>%BASE%\start.bat</executable>
<log mode="none"></log>

@ -1,11 +1,11 @@
server:
port: 9444
port: 9445
spring:
application:
name: @artifactId@
profiles:
active: test
active: prod
datasource:
dynamic:
primary: master #设置默认的数据源默认值为master
@ -67,11 +67,11 @@ xxl:
admin:
addresses: http://job.docus.cn:8180/xxl-job-admin
executor:
appname: docus-report-manager
appname: docus-report-unblocking
address:
ip:
port: 19444
port: 19445
logretentiondays: 30
logpath: D:/xxl-job/docus-report-manager
logpath: D:/xxl-job/docus-report-unblocking

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>docus-report-manager</contextName>
<contextName>docus-report-unblocking</contextName>
<property name="log.path" value="logs/logback"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
@ -21,7 +21,7 @@
<fileNamePattern>${log.path}%d.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>500MB</maxFileSize>
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<MaxHistory>60</MaxHistory>
</rollingPolicy>

@ -3,14 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.reportmanager.mapper.CollectTaskMapper">
<insert id="moveCancel">
INSERT INTO `docus_archivefile`.`af_collect_task_cancel`
SELECT * FROM `docus_archivefile`.`af_collect_task`
WHERE `id` in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</insert>
<update id="cancel">
UPDATE `docus_archivefile`.`af_collect_task`
SET `state` = '4'
@ -19,32 +11,11 @@
#{id}
</foreach>
</update>
<update id="updateTaskForRecollect">
UPDATE `docus_archivefile`.`af_collect_task`
SET `state` = #{state},
`C9`='1',
`recollect_name`=#{operator},
`sync_time`=now(),
`recollect_time`=now()
WHERE `id` in
<foreach collection="taskIds" item="taskId" separator="," open="(" close=")">
#{taskId}
</foreach>
</update>
<delete id="del">
DELETE FROM `docus_archivefile`.`af_collect_task`
WHERE `id` in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<select id="getTasks" resultType="com.docus.server.reportmanager.entity.AfCollectTask">
SELECT
id,
patient_id as patientId,
af_archive_detail_id,
C1,C2,C4,C6,C7,C8
patient_id as patientId
FROM
`docus_archivefile`.`af_collect_task`
<where>
@ -57,28 +28,6 @@
<if test="task.C1 !=null and task.C1 != ''">
and C1=#{task.C1}
</if>
<if test="task.C2 !=null and task.C2 != ''">
and C2=#{task.C2}
</if>
<if test="task.C4 !=null and task.C4 != ''">
and C4=#{task.C4}
</if>
<if test="task.C6 !=null and task.C6 != ''">
and C6=#{task.C6}
</if>
<if test="task.C7 !=null and task.C7 != ''">
and C7=#{task.C7}
</if>
<if test="task.C8 !=null and task.C8 != ''">
and C8=#{task.C8}
</if>
</where>
</select>
<select id="getCollectionState" resultType="java.lang.String">
SELECT
collectionstate
FROM
`docus_archivefile`.`af_system_config`
LIMIT 1
</select>
</mapper>

@ -3,11 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.reportmanager.mapper.ScanAssortMapper">
<insert id="insertDeleteLog">
INSERT INTO `docus_archivefile`.`af_report_delete_log`
(`id`, `patient_id`, `delete_content`, `type`, `create_time`, `update_time`)
VALUES (#{delLog.id}, #{delLog.patientId}, #{delLog.deleteContent}, #{delLog.type}, #{delLog.createTime}, #{delLog.updateTime})
</insert>
<update id="cancel">
UPDATE `docus_archivefile`.`t_scan_assort`
@ -17,26 +12,10 @@
#{id}
</foreach>
</update>
<update id="updateDleteLog">
UPDATE `docus_archivefile`.`af_report_delete_log`
SET `patient_id` = #{delLog.patientId},
`delete_content` = #{delLog.deleteContent},
`type` = #{delLog.type},
`create_time` = #{delLog.createTime},
`update_time` = #{delLog.updateTime}
WHERE `id` = #{delLog.id}
</update>
<update id="cancelBySerialNum">
<update id="unblocking">
UPDATE `docus_archivefile`.`t_scan_assort`
SET `is_del` = 1
WHERE
patient_id=#{patientId}
AND source=#{source}
AND `file_column_1` in
<foreach collection="serials" item="serial" separator="," open="(" close=")">
#{serial}
</foreach>
SET `sealed` = 0
WHERE `patient_id` = #{patientId}
</update>
<select id="getIdByPatientTask" resultType="java.lang.Long">
select id

@ -0,0 +1,27 @@
<?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.server.reportmanager.mapper.TSealMapper">
<select id="findByCondition" resultType="com.docus.server.reportmanager.entity.TSeal">
SELECT
*
FROM `docus_medicalrecord`.`t_seal`
<where>
<if test="condition.jzh != null and condition.jzh != ''">
and jzh=#{condition.jzh}
</if>
<if test="condition.sealId != null and condition.sealId != ''">
and seal_id=#{condition.sealId}
</if>
<if test="condition.patientId != null and condition.patientId != ''">
and patient_id=#{condition.patientId}
</if>
<if test="condition.name != null and condition.name != ''">
and name=#{condition.name}
</if>
</where>
</select>
</mapper>

@ -1,34 +0,0 @@
<?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.server.reportmanager.mapper.TbasicMapper">
<select id="getPatientIds" resultType="java.lang.String">
select patient_id
from docus_medicalrecord.t_basic
WHERE 1=1
<if test="qrDto.inpatientNo != null and qrDto.inpatientNo != ''">
and inpatient_no=#{qrDto.inpatientNo}
</if>
<if test="qrDto.admissTimes != null ">
and admiss_times=#{qrDto.admissTimes}
</if>
<if test="qrDto.admissDateBegin != null and qrDto.admissDateBegin != ''">
and admiss_date BETWEEN #{qrDto.admissDateBegin} and #{qrDto.admissDateEnd}
</if>
<if test="qrDto.disDateBegin != null and qrDto.disDateBegin != ''">
and dis_date BETWEEN #{qrDto.disDateBegin} and #{qrDto.disDateEnd}
</if>
<if test="qrDto.name != null and qrDto.name != ''">
and name=#{qrDto.name}
</if>
<if test="qrDto.idCard != null and qrDto.idCard != ''">
and id_card=#{qrDto.idCard}
</if>
<if test="qrDto.jzh != null and qrDto.jzh != ''">
and jzh=#{qrDto.jzh}
</if>
LIMIT ${offset},${size}
</select>
</mapper>
Loading…
Cancel
Save