ignore .Ds_store

dev
youhong.ai 2023-07-10 16:21:08 +08:00
parent 5ba3b46d7d
commit a78f69bead
3 changed files with 30 additions and 2 deletions

View File

@ -61,6 +61,13 @@ public class ExamBtnControlService {
return isReadVersion2(user, params); return isReadVersion2(user, params);
} }
/**
* <h2></h2>
*
* @param user
* @param params
* @return
*/
private boolean isReadVersion2(User user, Map<String, Object> params) { private boolean isReadVersion2(User user, Map<String, Object> params) {
// 获取表名称 // 获取表名称
String tableName = Util.null2String(params.get("tableName")); String tableName = Util.null2String(params.get("tableName"));
@ -81,6 +88,7 @@ public class ExamBtnControlService {
if (docIds.size() != docReadTime.size()) { if (docIds.size() != docReadTime.size()) {
return false; return false;
} }
// 转为map key->docId value->time
Map<String, String> readDocTime = docReadTime.stream().collect( Map<String, String> readDocTime = docReadTime.stream().collect(
Collectors.toMap( Collectors.toMap(
v -> Util.null2String(v.get("docId")), v -> Util.null2String(v.get("docId")),
@ -89,6 +97,7 @@ public class ExamBtnControlService {
if (CollectionUtil.isEmpty(readDocTime)) { if (CollectionUtil.isEmpty(readDocTime)) {
throw new CustomerException("数组转map异常请检查"); throw new CustomerException("数组转map异常请检查");
} }
// 循环对比
for (Map<String, Object> map : docInfo) { for (Map<String, Object> map : docInfo) {
String docId = Util.null2String(map.get(docIdField)); String docId = Util.null2String(map.get(docIdField));
String time = Util.null2String(map.get(timeField)); String time = Util.null2String(map.get(timeField));
@ -120,6 +129,14 @@ public class ExamBtnControlService {
return where; return where;
} }
/**
* <h2>1</h2>
*
* @param user
* @param params
* @return
*/
private boolean isReadVersion1(User user, Map<String, Object> params) { private boolean isReadVersion1(User user, Map<String, Object> params) {
// 获取表名称 // 获取表名称
String tableName = Util.null2String(params.get("tableName")); String tableName = Util.null2String(params.get("tableName"));
@ -278,6 +295,10 @@ public class ExamBtnControlService {
} else { } else {
dataId = Util.getModeDataId("uf_exam_doc_read_time", 1); 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;
} }
} }

View File

@ -25,7 +25,7 @@ public class AutoPackageJar {
public static void createJar(String targetPath) { public static void createJar(String targetPath) {
String path = AutoPackageJar.class.getResource("").getPath(); String path = AutoPackageJar.class.getResource("").getPath();
String finalPath = path.split(File.separator + targetPath)[0] + File.separator + targetPath + FileTreeBuilder.classPath; String finalPath = path.split(File.separator + targetPath)[0] + File.separator + targetPath + FileTreeBuilder.classPath;
createJar(finalPath + "aiyh", finalPath + "aiyh_utils.jar"); createJar(finalPath + "aiyh", finalPath + "aiyh_utils.jar");
createJar(finalPath + "ebu7common", finalPath + "ebu7common.jar"); createJar(finalPath + "ebu7common", finalPath + "ebu7common.jar");
} }
@ -62,6 +62,9 @@ public class AutoPackageJar {
} }
private static void addFileToJar(String entryPath, File file, JarOutputStream jos) throws IOException { private static void addFileToJar(String entryPath, File file, JarOutputStream jos) throws IOException {
if (file.getName().endsWith(".DS_Store")) {
return;
}
String entryName = entryPath + file.getName(); String entryName = entryPath + file.getName();
jos.putNextEntry(new JarEntry(entryName)); jos.putNextEntry(new JarEntry(entryName));

View File

@ -44,9 +44,13 @@ public class FileCompressor {
} }
private static void addFileToZip(File file, String parentPath, ZipOutputStream zipOutputStream, Function<String, String> replacePath) throws IOException { 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)) { try (FileInputStream fileInputStream = new FileInputStream(file)) {
String entryPath = parentPath + File.separator + file.getName(); String entryPath = parentPath + File.separator + file.getName();
String finalPath = replacePath.apply(entryPath); String finalPath = replacePath.apply(entryPath);
if (StrUtil.isBlank(finalPath)) { if (StrUtil.isBlank(finalPath)) {
finalPath = "/"; finalPath = "/";
} }