|
@@ -17,6 +17,7 @@ import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.util.MD5Util;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -61,20 +62,25 @@ public class DocumentLibraryServiceImpl implements DocumentLibraryService {
|
|
|
return result;
|
|
|
}
|
|
|
try {
|
|
|
- if (accountIds != null && !documentList.isEmpty() && !accountIds.isEmpty()) {
|
|
|
+ if (accountIds != null && !documentList.isEmpty() && accountIds != null && !accountIds.isEmpty()) {
|
|
|
|
|
|
+ List<DocumentLibraryInfo> list = new ArrayList<>();
|
|
|
for (String docu : documentList) {
|
|
|
- DocumentLibraryInfo documentLibraryInfo = new DocumentLibraryInfo();
|
|
|
- documentLibraryInfo.setCopyWriter(docu);
|
|
|
- documentLibraryInfo.setCopyWriterId(UUID.randomUUID().toString());
|
|
|
- documentLibraryInfo.setCreateTime(formatter.format(new Date()));
|
|
|
- documentLibraryInfo.setStatus(0);
|
|
|
if (docu != null && docu != "" && docu.length() <= 30) {
|
|
|
for (String accountId : accountIds) {
|
|
|
+ DocumentLibraryInfo documentLibraryInfo = new DocumentLibraryInfo();
|
|
|
+ documentLibraryInfo.setCopyWriter(docu);
|
|
|
+ documentLibraryInfo.setCreateTime(formatter.format(new Date()));
|
|
|
+ documentLibraryInfo.setStatus(0);
|
|
|
documentLibraryInfo.setAccountId(accountId);
|
|
|
- documentLibraryMapper.saveDocumentLibrary(documentLibraryInfo);
|
|
|
+ documentLibraryInfo.setCopyWriterId(MD5Util.getMd5(accountId + docu));
|
|
|
+ list.add(documentLibraryInfo);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (list.size() > 0) {
|
|
|
+ documentLibraryMapper.insertBatch(list);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
result.success("添加成功");
|
|
@@ -252,20 +258,20 @@ public class DocumentLibraryServiceImpl implements DocumentLibraryService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void insertBatch(String description,Long accountId) {
|
|
|
+ public void insertBatch(String description, Long accountId) {
|
|
|
JSONArray array = JSONArray.parseArray(description);
|
|
|
List<DocumentLibraryInfo> list = new ArrayList<>();
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
DocumentLibraryInfo documentLibraryInfo = new DocumentLibraryInfo();
|
|
|
- documentLibraryInfo.setCopyWriter(array.getString(i).trim());
|
|
|
- documentLibraryInfo.setCopyWriterId(UUID.randomUUID().toString());
|
|
|
+ String copyWriter = array.getString(i).trim();
|
|
|
+ documentLibraryInfo.setCopyWriter(copyWriter);
|
|
|
+ documentLibraryInfo.setCopyWriterId(MD5Util.getMd5(accountId + copyWriter));
|
|
|
documentLibraryInfo.setCreateTime(formatter.format(new Date()));
|
|
|
documentLibraryInfo.setStatus(0);
|
|
|
documentLibraryInfo.setAccountId(accountId.toString());
|
|
|
list.add(documentLibraryInfo);
|
|
|
}
|
|
|
-
|
|
|
documentLibraryMapper.insertBatch(list);
|
|
|
}
|
|
|
}
|