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
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
* @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);
// 获取到所有数据 然后在java代码中分组
List<LogStatisticsGroupByUserVO> vos = logStatisticsMapper.getStatisticsGroupByUser(dto);
List<LogStatisticsDetailsVO> vos = logStatisticsMapper.getStatisticsGroupByUser(dto);
// 根据用户id/部门id分组
Map<String, List<LogStatisticsGroupByUserVO>> map = vos.stream().collect(Collectors.groupingBy(a -> a.getUserId() + "_" + a.getDeptId() + "_" + a.getType()));
for (Map.Entry<String, List<LogStatisticsGroupByUserVO>> entry : map.entrySet()) {
Map<String, List<LogStatisticsDetailsVO>> map = vos.stream().collect(Collectors.groupingBy(a -> a.getUserId() + "_" + a.getDeptId() + "_" + a.getType()));
for (Map.Entry<String, List<LogStatisticsDetailsVO>> entry : map.entrySet()) {
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.setType(entry.getValue().get(0).getType());
vo.setShould(entry.getValue().size());

View File

@ -152,7 +152,7 @@
</where>
</select>
<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
a.nickname as nickName,
c.`name` as deptName,