Fancy
2025-01-24 1e0beb1fe98f1d4a2bc93a5654443a84efda3d8e
device
1个文件已添加
72 ■■■■■ 已修改文件
pms-parent/pms-web-wechat/src/main/java/com/dy/pmsWechat/device/DeviceSv.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-wechat/src/main/java/com/dy/pmsWechat/device/DeviceSv.java
New file
@@ -0,0 +1,72 @@
package com.dy.pmsWechat.device;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.dy.pmsGlobal.daoSta.*;
import com.dy.pmsGlobal.pojoSta.*;
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 DeviceSv {
    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.selectByDeviceNo(deviceNo);
        deviceInfo.put("deviceLog", log);
        // 查询设备生命周期
        List<StaDeviceLife> deviceLife = deviceLifeDao.selectByDeviceNo(deviceNo);
        deviceInfo.put("deviceLife", deviceLife);
        // 查询设备维修信息
        List<StaRepairInfo> repairInfo = repairInfoDao.selectByDeviceNo(deviceNo);
        deviceInfo.put("deviceRepair", repairInfo);
        // 查询设备附件信息
        List<StaWipSnEx> wipSnEx = wipSnExDao.selectByDeviceNo(deviceNo);
        deviceInfo.put("deviceAttach", wipSnEx);
        return deviceInfo;
    }
}