|
@@ -142,28 +142,22 @@ public class ScratchWordsService extends ServiceImpl<ScratchWordsMapper, Scratch
|
|
|
public PageVO queryScratchs(QueryScratchsDTO queryScratchsDTO) throws IOException {
|
|
|
log.info("开始处理【查询标注清单】的业务,参数为:{}", queryScratchsDTO);
|
|
|
|
|
|
- //若有检索筛选,将检索框里的专利号或标注内容去除两端空格
|
|
|
- if (queryScratchsDTO.getPatentNo() != null) {
|
|
|
- queryScratchsDTO.setPatentNo(queryScratchsDTO.getPatentNo().trim());
|
|
|
- }
|
|
|
- if (queryScratchsDTO.getRemark() != null) {
|
|
|
- queryScratchsDTO.setRemark(queryScratchsDTO.getRemark().trim());
|
|
|
+ List<SearchItem> search = queryScratchsDTO.getSearch();
|
|
|
+ List<String> names = search.stream().filter(searchItem -> searchItem.getValue().equals("name")).map(SearchItem::getContent).collect(Collectors.toList());
|
|
|
+ List<Integer> personIds = new ArrayList<>();
|
|
|
+ if (names.size() > 0) {
|
|
|
+ //若根据创建人名称模糊查询,调用权限系统根据人员名称获得人员ids并装载到参数中
|
|
|
+ String res = outInterfaceService.getPersonIdByNamesPCS(names);
|
|
|
+ personIds = JSON.parseArray(res, Integer.class);
|
|
|
+ if (personIds.size() == 0) {
|
|
|
+ personIds.add(-1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
PageVO pageVO = new PageVO()
|
|
|
.setCurrent(queryScratchsDTO.getCurrent())
|
|
|
.setSize(queryScratchsDTO.getSize());
|
|
|
|
|
|
- //若根据创建人名称模糊查询,调用权限系统根据人员名称获得人员ids并装载到参数中
|
|
|
- if (queryScratchsDTO.getName() != null && !queryScratchsDTO.getName().equals("")) {
|
|
|
- String res = outInterfaceService.getPersonIdByNamePCS(queryScratchsDTO.getName());
|
|
|
- List<Integer> personIds = JSON.parseArray(res, Integer.class);
|
|
|
- if (personIds.size() == 0) {
|
|
|
- personIds.add(-1);
|
|
|
- }
|
|
|
- queryScratchsDTO.setPersonIds(personIds);
|
|
|
- }
|
|
|
-
|
|
|
//获取登陆人id、所属租户id、token
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
Integer personId = personnelVO.getId();
|
|
@@ -197,7 +191,7 @@ public class ScratchWordsService extends ServiceImpl<ScratchWordsMapper, Scratch
|
|
|
PageHelper.startPage(queryScratchsDTO.getCurrent(), queryScratchsDTO.getSize());
|
|
|
}
|
|
|
// if (queryScratchsDTO.getGrouping() == null || queryScratchsDTO.getGrouping().equals("")) { //不分组
|
|
|
- List<ScratchWordVO> scratchWords = scratchWordsMapper.queryScratchWords(queryScratchsDTO, tenantId, personId, projectIds, reportIds);
|
|
|
+ List<ScratchWordVO> scratchWords = scratchWordsMapper.queryScratchWords(personIds, search, tenantId, personId, projectIds, reportIds);
|
|
|
PageInfo<ScratchWordVO> pageInfo = new PageInfo<>(scratchWords);
|
|
|
if (scratchWords.size() > 0) {
|
|
|
//装载创建人名称
|
|
@@ -253,15 +247,16 @@ public class ScratchWordsService extends ServiceImpl<ScratchWordsMapper, Scratch
|
|
|
public PageVO queryGroupScratchs(QueryGroupScratchsDTO queryGroupScratchsDTO) throws IOException {
|
|
|
log.info("开始处理【分页分组查询标注清单】的业务,参数为:{}", queryGroupScratchsDTO);
|
|
|
|
|
|
- //调用权限系统根据人员名称获得人员ids
|
|
|
- if (queryGroupScratchsDTO.getName() != null && !queryGroupScratchsDTO.getName().equals("")) {
|
|
|
- String res = outInterfaceService.getPersonIdByNamePCS(queryGroupScratchsDTO.getName());
|
|
|
- //JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- List<Integer> personIds = JSON.parseArray(res, Integer.class);
|
|
|
+ List<SearchItem> search = queryGroupScratchsDTO.getSearch();
|
|
|
+ List<String> names = search.stream().filter(searchItem -> searchItem.getValue().equals("name")).map(SearchItem::getContent).collect(Collectors.toList());
|
|
|
+ List<Integer> personIds = new ArrayList<>();
|
|
|
+ if (names.size() > 0) {
|
|
|
+ //若根据创建人名称模糊查询,调用权限系统根据人员名称获得人员ids并装载到参数中
|
|
|
+ String res = outInterfaceService.getPersonIdByNamesPCS(names);
|
|
|
+ personIds = JSON.parseArray(res, Integer.class);
|
|
|
if (personIds.size() == 0) {
|
|
|
personIds.add(-1);
|
|
|
}
|
|
|
- queryGroupScratchsDTO.setPersonIds(personIds);
|
|
|
}
|
|
|
|
|
|
//获取登陆人id和所属租户id
|
|
@@ -290,7 +285,7 @@ public class ScratchWordsService extends ServiceImpl<ScratchWordsMapper, Scratch
|
|
|
if (queryGroupScratchsDTO.getCurrent() != null && queryGroupScratchsDTO.getSize() != null) {
|
|
|
PageHelper.startPage(queryGroupScratchsDTO.getCurrent(), queryGroupScratchsDTO.getSize());
|
|
|
}
|
|
|
- List<GroupName> groupNames = scratchWordsMapper.queryGroupScratchs(queryGroupScratchsDTO, tenantId, personId, projectIds, reportIds);
|
|
|
+ List<GroupName> groupNames = scratchWordsMapper.queryGroupScratchs(personIds, search, queryGroupScratchsDTO.getGrouping(), tenantId, personId, projectIds, reportIds);
|
|
|
PageInfo<GroupName> pageInfo = new PageInfo<>(groupNames);
|
|
|
|
|
|
if (groupNames.size() > 0) {
|