| | |
| | | import java.util.List; |
| | | |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.inspection.utils.ZipFileUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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业务层处理 |
| | |
| | | |
| | | @Autowired |
| | | private ArdPointCloudMapper ardPointCloudMapper; |
| | | |
| | | @Resource |
| | | private ZipFileUtils zipFileUtils; |
| | | |
| | | /** |
| | | * 查询点云文件 |
| | |
| | | */ |
| | | @Override |
| | | public int insertArdPointCloud(ArdPointCloud ardPointCloud) { |
| | | ardPointCloud.setId(IdUtils.simpleUUID()); |
| | | ardPointCloud.setCreateTime(DateUtils.getNowDate()); |
| | | ardPointCloud.setAssociatedState("0"); |
| | | return ardPointCloudMapper.insertArdPointCloud(ardPointCloud); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public int deleteArdPointCloudByIds(String[] ids) { |
| | | return ardPointCloudMapper.deleteArdPointCloudByIds(ids); |
| | | // 删除点云文件 |
| | | String folderPath = "/home/inspection/uploadPath/zip/"; |
| | | int count = 0; |
| | | for (String id : ids) { |
| | | ArdPointCloud ardPointCloud = ardPointCloudMapper.selectArdPointCloudById(id); |
| | | if (zipFileUtils.deleteZipFile(folderPath + ardPointCloud.getFolderName())){ |
| | | ardPointCloudMapper.deleteArdPointCloudById(id); |
| | | count++; |
| | | } |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | |
| | | return ardPointCloudMapper.deleteArdPointCloudById(id); |
| | | } |
| | | |
| | | @Override |
| | | public ArdPointCloud selectArdPointCloudByFileName(String filename) { |
| | | return ardPointCloudMapper.selectArdPointCloudByFileName(filename); |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdPointCloud> selectArdPointCloudNotList(String[] ids) { |
| | | return ardPointCloudMapper.selectArdPointCloudNotList(ids); |
| | | } |
| | | |
| | | } |