ignore .Ds_store
parent
5ba3b46d7d
commit
a78f69bead
|
@ -61,6 +61,13 @@ public class ExamBtnControlService {
|
|||
return isReadVersion2(user, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* <h2>是否已读版本二</h2>
|
||||
*
|
||||
* @param user 当前用户
|
||||
* @param params 参数
|
||||
* @return 是否已读
|
||||
*/
|
||||
private boolean isReadVersion2(User user, Map<String, Object> params) {
|
||||
// 获取表名称
|
||||
String tableName = Util.null2String(params.get("tableName"));
|
||||
|
@ -81,6 +88,7 @@ public class ExamBtnControlService {
|
|||
if (docIds.size() != docReadTime.size()) {
|
||||
return false;
|
||||
}
|
||||
// 转为map key->docId value->time
|
||||
Map<String, String> readDocTime = docReadTime.stream().collect(
|
||||
Collectors.toMap(
|
||||
v -> Util.null2String(v.get("docId")),
|
||||
|
@ -89,6 +97,7 @@ public class ExamBtnControlService {
|
|||
if (CollectionUtil.isEmpty(readDocTime)) {
|
||||
throw new CustomerException("数组转map异常,请检查!");
|
||||
}
|
||||
// 循环对比
|
||||
for (Map<String, Object> map : docInfo) {
|
||||
String docId = Util.null2String(map.get(docIdField));
|
||||
String time = Util.null2String(map.get(timeField));
|
||||
|
@ -120,6 +129,14 @@ public class ExamBtnControlService {
|
|||
return where;
|
||||
}
|
||||
|
||||
/**
|
||||
* <h2>是否已读版本1</h2>
|
||||
*
|
||||
* @param user 当前用户
|
||||
* @param params 请求参数
|
||||
* @return 是否已读
|
||||
*/
|
||||
|
||||
private boolean isReadVersion1(User user, Map<String, Object> params) {
|
||||
// 获取表名称
|
||||
String tableName = Util.null2String(params.get("tableName"));
|
||||
|
@ -278,6 +295,10 @@ public class ExamBtnControlService {
|
|||
} else {
|
||||
dataId = Util.getModeDataId("uf_exam_doc_read_time", 1);
|
||||
}
|
||||
return mapper.updateReadTimeTag(docId, user.getUID(), currentReadTimeInt, dataId);
|
||||
boolean b = mapper.updateReadTimeTag(docId, user.getUID(), currentReadTimeInt, dataId);
|
||||
if (b) {
|
||||
Util.rebuildModeDataShare(1, "uf_exam_doc_read_time", dataId);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,9 @@ public class AutoPackageJar {
|
|||
}
|
||||
|
||||
private static void addFileToJar(String entryPath, File file, JarOutputStream jos) throws IOException {
|
||||
if (file.getName().endsWith(".DS_Store")) {
|
||||
return;
|
||||
}
|
||||
String entryName = entryPath + file.getName();
|
||||
jos.putNextEntry(new JarEntry(entryName));
|
||||
|
||||
|
|
|
@ -44,9 +44,13 @@ public class FileCompressor {
|
|||
}
|
||||
|
||||
private static void addFileToZip(File file, String parentPath, ZipOutputStream zipOutputStream, Function<String, String> replacePath) throws IOException {
|
||||
if (file.getName().endsWith(".DS_Store")) {
|
||||
return;
|
||||
}
|
||||
try (FileInputStream fileInputStream = new FileInputStream(file)) {
|
||||
String entryPath = parentPath + File.separator + file.getName();
|
||||
String finalPath = replacePath.apply(entryPath);
|
||||
|
||||
if (StrUtil.isBlank(finalPath)) {
|
||||
finalPath = "/";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue