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 getMeteringPage(MesDvMeteringPageReqVO pageReqVO); /** * 获得计量器具列表 * * @return 计量器具列表 */ List getMeteringList(); /** * 获得计量器具列表 * * @param ids 编号数组 * @return 计量器具列表 */ List getMeteringList(Collection ids); /** * 获得计量器具 Map * * @param ids 编号数组 * @return 计量器具 Map */ default Map getMeteringMap(Collection 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); }