2021-07-13 10:18:08 +08:00
|
|
|
package com.xkrs.service.impl;
|
|
|
|
|
|
|
|
import com.xkrs.dao.FirePointDao;
|
|
|
|
import com.xkrs.model.entity.FirePointEntity;
|
|
|
|
import com.xkrs.model.qo.FirePointQo;
|
|
|
|
import com.xkrs.service.FirePointService;
|
|
|
|
import com.xkrs.utils.AddressUtils;
|
|
|
|
import com.xkrs.utils.DateTimeUtil;
|
2021-07-14 17:35:10 +08:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2021-07-13 10:18:08 +08:00
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author XinYi Song
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
public class FirePointServiceImpl implements FirePointService {
|
|
|
|
|
2021-07-14 17:35:10 +08:00
|
|
|
public static Logger log = LoggerFactory.getLogger(FirePointServiceImpl.class);
|
|
|
|
|
2021-07-13 10:18:08 +08:00
|
|
|
@Resource
|
|
|
|
private FirePointDao firePointDao;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 添加火点信息
|
|
|
|
* @param firePointQo
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public FirePointEntity insertFirePoint(FirePointQo firePointQo) {
|
|
|
|
FirePointEntity firePointEntity = new FirePointEntity();
|
|
|
|
firePointEntity.setFireCode(firePointQo.getFireCode());
|
|
|
|
firePointEntity.setCountyCode(firePointQo.getCountyCode().toString());
|
|
|
|
firePointEntity.setCountyName(firePointQo.getCountyName());
|
|
|
|
firePointEntity.setSatelliteTime(DateTimeUtil.timeMillisToString(firePointQo.getSatelliteTimeTs().longValue()));
|
|
|
|
firePointEntity.setLongitude(firePointQo.getLongitude());
|
|
|
|
firePointEntity.setLatitude(firePointQo.getLatitude());
|
|
|
|
firePointEntity.setFirePointAddress(AddressUtils.getLatAndLng(firePointQo.getLatitude().toString(),firePointQo.getLongitude().toString()));
|
|
|
|
firePointEntity.setSatelliteType(firePointQo.getSatelliteType());
|
|
|
|
firePointEntity.setLandType(firePointQo.getLandType());
|
|
|
|
firePointEntity.setConfidence(firePointQo.getConfidence());
|
|
|
|
firePointEntity.setAddTime(DateTimeUtil.dateTimeToString(LocalDateTime.now()));
|
|
|
|
firePointEntity.setFireType("0");
|
2021-07-14 17:35:10 +08:00
|
|
|
log.info("-------发现新火点");
|
2021-07-13 10:18:08 +08:00
|
|
|
return firePointDao.save(firePointEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|