zhuo
2025-03-29 f682213b9ff8a7d41ea16edfb1b68d996c46e080
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.ruoyi.basic.service.impl;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.basic.mapper.StandardMethodListMapper;
import com.ruoyi.basic.mapper.StandardProductListMapper;
import com.ruoyi.basic.pojo.StandardMethodList;
import com.ruoyi.basic.pojo.StandardProductList;
import com.ruoyi.basic.service.StandardMethodListService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
* @author Administrator
* @description 针对表【standard_method_list(标准树下的标准列表)】的数据库操作Service实现
* @createDate 2024-03-04 13:44:04
*/
@Service
@AllArgsConstructor
public class StandardMethodListServiceImpl extends ServiceImpl<StandardMethodListMapper, StandardMethodList>
    implements StandardMethodListService{
 
    private StandardMethodListMapper standardMethodListMapper;
 
    @Override
    public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) {
        String[] trees = tree.split(" - ");
        Map<String, List<?>> map = new HashMap<>();
        String str = "";
        List<StandardMethodList> standardMethodLists = new ArrayList<>();
        switch (trees.length){
            case 5:
                str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\""));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                break;
            case 4:
                str += "\"" + trees[2] + "\",\"" + trees[3] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                break;
            case 3:
                str += "\"" + trees[2] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str));
                break;
            default:
                map.put("standardMethodList", null);
                return map;
        }
        standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodListsByNull(str));
        map.put("standardMethodList", standardMethodLists);
        return map;
    }
 
    @Override
    public List<StandardMethodList> selectStandardMethodEnum() {
        return standardMethodListMapper.selectListEnum();
    }
 
    @Override
    public Integer getStandardMethodId(String code) {
        return baseMapper.getStandardMethodId(code);
    }
}