认证-上报库-操作记录修改
This commit is contained in:
+72
-21
@@ -1591,7 +1591,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
// 处理数据
|
||||
for (Map<String, Object> map : configDataList) {
|
||||
String paramsCollectManifestId = (String) map.get("id");
|
||||
|
||||
// 操作记录
|
||||
StringBuilder logCnContent = new StringBuilder();
|
||||
StringBuilder logEnContent = new StringBuilder();
|
||||
logCnContent.append(loginUser.getUsername()).append("将");
|
||||
logEnContent.append(loginUser.getUsername()).append(" set ");
|
||||
// 添加配置数据
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
if ("id".equals(entry.getKey())) {
|
||||
@@ -1607,9 +1611,6 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
}
|
||||
|
||||
ParamsReportConfigDataEO paramsReportConfigDataEO = new ParamsReportConfigDataEO();
|
||||
// 操作记录
|
||||
StringBuilder logCnContent = new StringBuilder();
|
||||
StringBuilder logEnContent = new StringBuilder();
|
||||
// 取值
|
||||
String paramsReportConfigEOId = entry.getKey();
|
||||
ParamsReportConfigEO paramsReportConfigEO = paramsReportConfigEOService.getById(paramsReportConfigEOId);
|
||||
@@ -1622,10 +1623,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
if (ObjectUtil.isNotEmpty(oldConfigDataEO)) {
|
||||
paramsReportConfigDataEO.setId(oldConfigDataEO.getId());
|
||||
}
|
||||
logCnContent.append(loginUser.getUsername()).append("将").append(paramsReportConfigEO.getConfigName()).append("的");
|
||||
logEnContent.append(loginUser.getUsername()).append(" set ").append(paramsReportConfigEO.getConfigName()).append(" from ");
|
||||
|
||||
|
||||
logCnContent.append(paramsReportConfigEO.getConfigName()).append("的");
|
||||
logEnContent.append(paramsReportConfigEO.getConfigName());
|
||||
|
||||
paramsReportConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId);
|
||||
paramsReportConfigDataEO.setParamsConfigId(paramsReportConfigEOId);
|
||||
@@ -1636,25 +1635,57 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
|
||||
if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) {
|
||||
paramsReportConfigDataEO.setTextData(dataValue);
|
||||
if (StringUtils.isEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue)) {
|
||||
logCnContent.append("空").append("改为").append(dataValue).append(",");
|
||||
logEnContent.append(" from ").append("Null").append(" to ").append(dataValue).append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isEmpty(dataValue)) {
|
||||
logCnContent.append(oldConfigDataEO.getTextData()).append("改为").append("空").append(",");
|
||||
logEnContent.append(" from ").append(oldConfigDataEO.getTextData()).append(" to ").append("Null").append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getTextData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getTextData().equals(dataValue)) {
|
||||
logCnContent.append(oldConfigDataEO.getTextData()).append("改为").append(dataValue).append(",");
|
||||
logEnContent.append(" from ").append(oldConfigDataEO.getTextData()).append(" to ").append(dataValue).append(", ");
|
||||
|
||||
}
|
||||
|
||||
} else if (type.equals(ConfigDataTypeEnum.PULL.getValue())
|
||||
|| type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) {
|
||||
paramsReportConfigDataEO.setPullData(dataValue);
|
||||
|
||||
if (StringUtils.isEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue)) {
|
||||
logCnContent.append("空").append("改为").append(dataValue).append(",");
|
||||
logEnContent.append(" from ").append("Null").append(" to ").append(dataValue).append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isEmpty(dataValue)) {
|
||||
logCnContent.append(oldConfigDataEO.getPullData()).append("改为").append("空").append(",");
|
||||
logEnContent.append(" from ").append(oldConfigDataEO.getPullData()).append(" to ").append("Null").append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getPullData()) && StringUtils.isNotEmpty(dataValue) && !oldConfigDataEO.getPullData().equals(dataValue)) {
|
||||
logCnContent.append(oldConfigDataEO.getPullData()).append("改为").append(dataValue).append(",");
|
||||
logEnContent.append(" from ").append(oldConfigDataEO.getPullData()).append(" to ").append(dataValue).append(", ");
|
||||
|
||||
}
|
||||
|
||||
} else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) {
|
||||
if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件
|
||||
String newFileNames = "";
|
||||
if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件. 目前没用到这段代码
|
||||
// 处理文件connectId
|
||||
String[] fileIdList = dataValue.split(",");
|
||||
String connectId = UUID.randomUUID().toString().replace("-", "");
|
||||
List<OSSFile> updateFileList = new ArrayList<>();
|
||||
for (int i = 0; i < fileIdList.length; i++) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setId(fileIdList[i]);
|
||||
ossFile.setConnectId(connectId);
|
||||
updateFileList.add(ossFile);
|
||||
List<OSSFile> ossFiles = ossFileService.getFileInfosByConnectId(fileIdList[0]);
|
||||
if(CollectionUtil.isEmpty(ossFiles)) { // 新加了一个文件
|
||||
String connectId = UUID.randomUUID().toString().replace("-", "");
|
||||
List<OSSFile> updateFileList = new ArrayList<>();
|
||||
for (int i = 0; i < fileIdList.length; i++) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setId(fileIdList[i]);
|
||||
ossFile.setConnectId(connectId);
|
||||
updateFileList.add(ossFile);
|
||||
}
|
||||
ossFileService.updateBatchById(updateFileList);
|
||||
dataValue = connectId;
|
||||
newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
}
|
||||
ossFileService.updateBatchById(updateFileList);
|
||||
dataValue = connectId;
|
||||
} else if (StringUtils.isNotEmpty(dataValue) && !dataValue.contains(",")) {
|
||||
List<OSSFile> ossFiles = ossFileService.getFileInfosByConnectId(dataValue);
|
||||
if(CollectionUtil.isEmpty(ossFiles)){ // 新加了一个文件
|
||||
@@ -1669,18 +1700,38 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
}
|
||||
ossFileService.updateFileInfo(oSSFileList);
|
||||
dataValue = connectId;
|
||||
newFileNames = ossFileService.getFileInfosByConnectId(connectId).stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
paramsReportConfigDataEO.setFileConnectId(dataValue);
|
||||
if (StringUtils.isEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) {
|
||||
logCnContent.append("空").append("改为").append(newFileNames).append(",");
|
||||
logEnContent.append(" from ").append("Null").append(" to ").append(newFileNames).append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isEmpty(dataValue)) {
|
||||
String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
logCnContent.append(oldFileNames).append("改为").append("空").append(",");
|
||||
logEnContent.append(" from ").append(oldFileNames).append(" to ").append("Null").append(", ");
|
||||
|
||||
} else if (StringUtils.isNotEmpty(oldConfigDataEO.getFileConnectId()) && StringUtils.isNotEmpty(dataValue)) {
|
||||
String oldFileNames = ossFileService.getFileInfosByConnectId(oldConfigDataEO.getFileConnectId()).stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
if (!oldConfigDataEO.getFileConnectId().equals(dataValue)) {
|
||||
logCnContent.append(oldFileNames).append("改为").append(newFileNames).append(",");
|
||||
logEnContent.append(" from ").append(oldFileNames).append(" to ").append(newFileNames).append(", ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
newConfigDataEOList.add(paramsReportConfigDataEO);
|
||||
|
||||
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
|
||||
insertLogEO.setLogCnContent(logCnContent.toString());
|
||||
insertLogEO.setLogEnContent(logEnContent.toString());
|
||||
}
|
||||
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
|
||||
if (logCnContent.toString().endsWith(",")) {
|
||||
insertLogEO.setLogCnContent(logCnContent.toString().substring(0, logCnContent.lastIndexOf(",")));
|
||||
insertLogEO.setLogEnContent(logEnContent.toString().substring(0, logEnContent.lastIndexOf(",")));
|
||||
insertLogEO.setParamsReportId(paramsManifestId);
|
||||
insertLogEO.setParamsReportDetailId(paramsCollectManifestId);
|
||||
insertLogEOList.add(insertLogEO);
|
||||
|
||||
Reference in New Issue
Block a user