Explorar el Código

查询数据结构修改

hanzhiwei hace 2 años
padre
commit
71a41a114b

+ 2 - 9
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/WarningNoticeLogController.java

@@ -17,11 +17,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -91,7 +87,7 @@ public class WarningNoticeLogController extends AbstractController {
     @PostMapping("/appList")
     @ApiOperation("小程序查询预警通知列表")
     public ResultData appList(@RequestBody QueryAppWarningLogParam queryAppWarningLogParam){
-        Page<LinkedHashMap<LocalDate, List<WarningNoticeLogVO>>> VOPage = new Page<LinkedHashMap<LocalDate, List<WarningNoticeLogVO>>>();
+        Page<WarningNoticeLogVO> VOPage = new Page<>();
         Page<WarningNoticeLog> page = warningNoticeLogService.page(new Page<WarningNoticeLog>(queryAppWarningLogParam.getPageNum(), queryAppWarningLogParam.getPageSize()), new LambdaQueryWrapper<WarningNoticeLog>().eq(WarningNoticeLog::getIsDeleted,Boolean.FALSE).orderByDesc(WarningNoticeLog::getCreateTime));
         List<WarningNoticeLog> records = page.getRecords();
         if (records.size() > 0) {
@@ -99,11 +95,8 @@ public class WarningNoticeLogController extends AbstractController {
             warningNoticeLogVOS.forEach(warningNoticeLogVO -> {
                 warningNoticeLogVO.setCreateDate(LocalDateTimeUtil.ofDate(warningNoticeLogVO.getCreateTime()));
             });
-            List<LinkedHashMap<LocalDate, List<WarningNoticeLogVO>>> list = new ArrayList<>();
-            LinkedHashMap<LocalDate, List<WarningNoticeLogVO>> collect = warningNoticeLogVOS.stream().filter(i->i.getCreateDate() != null).collect(Collectors.groupingBy(WarningNoticeLogVO::getCreateDate, LinkedHashMap::new, Collectors.toList()));
-            list.add(collect);
             BeanUtils.copyProperties(page,VOPage);
-            VOPage.setRecords(list);
+            VOPage.setRecords(warningNoticeLogVOS);
         }
         return ResultData.success(VOPage);
     }