zss
2025-03-04 168f55417f3b75b0edf33f8d564257d22bf93121
basic-server/src/main/java/com/ruoyi/basic/service/impl/StandardProductListServiceImpl.java
@@ -12,7 +12,6 @@
import com.ruoyi.basic.dto.InsSampleReceiveDto;
import com.ruoyi.basic.dto.ProductDto;
import com.ruoyi.basic.dto.ResetTreeDragDTO;
import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper;
import com.ruoyi.basic.mapper.StandardProductListMapper;
import com.ruoyi.basic.mapper.StandardProductListSupplierAskMapper;
import com.ruoyi.basic.mapper.StandardTreeMapper;
@@ -46,8 +45,6 @@
    private StandardTreeMapper standardTreeMapper;
    private StandardProductListService2 standardProductListService2;
    private IfsInventoryQuantityMapper ifsInventoryQuantityMapper;
    private StandardProductListSupplierAskMapper standardProductListSupplierAskMapper;
@@ -166,31 +163,7 @@
                })
                .collect(Collectors.toList());
        // 查询厂家是否有特殊要求值
        if (insSample.getIfsInventoryId() != null) {
            // 查询原材料厂家名称
            String supplierName = ifsInventoryQuantityMapper.selectById(insSample.getIfsInventoryId())
                    .getSupplierName();
            List<Long> collect = list.stream().map(StandardProductList::getId).collect(Collectors.toList());
            if (CollectionUtils.isNotEmpty(collect)) {
                List<StandardProductListSupplierAsk> supplierAsks = standardProductListSupplierAskMapper.selectList(Wrappers.<StandardProductListSupplierAsk>lambdaQuery()
                        .in(StandardProductListSupplierAsk::getProductListId, collect)
                        .eq(StandardProductListSupplierAsk::getSupplierName, supplierName));
                // 判断有没有特殊值绑定
                if (CollectionUtils.isNotEmpty(supplierAsks)) {
                    for (StandardProductList standardProductList : list) {
                        for (StandardProductListSupplierAsk supplierAsk : supplierAsks) {
                            if (standardProductList.getId().equals(supplierAsk.getProductListId())) {
                                // 重新赋值要求值和要求描述
                                standardProductList.setAsk(supplierAsk.getAsk());
                                standardProductList.setTell(supplierAsk.getTell());
                            }
                        }
                    }
                }
            }
        }
        return list;
    }