ludc
2024-10-18 fd0287dfc1d5ab5c97f258d19757cafa29f7333c
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.vci.ubcs.code.controller;
 
import com.vci.ubcs.code.dto.CodeResembleRuleDTO;
import com.vci.ubcs.code.service.ICodeResembleRuleService;
import com.vci.ubcs.code.vo.pagemodel.CodeResembleRuleVO;
import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject;
import com.vci.ubcs.starter.web.pagemodel.DataGrid;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.Collection;
 
/**
 * 相似查询规则控制器
 *
 * @author weidy
 * @date 2022-04-10
 */
@RestController
@RequestMapping("/resembleRuleController")
public class CodeResembleRuleController {
    /**
     * 相似查询规则 服务
     */
    @Resource
    private ICodeResembleRuleService codeResembleRuleService;
 
    /**
     * 相似查询规则列表
     * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等
     * @return 相似查询规则显示对象列表
     */
    @GetMapping("/gridCodeResembleRule")
    public DataGrid<CodeResembleRuleVO> gridCodeResembleRule(BaseQueryObject baseQueryObject){
        if(baseQueryObject == null){
            baseQueryObject = new BaseQueryObject();
        }
        return codeResembleRuleService.gridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
    }
    /**
     * 增加 相似查询规则
     * @param codeResembleRuleDTO 相似查询规则数据传输对象
     * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象
     */
    @PostMapping( "/addSave")
    public R<CodeResembleRuleVO> addSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){
        CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.addSave(codeResembleRuleDTO);
        return R.data(codeResembleRuleVO);
    }
 
    /**
     * 修改 相似查询规则
     * @param codeResembleRuleDTO 相似查询规则数据传输对象
     * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象
     */
    @PutMapping("/editSave")
    public R<CodeResembleRuleVO> editSave(@RequestBody CodeResembleRuleDTO codeResembleRuleDTO){
        CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.editSave(codeResembleRuleDTO);
        return R.data(codeResembleRuleVO);
    }
 
 
    /**
     * 删除相似查询规则
     * @param codeResembleRuleDTO 相似查询规则数据传输对象,oid和ts需要传输
     * @return 删除结果反馈::success:成功,fail:失败
     */
    @DeleteMapping( "/deleteData")
    public R delCodeResembleRule( CodeResembleRuleDTO codeResembleRuleDTO) {
        return codeResembleRuleService.deleteCodeResembleRule(codeResembleRuleDTO);
    }
 
    /**
     * 主键获取相似查询规则
     * @param oid 主键
     * @return 相似查询规则显示对象
     */
    @GetMapping("/getObjectByOid")
    public R<CodeResembleRuleVO> getObjectByOid(String oid){
        CodeResembleRuleVO codeResembleRuleVO = codeResembleRuleService.getObjectByOid(oid);
        return R.data(codeResembleRuleVO);
    }
 
    /**
     * 主键批量获取相似查询规则
     * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个
     * @return 相似查询规则显示对象
     */
    @GetMapping("/listDataByOids")
    public R<CodeResembleRuleVO> listCodeResembleRuleByOids(String oids){
        Collection<CodeResembleRuleVO> voCollection =  codeResembleRuleService.listCodeResembleRuleByOids(VciBaseUtil.str2List(oids));
        R baseResult = R.success("查询成功!");
        baseResult.setData(voCollection);
        return  baseResult;
    }
 
 
 
    /**
     * 参照相似查询规则列表
     * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等
     * @return 相似查询规则显示对象列表,生效的内容
     */
    @GetMapping("/refDataGrid")
    public DataGrid<CodeResembleRuleVO> refDataGridCodeResembleRule(BaseQueryObject baseQueryObject){
        if(baseQueryObject == null){
            baseQueryObject = new BaseQueryObject();
        }
        return codeResembleRuleService.refDataGridCodeResembleRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
    }
}