master
parent
223471291c
commit
9db1547a5f
|
|
@ -35,6 +35,9 @@ public class ConsumeCode {
|
|||
|
||||
public final static int HP_SAVE_BANK = 17;
|
||||
|
||||
/**保底抽水*/
|
||||
public final static int HP_PUMP_BAODI = 18;
|
||||
|
||||
/** 洗牌 **/
|
||||
public final static int HP_XIPAI_PUMP = 20;
|
||||
/** 合伙人洗牌奖励 **/
|
||||
|
|
@ -43,6 +46,9 @@ public class ConsumeCode {
|
|||
/** 合伙人按抽奖励 **/
|
||||
public final static int HP_PARTNER_ANCHOU_REWARD = 22;
|
||||
|
||||
/** 合伙人洗牌奖励退回 **/
|
||||
public final static int HP_PARTNER_XIPAI_REWARD_BACK = 23;
|
||||
|
||||
/** 邮件 **/
|
||||
public final static int DIAMO_MAIL = 50;
|
||||
/** 转盘**/
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class HandlerGroupMemberRound implements IHandler {
|
|||
|
||||
@Override
|
||||
public int processGroup(int groupId, ITObject param) throws Exception {
|
||||
// EventServer.log.info("processGroup begin:" + param);
|
||||
EventServer.log.info("processGroup begin:" + param);
|
||||
|
||||
int pid = param.getInt("pid");
|
||||
int score = param.getInt("score");
|
||||
|
|
@ -80,6 +80,15 @@ public class HandlerGroupMemberRound implements IHandler {
|
|||
groupId, uid, ConsumeCode.HP_PUMP_TOTAL,
|
||||
score > 0 ? score - pumpReal - xipai_total : score - xipai_total - pumpBase, cur_hp, pid, roomid,
|
||||
(int) (cur_time));
|
||||
|
||||
if (score == 0) {
|
||||
sql = String.format(
|
||||
"INSERT INTO group_hp_log(gid,uid,reason,hp,cur_hp,pid,roomid,time) "
|
||||
+ "VALUES(%s,%s,%s,%s,%s,%s,%s,%s)",
|
||||
groupId, uid, ConsumeCode.HP_PUMP_BAODI, score - xipai_total - pumpReal , cur_hp, pid, roomid,
|
||||
(int) (cur_time));
|
||||
|
||||
}
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
// DataBase.use().executeUpdate(sql);
|
||||
|
||||
|
|
@ -93,9 +102,9 @@ public class HandlerGroupMemberRound implements IHandler {
|
|||
CountUtil.countLog(gmr_key, 1, jedis13);
|
||||
|
||||
Pipeline pipeline13 = jedis13.pipelined();
|
||||
if(score>0) {
|
||||
if (score > 0) {
|
||||
Utils.countRoundWin(pipeline13, groupId, pid, uid, win == 1, score - pumpReal);
|
||||
}else {
|
||||
} else {
|
||||
Utils.countRoundWin(pipeline13, groupId, pid, uid, win == 1, score);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ public class HandlerHpConsume implements IHandler {
|
|||
static Logger log = Logger.getLogger(HandlerHpConsume.class);
|
||||
final static String DB = "group1_db10";
|
||||
|
||||
private static boolean hpConsume(int gid, int uid, int pid, int hp, int cur_hp, int reason, String roomid, int time,
|
||||
|
||||
private static boolean hpConsume(int gid, int uid, int pid, int hp, int cur_hp, int reason, String roomid, int time,
|
||||
String desc) throws SQLException {
|
||||
log.info("uid:" + uid);
|
||||
log.info("当前HP:" + hp);
|
||||
|
|
@ -497,14 +498,17 @@ public class HandlerHpConsume implements IHandler {
|
|||
log.info("保底赢家抽水到这里cur_hp:" + cur_hp);
|
||||
log.info("保底抽水到这里pumpReal:" + pumpReal);
|
||||
log.info("保底只抽大赢家pumpBaseWin:" + pumpBaseWin);
|
||||
log.info("保底只抽大赢家hp:" + hp);
|
||||
|
||||
if (pumpBaseWin == 0) {
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, -pumpReal, cur_hp, ConsumeCode.HP_PUMP, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp+hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, -pumpReal, cur_hp+hp-pumpReal, ConsumeCode.HP_PUMP, roomid, time, desc);
|
||||
|
||||
} else {
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp+hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else if(hp < 0){
|
||||
log.info("保底输家cur_hp:" + cur_hp);
|
||||
log.info("保底输家:" + hp);
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
|
|
@ -515,14 +519,18 @@ public class HandlerHpConsume implements IHandler {
|
|||
log.info("正常抽水结算到这里:" + cur_hp);
|
||||
cur_hp = cur_hp + hp;
|
||||
if (hp < 0) {
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp+hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
} else {
|
||||
cur_hp = cur_hp - pumpReal;
|
||||
hpConsume(groupId, uid, pid, hp, cur_hp - pumpReal, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, -pumpReal, cur_hp, ConsumeCode.HP_PUMP, roomid, time, desc);
|
||||
hpConsume(groupId, uid, pid, -pumpReal, cur_hp-pumpReal, ConsumeCode.HP_PUMP, roomid, time, desc);
|
||||
|
||||
}
|
||||
//不抽水
|
||||
}
|
||||
// else if(hp != 0 && pumpReal==0){
|
||||
// hpConsume(groupId, uid, pid, hp, cur_hp, ConsumeCode.HP_CLEARING, roomid, time, desc);
|
||||
// }
|
||||
|
||||
Jedis jedis9 = Redis.use("group1_db13").getJedis();
|
||||
try {
|
||||
|
|
@ -578,7 +586,7 @@ public class HandlerHpConsume implements IHandler {
|
|||
// 平局则把保底分给到群主
|
||||
if (hp > 0 && pumpBase > 0 && is_pump && pumpBaseWin != 0) {
|
||||
log.info("平局抽赢家保底分");
|
||||
hpConsume(groupId, uid, pid, -pumpBaseWin, cur_hp - pumpBase, ConsumeCode.HP_PUMP, roomid, time,
|
||||
hpConsume(groupId, uid, pid, -pumpBaseWin, cur_hp - -pumpBaseWin, ConsumeCode.HP_PUMP, roomid, time,
|
||||
desc);
|
||||
|
||||
GroupBean gb = GroupCache.getGroup(groupId);
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ public class EventController {
|
|||
String desc, int baodiHp) {
|
||||
Room room = owner.room;
|
||||
String gm_key = GroupMemberCache.genKey(room.groupId, owner.playerid);
|
||||
// Global.logger.info("playid:" + owner.playerid + "hp:" + hp + "total_hp:" + owner.hp.total_hp + "hpPump:"
|
||||
// Global.logger.info("playid:" + owner.playerid +"cur_hp:"+cur_hp+", "hp:" + hp + "total_hp:" + owner.hp.total_hp + "hpPump:"
|
||||
// + hpPump + "mr:" + mengzhu_reward + "xp:" + xipai_score + "xipai:" + xipai + "desc:" + desc
|
||||
// + "owner.practicalHpPumpReal:" + owner.practicalHpPumpReal);
|
||||
long cur_hp = 0;
|
||||
|
|
@ -205,8 +205,8 @@ public class EventController {
|
|||
cur_hp = Redis.use("group1_db10").hincrBy(gm_key, "hp", -xipai_score);
|
||||
} else {
|
||||
Global.logger.info("当前cur_hpgm_key-hp:" + hp);
|
||||
|
||||
cur_hp = Redis.use("group1_db10").hincrBy(gm_key, "hp", hp);
|
||||
//这里如果是保底输家则不重复扣除分数
|
||||
cur_hp = Redis.use("group1_db10").hincrBy(gm_key, "hp", baodiHp==-1?0:hp);
|
||||
Global.logger.info("修改后cur_hpgm_key:" + cur_hp);
|
||||
|
||||
}
|
||||
|
|
@ -224,8 +224,8 @@ public class EventController {
|
|||
Global.logger.info("owner.prs:" + owner.prs);
|
||||
Global.logger.info("owner.hp.total_hp:" + owner.hp.total_hp);
|
||||
|
||||
data.putInt("hp", hp + baodiHp);
|
||||
data.putInt("cur_hp", (int) cur_hp);
|
||||
data.putInt("hp", hp > 0 ? hp + baodiHp : hp);
|
||||
data.putInt("cur_hp", (int) cur_hp - hp);
|
||||
data.putInt("pid", room.groupPid);
|
||||
data.putInt("uid", owner.playerid);
|
||||
data.putInt("time", (int) (System.currentTimeMillis() / 1000));
|
||||
|
|
@ -265,7 +265,7 @@ public class EventController {
|
|||
Redis.use("group1_db10").hincrBy(gm_key, "hp", -room.basePump);
|
||||
|
||||
data.putInt("pumpBase", room.basePump);
|
||||
|
||||
|
||||
} else if (owner.hp.total_hp != 0 && UpperLimit > Math.abs(readScore) && mengzhu_reward) {
|
||||
// 如果输赢低于UpperLimit的分数则只扣除大赢家
|
||||
Global.logger.info("保底抽水:" + UpperLimitReward);
|
||||
|
|
|
|||
|
|
@ -505,12 +505,14 @@ public class GameController implements IController {
|
|||
public void readyAndXipai(Player owner) {
|
||||
if (owner.xi_pai == false) {
|
||||
owner.xi_pai = true;
|
||||
owner.room.redisUpdateXiPaiPlayer(owner);
|
||||
// owner.room.redisUpdateXiPaiPlayer(owner);
|
||||
|
||||
}
|
||||
long cur_hp = Util.readRedisHp(owner.room.groupId, owner.playerid);
|
||||
|
||||
if (cur_hp < owner.hp.cur_hp || cur_hp == 0) {
|
||||
Global.logger.error("cur hp:" + cur_hp + " < >>>>> hp.cur_hp:" + owner.hp.cur_hp + " playerId:" + owner.playerid);
|
||||
Global.logger.error(
|
||||
"cur hp:" + cur_hp + " < >>>>> hp.cur_hp:" + owner.hp.cur_hp + " playerId:" + owner.playerid);
|
||||
if (owner.room.round == 0 && (!checkHplimitInRoom(owner.room, cur_hp) || cur_hp == 0)) {
|
||||
owner.room.saveMilitaryTotal(true);
|
||||
owner.room.stateMachine.changeState(Global.getState(RoomDestoryGameState.class));
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ public class Config {
|
|||
public static final String ROOM_CONFIG_HONGZHONG = "laizi";
|
||||
public static final String ROOM_CONFIG_WUGUI_JIABEI = "wuguijiabei";
|
||||
public static final String ROOM_CONFIG_WUGUI_ZHUOPAO_JIABEI = "wuguizhuopaojiabei";
|
||||
public static final String ROOM_CONFIG_QUEYIMEN = "queyimen";
|
||||
|
||||
|
||||
public static final String ROOM_CONFIG_DIANPAOHU = "dianpaohu";
|
||||
public static final String ROOM_CONFIG_QIANGKONG = "qiangkong";
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ public class Group implements Runnable {
|
|||
CommandData cmd = entry.getValue();
|
||||
arr.addTObject(cmd.param);
|
||||
}
|
||||
Global.logger.info("[" + list + "] !"+ param+"--"+list);
|
||||
|
||||
TPServer.me().getController().sendEvent(Router.FGMGR_EVT_UPDATE_ROOM, 0, param, list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ public class GroupController extends Controller {
|
|||
| WebInterceptor.V_GROUP_MGR_OR_PARTNER)
|
||||
public final void getMembers_1() throws Exception {
|
||||
ITObject reqData = this.getParams();
|
||||
logger.info("查看成员:"+reqData);
|
||||
int groupId = reqData.getInt("id");
|
||||
String session = this.getSession();
|
||||
AccountBean acc = AccountCache.getAccount(session);
|
||||
|
|
@ -462,7 +463,7 @@ public class GroupController extends Controller {
|
|||
* @throws Exception
|
||||
*/
|
||||
@ActionKey(value = Protocol.ADD_PLAY, validate = WebInterceptor.V_SESSION | WebInterceptor.V_GROUP
|
||||
| WebInterceptor.V_GROUP_OWNER)
|
||||
)
|
||||
public final void addPlay() throws Exception {
|
||||
ITObject reqData = this.getParams();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ import redis.clients.jedis.Jedis;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElementDecl.GLOBAL;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
||||
public class GroupLogController extends Controller{
|
||||
|
||||
/**
|
||||
|
|
@ -169,6 +173,7 @@ public class GroupLogController extends Controller{
|
|||
}
|
||||
|
||||
ITObject resData = GroupLogService.getHpLogInfo(groupId, tagId, limit, num, choose,beginTime,endTime);
|
||||
logger.info("get_hplog_info:"+resData);
|
||||
sendResponse(0, resData);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class GroupLogService {
|
|||
private static final int CHOOSE_TAKE_REWARD = 64;
|
||||
// 洗牌
|
||||
private static final int CHOOSE_XIPAI = 128;
|
||||
|
||||
|
||||
private static final String redisdb = "group1_db13";
|
||||
/**
|
||||
* 上下分记录类型
|
||||
|
|
@ -509,7 +509,7 @@ public class GroupLogService {
|
|||
int tagUid = objLine.getInt("uid");
|
||||
|
||||
AccountBean acc = AccountCache.getAccount(tagUid);
|
||||
objLine.putString("nick",acc==null?"": acc.nick);
|
||||
objLine.putString("nick", acc == null ? "" : acc.nick);
|
||||
|
||||
if (tagUid != uid) {
|
||||
// int newBeginTime = beginTime - 86400 * 30;
|
||||
|
|
@ -890,7 +890,7 @@ public class GroupLogService {
|
|||
ITObject objLine = list.getTObject(i);
|
||||
int tagUid = objLine.getInt("uid");
|
||||
AccountBean acc = AccountCache.getAccount(tagUid);
|
||||
objLine.putString("nick", acc==null?"":acc.nick);
|
||||
objLine.putString("nick", acc == null ? "" : acc.nick);
|
||||
|
||||
getMemberData(jedis9, tagUid, objLine, groupId, timeType, beginTime, endTime, true, true);
|
||||
}
|
||||
|
|
@ -1229,12 +1229,14 @@ public class GroupLogService {
|
|||
(sortType % 2 == 1 ? "DESC" : "ASC"));
|
||||
}
|
||||
String sql = String.format(
|
||||
"SELECT IFNULL(B.win, 0) AS win, IFNULL(B.ROUND, 0) AS round, IFNULL(B.score, 0) AS score, IFNULL(C.pump, 0) AS pump, A.uid, A.hp, A.lev, A.partnerLev "
|
||||
"SELECT IFNULL(B.win, 0) AS win, IFNULL(B.ROUND, 0) AS round, IFNULL(B.score, 0) + IFNULL(D.reason15_hp, 0) AS score, IFNULL(C.pump, 0) AS pump, A.uid, A.hp, A.lev, A.partnerLev "
|
||||
+ "FROM group_member AS A "
|
||||
+ "LEFT JOIN( SELECT SUM(win) AS win, SUM(ROUND) AS ROUND, SUM(score) AS score, uid FROM group_member_log WHERE groupId = %s AND TIME >= %s AND TIME < %s GROUP BY uid ) AS B ON A.uid = B.uid "
|
||||
+ "LEFT JOIN( SELECT IFNULL(SUM(hp), 0) AS pump, uid FROM group_hp_log WHERE gid = %s AND TIME >= %s AND TIME < %s AND reason = 7 GROUP BY uid ) AS C ON A.uid = C.uid "
|
||||
+ "LEFT JOIN (SELECT SUM(hp) AS reason15_hp,uid FROM group_hp_log WHERE gid = %s AND TIME >= %s AND TIME < %s AND reason = 18 GROUP BY uid ) AS D ON A.uid = D.uid "
|
||||
+ "WHERE A.groupId = %s AND round > 0 %s " + "GROUP BY A.uid %s" + "limit %s,%s",
|
||||
groupId, beginTime, endTime, groupId, beginTime, endTime, groupId, qid_sql, order_sql, limit, num);
|
||||
groupId, beginTime, endTime, groupId, beginTime, endTime, groupId, beginTime, endTime, groupId, qid_sql,
|
||||
order_sql, limit, num);
|
||||
|
||||
log.info("查询sql:" + sql);
|
||||
ITArray arr = DataBase.use().executeQueryByTArray(sql);
|
||||
|
|
@ -1831,6 +1833,7 @@ public class GroupLogService {
|
|||
|
||||
String roundSql = "select ifnull(sum(round_cnt),0) round_cnt,ifnull(sum(bigwin_cnt),0) bigwin_cnt from team_round_stat_day where uid="
|
||||
+ gb.owner + " and stat_day>=" + beginTime + " and stat_day<" + endTime;
|
||||
log.info("盟主号大赢家总数SQL:" + roundSql);
|
||||
|
||||
ITArray roundArr = DataBase.use().executeQueryByTArray(roundSql);
|
||||
if (roundArr.size() > 0) {
|
||||
|
|
@ -1839,6 +1842,7 @@ public class GroupLogService {
|
|||
? userData.getDouble("bigwin_cnt").intValue()
|
||||
: valid_count;
|
||||
}
|
||||
log.info("盟主号大赢家总数SQL:" + valid_count);
|
||||
|
||||
// String reward_hp = String.format("g{%s}:m%s:", groupId,uids);
|
||||
hp_cost = _getCountValue(jedis9, hp_cost_key, beginTime, endTime);
|
||||
|
|
@ -1869,8 +1873,8 @@ public class GroupLogService {
|
|||
ITObject dbData = resultArray.getTObject(0);
|
||||
Double pump = dbData.getDouble("hp");
|
||||
String xipaiwhere_sql = String.format(
|
||||
" WHERE gid = %s and reason=%s and time>=%s and time <=%s AND info != '' ", groupId,
|
||||
ConsumeCode.HP_XIPAI_PUMP, beginTime, endTime);
|
||||
" WHERE gid = %s and reason in(%s,%s) and time>=%s and time <=%s AND info != '' ", groupId,
|
||||
ConsumeCode.HP_XIPAI_PUMP,ConsumeCode.HP_PARTNER_XIPAI_REWARD_BACK, beginTime, endTime);
|
||||
String xipaisql = String.format("SELECT ifnull(sum(hp),0) as hp FROM group_hp_log %s ", xipaiwhere_sql);
|
||||
ITArray xipaiArray = DataBase.use().executeQueryByTArray(xipaisql);
|
||||
|
||||
|
|
@ -1935,6 +1939,8 @@ public class GroupLogService {
|
|||
if ((choose & CHOOSE_XIPAI) != 0) {
|
||||
reason_sql += ConsumeCode.HP_PARTNER_XIPAI_REWARD + ",";
|
||||
}
|
||||
reason_sql += ConsumeCode.HP_PUMP_BAODI + ",";
|
||||
|
||||
// reason_sql +=ConsumeCode.HP_CLEARING+ ",";
|
||||
|
||||
if (StringUtil.isNotEmpty(reason_sql)) {
|
||||
|
|
@ -2237,8 +2243,6 @@ public class GroupLogService {
|
|||
|
||||
String round_key = String.format("g%s:round:p%s", groupId, pid);
|
||||
obj.putInt("round", _getCountValue(jedis9, round_key, beginTime, endTime) * 100);
|
||||
|
||||
|
||||
|
||||
String valid_key = String.format("g%s:valid_room:p%s", groupId, pid);
|
||||
obj.putInt("valid", _getCountValue(jedis9, valid_key, beginTime, endTime) * 100);
|
||||
|
|
@ -2259,14 +2263,14 @@ public class GroupLogService {
|
|||
ITObject obj = TObject.newInstance();
|
||||
String round_key = String.format("g{%s}:m%s:valid_round2:p%s", groupId, uid, pid);
|
||||
int all_round = _getCountValue(jedis9, round_key, beginTime, endTime);
|
||||
obj.putInt("round", all_round*100);
|
||||
obj.putInt("round", all_round * 100);
|
||||
|
||||
String valid_key = String.format("g{%s}:m%s:valid_round2:p%s", groupId, uid, pid);
|
||||
int valid = _getCountValue(jedis9, valid_key, beginTime, endTime);
|
||||
obj.putInt("valid", valid*100);
|
||||
obj.putInt("valid", valid * 100);
|
||||
|
||||
int no_valid_key = all_round - valid;
|
||||
obj.putInt("no_valid", no_valid_key*100);
|
||||
obj.putInt("no_valid", no_valid_key * 100);
|
||||
|
||||
String diamo_cost_key = String.format("g{%s}:m%s:valid_diamo:p%s", groupId, uid, pid);
|
||||
obj.putInt("diamo_cost", _getCountValue(jedis9, diamo_cost_key, beginTime, endTime));
|
||||
|
|
@ -2279,6 +2283,7 @@ public class GroupLogService {
|
|||
} finally {
|
||||
jedis9.close();
|
||||
}
|
||||
log.info("玩法统计:" + arr);
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -670,6 +670,8 @@ public class GroupService {
|
|||
String sql = String.format("{call sp_add_member(%s,%s,%s)}", groupId, mgn_uid, tagId);
|
||||
log.info("addMember addsql:" + sql);
|
||||
Utility.evtdb(groupId, 2, sql);
|
||||
log.info("addMember add:" + groupId + "--" + mgn_uid + "--" + tagId);
|
||||
// sp_add_member(groupId, mgn_uid, tagId);
|
||||
|
||||
long time = System.currentTimeMillis() / 1000;
|
||||
log.info("addMember time:" + time);
|
||||
|
|
@ -687,9 +689,9 @@ public class GroupService {
|
|||
|
||||
String group_ban = jedis10.hget(mng_key, "group_ban");
|
||||
if (!StringUtil.isEmpty(group_ban) && Integer.parseInt(group_ban) == 1) {
|
||||
sql = String.format("update group_member set ban = %s where uid = %s AND groupId = %s", group_ban,
|
||||
tagId, groupId);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
String updateSql = String.format("update group_member set ban = %s where uid = %s AND groupId = %s",
|
||||
group_ban, tagId, groupId);
|
||||
Utility.evtdb(groupId, 1, updateSql);
|
||||
|
||||
jedis10.hset(tag_key, "ban", group_ban);
|
||||
jedis10.hset(tag_key, "group_ban", group_ban);
|
||||
|
|
@ -2844,6 +2846,7 @@ public class GroupService {
|
|||
|
||||
arr.addTObject(obj);
|
||||
}
|
||||
log.info("sql:"+sql);
|
||||
ITArray arr1 = DataBase.use().executeQueryByTArray(sql);
|
||||
if (arr1.size() > 0) {
|
||||
for (int i = 0; i < arr1.size(); ++i) {
|
||||
|
|
@ -3354,8 +3357,8 @@ public class GroupService {
|
|||
temp.putInt("queueid", Integer.parseInt(map.get("queueid") == null ? "0" : map.get("queueid")));
|
||||
temp.putInt("seeid", Integer.parseInt(map.get("seeid") == null ? "0" : map.get("seeid")));
|
||||
AccountBean acc = AccountCache.getAccount(tag);
|
||||
temp.putString("nick", acc==null?"":acc.nick);
|
||||
temp.putString("portrait", acc==null?"":acc.portrait);
|
||||
temp.putString("nick", acc == null ? "" : acc.nick);
|
||||
temp.putString("portrait", acc == null ? "" : acc.portrait);
|
||||
String last_time = map.get("last_time");
|
||||
temp.putInt("last_time", StringUtil.isNotEmpty(last_time) ? Integer.parseInt(last_time) : 0);
|
||||
String permission = map.get("permission");
|
||||
|
|
@ -3541,6 +3544,10 @@ public class GroupService {
|
|||
|
||||
String p_reward_key = GroupCache.genRewardKey(groupId, pid);
|
||||
Double tem = jedis10.zscore(p_reward_key, tagId + "");
|
||||
// log.info("p_reward_key:"+p_reward_key);
|
||||
// log.info("tagId:"+tagId);
|
||||
// log.info("tem.intValue():"+tem.intValue());
|
||||
|
||||
cur_value = tem == null ? 0 : tem.intValue();
|
||||
if (partnerLev == 1) {
|
||||
max_value = gpb.reward;
|
||||
|
|
@ -5639,4 +5646,21 @@ public class GroupService {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void sp_add_member(int groupId, int mgn_uid, int tagId) {
|
||||
try {
|
||||
String sql = String.format("select count(1) from group_member where uid = %s AND groupId = %s for update",tagId,groupId);
|
||||
ITArray arr = DataBase.use().executeQueryByTArray(sql);
|
||||
if (arr.size() > 0) {
|
||||
throw new WebException(ErrorCode.GROUP_MEMBER_EXIST);
|
||||
}else {
|
||||
log.info("录入group_member: tagId-"+tagId+",parentId-"+mgn_uid);
|
||||
String addSql = String.format("INSERT INTO group_member(uid,groupId,join_time,parentId) VALUES(%s,%s,%s,%s)",tagId,groupId,System.currentTimeMillis(),mgn_uid);
|
||||
DataBase.use().executeUpdate(addSql);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.error("加入成员失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -852,26 +852,14 @@ public class AccountService extends Controller {
|
|||
resData.putBoolean("havePassword", true);
|
||||
resData.putBoolean("havegroup", true);
|
||||
resData.putString("isBangding", "1");
|
||||
// logger.info("reqData:"+resData);
|
||||
|
||||
// resData.putBoolean("isBangding", true);
|
||||
// // 判断是否已经进入圈子
|
||||
// String haveGroupsql = String.format("SELECT uid,partnerLev FROM group_member gm WHERE gm.uid ='%d'",
|
||||
// accountid);
|
||||
// List<Map<String, String>> haveGroupsqlCount = DataBase.use().executeQuery(haveGroupsql);
|
||||
// if (haveGroupsqlCount.size() > 0) {
|
||||
// // 这里只能判断第一条数据,如果多个大联盟需要区分哪个联盟的代理
|
||||
// int partnerLev = haveGroupsqlCount.get(0).get("partnerLev") == null ? 0
|
||||
// : Integer.parseInt(haveGroupsqlCount.get(0).get("partnerLev"));
|
||||
// if (partnerLev > 0) {
|
||||
// throw new WebException(ErrorCode._FAILED);
|
||||
// }
|
||||
// resData.putBoolean("havegroup", true);
|
||||
// } else {
|
||||
// resData.putBoolean("havegroup", false);
|
||||
// }
|
||||
// logger.info("havePassword:" + resData.getBoolean("havePassword"));
|
||||
// logger.info("havegroup:" + resData.getBoolean("havegroup"));
|
||||
// // 默认锁住账户
|
||||
// String lockSql = "update account set is_lock=? WHERE id=?";
|
||||
// String[] params3 = new String[2];
|
||||
// params3[0] = 1 + "";
|
||||
// params3[1] = accountid + "";
|
||||
//
|
||||
// DataBase.use().executeUpdateLogin(lockSql, params3);
|
||||
|
||||
this.sendResponse(ErrorCode._SUCC, resData);
|
||||
} finally {
|
||||
|
|
@ -1552,6 +1540,15 @@ public class AccountService extends Controller {
|
|||
System.currentTimeMillis() / 1000);
|
||||
|
||||
DataBase.use().executeUpdate(loginSql);
|
||||
|
||||
// // 默认锁住账户
|
||||
// String lockSql = "update account set is_lock=? WHERE id=?";
|
||||
// String[] params3 = new String[2];
|
||||
// params3[0] = 1 + "";
|
||||
// params3[1] = accountid + "";
|
||||
//
|
||||
// DataBase.use().executeUpdateLogin(lockSql, params3);
|
||||
|
||||
|
||||
this.sendResponse(ErrorCode._SUCC, resData);
|
||||
// }finally {
|
||||
|
|
|
|||
|
|
@ -109,15 +109,15 @@ public class RSAUtils {
|
|||
//测试
|
||||
public static void main(String[] args) throws Exception {
|
||||
//加密字符串
|
||||
String message = "{\"appid\":\"wx40ac640ee6bd1116\",\"appSecret\":\"cde030153f5b97874c5e6063c70c0f97\"}";
|
||||
System.out.println("随机生成的公钥为:" + appIdPublicKey);
|
||||
System.out.println("随机生成的私钥为:" + appIdPrivateKey);
|
||||
String messageEn = appIdencrypt(message, appIdPublicKey);
|
||||
System.out.println("加密前:" + message);
|
||||
System.out.println("加密后:" + "U8sAHDB1miX5\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\/VdaQH+Ha\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\/UgyYuyASAN3LLwAu\\/tU\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\/S39fuSfWdGTFjv5Mg6xv\\/hF6kgWlgSB2AP1GQy\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\/DyD+\\/Tico=");
|
||||
String messageDe = appIddecrypt("U8sAHDB1miX5\\\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\\\/VdaQH+Ha\\\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\\\/UgyYuyASAN3LLwAu\\\\/tU\\\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\\\/S39fuSfWdGTFjv5Mg6xv\\\\/hF6kgWlgSB2AP1GQy\\\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\\\/DyD+\\\\/Tico=");
|
||||
System.out.println("还原后:" + messageDe);
|
||||
|
||||
// String message = "{\"appid\":\"wx40ac640ee6bd1116\",\"appSecret\":\"cde030153f5b97874c5e6063c70c0f97\"}";
|
||||
// System.out.println("随机生成的公钥为:" + appIdPublicKey);
|
||||
// System.out.println("随机生成的私钥为:" + appIdPrivateKey);
|
||||
// String messageEn = appIdencrypt(message, appIdPublicKey);
|
||||
// System.out.println("加密前:" + message);
|
||||
// System.out.println("加密后:" + "U8sAHDB1miX5\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\/VdaQH+Ha\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\/UgyYuyASAN3LLwAu\\/tU\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\/S39fuSfWdGTFjv5Mg6xv\\/hF6kgWlgSB2AP1GQy\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\/DyD+\\/Tico=");
|
||||
// String messageDe = appIddecrypt("U8sAHDB1miX5\\\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\\\/VdaQH+Ha\\\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\\\/UgyYuyASAN3LLwAu\\\\/tU\\\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\\\/S39fuSfWdGTFjv5Mg6xv\\\\/hF6kgWlgSB2AP1GQy\\\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\\\/DyD+\\\\/Tico=");
|
||||
// System.out.println("还原后:" + messageDe);
|
||||
//
|
||||
|
||||
// String appid = "wx40ac640ee6bd1116";
|
||||
// String appSecret = "cde030153f5b97874c5e6063c70c0f97";
|
||||
|
|
@ -126,7 +126,8 @@ public class RSAUtils {
|
|||
// object.addProperty("appSecret", appSecret);
|
||||
// String encryptText = RSAUtils.encrypt(appid.toString(), RSAUtils.appIdPublicKey);
|
||||
// System.out.println("加密后的数据:"+encryptText);
|
||||
|
||||
String decryptedText = RSAUtils.decrypt("GHKjRtxfSvXcKHs508ezGSTlpzrArKvg5Vcdp36iQ2DDHvPniJ6lrwIIEkVAWNg4Bf0hwUHB3g+JQb4nCv3ty1qunU7gBWg1grE92g2EQv+Q2ptHkfcUwo+1n7Tf5gEwap+Bo2q53m2le0B0jj23GTPOLHhVzpsFEJjRnAXzrexRRKcWCuAeteH1kTAJblBsXAMKfhVeiXXf1ZaNyqyGmzJYRBatLuiQa59xFfE3J7dOnQshIMA357jKaBRXBNPzbmN8POSu6UNZVQY2VIOrnpU0BisH2HpIwQTRnlx6c7rwltiFVUrW8k9LP11CC5IkZjFY2pG+I6it1MEBwwe3tyE7Ckg7qiOl+YrJg2fYpRLQjuiW4GOIPpSFXpABB5\\/eTHR1qQBCM9U+LktagSu9TbtP3aJ\\/qtLvFeNRlXEhf9iGEFdl0XB+7zek0qbR7RsbW8sa4rbPteSMZNO5x+YS\\/RzVTFua6lRedwdls9nPw8NH8kNA88Fv31HmwGjTKlJ0dT4f4GTGgCKFu16FRVVehOLMy+hQyDkoej8Hvw\\/5Y8l2r4FlEN3Rj1kOGDL5OCAjcdHEbajjlOUzxrEKzbXzzolGsu9A9OGjnw\\/aZ4NRnOcpsyzXbhtVupaOOlGiRbg0CvfUr8BF0Gbpqbi1uxAnDMu+fheR7jadnTWlC6SzqZY=");
|
||||
System.out.println(decryptedText);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue