懒羊羊
2024-04-11 505237e928b3518483f3a49080a4e0b266bd7e7d
Merge remote-tracking branch 'origin/master'
已修改2个文件
已添加1个文件
69 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/domain/EmInspectionPlanTask.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/vo/ProductSelectVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/controller/EmInspectionPlanTaskController.java
@@ -1,10 +1,16 @@
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;
@@ -51,13 +57,28 @@
    @GetMapping("/getListLikeDevices")
    public AjaxResult getListLikeDevices(EmInspectionPlanTask emInspectionPlanTask)
    {
        List<ProductSelectVO> result = new ArrayList<>();
        List<EmInspectionPlanTask> list = emInspectionPlanTaskService.list(new LambdaQueryWrapper<EmInspectionPlanTask>()
                .select(EmInspectionPlanTask::getDevicesCode)
                .like(EmInspectionPlanTask::getDevicesCode,emInspectionPlanTask.getDevicesCode())
                .groupBy(EmInspectionPlanTask::getDevicesCode));
        List<String> collect = list.stream().map(EmInspectionPlanTask::getDevicesCode).collect(Collectors.toList());
                        .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(collect);
        }
        return AjaxResult.success(result);
    }
    /**
@@ -73,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')")
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/domain/EmInspectionPlanTask.java
@@ -1,5 +1,7 @@
package com.jcdm.main.em.inspectionPlanTask.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
@@ -11,6 +13,7 @@
 * @author Yi
 * @date 2024-03-23
 */
@Data
public class EmInspectionPlanTask extends BaseEntity
{
    private static final long serialVersionUID = 1L;
@@ -66,6 +69,9 @@
    @Excel(name = "修改人")
    private String updateUser;
    @TableField(exist = false)
    private String order;
    public void setId(Long id) 
    {
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanTask/vo/ProductSelectVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.jcdm.main.em.inspectionPlanTask.vo;
import lombok.Data;
@Data
public class ProductSelectVO {
    private String label;
    private String value;
}