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
130
131
package com.ruoyi.device.service;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.device.dto.DeviceExaminePlanDetailsDto;
import com.ruoyi.device.dto.DeviceExaminePlanDto;
import com.ruoyi.device.pojo.Device;
import com.ruoyi.device.pojo.DeviceExaminePlan;
import com.ruoyi.device.pojo.DeviceExaminePlanDetails;
import org.springframework.web.multipart.MultipartFile;
 
import jakarta.servlet.http.HttpServletResponse;
 
/**
 * <p>
 * 设备核查计划主表 服务类
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2024-12-16 07:14:04
 */
public interface DeviceExaminePlanService extends IService<DeviceExaminePlan> {
 
    /**
     * 新增设备核查计划
     * @param examinePlanDto
     * @return
     */
    boolean addDeviceExaminePlan(DeviceExaminePlanDto examinePlanDto);
 
    /**
     * 导入设备核查计划
     * @param file
     * @return
     */
    boolean importDeviceExaminePlan(MultipartFile file);
 
    /**
     * 提交批准
     * @param deviceExaminePlan
     * @return
     */
    boolean submitRatifyDeviceExaminePlan(DeviceExaminePlan deviceExaminePlan);
 
    /**
     * 设备核查计划批准
     * @param DeviceExaminePlan
     * @return
     */
    boolean ratifyDeviceExaminePlan(DeviceExaminePlan DeviceExaminePlan);
 
    /**
     * 设备核查计划列表
     * @param page
     * @param DeviceExaminePlan
     * @return
     */
    IPage<DeviceExaminePlanDto> pageDeviceExaminePlan(Page page, DeviceExaminePlan DeviceExaminePlan);
 
    /**
     * 设备核查计划详情列表
     * @param page
     * @param DeviceExaminePlanDetails
     * @return
     */
    IPage<DeviceExaminePlanDetailsDto> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails DeviceExaminePlanDetails);
 
 
    /**
     * 导出设备核查计划
     * @param deviceExaminePlanId 设备核查计划id
     * @param response 响应
     */
    void exportDeviceExaminePlanDetail(Integer deviceExaminePlanId, HttpServletResponse response);
 
    /**
     * 批量修改设备核查计划
     * @param examinePlanDto
     * @return
     */
    boolean updateDeviceExaminePlan(DeviceExaminePlanDto examinePlanDto);
 
    /**
     * 查询设备核查计划详情
     * @param planId
     * @return
     */
    DeviceExaminePlanDto getDeviceExaminePlan(Integer planId);
 
    /**
     * 按年份查询设备核查计划(不存在则自动创建),并自动补全已到点的设备明细
     * @param planYear 年份
     * @return 计划主表信息
     */
    DeviceExaminePlanDto getOrCreatePlanByYear(String planYear);
 
    /**
     * 设备档案变更后,立即把设备登记到下次核查日期所在年份的设备核查计划明细
     * @param device 设备
     */
    void syncDeviceExamineDetail(Device device);
 
    /**
     * 核查记录复核通过后,滚动设备档案的最近/下次核查日期,并登记下一轮计划
     * @param planDetailsId 计划明细id
     */
    void updateDeviceExamineDate(Integer planDetailsId);
 
    /**
     * 为指定设备找一条可录入核查记录的计划明细,没有则新增本轮明细
     * @param deviceId 设备id
     * @param checkTime 核查月份(yyyy-MM),决定明细所属的计划年份
     * @return 计划明细
     */
    DeviceExaminePlanDetails resolveExaminePlanDetail(Integer deviceId, String checkTime);
 
    /**
     * 修改计划明细(核查月份跨年时归到对应年份的计划)
     * @param detail 计划明细
     * @return 是否修改成功
     */
    boolean updateExaminePlanDetail(DeviceExaminePlanDetails detail);
 
    /**
     * 删除计划明细(已有核查记录的不允许删除)
     * @param planDetailsId 计划明细id
     * @return 是否删除成功
     */
    boolean removeExaminePlanDetail(Integer planDetailsId);
}