Xiajijian
2026-04-01 578d3bb0659811d39c1a989260062114fb110e1e
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
package com.ard.inspection.service.impl;
 
import java.util.List;
 
import com.ard.common.utils.DateUtils;
import com.ard.common.utils.uuid.IdUtils;
import com.ard.inspection.domain.ArdPointCloudRoute;
import com.ard.inspection.domain.NotCould;
import com.ard.inspection.utils.ZipFileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.ard.inspection.mapper.ArdPointCloudMapper;
import com.ard.inspection.domain.ArdPointCloud;
import com.ard.inspection.service.IArdPointCloudService;
 
import javax.annotation.Resource;
 
/**
 * 点云文件Service业务层处理
 * 
 * @author xia
 * @date 2026-03-03
 */
@Service
public class ArdPointCloudServiceImpl implements IArdPointCloudService {
 
    @Autowired
    private ArdPointCloudMapper ardPointCloudMapper;
 
    @Resource
    private ZipFileUtils zipFileUtils;
 
    /**
     * 查询点云文件
     * 
     * @param id 点云文件主键
     * @return 点云文件
     */
    @Override
    public ArdPointCloud selectArdPointCloudById(String id) {
        return ardPointCloudMapper.selectArdPointCloudById(id);
    }
 
    /**
     * 查询点云文件列表
     * 
     * @param ardPointCloud 点云文件
     * @return 点云文件
     */
    @Override
    public List<ArdPointCloud> selectArdPointCloudList(ArdPointCloud ardPointCloud) {
        return ardPointCloudMapper.selectArdPointCloudList(ardPointCloud);
    }
 
    /**
     * 新增点云文件
     * 
     * @param ardPointCloud 点云文件
     * @return 结果
     */
    @Override
    public int insertArdPointCloud(ArdPointCloud ardPointCloud) {
        ardPointCloud.setId(IdUtils.simpleUUID());
        ardPointCloud.setCreateTime(DateUtils.getNowDate());
        ardPointCloud.setAssociatedState("0");
        return ardPointCloudMapper.insertArdPointCloud(ardPointCloud);
    }
 
    /**
     * 修改点云文件
     * 
     * @param ardPointCloud 点云文件
     * @return 结果
     */
    @Override
    public int updateArdPointCloud(ArdPointCloud ardPointCloud) {
        ardPointCloud.setUpdateTime(DateUtils.getNowDate());
        return ardPointCloudMapper.updateArdPointCloud(ardPointCloud);
    }
 
    /**
     * 批量删除点云文件
     * 
     * @param ids 需要删除的点云文件主键
     * @return 结果
     */
    @Override
    public int deleteArdPointCloudByIds(String[] ids) {
        // 删除点云文件
        int count = 0;
        for (String id : ids) {
            ArdPointCloud ardPointCloud = ardPointCloudMapper.selectArdPointCloudById(id);
            String cloudFolder = "/home/inspection/uploadPath/zip/";
            if (zipFileUtils.deleteZipFile(cloudFolder + ardPointCloud.getFolderName())){
                ardPointCloudMapper.deleteArdPointCloudById(id);
                count++;
            }
        }
        return count;
    }
 
    /**
     * 删除点云文件信息
     * 
     * @param id 点云文件主键
     * @return 结果
     */
    @Override
    public int deleteArdPointCloudById(String id) {
        return ardPointCloudMapper.deleteArdPointCloudById(id);
    }
 
    @Override
    public ArdPointCloud selectArdPointCloudByFileName(String filename) {
        return ardPointCloudMapper.selectArdPointCloudByFileName(filename);
    }
 
    @Override
    public List<ArdPointCloud> selectArdPointCloudNotList(NotCould notCould) {
        return ardPointCloudMapper.selectArdPointCloudNotList(notCould.getIds(),notCould.getCloudName(),notCould.getGroupId());
    }
 
    @Override
    public List<ArdPointCloudRoute> selectPointCloudRoute(String id) {
        return ardPointCloudMapper.selectPointCloudRoute(id);
    }
 
}