|
|
@@ -1,18 +1,25 @@
|
|
|
package com.cloud.sa.flow.commom.service.data;
|
|
|
|
|
|
+
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.cloud.sa.flow.commom.aspect.CacheProgram;
|
|
|
import com.cloud.sa.flow.commom.common.redis.StRedisCache;
|
|
|
import com.cloud.sa.flow.commom.common.system.StUserInfo;
|
|
|
+
|
|
|
import com.cloud.sa.flow.commom.domain.common.RedisKeys;
|
|
|
import com.cloud.sa.flow.commom.domain.entity.StDataTemplate;
|
|
|
+
|
|
|
import com.cloud.sa.flow.commom.domain.mapper.StCommonMapper;
|
|
|
import com.cloud.sa.flow.commom.domain.mapper.StDataTemplateMapper;
|
|
|
+
|
|
|
import com.cloud.sa.flow.commom.domain.virentity.Column;
|
|
|
import com.cloud.sa.flow.commom.domain.virentity.DataPower;
|
|
|
+
|
|
|
+
|
|
|
import com.cloud.sa.flow.commom.domain.virenum.ActionType;
|
|
|
import com.cloud.sa.flow.commom.domain.virenum.DataType;
|
|
|
+
|
|
|
import com.cloud.sa.flow.commom.service.genSql.SqlGeneratorService;
|
|
|
import com.cloud.sa.flow.commom.service.setting.StAdmitService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -41,6 +48,7 @@ public class StDataService {
|
|
|
@Autowired
|
|
|
StCommonMapper commonMapper;
|
|
|
|
|
|
+
|
|
|
public void IstDataTemplateCache(String flowCode) {
|
|
|
|
|
|
//1、缓存流程数据,走实体字段相关的先走一遍再用
|
|
|
@@ -53,14 +61,24 @@ public class StDataService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void removeDataTemplateCache(String flowCode) {
|
|
|
+ public void removeDataTemplateFieldCache(String flowCode) {
|
|
|
String templateFieldKey = RedisKeys.getTemplateFieldData(flowCode);
|
|
|
rd.deleteObject(templateFieldKey);
|
|
|
}
|
|
|
+ public void removeDataTemplateCache(String flowCode) {
|
|
|
+ String dataTemplateKey = RedisKeys.getDataTemplate(flowCode);
|
|
|
+ rd.deleteObject(dataTemplateKey);
|
|
|
+ }
|
|
|
|
|
|
public StDataTemplate getStDataTemplate(String flowCode) {
|
|
|
- StDataTemplate stDataTemplate = stDataTemplateMapper.getStDataTemplate(flowCode);
|
|
|
- return stDataTemplate;
|
|
|
+ String dataTemplateKey = RedisKeys.getDataTemplate(flowCode);
|
|
|
+ if (rd.hasKey(dataTemplateKey)) {
|
|
|
+ return rd.getCacheObject(dataTemplateKey);
|
|
|
+ } else {
|
|
|
+ StDataTemplate stDataTemplate = stDataTemplateMapper.getStDataTemplate(flowCode);
|
|
|
+ rd.setCacheObject(dataTemplateKey, stDataTemplate);
|
|
|
+ return stDataTemplate;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public List<Column> getStDataColumn(String flowCode) {
|
|
|
@@ -77,7 +95,7 @@ public class StDataService {
|
|
|
public List<DataPower> getFlowDataTemplate(String flowCode) {
|
|
|
String flowDataRedisKey = RedisKeys.getFlowDataTemplate(flowCode);
|
|
|
if (rd.hasKey(flowDataRedisKey) == false) {
|
|
|
- StDataTemplate stDataTemplate = stDataTemplateMapper.getStDataTemplate(flowCode);
|
|
|
+ StDataTemplate stDataTemplate = getStDataTemplate(flowCode);
|
|
|
if (stDataTemplate == null) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -144,6 +162,7 @@ public class StDataService {
|
|
|
for (Column column : collectColumnsChildren) {
|
|
|
tableFieldDeal("m_" + column.getCode(), column.getChildren());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|