From 71a860affbf97e7be13a2059b6cb001bfd368adb Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期日, 28 四月 2024 14:34:25 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java index 9c473db..53363b1 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java @@ -1,13 +1,13 @@ package com.yuanchu.mom.service.impl; -import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yuanchu.mom.mapper.StandardProductListMapper; +import com.yuanchu.mom.mapper.StandardTreeMapper; import com.yuanchu.mom.pojo.InsSample; import com.yuanchu.mom.pojo.StandardProductList; import com.yuanchu.mom.service.StandardProductListService; -import com.yuanchu.mom.mapper.StandardProductListMapper; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -28,6 +28,8 @@ private StandardProductListMapper standardProductListMapper; + private StandardTreeMapper standardTreeMapper; + @Override public int upStandardProductList(StandardProductList list) { return standardProductListMapper.updateById(list); @@ -43,15 +45,15 @@ List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1)); list = list.stream().filter(a -> { try { - if(a.getSection()!=null && !Objects.equals(a.getSection(), "")){ + if (a.getSection() != null && !Objects.equals(a.getSection(), "")) { if (a.getSection().contains("~")) { String[] split = a.getSection().split("~"); return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[0])) > -1 && new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[1])) < 1; } else if (a.getSection().contains("鈮�") || a.getSection().contains(">=")) { - String param = a.getSection().replace("鈮�", "").replace(">=",""); + String param = a.getSection().replace("鈮�", "").replace(">=", ""); return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) > -1; } else if (a.getSection().contains("鈮�") || a.getSection().contains("<=")) { - String param = a.getSection().replace("鈮�", "").replace("<=",""); + String param = a.getSection().replace("鈮�", "").replace("<=", ""); return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) < 1; } else if (a.getSection().contains(">")) { String param = a.getSection().replace(">", ""); @@ -73,8 +75,16 @@ } @Override - public List<StandardProductList> selectStandardProductListByMethodId(Integer id) { - return standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id)); + public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) { + String[] trees = tree.split(" - "); + List<StandardProductList> list; + if(tree.length() == 3){ + list = standardTreeMapper.selectStandardProductListByTree(trees[2], trees[3]); + }else{ + list = standardTreeMapper.selectStandardProductListByTree(trees[2], null); + } + List<StandardProductList> standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id)); + return list; } } -- Gitblit v1.9.3