|
@@ -81,13 +81,14 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
|
|
|
}
|
|
}
|
|
|
//todo 拿出全部利润
|
|
//todo 拿出全部利润
|
|
|
Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
|
|
Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
|
|
|
- Double _profit = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb()+landLevelInCome;
|
|
|
|
|
|
|
+ Integer _profitInt = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb();
|
|
|
|
|
+ Double _profit = DoubleUtil.add(_profitInt.doubleValue(),landLevelInCome);
|
|
|
//todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
|
|
//todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
|
|
|
|
|
|
|
|
//必然发生的灾难,减产50%
|
|
//必然发生的灾难,减产50%
|
|
|
- Double _reduceProfit = DoubleUtil.mul(_profit.doubleValue(), 0.5);
|
|
|
|
|
|
|
+ Double _reduceProfit = DoubleUtil.mul(_profit, 0.5);
|
|
|
// 100 - 80 = 20
|
|
// 100 - 80 = 20
|
|
|
- Double _residualProfit = DoubleUtil.sub(_profit.doubleValue(), allLossProfit);
|
|
|
|
|
|
|
+ Double _residualProfit = DoubleUtil.sub(_profit, allLossProfit);
|
|
|
//剩余利润减去当前需要减产的利润值
|
|
//剩余利润减去当前需要减产的利润值
|
|
|
Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
|
|
Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
|
|
|
if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
|
|
if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
|
|
@@ -102,7 +103,7 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
|
|
|
comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
|
|
comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
|
|
|
comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
|
|
comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
|
|
|
comPlayerProfit.setHarvest(_otherAmount); // todo
|
|
comPlayerProfit.setHarvest(_otherAmount); // todo
|
|
|
- comPlayerProfit.setProfit(_profit.doubleValue());//todo 目标用户可偷的初始利润值
|
|
|
|
|
|
|
+ comPlayerProfit.setProfit(_profit);//todo 目标用户可偷的初始利润值
|
|
|
comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
|
|
comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
|
|
|
comPlayerProfit.setFinalSteal(_endReduceProfit);//
|
|
comPlayerProfit.setFinalSteal(_endReduceProfit);//
|
|
|
comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的
|
|
comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的
|
|
@@ -137,7 +138,8 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
|
|
|
}
|
|
}
|
|
|
//todo 拿出全部利润
|
|
//todo 拿出全部利润
|
|
|
Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
|
|
Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
|
|
|
- Double _profit = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb()+landLevelInCome;
|
|
|
|
|
|
|
+ Integer _profitInt = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb();
|
|
|
|
|
+ Double _profit = DoubleUtil.add(_profitInt.doubleValue(),landLevelInCome);
|
|
|
//todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
|
|
//todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
|
|
|
|
|
|
|
|
//额外发生的灾难,按照次数计算减产 50% 发生已经发生1次计算后当次等于 25%,
|
|
//额外发生的灾难,按照次数计算减产 50% 发生已经发生1次计算后当次等于 25%,
|
|
@@ -145,9 +147,9 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
|
|
|
for(int i = disasterCount;i>0;i--){
|
|
for(int i = disasterCount;i>0;i--){
|
|
|
_startRatio = DoubleUtil.mul(_startRatio,0.5);
|
|
_startRatio = DoubleUtil.mul(_startRatio,0.5);
|
|
|
}
|
|
}
|
|
|
- Double _reduceProfit = DoubleUtil.mul(_profit.doubleValue(), _startRatio);
|
|
|
|
|
|
|
+ Double _reduceProfit = DoubleUtil.mul(_profit, _startRatio);
|
|
|
// 100 - 80 = 20
|
|
// 100 - 80 = 20
|
|
|
- Double _residualProfit = DoubleUtil.sub(_profit.doubleValue(), allLossProfit);
|
|
|
|
|
|
|
+ Double _residualProfit = DoubleUtil.sub(_profit, allLossProfit);
|
|
|
//剩余利润减去当前需要减产的利润值
|
|
//剩余利润减去当前需要减产的利润值
|
|
|
Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
|
|
Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
|
|
|
if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
|
|
if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
|
|
@@ -162,7 +164,7 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
|
|
|
comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
|
|
comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
|
|
|
comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
|
|
comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
|
|
|
comPlayerProfit.setHarvest(_otherAmount); // todo
|
|
comPlayerProfit.setHarvest(_otherAmount); // todo
|
|
|
- comPlayerProfit.setProfit(_profit.doubleValue());//todo 目标用户可偷的初始利润值
|
|
|
|
|
|
|
+ comPlayerProfit.setProfit(_profit);//todo 目标用户可偷的初始利润值
|
|
|
comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
|
|
comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
|
|
|
comPlayerProfit.setFinalSteal(_endReduceProfit);//
|
|
comPlayerProfit.setFinalSteal(_endReduceProfit);//
|
|
|
comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的
|
|
comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的
|