|
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.dto.CheckWorkDTO;
|
|
|
import com.diagbot.dto.MedicalRecordDTO;
|
|
|
-import com.diagbot.entity.*;
|
|
|
+import com.diagbot.entity.MedBehospitalType;
|
|
|
+import com.diagbot.entity.MedCheckInfo;
|
|
|
+import com.diagbot.entity.SysTaskCron;
|
|
|
+import com.diagbot.entity.SysUser;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -16,12 +19,18 @@ import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
-import com.diagbot.vo.*;
|
|
|
+import com.diagbot.vo.CheckWorkPageVO;
|
|
|
+import com.diagbot.vo.MedCheckWorkAddVO;
|
|
|
+import com.diagbot.vo.RecordTypeVO;
|
|
|
+import com.diagbot.vo.SysUserBaseVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -83,8 +92,7 @@ public class MedCheckWorkFacade {
|
|
|
}
|
|
|
|
|
|
int i = medCheckInfoFacade.getBaseMapper().deleteBatchCodes(medCheckWorkVO.getBehospitalCodeList());
|
|
|
- if(i!=0)
|
|
|
- {
|
|
|
+ if (i != 0) {
|
|
|
return true;
|
|
|
}
|
|
|
} else if (checkStatus != null && checkStatus == 1) {
|
|
@@ -149,7 +157,7 @@ public class MedCheckWorkFacade {
|
|
|
recordContentVO.setIsPlacefile(1l);//获取已归档的患者
|
|
|
recordContentVO.setStartTime(DateUtil.formatDateTime(DateUtil.addMinutes(DateUtil.now(), -30)));
|
|
|
recordContentVO.setEndTime(DateUtil.formatDateTime(DateUtil.now()));
|
|
|
- putBehospitalTypeMap(medBehospitalTypeMap,recordContentVO,typeValue,typeName,hospiatlId,searchSize);
|
|
|
+ putBehospitalTypeMap(medBehospitalTypeMap, recordContentVO, typeValue, typeName, hospiatlId, searchSize);
|
|
|
} else {
|
|
|
//2.2添加今天之前所有患者的类型
|
|
|
//2.2.1获取所有数据数量
|
|
@@ -158,24 +166,22 @@ public class MedCheckWorkFacade {
|
|
|
recordContentVO.setHospitalId(hospiatlId);
|
|
|
recordContentVO.setModeList(new ArrayList<String>(typeValue.keySet()));
|
|
|
recordContentVO.setIsPlacefile(1l);//获取已归档的患者
|
|
|
- putBehospitalTypeMap(medBehospitalTypeMap,recordContentVO,typeValue,typeName,hospiatlId,searchSize);
|
|
|
+ putBehospitalTypeMap(medBehospitalTypeMap, recordContentVO, typeValue, typeName, hospiatlId, searchSize);
|
|
|
}
|
|
|
//3.批量执行插入操作
|
|
|
try {
|
|
|
- if (medBehospitalTypeMap!=null&&medBehospitalTypeMap.size() > 0) {
|
|
|
+ if (medBehospitalTypeMap != null && medBehospitalTypeMap.size() > 0) {
|
|
|
List<MedBehospitalType> medBehospitalTypeList = new ArrayList<>(medBehospitalTypeMap.values());
|
|
|
medBehospitalTypeServiceImpl.saveBatch(medBehospitalTypeList, batchSize);
|
|
|
}
|
|
|
- }
|
|
|
- catch(Exception e)
|
|
|
- {
|
|
|
- log.error(e.getMessage(),e);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void putBehospitalTypeMap(HashMap<String, MedBehospitalType> medBehospitalTypeMap,
|
|
|
RecordTypeVO recordContentVO, JSONObject typeValue,
|
|
|
- JSONObject typeName, Long hospiatlId,int searchSize) {
|
|
|
+ JSONObject typeName, Long hospiatlId, int searchSize) {
|
|
|
int num = medicalRecordServiceImpl.getRecordCount(recordContentVO);
|
|
|
if (num > 0) {
|
|
|
|
|
@@ -185,9 +191,7 @@ public class MedCheckWorkFacade {
|
|
|
recordContentVO.setEnd(num + 0L);
|
|
|
getPatientRecordType(medBehospitalTypeMap,
|
|
|
medicalRecordServiceImpl.getMedicalRecord(recordContentVO), typeValue, typeName, hospiatlId);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
int i = num / searchSize + 1;
|
|
|
for (int j = 0; j < i; j++) {
|
|
|
//5000个一次循环添加
|
|
@@ -275,6 +279,12 @@ public class MedCheckWorkFacade {
|
|
|
}
|
|
|
}
|
|
|
checkWorkPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+
|
|
|
+ if (StringUtil.isNotBlank(checkWorkPageVO.getJobType()) && checkWorkPageVO.getJobType().equals("0")) {
|
|
|
+ SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
|
|
|
+ sysUserBaseVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
|
|
|
+ checkWorkPageVO.setDepartments(sysUserFacade.getUserDepts(sysUserBaseVO).getSelDepts().stream().map(i -> i.getDeptId()).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public boolean getCheckListByUserId() {
|
|
@@ -285,9 +295,7 @@ public class MedCheckWorkFacade {
|
|
|
if (null != task && StringUtil.isNotBlank(task.getCron())) {
|
|
|
try {
|
|
|
execute(task.getParam());
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return false;
|
|
|
}
|