From 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期二, 15 十月 2024 09:47:26 +0800 Subject: [PATCH] -打印bug修改 --- jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java b/jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java index 3e3ca6f..9b5b574 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java @@ -1,7 +1,17 @@ package com.jcdm.main.em.inspectionPlanTask.controller; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.jcdm.common.core.domain.BaseEntity; +import com.jcdm.main.em.inspectionPlanTask.vo.ProductSelectVO; +import org.aspectj.weaver.loadtime.Aj; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -35,6 +45,43 @@ private IEmInspectionPlanTaskService emInspectionPlanTaskService; /** + * 鏌ヨ鐐规浠诲姟鍒楄〃涓嶅垎椤� + */ + @PostMapping("/noPageList") + public AjaxResult noPageList() + { + List<EmInspectionPlanTask> list = emInspectionPlanTaskService.list(); + return AjaxResult.success(list); + } + + @GetMapping("/getListLikeDevices") + public AjaxResult getListLikeDevices(EmInspectionPlanTask emInspectionPlanTask) + { + List<ProductSelectVO> result = new ArrayList<>(); + List<EmInspectionPlanTask> list = emInspectionPlanTaskService.list(new LambdaQueryWrapper<EmInspectionPlanTask>() + .like(StrUtil.isNotBlank(emInspectionPlanTask.getDevicesCode()),EmInspectionPlanTask::getDevicesCode,emInspectionPlanTask.getDevicesCode()) + ); + if (CollUtil.isNotEmpty(list)){ + ProductSelectVO all = new ProductSelectVO(); + all.setLabel("鍏ㄩ儴"); + all.setValue(null); + result.add(all); + for (EmInspectionPlanTask inspectionPlanTask : list) { + ProductSelectVO vo = new ProductSelectVO(); + vo.setLabel(inspectionPlanTask.getDevicesName()); + vo.setValue(inspectionPlanTask.getDevicesCode()); + result.add(vo); + } + result = result.stream().distinct().collect(Collectors.toList()); + + + } + + + return AjaxResult.success(result); + } + + /** * 鏌ヨ鐐规浠诲姟鍒楄〃 */ @PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:list')") @@ -47,6 +94,27 @@ } /** + * 鏌ヨ鐐规浠诲姟鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:list')") + @GetMapping("/list2") + public AjaxResult list2(EmInspectionPlanTask emInspectionPlanTask) + { + List<EmInspectionPlanTask> list = emInspectionPlanTaskService.selectEmInspectionPlanTaskList(emInspectionPlanTask); + if (StrUtil.isNotBlank(emInspectionPlanTask.getOrder())){ + if ("1".equals(emInspectionPlanTask.getOrder())){ + //椤哄簭 + list = list.stream().sorted(Comparator.comparing(BaseEntity::getCreateTime)).collect(Collectors.toList()); + } else if ("0".equals(emInspectionPlanTask.getOrder())) { + //閫嗗簭 + list = list.stream().sorted(Comparator.comparing(BaseEntity::getCreateTime).reversed()).collect(Collectors.toList()); + } + } + + return AjaxResult.success(list); + } + + /** * 瀵煎嚭鐐规浠诲姟鍒楄〃 */ @PreAuthorize("@ss.hasPermi('em:inspectionPlanTask:export')") -- Gitblit v1.9.3