|
|
@@ -365,6 +365,7 @@ public class FmsConsoleController extends BaseController {
|
|
|
private void appendPlanStat(FmsConsoleStatResVo fmsConsoleStatResVo,List<String> blockIds){
|
|
|
FmsPlan fmsPlanQuery = new FmsPlan();
|
|
|
fmsPlanQuery.setBlockIds(blockIds);
|
|
|
+ fmsPlanQuery.setPlanStatus(CommonEnums.PLAN_STATUS_NOT_START.getCode() + "," + CommonEnums.PLAN_STATUS_START.getCode());
|
|
|
List<FmsPlan> fmsPlanList = fmsPlanService.selectFmsPlanList(fmsPlanQuery);
|
|
|
Set<String> blockIdSet = new HashSet<>();
|
|
|
Set<String> cropIdSet = new HashSet<>();
|
|
|
@@ -372,7 +373,7 @@ public class FmsConsoleController extends BaseController {
|
|
|
for(FmsPlan fmsPlan : fmsPlanList){
|
|
|
blockIdSet.add(fmsPlan.getBlockId());
|
|
|
cropIdSet.add(fmsPlan.getCropId());
|
|
|
- planArea.add(fmsPlan.getPlanArea());
|
|
|
+ planArea = planArea.add(fmsPlan.getPlanArea());
|
|
|
}
|
|
|
// 计算种植作物种类
|
|
|
fmsConsoleStatResVo.setCropTypeNum(new BigDecimal(cropIdSet.size()));
|
|
|
@@ -381,6 +382,6 @@ public class FmsConsoleController extends BaseController {
|
|
|
// 计算未使用的地块数量
|
|
|
fmsConsoleStatResVo.setBlockUnUsedNum(fmsConsoleStatResVo.getBlockTotalNum().subtract(fmsConsoleStatResVo.getBlockUsedNum()));
|
|
|
// 计算地块使用率
|
|
|
- fmsConsoleStatResVo.setBlockUsageRate(planArea.divide(fmsConsoleStatResVo.getBlockTotalArea(),2, RoundingMode.HALF_UP));
|
|
|
+ fmsConsoleStatResVo.setBlockUsageRate(planArea.divide(fmsConsoleStatResVo.getBlockTotalArea(),2, RoundingMode.HALF_UP).doubleValue());
|
|
|
}
|
|
|
}
|