|
|
@@ -134,17 +134,17 @@ public class ComPlayerLandController extends CommonController<ComPlayerLandVo, C
|
|
|
// 如果种植了,返回一个种植数据
|
|
|
if (comPlayerLandAndPlantVo.getIsPlant().equals(1)) {
|
|
|
ComMallSeedVo comMallSeedVo = comMallSeedService.findById(comPlayerLandAndPlantVo.getPlantId());
|
|
|
+ //todo [牧场养殖渔场需求] 如果是养殖类的,计算延期后的成熟期
|
|
|
+ if (ArrayUtil.contains(CultivateKeys.mallType,e.getMallType())) {
|
|
|
+ Integer days = comPlayerCultivateSerivce.getHarvestDays(userId, e.getConfigLandId());
|
|
|
+ comMallSeedVo.setMaturity(days);
|
|
|
+ }
|
|
|
comPlayerLandAndPlantVo.setSeedInfo(comMallSeedVo);
|
|
|
//种子时间
|
|
|
//当前时间 > 种植时间+成熟期 = 说明可以收获了
|
|
|
//获取当前时间 - 植物的成熟期 = 收获时间,收获时间 >= 种植时间,即可以收获
|
|
|
Date _harvestTime = DateUtil.getNowDateMinusDay(comMallSeedVo.getMaturity());
|
|
|
|
|
|
- //todo [牧场养殖渔场需求] 如果是养殖类的,成熟期需要单独计算
|
|
|
- if (ArrayUtil.contains(CultivateKeys.mallType,e.getMallType())) {
|
|
|
- _harvestTime = comPlayerCultivateSerivce.getHarvestTime(userId, e.getConfigLandId());
|
|
|
- }
|
|
|
-
|
|
|
// 两个时间差, 逻辑是_harvestTime 时间慢慢接近种植时间
|
|
|
long diff = comPlayerLandAndPlantVo.getPlantStart().getTime() - _harvestTime.getTime();
|
|
|
//种植的剩余时间毫秒
|
|
|
@@ -222,15 +222,16 @@ public class ComPlayerLandController extends CommonController<ComPlayerLandVo, C
|
|
|
// 如果种植了,返回一个种植数据
|
|
|
if (comPlayerLandAndPlantVo.getIsPlant().equals(1)) {
|
|
|
ComMallSeedVo comMallSeedVo = comMallSeedService.findById(comPlayerLandAndPlantVo.getPlantId());
|
|
|
+ //todo [牧场养殖渔场需求] 如果是养殖类的,计算延期后的成熟期
|
|
|
+ if (ArrayUtil.contains(CultivateKeys.mallType,e.getMallType())) {
|
|
|
+ Integer days = comPlayerCultivateSerivce.getHarvestDays(userId, e.getConfigLandId());
|
|
|
+ comMallSeedVo.setMaturity(days);
|
|
|
+ }
|
|
|
comPlayerLandAndPlantVo.setSeedInfo(comMallSeedVo);
|
|
|
//种子时间
|
|
|
//当前时间 > 种植时间+成熟期 = 说明可以收获了
|
|
|
//获取当前时间 - 植物的成熟期 = 收获时间,收获时间 >= 种植时间,即可以收获
|
|
|
Date _harvestTime = DateUtil.getNowDateMinusDay(comMallSeedVo.getMaturity());
|
|
|
- //todo [牧场养殖渔场需求] 如果是养殖类的,成熟期需要单独计算
|
|
|
- if (ArrayUtil.contains(CultivateKeys.mallType,e.getMallType())) {
|
|
|
- _harvestTime = comPlayerCultivateSerivce.getHarvestTime(userId, e.getConfigLandId());
|
|
|
- }
|
|
|
|
|
|
// 两个时间差, 逻辑是_harvestTime 时间慢慢接近种植时间
|
|
|
long diff = comPlayerLandAndPlantVo.getPlantStart().getTime() - _harvestTime.getTime();
|