Merge remote-tracking branch 'origin/dev.vehicles' into dev
commit
e2d710fbb6
|
@ -20,4 +20,8 @@ public class ServiceNameConstants {
|
|||
* 文件服务的serviceid
|
||||
*/
|
||||
public static final String FILE_SERVICE = "cloud-file";
|
||||
/**
|
||||
* 企业平台服务的serviceid
|
||||
*/
|
||||
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--swagger3maven依赖-->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- mybatis-plus-join依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
|
|
|
@ -102,6 +102,18 @@ public class MessageValueController extends BaseController
|
|||
return Result.success(messageValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据报文模版id查询报文数据
|
||||
* @param templateId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/messageValue/findByTemplateId/{templateId}")
|
||||
@Operation(summary = "根据报文模版id查询报文数据", description = "根据报文模版id查询报文数据")
|
||||
public Result<List<MessageValueListResp>> findByTemplateId(@PathVariable("templateId") Long templateId){
|
||||
List<MessageValueListResp> list = messageValueService.findByTemplateId(templateId);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -127,4 +127,16 @@ public class VehicleController extends BaseController
|
|||
util.exportExcel(response, list, "车辆数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过车辆vin码查询模板id
|
||||
* @param vehicleVin 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/findByVehicleVin/{vehicleVin}")
|
||||
@Operation(description = "通过车辆vin码查询模板id")
|
||||
public Result<Long> findByVehicleVin(@PathVariable("vehicleVin") String vehicleVin) {
|
||||
Long byVehicleVin = vehicleService.findByVehicleVin(vehicleVin);
|
||||
return Result.success(byVehicleVin);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.muyu.enterprise.domain.car.Vehicle;
|
|||
import com.muyu.enterprise.domain.req.car.VehicleManageReq;
|
||||
import com.muyu.enterprise.domain.resp.car.VehicleManageResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -28,5 +29,11 @@ public interface VehicleMapper extends MPJBaseMapper<Vehicle>
|
|||
* @return 返回结果
|
||||
*/
|
||||
List<VehicleManageResp> findAll(VehicleManageReq vehicleManageReq);
|
||||
|
||||
/**
|
||||
* 通过车辆vin码查询模板id
|
||||
* @param vehicleVin 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Select("SELECT t.message_template_id FROM vehicle v LEFT JOIN vehicle_type t ON v.vehicle_type_id = t.vehicle_type_id WHERE v.vehicle_vin = #{vehicleVin}")
|
||||
Long findByVehicleVin(String vehicleVin);
|
||||
}
|
||||
|
|
|
@ -37,4 +37,12 @@ extends IService<MessageValue>
|
|||
* @return 返回结果
|
||||
*/
|
||||
JSONObject analysis(String testStr);
|
||||
/**
|
||||
* 根据报文模版id查询报文数据
|
||||
* @param templateId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
List<MessageValueListResp> findByTemplateId(Long templateId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,5 +26,10 @@ extends IService<Vehicle>
|
|||
* @return 返回结果
|
||||
*/
|
||||
List<VehicleManageResp> getVehicleList(VehicleManageReq vehicleManageReq);
|
||||
|
||||
/**
|
||||
* 通过车辆vin码查询模板id
|
||||
* @param vehicleVin 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
Long findByVehicleVin(String vehicleVin);
|
||||
}
|
||||
|
|
|
@ -137,5 +137,17 @@ extends ServiceImpl<MessageValueMapper,
|
|||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageValueListResp> findByTemplateId(Long templateId) {
|
||||
LambdaQueryWrapper<MessageValue> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MessageValue::getTemplateId,templateId);
|
||||
List<MessageValue> list = this.list();
|
||||
return list.stream()
|
||||
.map(messageValue ->MessageValueListResp.valueBuild(
|
||||
messageValue
|
||||
)
|
||||
).toList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -58,6 +58,17 @@ extends ServiceImpl<VehicleMapper,
|
|||
List<VehicleManageResp> list = vehicleMapper.selectJoinList(VehicleManageResp.class, wrapper);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 通过车辆vin码查询模板id
|
||||
* @param vehicleVin 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Override
|
||||
public Long findByVehicleVin(String vehicleVin) {
|
||||
Long templateId = vehicleMapper.findByVehicleVin(vehicleVin);
|
||||
return templateId;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.analysis.parsing;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 协议解析启动类
|
||||
* @Author: 李庆帅
|
||||
* @Package: com.muyu.cloud.protocol.parsing
|
||||
* @Project: 2112-car-cloud-server
|
||||
* @name: ProtocolParsingApplication
|
||||
* @Date: 2024/9/28 11:54
|
||||
* @Description: 协议解析启动类
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class ProtocolParsingApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ProtocolParsingApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@
|
|||
<modules>
|
||||
<module>cloud-modules-enterprise-server</module>
|
||||
<module>cloud-modules-enterprise-common</module>
|
||||
<module>cloud-modules-protocol-analysis</module>
|
||||
</modules>
|
||||
|
||||
<description>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
|
@ -89,12 +89,17 @@
|
|||
<artifactId>cloud-modules-enterprise-server</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus-join依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>1.4.11</version>
|
||||
</dependency>
|
||||
<!-- 核心模块 - 公共依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.analysis;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 协议解析启动类
|
||||
*
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class ProtocolAnalysisApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ProtocolAnalysisApplication.class, args);
|
||||
System.out.println(" _ooOoo_\n" +
|
||||
" o8888888o\n" +
|
||||
" 88\" . \"88\n" +
|
||||
" (| -_- |)\n" +
|
||||
" O\\ = /O\n" +
|
||||
" ____/`---'\\____\n" +
|
||||
" .' \\\\| |// `.\n" +
|
||||
" / \\\\||| : |||// \\\n" +
|
||||
" / _||||| -:- |||||- \\\n" +
|
||||
" | | \\\\\\ - /// | |\n" +
|
||||
" | \\_| ''\\---/'' | |\n" +
|
||||
" \\ .-\\__ `-` ___/-. /\n" +
|
||||
" ___`. .' /--.--\\ `. . __\n" +
|
||||
" .\"\" '< `.___\\_<|>_/___.' >'\"\".\n" +
|
||||
" | | : `- \\`.;`\\ _ /`;.`/ - ` : | |\n" +
|
||||
" \\ \\ `-. \\_ __\\ /__ _/ .-` / /\n" +
|
||||
" ======`-.____`-.___\\_____/___.-`____.-'======\n" +
|
||||
" `=---='\n" +
|
||||
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
|
||||
" // 佛祖保佑 永不宕机 永无BUG //");
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.analysis.parsing.remote;
|
||||
|
||||
import com.muyu.analysis.parsing.remote.factory.RemoteClientServiceFactory;
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
@ -16,9 +17,12 @@ import java.util.List;
|
|||
* @Project:cloud-server
|
||||
* @name:RemoteServiceClient
|
||||
* @Date:2024/9/28 20:38
|
||||
* ,,value = ServiceNameConstants.ENTERPRISE_SERVICE
|
||||
* ,fallbackFactory= RemoteClientServiceFactory.class
|
||||
*/
|
||||
@FeignClient(name = "remoteClientService"
|
||||
,fallbackFactory= RemoteClientServiceFactory.class)
|
||||
@FeignClient(name = "cloud-enterprise",value = ServiceNameConstants.ENTERPRISE_SERVICE
|
||||
,fallbackFactory= RemoteClientServiceFactory.class
|
||||
)
|
||||
public interface RemoteClientService {
|
||||
/**
|
||||
* 根据报文模版id查询报文数据
|
|
@ -6,6 +6,7 @@ import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -17,7 +18,9 @@ import java.util.List;
|
|||
* @name:RemoteServiceClientFactory
|
||||
* @Date:2024/9/28 21:16
|
||||
*/
|
||||
public class RemoteClientServiceFactory implements FallbackFactory<RemoteClientService>
|
||||
@Component
|
||||
public class RemoteClientServiceFactory
|
||||
implements FallbackFactory<RemoteClientService>
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteClientServiceFactory.class);
|
||||
|
|
@ -12,7 +12,7 @@ nacos:
|
|||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-enterprise
|
||||
name: cloud-protocol-analysis
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
|
@ -14,6 +14,7 @@
|
|||
<module>cloud-modules-file</module>
|
||||
<module>cloud-modules-enterprise</module>
|
||||
<module>cloud-weixin-mp</module>
|
||||
<module>cloud-modules-protocol-analysis</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
|
|
Loading…
Reference in New Issue