fix (farm): 农场首页
- 调整相应参数
This commit is contained in:
@@ -18,8 +18,6 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class HomeInfo {
|
public class HomeInfo {
|
||||||
|
|
||||||
@Schema(description = "租户信息概述")
|
|
||||||
private TenantInfo tenantInfo;
|
|
||||||
@Schema(description = "基地统计信息概述")
|
@Schema(description = "基地统计信息概述")
|
||||||
private BaseOverviewInfo baseOverviewInfo;
|
private BaseOverviewInfo baseOverviewInfo;
|
||||||
@Schema(description = "基地弹框信息")
|
@Schema(description = "基地弹框信息")
|
||||||
@@ -31,22 +29,8 @@ public class HomeInfo {
|
|||||||
@Schema(description = "统计信息")
|
@Schema(description = "统计信息")
|
||||||
private StatisticalInfo statisticalInfo;
|
private StatisticalInfo statisticalInfo;
|
||||||
|
|
||||||
public HomeInfo(TenantInfo tenantInfo) {
|
public HomeInfo(BaseOverviewInfo baseOverviewInfo) {
|
||||||
this.tenantInfo = tenantInfo;
|
this.baseOverviewInfo = baseOverviewInfo;
|
||||||
}
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public static class TenantInfo {
|
|
||||||
@Schema(description = "基地数量")
|
|
||||||
private Integer baseCount;
|
|
||||||
@Schema(description = "总面积")
|
|
||||||
private Integer cropCount;
|
|
||||||
@Schema(description = "在种作物数量")
|
|
||||||
private Double totalArea;
|
|
||||||
@Schema(description = "在职员工人数")
|
|
||||||
private Integer personnelCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -81,6 +65,23 @@ public class HomeInfo {
|
|||||||
private Integer beingPlot;
|
private Integer beingPlot;
|
||||||
@Schema(description = "在种作物数量")
|
@Schema(description = "在种作物数量")
|
||||||
private Integer beingCrop;
|
private Integer beingCrop;
|
||||||
|
|
||||||
|
@Schema(description = "基地数量")
|
||||||
|
private Integer baseCount;
|
||||||
|
@Schema(description = "总面积")
|
||||||
|
private Integer cropCount;
|
||||||
|
@Schema(description = "在种作物数量")
|
||||||
|
private Double totalArea;
|
||||||
|
@Schema(description = "在职员工人数")
|
||||||
|
private Integer personnelCount;
|
||||||
|
|
||||||
|
public BaseOverviewInfo(String baseId, Integer baseCount, Integer cropCount, Double totalArea, Integer personnelCount) {
|
||||||
|
this.baseId = baseId;
|
||||||
|
this.baseCount = baseCount;
|
||||||
|
this.cropCount = cropCount;
|
||||||
|
this.totalArea = totalArea;
|
||||||
|
this.personnelCount = personnelCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -57,21 +57,20 @@ public class HomeServiceImpl implements HomeService {
|
|||||||
public HomeInfo getHomeInfo(String baseId) {
|
public HomeInfo getHomeInfo(String baseId) {
|
||||||
|
|
||||||
if (baseId.trim().isEmpty()) {
|
if (baseId.trim().isEmpty()) {
|
||||||
return new HomeInfo(this.getCompanyInfo());
|
BaseOverviewInfo baseOverviewInfo = this.getCompanyInfo();
|
||||||
|
return new HomeInfo(baseOverviewInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 员工集合 <id,name>
|
// 员工集合 <id,name>
|
||||||
Map<String, String> employeeNameMap = personnelManagementService.getEmployeeNameMap();
|
Map<String, String> employeeNameMap = personnelManagementService.getEmployeeNameMap();
|
||||||
BaseInfoDO baseObj = baseInfoService.getBaseInfo(baseId);
|
BaseInfoDO baseObj = baseInfoService.getBaseInfo(baseId);
|
||||||
|
|
||||||
|
|
||||||
TenantInfo tenantInfo = this.getCompanyInfo();
|
|
||||||
BaseOverviewInfo baseOverviewInfo = this.getBaseOverviewInfo(baseObj, employeeNameMap);
|
BaseOverviewInfo baseOverviewInfo = this.getBaseOverviewInfo(baseObj, employeeNameMap);
|
||||||
List<PlotPopupFrame> plotPopupFrames = this.getPlotPopupFrame(baseObj, employeeNameMap);
|
List<PlotPopupFrame> plotPopupFrames = this.getPlotPopupFrame(baseObj, employeeNameMap);
|
||||||
List<PlotInfo> plotInfos = this.getPlotInfoList(baseId, employeeNameMap);
|
List<PlotInfo> plotInfos = this.getPlotInfoList(baseId, employeeNameMap);
|
||||||
List<PlanInfo> planInfos = this.getPlanInfoList(baseId, "", null);
|
List<PlanInfo> planInfos = this.getPlanInfoList(baseId, "", null);
|
||||||
StatisticalInfo statisticalInfo = this.getStatisticalInfo(baseId);
|
StatisticalInfo statisticalInfo = this.getStatisticalInfo(baseId);
|
||||||
return new HomeInfo(tenantInfo, baseOverviewInfo, plotPopupFrames, plotInfos, planInfos, statisticalInfo);
|
return new HomeInfo(baseOverviewInfo, plotPopupFrames, plotInfos, planInfos, statisticalInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private StatisticalInfo getStatisticalInfo(String baseId) {
|
private StatisticalInfo getStatisticalInfo(String baseId) {
|
||||||
@@ -216,12 +215,12 @@ public class HomeServiceImpl implements HomeService {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TenantInfo getCompanyInfo() {
|
private BaseOverviewInfo getCompanyInfo() {
|
||||||
LoginUser user = getLoginUser();
|
LoginUser user = getLoginUser();
|
||||||
int baseCount = baseInfoService.getBaseCount(user.getTenantId()); // 基地数量
|
int baseCount = baseInfoService.getBaseCount(user.getTenantId()); // 基地数量
|
||||||
int cropCount = cropFarmingCenterService.getCropCount(user.getTenantId()); // 作物数量
|
int cropCount = cropFarmingCenterService.getCropCount(user.getTenantId()); // 作物数量
|
||||||
Double totalArea = cropFarmingCenterService.getTotalArea(user.getTenantId()); // 总面积
|
Double totalArea = cropFarmingCenterService.getTotalArea(user.getTenantId()); // 总面积
|
||||||
int personnelCount = personnelManagementService.personnelCount(user.getTenantId()); // 在职人员
|
int personnelCount = personnelManagementService.personnelCount(user.getTenantId()); // 在职人员
|
||||||
return new TenantInfo(baseCount,cropCount,totalArea,personnelCount);
|
return new BaseOverviewInfo("",baseCount,cropCount,totalArea,personnelCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user