许鹏程
2024-10-08 d94ade5a7cee4d3067e4c3b05cbb2e3c9d2f68fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
package com.product.mobile.core.service;
 
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.drew.metadata.Face;
import com.google.common.collect.Sets;
import com.product.common.lang.StringUtils;
import com.product.core.cache.DataPoolCacheImpl;
import com.product.core.dao.BaseDao;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.exception.BaseException;
import com.product.core.service.support.AbstractBaseService;
import com.product.mobile.core.config.MobileCoreCode;
import com.product.mobile.core.config.MobileCoreConst;
import com.product.mobile.core.entity.FaceFieldEntity;
import com.product.tool.flow.config.CmnConst;
import com.product.tool.flow.service.FlowDetailService;
import com.product.util.BaseUtil;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.io.File;
import java.nio.charset.Charset;
import java.util.*;
 
/**
 * @Author cheng
 * @Date 2024/8/15 10:21
 * @Desc
 */
@Service
public class FaceMobileService extends AbstractBaseService {
 
    @Resource
    FlowDetailService flowDetailService;
 
    @Autowired
    public BaseDao baseDao;
 
    ///获取表单总入口
    /**
     *
     * @param fse传入表名,或 表UUID
     * @return
     */
    public List<FaceFieldEntity> getFaceConfig(FieldSetEntity fse) {
 
        String tableUuid=fse.getString("table_uuid");
        if (tableUuid==null && StringUtils.isNotEmpty(fse.getString("uuid"))
                && StringUtils.isEmpty(fse.getString("table_name"))) {
            //通过业务表信息查表单信息
            FieldSetEntity detailFse = getBaseDao().getFieldSetEntity(CmnConst.TABLE_FLOW_DETAIL, fse.getString(CmnConst.FIELD_UUID), false);
            if(detailFse!=null) {
                //获取表名
                fse.setValue("table_name", detailFse.getString("table_name"));
            }
 
        }
        //通过审批任务的uuid来查表单信息
        if (tableUuid==null && StringUtils.isNotEmpty(fse.getString("table_name"))) {
            FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息", new String[]{fse.getString("table_name")});
            if (!FieldSetEntity.isEmpty(tableInfo)) {
                tableUuid = tableInfo.getString("uuid");
                fse.setValue("table_uuid", tableUuid);
            }
        }
 
        if(tableUuid!=null && fse.getString("table_name")==null) {
 
            FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息(uuid)", new String[]{tableUuid});
            if (!FieldSetEntity.isEmpty(tableInfo)) {
                //获取表名
                fse.setValue("table_name", tableInfo.getString("table_name"));
            }
        }
 
        List<FaceFieldEntity> ls=getFaceFieldByTable(fse);
        if(ls==null)ls=new ArrayList<FaceFieldEntity>();
        addproperty(tableUuid,fse.getString("table_name"),ls);
        //所有表单uuid自动添加,并为hidden
        return ls;
 
    }
    //递归把主表和子表的字段属性添加进去,如果没有配表单,则取表数据结构进行展示
    /**
     *
     * @param ls查出来的表单信息
     * @param tables 记录的所有表,对应的表单信息
     */
    private void  addproperty(String table_uuid,String table_name,List<FaceFieldEntity> ls) {
        if(ls.size()>0) {
            for(int i=0;i<ls.size();i++) {
                String subTableName=ls.get(i).getSubTableName();///可能是子表
                if(StringUtils.isEmpty(subTableName)) {///主表字段
                    DataTableEntity dt = DataPoolCacheImpl.getInstance().getCacheData("表字段信息"
                            ,new String[] {table_uuid,ls.get(i).getField()});
 
                    if(!DataTableEntity.isEmpty(dt)) {
//                        if(StringUtils.isEmpty(ls.get(i).getType())) {
//                            ls.get(i).setType(dt.getFieldSetEntity(0).getString("field_type"));
//                        }
                        if(StringUtils.isEmpty(ls.get(i).getPrompt()) &&
                                !StringUtils.isEmpty(dt.getFieldSetEntity(0).getString("field_reference"))) {
                            ls.get(i).setPrompt(dt.getFieldSetEntity(0).getString("field_reference"));
                        }
                        if(StringUtils.isEmpty(ls.get(i).getRequired()) &&
                                !StringUtils.isEmpty(dt.getFieldSetEntity(0).getString("is_required"))) {
                            ls.get(i).setRequired(dt.getFieldSetEntity(0).getString("is_required"));
                        }
                        if(StringUtils.isEmpty(ls.get(i).getName()) &&
                                !StringUtils.isEmpty(dt.getFieldSetEntity(0).getString("field_show_name"))) {
                            ls.get(i).setName(dt.getFieldSetEntity(0).getString("field_show_name"));
                        }
                    }
                    ls.get(i).setTable(table_name);
                }else {
                    //============把子表字段也处理一下
                    //子表
                    FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息", new String[]{subTableName});
                    if (!FieldSetEntity.isEmpty(tableInfo)) {
                        addproperty(tableInfo.getString("uuid"),tableInfo.getString("table_name"),ls.get(i).getSubField());
                    }
                }
 
            }
            DataTableEntity dt = DataPoolCacheImpl.getInstance().getCacheData("表字段信息",new String[] {table_uuid,"uuid"});
            if(!DataTableEntity.isEmpty(dt)) {
                FaceFieldEntity uuid=new FaceFieldEntity();
                uuid.setComponentType("uuid");
                uuid.setField("uuid");
                uuid.setName("编  码");
                uuid.setType("String");
                uuid.setTable(table_name);
                uuid.setHidden("1");
                ls.add(uuid);
            }
 
        }else {///以表单设计为准,如果没有配置表单,则以数据表为准,全部保留
            toConvertFace(table_uuid,table_name,ls,null);
            //返回子表
            Object [][]sub=baseDao.getSubTableName(table_name);
            if(sub!=null && sub.length>0&&sub[0].length>0) {
                for(int i=0;i<sub[0].length;i++) {
                    toConvertFace(sub[0][i].toString(),sub[1][i].toString(),new ArrayList<FaceFieldEntity>(),ls);
                }
            }
 
        }
    }
    /**
     * 数据库表字段定义转换成表单定义
     * @param table_uuid
     * @param table_name
     * @param ls
     * @param pls 父界面
     */
    private void toConvertFace(String table_uuid,String table_name,List<FaceFieldEntity> ls,List<FaceFieldEntity> pls) {
        if(ls==null) {
            ls=new ArrayList<FaceFieldEntity>();
        }
        DataTableEntity dte = DataPoolCacheImpl.getInstance().getCacheData("所有字段信息并按表分组",new String[] {table_uuid});
        for(int j=0;j<dte.getRows();j++) {
            FaceFieldEntity uuid=new FaceFieldEntity();
            FieldSetEntity f=dte.getFieldSetEntity(j);
            if("pk".equals(f.getString("field_type"))
                    ||"updated_by".equals(f.getString("field_name"))
                    ||"updated_utc_datetime".equals(f.getString("field_name"))) {
                continue;
            }
            if("uuid".equals(f.getString("field_name"))) {
                uuid.setHidden("1");
            }
            if("userids".equals(f.getString("field_type")) ||"orgUuids".equals(f.getString("field_type")) ) {
                uuid.setMultiple("1");
            }else {
                uuid.setMultiple("0");
            }
 
            uuid.setComponentType("");
            uuid.setPrompt(f.getString("field_reference"));
            uuid.setName(f.getString("field_show_name"));
            uuid.setField(f.getString("field_name"));
            uuid.setType(f.getString("field_type"));
            uuid.setTable(table_name);
            ls.add(uuid);
        }
        if(pls!=null) {
            FaceFieldEntity uuid=new FaceFieldEntity();
            uuid.setHidden("");
            uuid.setComponentType("subTable");
            uuid.setPrompt("");
            uuid.setName("");
            uuid.setField("");
            uuid.setType("");
            uuid.setSubField(ls);
            uuid.setSubTableName(table_name);
            pls.add(uuid);
        }
    }
 
    public List<FaceFieldEntity> getFaceFieldByTable(FieldSetEntity fse) {
        String tableUuid = fse.getString("table_uuid");
        String tableName = fse.getString("table_name");
        if (StringUtils.isEmpty(tableUuid) && !StringUtils.isEmpty(tableName)) {
            FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息", new String[]{tableName});
            if (!FieldSetEntity.isEmpty(tableInfo)) {
                tableUuid = tableInfo.getString("uuid");
            }
        }
        if (StringUtils.isEmpty(tableUuid)) {
            throw new BaseException(MobileCoreCode.SYSTEM_FORM_COUNT);
        }
        FieldSetEntity faceFse = getBaseDao().getFieldSetByFilter("product_sys_face", "table_uuid=? and face_type=2", new Object[]{tableUuid}, true);
        faceFse.setTableName(tableName);
        return getFaceField(faceFse);
    }
 
 
    public List<FaceFieldEntity> getFlowFaceField(FieldSetEntity fse) throws BaseException {
        String flowBusinessForm = flowDetailService.getFlowBusinessForm(fse);
        JSONObject jsonObject = JSON.parseObject(flowBusinessForm);
        JSONObject data = jsonObject.getJSONObject("data");
        FieldSetEntity faceFse = null;
        if (data != null && !StringUtils.isEmpty(data.getString("face_number"))) {
            if (!StringUtils.isEmpty(data.getString("face_number"))) {
                faceFse = getBaseDao().getFieldSetEntityByFilter("product_sys_face", "face_number=?", new Object[]{data.getString("face_number")}, true);
            }
        } else {
            do {
                //根据流程获取表名
                FieldSetEntity detailFse;
                if (CmnConst.TABLE_FLOW_TASK.equals(fse.getTableName())) {
                    detailFse = getBaseDao().getFieldSetEntityByFilter(CmnConst.TABLE_FLOW_DETAIL, "task_uuid=? and source_uuid is null", new Object[]{fse.getUUID()}, false);
                } else {
                    detailFse = getBaseDao().getFieldSetEntity(CmnConst.TABLE_FLOW_DETAIL, fse.getString(CmnConst.FIELD_UUID), false);
                }
                if (FieldSetEntity.isEmpty(detailFse)) {
                    break;
                }
                //获取表名
                String tableName = detailFse.getString("table_name");
                FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("所有表信息", new String[]{tableName});
                if (FieldSetEntity.isEmpty(tableInfo)) {
                    break;
                }
                String tableUuid = tableInfo.getString("uuid");
                faceFse = getBaseDao().getFieldSetByFilter("product_sys_face", "table_uuid=?", new Object[]{tableUuid}, true);
            } while (false);
 
        }
        return getFaceField(faceFse);
    }
 
    private List<FaceFieldEntity> getFaceField(FieldSetEntity faceFse) {
        if (FieldSetEntity.isEmpty(faceFse) || DataTableEntity.isEmpty(faceFse.getSubDataTable("product_sys_face_control_property"))) {
            return null;
//            throw new BaseException(MobileCoreCode.GET_FACE_CONFIG_FAIL);
        }
 
        DataTableEntity productSysFaceControlProperty = faceFse.getSubDataTable("product_sys_face_control_property");
        List<FieldSetEntity> tagFieldSetEntityList = new ArrayList<>();
        //根据group_uuid 分组
        Map<String, List<FieldSetEntity>> groupMap = new HashMap<>();
        Map<String, List<FieldSetEntity>> parentMap = new HashMap<>();
        for (FieldSetEntity fieldSetEntity : productSysFaceControlProperty.getData()) {
            String groupUuid = fieldSetEntity.getString("group_uuid");
            String parentUuid = fieldSetEntity.getString("parent_uuid");
            if (!StringUtils.isEmpty(parentUuid)) {
                List<FieldSetEntity> fieldSetEntities = parentMap.get(parentUuid);
                if (fieldSetEntities == null) {
                    fieldSetEntities = new ArrayList<>();
                    parentMap.put(parentUuid, fieldSetEntities);
                }
                fieldSetEntities.add(fieldSetEntity);
            }
            if ("tag".equals(fieldSetEntity.getString("property_name"))) {
                tagFieldSetEntityList.add(fieldSetEntity);
            }
            if (StringUtils.isEmpty(groupUuid)) {
                continue;
            }
            if (!groupMap.containsKey(groupUuid)) {
                groupMap.put(groupUuid, new ArrayList<>());
            }
            groupMap.get(groupUuid).add(fieldSetEntity);
        }
 
        if (CollectionUtil.isEmpty(groupMap)) {
            throw new BaseException(MobileCoreCode.GET_FACE_CONFIG_FAIL);
        }
 
        List<FaceFieldEntity> result = new ArrayList<>();
        List<List<FieldSetEntity>> subTableField = new ArrayList<>();
        for (FieldSetEntity fs : tagFieldSetEntityList) {
            String groupUuid = fs.getString("group_uuid");
            String parentUuid = fs.getString("parent_uuid");
            if (StringUtils.isEmpty(groupUuid) || StringUtils.isEmpty(parentUuid)) {
                continue;
            }
            List<FieldSetEntity> fieldSetEntity = productSysFaceControlProperty.getFieldSetEntity(parentUuid);
            if (CollectionUtil.isEmpty(fieldSetEntity)) {
                continue;
            }
 
            to(groupMap, fieldSetEntity, subTableField, result, parentMap);
        }
        if (!CollectionUtil.isEmpty(subTableField)) {
            //根据子表表名装载
            Map<String, FaceFieldEntity> tableByFaceField = new HashMap<>();
            for (List<FieldSetEntity> fieldSetEntities : subTableField) {
                String parentUuid = fieldSetEntities.get(0).getString("parent_uuid");
                //先找到children
                List<FieldSetEntity> fieldSetEntity = productSysFaceControlProperty.getFieldSetEntity(parentUuid);
                if (CollectionUtil.isEmpty(fieldSetEntities)) {
                    continue;
                }
                //找到了children
                FieldSetEntity fieldSetEntity1 = fieldSetEntity.get(0);
                String p = fieldSetEntity1.getString("parent_uuid");
                String cGroupUuid = fieldSetEntity1.getString("group_uuid");
                if (StringUtils.isEmpty(p) || StringUtils.isEmpty(cGroupUuid)) {
                    continue;
                }
                List<FieldSetEntity> childrenGroup = groupMap.get(cGroupUuid);
                List<FieldSetEntity> fieldSetEntity2 = productSysFaceControlProperty.getFieldSetEntity(p);
                if (CollectionUtil.isEmpty(fieldSetEntity2) || CollectionUtil.isEmpty(childrenGroup)) {
                    continue;
                }
                //找到了 __config__
                FieldSetEntity fieldSetEntity3 = fieldSetEntity2.get(0);
                String groupUuid = fieldSetEntity3.getString("group_uuid");
                if (StringUtils.isEmpty(groupUuid)) {
                    continue;
                }
                String uuid = fieldSetEntity3.getUUID();
 
                FaceFieldEntity faceFieldEntity = tableByFaceField.get(uuid);
                if (faceFieldEntity == null) {
                    faceFieldEntity = new FaceFieldEntity();
                }
                faceFieldEntity.setComponentType("subTable");
                boolean isSub = CollectionUtil.isNotEmpty(faceFieldEntity.getSubField());
                if (!isSub) {
                    for (FieldSetEntity setEntity : childrenGroup) {
                        String propertyName = setEntity.getString("property_name");
                        if ("tag".equals(propertyName) && "lx-form-sub-table".equals(setEntity.getString("property_value"))) {
                            isSub = true;
                            break;
                        }
                    }
                }
                if (!isSub) {
                    //不是子表组件
                    continue;
                }
                for (FieldSetEntity setEntity : groupMap.get(groupUuid)) {
                    String propertyName = setEntity.getString("property_name");
                    if ("subTableName".equals(propertyName)) {
                        faceFieldEntity.setSubTableName(setEntity.getString("property_value"));
                        tableByFaceField.put(faceFieldEntity.getSubTableName(), faceFieldEntity);
                    } else if ("add".equals(propertyName)) {
                        faceFieldEntity.setAllowAdd(setEntity.getBoolean("property_value"));
                    } else if ("delete".equals(propertyName)) {
                        faceFieldEntity.setAllowDelete(setEntity.getBoolean("property_value"));
                    }
                }
                List<FaceFieldEntity> subFieldList = faceFieldEntity.getSubField();
                if (CollectionUtil.isEmpty(subFieldList)) {
                    subFieldList = new ArrayList<>();
                    faceFieldEntity.setSubField(subFieldList);
                }
 
                for (List<FieldSetEntity> setEntities : subTableField) {
                    to(groupMap, setEntities, null, subFieldList, parentMap);
                }
                if (!tableByFaceField.containsKey(uuid)) {
                    tableByFaceField.put(uuid, faceFieldEntity);
                    result.add(faceFieldEntity);
                }
                break;
 
            }
        }
        return result;
    }
 
    public static void main(String[] args) {
 
        String textFilePath = "d:\\Desktop\\新建 文本文档 (2).txt";
 
        List<String> lines = FileUtil.readLines(new File(textFilePath), CharsetUtil.defaultCharset());
        for (int i = 0; i < lines.size(); i++) {
            //UPDATE `product_db_lift`.`product_sys_datamodel_table` SET `uuid` = '4503ea5c-1e10-40b6-a2b4-79760eea6474', `table_name` = 'product_deivce_failure_level_config', `table_description` = '设备故障等级配置', `table_primary_key` = NULL, `container_name` = NULL, `table_base_view` = NULL, `view_sql` = NULL, `org_level_uuid` = NULL, `is_international` = NULL, `table_type` = '1', `created_by` = '1', `created_utc_datetime` = '2024-08-09 00:00:00', `updated_by` = '1', `updated_utc_datetime` = '2024-08-09 00:00:00', `produce_msg` = NULL, `sequence` = 2, `view_status` = NULL WHERE `table_id` = 5300;
            String line = lines.get(i);
            line = line.replaceAll("`", "");
            String start = line.substring(line.indexOf("SET") + 3, line.indexOf("WHERE"));
            String[] split = start.split(",");
            Map<String, String> map = new HashMap<>();
            for (String s : split) {
                String[] split1 = s.split("=");
                String value = split1.length == 1 ? null : split1[1].trim();
                if ("null".equalsIgnoreCase(value)) {
                    value = null;
                }
                map.put(split1[0].trim(), value);
 
            }
            lines.set(i, lines.get(i).substring(0, lines.get(i).indexOf("WHERE")) + " WHERE `uuid`=" + map.get("uuid") + ";");
        }
        FileUtil.writeLines(lines, textFilePath, CharsetUtil.defaultCharset());
    }
 
 
    private void to(Map<String, List<FieldSetEntity>> groupMap, List<FieldSetEntity> fieldSetEntity, List<List<FieldSetEntity>> subTableField, List<FaceFieldEntity> result, Map<String, List<FieldSetEntity>> parentMap) {
        FieldSetEntity parent = fieldSetEntity.get(0);
        String groupUuid1 = parent.getString("group_uuid");
        if (StringUtils.isEmpty(groupUuid1)) {
            return;
        }
        List<FieldSetEntity> parentGroup = groupMap.get(groupUuid1);
        FaceFieldEntity faceFieldEntity = new FaceFieldEntity();
        String __config__ = null;
        List<FieldSetEntity> other = null;
        do {
            for (FieldSetEntity setEntity : parentGroup) {
                //找到属性名称= __vModel__
                String propertyName = setEntity.getString("property_name");
                if ("parentType".equals(propertyName) && "subTable".equals(setEntity.getString("property_value")) && subTableField != null) {
                    //子表字段
                    subTableField.add(parentGroup);
                    result.remove(faceFieldEntity);
                    break;
                }
                if ("__vModel__".equals(setEntity.getString("property_name"))) {
                    result.add(faceFieldEntity);
                    propertyName = "field";
                } else if ("label".equals(setEntity.getString("property_name"))) {
                    propertyName = "name";
                } else if ("advanceName".equals(setEntity.getString("property_name"))) {
                    propertyName = "field";
                } else if ("__config__".equals(propertyName)) {
                    __config__ = setEntity.getUUID();
                }
                if (!StringUtils.isAnyEmpty(__config__)) {
                    //读取子表属性
                    if (parentMap != null) {
                        other = parentMap.get(__config__);
                    }
                }
                propertyName = StrUtil.toCamelCase(propertyName);
                if (ReflectUtil.hasField(FaceFieldEntity.class, propertyName) && !"field".equals(setEntity.getString("property_name"))) {
                    ReflectUtil.setFieldValue(faceFieldEntity, propertyName, setEntity.getObject("property_value"));
 
                } else if (!StringUtils.isEmpty(setEntity.getObject("property_value"))) {
                    //判断是否
                    faceFieldEntity.putOtherParam(propertyName, setEntity.getObject("property_value"));
                }
            }
            if (StringUtils.isEmpty(faceFieldEntity.getField())) {
                return;
            }
            if (parentGroup == other) {
                break;
            }
            if (other != null) {
                parentGroup = other;
                parentMap = null;
            }
        } while (other != null);
        Set<FieldSetEntity> configGroup = Sets.newHashSet(groupMap.get(fieldSetEntity.get(0).getString("group_uuid")));
        if (other != null) {
            if (configGroup == null) {
                configGroup = Sets.newHashSet(other);
            } else {
                configGroup.addAll(other);
            }
        }
        parentGroup = groupMap.get(groupUuid1);
        if (configGroup != null && parentGroup != null) {
            configGroup.addAll(parentGroup);
        }
 
        for (FieldSetEntity setEntity : configGroup) {
            //找到属性名称= __vModel__
            String propertyName = setEntity.getString("property_name");
            if ("tag".equals(propertyName)) {
                propertyName = "component_type";
            } else if ("field".equals(propertyName)) {
                propertyName = "fileField";
            } else if ("tableName".equals(propertyName)) {
                propertyName = "fileTableName";
            }
            propertyName = StrUtil.toCamelCase(propertyName);
            if (ReflectUtil.hasField(FaceFieldEntity.class, propertyName)) {
                ReflectUtil.setFieldValue(faceFieldEntity, propertyName, setEntity.getObject("property_value"));
            }
        }
    }
 
}