Fancy
2024-07-04 ddd56a8f37eb47d933a7064be9341feb8dbd8165
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
package com.dy.pmsReport.deviceReport;
 
import com.alibaba.excel.util.StringUtils;
import com.dy.pmsGlobal.daoSta.*;
import com.dy.pmsGlobal.pojoSta.StaDeviceLast;
import com.dy.pmsGlobal.pojoSta.StaDeviceLife;
import com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Slf4j
@Service
public class DeviceReportSv {
    private StaDeviceLastMapper deviceLastDao;
    private StaDeviceLifeMapper deviceLifeDao;
    private StaWipSnExMapper wipSnExDao;
    private StaDeviceProductionLogMapper deviceProductionLogDao;
    private StaRepairInfoMapper repairInfoDao;
    @Autowired
    public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) {
        this.deviceLastDao = deviceLastDao;
    }
 
    @Autowired
    public void setDeviceLifeDao(StaDeviceLifeMapper deviceLifeDao) {
        this.deviceLifeDao = deviceLifeDao;
    }
 
    @Autowired
    public void setWipSnExDao(StaWipSnExMapper wipSnExDao) {
        this.wipSnExDao = wipSnExDao;
    }
 
    @Autowired
    public void setDeviceProductionLogDao(StaDeviceProductionLogMapper deviceProductionLogDao) {
        this.deviceProductionLogDao = deviceProductionLogDao;
    }
 
    @Autowired
    public void setRepairInfoDao(StaRepairInfoMapper repairInfoDao) {
        this.repairInfoDao = repairInfoDao;
    }
 
    public Map<String, Object> getDeviceInfo(String deviceNo) {
        if (StringUtils.isBlank(deviceNo)) {
            return null;
        }
        // 查询设备信息
        StaDeviceLast deviceLast = deviceLastDao.selectByDeviceNo(deviceNo);
        if (deviceLast == null) {
            return null;
        }
        Map<String, Object> deviceInfo =new HashMap<>();
        deviceInfo.put("deviceInfo", deviceLast);
        //查询设备日志
        List<StaDeviceProductionLog> log = deviceProductionLogDao.selectByEquipNo(deviceNo);
        deviceInfo.put("deviceLog", log);
        // 查询设备生命周期
        List<StaDeviceLife> deviceLife = deviceLifeDao.selectByEquipNo(deviceNo);
        deviceInfo.put("deviceLife", log);
        // 查询设备维修信息
        /*StaRepairInfo repairInfo = repairInfoDao.selectByDeviceNo(deviceNo);
 
        if (preRecord.getStatus() == 1) {
            if (repairInfo == null) {
                return null;
            }
            // 查询设备维修信息
            StaWipSnEx wipSnEx = wipSnExDao.selectByDeviceNo();
        }
        return DeviceReportDao.getDeviceInfo(deviceNo);*/
        return deviceInfo;
    }
}