田源
2024-04-18 3aae81075a18a11d6b605c7583eb03b75366b466
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
package com.vci.ubcs.code.applyjtcodeservice.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.vci.ubcs.code.applyjtcodeservice.entity.DockingPreMetaAttr;
import com.vci.ubcs.code.applyjtcodeservice.service.IGroupAttrPoolMappingService;
import com.vci.ubcs.code.applyjtcodeservice.vo.GroupAttrPoolMappingVO;
import com.vci.ubcs.omd.entity.Enum;
import com.vci.ubcs.omd.vo.EnumVO;
import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
 
import javax.sql.rowset.serial.SerialException;
import java.util.List;
 
/**
 * 集团属性池映射Controller
 * @author ludc
 * @date 2024/4/15 16:48
 */
@RestController
@AllArgsConstructor
@RequestMapping("/groupAttrPoolMapping")
@Api(value = "集团属性池映射配置", tags = "集团属性池映射配置接口")
public class GroupAttrPoolMappingController {
 
    private final IGroupAttrPoolMappingService groupAttrPoolMappingService;
 
    /**
     * 查询集团属性池映射的属性
     * @param bladeQueryObject
     * @return
     */
    @GetMapping("/getGroupAttrPoolALlList")
    public R<IPage<GroupAttrPoolMappingVO>> getGroupAttrPoolALlList(BladeQueryObject bladeQueryObject) throws ServiceException {
        return R.data(groupAttrPoolMappingService.getGroupAttrPoolALlList(bladeQueryObject));
    }
 
    /**
     * 根据集团属性编号查询集团属性池映射
     * @param groupAttrPoolMappingVO
     * @return
     */
    @PostMapping("/getByGroupAttrKeyList")
    public R<List<GroupAttrPoolMappingVO>> getByGroupAttrKeyList(@RequestBody GroupAttrPoolMappingVO groupAttrPoolMappingVO) throws ServiceException {
        return R.data(groupAttrPoolMappingService.getByGroupAttrKeyList(groupAttrPoolMappingVO));
    }
 
    /**
     * 根据集团属性编号查询集团属性池映射
     * @param groupAttrPoolMappingVO
     * @return
     */
    @PostMapping("/editGroupAttr")
    public R editGroupAttr(@RequestBody List<GroupAttrPoolMappingVO> groupAttrPoolMappingVO) throws ServiceException {
        return R.status(groupAttrPoolMappingService.editGroupAttr(groupAttrPoolMappingVO));
    }
 
    /**
     * 根据集团属性编号查询集团属性池映射并同步,慎用因为会更新所有用到这个集团属性的记录
     * @param groupAttrPoolMappingVOS
     * @return
     */
    @PostMapping("/syncGroupAttrMapping")
    public R syncGroupAttrMapping(@RequestBody List<GroupAttrPoolMappingVO> groupAttrPoolMappingVOS) throws ServiceException {
        return groupAttrPoolMappingService.syncGroupAttrMapping(groupAttrPoolMappingVOS);
    }
 
    /**
     * 后期要删除,前期测试用
     * @param dockingPreMetaAttrList
     * @return
     * @throws SerialException
     */
    @PostMapping("/saveDistinctGroupAttr")
    public R saveDistinctGroupAttr(@RequestBody List<DockingPreMetaAttr> dockingPreMetaAttrList) throws ServiceException {
        return R.status(groupAttrPoolMappingService.saveDistinctGroupAttr(dockingPreMetaAttrList));
    }
 
    /**
     * 根据分类OID获取到模板再根据属性id获取到模板下的属性id的enum值,然后查询出枚举
     * @param groupAttrPoolMappingVO
     * @return
     */
    @PostMapping("/getEnumAttrByClsOIdAndAttrId")
    public R<List<EnumVO>> getEnumAttrByClsOIdAndAttrId(@RequestBody GroupAttrPoolMappingVO groupAttrPoolMappingVO) throws ServiceException {
        return R.data(groupAttrPoolMappingService.getEnumAttrByClsOIdAndAttrId(groupAttrPoolMappingVO));
    }
 
}