Commit 171f82f3 authored by huyuchen's avatar huyuchen

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

parent ef2eb51c
...@@ -156,7 +156,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -156,7 +156,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
elecTypeMap.put(entry.getValue(),entry.getKey()); elecTypeMap.put(entry.getValue(),entry.getKey());
} }
} }
if (!elecTypeMap.isEmpty()) { if (elecTypeMap.isEmpty()) {
return R.failed("获取字典失败!"); return R.failed("获取字典失败!");
} }
// 判断源文件是否存在 // 判断源文件是否存在
...@@ -176,14 +176,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -176,14 +176,19 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TEmployeeInfo tEmployeeInfo; TEmployeeInfo tEmployeeInfo;
ZipEntry entry; ZipEntry entry;
String idCard;
String empInfo;
while (entriesCheck.hasMoreElements()) { while (entriesCheck.hasMoreElements()) {
entry = (ZipEntry) entriesCheck.nextElement(); entry = (ZipEntry) entriesCheck.nextElement();
//添加进filesName //添加进filesName
String empInfo = entry.getName(); empInfo = entry.getName();
infoList.add(empInfo); infoList.add(empInfo);
String dataType = ""; String dataType = "";
if (empInfo.length() == empInfo.lastIndexOf("/") + 1) { 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() tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT) .eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING) .eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
...@@ -197,7 +202,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -197,7 +202,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
if (!Common.isNotNull(elecTypeMap.get(dataType))) { if (!Common.isNotNull(elecTypeMap.get(dataType))) {
return R.failed("资料类型错误:" + dataType); return R.failed("资料类型错误:" + dataType);
} }
cardType.add(idCard + "/" + dataType); cardType.add(idCard + "_" + dataType);
} }
} }
} }
...@@ -219,7 +224,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -219,7 +224,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
while (entries.hasMoreElements()) { while (entries.hasMoreElements()) {
entry = (ZipEntry) entries.nextElement(); entry = (ZipEntry) entries.nextElement();
//添加进filesName //添加进filesName
String empInfo = entry.getName(); empInfo = entry.getName();
// 如果是文件夹,就创建个文件夹 // 如果是文件夹,就创建个文件夹
if (entry.isDirectory()) { if (entry.isDirectory()) {
String dirPath = destDirPath + "/" + entry.getName(); String dirPath = destDirPath + "/" + entry.getName();
...@@ -245,7 +250,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -245,7 +250,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo(); TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo();
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) { 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 dataType = empInfo.substring(empInfo.indexOf("/") + 1, empInfo.lastIndexOf("/"));
String empName = ""; String empName = "";
employeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda() employeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
...@@ -388,16 +393,12 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -388,16 +393,12 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
} }
public boolean containsCheckTwo(String e,String idCard) { public boolean containsCheckTwo(String e,String idCard) {
if (e.contains(idCard) && e.length() > 20) { return e.contains(idCard) && e.length() > 20;
return true;
}
return false;
} }
public boolean containsCheckOne(String e,String cardType) { public boolean containsCheckOne(String e,String cardType) {
if (e.contains(cardType) && e.contains(CommonConstants.SPOT)) { String empIdcard = cardType.substring(0,cardType.indexOf("_"));
return true; String fileName = cardType.substring(cardType.indexOf("_") +1 ,cardType.length());
} return e.contains(empIdcard) && e.contains(fileName) && e.contains(CommonConstants.SPOT);
return false;
} }
} }
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