| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author cheng |
| | |
| | | |
| | | Object o = getFaceFieldByTable(fse); |
| | | if (o instanceof FaceListEntity) { |
| | | return o; |
| | | FaceListEntity faceListEntity = (FaceListEntity) o; |
| | | List<FaceListEntity.FaceField> faceFieldList = faceListEntity.getFaceFields(); |
| | | List<JSONObject> objList = faceFieldList.stream().map(faceField -> { |
| | | JSONObject obj = JSONObject.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(faceField)); |
| | | obj.put("name", obj.getString("columnName")); |
| | | obj.put("field", obj.getString("fieldName")); |
| | | return obj; |
| | | }).collect(Collectors.toList()); |
| | | return objList; |
| | | } |
| | | List<FaceFieldEntity> ls = (List<FaceFieldEntity>) o; |
| | | if (ls == null) ls = new ArrayList<FaceFieldEntity>(); |
| | | addproperty(tableUuid, fse.getString("table_name"), ls); |
| | | //所有表单uuid自动添加,并为hidden |
| | | |
| | | // 移动端若是没有配置表单信息,那么就最多显示10个字段,且需要剔除到部分字段 |
| | | String clientType = fse.getString("client_type"); |
| | | if ("app".equals(clientType)) { |
| | | List<String> exceptList = Arrays.asList("uuid", "org_level_uuid", "created_by", "created_utc_datetime"); |
| | | ls = ls.stream().filter(obj -> !exceptList.contains(obj.getField())).collect(Collectors.toList()); |
| | | if (ls.size() > 10) { |
| | | ls = ls.subList(0, 10); |
| | | } |
| | | } |
| | | return ls; |
| | | |
| | | } |
| | |
| | | throw new BaseException(MobileCoreCode.SYSTEM_FORM_COUNT); |
| | | } |
| | | String faceType = BaseUtil.ifNull(fse.getString("face_type"), "2"); |
| | | FieldSetEntity faceFse = getBaseDao().getFieldSetByFilter("product_sys_face", "table_uuid=? and face_type=?", new Object[]{tableUuid, faceType}, true); |
| | | String faceNumber = fse.getString("face_number"); |
| | | String filter = "table_uuid=? and face_type=? AND LENGTH(IFNULL(face_number,''))>0"; |
| | | Object[] paramArr = new Object[]{tableUuid, faceType}; |
| | | if (!StringUtils.isEmpty(faceNumber)) { |
| | | filter = "face_number=?"; |
| | | paramArr = new Object[]{faceNumber}; |
| | | } |
| | | FieldSetEntity faceFse = getBaseDao().getFieldSetByFilter("product_sys_face", filter, paramArr, true); |
| | | faceFse.setTableName(tableName); |
| | | if ("1".equals(faceType) && !FieldSetEntity.isEmpty(faceFse)) { |
| | | //列表 |