Commit 171f82f3 authored by huyuchen's avatar huyuchen

电子档案文件夹名称格式修改

parent ef2eb51c
......@@ -156,7 +156,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
elecTypeMap.put(entry.getValue(),entry.getKey());
}
}
if (!elecTypeMap.isEmpty()) {
if (elecTypeMap.isEmpty()) {
return R.failed("获取字典失败!");
}
// 判断源文件是否存在
......@@ -176,14 +176,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TEmployeeInfo tEmployeeInfo;
ZipEntry entry;
String idCard;
String empInfo;
while (entriesCheck.hasMoreElements()) {
entry = (ZipEntry) entriesCheck.nextElement();
//添加进filesName
String empInfo = entry.getName();
empInfo = entry.getName();
infoList.add(empInfo);
String dataType = "";
if (empInfo.length() == empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0, empInfo.indexOf("/"));
if (!empInfo.contains("-")) {
return R.failed("请使用正确的文件夹命名格式:身份证-员工姓名");
}
idCard = empInfo.substring(0, empInfo.indexOf("-"));
tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
......@@ -197,7 +202,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
if (!Common.isNotNull(elecTypeMap.get(dataType))) {
return R.failed("资料类型错误:" + dataType);
}
cardType.add(idCard + "/" + dataType);
cardType.add(idCard + "_" + dataType);
}
}
}
......@@ -219,7 +224,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
while (entries.hasMoreElements()) {
entry = (ZipEntry) entries.nextElement();
//添加进filesName
String empInfo = entry.getName();
empInfo = entry.getName();
// 如果是文件夹,就创建个文件夹
if (entry.isDirectory()) {
String dirPath = destDirPath + "/" + entry.getName();
......@@ -245,7 +250,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo();
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0, empInfo.indexOf("/"));
idCard = empInfo.substring(0, empInfo.indexOf("-"));
String dataType = empInfo.substring(empInfo.indexOf("/") + 1, empInfo.lastIndexOf("/"));
String empName = "";
employeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
......@@ -388,16 +393,12 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
}
public boolean containsCheckTwo(String e,String idCard) {
if (e.contains(idCard) && e.length() > 20) {
return true;
}
return false;
return e.contains(idCard) && e.length() > 20;
}
public boolean containsCheckOne(String e,String cardType) {
if (e.contains(cardType) && e.contains(CommonConstants.SPOT)) {
return true;
}
return false;
String empIdcard = cardType.substring(0,cardType.indexOf("_"));
String fileName = cardType.substring(cardType.indexOf("_") +1 ,cardType.length());
return e.contains(empIdcard) && e.contains(fileName) && e.contains(CommonConstants.SPOT);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment