Browse Source

调整中农云接口格式,删除无用的依赖

master
zhangyeguang 4 weeks ago
parent
commit
400b5075c8
  1. 24
      social/pom.xml
  2. 9
      social/src/main/java/com/jiagutech/ams/controller/JobController.java
  3. 32
      social/src/main/java/com/jiagutech/ams/listener/JobFinishListener.java
  4. 2
      social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java
  5. 12
      social/src/main/java/com/jiagutech/ams/model/ZhongNongTrackData.java
  6. 7
      social/src/main/java/com/jiagutech/ams/rest/TrackRestClient.java
  7. 8
      social/src/main/java/com/jiagutech/ams/rest/ZhongNongRestClient.java
  8. 146
      social/src/main/java/com/jiagutech/ams/service/SortieService.java
  9. 11
      social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java
  10. 2
      system/src/main/java/com/jiagutech/ams/service/UserServiceImpl.java
  11. 16
      web/pom.xml
  12. 90
      web/src/main/java/com/jiagutech/ams/common/RabbitConfig.java
  13. 10
      web/src/main/resources/application-dev.yml
  14. 10
      web/src/main/resources/application-prod.yml
  15. 10
      web/src/main/resources/application-zyg.yml
  16. 10
      web/src/main/resources/application.yml

24
social/pom.xml

@ -63,18 +63,18 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-amqp</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-rabbit</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-amqp</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>

9
social/src/main/java/com/jiagutech/ams/controller/JobController.java

@ -3,7 +3,6 @@ package com.jiagutech.ams.controller;
import cn.dev33.satoken.annotation.SaCheckRole;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import com.jiagutech.ams.listener.JobFinishListener;
import com.jiagutech.ams.model.TrackImageVO;
import com.jiagutech.ams.model.TrackItem;
@ -22,7 +21,6 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
@ -45,6 +43,7 @@ public class JobController {
private final JobFinishListener jobFinishListener;
@GetMapping("/types")
@Operation(summary = "作业类型列表")
public R<List<JobTypeDTO>> getJobTypes() {
@ -131,13 +130,15 @@ public class JobController {
List<TrackItem> tracks = jobService.getTracks(deviceId, startTime, endTime);
List<TrackItem> tracks1 = jobFinishListener.getTracks(deviceId, startTime, endTime);
float noFilter = TrackUtil.calcAreaByBlockDataNoFilter(tracks,breadth);
float noFilter = TrackUtil.calcAreaByBlockDataNoFilter(tracks, breadth);
float byFilter = TrackUtil.calcAreaByBlockData(tracks);
float zhongnongArea = TrackUtil.calcAreaByBlockDataNoFilter(tracks1,breadth);
float zhongnongArea = TrackUtil.calcAreaByBlockDataNoFilter(tracks1, breadth);
float zhongnongArea1 = TrackUtil.calcAreaByBlockData(tracks1, breadth);
Map<String, Float> areas = new HashMap<>(4);
areas.put("noFilter", noFilter);
areas.put("byFilter", byFilter);
areas.put("zhongnongArea", zhongnongArea);
areas.put("zhongnongArea1", zhongnongArea1);
return R.ok(areas);
}

32
social/src/main/java/com/jiagutech/ams/listener/JobFinishListener.java

@ -6,12 +6,10 @@ import com.jiagutech.ams.mapper.DeviceMapper;
import com.jiagutech.ams.mapper.JobMapper;
import com.jiagutech.ams.model.TrackItem;
import com.jiagutech.ams.model.TrackMapping;
import com.jiagutech.ams.model.ZhongNongTrack;
import com.jiagutech.ams.model.ZhongNongTrackData;
import com.jiagutech.ams.model.dto.DeviceDTO;
import com.jiagutech.ams.model.dto.JobDTO;
import com.jiagutech.ams.rest.TrackRestClient;
import com.jiagutech.ams.rest.ZhongNongRestClient;
import com.jiagutech.ams.scheduled.JobScheduled;
import com.jiagutech.ams.service.JobService;
import com.jiagutech.ams.utils.TrackUtil;
import lombok.RequiredArgsConstructor;
@ -85,7 +83,7 @@ public class JobFinishListener {
public void refreshJobArea(long jobId) {
JobDTO jobDTO = jobMapper.selectById(jobId);
if ((jobDTO.getDuration()==null ||jobDTO.getDuration() == 0) && jobDTO.getStartTime() != null && jobDTO.getEndTime() != null) {
if ((jobDTO.getDuration() == null || jobDTO.getDuration() == 0) && jobDTO.getStartTime() != null && jobDTO.getEndTime() != null) {
Instant instant1 = Instant.ofEpochMilli(jobDTO.getStartTime());
Instant instant2 = Instant.ofEpochMilli(jobDTO.getEndTime());
Duration duration = Duration.between(instant1, instant2);
@ -100,11 +98,20 @@ public class JobFinishListener {
DeviceDTO deviceDTO = deviceMapper.selectById(jobDTO.getDeviceId());
log.info("从td-engine中获取轨迹");
List<TrackItem> tracks = jobService.getTracks(deviceDTO.getBoxNum(), jobDTO.getStartTime(), jobDTO.getEndTime());
if (CollectionUtil.isEmpty(tracks)) {
log.info("从中农云中获取轨迹");
tracks = getTracksFromZhongNong(deviceDTO.getBoxNum(), jobDTO.getStartTime(), jobDTO.getEndTime());
double breadth = 0;
if (CollectionUtil.isNotEmpty(tracks)) {
for (TrackItem track : tracks) {
if (track.getBreadth() > 0) {
breadth = track.getBreadth();
break;
}
}
}
jobDTO.setArea(TrackUtil.calcAreaByBlockData(tracks));
log.info("从中农云中获取轨迹");
tracks = getTracksFromZhongNong(deviceDTO.getBoxNum(), jobDTO.getStartTime(), jobDTO.getEndTime());
jobDTO.setArea(TrackUtil.calcAreaByBlockData(tracks, breadth));
TrackItem trackItem = tracks.get(tracks.size() - 1);
jobDTO.setLat(trackItem.getLat()).setLng(trackItem.getLng());
deviceDTO.setLat(trackItem.getLat()).setLng(trackItem.getLng()).setUpdateTime(trackItem.getTimestamp());
@ -114,10 +121,13 @@ public class JobFinishListener {
}
private List<TrackItem> getTracksFromZhongNong(String vehicleId, Long startTime, Long endTime) {
List<ZhongNongTrack> tracks = trackRestClient.getZhongNongTracks(keyId, secretKey, vehicleId, startTime, endTime);
log.info("中农云获取到的轨迹数量:{}", tracks != null ? tracks.size() : 0);
ZhongNongTrackData tracks = trackRestClient.getZhongNongTracks(keyId, secretKey, vehicleId, startTime, endTime);
log.info("中农云获取到的轨迹数量:{}", tracks != null ? tracks.getVehicleLocusList().size() : 0);
TrackMapping mapping = TrackMapping.INSTANCE;
return mapping.convertToTrackItemsByZhongNongTracks(tracks);
assert tracks != null;
List<TrackItem> items = mapping.convertToTrackItemsByZhongNongTracks(tracks.getVehicleLocusList());
items.get(0).setBreadth(tracks.getBreadth());
return items;
}

2
social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java

@ -17,4 +17,6 @@ public class ZhongNongTrack {
private Integer direction;
private Double breadth;
}

12
social/src/main/java/com/jiagutech/ams/model/ZhongNongTrackData.java

@ -0,0 +1,12 @@
package com.jiagutech.ams.model;
import lombok.Data;
import java.util.List;
@Data
public class ZhongNongTrackData {
private double breadth;
private List<ZhongNongTrack> vehicleLocusList;
}

7
social/src/main/java/com/jiagutech/ams/rest/TrackRestClient.java

@ -3,7 +3,7 @@ package com.jiagutech.ams.rest;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import com.jiagutech.ams.model.Locus;
import com.jiagutech.ams.model.ZhongNongTrack;
import com.jiagutech.ams.model.ZhongNongTrackData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -50,7 +50,7 @@ public class TrackRestClient {
return result;
}
public List<ZhongNongTrack> getZhongNongTracks(String keyId, String secretKey, String droneId, Long startTime, Long endTime) {
public ZhongNongTrackData getZhongNongTracks(String keyId, String secretKey, String droneId, Long startTime, Long endTime) {
Map<String, Object> map = new HashMap<>();
map.put("droneId", droneId);
map.put("startTime", startTime);
@ -58,8 +58,7 @@ public class TrackRestClient {
map.put("keyId", keyId);
map.put("secretKey", secretKey);
String res = restTemplate.getForObject(centerBaseUrl + "/zhongnong/tracks?keyId={keyId}&secretKey={secretKey}&droneId={droneId}&start={startTime}&end={endTime}", String.class, map);
return JSON.parseObject(res, new TypeReference<List<ZhongNongTrack>>() {
});
return JSON.parseObject(res, ZhongNongTrackData.class);
}
}

8
social/src/main/java/com/jiagutech/ams/rest/ZhongNongRestClient.java

@ -2,8 +2,7 @@ package com.jiagutech.ams.rest;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.jiagutech.ams.model.ZhongNongTrack;
import io.swagger.v3.core.util.Json;
import com.jiagutech.ams.model.ZhongNongTrackData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -17,7 +16,6 @@ import org.springframework.web.client.RestTemplate;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.List;
@Slf4j
@Component
@ -51,7 +49,7 @@ public class ZhongNongRestClient {
}
public List<ZhongNongTrack> getTracks(String accessToken, String simNo, long startTime, long endTime) {
public ZhongNongTrackData getTracks(String accessToken, String simNo, long startTime, long endTime) {
// 设置请求头和请求体
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
@ -66,7 +64,7 @@ public class ZhongNongRestClient {
HttpEntity<String> requestEntity = new HttpEntity<>(body.toJSONString(), headers);
ResponseEntity<String> response = restTemplate.postForEntity(baseUrl + "/MessageDataService/vehicleLocusList", requestEntity, String.class);
if (response.getStatusCode().is2xxSuccessful()) {
return JSON.parseArray(response.getBody(), ZhongNongTrack.class);
return JSON.parseObject(response.getBody(), ZhongNongTrackData.class);
} else {
log.error("获取轨迹失败:{}", response);
return null;

146
social/src/main/java/com/jiagutech/ams/service/SortieService.java

@ -1,75 +1,75 @@
package com.jiagutech.ams.service;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jiagutech.ams.mapper.DeviceMapper;
import com.jiagutech.ams.mapper.SortieMapper;
import com.jiagutech.ams.model.SortieMapping;
import com.jiagutech.ams.model.UavSortie;
import com.jiagutech.ams.model.dto.DeviceDTO;
import com.jiagutech.ams.model.dto.SortieDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
* @ClassName SortieService
* @author: zhangyeguang
* @create: 2024-09-09 09:32
* @Version 1.0
* @description:
**/
@Slf4j
@Component
@RequiredArgsConstructor
public class SortieService {
private final SortieMapper sortieMapper;
private final DeviceMapper deviceMapper;
@RabbitListener(queues = "queue_ams_social_sortie")
public void receiveMessage(Message message) {
byte[] body = message.getBody();
String jsonString = new String(body, StandardCharsets.UTF_8);
log.info("receiveMessage: {}", jsonString);
try {
UavSortie uavSortie = JSON.parseObject(jsonString, UavSortie.class);
SortieDTO sortieDTO = SortieMapping.INSTANCE.convertToSortieDTOByUavSortie(uavSortie);
SortieDTO hasSorties = sortieMapper.selectOne(Wrappers.lambdaQuery(SortieDTO.class).eq(SortieDTO::getVehicleId, sortieDTO.getVehicleId())
.eq(SortieDTO::getStartAt, sortieDTO.getStartAt()));
if (ObjectUtil.isNotEmpty(sortieDTO)) {
if (ObjectUtil.isNotEmpty(hasSorties)) {
sortieDTO.setId(hasSorties.getId());
sortieMapper.updateById(sortieDTO);
} else {
sortieMapper.insert(sortieDTO);
}
QueryWrapper<DeviceDTO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(DeviceDTO::getBoxNum, sortieDTO.getVehicleId()).lt(DeviceDTO::getUpdateTime, sortieDTO.getEndAt());
DeviceDTO deviceDTO = new DeviceDTO().setUpdateTime(sortieDTO.getEndAt()).setLat(sortieDTO.getLatitude()).setLng(sortieDTO.getLongitude());
deviceMapper.update(deviceDTO,queryWrapper);
}
} catch (Exception e) {
log.error("receiveMessage error", e);
}
}
// QueryWrapper<DeviceDTO> queryWrapper = Wrappers.query();
// DeviceDTO deviceDTO = deviceMapper.selectOne(queryWrapper.eq("device_id", sortieDTO.getVehicleId()));
// if (ObjectUtil.isNotEmpty(deviceDTO)) {
// Long DeviceId = deviceDTO.getId();
//package com.jiagutech.ams.service;
//
//import cn.hutool.core.util.ObjectUtil;
//import com.alibaba.fastjson2.JSON;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.jiagutech.ams.mapper.DeviceMapper;
//import com.jiagutech.ams.mapper.SortieMapper;
//import com.jiagutech.ams.model.SortieMapping;
//import com.jiagutech.ams.model.UavSortie;
//import com.jiagutech.ams.model.dto.DeviceDTO;
//import com.jiagutech.ams.model.dto.SortieDTO;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Component;
//
//import java.nio.charset.StandardCharsets;
//import java.util.Map;
//
///**
// * @ClassName SortieService
// * @author: zhangyeguang
// * @create: 2024-09-09 09:32
// * @Version 1.0
// * @description:
// **/
//@Slf4j
//@Component
//@RequiredArgsConstructor
//public class SortieService {
//
// private final SortieMapper sortieMapper;
// private final DeviceMapper deviceMapper;
//
// @RabbitListener(queues = "queue_ams_social_sortie")
// public void receiveMessage(Message message) {
// byte[] body = message.getBody();
// String jsonString = new String(body, StandardCharsets.UTF_8);
// log.info("receiveMessage: {}", jsonString);
// try {
// UavSortie uavSortie = JSON.parseObject(jsonString, UavSortie.class);
// SortieDTO sortieDTO = SortieMapping.INSTANCE.convertToSortieDTOByUavSortie(uavSortie);
// SortieDTO hasSorties = sortieMapper.selectOne(Wrappers.lambdaQuery(SortieDTO.class).eq(SortieDTO::getVehicleId, sortieDTO.getVehicleId())
// .eq(SortieDTO::getStartAt, sortieDTO.getStartAt()));
// if (ObjectUtil.isNotEmpty(sortieDTO)) {
// if (ObjectUtil.isNotEmpty(hasSorties)) {
// sortieDTO.setId(hasSorties.getId());
// sortieMapper.updateById(sortieDTO);
//
// } else {
// sortieMapper.insert(sortieDTO);
// }
// QueryWrapper<DeviceDTO> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().eq(DeviceDTO::getBoxNum, sortieDTO.getVehicleId()).lt(DeviceDTO::getUpdateTime, sortieDTO.getEndAt());
// DeviceDTO deviceDTO = new DeviceDTO().setUpdateTime(sortieDTO.getEndAt()).setLat(sortieDTO.getLatitude()).setLng(sortieDTO.getLongitude());
// deviceMapper.update(deviceDTO,queryWrapper);
//
// }
// } catch (Exception e) {
// log.error("receiveMessage error", e);
// }
}
//
// }
//// QueryWrapper<DeviceDTO> queryWrapper = Wrappers.query();
//// DeviceDTO deviceDTO = deviceMapper.selectOne(queryWrapper.eq("device_id", sortieDTO.getVehicleId()));
//// if (ObjectUtil.isNotEmpty(deviceDTO)) {
//// Long DeviceId = deviceDTO.getId();
////
//// }
//
//
//}
//

11
social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java

@ -88,7 +88,6 @@ public class TrackUtil {
AtomicReference<Double> breadth = new AtomicReference<>((double) 0);
List<double[]> coordinates = pointTemps.stream()
.filter(p -> p.getVelocity() > 0)
.filter(p -> p.getBreadth()!=null && p.getBreadth() > 0)
.map(item -> {
breadth.set(item.getBreadth());
return new double[]{item.getLng(), item.getLat()};
@ -96,7 +95,15 @@ public class TrackUtil {
return (float) calculateArea(coordinates, breadth.get());
}
public static float calcAreaByBlockDataNoFilter(List<TrackItem> pointTemps,double breadth) {
public static float calcAreaByBlockData(List<TrackItem> pointTemps, double breadth) {
List<double[]> coordinates = pointTemps.stream()
.filter(p -> p.getVelocity() > 0)
.map(item -> new double[]{item.getLng(), item.getLat()}).toList();
return (float) calculateArea(coordinates, breadth);
}
public static float calcAreaByBlockDataNoFilter(List<TrackItem> pointTemps, double breadth) {
List<double[]> coordinates = pointTemps.stream()
.map(item -> new double[]{item.getLng(), item.getLat()}).toList();
return (float) calculateArea(coordinates, breadth);

2
system/src/main/java/com/jiagutech/ams/service/UserServiceImpl.java

@ -108,7 +108,7 @@ public class UserServiceImpl implements UserService {
public void addUser(UserRequest userRequest) {
UserDTO userDTO = UserMapping.INSTANCE.userToUserDTO(userRequest);
userDTO.setId(null);
userDTO.setPassword(BCrypt.hashpw(userRequest.getPassword()));
userDTO.setPassword(BCrypt.hashpw(userRequest.getPassword()));
if (userDTO.getRegionCode() != null && userDTO.getRegionCode() != 0l) {
RegionVO completeRegionInfo = regionMapper.getCompleteRegionInfo(userDTO.getRegionCode());
if (completeRegionInfo != null) {

16
web/pom.xml

@ -94,14 +94,14 @@
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-rabbit</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.amqp</groupId>-->
<!-- <artifactId>spring-amqp</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>

90
web/src/main/java/com/jiagutech/ams/common/RabbitConfig.java

@ -1,45 +1,45 @@
package com.jiagutech.ams.common;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @ClassName RabbitConfig
* @author: zhangyeguang
* @create: 2024-09-10 09:58
* @Version 1.0
* @description:
**/
@Configuration
public class RabbitConfig {
public static final String EXCHANGE_NAME = "topic.exchange";
public static final String QUEUE_FARM_SORTIE = "queue_ams_social_sortie";
@Bean
public Exchange exchange() {
//durable(true) 持久化,mq重启之后交换机还在
return ExchangeBuilder.topicExchange(EXCHANGE_NAME).durable(true).build();
}
@Bean(QUEUE_FARM_SORTIE)
public Queue farmsortieQueue() {
return new Queue(QUEUE_FARM_SORTIE);
}
@Bean
public Binding bindingFarmSortie() {
return BindingBuilder.bind(farmsortieQueue()).to(exchange()).with("ams.sortie.key").noargs();
}
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
return rabbitTemplate;
}
}
//package com.jiagutech.ams.common;
//
//import org.springframework.amqp.core.*;
//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @ClassName RabbitConfig
// * @author: zhangyeguang
// * @create: 2024-09-10 09:58
// * @Version 1.0
// * @description:
// **/
//@Configuration
//public class RabbitConfig {
// public static final String EXCHANGE_NAME = "topic.exchange";
// public static final String QUEUE_FARM_SORTIE = "queue_ams_social_sortie";
//
// @Bean
// public Exchange exchange() {
// //durable(true) 持久化,mq重启之后交换机还在
// return ExchangeBuilder.topicExchange(EXCHANGE_NAME).durable(true).build();
// }
//
// @Bean(QUEUE_FARM_SORTIE)
// public Queue farmsortieQueue() {
// return new Queue(QUEUE_FARM_SORTIE);
// }
//
//
// @Bean
// public Binding bindingFarmSortie() {
// return BindingBuilder.bind(farmsortieQueue()).to(exchange()).with("ams.sortie.key").noargs();
// }
// @Bean
// public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
// RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
// rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
// return rabbitTemplate;
// }
//
//}

10
web/src/main/resources/application-dev.yml

@ -13,11 +13,11 @@ spring:
host: 192.168.10.111
port: 6379
database: 11
rabbitmq:
host: 192.168.10.111
port: 5672
username: admin
password: admin
# rabbitmq:
# host: 192.168.10.111
# port: 5672
# username: admin
# password: admin

10
web/src/main/resources/application-prod.yml

@ -14,11 +14,11 @@ spring:
port: 6379
database: 11
password: Test123
rabbitmq:
host: 192.168.1.195
port: 5672
username: jiagu
password: jiagu2058
# rabbitmq:
# host: 192.168.1.195
# port: 5672
# username: jiagu
# password: jiagu2058

10
web/src/main/resources/application-zyg.yml

@ -12,11 +12,11 @@ spring:
database: 10
# password: 123456
rabbitmq:
host: 192.168.10.111
port: 5672
username: admin
password: admin
# rabbitmq:
# host: 192.168.10.111
# port: 5672
# username: admin
# password: admin

10
web/src/main/resources/application.yml

@ -38,11 +38,11 @@ spring:
max-idle: 50
# 连接池中的最小空闲连接
min-idle: 10
rabbitmq:
listener:
simple:
concurrency: 2
# rabbitmq:
#
# listener:
# simple:
# concurrency: 2

Loading…
Cancel
Save