| | |
| | | package com.product.face.entity; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.common.collect.Maps; |
| | | import com.product.admin.config.CmnConst; |
| | |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.spring.context.SpringBeanUtil; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.face.config.FaceConst; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.util.BaseUtil; |
| | | |
| | |
| | | * 表名 |
| | | */ |
| | | private String tableName; |
| | | |
| | | /** |
| | | * 是否显示树 |
| | | */ |
| | | private String treeShow; |
| | | |
| | | /** |
| | | * 树数据源类型 |
| | | */ |
| | | private String treeDataType; |
| | | |
| | | /** |
| | | * 数据源 |
| | | */ |
| | | private String treeDataSource; |
| | | |
| | | /** |
| | | * 树label key |
| | | */ |
| | | private String treeLabelKey; |
| | | |
| | | /** |
| | | * 树value key |
| | | */ |
| | | private String treeValueKey; |
| | | |
| | | /** |
| | | * 获取表名 |
| | |
| | | this.faceFields = faceFields; |
| | | } |
| | | |
| | | public void setTableName(String tableName) { |
| | | this.tableName = tableName; |
| | | } |
| | | |
| | | public String getTreeShow() { |
| | | return treeShow; |
| | | } |
| | | |
| | | public void setTreeShow(String treeShow) { |
| | | this.treeShow = treeShow; |
| | | } |
| | | |
| | | public String getTreeDataType() { |
| | | return treeDataType; |
| | | } |
| | | |
| | | public void setTreeDataType(String treeDataType) { |
| | | this.treeDataType = treeDataType; |
| | | } |
| | | |
| | | public String getTreeDataSource() { |
| | | return treeDataSource; |
| | | } |
| | | |
| | | public void setTreeDataSource(String treeDataSource) { |
| | | this.treeDataSource = treeDataSource; |
| | | } |
| | | |
| | | public String getTreeLabelKey() { |
| | | return treeLabelKey; |
| | | } |
| | | |
| | | public void setTreeLabelKey(String treeLabelKey) { |
| | | this.treeLabelKey = treeLabelKey; |
| | | } |
| | | |
| | | public String getTreeValueKey() { |
| | | return treeValueKey; |
| | | } |
| | | |
| | | public void setTreeValueKey(String treeValueKey) { |
| | | this.treeValueKey = treeValueKey; |
| | | } |
| | | |
| | | /** |
| | | * 获取参照条件 |
| | | * |
| | |
| | | } |
| | | //字段名称 |
| | | String fieldName = faceField.getFieldName(); |
| | | if (!StringUtils.isEmpty(fieldName)) { |
| | | fieldName.trim(); |
| | | } |
| | | if (aliasField != null && !StringUtils.isEmpty(fieldName)) { |
| | | List<String> fieldAlias = aliasField.get(getTableName() + "." + fieldName); |
| | | if (fieldAlias != null && fieldAlias.size() > 0) { |
| | | String alias = fieldAlias.get(0); |
| | | if (!StringUtils.isEmpty(alias)) { |
| | | fieldName = alias; |
| | | fieldName = alias.trim(); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | FieldSetEntity ff = prompt.getFieldSetEntity(0); |
| | | StringBuilder p = new StringBuilder(); |
| | | p.append(getFieldName(tableAlias, fieldName)).append("` in ").append(" ( SELECT `").append(ff.getString("value_field")).append("` FROM ").append(ff.getString("source_table")); |
| | | p.append(getFieldName(tableAlias, fieldName)).append(" in ").append(" ( SELECT ").append(ff.getString("value_field")).append(" FROM ").append(ff.getString("source_table")); |
| | | p.append(" WHERE ").append(ff.getString("view_fields")).append(" like concat('%','~val~','%') )"); |
| | | filters.add(p.toString()); |
| | | continue; |
| | |
| | | //获取redis 起始key |
| | | String faceListKey = SystemFaceService.FACE_LIST_KEY; |
| | | //重新放入redis |
| | | RedisUtil.set(faceListKey + getUuid(), this); |
| | | RedisUtil.set(faceListKey + getUuid(), JSON.parseObject(JSON.toJSONString(this), com.product.admin.entity.FaceListEntity.class)); |
| | | return maps; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | } |