Merge pull request '产品需求固定模块排序到最后面' (#781) from otto/microservices:product_refact into product_refact

This commit is contained in:
otto 2024-12-20 08:45:40 +08:00
commit 3371917732
1 changed files with 7 additions and 3 deletions

View File

@ -324,8 +324,13 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
allPmsProductModule.setId(0L);
allPmsProductModule.setModuleName(ALL_MODULE);
allPmsProductModule.setNodeDataCount(allNodeDataCount);
allPmsProductModule.setIsFixedModule(pmsProductModule.getIsFixedModule());
allPmsProductModule.setIsFixedModule(true);
moduleList.add(allPmsProductModule);
// 模块根据id排序
moduleList = moduleList.stream()
.sorted(Comparator.comparing(PmsProductModule::getId))
.sorted(Comparator.comparing(PmsProductModule::getIsFixedModule))
.collect(Collectors.toList());
// 构建无所属模块
PmsProductModule noPmsProductModule = new PmsProductModule();
noPmsProductModule.setPmsProductIdentifier(pmsProductModule.getPmsProductIdentifier());
@ -333,9 +338,8 @@ public class PmsProductModuleServiceImpl implements IPmsProductModuleService
noPmsProductModule.setModuleName(NO_MODULE);
noPmsProductModule.setParentId(0L);
noPmsProductModule.setNodeDataCount(noModuleNodeDataCount);
noPmsProductModule.setIsFixedModule(true);
moduleList.add(noPmsProductModule);
// 模块根据id排序
moduleList = moduleList.stream().sorted(Comparator.comparing(PmsProductModule::getId)).collect(Collectors.toList());
return buildModuleTreeSelect(moduleList);
}