diff --git a/social/pom.xml b/social/pom.xml index 6fe0db3..35d62a7 100644 --- a/social/pom.xml +++ b/social/pom.xml @@ -63,18 +63,18 @@ org.apache.poi poi-ooxml - - org.springframework.boot - spring-boot-starter-amqp - - - org.springframework.amqp - spring-rabbit - - - org.springframework.amqp - spring-amqp - + + + + + + + + + + + + com.alibaba easyexcel diff --git a/social/src/main/java/com/jiagutech/ams/controller/JobController.java b/social/src/main/java/com/jiagutech/ams/controller/JobController.java index 22bde56..d60ed7b 100644 --- a/social/src/main/java/com/jiagutech/ams/controller/JobController.java +++ b/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> getJobTypes() { @@ -131,13 +130,15 @@ public class JobController { List tracks = jobService.getTracks(deviceId, startTime, endTime); List 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 areas = new HashMap<>(4); areas.put("noFilter", noFilter); areas.put("byFilter", byFilter); areas.put("zhongnongArea", zhongnongArea); + areas.put("zhongnongArea1", zhongnongArea1); return R.ok(areas); } diff --git a/social/src/main/java/com/jiagutech/ams/listener/JobFinishListener.java b/social/src/main/java/com/jiagutech/ams/listener/JobFinishListener.java index 658b28d..d4dcbe7 100644 --- a/social/src/main/java/com/jiagutech/ams/listener/JobFinishListener.java +++ b/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 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 getTracksFromZhongNong(String vehicleId, Long startTime, Long endTime) { - List 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 items = mapping.convertToTrackItemsByZhongNongTracks(tracks.getVehicleLocusList()); + items.get(0).setBreadth(tracks.getBreadth()); + return items; } diff --git a/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java b/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java index 5a6ddcb..2e0d975 100644 --- a/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java +++ b/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrack.java @@ -17,4 +17,6 @@ public class ZhongNongTrack { private Integer direction; + private Double breadth; + } diff --git a/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrackData.java b/social/src/main/java/com/jiagutech/ams/model/ZhongNongTrackData.java new file mode 100644 index 0000000..bf43499 --- /dev/null +++ b/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 vehicleLocusList; +} diff --git a/social/src/main/java/com/jiagutech/ams/rest/TrackRestClient.java b/social/src/main/java/com/jiagutech/ams/rest/TrackRestClient.java index 4264300..4fc3503 100644 --- a/social/src/main/java/com/jiagutech/ams/rest/TrackRestClient.java +++ b/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 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 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>() { - }); + return JSON.parseObject(res, ZhongNongTrackData.class); } } diff --git a/social/src/main/java/com/jiagutech/ams/rest/ZhongNongRestClient.java b/social/src/main/java/com/jiagutech/ams/rest/ZhongNongRestClient.java index e1cc19a..4dee071 100644 --- a/social/src/main/java/com/jiagutech/ams/rest/ZhongNongRestClient.java +++ b/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 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 requestEntity = new HttpEntity<>(body.toJSONString(), headers); ResponseEntity 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; diff --git a/social/src/main/java/com/jiagutech/ams/service/SortieService.java b/social/src/main/java/com/jiagutech/ams/service/SortieService.java index 486ad4c..2c16e49 100644 --- a/social/src/main/java/com/jiagutech/ams/service/SortieService.java +++ b/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 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 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 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 queryWrapper = Wrappers.query(); +//// DeviceDTO deviceDTO = deviceMapper.selectOne(queryWrapper.eq("device_id", sortieDTO.getVehicleId())); +//// if (ObjectUtil.isNotEmpty(deviceDTO)) { +//// Long DeviceId = deviceDTO.getId(); +//// +//// } +// +// +//} +// diff --git a/social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java b/social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java index c472932..e5d57ba 100644 --- a/social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java +++ b/social/src/main/java/com/jiagutech/ams/utils/TrackUtil.java @@ -88,7 +88,6 @@ public class TrackUtil { AtomicReference breadth = new AtomicReference<>((double) 0); List 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 pointTemps,double breadth) { + public static float calcAreaByBlockData(List pointTemps, double breadth) { + + List 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 pointTemps, double breadth) { List coordinates = pointTemps.stream() .map(item -> new double[]{item.getLng(), item.getLat()}).toList(); return (float) calculateArea(coordinates, breadth); diff --git a/system/src/main/java/com/jiagutech/ams/service/UserServiceImpl.java b/system/src/main/java/com/jiagutech/ams/service/UserServiceImpl.java index ccb148c..4827976 100644 --- a/system/src/main/java/com/jiagutech/ams/service/UserServiceImpl.java +++ b/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) { diff --git a/web/pom.xml b/web/pom.xml index 49bfe6c..b7fc85d 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -94,14 +94,14 @@ org.mapstruct mapstruct - - org.springframework.amqp - spring-rabbit - - - org.springframework.amqp - spring-amqp - + + + + + + + + org.springframework.boot spring-boot-starter-actuator diff --git a/web/src/main/java/com/jiagutech/ams/common/RabbitConfig.java b/web/src/main/java/com/jiagutech/ams/common/RabbitConfig.java index 11e14fd..f59826c 100644 --- a/web/src/main/java/com/jiagutech/ams/common/RabbitConfig.java +++ b/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; +// } +// +//} diff --git a/web/src/main/resources/application-dev.yml b/web/src/main/resources/application-dev.yml index 39f7b24..8da6d21 100644 --- a/web/src/main/resources/application-dev.yml +++ b/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 diff --git a/web/src/main/resources/application-prod.yml b/web/src/main/resources/application-prod.yml index 45b7d61..496be81 100644 --- a/web/src/main/resources/application-prod.yml +++ b/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 diff --git a/web/src/main/resources/application-zyg.yml b/web/src/main/resources/application-zyg.yml index 49998fb..5b9013c 100644 --- a/web/src/main/resources/application-zyg.yml +++ b/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 diff --git a/web/src/main/resources/application.yml b/web/src/main/resources/application.yml index b95f40d..3c4d1ae 100644 --- a/web/src/main/resources/application.yml +++ b/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