|
|
@@ -395,6 +395,12 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
|
|
|
//对应的,存在plantFlag则解锁
|
|
|
redisLock.unlock(_redisKey, String.valueOf(landTime));
|
|
|
+ try {
|
|
|
+ // 计算断电损耗
|
|
|
+ comPlayerLogService.powerLoss(userId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.err.println("断电损耗异常:" + e.getMessage());
|
|
|
+ }
|
|
|
//redisLock.unlock(_disasterKey, String.valueOf(_disasterTime));
|
|
|
} catch (Exception e) {
|
|
|
//对应的,存在plantFlag则解锁
|
|
|
@@ -717,7 +723,12 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
}
|
|
|
ComPlayerGoodsVo comPlayerGoodsVo = CopyUtil.copy(comPlayerGoods, ComPlayerGoodsVo.class);
|
|
|
comPlayerGoodsService.save(comPlayerGoodsVo);
|
|
|
-
|
|
|
+ try {
|
|
|
+ // 计算断电损耗
|
|
|
+ comPlayerLogService.powerLoss(userId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.err.println("断电损耗异常:" + e.getMessage());
|
|
|
+ }
|
|
|
//todo 偷窃损失,处理目标用户收取果实时候,减扣一部分被偷取的数量
|
|
|
ComPlayerProfit comPlayerProfit = new ComPlayerProfit();
|
|
|
comPlayerProfit.setUserId(userId);
|
|
|
@@ -1157,6 +1168,12 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
|
|
|
if (amount <= 0) {
|
|
|
return Result.of(null, false, ResultEnum.FRUIT_AMOUNT_ERROR.getMessage(), ResultEnum.FRUIT_AMOUNT_ERROR.getCode());
|
|
|
}
|
|
|
+ try {
|
|
|
+ // 计算断电损耗
|
|
|
+ comPlayerLogService.powerLoss(userId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.err.println("断电损耗异常:" + e.getMessage());
|
|
|
+ }
|
|
|
//
|
|
|
ComFruitVo comFruitVo = comFruitService.findById(fruitId);
|
|
|
|