parent
9259596e54
commit
a7e5619097
|
|
@ -31,7 +31,7 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
jcl_field_extendgroup t
|
||||
WHERE t.delete_type = 0
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
<if test=" extendType != null and extendType != '' ">
|
||||
and extend_type = #{extendType}
|
||||
</if>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_field_extendgroup t
|
||||
WHERE t.delete_type = 0
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
and t.pid= #{pid}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
jcl_field_extendtitle t
|
||||
WHERE t.delete_type = 0
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
<if test=" groupId != null ">
|
||||
and group_id = #{groupId}
|
||||
</if>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
jcl_field_extendtitle t
|
||||
WHERE t.delete_type = 0
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,7 @@ public interface ExtService {
|
|||
* @param showLabel
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getExtendTables(User user, String extendType, String tableName, long id, int viewAttr, boolean showLabel);
|
||||
|
||||
List<Map<String, Object>> getExtendTables(User user, String extendType, Long groupId,String tableName, long id, int viewAttr, boolean showLabel);
|
||||
/**
|
||||
* 拓展页面分组
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,4 +24,12 @@ public interface FieldDefinedService {
|
|||
*/
|
||||
Map<String, Object> getTabInfo(String groupType);
|
||||
|
||||
/**
|
||||
* 保存自定义字段
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
int saveFields(String data);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
// 拓展页面分组
|
||||
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_COMPEXT));
|
||||
// 处理明细表
|
||||
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, id, viewAttr, false));
|
||||
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_COMPEXT_DT1, id, viewAttr, false));
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
|
||||
apiDatas.put("result", resultMap);
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
// 拓展页面分组
|
||||
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_DEPTEXT));
|
||||
// 处理明细表
|
||||
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, id, viewAttr, false));
|
||||
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_DEPTEXT_DT1, id, viewAttr, false));
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
|
||||
apiDatas.put("result", resultMap);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
||||
import com.engine.organization.entity.fieldset.TypeTreeDTO;
|
||||
|
|
@ -8,6 +10,8 @@ import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|||
import com.engine.organization.service.FieldDefinedService;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -59,6 +63,17 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
return datas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveFields(String data) {
|
||||
if (StringUtils.isEmpty(data)) {
|
||||
return 0;
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
String groupType = Util.null2String(jsonObject.get("groupType"));
|
||||
String groupId = Util.null2String(jsonObject.get("groupId"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断该分组下是否有字段
|
||||
*
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 拓展页面分组
|
||||
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_JOBEXT));
|
||||
// 处理明细表
|
||||
List<Map<String, Object>> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, id, viewAttr, false);
|
||||
List<Map<String, Object>> extendTables = getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId),JCL_ORG_JOBEXT_DT1, id, viewAttr, false);
|
||||
|
||||
Map<String, Object> tableMap = new HashMap<>();
|
||||
tableMap.put("hide", false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue