增加重置设备锁定
parent
ba33fb29b2
commit
fb14f9bb51
|
|
@ -228,8 +228,8 @@ public class Protocol {
|
|||
/** 成员禁止玩法详情*/
|
||||
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";
|
||||
/** 重置多设备锁定*/
|
||||
public static final String GROUP_RESET_MORE_LOCK = "group_reset_more_lock";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,7 @@ public class GroupController extends Controller {
|
|||
| WebInterceptor.V_GROUP_OWNER)
|
||||
public final void groupTakeHp() throws Exception {
|
||||
ITObject reqData = this.getParams();
|
||||
logger.info("reqData:"+reqData);
|
||||
logger.info("reqData:" + reqData);
|
||||
String session = this.getSession();
|
||||
int groupId = reqData.getInt("id");
|
||||
int tagId = reqData.getInt("tagId");
|
||||
|
|
@ -1569,7 +1569,8 @@ public class GroupController extends Controller {
|
|||
/**
|
||||
* 重置用户密码
|
||||
*/
|
||||
@ActionKey(value = Protocol.GROUP_RESET_PASSWORD, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP | WebInterceptor.V_GROUP_MGR_OR_PARTNER)
|
||||
@ActionKey(value = Protocol.GROUP_RESET_PASSWORD, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP
|
||||
| WebInterceptor.V_GROUP_MGR_OR_PARTNER)
|
||||
public final void resetPassword() throws Exception {
|
||||
ITObject reqData = this.getParams();
|
||||
String session = this.getSession();
|
||||
|
|
@ -1605,24 +1606,29 @@ public class GroupController extends Controller {
|
|||
DataBase.use().executeUpdateLogin(sql, params1);
|
||||
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_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");
|
||||
if (lockType == 1) {
|
||||
throw new WebException(ErrorCode._FAILED);
|
||||
}
|
||||
|
||||
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
|
||||
| WebInterceptor.V_GROUP_MGR_OR_PARTNER)
|
||||
|
|
|
|||
|
|
@ -3171,7 +3171,7 @@ public class AccountService extends Controller {
|
|||
}
|
||||
}
|
||||
if (!islock) {
|
||||
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
|
||||
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and left(device_code,13)=left(?,13)");
|
||||
|
||||
String[] params1 = new String[2];
|
||||
params1[0] = accountid + "";
|
||||
|
|
@ -3187,13 +3187,13 @@ public class AccountService extends Controller {
|
|||
}
|
||||
return true;
|
||||
} else {
|
||||
String sql3 = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
|
||||
|
||||
String sql3 = String.format("SELECT * FROM account_device WHERE user_id =? and left(device_code,13)=left(?,13)");
|
||||
String[] params3 = new String[2];
|
||||
params3[0] = accountid + "";
|
||||
params3[1] = deviceCode + "";
|
||||
|
||||
ITArray resultArray3 = DataBase.use().executeQueryByTArrayLogin(sql3, params3);
|
||||
// logger.info("sql3:"+sql3);
|
||||
if (resultArray3.size() == 0) {
|
||||
// 添加设备
|
||||
String deviceSql = String.format(
|
||||
|
|
@ -3203,21 +3203,26 @@ public class AccountService extends Controller {
|
|||
}
|
||||
|
||||
|
||||
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and device_code=?");
|
||||
String sql = String.format("SELECT * FROM account_device WHERE user_id =? and left(device_code,13)=left(?,13)");
|
||||
|
||||
String[] params1 = new String[2];
|
||||
params1[0] = accountid + "";
|
||||
params1[1] = deviceCode + "";
|
||||
// logger.info("sql:"+sql);
|
||||
|
||||
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);
|
||||
// logger.info("device_code:"+obj.getString("device_code").substring(13));
|
||||
// logger.info("deviceCode:"+deviceCode.substring(13));
|
||||
// logger.info("deviceCode:"+obj.getInt("is_lock"));
|
||||
|
||||
if (obj.getInt("is_lock") == 1 && obj.getString("device_code").equalsIgnoreCase(deviceCode)) {
|
||||
if (obj.getInt("is_lock") == 1 && obj.getString("device_code").substring(0,13).equalsIgnoreCase(deviceCode.substring(0,13))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue