From b8f8eeb8a6fb0c50773e494068e8a1bb9754739a Mon Sep 17 00:00:00 2001
From: cheng <1821349743@qq.com>
Date: 星期日, 25 八月 2024 14:15:19 +0800
Subject: [PATCH] 获取表达输入性控件

---
 src/main/java/com/product/mobile/core/service/FaceMobileService.java |   41 +++++++++++++++++++++++++++++++++++------
 1 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/product/mobile/core/service/FaceMobileService.java b/src/main/java/com/product/mobile/core/service/FaceMobileService.java
index 310b02f..bb12302 100644
--- a/src/main/java/com/product/mobile/core/service/FaceMobileService.java
+++ b/src/main/java/com/product/mobile/core/service/FaceMobileService.java
@@ -10,11 +10,9 @@
 import com.product.core.entity.FieldSetEntity;
 import com.product.core.exception.BaseException;
 import com.product.core.service.support.AbstractBaseService;
-import com.product.face.util.FaceUtil;
 import com.product.mobile.core.config.MobileCoreCode;
 import com.product.mobile.core.entity.FaceFieldEntity;
 import com.product.tool.flow.config.CmnConst;
-import com.product.tool.flow.config.FlowCode;
 import com.product.tool.flow.service.FlowDetailService;
 import com.product.util.BaseUtil;
 import org.springframework.stereotype.Service;
@@ -33,7 +31,23 @@
 	@Resource
 	FlowDetailService flowDetailService;
 
-	public List<FaceFieldEntity> getFaceField(FieldSetEntity fse) throws BaseException {
+	public List<FaceFieldEntity> getFaceFieldByTable(FieldSetEntity fse) {
+		String tableUuid = fse.getString("table_uuid");
+		if (StringUtils.isEmpty(tableUuid)) {
+			FieldSetEntity tableInfo = BaseUtil.getSingleInfoByCache("鎵�鏈夎〃淇℃伅", new String[]{fse.getString("table_name")});
+			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=?", new Object[]{tableUuid}, true);
+		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");
@@ -65,7 +79,10 @@
 			} while (false);
 
 		}
+		return getFaceField(faceFse);
+	}
 
+	private List<FaceFieldEntity> getFaceField(FieldSetEntity faceFse) {
 		if (FieldSetEntity.isEmpty(faceFse) || DataTableEntity.isEmpty(faceFse.getSubDataTable("product_sys_face_control_property"))) {
 			throw new BaseException(MobileCoreCode.GET_FACE_CONFIG_FAIL);
 		}
@@ -116,18 +133,30 @@
 				if ("__vModel__".equals(setEntity.getString("property_name"))) {
 					result.add(faceFieldEntity);
 					propertyName = "fieldName";
+				}else if ("defaultNow".equals(propertyName)){
+					propertyName="defaultValue";
 				}
 				propertyName = StrUtil.toCamelCase(propertyName);
 				if (ReflectUtil.hasField(FaceFieldEntity.class, propertyName)) {
-					ReflectUtil.setFieldValue(faceFieldEntity, propertyName, setEntity.getObject("property_value"));
+					if ("defaultValue".equals(propertyName)) {
+						ReflectUtil.setFieldValue(faceFieldEntity, propertyName, setEntity.getBoolean("property_value"));
+						continue;
+					} else {
+						ReflectUtil.setFieldValue(faceFieldEntity, propertyName, setEntity.getObject("property_value"));
+					}
+
 				}
+				System.out.println(propertyName);
+			}
+			if (StringUtils.isEmpty(faceFieldEntity.getFieldName())) {
+				result.remove(faceFieldEntity);
+				continue;
 			}
 			List<FieldSetEntity> configGroup = groupMap.get(groupUuid);
 			for (FieldSetEntity setEntity : configGroup) {
 				//鎵惧埌灞炴�у悕绉�= __vModel__
 				String propertyName = setEntity.getString("property_name");
 				if ("tag".equals(propertyName)) {
-					result.add(faceFieldEntity);
 					propertyName = "component_type";
 				} else if ("field".equals(propertyName)) {
 					propertyName = "fileField";
@@ -141,7 +170,7 @@
 			}
 
 		}
-
 		return result;
 	}
+
 }

--
Gitblit v1.9.2