Merge pull request #124 from qxinfo2019/qxinfo2019-patch-2

fix: 同一表单中使用同一 stateClass 数据错乱
This commit is contained in:
RB 2020-01-11 13:56:22 +08:00 committed by GitHub
commit ad02c47a4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
package com.rebuild.server.helper.state; package com.rebuild.server.helper.state;
import cn.devezhao.persist4j.Field; import cn.devezhao.persist4j.Field;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.rebuild.server.Application; import com.rebuild.server.Application;
@ -65,7 +66,8 @@ public class StateManager {
final String cKey = "STATECLASS-" + stateClass; final String cKey = "STATECLASS-" + stateClass;
JSONArray options = (JSONArray) Application.getCommonCache().getx(cKey); JSONArray options = (JSONArray) Application.getCommonCache().getx(cKey);
if (options != null) { if (options != null) {
return options; // 使用副本
return JSON.parseArray(options.toJSONString());
} }
Class<?> state = StateHelper.getSatetClass(stateClass); Class<?> state = StateHelper.getSatetClass(stateClass);