|
@@ -248,16 +248,18 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//需要redis 加锁
|
|
//需要redis 加锁
|
|
|
- long time = System.currentTimeMillis() + RedisData.getPlayerGoodsTimeout();
|
|
|
|
|
|
|
+ //long time = System.currentTimeMillis() + RedisData.getPlayerGoodsTimeout();
|
|
|
//获取用户的plantFlag,因为之前的用户没有设置这个flag,所以设为第一次,用 userId 和 landId 组合成key
|
|
//获取用户的plantFlag,因为之前的用户没有设置这个flag,所以设为第一次,用 userId 和 landId 组合成key
|
|
|
String _redisKey = comPlayerLand.getPlantFlag();
|
|
String _redisKey = comPlayerLand.getPlantFlag();
|
|
|
if (!StringUtils.hasText(_redisKey)) {
|
|
if (!StringUtils.hasText(_redisKey)) {
|
|
|
//return Result.of(null, false, ResultEnum.LAND_PLANT_FLAG_IS_NULL.getMessage(), ResultEnum.LAND_PLANT_FLAG_IS_NULL.getCode());
|
|
//return Result.of(null, false, ResultEnum.LAND_PLANT_FLAG_IS_NULL.getMessage(), ResultEnum.LAND_PLANT_FLAG_IS_NULL.getCode());
|
|
|
_redisKey = comPlayerLand.getUserId() + "or" + comPlayerLand.getConfigLandId();
|
|
_redisKey = comPlayerLand.getUserId() + "or" + comPlayerLand.getConfigLandId();
|
|
|
}
|
|
}
|
|
|
|
|
+ long landTime = System.currentTimeMillis() + RedisData.getLandTimeout();
|
|
|
|
|
+
|
|
|
//受灾时候,不给收获
|
|
//受灾时候,不给收获
|
|
|
- String _disasterKey = RedisData.getPlayerDisastersFirstKey() + comPlayerLand.getConfigLandId() + comPlayerLand.getUserId();
|
|
|
|
|
- long _disasterTime = System.currentTimeMillis() + RedisData.getPlayerDisastersFirstTimeout();
|
|
|
|
|
|
|
+ //String _disasterKey = RedisData.getPlayerDisastersFirstKey() + comPlayerLand.getConfigLandId() + comPlayerLand.getUserId();
|
|
|
|
|
+ //long _disasterTime = System.currentTimeMillis() + RedisData.getPlayerDisastersFirstTimeout();
|
|
|
|
|
|
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
|
//todo 总共偷去的数量
|
|
//todo 总共偷去的数量
|
|
@@ -266,12 +268,12 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
Double _disasterProfits = 0d;
|
|
Double _disasterProfits = 0d;
|
|
|
try {
|
|
try {
|
|
|
//加一层受灾锁
|
|
//加一层受灾锁
|
|
|
- if (!redisLock.lock(_disasterKey, String.valueOf(_disasterTime))) {
|
|
|
|
|
- return Result.of(null, false, ResultEnum.LAND_DISATER_LOCK.getMessage(), ResultEnum.LAND_DISATER_LOCK.getCode());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (!redisLock.lock(_disasterKey, String.valueOf(_disasterTime))) {
|
|
|
|
|
+ // return Result.of(null, false, ResultEnum.LAND_DISATER_LOCK.getMessage(), ResultEnum.LAND_DISATER_LOCK.getCode());
|
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
// 如果存在plantFlag 说明是新种植的
|
|
// 如果存在plantFlag 说明是新种植的
|
|
|
- if (!redisLock.lock(_redisKey, String.valueOf(time))) {
|
|
|
|
|
|
|
+ if (!redisLock.lock(_redisKey, String.valueOf(landTime))) {
|
|
|
return Result.of(null, false, ResultEnum.LAND_STEAL_LOCK.getMessage(), ResultEnum.LAND_STEAL_LOCK.getCode());
|
|
return Result.of(null, false, ResultEnum.LAND_STEAL_LOCK.getMessage(), ResultEnum.LAND_STEAL_LOCK.getCode());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -382,12 +384,12 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
comPlayerLogService.save(_playerLogVo);
|
|
comPlayerLogService.save(_playerLogVo);
|
|
|
|
|
|
|
|
//对应的,存在plantFlag则解锁
|
|
//对应的,存在plantFlag则解锁
|
|
|
- redisLock.unlock(_redisKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
|
|
|
|
+ redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
|
|
+ //redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
//对应的,存在plantFlag则解锁
|
|
//对应的,存在plantFlag则解锁
|
|
|
- redisLock.unlock(_redisKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
|
|
|
|
+ redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
|
|
+ //redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
}
|
|
|
map.put("msg", "成功收取果实!");
|
|
map.put("msg", "成功收取果实!");
|
|
@@ -481,6 +483,10 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
ComPlayersAttriVo playersAttribute = comPlayersAttriService.findByUserId(userId);
|
|
ComPlayersAttriVo playersAttribute = comPlayersAttriService.findByUserId(userId);
|
|
|
Integer _out = _maxStrength - Math.abs(playersAttribute.getStrength());
|
|
Integer _out = _maxStrength - Math.abs(playersAttribute.getStrength());
|
|
|
Double _userAllSnb = DoubleUtil.add(comUsersVo.getSnb().doubleValue(), comUsersVo.getSnbPart());
|
|
Double _userAllSnb = DoubleUtil.add(comUsersVo.getSnb().doubleValue(), comUsersVo.getSnbPart());
|
|
|
|
|
+ if (DoubleUtil.compare(_userAllSnb, 0.0).equals(-1)) {
|
|
|
|
|
+ map.put("msg", "snb异常");
|
|
|
|
|
+ return Result.of(map, false, ResultEnum.WALLET_SNB_ABNORMAL.getMessage(), ResultEnum.WALLET_SNB_ABNORMAL.getCode());
|
|
|
|
|
+ }
|
|
|
//判断是否有足够的snb
|
|
//判断是否有足够的snb
|
|
|
if (DoubleUtil.compare(_userAllSnb, comSettingVo.getDeductSnb()) == -1) {
|
|
if (DoubleUtil.compare(_userAllSnb, comSettingVo.getDeductSnb()) == -1) {
|
|
|
_hasReduceSnb = false;
|
|
_hasReduceSnb = false;
|
|
@@ -510,44 +516,57 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
if (otherPlayerLand == null) {
|
|
if (otherPlayerLand == null) {
|
|
|
return Result.of(null, false, ResultEnum.LAND_CAN_STEAL_IS_NULL.getMessage(), ResultEnum.LAND_CAN_STEAL_IS_NULL.getCode());
|
|
return Result.of(null, false, ResultEnum.LAND_CAN_STEAL_IS_NULL.getMessage(), ResultEnum.LAND_CAN_STEAL_IS_NULL.getCode());
|
|
|
}
|
|
}
|
|
|
|
|
+ if (otherPlayerLand.getIsPlant().equals(0) && otherPlayerLand.getPlantSteal().equals(0)) {
|
|
|
|
|
+ return Result.of(null, false, ResultEnum.LAND_CAN_STEAL_IS_NULL.getMessage(), ResultEnum.LAND_CAN_STEAL_IS_NULL.getCode());
|
|
|
|
|
+ }
|
|
|
//snb 的key
|
|
//snb 的key
|
|
|
String _redisSNBKey = "SNB_SAVE_" + userId;
|
|
String _redisSNBKey = "SNB_SAVE_" + userId;
|
|
|
|
|
+ long snbTime = System.currentTimeMillis() + RedisData.getSnbTimeout();
|
|
|
|
|
+
|
|
|
//获取用户的plantFlag,因为之前的用户没有设置这个flag,所以设为第一次,用 userId 和 landId 组合成key
|
|
//获取用户的plantFlag,因为之前的用户没有设置这个flag,所以设为第一次,用 userId 和 landId 组合成key
|
|
|
String _redisKey = otherPlayerLand.getPlantFlag();
|
|
String _redisKey = otherPlayerLand.getPlantFlag();
|
|
|
if (!StringUtils.hasText(_redisKey)) {
|
|
if (!StringUtils.hasText(_redisKey)) {
|
|
|
//return Result.of(null, false, ResultEnum.LAND_PLANT_FLAG_IS_NULL.getMessage(), ResultEnum.LAND_PLANT_FLAG_IS_NULL.getCode());
|
|
//return Result.of(null, false, ResultEnum.LAND_PLANT_FLAG_IS_NULL.getMessage(), ResultEnum.LAND_PLANT_FLAG_IS_NULL.getCode());
|
|
|
_redisKey = otherPlayerLand.getUserId() + "or" + otherPlayerLand.getConfigLandId();
|
|
_redisKey = otherPlayerLand.getUserId() + "or" + otherPlayerLand.getConfigLandId();
|
|
|
}
|
|
}
|
|
|
- //todo 先判断是否偷取过
|
|
|
|
|
- ComPlayerProfit comPlayerProfit = comPlayerProfitService.findByUserIdAndOtherUserIdAndPlantFlag(userId, otherUserId, _redisKey);
|
|
|
|
|
- if (comPlayerProfit != null) {
|
|
|
|
|
- return Result.of(null, false, ResultEnum.LAND_HARVEST_STOLEN.getMessage(), ResultEnum.LAND_HARVEST_STOLEN.getCode());
|
|
|
|
|
- }
|
|
|
|
|
- //获取当前种植的种子
|
|
|
|
|
- ComMallSeedVo comMallSeedVo = comMallSeedService.findById(otherPlayerLand.getPlantId());
|
|
|
|
|
- //需要redis 加锁
|
|
|
|
|
- long time = System.currentTimeMillis() + RedisData.getPlayerGoodsTimeout();
|
|
|
|
|
|
|
+ long landTime = System.currentTimeMillis() + RedisData.getLandTimeout();
|
|
|
|
|
|
|
|
//受灾时候,不给收获
|
|
//受灾时候,不给收获
|
|
|
- String _disasterKey = RedisData.getPlayerDisastersFirstKey() + otherPlayerLand.getConfigLandId() + otherPlayerLand.getUserId();
|
|
|
|
|
- long _disasterTime = System.currentTimeMillis() + RedisData.getPlayerDisastersFirstTimeout();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //String _disasterKey = RedisData.getPlayerDisastersFirstKey() + otherPlayerLand.getConfigLandId() + otherPlayerLand.getUserId();
|
|
|
|
|
+ //long _disasterTime = System.currentTimeMillis() + RedisData.getPlayerDisastersFirstTimeout();
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+
|
|
|
//加一层受灾锁
|
|
//加一层受灾锁
|
|
|
- if (!redisLock.lock(_disasterKey, String.valueOf(_disasterTime))) {
|
|
|
|
|
- return Result.of(null, false, ResultEnum.LAND_DISATER_LOCK.getMessage(), ResultEnum.LAND_DISATER_LOCK.getCode());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (!redisLock.lock(_disasterKey, String.valueOf(_disasterTime))) {
|
|
|
|
|
+ // return Result.of(null, false, ResultEnum.LAND_DISATER_LOCK.getMessage(), ResultEnum.LAND_DISATER_LOCK.getCode());
|
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
- if (!redisLock.lock(_redisSNBKey, String.valueOf(time))) {
|
|
|
|
|
|
|
+ //snb 是个人锁
|
|
|
|
|
+ if (!redisLock.lock(_redisSNBKey, String.valueOf(snbTime))) {
|
|
|
//如果有snb冲突锁
|
|
//如果有snb冲突锁
|
|
|
return Result.of(null, false, ResultEnum.USER_LOGIN_LOCK.getMessage(), ResultEnum.USER_LOGIN_LOCK.getCode());
|
|
return Result.of(null, false, ResultEnum.USER_LOGIN_LOCK.getMessage(), ResultEnum.USER_LOGIN_LOCK.getCode());
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- if (!redisLock.lock(_redisKey, String.valueOf(time))) {
|
|
|
|
|
|
|
+ if (!redisLock.lock(_redisKey, String.valueOf(landTime))) {
|
|
|
//如果有冲突锁
|
|
//如果有冲突锁
|
|
|
return Result.of(null, false, ResultEnum.LAND_STEAL_LOCK.getMessage(), ResultEnum.LAND_STEAL_LOCK.getCode());
|
|
return Result.of(null, false, ResultEnum.LAND_STEAL_LOCK.getMessage(), ResultEnum.LAND_STEAL_LOCK.getCode());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //todo 先判断是否偷取过
|
|
|
|
|
+ //ComPlayerProfit comPlayerProfit = comPlayerProfitService.findByUserIdAndOtherUserIdAndPlantFlag(userId, otherUserId, _redisKey);
|
|
|
|
|
+ //if (comPlayerProfit != null) {
|
|
|
|
|
+ // return Result.of(null, false, ResultEnum.LAND_HARVEST_STOLEN.getMessage(), ResultEnum.LAND_HARVEST_STOLEN.getCode());
|
|
|
|
|
+ //}
|
|
|
|
|
+ List<ComPlayerProfit> comPlayerProfits = comPlayerProfitService.findByUserIdAndPlantFlagAndLandId(otherUserId, _redisKey, otherPlayerLand.getConfigLandId());
|
|
|
|
|
+ for (int i = 0; i < comPlayerProfits.size(); i++) {
|
|
|
|
|
+ ComPlayerProfit temp = comPlayerProfits.get(i);
|
|
|
|
|
+ if (temp.getUserId().equals(userId)) {
|
|
|
|
|
+ return Result.of(null, false, ResultEnum.LAND_HARVEST_STOLEN.getMessage(), ResultEnum.LAND_HARVEST_STOLEN.getCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取当前种植的种子
|
|
|
|
|
+ ComMallSeedVo comMallSeedVo = comMallSeedService.findById(otherPlayerLand.getPlantId());
|
|
|
//todo 如果当前人员偷窃水果。记录一个信息,存储当前玩家已偷过的水果的信息
|
|
//todo 如果当前人员偷窃水果。记录一个信息,存储当前玩家已偷过的水果的信息
|
|
|
//计算一个偷取的收获量, 租赁倍数* 租赁日期下的产量
|
|
//计算一个偷取的收获量, 租赁倍数* 租赁日期下的产量
|
|
|
Integer _otherAmount = 0;
|
|
Integer _otherAmount = 0;
|
|
@@ -578,11 +597,11 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
//这里根据plantFlag判断目标用户当前种植被偷取完,记录更新用户 comPlayerLand plantSteal 字段;保存一个偷取状态
|
|
//这里根据plantFlag判断目标用户当前种植被偷取完,记录更新用户 comPlayerLand plantSteal 字段;保存一个偷取状态
|
|
|
//这里只拿去被偷的利润,灾难扣除的不算再这里,但是总利润需要限制计算
|
|
//这里只拿去被偷的利润,灾难扣除的不算再这里,但是总利润需要限制计算
|
|
|
//Double _sumStolen = comPlayerProfitService.getStolenSumByOtherUserIdAndPlantFlagAndLossType(otherUserId, _redisKey,0);
|
|
//Double _sumStolen = comPlayerProfitService.getStolenSumByOtherUserIdAndPlantFlagAndLossType(otherUserId, _redisKey,0);
|
|
|
- Double _sumStolen = 0d,_allStolen = 0d;
|
|
|
|
|
- List<ComPlayerProfit> comPlayerProfits = comPlayerProfitService.findByUserIdAndPlantFlagAndLandId(otherUserId, _redisKey, otherPlayerLand.getConfigLandId());
|
|
|
|
|
|
|
+ Double _sumStolen = 0d, _allStolen = 0d;
|
|
|
|
|
+
|
|
|
for (int i = 0; i < comPlayerProfits.size(); i++) {
|
|
for (int i = 0; i < comPlayerProfits.size(); i++) {
|
|
|
ComPlayerProfit temp = comPlayerProfits.get(i);
|
|
ComPlayerProfit temp = comPlayerProfits.get(i);
|
|
|
- if(temp.getLossType().equals(0)){
|
|
|
|
|
|
|
+ if (temp.getLossType().equals(0)) {
|
|
|
//偷取时候的利润总和
|
|
//偷取时候的利润总和
|
|
|
_sumStolen = DoubleUtil.add(_sumStolen, temp.getStolen());
|
|
_sumStolen = DoubleUtil.add(_sumStolen, temp.getStolen());
|
|
|
}
|
|
}
|
|
@@ -608,32 +627,32 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
//Double _diff = Math.abs(DoubleUtil.sub(_maxAmount, _sumStolen));
|
|
//Double _diff = Math.abs(DoubleUtil.sub(_maxAmount, _sumStolen));
|
|
|
Double _diff = DoubleUtil.sub(_maxAmount, _sumStolen);
|
|
Double _diff = DoubleUtil.sub(_maxAmount, _sumStolen);
|
|
|
Boolean isUpdateCanSteal = false;
|
|
Boolean isUpdateCanSteal = false;
|
|
|
- if (DoubleUtil.compare(_diff,0.0).equals(1)) {
|
|
|
|
|
- if(DoubleUtil.compare(_stolenAmount, _diff).equals(1)){
|
|
|
|
|
|
|
+ if (DoubleUtil.compare(_diff, 0.0).equals(1)) {
|
|
|
|
|
+ if (DoubleUtil.compare(_stolenAmount, _diff).equals(1)) {
|
|
|
_stolenAmount = _diff;
|
|
_stolenAmount = _diff;
|
|
|
isUpdateCanSteal = true;
|
|
isUpdateCanSteal = true;
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
_stolenAmount = 0d;
|
|
_stolenAmount = 0d;
|
|
|
isUpdateCanSteal = true;
|
|
isUpdateCanSteal = true;
|
|
|
}
|
|
}
|
|
|
//这里需要拦截处理最终偷取的利润,比如 总利润_profit=530(可能会加上收益),
|
|
//这里需要拦截处理最终偷取的利润,比如 总利润_profit=530(可能会加上收益),
|
|
|
// _allStolen + _stolenAmount 不能大于总利润
|
|
// _allStolen + _stolenAmount 不能大于总利润
|
|
|
- Double _endLossProfit = DoubleUtil.add(_allStolen,_stolenAmount);
|
|
|
|
|
- Double _endLossDiff = DoubleUtil.sub(_profit,_endLossProfit);
|
|
|
|
|
- if(!DoubleUtil.compare(_sumStolen, _maxAmount).equals(-1) || DoubleUtil.compare(_endLossDiff,0.0).equals(-1)){
|
|
|
|
|
|
|
+ Double _endLossProfit = DoubleUtil.add(_allStolen, _stolenAmount);
|
|
|
|
|
+ Double _endLossDiff = DoubleUtil.sub(_profit, _endLossProfit);
|
|
|
|
|
+ if (!DoubleUtil.compare(_sumStolen, _maxAmount).equals(-1) || DoubleUtil.compare(_endLossDiff, 0.0).equals(-1)) {
|
|
|
//如果差值为零
|
|
//如果差值为零
|
|
|
// 需要redis 解锁
|
|
// 需要redis 解锁
|
|
|
- redisLock.unlock(_redisKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_redisSNBKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
|
|
|
|
+ redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
|
|
+ redisLock.unlock(_redisSNBKey, String.valueOf(snbTime));
|
|
|
|
|
+ //redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
//记录一个不可偷取的状态
|
|
//记录一个不可偷取的状态
|
|
|
otherPlayerLand.setPlantSteal(0);
|
|
otherPlayerLand.setPlantSteal(0);
|
|
|
comPlayerLandService.save(CopyUtil.copy(otherPlayerLand, ComPlayerLandVo.class));
|
|
comPlayerLandService.save(CopyUtil.copy(otherPlayerLand, ComPlayerLandVo.class));
|
|
|
map.put("plant_steal", otherPlayerLand.getPlantSteal());
|
|
map.put("plant_steal", otherPlayerLand.getPlantSteal());
|
|
|
return Result.of(map, false, ResultEnum.LAND_CAN_STEAL_IS_MAX.getMessage(), ResultEnum.LAND_CAN_STEAL_IS_MAX.getCode());
|
|
return Result.of(map, false, ResultEnum.LAND_CAN_STEAL_IS_MAX.getMessage(), ResultEnum.LAND_CAN_STEAL_IS_MAX.getCode());
|
|
|
}
|
|
}
|
|
|
- if(isUpdateCanSteal){
|
|
|
|
|
|
|
+ if (isUpdateCanSteal) {
|
|
|
//记录一个不可偷取的状态
|
|
//记录一个不可偷取的状态
|
|
|
otherPlayerLand.setPlantSteal(0);
|
|
otherPlayerLand.setPlantSteal(0);
|
|
|
comPlayerLandService.save(CopyUtil.copy(otherPlayerLand, ComPlayerLandVo.class));
|
|
comPlayerLandService.save(CopyUtil.copy(otherPlayerLand, ComPlayerLandVo.class));
|
|
@@ -669,7 +688,7 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
comPlayerGoodsService.save(comPlayerGoodsVo);
|
|
comPlayerGoodsService.save(comPlayerGoodsVo);
|
|
|
|
|
|
|
|
//todo 偷窃损失,处理目标用户收取果实时候,减扣一部分被偷取的数量
|
|
//todo 偷窃损失,处理目标用户收取果实时候,减扣一部分被偷取的数量
|
|
|
- comPlayerProfit = new ComPlayerProfit();
|
|
|
|
|
|
|
+ ComPlayerProfit comPlayerProfit = new ComPlayerProfit();
|
|
|
comPlayerProfit.setUserId(userId);
|
|
comPlayerProfit.setUserId(userId);
|
|
|
comPlayerProfit.setTargetId(otherUserId);
|
|
comPlayerProfit.setTargetId(otherUserId);
|
|
|
comPlayerProfit.setPlantFlag(_redisKey);
|
|
comPlayerProfit.setPlantFlag(_redisKey);
|
|
@@ -730,8 +749,6 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
_landMap.put("finallyGetRatioConfig", finallyGetRatioConfig);
|
|
_landMap.put("finallyGetRatioConfig", finallyGetRatioConfig);
|
|
|
|
|
|
|
|
_finalStealAmountSum = DoubleUtil.add(_finalStealAmount, _finalStealAmountSum);
|
|
_finalStealAmountSum = DoubleUtil.add(_finalStealAmount, _finalStealAmountSum);
|
|
|
- // 需要redis 解锁
|
|
|
|
|
- redisLock.unlock(_redisKey, String.valueOf(time));
|
|
|
|
|
|
|
|
|
|
map.put("msg", "偷取果实.");
|
|
map.put("msg", "偷取果实.");
|
|
|
map.put("stealInfo", _landMap);
|
|
map.put("stealInfo", _landMap);
|
|
@@ -813,16 +830,20 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
map.put("snb", comUsersVo.getSnb());
|
|
map.put("snb", comUsersVo.getSnb());
|
|
|
map.put("snbPart", comUsersVo.getSnbPart());
|
|
map.put("snbPart", comUsersVo.getSnbPart());
|
|
|
|
|
|
|
|
|
|
+ //2l 之后,解锁
|
|
|
|
|
+ //Thread.sleep(2L);
|
|
|
|
|
+ //解除land锁
|
|
|
|
|
+ redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
//解除snb锁
|
|
//解除snb锁
|
|
|
- redisLock.unlock(_redisSNBKey, String.valueOf(time));
|
|
|
|
|
-
|
|
|
|
|
- redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
|
|
|
|
+ redisLock.unlock(_redisSNBKey, String.valueOf(snbTime));
|
|
|
|
|
+ //解除灾难锁
|
|
|
|
|
+ //redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
return Result.of(map);
|
|
return Result.of(map);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
// 需要redis 解锁
|
|
// 需要redis 解锁
|
|
|
- redisLock.unlock(_redisKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_redisSNBKey, String.valueOf(time));
|
|
|
|
|
- redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
|
|
|
|
+ redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
|
|
+ redisLock.unlock(_redisSNBKey, String.valueOf(snbTime));
|
|
|
|
|
+ //redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|