1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

Add fuzzy query function in work items

This commit is contained in:
GGB
2023-05-11 16:04:03 +08:00
parent 15021407e7
commit 1dc1c21efa
12 changed files with 158 additions and 72 deletions

View File

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -71,6 +72,17 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, Work> implements IW
return work;
}
@Override
public List<Work> getWorkByContent(String content) {
List<Work> workList = workMapper.getWorkByContent(content);
for (Work work:
workList) {
work.setProgress(getProgress(work.getId()));
work.setPublisherName(getUserName(work.getPublisherId()));
}
return workList;
}
@Override
public double getProgress(Long workId) {
double workNum = userWorkMapper.selectCount(new QueryWrapper<UserWork>().eq("work_id",workId));