ali
2025-02-10 8babd61414ff62e4f8379bdf54e7a7d9c3b9b70b
zhitan-system/src/main/java/com/zhitan/basicSetup/service/impl/SysEquipmentfileServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
package com.zhitan.basicSetup.service.impl;
import com.zhitan.basicSetup.mapper.SysEquipmentfileMapper;
import com.zhitan.basicSetup.service.ISysEquipmentfileService;
import com.zhitan.realtimedata.domain.SysEquipmentFile;
import com.zhitan.realtimedata.domain.SysSvgInfo;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * ç»„态图Service业务层处理
 *
 * @author sys
 * @date 2020-02-24
 */
@Service
public class SysEquipmentfileServiceImpl implements ISysEquipmentfileService {
  @Autowired
  private SysEquipmentfileMapper equipmentfileMapper;
  @Override
  public void saveEquipmentFile(SysEquipmentFile sysEquipmentfile) {
    SysEquipmentFile sysEquipmentFile = equipmentfileMapper.selectById(sysEquipmentfile.getNodeId());
    if (ObjectUtils.isNotEmpty(sysEquipmentFile)){
      sysEquipmentFile.setFilePath(sysEquipmentfile.getFilePath());
      equipmentfileMapper.updateById(sysEquipmentFile);
    }else {
      SysEquipmentFile equipmentFile = new SysEquipmentFile();
      equipmentFile.setFilePath(sysEquipmentfile.getFilePath());
      equipmentFile.setNodeId(sysEquipmentfile.getNodeId());
      equipmentfileMapper.insert(equipmentFile);
    }
  }
  @Override
  public void saveSettingInfo(String nodeId, List<SysSvgInfo> svgInfo) {
    equipmentfileMapper.saveSettingInfo(nodeId, svgInfo);
  }
  @Override
  public SysEquipmentFile getConfigure(String nodeId) {
    SysEquipmentFile sysEquipmentfile = equipmentfileMapper.getConfigure(nodeId);
    List<SysSvgInfo> infos = getConfigureTag(nodeId);
    if (sysEquipmentfile != null) {
      sysEquipmentfile.setInfoList(infos);
    }
    return sysEquipmentfile;
  }
  @Override
  public List<SysSvgInfo> getConfigureTag(String nodeId) {
    return equipmentfileMapper.getConfigureTag(nodeId);
  }
}