Commit 1ec64c53 authored by tangwei's avatar tangwei

增加app坐标

parent b29ca6a9
package com.yeejoin.amos.boot.module.jcs.api.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* @description:
* @author: tw
* @createDate: 2022/8/24
*/
@Data
@Accessors(chain = true)
@Document(indexName = "jcs", type = "car", shards = 1, replicas = 0)
public class ESCar {
@Id
private Long sequenceNbr;
@Field(type = FieldType.Double)
private String longitude;
@Field(type = FieldType.Double)
private String latitude;
@Field(type = FieldType.Long)
private Long Time;
}
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESCar;
/**
* @description:
* @author: tw
* @createDate: 2022/8/24
*/
public interface IESCarService {
public ESCar saveESCar(ESCar Car) throws Exception;
}
...@@ -159,6 +159,9 @@ public class CommandController extends BaseController { ...@@ -159,6 +159,9 @@ public class CommandController extends BaseController {
RestTemplate restTemplate; RestTemplate restTemplate;
@Autowired @Autowired
IESCarService esCarService;
@Autowired
AirportStandMapper airportStandMapper; AirportStandMapper airportStandMapper;
private static final String JW = "mechinePosition"; private static final String JW = "mechinePosition";
private static final String KEYSITE = "keySiteExcle"; private static final String KEYSITE = "keySiteExcle";
...@@ -1190,6 +1193,10 @@ public class CommandController extends BaseController { ...@@ -1190,6 +1193,10 @@ public class CommandController extends BaseController {
queryWrapper.eq("status", FireCarStatusEnum.执行中.getCode()); queryWrapper.eq("status", FireCarStatusEnum.执行中.getCode());
List<PowerTransferCompanyResources> alertFormValue = powerTransferCompanyResourcesMapper.selectList(queryWrapper); List<PowerTransferCompanyResources> alertFormValue = powerTransferCompanyResourcesMapper.selectList(queryWrapper);
result.stream().forEach(e -> { result.stream().forEach(e -> {
e.put("latitude", 34.43760404432992);
e.put("longitude", 108.7585304877751);
if (e.get("carState").equals("在位")) { if (e.get("carState").equals("在位")) {
e.put("carState", FireCarStatusEnum.执勤.getName()); e.put("carState", FireCarStatusEnum.执勤.getName());
} }
...@@ -1714,4 +1721,26 @@ public class CommandController extends BaseController { ...@@ -1714,4 +1721,26 @@ public class CommandController extends BaseController {
UserCar userCar = userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId())); UserCar userCar = userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
return ResponseHelper.buildResponse(userCar); return ResponseHelper.buildResponse(userCar);
} }
//存储啊手机上报的车辆信息
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/addESCar", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "手机上报", notes = "手机上报")
public ResponseModel<Object> addESCar( @RequestBody ESCar esCar) {
try {
Date date= new Date();
esCar.setTime(date.getTime());
esCarService.saveESCar(esCar);
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(true);
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.dao;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESCar;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @description:
* @author: tw
* @createDate: 2022/8/24
*/
@Repository
public interface ESCarRepository extends PagingAndSortingRepository<ESCar, Long> {
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.service.IESCarService;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESCarRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.stereotype.Service;
/**
* @description:
* @author: tw
* @createDate: 2022/8/24
*/
@Service
public class ESCarService implements IESCarService {
@Autowired
private ElasticsearchRestTemplate elasticsearchTemplate;
@Autowired
private ESCarRepository esCarRepository;
@Override
public ESCar saveESCar(ESCar Car) throws Exception
{
esCarRepository.save(Car);
return Car;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment