| | |
| | | |
| | | |
| | | @Resource |
| | | private PublicService publicService; |
| | | public PublicService publicService; |
| | | |
| | | /** |
| | | * 获取表单配置详情 |
| | |
| | | FieldSetEntity fse = getBaseDao().getFieldSetEntity(FaceConst.TABLE_FACE_CONFIG, uuid, true); |
| | | DataTableEntity fieldPropertyDt = fse.getSubDataTable(FaceConst.TABLE_FACE_FIELD_CONTROL_PROPERTY); |
| | | if (DataTableEntity.isEmpty(fieldPropertyDt)) { |
| | | return null; |
| | | throw new BaseException(ErrorCode.GET_FACE_CONFIG_FAIL); |
| | | } |
| | | List<JSONObject> result = getFaceControlList(fieldPropertyDt); |
| | | Map<String, Object> other = new HashMap<>(); |
| | | other.put("drawingList", result); |
| | | fse.getSubData().clear(); |
| | | return BaseUtil.success(fse, other); |
| | | } |
| | | |
| | | public List<JSONObject> getFaceControlList(DataTableEntity faceControlDt) { |
| | | List<JSONObject> result = new ArrayList<>(); |
| | | List<FieldSetEntity> data = fieldPropertyDt.getData(); |
| | | List<FieldSetEntity> data = faceControlDt.getData(); |
| | | Map<String, List<FieldSetEntity>> collect = data.stream() |
| | | .filter(item -> StringUtils.isEmpty(item.getString(FaceConst.FIELD_PARENT_UUID))) //过滤 取父级 |
| | | // .sorted(Comparator.comparing(item -> item.getInteger(FaceConst.CONTROL_SEQUENCE))) //排序 |
| | |
| | | result.add(getPropertyJson(propertyList, groupContainer)); |
| | | } |
| | | result.sort(Comparator.comparing(item -> item.getInteger(FaceConst.CONTROL_SEQUENCE))); |
| | | System.out.println(result); |
| | | Map<String, Object> other = new HashMap<>(); |
| | | other.put("drawingList", result); |
| | | fse.getSubData().clear(); |
| | | return BaseUtil.success(fse, other); |
| | | return result; |
| | | } |
| | | |
| | | private JSONObject getPropertyJson(List<FieldSetEntity> propertyList, Map<String, List<FieldSetEntity>> groupContainer) { |