2 天以前 3be684af887afe4c0e45f281cc53adfef6f12b78
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 cn.iocoder.yudao.module.mes.service.dv.checkplan;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.dv.checkplan.vo.MesDvCheckPlanPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.dv.checkplan.vo.MesDvCheckPlanSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.checkplan.MesDvCheckPlanDO;
import jakarta.validation.Valid;
 
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
/**
 * MES 点检保养方案 Service 接口
 *
 * @author 芋道源码
 */
public interface MesDvCheckPlanService {
 
    /**
     * 创建点检保养方案
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createCheckPlan(@Valid MesDvCheckPlanSaveReqVO createReqVO);
 
    /**
     * 更新点检保养方案
     *
     * @param updateReqVO 更新信息
     */
    void updateCheckPlan(@Valid MesDvCheckPlanSaveReqVO updateReqVO);
 
    /**
     * 启用点检保养方案
     *
     * @param id 编号
     */
    void enableCheckPlan(Long id);
 
    /**
     * 停用点检保养方案
     *
     * @param id 编号
     */
    void disableCheckPlan(Long id);
 
    /**
     * 删除点检保养方案
     *
     * @param id 编号
     */
    void deleteCheckPlan(Long id);
 
    /**
     * 校验点检保养方案存在
     *
     * @param id 编号
     */
    void validateCheckPlanExists(Long id);
 
    /**
     * 校验点检保养方案存在、类型匹配,且方案已启用
     *
     * @param id   方案编号
     * @param type 期望的方案类型
     * @return 方案
     */
    MesDvCheckPlanDO validateCheckPlanExistsAndType(Long id, Integer type);
 
    /**
     * 校验点检保养方案为草稿状态
     *
     * @param planId 方案编号
     * @return 方案
     */
    MesDvCheckPlanDO validateCheckPlanPrepare(Long planId);
 
    /**
     * 获得点检保养方案
     *
     * @param id 编号
     * @return 方案
     */
    MesDvCheckPlanDO getCheckPlan(Long id);
 
    /**
     * 获得点检保养方案分页
     *
     * @param pageReqVO 分页查询
     * @return 方案分页
     */
    PageResult<MesDvCheckPlanDO> getCheckPlanPage(MesDvCheckPlanPageReqVO pageReqVO);
 
    /**
     * 获得点检保养方案列表
     *
     * @param ids 编号数组
     * @return 方案列表
     */
    List<MesDvCheckPlanDO> getCheckPlanList(Collection<Long> ids);
 
    /**
     * 获得点检保养方案 Map
     *
     * @param ids 编号数组
     * @return 方案 Map
     */
    default Map<Long, MesDvCheckPlanDO> getCheckPlanMap(Collection<Long> ids) {
        return convertMap(getCheckPlanList(ids), MesDvCheckPlanDO::getId);
    }
 
}