|
|
@ -10,18 +10,24 @@ import net.coobird.thumbnailator.Thumbnails;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.io.FileReader;
|
|
|
|
|
|
|
|
import java.io.FileWriter;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
@ -37,6 +43,8 @@ public class UpdateService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private DataQuery dataQuery;
|
|
|
|
private DataQuery dataQuery;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Set<String> lianZhongPatPicDirs = new HashSet<>();
|
|
|
|
|
|
|
|
|
|
|
|
public List<CardInfo> updateData() {
|
|
|
|
public List<CardInfo> updateData() {
|
|
|
|
List<CardInfo> cardInfos = dataQuery.dateQuery();
|
|
|
|
List<CardInfo> cardInfos = dataQuery.dateQuery();
|
|
|
|
dataQuery.updateBatchState(cardInfos, 1);
|
|
|
|
dataQuery.updateBatchState(cardInfos, 1);
|
|
|
@ -49,6 +57,7 @@ public class UpdateService {
|
|
|
|
|
|
|
|
|
|
|
|
@PostConstruct
|
|
|
|
@PostConstruct
|
|
|
|
public void upload() {
|
|
|
|
public void upload() {
|
|
|
|
|
|
|
|
initLianZhongPatPicDir();
|
|
|
|
log.info("联众同步数据启动>>>>>>>>>>>>>>>>>>>>");
|
|
|
|
log.info("联众同步数据启动>>>>>>>>>>>>>>>>>>>>");
|
|
|
|
String syncDir = FilePathUtil.currentPath() + File.separator + "lianzhong-sync";
|
|
|
|
String syncDir = FilePathUtil.currentPath() + File.separator + "lianzhong-sync";
|
|
|
|
FilePathUtil.mkdirs(syncDir);
|
|
|
|
FilePathUtil.mkdirs(syncDir);
|
|
|
@ -115,7 +124,7 @@ public class UpdateService {
|
|
|
|
LianZhongUploadInfo.PatientInfo patientInfo = convert(cardInfo);
|
|
|
|
LianZhongUploadInfo.PatientInfo patientInfo = convert(cardInfo);
|
|
|
|
List<LianZhongUploadInfo.FileInfo> fileInfos = new ArrayList<>();
|
|
|
|
List<LianZhongUploadInfo.FileInfo> fileInfos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<String> faultFileNames = new ArrayList<>();
|
|
|
|
List<String> faultFileNames = new ArrayList<>();
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
for (Picture picture : pictures) {
|
|
|
|
for (Picture picture : pictures) {
|
|
|
|
File pictureFile = new File(picDir + File.separator + removeFileExtension(picture.getPicname()) + ".jpg");
|
|
|
|
File pictureFile = new File(picDir + File.separator + removeFileExtension(picture.getPicname()) + ".jpg");
|
|
|
@ -124,17 +133,16 @@ public class UpdateService {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
files.add(pictureFile);
|
|
|
|
files.add(pictureFile);
|
|
|
|
LianZhongUploadInfo.FileInfo fileInfo=new LianZhongUploadInfo.FileInfo();
|
|
|
|
LianZhongUploadInfo.FileInfo fileInfo = new LianZhongUploadInfo.FileInfo();
|
|
|
|
fileInfo.setFileTitle(picture.getPicname());
|
|
|
|
fileInfo.setFileTitle(picture.getPicname());
|
|
|
|
fileInfo.setUploadFileName(pictureFile.getName());
|
|
|
|
fileInfo.setUploadFileName(pictureFile.getName());
|
|
|
|
fileInfo.setAssortId(picture.getPickind());
|
|
|
|
fileInfo.setAssortId(picture.getPickind());
|
|
|
|
// todo 应该有个排序
|
|
|
|
fileInfo.setSort(picture.getPicno());
|
|
|
|
fileInfo.setSort(0);
|
|
|
|
|
|
|
|
fileInfos.add(fileInfo);
|
|
|
|
fileInfos.add(fileInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (files.isEmpty()) {
|
|
|
|
if (files.isEmpty()) {
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2,"未获取到图片!");
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2, "未获取到图片!");
|
|
|
|
// 删除文件
|
|
|
|
// 删除文件
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -166,7 +174,7 @@ public class UpdateService {
|
|
|
|
List<FormField> params = new ArrayList<>();
|
|
|
|
List<FormField> params = new ArrayList<>();
|
|
|
|
String s = new Gson().toJson(uploadInfo);
|
|
|
|
String s = new Gson().toJson(uploadInfo);
|
|
|
|
params.add(new FormField("uploadFileParams", s));
|
|
|
|
params.add(new FormField("uploadFileParams", s));
|
|
|
|
CommonResult commonResult = FileUploader.uploadFilesWithParams(batch, "http://192.168.161.102:9511/lianzhong/batchFileUploadJpg", params);
|
|
|
|
CommonResult commonResult = FileUploader.uploadFilesWithParams(batch, "http://129.7.1.25:9511/lianzhong/batchFileUploadJpg", params);
|
|
|
|
boolean res = commonResult.getCode() == 0;
|
|
|
|
boolean res = commonResult.getCode() == 0;
|
|
|
|
success = success && res;
|
|
|
|
success = success && res;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -175,7 +183,7 @@ public class UpdateService {
|
|
|
|
List<FormField> params = new ArrayList<>();
|
|
|
|
List<FormField> params = new ArrayList<>();
|
|
|
|
String s = new Gson().toJson(uploadInfo);
|
|
|
|
String s = new Gson().toJson(uploadInfo);
|
|
|
|
params.add(new FormField("uploadFileParams", s));
|
|
|
|
params.add(new FormField("uploadFileParams", s));
|
|
|
|
CommonResult commonResult = FileUploader.uploadFilesWithParams(files, "http://192.168.161.102:9511/lianzhong/batchFileUploadJpg", params);
|
|
|
|
CommonResult commonResult = FileUploader.uploadFilesWithParams(files, "http://129.7.1.25:9511/lianzhong/batchFileUploadJpg", params);
|
|
|
|
success = commonResult.getCode() == 0;
|
|
|
|
success = commonResult.getCode() == 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -183,24 +191,24 @@ public class UpdateService {
|
|
|
|
dataQuery.updateBatchState(cardInfo, 3);
|
|
|
|
dataQuery.updateBatchState(cardInfo, 3);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2,"上传服务端出现异常!");
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2, "上传服务端出现异常!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2,e.getMessage());
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2, e.getMessage());
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!faultFileNames.isEmpty()) {
|
|
|
|
if (!faultFileNames.isEmpty()) {
|
|
|
|
// 不完整
|
|
|
|
// 不完整
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2,String.join(",",faultFileNames+" 无法转换jpg图片!"));
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2, String.join(",", faultFileNames + " 无法转换jpg图片!"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除文件
|
|
|
|
// 删除文件
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
}catch (Exception ex){
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error(ex.getMessage(),ex);
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
FilePathUtil.deleteDir(picDir);
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2,ex.getMessage());
|
|
|
|
dataQuery.updateBatchState(cardInfo, 2, ex.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
patientFutures.add(patientFuture);
|
|
|
|
patientFutures.add(patientFuture);
|
|
|
@ -217,24 +225,121 @@ public class UpdateService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
UpdateService updateService = new UpdateService();
|
|
|
|
|
|
|
|
System.out.println(new Gson().toJson(updateService.lianZhongPatPicDirs));
|
|
|
|
|
|
|
|
updateService.initLianZhongPatPicDir();
|
|
|
|
|
|
|
|
System.out.println(new Gson().toJson(updateService.lianZhongPatPicDirs));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initLianZhongPatPicDir() {
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>初始化联众患者文件目录");
|
|
|
|
|
|
|
|
String readFilePath = FilePathUtil.currentPath() + File.separator + "lianzhong-patpic-dir.txt";
|
|
|
|
|
|
|
|
File readFile = new File(readFilePath);
|
|
|
|
|
|
|
|
if (readFile.exists()) {
|
|
|
|
|
|
|
|
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(readFile))) {
|
|
|
|
|
|
|
|
String line;
|
|
|
|
|
|
|
|
while ((line = bufferedReader.readLine()) != null) {
|
|
|
|
|
|
|
|
lianZhongPatPicDirs.add(line);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
log.error(">>>>>>>>>>>> 初始化联众患者文件目录读取存储文件错误!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<String> rootDirs = Arrays.asList("D:\\UnionNet\\ServerD", "D:\\UnionNet\\ServerD_ny", "D:\\UnionNet\\ServerDTemp",
|
|
|
|
|
|
|
|
"G:\\UnionNet\\ServerD", "G:\\UnionNet\\ServerD_ny", "G:\\UnionNet\\ServerDTemp");
|
|
|
|
|
|
|
|
for (String rootDir : rootDirs) {
|
|
|
|
|
|
|
|
File rootDirFile = new File(rootDir);
|
|
|
|
|
|
|
|
if (!rootDirFile.exists()) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 第一层 年 ,如果有,后面基本都会有
|
|
|
|
|
|
|
|
File[] level1 = rootDirFile.listFiles();
|
|
|
|
|
|
|
|
if (level1 == null || level1.length <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (File level1File : level1) {
|
|
|
|
|
|
|
|
// 第二层 年月
|
|
|
|
|
|
|
|
File[] level2 = level1File.listFiles();
|
|
|
|
|
|
|
|
if (level2 == null || level2.length <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (File level2File : level2) {
|
|
|
|
|
|
|
|
if (level2File.isDirectory()) {
|
|
|
|
|
|
|
|
// 第三层 年月日
|
|
|
|
|
|
|
|
File[] level3 = level2File.listFiles();
|
|
|
|
|
|
|
|
if (level3 == null || level3.length <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (File level3File : level3) {
|
|
|
|
|
|
|
|
if (level3File.isDirectory()) {
|
|
|
|
|
|
|
|
// 第四层,患者存放文件的最后一级目录
|
|
|
|
|
|
|
|
File[] level4 = level3File.listFiles();
|
|
|
|
|
|
|
|
if (level4 == null || level4.length <= 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (File level4File : level4) {
|
|
|
|
|
|
|
|
if (level4File.isDirectory()) {
|
|
|
|
|
|
|
|
lianZhongPatPicDirs.add(level4File.getPath());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!lianZhongPatPicDirs.isEmpty()) {
|
|
|
|
|
|
|
|
try (BufferedWriter writer = new BufferedWriter(new FileWriter(readFile));) {
|
|
|
|
|
|
|
|
for (String picDir : lianZhongPatPicDirs) {
|
|
|
|
|
|
|
|
writer.write(picDir);
|
|
|
|
|
|
|
|
writer.newLine();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
log.error("持久化联众患者文件目录错误:" + ex.getMessage(), ex);
|
|
|
|
|
|
|
|
if (readFile.exists()) {
|
|
|
|
|
|
|
|
readFile.delete();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private LianZhongUploadInfo.PatientInfo convert(CardInfo cardInfo) {
|
|
|
|
private LianZhongUploadInfo.PatientInfo convert(CardInfo cardInfo) {
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
LianZhongUploadInfo.PatientInfo patientInfo=new LianZhongUploadInfo.PatientInfo();
|
|
|
|
|
|
|
|
// todo 病案号
|
|
|
|
LianZhongUploadInfo.PatientInfo patientInfo = new LianZhongUploadInfo.PatientInfo();
|
|
|
|
patientInfo.setInpatientNo(null);
|
|
|
|
patientInfo.setInpatientNo(cardInfo.getPatno());
|
|
|
|
// todo 住院次数
|
|
|
|
String gestno = cardInfo.getGestno();
|
|
|
|
patientInfo.setAdmissTimes(null);
|
|
|
|
// 123步设置住院次数
|
|
|
|
|
|
|
|
Integer admissTimes = cardInfo.getPatnum();
|
|
|
|
|
|
|
|
if (admissTimes == null && StringUtils.hasText(gestno)) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String admissTimesStr = removeLeadingZeros(gestno.substring(gestno.length() - 3));
|
|
|
|
|
|
|
|
admissTimes = Integer.valueOf(admissTimesStr);
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
log.error("无法解析gestno:{} 当中的住院次数!", gestno);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 没办法获取那就直接用出院的日期当住院次数
|
|
|
|
|
|
|
|
if (admissTimes == null) {
|
|
|
|
|
|
|
|
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
|
|
|
admissTimes = Integer.valueOf(sdf2.format(cardInfo.getOutdate()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
patientInfo.setAdmissTimes(admissTimes);
|
|
|
|
|
|
|
|
patientInfo.setAge(cardInfo.getPatage());
|
|
|
|
patientInfo.setName(cardInfo.getPatname());
|
|
|
|
patientInfo.setName(cardInfo.getPatname());
|
|
|
|
// todo 年龄
|
|
|
|
|
|
|
|
patientInfo.setSex("") ;
|
|
|
|
patientInfo.setSex("1".equals(cardInfo.getPatsex()) ? "男" : "女");
|
|
|
|
patientInfo.setSexName("") ;
|
|
|
|
patientInfo.setSexName("");
|
|
|
|
patientInfo.setAdmissDate(cardInfo.getIndate() == null ?null:sdf.format(cardInfo.getIndate())) ;
|
|
|
|
patientInfo.setAdmissDate(cardInfo.getIndate() == null ? null : sdf.format(cardInfo.getIndate()));
|
|
|
|
patientInfo.setDisDate(cardInfo.getOutdate() == null ?null:sdf.format(cardInfo.getOutdate()));
|
|
|
|
patientInfo.setDisDate(cardInfo.getOutdate() == null ? null : sdf.format(cardInfo.getOutdate()));
|
|
|
|
patientInfo.setAdmissDeptName(cardInfo.getIndeptname()) ;
|
|
|
|
patientInfo.setAdmissDeptName(cardInfo.getIndeptname());
|
|
|
|
patientInfo.setDisDeptName(cardInfo.getOutdeptname());
|
|
|
|
patientInfo.setDisDeptName(cardInfo.getOutdeptname());
|
|
|
|
patientInfo.setIdCard(cardInfo.getPatciticard()) ;
|
|
|
|
patientInfo.setIdCard(cardInfo.getPatciticard());
|
|
|
|
patientInfo.setMainDiagCode(null) ;
|
|
|
|
patientInfo.setMainDiagCode(null);
|
|
|
|
patientInfo.setMainDiagName(null) ;
|
|
|
|
patientInfo.setMainDiagName(null);
|
|
|
|
patientInfo.setMainOperateCode(null);
|
|
|
|
patientInfo.setMainOperateCode(null);
|
|
|
|
patientInfo.setMainOperateName(null);
|
|
|
|
patientInfo.setMainOperateName(null);
|
|
|
|
return patientInfo;
|
|
|
|
return patientInfo;
|
|
|
@ -243,41 +348,20 @@ public class UpdateService {
|
|
|
|
private String findLianZhongDir(CardInfo cardInfo) {
|
|
|
|
private String findLianZhongDir(CardInfo cardInfo) {
|
|
|
|
String gestno = cardInfo.getGestno();
|
|
|
|
String gestno = cardInfo.getGestno();
|
|
|
|
String patno = cardInfo.getPatno();
|
|
|
|
String patno = cardInfo.getPatno();
|
|
|
|
Date outdate = cardInfo.getOutdate();
|
|
|
|
for (String lianZhongPatPicDir : lianZhongPatPicDirs) {
|
|
|
|
SimpleDateFormat yearSdf = new SimpleDateFormat("yyyy");
|
|
|
|
String dirName = new File(lianZhongPatPicDir).getName();
|
|
|
|
SimpleDateFormat yearMonthSdf = new SimpleDateFormat("yyyyMM");
|
|
|
|
String comparePart = dirName.substring(2).substring(0, 10);
|
|
|
|
SimpleDateFormat yearMonthDaySdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
comparePart = removeLeadingZeros(comparePart);
|
|
|
|
String yFormat = yearSdf.format(outdate);
|
|
|
|
// gestno 或者 patno 进行 识别
|
|
|
|
String ymFormat = yearMonthSdf.format(outdate);
|
|
|
|
if (StringUtils.hasText(gestno)) {
|
|
|
|
String ymdFormat = yearMonthDaySdf.format(outdate);
|
|
|
|
if (comparePart.contains(removeLeadingZeros(gestno))) {
|
|
|
|
List<String> archiveDirs = Arrays.asList(
|
|
|
|
return lianZhongPatPicDir;
|
|
|
|
"D:\\UnionNet\\ServerD",
|
|
|
|
|
|
|
|
"D:\\UnionNet\\ServerD_ny",
|
|
|
|
|
|
|
|
"D:\\UnionNet\\ServerDTemp",
|
|
|
|
|
|
|
|
"G:\\UnionNet\\ServerD",
|
|
|
|
|
|
|
|
"G:\\UnionNet\\ServerD_ny",
|
|
|
|
|
|
|
|
"G:\\UnionNet\\ServerDTemp");
|
|
|
|
|
|
|
|
for (String archiveDir : archiveDirs) {
|
|
|
|
|
|
|
|
String ymdDateDir = archiveDir + File.separator + yFormat + File.separator + ymFormat + File.separator + ymdFormat;
|
|
|
|
|
|
|
|
File ymdDateDirFile = new File(ymdDateDir);
|
|
|
|
|
|
|
|
if (!ymdDateDirFile.exists()) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
File[] patPicDirs = ymdDateDirFile.listFiles();
|
|
|
|
|
|
|
|
if (patPicDirs != null && patPicDirs.length > 0) {
|
|
|
|
|
|
|
|
for (File patPicDir : patPicDirs) {
|
|
|
|
|
|
|
|
String dirName = patPicDir.getName();
|
|
|
|
|
|
|
|
String comparePart = dirName.substring(2).substring(0, 10);
|
|
|
|
|
|
|
|
comparePart = removeLeadingZeros(comparePart);
|
|
|
|
|
|
|
|
//TODO gestno 或者 patno 进行 识别
|
|
|
|
|
|
|
|
boolean match = comparePart.contains(removeLeadingZeros(patno));
|
|
|
|
|
|
|
|
if (match) {
|
|
|
|
|
|
|
|
return patPicDir.getPath();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (comparePart.contains(removeLeadingZeros(patno))) {
|
|
|
|
|
|
|
|
return lianZhongPatPicDir;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|