net
2025-02-14 06d3d15a5a08637041cc601101c063b11b07a346
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
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);
  }
}