From 562a960261b75d70abd65aa10528f09aeece94e8 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 24 九月 2024 09:49:23 +0800
Subject: [PATCH] 代码提交
---
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java | 77 +++++++++++++++++---------------------
1 files changed, 35 insertions(+), 42 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
index 201e911..871e4d3 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -1,13 +1,5 @@
package com.smartor.service.impl;
-import java.io.FileOutputStream;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.stream.Collectors;
-
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.base.BaseException;
@@ -16,7 +8,9 @@
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.BaseTagMapper;
+import com.smartor.mapper.PatArchiveMapper;
import com.smartor.mapper.PatArchivetagMapper;
+import com.smartor.service.IPatArchiveService;
import com.smartor.service.IPatMedInhospService;
import com.smartor.service.IPatMedOuthospService;
import com.smartor.service.IPatMedPhysicalService;
@@ -24,14 +18,23 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.DataFormatter;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import com.smartor.mapper.PatArchiveMapper;
-import com.smartor.service.IPatArchiveService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
+
+import java.io.FileOutputStream;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.stream.Collectors;
/**
* 鎮h�呮。妗圫ervice涓氬姟灞傚鐞�
@@ -96,15 +99,8 @@
@Override
public Integer insertPatArchive(PatArchive patArchive) {
patArchive.setCreateTime(DateUtils.getNowDate());
- List<PatArchive> patArchives = new ArrayList<>();
- patArchives.add(patArchive);
- patArchiveMapper.insertPatArchive(patArchives);
- if (CollectionUtils.isNotEmpty(patArchives)) {
- patArchives.get(0).getId();
- log.info("鎮h�卛d涓�: {}", patArchives.get(0).getId());
- return patArchives.get(0).getId().intValue();
- }
- return null;
+ patArchiveMapper.insertPatArchiveSingle(patArchive);
+ return patArchive.getId().intValue();
}
@Override
@@ -189,39 +185,36 @@
* @return
*/
@Override
- public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq) {
- List<ServiceSubtask> serviceSubtaskList = new ArrayList<>();
+ public List<PatArchiveOthreInfo> getPatientInfo(PatArchiveReq patArchiveReq) {
+ if (CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) || patArchiveReq.getLeavehospitaldistrictcodes().size() == 0) {
+ patArchiveReq.setLeavehospitaldistrictcodes(null);
+ }
+ if (CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) || patArchiveReq.getLeaveldeptcodes().size() == 0) {
+ patArchiveReq.setLeaveldeptcodes(null);
+ }
- List<PatArchive> patArchiveList = new ArrayList<>();
+ List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>();
if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) {
// 鏌ョ湅浣忛櫌 1 鏌ョ湅闂ㄨ瘖 2 鏌ョ湅浣撴 3
- List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhosp(patArchiveReq);
+ List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhosp(patArchiveReq);
if (CollectionUtils.isNotEmpty(patArchives1)) {
patArchiveList.addAll(patArchives1);
}
} else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) {
// 鏌ョ湅浣忛櫌 1 鏌ョ湅闂ㄨ瘖 2 鏌ョ湅浣撴 3
- List<PatArchive> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchiveReq);
+ List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchiveReq);
if (CollectionUtils.isNotEmpty(patArchives2)) {
patArchiveList.addAll(patArchives2);
}
} else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) {
// 鏌ョ湅浣忛櫌 1 鏌ョ湅闂ㄨ瘖 2 鏌ョ湅浣撴 3
- List<PatArchive> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchiveReq);
+ List<PatArchiveOthreInfo> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchiveReq);
if (CollectionUtils.isNotEmpty(patArchives3)) {
patArchiveList.addAll(patArchives3);
}
}
- for (PatArchive patArchive : patArchiveList) {
- ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(patArchive, ServiceSubtask.class);
- serviceSubtask.setCreateTime(patArchive.getCreateTime());
- serviceSubtask.setCreateBy(patArchive.getCreateBy());
- serviceSubtask.setDeptname(patArchive.getDept());
- serviceSubtask.setPhone(patArchive.getTelcode());
- serviceSubtaskList.add(serviceSubtask);
- }
- return serviceSubtaskList;
+ return patArchiveList;
}
@@ -499,7 +492,7 @@
//鏍规嵁鏉′欢鑾峰彇鎮h�呬俊鎭�
// List<PatArchive> patArchiveList = patArchiveMapper.patInfoByContion(patArchive);
- List<PatArchive> patArchiveList = new ArrayList<>();
+ List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>();
if (patArchive.getEndtime() != null) {
//鍑洪櫌鏃堕棿鍙湁浣忛櫌鎵嶆湁
@@ -507,32 +500,32 @@
}
if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 0) {
- List<PatArchive> patArchives0 = patArchiveMapper.selectPatArchiveInfoByAllhosp(patArchive);
+ List<PatArchiveOthreInfo> patArchives0 = patArchiveMapper.selectPatArchiveInfoByAllhosp(patArchive);
if (CollectionUtils.isNotEmpty(patArchives0)) {
patArchiveList.addAll(patArchives0);
}
} else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 1) {
- List<PatArchive> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhosp(patArchive);
+ List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhosp(patArchive);
if (CollectionUtils.isNotEmpty(patArchives1)) {
patArchiveList.addAll(patArchives1);
}
} else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 2) {
- List<PatArchive> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchive);
+ List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchive);
if (CollectionUtils.isNotEmpty(patArchives2)) {
patArchiveList.addAll(patArchives2);
}
} else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 3) {
- List<PatArchive> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchive);
+ List<PatArchiveOthreInfo> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchive);
if (CollectionUtils.isNotEmpty(patArchives3)) {
patArchiveList.addAll(patArchives3);
}
}
//鏍规嵁鎮h�匢D杩涜鍒嗙粍
- Map<Long, List<PatArchive>> listMap = patArchiveList.stream().collect(Collectors.groupingBy(PatArchive::getId));
+ Map<Long, List<PatArchiveOthreInfo>> listMap = patArchiveList.stream().collect(Collectors.groupingBy(PatArchiveOthreInfo::getId));
//瀵规暟鎹繘琛屽皝瑁�
- for (List<PatArchive> list : listMap.values()) {
+ for (List<PatArchiveOthreInfo> list : listMap.values()) {
PatArchive patArchive1 = new PatArchive();
Set<PatArchivetag> stringList = new HashSet<>();
for (int i = 0; i < list.size(); i++) {
--
Gitblit v1.9.3