fix (farm): 农场首页

- 全量查询,统计租户信息
This commit is contained in:
达富斌
2025-09-01 15:58:31 +08:00
parent b0d86151b6
commit e1b50dcfac
2 changed files with 12 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ public class HomeInfo {
@Schema(description = "统计信息")
private StatisticalInfo statisticalInfo;
public HomeInfo(BaseOverviewInfo baseOverviewInfo) {
this.baseOverviewInfo = baseOverviewInfo;
}
@Data
@AllArgsConstructor

View File

@@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.farm.service.personnelmanagement.PersonnelManagem
import cn.iocoder.yudao.module.farm.service.plotinfo.PlotInfoService;
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@@ -55,6 +56,12 @@ public class HomeServiceImpl implements HomeService {
@Override
public HomeInfo getHomeInfo(String baseId) {
if (StringUtils.isEmpty(baseId)) {
BaseOverviewInfo baseOverviewInfo = new BaseOverviewInfo();
return new HomeInfo(baseOverviewInfo);
}
// 员工集合 <id,name>
Map<String, String> employeeNameMap = personnelManagementService.getEmployeeNameMap();
BaseInfoDO baseObj = baseInfoService.getBaseInfo(baseId);
@@ -96,8 +103,8 @@ public class HomeServiceImpl implements HomeService {
List<PlotInfoDO> plotList = plotInfoService.getPlotInfos(baseObj.getId());
for (PlotInfoDO e : plotList) {
String employeeName = personnelManagementService.getEmployeeNameMap(employeeNameMap, e.getEmployeeId());
String beingPlotArea = productionPlanService.getBeingPlotArea(e.getId(), e.getPlotArea());
String beingCropName = productionPlanService.getBeingCropName(e.getId());
String beingPlotArea = productionPlanService.getBeingPlotArea(e.getPlotId(), e.getPlotArea());
String beingCropName = productionPlanService.getBeingCropName(e.getPlotId());
targetList.add(new PlotPopupFrame(beingPlotArea,employeeName,beingCropName));
}