9 天以前 8c14b50773a1e582b652c03f5a63bb2233d069b8
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
package cn.iocoder.yudao.module.mes.service.cal.plan;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO;
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 MesCalPlanShiftService {
 
    /**
     * 创建计划班次
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createPlanShift(@Valid MesCalPlanShiftSaveReqVO createReqVO);
 
    /**
     * 更新计划班次
     *
     * @param updateReqVO 更新信息
     */
    void updatePlanShift(@Valid MesCalPlanShiftSaveReqVO updateReqVO);
 
    /**
     * 删除计划班次
     *
     * @param id 编号
     */
    void deletePlanShift(Long id);
 
    /**
     * 获得计划班次
     *
     * @param id 编号
     * @return 计划班次
     */
    MesCalPlanShiftDO getPlanShift(Long id);
 
    /**
     * 获得计划班次分页
     *
     * @param pageReqVO 分页查询
     * @return 计划班次分页
     */
    PageResult<MesCalPlanShiftDO> getPlanShiftPage(MesCalPlanShiftPageReqVO pageReqVO);
 
    /**
     * 获得指定排班计划的班次列表
     *
     * @param planId 排班计划编号
     * @return 班次列表
     */
    List<MesCalPlanShiftDO> getPlanShiftListByPlanId(Long planId);
 
    /**
     * 获得指定排班计划的班次数量
     *
     * @param planId 排班计划编号
     * @return 班次数量
     */
    Long getPlanShiftCountByPlanId(Long planId);
 
    /**
     * 根据轮班方式添加默认班次
     *
     * @param planId    排班计划编号
     * @param shiftType 轮班方式
     */
    void addDefaultPlanShift(Long planId, Integer shiftType);
 
    /**
     * 获得计划班次列表
     *
     * @param ids 班次编号集合
     * @return 班次列表
     */
    List<MesCalPlanShiftDO> getPlanShiftList(Collection<Long> ids);
 
    /**
     * 获得计划班次 Map
     *
     * @param ids 班次编号集合
     * @return 班次 Map,key 为编号
     */
    default Map<Long, MesCalPlanShiftDO> getPlanShiftMap(Collection<Long> ids) {
        return convertMap(getPlanShiftList(ids), MesCalPlanShiftDO::getId);
    }
 
    /**
     * 根据排班计划编号删除所有班次
     *
     * @param planId 排班计划编号
     */
    void deletePlanShiftByPlanId(Long planId);
 
}