|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.taauav.admin.entity.TauvInspectAppPoint; |
|
|
import com.taauav.admin.entity.TauvInspectAppPoint; |
|
|
|
|
|
import com.taauav.api.dto.InspectAppPointDto; |
|
|
import com.taauav.api.mapper.InspectAppPointMapper; |
|
|
import com.taauav.api.mapper.InspectAppPointMapper; |
|
|
import com.taauav.api.service.IInspectAppPointService; |
|
|
import com.taauav.api.service.IInspectAppPointService; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
import com.taauav.common.bean.Response; |
|
|
|
|
|
import com.taauav.common.util.DateUtil; |
|
|
|
|
|
import com.taauav.common.util.ShiroUtils; |
|
|
|
|
|
import com.taauav.common.util.StringUtils; |
|
|
|
|
|
import io.netty.util.internal.StringUtil; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private InspectAppPointMapper inspectAppPointMapper; |
|
|
private InspectAppPointMapper inspectAppPointMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private Response response; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 创建巡检坐标定位 |
|
|
|
|
|
* |
|
|
|
|
|
* @param inspectAppPointDto 参数 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public Response createAppPoint(InspectAppPointDto inspectAppPointDto) { |
|
|
|
|
|
// 巡检任务ID |
|
|
|
|
|
if (inspectAppPointDto.getInspectAppId() == null || inspectAppPointDto.getInspectAppId() <= 0) { |
|
|
|
|
|
return response.failure("巡检任务ID不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
// 经度 |
|
|
|
|
|
if (StringUtils.isEmpty(inspectAppPointDto.getX())) { |
|
|
|
|
|
return response.failure("经度不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
// 纬度 |
|
|
|
|
|
if (StringUtils.isEmpty(inspectAppPointDto.getY())) { |
|
|
|
|
|
return response.failure("纬度不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
TauvInspectAppPoint entity = new TauvInspectAppPoint(); |
|
|
|
|
|
entity.setInspectAppId(inspectAppPointDto.getInspectAppId()); |
|
|
|
|
|
entity.setX(inspectAppPointDto.getX()); |
|
|
|
|
|
entity.setY(inspectAppPointDto.getY()); |
|
|
|
|
|
entity.setCreateUser(ShiroUtils.getAdminId()); |
|
|
|
|
|
entity.setCreateTime(DateUtil.now()); |
|
|
|
|
|
int result = inspectAppPointMapper.insert(entity); |
|
|
|
|
|
if (result == 0) { |
|
|
|
|
|
return response.failure("坐标上传失败"); |
|
|
|
|
|
} |
|
|
|
|
|
return response.success("坐标上传成功"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取巡检坐标列表 |
|
|
* 获取巡检坐标列表 |