|
|
|
|
@ -4,8 +4,10 @@ import com.emr.dao.CommomMapper;
|
|
|
|
|
import com.emr.dao.tScanAssort.T_Scan_AssortMapper;
|
|
|
|
|
import com.emr.entity.tScanAssort.T_Scan_Assort;
|
|
|
|
|
import com.emr.vo.FontVo.ScanAssortVo;
|
|
|
|
|
import com.emr.vo.ZhFyImageVo;
|
|
|
|
|
import com.emr.vo.IndexFds;
|
|
|
|
|
import com.emr.vo.PatientAssortVo;
|
|
|
|
|
import com.emr.vo.PicListVo;
|
|
|
|
|
import com.emr.vo.ZhFyImageVo;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -14,8 +16,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.DigestUtils;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.net.MalformedURLException;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@ -33,16 +33,17 @@ import java.util.List;
|
|
|
|
|
*/
|
|
|
|
|
@Service
|
|
|
|
|
@Transactional
|
|
|
|
|
public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
|
|
|
|
|
public class T_Scan_AssortServiceImpl implements T_Scan_AssortService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private T_Scan_AssortMapper scanAssortMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CommomMapper commomMapper;
|
|
|
|
|
@Value("${NEW_EMR_RECORD_JSP}")
|
|
|
|
|
private String NEW_EMR_RECORD_JSP;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateByPrimaryKeySelective(T_Scan_Assort newAssort, T_Scan_Assort oldAssort) {
|
|
|
|
|
scanAssortMapper.updateByPrimaryKeySelective(newAssort,oldAssort);
|
|
|
|
|
scanAssortMapper.updateByPrimaryKeySelective(newAssort, oldAssort);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ -57,12 +58,12 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int SimpleDelByPatientIdAndScanPages(String patientId, String scanPages) {
|
|
|
|
|
return scanAssortMapper.SimpleDelByPatientIdAndScanPages(patientId,scanPages);
|
|
|
|
|
return scanAssortMapper.SimpleDelByPatientIdAndScanPages(patientId, scanPages);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void SimpleInsert(List<T_Scan_Assort> list) {
|
|
|
|
|
if(!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
//根据字段多少批量新增
|
|
|
|
|
///查询表列数
|
|
|
|
|
int colCount = commomMapper.selectColByTableName("t_scan_assort");
|
|
|
|
|
@ -95,16 +96,16 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
|
|
|
|
|
@Override
|
|
|
|
|
public List<ZhFyImageVo> getPathListByInpatientNo(String inpatientNo, String admissTimes) {
|
|
|
|
|
List<ZhFyImageVo> list = scanAssortMapper.getPathListByInpatientNo(inpatientNo, admissTimes);
|
|
|
|
|
for (ZhFyImageVo scanAssortList:list){
|
|
|
|
|
for (ZhFyImageVo scanAssortList : list) {
|
|
|
|
|
List<PicListVo> picList = scanAssortList.getPicList();
|
|
|
|
|
//编辑图片信息
|
|
|
|
|
for (PicListVo picPathList:picList){
|
|
|
|
|
for (PicListVo picPathList : picList) {
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
String root = selectRootByNotWater(picPathList.getPicUrl());
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
String str1 = picPathList.getPicUrl().substring(0, picPathList.getPicUrl().indexOf(File.separator));
|
|
|
|
|
String picPath = picPathList.getPicUrl().substring(str1.length() + 1, picPathList.getPicUrl().length());
|
|
|
|
|
String fileUrl = NEW_EMR_RECORD_JSP+ File.separator + root + picPath;
|
|
|
|
|
String fileUrl = NEW_EMR_RECORD_JSP + File.separator + root + picPath;
|
|
|
|
|
picPathList.setPicUrl(fileUrl);
|
|
|
|
|
//生成文件id
|
|
|
|
|
String fileId = scanAssortList.getPatientId() + picPathList.getScanPage();
|
|
|
|
|
@ -116,17 +117,17 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ZhFyImageVo> getPathListByDisDate(String startTime,String endTime) {
|
|
|
|
|
public List<ZhFyImageVo> getPathListByDisDate(String startTime, String endTime) {
|
|
|
|
|
List<ZhFyImageVo> list = scanAssortMapper.getPathListByDisDate(startTime, endTime);
|
|
|
|
|
for (ZhFyImageVo scanAssortList:list){
|
|
|
|
|
for (ZhFyImageVo scanAssortList : list) {
|
|
|
|
|
List<PicListVo> picList = scanAssortList.getPicList();
|
|
|
|
|
for (PicListVo picPathList:picList){
|
|
|
|
|
for (PicListVo picPathList : picList) {
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
String root = selectRootByNotWater(picPathList.getPicUrl());
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
String str1 = picPathList.getPicUrl().substring(0, picPathList.getPicUrl().indexOf(File.separator));
|
|
|
|
|
String picPath = picPathList.getPicUrl().substring(str1.length() + 1, picPathList.getPicUrl().length());
|
|
|
|
|
String fileUrl = NEW_EMR_RECORD_JSP+ File.separator + root + picPath;
|
|
|
|
|
String fileUrl = NEW_EMR_RECORD_JSP + File.separator + root + picPath;
|
|
|
|
|
picPathList.setPicUrl(fileUrl);
|
|
|
|
|
//生成文件id
|
|
|
|
|
String fileId = scanAssortList.getPatientId() + picPathList.getScanPage();
|
|
|
|
|
@ -137,6 +138,52 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<PatientAssortVo> getPatAssortListByPatientId(String patientId) {
|
|
|
|
|
List<PatientAssortVo> list = scanAssortMapper.getPatAssortListByPatientId(patientId);
|
|
|
|
|
|
|
|
|
|
for (PatientAssortVo patientAssortVo : list) {
|
|
|
|
|
List<IndexFds> indexFdsList = patientAssortVo.getIndexFds();
|
|
|
|
|
//编辑图片信息
|
|
|
|
|
for (IndexFds indexFds : indexFdsList) {
|
|
|
|
|
String srcPath = indexFds.getScanFile().replaceAll("\\\\", "/");
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
String root = "";
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
String picPath = "";
|
|
|
|
|
//拼接图片地址
|
|
|
|
|
String fileUrl = "";
|
|
|
|
|
if (srcPath.startsWith("/")) {
|
|
|
|
|
//截取字符串为磁盘路径
|
|
|
|
|
int thirdBackslashIndex = srcPath.indexOf('/', srcPath.indexOf('/', srcPath.indexOf('/') + 1) + 1);
|
|
|
|
|
if (thirdBackslashIndex != -1) {
|
|
|
|
|
srcPath = srcPath.substring(thirdBackslashIndex + 1);
|
|
|
|
|
}
|
|
|
|
|
//将原图片地址转换成映射地址
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
root = selectRootByNotWater(srcPath);
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
picPath = srcPath.substring(srcPath.indexOf('/'));
|
|
|
|
|
fileUrl = NEW_EMR_RECORD_JSP + File.separator + root + picPath;
|
|
|
|
|
} else {
|
|
|
|
|
//获取盘符并转换映射地址的头部地址
|
|
|
|
|
root = selectRootByNotWater(indexFds.getScanFile());
|
|
|
|
|
//获取盘符后面的地址
|
|
|
|
|
String str1 = indexFds.getScanFile().substring(0, indexFds.getScanFile().indexOf(File.separator));
|
|
|
|
|
picPath = indexFds.getScanFile().substring(str1.length() + 1, indexFds.getScanFile().length());
|
|
|
|
|
fileUrl = NEW_EMR_RECORD_JSP + File.separator + root + picPath;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
indexFds.setScanFile(fileUrl);
|
|
|
|
|
//生成文件id
|
|
|
|
|
String fileId = patientAssortVo.getPatientId() + indexFds.getScanFile();
|
|
|
|
|
String s = DigestUtils.md5DigestAsHex(fileId.getBytes());
|
|
|
|
|
indexFds.setId(s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String selectRootByNotWater(String srcPath) {
|
|
|
|
|
//获取盘符
|
|
|
|
|
String str = srcPath.substring(0, 1).toUpperCase();
|
|
|
|
|
|