ludc
2023-03-27 82a410d9ec7a5d15eed27e9990cff371feab43a1
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
115
116
package org.springblade.code.controller;
 
 
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.VciBaseUtil;
import org.springblade.code.dto.CodeKeyAttrRepeatRuleDTO;
import org.springblade.code.pagemodel.CodeKeyAttrRepeatRuleVO;
import org.springblade.code.service.CodeKeyAttrRepeatRuleServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Collection;
 
 
/**
 * 关键数据查重规则控制器
 *
 * @author weidy
 * @date 2022-01-24
 */
@RestController
@RequestMapping("/codeKeyAttrRepeatController")
public class CodeKeyAttrRepeatRuleController {
    /**
    * 关键数据查重规则 服务
    */
    @Autowired
    private CodeKeyAttrRepeatRuleServiceI codeKeyAttrRepeatRuleService;
 
    /**
     * 关键数据查重规则列表
     * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等
     * @return 关键数据查重规则显示对象列表
     */
    @GetMapping("/gridCodeKeyAttrRepeatRule")
    public DataGrid<CodeKeyAttrRepeatRuleVO> gridCodeKeyAttrRepeatRule(BaseQueryObject baseQueryObject){
        if(baseQueryObject == null){
            baseQueryObject = new BaseQueryObject();
        }
        return codeKeyAttrRepeatRuleService.gridCodeKeyAttrRepeatRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
    }
    /**
     * 增加 关键数据查重规则
     * @param codeKeyAttrRepeatRuleDTO 关键数据查重规则数据传输对象
     * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象
     */
    @PostMapping( "/addSave")
    public BaseResult<CodeKeyAttrRepeatRuleVO> addSave(@RequestBody CodeKeyAttrRepeatRuleDTO codeKeyAttrRepeatRuleDTO){
         CodeKeyAttrRepeatRuleVO codeKeyAttrRepeatRuleVO = codeKeyAttrRepeatRuleService.addSave(codeKeyAttrRepeatRuleDTO);
         return BaseResult.success(codeKeyAttrRepeatRuleVO);
    }
 
    /**
     * 修改 关键数据查重规则
     * @param codeKeyAttrRepeatRuleDTO 关键数据查重规则数据传输对象
     * @return 执行结果,success为true表示成功,msg是失败的提示信息,obj是添加完成后的显示对象
     */
    @PutMapping("/editSave")
    public BaseResult<CodeKeyAttrRepeatRuleVO> editSave(@RequestBody CodeKeyAttrRepeatRuleDTO codeKeyAttrRepeatRuleDTO){
        CodeKeyAttrRepeatRuleVO codeKeyAttrRepeatRuleVO = codeKeyAttrRepeatRuleService.editSave(codeKeyAttrRepeatRuleDTO);
        return BaseResult.success(codeKeyAttrRepeatRuleVO);
    }
 
 
    /**
     * 删除关键数据查重规则
     * @param codeKeyAttrRepeatRuleDTO 关键数据查重规则数据传输对象,oid和ts需要传输
     * @return 删除结果反馈::success:成功,fail:失败
     */
    @DeleteMapping( "/deleteData")
    public BaseResult delCodeKeyAttrRepeatRule( CodeKeyAttrRepeatRuleDTO codeKeyAttrRepeatRuleDTO) {
        return codeKeyAttrRepeatRuleService.deleteCodeKeyAttrRepeatRule(codeKeyAttrRepeatRuleDTO);
    }
 
    /**
    * 主键获取关键数据查重规则
    * @param oid 主键
    * @return 关键数据查重规则显示对象
    */
    @GetMapping("/getObjectByOid")
    public BaseResult<CodeKeyAttrRepeatRuleVO> getObjectByOid(String oid){
        CodeKeyAttrRepeatRuleVO codeKeyAttrRepeatRuleVO = codeKeyAttrRepeatRuleService.getObjectByOid(oid);
        return BaseResult.success(codeKeyAttrRepeatRuleVO);
    }
 
    /**
     * 主键批量获取关键数据查重规则
     * @param oids 主键,多个以逗号分隔,但是受性能影响,建议一次查询不超过10000个
     * @return 关键数据查重规则显示对象
     */
    @GetMapping("/listDataByOids")
    public BaseResult<CodeKeyAttrRepeatRuleVO> listCodeKeyAttrRepeatRuleByOids(String oids){
        Collection<CodeKeyAttrRepeatRuleVO> voCollection =  codeKeyAttrRepeatRuleService.listCodeKeyAttrRepeatRuleByOids(VciBaseUtil.str2List(oids));
        BaseResult baseResult = BaseResult.success();
        baseResult.setData(voCollection);
        return  baseResult;
    }
 
 
 
    /**
     * 参照关键数据查重规则列表
     * @param baseQueryObject 基础查询对象,包含查询条件,分页,排序等
     * @return 关键数据查重规则显示对象列表,生效的内容
     */
    @GetMapping("/refDataGrid")
    public DataGrid<CodeKeyAttrRepeatRuleVO> refDataGridCodeKeyAttrRepeatRule(BaseQueryObject baseQueryObject){
        if(baseQueryObject == null){
            baseQueryObject = new BaseQueryObject();
        }
        return codeKeyAttrRepeatRuleService.refDataGridCodeKeyAttrRepeatRule(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
    }
 
}