From 9d2b1757355487ce1d1b92b05182fbeac5b3a1ad Mon Sep 17 00:00:00 2001
From: 许鹏程 <1821349743@qq.com>
Date: 星期五, 23 八月 2024 11:31:19 +0800
Subject: [PATCH] mobiel face
---
src/main/java/com/product/mobile/core/service/FaceMobileService.java | 25 +++++++++++++++++++++----
src/main/java/com/product/mobile/core/controller/FaceMobileController.java | 21 ++++++++++++++++++++-
2 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/product/mobile/core/controller/FaceMobileController.java b/src/main/java/com/product/mobile/core/controller/FaceMobileController.java
index 56f530a..7611f03 100644
--- a/src/main/java/com/product/mobile/core/controller/FaceMobileController.java
+++ b/src/main/java/com/product/mobile/core/controller/FaceMobileController.java
@@ -26,6 +26,25 @@
@Resource
FaceMobileService faceMobileService;
+
+ /**
+ * 鑾峰彇琛ㄥ崟鎵�鏈夌粍浠剁殑瀛楁鏍规嵁涓氬姟琛ㄥ悕
+ */
+ @PostMapping("/get-face-field-by-table/{version}")
+ @ApiVersion(1)
+ public String getFaceFieldByTable(HttpServletRequest request) {
+ try {
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+ return BaseUtil.success(faceMobileService.getFlowFaceField(fse));
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return error(MobileCoreCode.GET_FACE_FIELD_FAIL, e);
+ }
+ }
+
/**
* 鑾峰彇琛ㄥ崟鎵�鏈夌粍浠剁殑瀛楁鏍规嵁flow_task 琛� uuid 鎴栬�� flow_detail 琛� uuid
*
@@ -38,7 +57,7 @@
try {
//涓嶉獙璇佷紶鍏ョ殑琛ㄥ悕 鍙兘浼氭槸 product_sys_flow_task/product_sys_flow_detail
FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
- return BaseUtil.success(faceMobileService.getFaceField(fse));
+ return BaseUtil.success(faceMobileService.getFlowFaceField(fse));
} catch (BaseException e) {
e.printStackTrace();
return error(e);
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..435414b 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);
}
@@ -141,7 +158,7 @@
}
}
-
return result;
}
+
}
--
Gitblit v1.9.2