| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.common.Cools; |
| | | import com.zy.common.R; |
| | | import com.zy.common.SpringUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.param.UpdateFakeThreadStatusParam; |
| | | import com.zy.core.properties.DeviceConfig; |
| | | import com.zy.core.thread.FakeThread; |
| | | import com.zy.core.thread.impl.NyShuttleThread; |
| | |
| | | String pathList = body.getString("path"); |
| | | List<JSONObject> list = JSON.parseArray(pathList, JSONObject.class); |
| | | for (JSONObject path : list) { |
| | | while (true) { |
| | | JSONObject realFakeStatus = fakeStatusMap.get(key); |
| | | Integer errorCode = realFakeStatus.getInteger("errorCode"); |
| | | if (errorCode > 0) { |
| | | continue; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | String currentCode = fakeStatus.getString("currentCode"); |
| | | JSONObject point = JSON.parseObject(currentCode); |
| | | point.put("x", path.getInteger("xp")); |
| | |
| | | public ConcurrentHashMap<String, JSONObject> getFakeCommandMap() { |
| | | return this.fakeCommandMap; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateFakeStatus(UpdateFakeThreadStatusParam param) { |
| | | String key = param.getDeviceType() + param.getDeviceNo(); |
| | | JSONObject result = fakeStatusMap.get(key); |
| | | if (result == null) { |
| | | return false; |
| | | } |
| | | |
| | | JSONObject newData = JSON.parseObject(param.getData()); |
| | | this.fakeStatusMap.put(key, newData); |
| | | return true; |
| | | } |
| | | } |