Merge branch 'dev' into frx

This commit is contained in:
furongxin 2024-08-16 14:50:45 +08:00
commit e6d7b23ef9
4 changed files with 6 additions and 12 deletions

View File

@ -7,10 +7,4 @@ import lombok.Data;
@Data @Data
public class LogStatisticsGroupByUserVO extends LogStatisticsDetailsVO { public class LogStatisticsGroupByUserVO extends LogStatisticsDetailsVO {
@Schema(description = "姓名")
private String nickName;
@Schema(description = "部门名称")
private String deptName;
} }

View File

@ -91,5 +91,5 @@ public interface LogStatisticsMapper extends BaseMapperX<LogStatisticsDO> {
* @param dto * @param dto
* @return * @return
*/ */
List<LogStatisticsGroupByUserVO> getStatisticsGroupByUser(@Param("dto") LogStatisticsDetailsListGroupByUserDTO dto); List<LogStatisticsDetailsVO> getStatisticsGroupByUser(@Param("dto") LogStatisticsDetailsListGroupByUserDTO dto);
} }

View File

@ -407,12 +407,12 @@ public class LogStatisticsServiceImpl implements LogStatisticsService {
} }
dto.setDateList(dateList); dto.setDateList(dateList);
// 获取到所有数据 然后在java代码中分组 // 获取到所有数据 然后在java代码中分组
List<LogStatisticsGroupByUserVO> vos = logStatisticsMapper.getStatisticsGroupByUser(dto); List<LogStatisticsDetailsVO> vos = logStatisticsMapper.getStatisticsGroupByUser(dto);
// 根据用户id/部门id分组 // 根据用户id/部门id分组
Map<String, List<LogStatisticsGroupByUserVO>> map = vos.stream().collect(Collectors.groupingBy(a -> a.getUserId() + "_" + a.getDeptId() + "_" + a.getType())); Map<String, List<LogStatisticsDetailsVO>> map = vos.stream().collect(Collectors.groupingBy(a -> a.getUserId() + "_" + a.getDeptId() + "_" + a.getType()));
for (Map.Entry<String, List<LogStatisticsGroupByUserVO>> entry : map.entrySet()) { for (Map.Entry<String, List<LogStatisticsDetailsVO>> entry : map.entrySet()) {
LogStatisticsDetailsListGroupByUserVO vo = new LogStatisticsDetailsListGroupByUserVO(); LogStatisticsDetailsListGroupByUserVO vo = new LogStatisticsDetailsListGroupByUserVO();
vo.setNickName(entry.getValue().get(0).getNickName()); vo.setNickName(entry.getValue().get(0).getNickname());
vo.setDeptName(entry.getValue().get(0).getDeptName()); vo.setDeptName(entry.getValue().get(0).getDeptName());
vo.setType(entry.getValue().get(0).getType()); vo.setType(entry.getValue().get(0).getType());
vo.setShould(entry.getValue().size()); vo.setShould(entry.getValue().size());

View File

@ -152,7 +152,7 @@
</where> </where>
</select> </select>
<select id="getStatisticsGroupByUser" <select id="getStatisticsGroupByUser"
resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.statisticsrecord.LogStatisticsGroupByUserVO"> resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.statistics.LogStatisticsDetailsVO">
SELECT SELECT
a.nickname as nickName, a.nickname as nickName,
c.`name` as deptName, c.`name` as deptName,