| | |
| | | |
| | | @Resource |
| | | private IFaceDesignService faceDesignService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 表单列表左侧树 |
| | | * |
| | |
| | | @PostMapping("/tree-face/{version}") |
| | | @ApiVersion(1) |
| | | public String faceListTree() { |
| | | // 获取所有表数据、所有表单数据 |
| | | DataTableEntity tableData = faceDesignService.listAllTable(); |
| | | DataTableEntity tablePage = faceDesignService.listAllDesignFace(); |
| | | if (!DataTableEntity.isEmpty(tableData) && !DataTableEntity.isEmpty(tablePage)) { |
| | | for (int i = 0; i < tableData.getRows(); i++) { |
| | | FieldSetEntity fseTable = tableData.getFieldSetEntity(i); |
| | | fseTable.setValue("value", fseTable.getUUID()); |
| | | // 子集容器 |
| | | DataTableEntity dtChildren = new DataTableEntity(); |
| | | for (int j = 0; j < tablePage.getRows(); j++) { |
| | | FieldSetEntity fsePage = tablePage.getFieldSetEntity(j); |
| | | fsePage.setValue("value", fsePage.getUUID()); |
| | | fsePage.setTableName("children"); |
| | | if ((fseTable.getUUID()).equals(fsePage.getString( "table_uuid"))) { |
| | | dtChildren.addFieldSetEntity(fsePage); |
| | | } |
| | | } |
| | | fseTable.addSubDataTable(dtChildren); |
| | | } |
| | | } |
| | | return success(tableData); |
| | | } |
| | | @PostMapping("/tree-face2/{version}") |
| | | @ApiVersion(1) |
| | | public String faceListTree2() { |
| | | DataTableEntity tableInfoData = DataPoolCacheImpl.getInstance().getCacheData("所有表信息"); |
| | | List<Map<String, Object>> resultList = new ArrayList<>(); |
| | | if (!DataTableEntity.isEmpty(tableInfoData)) { |
| | |
| | | private String getFieldName(Map<String, List<String>> tableAlias,Map<String, List<String>> aliasField, Map<String, List<String>> tableAndField, String fieldName) { |
| | | String table=null; |
| | | boolean b=false; |
| | | if(!tableAndField.isEmpty()) { |
| | | if(tableAndField!=null && !tableAndField.isEmpty()) { |
| | | for(String key:tableAndField.keySet()) { |
| | | for(String field:tableAndField.get(key)) { |
| | | if(fieldName.equals(field)) { |
| | | |
| | | List<String>alias=tableAlias.get(key); |
| | | if(!alias.isEmpty()) { |
| | | if(alias!=null && !alias.isEmpty()) { |
| | | table=alias.get(0);//取第一个别名 |
| | | } |
| | | b=true; |
| | |
| | | import com.product.face.config.FaceConst; |
| | | import com.product.face.service.ide.IFaceDesignService; |
| | | import com.product.face.util.FaceUtil; |
| | | import com.product.file.config.CmnConst; |
| | | import com.product.util.BaseUtil; |
| | | import org.apache.poi.hdgf.pointers.Pointer; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | |
| | | @Resource |
| | | public PublicService publicService; |
| | | |
| | | public DataTableEntity listAllTable(){ |
| | | return getBaseDao().listTable("product_sys_datamodel_table", null, "table_type ASC"); |
| | | } |
| | | |
| | | public DataTableEntity listAllDesignFace(){ |
| | | return getBaseDao().listTable(FaceConst.TABLE_FACE_CONFIG); |
| | | } |
| | | |
| | | /** |
| | | * 获取表单配置详情 |
| | | * |
| | |
| | | face = JSON.parseObject(JSON.toJSONString(RedisUtil.get(FaceConst.FACE_LIST_KEY + faceUuid)), FaceListEntity.class); |
| | | } |
| | | if (face != null) { |
| | | String tableAlias = null; |
| | | String tableName = face.getTableName(); |
| | | List<String> t = aliasTable.get(tableName); |
| | | if (t != null && t.size() > 0) { |
| | | tableAlias = t.get(0); |
| | | } |
| | | // String tableAlias = null; |
| | | // String tableName = face.getTableName(); |
| | | // List<String> t = aliasTable.get(tableName); |
| | | // if (t != null && t.size() > 0) { |
| | | // tableAlias = t.get(0); |
| | | // } |
| | | Map<String, List<String>> params = face.getFilters(aliasTable, aliasField,tableOfField); |
| | | List<String> fieldNames = params.get("fields"); |
| | | List<String> filters = params.get("filter"); |
| | |
| | | * @throws BaseException |
| | | */ |
| | | void deleteFace(FieldSetEntity fse) throws BaseException; |
| | | |
| | | |
| | | /** |
| | | * 获取所有设计页面 |
| | | * @return |
| | | * @throws BaseException |
| | | */ |
| | | DataTableEntity listAllDesignFace() throws BaseException; |
| | | /** |
| | | * 获取所有设计页面 |
| | | * @return |
| | | * @throws BaseException |
| | | */ |
| | | DataTableEntity listAllTable() throws BaseException; |
| | | } |