8 天以前 48de66e32e3f509a0d212af54cda814bb7c3d4dd
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.dv.metering;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO;
import jakarta.validation.Valid;
 
import java.time.LocalDate;
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 MesDvMeteringService {
 
    /**
     * 创建计量器具
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createMetering(@Valid MesDvMeteringSaveReqVO createReqVO);
 
    /**
     * 更新计量器具
     *
     * @param updateReqVO 更新信息
     */
    void updateMetering(@Valid MesDvMeteringSaveReqVO updateReqVO);
 
    /**
     * 删除计量器具
     *
     * @param id 编号
     */
    void deleteMetering(Long id);
 
    /**
     * 获得计量器具
     *
     * @param id 编号
     * @return 计量器具
     */
    MesDvMeteringDO getMetering(Long id);
 
    /**
     * 获得计量器具分页
     *
     * @param pageReqVO 分页查询
     * @return 计量器具分页
     */
    PageResult<MesDvMeteringDO> getMeteringPage(MesDvMeteringPageReqVO pageReqVO);
 
    /**
     * 获得计量器具列表
     *
     * @return 计量器具列表
     */
    List<MesDvMeteringDO> getMeteringList();
 
    /**
     * 获得计量器具列表
     *
     * @param ids 编号数组
     * @return 计量器具列表
     */
    List<MesDvMeteringDO> getMeteringList(Collection<Long> ids);
 
    /**
     * 获得计量器具 Map
     *
     * @param ids 编号数组
     * @return 计量器具 Map
     */
    default Map<Long, MesDvMeteringDO> getMeteringMap(Collection<Long> ids) {
        return convertMap(getMeteringList(ids), MesDvMeteringDO::getId);
    }
 
    /**
     * 校验计量器具存在
     *
     * @param id 编号
     */
    void validateMeteringExists(Long id);
 
    /**
     * 获得到期提醒天数(默认 30)
     *
     * @return 提醒天数
     */
    int getRemindDays();
 
    /**
     * 回写计量器具的最近检测信息(检测记录新增/修改/删除后调用)
     *
     * @param meteringId 计量器具编号
     * @param lastCheckDate 最近检测日期(无则置空)
     * @param nextCheckDate 下次检测日期(无则置空)
     */
    void updateMeteringCheckInfo(Long meteringId, LocalDate lastCheckDate, LocalDate nextCheckDate);
 
}