| | |
| | | import com.ruoyi.alarmpoints.tube.domain.ArdTubesDetails; |
| | | import com.ruoyi.alarmpoints.tube.mapper.ArdTubesDetailsMapper; |
| | | import com.ruoyi.alarmpoints.tube.mapper.ArdTubesMapper; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import com.ruoyi.utils.tube.GeoPoint; |
| | | import com.ruoyi.utils.tube.TubeTools; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; |
| | | |
| | | /** |
| | | * @ClassName: globalAlarmServiceImpl |
| | |
| | | * @Version: 1.0 |
| | | **/ |
| | | @Service |
| | | @Slf4j(topic = "mqtt") |
| | | public class GlobalAlarmServiceImpl implements IGlobalAlarmService { |
| | | @Resource |
| | | ArdAlarmStealelecMapper ardAlarmStealelecMapper; |
| | |
| | | ardAlarmTube.setColor(ardTubes.getColor()); |
| | | ardAlarmTube.setPipeDiameter(ardTubes.getPipeDiameter()); |
| | | ardAlarmTube.setTubeType(ardTubes.getType()); |
| | | GeoPoint geoPoint = TubeTools.CalculateCoordinates(ardTubesDetails, ardAlarmTube.getPosition()); |
| | | if(StringUtils.isNotNull(geoPoint)) |
| | | { |
| | | ardAlarmTube.setLongitude(geoPoint.getLongitude()); |
| | | ardAlarmTube.setLatitude(geoPoint.getLatitude()); |
| | | ardAlarmTube.setAltitude(geoPoint.getAltitude()); |
| | | } |
| | | } |
| | | int i = ardAlarmTubeService.insertArdAlarmTube(ardAlarmTube); |
| | | if(i>0) |
| | | { |
| | | log.info("入库成功:"+ardAlarmTube.toString()); |
| | | } |
| | | break; |
| | | } |
| | | } |