7 天以前 85156554438bb13930c89072ee0b7fa93192a7fe
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
117
118
119
120
121
122
123
124
125
126
127
128
129
package cn.iocoder.yudao.module.mes.service.dv.machinery;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.dv.machinery.vo.MesDvMachineryImportExcelVO;
import cn.iocoder.yudao.module.mes.controller.admin.dv.machinery.vo.MesDvMachineryImportRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.dv.machinery.vo.MesDvMachineryPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.dv.machinery.vo.MesDvMachinerySaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.machinery.MesDvMachineryDO;
import jakarta.validation.Valid;
 
import java.time.LocalDateTime;
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 MesDvMachineryService {
 
    /**
     * 创建设备
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createMachinery(@Valid MesDvMachinerySaveReqVO createReqVO);
 
    /**
     * 更新设备
     *
     * @param updateReqVO 更新信息
     */
    void updateMachinery(@Valid MesDvMachinerySaveReqVO updateReqVO);
 
    /**
     * 删除设备
     *
     * @param id 编号
     */
    void deleteMachinery(Long id);
 
    /**
     * 获得设备
     *
     * @param id 编号
     * @return 设备
     */
    MesDvMachineryDO getMachinery(Long id);
 
    /**
     * 获得设备分页
     *
     * @param pageReqVO 分页查询
     * @return 设备分页
     */
    PageResult<MesDvMachineryDO> getMachineryPage(MesDvMachineryPageReqVO pageReqVO);
 
    /**
     * 获得指定设备类型下的设备数量
     *
     * @param machineryTypeId 设备类型编号
     * @return 设备数量
     */
    Long getMachineryCountByMachineryTypeId(Long machineryTypeId);
 
    /**
     * 校验设备存在
     *
     * @param id 编号
     */
    void validateMachineryExists(Long id);
 
    /**
     * 获得设备列表
     *
     * @return 设备列表
     */
    List<MesDvMachineryDO> getMachineryList();
 
    /**
     * 获得设备列表
     *
     * @param ids 编号数组
     * @return 设备列表
     */
    List<MesDvMachineryDO> getMachineryList(Collection<Long> ids);
 
    /**
     * 获得设备 Map
     *
     * @param ids 编号数组
     * @return 设备 Map
     */
    default Map<Long, MesDvMachineryDO> getMachineryMap(Collection<Long> ids) {
        return convertMap(getMachineryList(ids), MesDvMachineryDO::getId);
    }
 
    /**
     * 更新设备的最近点检时间
     *
     * @param machineryId 设备编号
     * @param lastCheckTime 最近点检时间
     */
    void updateMachineryLastCheckTime(Long machineryId, LocalDateTime lastCheckTime);
 
    /**
     * 更新设备的最近保养时间
     *
     * @param machineryId 设备编号
     * @param lastMaintenTime 最近保养时间
     */
    void updateMachineryLastMaintenTime(Long machineryId, LocalDateTime lastMaintenTime);
 
    /**
     * 导入设备列表
     *
     * @param importMachineryList 导入设备列表
     * @param updateSupport 是否支持更新
     * @return 导入结果
     */
    MesDvMachineryImportRespVO importMachineryList(List<MesDvMachineryImportExcelVO> importMachineryList,
                                                    boolean updateSupport);
 
}