|
|
|
@ -6,6 +6,7 @@ import com.engine.organization.entity.TopTab;
|
|
|
|
|
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
|
|
|
|
import com.engine.organization.entity.extend.ExtendInfoOperateType;
|
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
|
|
|
|
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
|
|
|
@ -116,10 +117,15 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Map<String, Object>> getExtendTables(User user, String extendType, String tableName, long id, int viewAttr, boolean showLabel) {
|
|
|
|
|
public List<Map<String, Object>> getExtendTables(User user, String extendType, Long groupId, String tableName, long id, int viewAttr, boolean showLabel) {
|
|
|
|
|
List<Map<String, Object>> tables = new ArrayList<>();
|
|
|
|
|
List<ExtendInfoPO> infoPOList = new ArrayList<>();
|
|
|
|
|
// 查询明细表
|
|
|
|
|
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listGroupByPid(groupId);
|
|
|
|
|
for (ExtendGroupPO extendGroup : extendGroupList) {
|
|
|
|
|
infoPOList.addAll(getExtendInfoMapper().listFields(extendType, extendGroup.getId() + "", tableName, ""));
|
|
|
|
|
}
|
|
|
|
|
// 查询所有分布模块,拓展明细表信息
|
|
|
|
|
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, "");
|
|
|
|
|
Map<Long, List<ExtendInfoPO>> groupMap = infoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId));
|
|
|
|
|
// 遍历Map,组装数据
|
|
|
|
|
for (Map.Entry<Long, List<ExtendInfoPO>> entry : groupMap.entrySet()) {
|
|
|
|
@ -132,7 +138,7 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|
|
|
|
|
|
|
|
|
// 浏览按钮添加filespan字段
|
|
|
|
|
String fields = entry.getValue().stream().map(item -> {
|
|
|
|
|
if (BROWSER_TYPE == item.getControlType()) {
|
|
|
|
|
if (BROWSER_TYPE.equals(item.getControlType())) {
|
|
|
|
|
return item.getFieldName() + "," + item.getFieldName() + "span";
|
|
|
|
|
}
|
|
|
|
|
return item.getFieldName();
|
|
|
|
@ -160,12 +166,15 @@ public class ExtServiceImpl extends Service implements ExtService {
|
|
|
|
|
infoPOList.addAll(infoPOList1);
|
|
|
|
|
List<Long> ids = infoPOList.stream().map(ExtendInfoPO::getExtendGroupId).collect(Collectors.toList());
|
|
|
|
|
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByIds(ids);
|
|
|
|
|
Set<Long> extendGroups = extendTitles.stream().map(ExtendTitlePO::getGroupId).collect(Collectors.toSet());
|
|
|
|
|
Set<Long> groupIds = extendTitles.stream().map(ExtendTitlePO::getGroupId).collect(Collectors.toSet());
|
|
|
|
|
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listByType(extendType);
|
|
|
|
|
|
|
|
|
|
// 拓展信息
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendGroups)) {
|
|
|
|
|
for (Long groupId : extendGroups) {
|
|
|
|
|
topTabs.add(TopTab.builder().color("#000000").groupId(groupId + "").showcount(false).title(getExtendGroupMapper().getGroupNameById(groupId + "")).viewCondition(groupId + "").build());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(extendGroupList) && CollectionUtils.isNotEmpty(groupIds)) {
|
|
|
|
|
for (ExtendGroupPO extendGroup : extendGroupList) {
|
|
|
|
|
if (groupIds.contains(extendGroup.getId())) {
|
|
|
|
|
topTabs.add(TopTab.builder().color("#000000").groupId(extendGroup.getId().toString()).showcount(false).title(extendGroup.getGroupName()).viewCondition(extendGroup.getId().toString()).build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return topTabs;
|
|
|
|
|