1.谐波溯源算法bug

This commit is contained in:
2025-10-17 15:32:54 +08:00
parent e0cfcbccf8
commit 0e1605d9b3
7 changed files with 25 additions and 13 deletions

View File

@@ -55,6 +55,9 @@ public class CsPagePO extends BaseEntity {
private String status;
private Integer sort;
public static final String COL_ID = "id";

View File

@@ -46,7 +46,6 @@ public class CsElementServiceImpl extends ServiceImpl<CsElementMapper, CsElement
csElement.setPath(path);
csElement.setStatus(1);
this.saveOrUpdate(csElement);
csElement.setPath(path);
return csElement;
}

View File

@@ -25,7 +25,9 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -68,11 +70,14 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
.lines()
.collect(Collectors.joining("\n"));
List<CsPagePO> csPagePOS = JSONUtil.toList(text, CsPagePO.class);
// 倒序排列
csPagePOS.forEach(temp->{
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(temp.getPath()), OssPath.CONFIGURATIONPATH, OssPath.CONFIGURATIONNAME);
temp.setPid(pid);
temp.setStatus("1");
temp.setPath(s);
temp.setCreateTime(LocalDateTime.now());
temp.setUpdateTime(LocalDateTime.now());
this.save(temp);
});
} catch (IOException e) {
@@ -109,8 +114,8 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
QueryWrapper<CsPagePO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StrUtil.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
like(StrUtil.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
eq ("status",1);
// orderByAsc(CsPagePO.COL_KID)
eq ("status",1).
orderByAsc("sort");
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);