master
parent
eeba27679b
commit
a5f2e62f27
|
|
@ -9,12 +9,9 @@ import com.group.Protocol;
|
|||
import com.group.WebInterceptor;
|
||||
import com.group.service.GroupRoomService;
|
||||
import com.taurus.core.entity.ITObject;
|
||||
import com.taurus.core.plugin.redis.Redis;
|
||||
import com.taurus.core.routes.ActionKey;
|
||||
import com.taurus.web.Controller;
|
||||
import com.taurus.web.WebException;
|
||||
import jdk.nashorn.internal.objects.Global;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
public class GroupRoomController extends Controller {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElementDecl.GLOBAL;
|
||||
|
||||
import com.data.bean.AccountBean;
|
||||
import com.data.bean.GroupBean;
|
||||
import com.data.bean.GroupMemberBean;
|
||||
|
|
@ -14,7 +12,6 @@ import com.data.cache.AccountCache;
|
|||
import com.data.cache.GroupCache;
|
||||
import com.data.cache.GroupMemberCache;
|
||||
import com.data.util.ConsumeCode;
|
||||
import com.data.util.CountUtil;
|
||||
import com.data.util.ErrorCode;
|
||||
import com.data.util.Utility;
|
||||
import com.taurus.core.entity.ITArray;
|
||||
|
|
@ -23,15 +20,12 @@ import com.taurus.core.entity.TArray;
|
|||
import com.taurus.core.entity.TObject;
|
||||
import com.taurus.core.plugin.database.DataBase;
|
||||
import com.taurus.core.plugin.redis.Redis;
|
||||
import com.taurus.core.plugin.redis.RedisLock;
|
||||
import com.taurus.core.util.DateUtils;
|
||||
import com.taurus.core.util.Logger;
|
||||
import com.taurus.core.util.StringUtil;
|
||||
import com.taurus.web.WebException;
|
||||
|
||||
import jdk.nashorn.internal.objects.Global;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
|
||||
public class GroupLogService {
|
||||
|
||||
|
|
@ -955,14 +949,12 @@ public class GroupLogService {
|
|||
valid_round = userData.getDouble("bigwin_cnt").intValue() > 0
|
||||
? userData.getDouble("bigwin_cnt").intValue()
|
||||
: 0;
|
||||
total_win = userData.getDouble("win_score").intValue() != 0
|
||||
? userData.getDouble("win_score").intValue()
|
||||
total_win = userData.getDouble("win_score").intValue() != 0 ? userData.getDouble("win_score").intValue()
|
||||
: total_win;
|
||||
reward_hp = userData.getDouble("round_reward").intValue() > 0
|
||||
? userData.getDouble("round_reward").intValue()
|
||||
: reward_hp;
|
||||
|
||||
|
||||
}
|
||||
// if (beginTime==1753286400&&endTime==1753372800){
|
||||
// param.putInt("total_round" , total_round+valid_round/100);
|
||||
|
|
@ -1056,18 +1048,15 @@ public class GroupLogService {
|
|||
valid_round = userData.getDouble("bigwin_cnt").intValue() > 0
|
||||
? userData.getDouble("bigwin_cnt").intValue()
|
||||
: 0;
|
||||
total_win = userData.getDouble("win_score").intValue() !=0
|
||||
? userData.getDouble("win_score").intValue()
|
||||
total_win = userData.getDouble("win_score").intValue() != 0 ? userData.getDouble("win_score").intValue()
|
||||
: total_win;
|
||||
|
||||
|
||||
}
|
||||
param.putInt("valid_round", valid_round);
|
||||
param.putInt("total_round", total_round);
|
||||
param.putInt("win_round", win_round);
|
||||
param.putInt("total_win", total_win-xipai_cost);
|
||||
param.putInt("total_win", total_win - xipai_cost);
|
||||
|
||||
|
||||
ITObject gallc = GroupService.getAllHpCache(groupId, uid, 30);
|
||||
param.putTObject("hpall", gallc);
|
||||
} else if (timeType == 2) {
|
||||
|
|
@ -1103,13 +1092,11 @@ public class GroupLogService {
|
|||
valid_round = userData.getDouble("bigwin_cnt").intValue() > 0
|
||||
? userData.getDouble("bigwin_cnt").intValue()
|
||||
: 0;
|
||||
total_win = userData.getDouble("win_score").intValue() !=0
|
||||
? userData.getDouble("win_score").intValue()
|
||||
total_win = userData.getDouble("win_score").intValue() != 0 ? userData.getDouble("win_score").intValue()
|
||||
: total_win;
|
||||
|
||||
|
||||
}
|
||||
param.putInt("total_win", total_win-xipai_cost);
|
||||
param.putInt("total_win", total_win - xipai_cost);
|
||||
param.putInt("total_round", total_round);
|
||||
param.putInt("valid_round", valid_round);
|
||||
param.putInt("win_round", win_round);
|
||||
|
|
@ -1227,7 +1214,7 @@ public class GroupLogService {
|
|||
Jedis jedis10 = Redis.use("group1_db10").getJedis();
|
||||
try {
|
||||
List<Integer> par_list = Utility.getMemberParents(jedis10, groupId, qid, false);
|
||||
if ((par_list == null || !par_list.contains(uid)) && qid!=uid) {
|
||||
if ((par_list == null || !par_list.contains(uid)) && qid != uid) {
|
||||
throw new WebException(ErrorCode.GROUP_NOT_PERMISSION);
|
||||
}
|
||||
} finally {
|
||||
|
|
@ -1370,7 +1357,7 @@ public class GroupLogService {
|
|||
}
|
||||
List<Integer> par_list = Utility.getMemberParents(jedis10, groupId,
|
||||
includeMembers == 0 ? parentId : qid, true);
|
||||
if ((par_list == null || !par_list.contains(uid)) && uid!=qid) {
|
||||
if ((par_list == null || !par_list.contains(uid)) && uid != qid) {
|
||||
// log.info("par_list:"+par_list);
|
||||
// log.info("uid:"+uid);
|
||||
//
|
||||
|
|
@ -1381,12 +1368,12 @@ public class GroupLogService {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
log.info("else find:"+find);
|
||||
log.info("else find:" + find);
|
||||
|
||||
find = false;
|
||||
}
|
||||
}
|
||||
}catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e);
|
||||
} finally {
|
||||
|
|
@ -1908,11 +1895,9 @@ public class GroupLogService {
|
|||
valid_count = userData.getDouble("bigwin_cnt").intValue() > 0
|
||||
? userData.getDouble("bigwin_cnt").intValue()
|
||||
: 0;
|
||||
count = userData.getDouble("round_cnt").intValue() > 0
|
||||
? userData.getDouble("round_cnt").intValue()
|
||||
count = userData.getDouble("round_cnt").intValue() > 0 ? userData.getDouble("round_cnt").intValue()
|
||||
: count;
|
||||
|
||||
|
||||
}
|
||||
// log.info("盟主号大赢家总数SQL:" + valid_count);
|
||||
|
||||
|
|
@ -1942,7 +1927,7 @@ public class GroupLogService {
|
|||
Double pump = dbData.getDouble("hp");
|
||||
String xipaiwhere_sql = String.format(
|
||||
" 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);
|
||||
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);
|
||||
|
||||
|
|
@ -1955,23 +1940,22 @@ public class GroupLogService {
|
|||
resData.putDouble("pump", pump - xipaiData.getDouble("hp"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// resData.putInt("pump", hp_cost);
|
||||
|
||||
String rewardsql = String.format(
|
||||
" SELECT -sum(win_score+round_reward) reward FROM `team_round_stat_day` WHERE stat_day >= %s AND stat_day < %s and uid!=%s and parent_uid=%s",
|
||||
beginTime, endTime,gb.owner,gb.owner);
|
||||
" SELECT -sum(win_score+round_reward) reward FROM `team_round_stat_day` WHERE stat_day >= %s AND stat_day < %s and uid!=%s and parent_uid=%s",
|
||||
beginTime, endTime, gb.owner, gb.owner);
|
||||
// log.info("rewardsql:" + rewardsql);
|
||||
|
||||
ITArray rewardArray = DataBase.use().executeQueryByTArray(rewardsql);
|
||||
if(rewardArray.size()!=0) {
|
||||
if (rewardArray.size() != 0) {
|
||||
ITObject rewardData = rewardArray.getTObject(0);
|
||||
|
||||
// log.info("reward:" + rewardData.getDouble("reward") );
|
||||
|
||||
resData.putDouble("pump", rewardData.getDouble("reward") );
|
||||
resData.putDouble("pump", rewardData.getDouble("reward"));
|
||||
|
||||
}
|
||||
resData.putInt("gains", hp_cost - hp_reward);
|
||||
|
|
@ -2002,9 +1986,12 @@ public class GroupLogService {
|
|||
if ((choose & CHOOSE_UPPER) != 0) {
|
||||
reason_sql += ConsumeCode.HP_MGR_UPPER + "," + ConsumeCode.HP_PARTNER_UPPER + ",";
|
||||
reason_sql += ConsumeCode.HP_MGR_SUB + "," + ConsumeCode.HP_PARTNER_SUB + ",";
|
||||
reason_sql += ConsumeCode.HP_TAKE_BANK + "," + ConsumeCode.HP_SAVE_BANK + ",";
|
||||
}
|
||||
if ((choose & CHOOSE_SUB) != 0) {
|
||||
reason_sql += ConsumeCode.HP_MGR_SUB + "," + ConsumeCode.HP_PARTNER_SUB + ",";
|
||||
reason_sql += ConsumeCode.HP_TAKE_BANK + "," + ConsumeCode.HP_SAVE_BANK + ",";
|
||||
|
||||
}
|
||||
if ((choose & CHOOSE_PUMP) != 0) {
|
||||
reason_sql += ConsumeCode.HP_PUMP + ",";
|
||||
|
|
@ -2026,7 +2013,6 @@ public class GroupLogService {
|
|||
if ((choose & CHOOSE_XIPAI) != 0) {
|
||||
reason_sql += ConsumeCode.HP_PARTNER_XIPAI_REWARD + ",";
|
||||
}
|
||||
|
||||
|
||||
// reason_sql +=ConsumeCode.HP_CLEARING+ ",";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
package com.group.service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.data.bean.*;
|
||||
import com.data.bean.AccountBean;
|
||||
import com.data.bean.GameBean;
|
||||
import com.data.bean.GroupBean;
|
||||
import com.data.bean.GroupMemberBean;
|
||||
import com.data.bean.GroupPlayBean;
|
||||
import com.data.cache.AccountCache;
|
||||
import com.data.cache.BaseCache;
|
||||
import com.data.cache.GameCache;
|
||||
|
|
@ -21,7 +30,6 @@ import com.taurus.core.util.Logger;
|
|||
import com.taurus.core.util.StringUtil;
|
||||
import com.taurus.web.WebException;
|
||||
|
||||
import jdk.nashorn.internal.objects.Global;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
public class GroupRoomService {
|
||||
|
|
@ -1016,7 +1024,7 @@ public class GroupRoomService {
|
|||
// }
|
||||
|
||||
// 检测是否可娱乐
|
||||
if(t_list!=null) {
|
||||
if (t_list != null) {
|
||||
for (int i = 0; i < t_list.size(); i++) {
|
||||
ITArray list = GroupService.getMemberPlayList(groupId, t_list.get(i));
|
||||
if (list.size() != 0) {
|
||||
|
|
@ -1030,7 +1038,6 @@ public class GroupRoomService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (String room : rooms) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
package com.group.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElementDecl.GLOBAL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
|
||||
import com.data.bean.AccountBean;
|
||||
import com.data.bean.GameBean;
|
||||
|
|
@ -20,7 +25,10 @@ import com.data.util.CountUtil;
|
|||
import com.data.util.ErrorCode;
|
||||
import com.data.util.Utility;
|
||||
import com.group.MainServer;
|
||||
import com.taurus.core.entity.*;
|
||||
import com.taurus.core.entity.ITArray;
|
||||
import com.taurus.core.entity.ITObject;
|
||||
import com.taurus.core.entity.TArray;
|
||||
import com.taurus.core.entity.TObject;
|
||||
import com.taurus.core.plugin.database.DataBase;
|
||||
import com.taurus.core.plugin.redis.Redis;
|
||||
import com.taurus.core.plugin.redis.RedisLock;
|
||||
|
|
@ -29,7 +37,6 @@ import com.taurus.core.util.Logger;
|
|||
import com.taurus.core.util.StringUtil;
|
||||
import com.taurus.web.WebException;
|
||||
|
||||
import jdk.nashorn.internal.objects.Global;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
|
||||
|
|
@ -120,8 +127,8 @@ public class GroupService {
|
|||
try {
|
||||
ITArray list = TArray.newInstance();
|
||||
String key = GroupCache.genGroupsKey(uid);
|
||||
log.info("key:"+key);
|
||||
log.info("uid:"+uid);
|
||||
log.info("key:" + key);
|
||||
log.info("uid:" + uid);
|
||||
|
||||
Set<String> groups = jedis11.zrevrange(key, 0, -1);
|
||||
for (String tem : groups) {
|
||||
|
|
@ -673,21 +680,20 @@ public class GroupService {
|
|||
long time = System.currentTimeMillis() / 1000;
|
||||
// String sql = String.format("{call sp_add_member(%s,%s,%s)}", groupId, mgn_uid, tagId);
|
||||
// Utility.evtdb(groupId, 2, sql);
|
||||
|
||||
|
||||
// INSERT INTO group_member(uid,groupId,join_time,parentId) VALUES(_tagId,_groupId,_time,_pid);
|
||||
String selectSql = String.format("select uid from group_member where uid=%s", tagId);
|
||||
ITArray tmplist = DataBase.use().executeQueryByTArray(selectSql);
|
||||
if (tmplist.size() > 0) {
|
||||
return ErrorCode.GROUP_MEMBER_EXIST;
|
||||
}else {
|
||||
} else {
|
||||
String insertSql = String.format(
|
||||
"INSERT INTO group_member(uid,groupId,join_time,parentId) VALUES(%s,%s,%s,%s)", tagId, groupId,
|
||||
time, mgn_uid);
|
||||
"INSERT INTO group_member(uid,groupId,join_time,parentId) VALUES(%s,%s,%s,%s)", tagId,
|
||||
groupId, time, mgn_uid);
|
||||
Utility.evtdb(groupId, 1, insertSql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// sp_add_member(groupId, mgn_uid, tagId);
|
||||
|
||||
Map<String, String> redis_map = memberToRedis(groupId + "", tagId, 3, 0, mgn_uid, time);
|
||||
|
|
@ -1412,76 +1418,69 @@ public class GroupService {
|
|||
} else {
|
||||
reason = hp < 0 ? ConsumeCode.HP_PARTNER_SUB : ConsumeCode.HP_PARTNER_UPPER;
|
||||
}
|
||||
//扣除操作者hp
|
||||
sql = String.format(
|
||||
"UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s ",
|
||||
-hp,groupId, uid);
|
||||
// 扣除操作者hp
|
||||
sql = String.format("UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s ", -hp,
|
||||
groupId, uid);
|
||||
// log.info("sql1:" + sql);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
//增加记录
|
||||
// 增加记录
|
||||
sql = String.format(
|
||||
"INSERT INTO group_hp_log(gid,uid,mgr_id,reason,hp,cur_hp,pid,roomid,time) "
|
||||
+ "VALUES(%s,%s,%s,%s,%s,%s,%s,'',%s)",
|
||||
groupId, uid,tagId, reason, -hp, mhp, 0, System.currentTimeMillis()/1000);
|
||||
groupId, uid, tagId, reason, -hp, mhp, 0, System.currentTimeMillis() / 1000);
|
||||
// log.info("操作者sql:" + sql);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
|
||||
|
||||
//扣除目标人物hp
|
||||
sql = String.format(
|
||||
"UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s ",
|
||||
hp,groupId, tagId);
|
||||
|
||||
// 扣除目标人物hp
|
||||
sql = String.format("UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s ", hp, groupId,
|
||||
tagId);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
//增加记录
|
||||
// 增加记录
|
||||
reason = hp < 0 ? ConsumeCode.HP_MGR_SUB : ConsumeCode.HP_MGR_UPPER;
|
||||
|
||||
|
||||
sql = String.format(
|
||||
"INSERT INTO group_hp_log(gid,uid,mgr_id,reason,hp,cur_hp,pid,roomid,time) "
|
||||
+ "VALUES(%s,%s,%s,%s,%s,%s,%s,'',%s)",
|
||||
groupId, tagId,uid, reason, hp, thp, 0, System.currentTimeMillis()/1000);
|
||||
groupId, tagId, uid, reason, hp, thp, 0, System.currentTimeMillis() / 1000);
|
||||
// log.info("目标人物sql:" + sql);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
} else {
|
||||
reason = hp < 0 ? ConsumeCode.HP_MGR_SUB : ConsumeCode.HP_MGR_UPPER;
|
||||
|
||||
//扣除目标人物hp
|
||||
sql = String.format(
|
||||
"UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s",
|
||||
hp,groupId, tagId);
|
||||
|
||||
// 扣除目标人物hp
|
||||
sql = String.format("UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s", hp, groupId,
|
||||
tagId);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
if (uid == tagId && otherId > 0) {
|
||||
//扣除操作者hp
|
||||
sql = String.format(
|
||||
"UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s",
|
||||
-hp,groupId, uid);
|
||||
// 扣除操作者hp
|
||||
sql = String.format("UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s", -hp,
|
||||
groupId, uid);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
//增加记录
|
||||
// 增加记录
|
||||
sql = String.format(
|
||||
"INSERT INTO group_hp_log(gid,uid,mgr_id,reason,hp,cur_hp,pid,roomid,time) "
|
||||
+ "VALUES(%s,%s,%s,%s,%s,%s,%s,'',%s)",
|
||||
groupId, uid,otherId, reason, hp, thp, 0, System.currentTimeMillis()/1000);
|
||||
groupId, uid, otherId, reason, hp, thp, 0, System.currentTimeMillis() / 1000);
|
||||
// log.info("自身记录:" + sql);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
}else {
|
||||
if(uid != tagId) {
|
||||
//扣除操作者hp
|
||||
sql = String.format(
|
||||
"UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s",
|
||||
-hp,groupId, uid);
|
||||
} else {
|
||||
if (uid != tagId) {
|
||||
// 扣除操作者hp
|
||||
sql = String.format("UPDATE group_member SET hp=hp+%s WHERE groupId = %s and uid=%s", -hp,
|
||||
groupId, uid);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
|
||||
}
|
||||
//增加记录
|
||||
// 增加记录
|
||||
sql = String.format(
|
||||
"INSERT INTO group_hp_log(gid,uid,mgr_id,reason,hp,cur_hp,pid,roomid,time) "
|
||||
+ "VALUES(%s,%s,%s,%s,%s,%s,%s,'',%s)",
|
||||
groupId, tagId,uid, reason, hp, thp, 0, System.currentTimeMillis()/1000);
|
||||
groupId, tagId, uid, reason, hp, thp, 0, System.currentTimeMillis() / 1000);
|
||||
// log.info("mengzhu自身记录:" + sql);
|
||||
DataBase.use().executeUpdate(sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ------------------------邮件 -------------------
|
||||
ITObject mail_data = TObject.newInstance();
|
||||
|
|
@ -1757,15 +1756,15 @@ public class GroupService {
|
|||
int mhp = arr.get(1).intValue();
|
||||
// String sql = String.format("{call sp_take_reward_hp(%s,%s,%s,%s)}", groupId, tagId, (int) hp, mhp);
|
||||
// Utility.evtdb(groupId, 2, sql);
|
||||
String sql = String.format("update group_member set reward_hp = reward_hp-%s,hp=hp+%s where uid = %s AND groupId = %s", hp,hp,
|
||||
tagId, groupId);
|
||||
String sql = String.format(
|
||||
"update group_member set reward_hp = reward_hp-%s,hp=hp+%s where uid = %s AND groupId = %s", hp,
|
||||
hp, tagId, groupId);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
log.info("提取sql:" + sql);
|
||||
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)",
|
||||
groupId, tagId, ConsumeCode.HP_TAKE_REWARD, hp , _r_hp, 0,
|
||||
System.currentTimeMillis()/1000);
|
||||
groupId, tagId, ConsumeCode.HP_TAKE_REWARD, hp, _r_hp, 0, System.currentTimeMillis() / 1000);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
|
||||
ITObject resData = TObject.newInstance();
|
||||
|
|
@ -2000,16 +1999,16 @@ public class GroupService {
|
|||
long b_hp = arr.get(1).longValue();
|
||||
// String sql = String.format("{call sp_bank_hp(%s,%s,%s,%s)}", groupId, tagId, -(int) hp, mhp);
|
||||
// Utility.evtdb(groupId, 2, sql);
|
||||
|
||||
String sql = String.format("update group_member set bank_hp = bank_hp-%s,hp=hp+%s where uid = %s AND groupId = %s",
|
||||
hp, hp, tagId, groupId);
|
||||
|
||||
String sql = String.format(
|
||||
"update group_member set bank_hp = bank_hp-%s,hp=hp+%s where uid = %s AND groupId = %s", hp, hp,
|
||||
tagId, groupId);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
log.info("取出sql:" + sql);
|
||||
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)",
|
||||
groupId, uid, ConsumeCode.HP_TAKE_BANK, -hp , b_hp, 0,
|
||||
System.currentTimeMillis()/1000);
|
||||
groupId, uid, ConsumeCode.HP_TAKE_BANK, -hp, b_hp, 0, System.currentTimeMillis() / 1000);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
ITObject resData = TObject.newInstance();
|
||||
resData.putLong("hp", mhp);
|
||||
|
|
@ -2086,18 +2085,17 @@ public class GroupService {
|
|||
// String sql = String.format("{call sp_bank_hp(%s,%s,%s,%s)}", groupId, tagId, hp, mhp);
|
||||
// Utility.evtdb(groupId, 2, sql);
|
||||
|
||||
String sql = String.format("update group_member set bank_hp =bank_hp+ %s,hp=hp-%s where uid = %s AND groupId = %s",
|
||||
hp, hp, tagId, groupId);
|
||||
String sql = String.format(
|
||||
"update group_member set bank_hp =bank_hp+ %s,hp=hp-%s where uid = %s AND groupId = %s", hp, hp,
|
||||
tagId, groupId);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
|
||||
|
||||
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)",
|
||||
groupId, uid, ConsumeCode.HP_SAVE_BANK, hp , b_hp, 0,
|
||||
System.currentTimeMillis()/1000);
|
||||
groupId, uid, ConsumeCode.HP_SAVE_BANK, hp, b_hp, 0, System.currentTimeMillis() / 1000);
|
||||
Utility.evtdb(groupId, 1, sql);
|
||||
|
||||
|
||||
ITObject resData = TObject.newInstance();
|
||||
resData.putLong("hp", mhp);
|
||||
resData.putLong("b_hp", b_hp);
|
||||
|
|
|
|||
Loading…
Reference in New Issue