diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitUserInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitUserInfoController.java index 9ef699e..2a67452 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitUserInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitUserInfoController.java @@ -3,6 +3,7 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.database.domain.MetaActualUnitUserInfo; +import com.ruoyi.database.domain.MetaRealEstateInfo; import com.ruoyi.database.service.MetaActualUnitUserInfoService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; /** @@ -38,7 +41,20 @@ public class MetaActualUnitUserInfoController extends BaseController { public TableDataInfo list(MetaActualUnitUserInfo metaActualUnitUserInfo) { startPage(); List list = metaActualUnitUserInfoService.list(new QueryWrapper<>(metaActualUnitUserInfo)); - return getDataTable(list); + HashMap map = new HashMap<>(); + for (MetaActualUnitUserInfo metaActualUnitUserInfo1 : list) { + String staffName = metaActualUnitUserInfo1.getStaffName(); + if (map.containsKey(staffName)){ + map.get(staffName).getStaffTypeCns().add(metaActualUnitUserInfo1.getStaffTypeCn()); + } else { + List strings = new ArrayList<>(); + strings.add(metaActualUnitUserInfo1.getStaffTypeCn()); + metaActualUnitUserInfo1.setStaffTypeCns(strings); + map.put(staffName,metaActualUnitUserInfo1); + } + } + ArrayList metaActualUnitUserInfos = new ArrayList<>(map.values()); + return getDataTable(metaActualUnitUserInfos); } @PostMapping diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/MetaActualUnitUserInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/MetaActualUnitUserInfo.java index 8e30288..1e12fdd 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/MetaActualUnitUserInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/MetaActualUnitUserInfo.java @@ -1,6 +1,7 @@ package com.ruoyi.database.domain; import java.util.Date; +import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; @@ -91,6 +92,8 @@ public class MetaActualUnitUserInfo extends BaseEntity { private Integer staffType; @TableField(exist = false) private String staffTypeCn; + @TableField(exist = false) + private List staffTypeCns; /** * 人员状态