|
|
@@ -13,6 +13,7 @@ import com.td.boss.game.complayerlog.vo.ComPlayerLogVo;
|
|
|
import com.td.boss.game.complayerlog.repository.ComPlayerLogRepository;
|
|
|
import com.td.boss.util.CopyUtil;
|
|
|
import com.td.boss.util.DoubleUtil;
|
|
|
+import com.td.boss.util.UUIDUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.jdbc.metadata.OracleUcpDataSourcePoolMetadata;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -67,14 +68,12 @@ public class ComPlayerLogServiceImpl extends CommonServiceImpl<ComPlayerLogVo, C
|
|
|
Date serverDate = new Date();
|
|
|
long dayDiff = DateUtil.betweenDay(serverDate, lastOperationTime, false);
|
|
|
System.out.println("与服务器时间相差:" + dayDiff + "天");
|
|
|
- // 7天未操作
|
|
|
+ // 7天未操作 并且 最多持续8天.
|
|
|
if (dayDiff < 7) {
|
|
|
System.out.println("未到7天不损耗");
|
|
|
return;
|
|
|
}
|
|
|
- // 最多持续8天.
|
|
|
dayDiff = dayDiff > 14 ? 14 : dayDiff;
|
|
|
- // 7 8 9 10 11 12 13 14
|
|
|
dayDiff = Math.abs(14 - 8 - dayDiff);
|
|
|
System.out.println("实际断电损耗:" + dayDiff + "天");
|
|
|
|
|
|
@@ -83,7 +82,7 @@ public class ComPlayerLogServiceImpl extends CommonServiceImpl<ComPlayerLogVo, C
|
|
|
System.out.println("仓库无果实不损耗");
|
|
|
return;
|
|
|
}
|
|
|
- // 更新仓库果实量
|
|
|
+ // 批量更新仓库果实量
|
|
|
List<ComPlayerGoods> playerGoodsList = new ArrayList<>();
|
|
|
// 写入明细
|
|
|
List<ComPlayerLog> playerLogList = new ArrayList<>();
|
|
|
@@ -101,10 +100,13 @@ public class ComPlayerLogServiceImpl extends CommonServiceImpl<ComPlayerLogVo, C
|
|
|
|
|
|
// 写入明细
|
|
|
ComPlayerLog playerLog = new ComPlayerLog();
|
|
|
+ playerLog.setId(UUIDUtil.getUUID());
|
|
|
playerLog.setUserId(userId);
|
|
|
// 操作目标id,比如进入背包的是收获时候操作:水果
|
|
|
playerLog.setTId(goods.getGoodsIndex());
|
|
|
playerLog.setTName(goods.getName());
|
|
|
+ playerLog.setTPart(0d);
|
|
|
+ playerLog.setTAmount(0);
|
|
|
// 1=果实
|
|
|
playerLog.setTType(1);
|
|
|
playerLog.setBeforeAmount(goodsBeforeAmount);
|