|
|
@ -6,7 +6,6 @@ import com.fanruan.api.util.ArrayKit; |
|
|
|
import com.fanruan.api.util.GeneralKit; |
|
|
|
import com.fanruan.api.util.GeneralKit; |
|
|
|
import com.fanruan.api.util.RenderKit; |
|
|
|
import com.fanruan.api.util.RenderKit; |
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
import com.fr.base.Parameter; |
|
|
|
|
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.plugin.db.redis.core.order.OrderValue; |
|
|
|
import com.fr.plugin.db.redis.core.order.OrderValue; |
|
|
|
import com.fr.plugin.db.redis.help.ScriptBridge; |
|
|
|
import com.fr.plugin.db.redis.help.ScriptBridge; |
|
|
@ -74,18 +73,18 @@ public class RedisUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static ParameterProvider[] analyzeParameter(JSONArray existParameters, OrderValue orderValue, String ...parameterTexts) { |
|
|
|
public static ParameterProvider[] analyzeParameter(JSONArray existParameters, OrderValue orderValue, String... parameterTexts) { |
|
|
|
Parameter[] oldParameters = new Parameter[existParameters.size()]; |
|
|
|
ParameterProvider[] oldParameters = new ParameterProvider[existParameters.size()]; |
|
|
|
for (int i = 0; i < existParameters.size(); i++) { |
|
|
|
for (int i = 0; i < existParameters.size(); i++) { |
|
|
|
oldParameters[i] = Parameter.getParameterFromJson(existParameters.getJSONObject(i)); |
|
|
|
oldParameters[i] = ParameterKit.json2Parameter(existParameters.getJSONObject(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
ParameterProvider[] newParameters = ParameterKit.analyzeAndUnionSameParameters(parameterTexts, oldParameters); |
|
|
|
ParameterProvider[] newParameters = ParameterKit.analyzeAndUnionSameParameters(parameterTexts, oldParameters); |
|
|
|
ParameterProvider[] newOrderParameters = orderValue.analyze4Parameters(); |
|
|
|
ParameterProvider[] newOrderParameters = orderValue.analyze4Parameters(); |
|
|
|
Map<String, ParameterProvider> parameterProviderMap = new HashMap<String, ParameterProvider>(); |
|
|
|
Map<String, ParameterProvider> parameterProviderMap = new HashMap<String, ParameterProvider>(); |
|
|
|
for (ParameterProvider parameterProvider: oldParameters) { |
|
|
|
for (ParameterProvider parameterProvider : oldParameters) { |
|
|
|
parameterProviderMap.put(parameterProvider.getName(), parameterProvider); |
|
|
|
parameterProviderMap.put(parameterProvider.getName(), parameterProvider); |
|
|
|
} |
|
|
|
} |
|
|
|
for (ParameterProvider parameterProvider: newOrderParameters) { |
|
|
|
for (ParameterProvider parameterProvider : newOrderParameters) { |
|
|
|
if (parameterProviderMap.containsKey(parameterProvider.getName())) { |
|
|
|
if (parameterProviderMap.containsKey(parameterProvider.getName())) { |
|
|
|
parameterProvider.setValue(parameterProviderMap.get(parameterProvider.getName()).getValue()); |
|
|
|
parameterProvider.setValue(parameterProviderMap.get(parameterProvider.getName()).getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|