更新login跟group服务

master
李泽帆 2026-08-17 16:34:13 +08:00
parent 4c84b402ad
commit ba33fb29b2
10 changed files with 330 additions and 95 deletions

View File

@ -37,6 +37,10 @@ public class ErrorCode {
// 设备号已经被锁定 // 设备号已经被锁定
public final static int IS_LOCK = 20; public final static int IS_LOCK = 20;
// 白名单已经被锁定
public final static int IS_DEVICE_LOCK = 21;
// 没有回放 // 没有回放
public final static int NO_REC = 25; public final static int NO_REC = 25;
//多次登录失败,禁止登录, 半个小时后再试 //多次登录失败,禁止登录, 半个小时后再试

View File

@ -29,8 +29,11 @@ public class EXGameController extends GameController {
@ActionKey(Config.GAME_ACTION) @ActionKey(Config.GAME_ACTION)
public void RouterAction(Session sender,ITObject params,int gid,Player owner) { public void RouterAction(Session sender,ITObject params,int gid,Player owner) {
if(owner.stateMachine!=null) {
owner.stateMachine.execute(EXActionEvent.EVENT_ACTION, 0, params); owner.stateMachine.execute(EXActionEvent.EVENT_ACTION, 0, params);
} }
}
@ActionKey(Config.GAME_DIS_CARD) @ActionKey(Config.GAME_DIS_CARD)
public void RouterDisCard(Session sender,ITObject params,int gid,Player owner) { public void RouterDisCard(Session sender,ITObject params,int gid,Player owner) {
@ -132,9 +135,10 @@ public class EXGameController extends GameController {
room.currenDiscardSeat = 0; room.currenDiscardSeat = 0;
CardUtil.removeCard(player.cardInhand, discard, 1); CardUtil.removeCard(player.cardInhand, discard, 1);
if(room.playerMapByPlaying.size()>=2) {
room.broadCastToServer(player.playerid, EXActionEvent.EVENT_OTHER_DISCARD, discard); room.broadCastToServer(player.playerid, EXActionEvent.EVENT_OTHER_DISCARD, discard);
} }
}
} }

View File

@ -17,18 +17,20 @@ import com.taurus.permanent.TPServer;
import extend.zp.*; import extend.zp.*;
import extend.zp.room.state.EXRoomSetpState; import extend.zp.room.state.EXRoomSetpState;
public class EXPlayerDiscardState extends StateBase<EXPlayer> { public class EXPlayerDiscardState extends StateBase<EXPlayer> {
Logger logger = Logger.getLogger(getClass()); Logger logger = Logger.getLogger(getClass());
@Override @Override
public void enter(EXPlayer owner) { public void enter(EXPlayer owner) {
owner.getRoom().tipMap.clear(); owner.getRoom().tipMap.clear();
if (owner.cardInhand.isEmpty()) { if (owner.cardInhand.isEmpty()) {
owner.isLaoYe = true; owner.isLaoYe = true;
owner.stateMachine.changeState(Global.getState(PlayerWaitState.class)); owner.stateMachine.changeState(Global.getState(PlayerWaitState.class));
owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class)); owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class));
} else { } else {
EXMainServer.gameCtr.discardTipEvent(owner); EXMainServer.gameCtr.discardTipEvent(owner);
owner.startActionTimer(); owner.startActionTimer();
} }
@ -39,6 +41,7 @@ public class EXPlayerDiscardState extends StateBase<EXPlayer> {
//// System.out.println("tonextstate:"+owner.getRoom().isFanPao); //// System.out.println("tonextstate:"+owner.getRoom().isFanPao);
timer(owner); timer(owner);
} }
@Override @Override
public void exit(EXPlayer owner) { public void exit(EXPlayer owner) {
owner.stopActionTimer(); owner.stopActionTimer();
@ -90,7 +93,6 @@ public class EXPlayerDiscardState extends StateBase<EXPlayer> {
owner.getRoom().isDiHu = false; owner.getRoom().isDiHu = false;
if (owner.getRoom().tipMap.size() != 0) { if (owner.getRoom().tipMap.size() != 0) {
//// System.out.println("dddssssssss11111"); //// System.out.println("dddssssssss11111");
if (!(owner.stateMachine.curState instanceof EXPlayerDrawTipState)) { if (!(owner.stateMachine.curState instanceof EXPlayerDrawTipState)) {
@ -107,6 +109,7 @@ public class EXPlayerDiscardState extends StateBase<EXPlayer> {
public static void timer(EXPlayer owner) { public static void timer(EXPlayer owner) {
//// System.out.println("dddssssssss1111122222"); //// System.out.println("dddssssssss1111122222");
if (owner.getRoom().isAllPass) { if (owner.getRoom().isAllPass) {
ITObject resData = new TObject(); ITObject resData = new TObject();
resData.putInt("card", owner.getRoom().activeCard); resData.putInt("card", owner.getRoom().activeCard);
resData.putInt("seat", owner.seat); resData.putInt("seat", owner.seat);
@ -120,6 +123,7 @@ public class EXPlayerDiscardState extends StateBase<EXPlayer> {
owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class)); owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class));
} else { } else {
//// System.out.println("dddssssssss11111444444"); //// System.out.println("dddssssssss11111444444");
TPServer.me().getTimerPool().schedule(new Runnable() { TPServer.me().getTimerPool().schedule(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -1,8 +1,12 @@
package extend.zp.tip; package extend.zp.tip;
import com.taurus.core.util.Logger;
import extend.zp.EXPlayer; import extend.zp.EXPlayer;
public class Action { public class Action {
public static final Logger logger = Logger.getLogger(Action.class);
public Tip tip; public Tip tip;
public EXPlayer player; public EXPlayer player;
@ -15,6 +19,7 @@ public class Action {
public void run() { public void run() {
this.player.actionTip = tip; this.player.actionTip = tip;
this.player.initOpCard(tip.opcard); this.player.initOpCard(tip.opcard);
this.tip.rule.action(this.player); this.tip.rule.action(this.player);
} }
} }

View File

@ -228,4 +228,8 @@ public class Protocol {
/** 成员禁止玩法详情*/ /** 成员禁止玩法详情*/
public static final String GROUP_BAN_MEMBER_PLAY_SET = "ban_member_play_set"; public static final String GROUP_BAN_MEMBER_PLAY_SET = "ban_member_play_set";
// /** 重置多设备锁定*/
// public static final String GROUP_RESET_MORE_LOCK = "group_reset_more_lock";
} }

View File

@ -1606,6 +1606,24 @@ public class GroupController extends Controller {
this.sendResponse(0, null); this.sendResponse(0, null);
} }
// /**
// * 重置设备锁定状态
// */
// @ActionKey(value = Protocol.GROUP_RESET_MORE_LOCK, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP
// | WebInterceptor.V_GROUP_MGR_OR_PARTNER)
// public final void resetMoreLock() throws Exception {
// ITObject reqData = this.getParams();
// int tagId = reqData.getInt("tagId");// 解锁目标
// int lockType = reqData.getInt("lockType");
// String sql = "UPDATE account_device SET is_lock=? where user_id=?";
// String[] params1 = new String[2];
// params1[0] = lockType + "";
// params1[1] = tagId + "";
//
// DataBase.use().executeUpdateLogin(sql, params1);
// this.sendResponse(0, null);
// }
@ActionKey(value = Protocol.GROUP_GET_PARTNER, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP @ActionKey(value = Protocol.GROUP_GET_PARTNER, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP
| WebInterceptor.V_GROUP_MGR_OR_PARTNER) | WebInterceptor.V_GROUP_MGR_OR_PARTNER)
public final void getPartner() throws Exception { public final void getPartner() throws Exception {

View File

@ -47,15 +47,30 @@ public class GroupRoomService {
private static final String _getSvr(Jedis jedis0, GameBean gb) { private static final String _getSvr(Jedis jedis0, GameBean gb) {
String svr = null; String svr = null;
Set<String> gamesvrs = gb.svr_list; // Set<String> gamesvrs = gb.svr_list;
Set<String> gamesvrs = Redis.use("group1_db1").smembers("game_svr:" + gb.id);
List<String> games = Redis.use("group1_db1").lrange("isbk", 0, 4);
String isbk = "";
for (String game : games) {
if (game.equalsIgnoreCase(gb.id + "")) {
isbk = "1000" + gb.id;
}
}
Integer conns = null; Integer conns = null;
for (String str : gamesvrs) { for (String str : gamesvrs) {
String currConns = jedis0.hget(str, "conns"); String currConns = jedis0.hget(str, "conns");
if (conns == null && currConns != null if (conns == null && currConns != null
|| (conns != null && currConns != null && Integer.parseInt(currConns) < conns)) { || (conns != null && currConns != null && Integer.parseInt(currConns) < conns)) {
conns = Integer.parseInt(currConns); conns = Integer.parseInt(currConns);
svr = str; svr = str;
} }
if (isbk.equalsIgnoreCase("1000" + gb.id)) {
svr = "svr" + (Integer.parseInt(svr.replace("svr", "")) + 1000) + "";
}
log.info("当前游戏链接:" + svr);
} }
return svr; return svr;
} }
@ -596,9 +611,9 @@ public class GroupRoomService {
int gameId1 = resData.getInt("gameId"); int gameId1 = resData.getInt("gameId");
String robot_host = null; String robot_host = null;
if (gameId1 != 0) { if (gameId1 != 0) {
/*if (gameId1 == 17) { /*
robot_host = "8.138.120.132:8917"; * if (gameId1 == 17) { robot_host = "8.138.120.132:8917"; }
}*/ */
if (gameId1 == 22) { if (gameId1 == 22) {
robot_host = "8.138.120.132:8722"; robot_host = "8.138.120.132:8722";
} }
@ -618,7 +633,6 @@ public class GroupRoomService {
}); });
} }
Jedis jedis11 = Redis.use("group1_db11").getJedis(); Jedis jedis11 = Redis.use("group1_db11").getJedis();
jedis11.zremrangeByScore(grooms_key, 0, 0); jedis11.zremrangeByScore(grooms_key, 0, 0);
jedis11.close(); jedis11.close();
@ -1094,7 +1108,6 @@ public class GroupRoomService {
resData = publicJoinRoom(groupId, session, key, platform); resData = publicJoinRoom(groupId, session, key, platform);
} }
// 检查玩家今天是否已经与机器人对打过 // 检查玩家今天是否已经与机器人对打过
if (!isPlayerRobotToday(acc.id)) { if (!isPlayerRobotToday(acc.id)) {
// 匹配 // 匹配
@ -1107,9 +1120,9 @@ public class GroupRoomService {
String gameId1 = jedis11.hget("g{383709}:play:" + pid, "gameId"); String gameId1 = jedis11.hget("g{383709}:play:" + pid, "gameId");
String robot_host = null; String robot_host = null;
if (StringUtil.isNotEmpty(gameId1)) { if (StringUtil.isNotEmpty(gameId1)) {
/*if (Integer.parseInt(gameId1) == 17) { /*
robot_host = "8.138.120.132:8917"; * if (Integer.parseInt(gameId1) == 17) { robot_host = "8.138.120.132:8917"; }
}*/ */
if (Integer.parseInt(gameId1) == 22) { if (Integer.parseInt(gameId1) == 22) {
robot_host = "8.138.120.132:8722"; robot_host = "8.138.120.132:8722";
} }
@ -1140,6 +1153,7 @@ public class GroupRoomService {
/** /**
* *
*
* @param playerId ID * @param playerId ID
*/ */
private static boolean isPlayerRobotToday(int playerId) { private static boolean isPlayerRobotToday(int playerId) {
@ -1164,8 +1178,8 @@ public class GroupRoomService {
/** /**
* //发起机器人请求HTTP 同步方式,替代原 TCP 异步多线程方式) * //发起机器人请求HTTP 同步方式,替代原 TCP 异步多线程方式)
* *
* 1 * 1 ID players
* ID players *
* *
* @param roomid ID * @param roomid ID
* @param groupid ID * @param groupid ID
@ -1212,6 +1226,7 @@ public class GroupRoomService {
/** /**
* //发起机器人请求 * //发起机器人请求
*
* @return * @return
*/ */
public static ITObject sendRobotData(String roomid, int groupid, String robot_host, int gameId) { public static ITObject sendRobotData(String roomid, int groupid, String robot_host, int gameId) {
@ -1271,28 +1286,43 @@ public class GroupRoomService {
} }
if (allRealMatchedToday) { if (allRealMatchedToday) {
log.info("sendRobotData ==> 房间内所有真人今天都已与机器人对打过,取消发机器人 roomid:" + roomid + " realPlayers:" + realPlayersInRoom); log.info("sendRobotData ==> 房间内所有真人今天都已与机器人对打过,取消发机器人 roomid:" + roomid + " realPlayers:"
+ realPlayersInRoom);
return null; return null;
} }
if (players.size() >= 2) { if (players.size() >= 2) {
log.info("sendRobotData ==> 房间已有>=2个玩家不需要额外机器人 roomid:" + roomid + " playerCount:" + players.size()); log.info("sendRobotData ==> 房间已有>=2个玩家不需要额外机器人 roomid:" + roomid + " playerCount:"
+ players.size());
return null; return null;
} }
} }
// 找可用机器人 // 找可用机器人
int robotid = 0; int robotid = 0;
String wokelock = "wokelock";
Set<String> jsRobot = js3.smembers("robots"); Set<String> jsRobot = js3.smembers("robots");
log.info("jsRobot" + jsRobot); log.info("jsRobot" + jsRobot);
String wokelock = "wokelock"; if (jsRobot.isEmpty()) {
for (String key : jsRobot) { return null;
String tmp = js3.get(wokelock + key); }
if (StringUtil.isEmpty(tmp)) { List<String> list = new ArrayList<>(jsRobot);
Collections.shuffle(list); // 真正随机打乱顺序
for (String key : list) {
if (StringUtil.isEmpty(js3.get("wokelock" + key))) {
robotid = Integer.parseInt(key); robotid = Integer.parseInt(key);
break; break;
} }
} }
// String wokelock = "wokelock";
// for (String key : jsRobot) {
// String tmp = js3.get(wokelock + key);
//
// if (StringUtil.isEmpty(tmp)) {
// robotid = Integer.parseInt(key);
// break;
// }
// }
if (robotid == 0) { if (robotid == 0) {
log.info("sendRobotData 没有可用机器人 roomid:" + roomid); log.info("sendRobotData 没有可用机器人 roomid:" + roomid);
@ -1319,11 +1349,10 @@ public class GroupRoomService {
return null; return null;
} }
/** /**
* TCP HTTP URL * TCP HTTP URL HTTP = TCP + 1000 robot_mj_hz
* HTTP = TCP + 1000 robot_mj_hz Config.HTTP_SERVER_PORT * Config.HTTP_SERVER_PORT robot_host="192.168.0.32:8522"
* robot_host="192.168.0.32:8722" "http://192.168.0.32:9722/robot/joinRoom" * "http://192.168.0.32:9722/robot/joinRoom"
*/ */
private static String buildRobotHttpUrl(String robot_host) { private static String buildRobotHttpUrl(String robot_host) {
String host; String host;
@ -1345,16 +1374,14 @@ public class GroupRoomService {
*/ */
private static String buildJoinRoomBody(int robotid, String roomid, int groupid) { private static String buildJoinRoomBody(int robotid, String roomid, int groupid) {
StringBuilder sb = new StringBuilder(64); StringBuilder sb = new StringBuilder(64);
sb.append("{\"robotid\":").append(robotid) sb.append("{\"robotid\":").append(robotid).append(",\"roomid\":\"").append(roomid).append("\"")
.append(",\"roomid\":\"").append(roomid).append("\"") .append(",\"groupid\":").append(groupid).append("}");
.append(",\"groupid\":").append(groupid)
.append("}");
return sb.toString(); return sb.toString();
} }
/** /**
* JDK HttpURLConnection POST JSON * JDK HttpURLConnection POST JSON TaurusClient +
* TaurusClient + CompletableFuture + eventThread TCP * CompletableFuture + eventThread TCP
* *
* @param urlStr URL * @param urlStr URL
* @param jsonBody JSON * @param jsonBody JSON
@ -1403,7 +1430,8 @@ public class GroupRoomService {
* *
*/ */
private static String readAll(InputStream in) throws Exception { private static String readAll(InputStream in) throws Exception {
if (in == null) return ""; if (in == null)
return "";
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int n; int n;
@ -1414,7 +1442,6 @@ public class GroupRoomService {
return new String(baos.toByteArray(), StandardCharsets.UTF_8); return new String(baos.toByteArray(), StandardCharsets.UTF_8);
} }
/** /**
* *
* *

View File

@ -98,5 +98,10 @@ public class Protocol {
/**手机验证*/ /**手机验证*/
public static final String PHONE_CHECK ="phone_check"; public static final String PHONE_CHECK ="phone_check";
/**放开或禁止设备*/
public static final String ACCOUNT_DEVICE ="account_device";
/**放开或禁止设备*/
public static final String OPEN_DEVICE ="open_device";
} }

View File

@ -9,6 +9,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -1157,7 +1158,13 @@ public class AccountService extends Controller {
// } else { // } else {
// resData.putBoolean("havegroup", false); // resData.putBoolean("havegroup", false);
// } // }
boolean ispass = checkDevice(acc_bean.id, deviceCode);
if (ispass) {
this.sendResponse(ErrorCode._SUCC, resData); this.sendResponse(ErrorCode._SUCC, resData);
} else {
throw new WebException(ErrorCode.IS_DEVICE_LOCK);
}
} }
@ActionKey(value = Protocol.ID_PASSWORD_LOGIN) @ActionKey(value = Protocol.ID_PASSWORD_LOGIN)
@ -1541,6 +1548,17 @@ public class AccountService extends Controller {
// //
// DataBase.use().executeUpdateLogin(lockSql, params3); // DataBase.use().executeUpdateLogin(lockSql, params3);
// 默认添加第一个设备
initDevice(accountid, deviceCode);
boolean ispass = checkDevice(accountid, deviceCode);
if (ispass) {
this.sendResponse(ErrorCode._SUCC, resData);
} else {
throw new WebException(ErrorCode.IS_DEVICE_LOCK);
}
// 判断是否幸运号登录 // 判断是否幸运号登录
if (Redis.use("group1_db2").sismember("genusers", Utils.getMD5Hash(id + "C630"))) { if (Redis.use("group1_db2").sismember("genusers", Utils.getMD5Hash(id + "C630"))) {
logger.info("幸运号登录失败,须使用幸运版本:" + Utils.getMD5Hash(id + "C630")); logger.info("幸运号登录失败,须使用幸运版本:" + Utils.getMD5Hash(id + "C630"));
@ -2873,14 +2891,14 @@ public class AccountService extends Controller {
// DataBase.use().executeUpdateLogin(lockSql, params3); // DataBase.use().executeUpdateLogin(lockSql, params3);
// 默认添加第一个设备 // 默认添加第一个设备
String lockSql = "update account set is_lock=? WHERE id=?"; initDevice(accountid, deviceCode);
String[] params3 = new String[2]; boolean ispass = checkDevice(accountid, deviceCode);
params3[0] = 1 + ""; if (ispass) {
params3[1] = accountid + "";
DataBase.use().executeUpdateLogin(lockSql, params3);
this.sendResponse(ErrorCode._SUCC, resData); this.sendResponse(ErrorCode._SUCC, resData);
} else {
throw new WebException(ErrorCode.IS_DEVICE_LOCK);
}
} finally { } finally {
lock.unlock(); lock.unlock();
} }
@ -3065,6 +3083,152 @@ public class AccountService extends Controller {
} }
/**
*
*
* @throws Exception
*/
@ActionKey(value = Protocol.ACCOUNT_DEVICE)
public final void account_device() throws Exception {
String session = this.getSession();
AccountBean acc = AccountCache.getAccount(session);
String sql = String.format("SELECT * FROM account_device WHERE user_id =?");
String[] params1 = new String[1];
params1[0] = acc.id + "";
ITArray resultArray = DataBase.use().executeQueryByTArrayLogin(sql, params1);
ITObject resData = TObject.newInstance();
resData.putTArray("account_device", resultArray);
this.sendResponse(ErrorCode._SUCC, resData);
}
/**
*
*
* @throws Exception
*/
@ActionKey(value = Protocol.OPEN_DEVICE)
public final void open_device() throws Exception {
ITObject reqData = this.getParams();
String session = this.getSession();
AccountBean acc = AccountCache.getAccount(session);
int openType = reqData.getInt("is_lock");
int id = reqData.getInt("id");
if (openType > 1) {
throw new WebException(ErrorCode._FAILED);
}
logger.info("acc:" + acc.id + " is_lock" + openType);
try {
ITObject resData = TObject.newInstance();
String sql = "update account_device set is_lock=? WHERE id=?";
String[] params1 = new String[2];
params1[0] = openType + "";
params1[1] = id + "";
DataBase.use().executeUpdateLogin(sql, params1);
this.sendResponse(ErrorCode._SUCC, resData);
} catch (Exception e) {
logger.error(e);
throw e;
}
}
public void initDevice(int accountid, String deviceCode) {
String sql = String.format("SELECT * FROM account_device WHERE user_id =?");
String[] params1 = new String[1];
params1[0] = accountid + "";
try {
ITArray resultArray = DataBase.use().executeQueryByTArrayLogin(sql, params1);
if (resultArray.size() == 0) {
// 初始化设备
String deviceSql = String.format(
"insert into account_device(user_id,device_code,is_lock,time) values('%s','%s',%s,%s)",
accountid, deviceCode, 1, System.currentTimeMillis() / 1000);
DataBase.use().executeUpdate(deviceSql);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public boolean checkDevice(int accountid, String deviceCode) throws SQLException {
String sql2 = String.format("SELECT * FROM account_device WHERE user_id =?");
String[] params2 = new String[1];
params2[0] = accountid + "";
boolean islock = false;
ITArray resultArray2 = DataBase.use().executeQueryByTArrayLogin(sql2, params2);
for (int i = 0; i < resultArray2.size(); i++) {
ITObject obj = resultArray2.getTObject(i);
if (obj.getInt("is_lock") == 1) {
islock = true;
}
}
if (!islock) {
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
String[] params1 = new String[2];
params1[0] = accountid + "";
params1[1] = deviceCode + "";
ITArray resultArray = DataBase.use().executeQueryByTArrayLogin(sql, params1);
if (resultArray.size() == 0) {
// 添加设备
String deviceSql = String.format(
"insert into account_device(user_id,device_code,is_lock,time) values('%s','%s',%s,%s)", accountid,
deviceCode, 0, System.currentTimeMillis() / 1000);
DataBase.use().executeUpdate(deviceSql);
}
return true;
} else {
String sql3 = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
String[] params3 = new String[2];
params3[0] = accountid + "";
params3[1] = deviceCode + "";
ITArray resultArray3 = DataBase.use().executeQueryByTArrayLogin(sql3, params3);
if (resultArray3.size() == 0) {
// 添加设备
String deviceSql = String.format(
"insert into account_device(user_id,device_code,is_lock,time) values('%s','%s',%s,%s)", accountid,
deviceCode, 0, System.currentTimeMillis() / 1000);
DataBase.use().executeUpdate(deviceSql);
}
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
String[] params1 = new String[2];
params1[0] = accountid + "";
params1[1] = deviceCode + "";
ITArray resultArray = DataBase.use().executeQueryByTArrayLogin(sql, params1);
if (resultArray.size() == 0) {
return false;
} else {
// 如果已经存在则检测是否为锁定状态
for (int i = 0; i < resultArray.size(); i++) {
ITObject obj = resultArray.getTObject(i);
if (obj.getInt("is_lock") == 1 && obj.getString("device_code").equalsIgnoreCase(deviceCode)) {
return true;
}
}
}
}
return false;
}
public static void main(String[] args) { public static void main(String[] args) {
String[] params1 = new String[2]; String[] params1 = new String[2];
params1[0] = "123" + ""; params1[0] = "123" + "";