diff --git a/fivegroup-common/fivegroup-common-core/src/main/java/com/fivegroup/common/core/admin/Firm.java b/fivegroup-common/fivegroup-common-core/src/main/java/com/fivegroup/common/core/admin/Firm.java index 71d5cc5..a6be71c 100644 --- a/fivegroup-common/fivegroup-common-core/src/main/java/com/fivegroup/common/core/admin/Firm.java +++ b/fivegroup-common/fivegroup-common-core/src/main/java/com/fivegroup/common/core/admin/Firm.java @@ -25,18 +25,36 @@ import java.util.Date; @AllArgsConstructor @TableName("t_firm") public class Firm { + /** + * 公司id + */ @TableId(value = "firm_id",type = IdType.AUTO) private Integer firmId; + /** + * 公司名称 + */ @TableField("firm_name") private String firmName; + /** + * 公司管理员 + */ @TableField("firm_admin") private String firmAdmin; + /** + * 公司创建时间 + */ @TableField("firm_time") @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date firmTime; + /** + * 公司地址 + */ @TableField("firm_home") private String firmHome; + /** + * 公司vip等级 + */ @TableField("firm_vip") private Integer firmVip; } diff --git a/fivegroup-gateway/src/main/resources/bootstrap.yml b/fivegroup-gateway/src/main/resources/bootstrap.yml index 6f8fb00..f2b70b9 100644 --- a/fivegroup-gateway/src/main/resources/bootstrap.yml +++ b/fivegroup-gateway/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 8080 + port: 8089 # Spring spring: application: diff --git a/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/FiveGroupAnalysisApplication.java b/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/FiveGroupAnalysisApplication.java index a4fbac1..d0dcfe6 100644 --- a/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/FiveGroupAnalysisApplication.java +++ b/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/FiveGroupAnalysisApplication.java @@ -11,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableMyFeignClients @SpringBootApplication public class FiveGroupAnalysisApplication { + public static void main(String[] args) { SpringApplication.run(FiveGroupAnalysisApplication.class); } diff --git a/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/feign/FaultLogFeign.java b/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/feign/FaultLogFeign.java index db2d00f..cce8af0 100644 --- a/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/feign/FaultLogFeign.java +++ b/fivegroup-modules/fivegroup-analysis/src/main/java/com/fivegroup/analysis/feign/FaultLogFeign.java @@ -1,7 +1,5 @@ package com.fivegroup.analysis.feign; -import com.fivegroup.common.core.domain.Result; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/fivegroup-modules/fivegroup-analysis/src/main/resources/bootstrap.yml b/fivegroup-modules/fivegroup-analysis/src/main/resources/bootstrap.yml index 3513c1f..f93b2c9 100644 --- a/fivegroup-modules/fivegroup-analysis/src/main/resources/bootstrap.yml +++ b/fivegroup-modules/fivegroup-analysis/src/main/resources/bootstrap.yml @@ -1,47 +1,39 @@ -# Tomcat server: port: 8081 - -feign: - client: - config: - default: - connectTimeout: 30000 - - -# Spring spring: rabbitmq: + host: 101.34.69.116 + port: 5672 username: guest password: guest - virtualHost: / - port: 5672 - host: 101.34.69.116 + template: + mandatory: true listener: simple: - prefetch: 1 # 每次只能获取一条,处理完成才能获取下一条 - publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange) + prefetch: 1 # 每次取一条消息消费 消费完成取下一条 + acknowledge-mode: manual # 设置消费端手动ack确认 + retry: + enabled: true # 支持重试 + publisher-confirms: true #确认消息已发送到交换机(Exchange) publisher-returns: true #确认消息已发送到队列(Queue) - application: - # 应用名称 - name: fivegroup-analysis - profiles: - # 环境配置 - active: dev - cloud: - nacos: - discovery: - # 服务注册地址 - server-addr: 101.34.69.116:8848 - config: - # 配置中心地址 - server-addr: 101.34.69.116:8848 - # 配置文件格式 - file-extension: yml - # 共享配置 - shared-configs: - - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} -logging: - level: - com.fivegroup.system.mapper: DEBUG - + redis: + host: 101.34.69.116 # Redis服务器主机地址 + port: 6379 # Redis服务器端口号 + password: # Redis密码,如果没有则为空 + timeout: 3000 # 连接超时时间,单位为毫秒 + database: 0 # Redis数据库索引号,默认为0 + datasource: + url: jdbc:mysql://101.34.69.116:3306/car?characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: root + password: zhang0318. + driver-class-name: com.mysql.cj.jdbc.Driver + druid: + initial-size: 5 # 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时 + min-idle: 5 # 最小连接池数量 + max-active: 20 # 最大连接池数量 + max-wait: 60000 # 获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.fivegroup.analysis.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath:mapper/**/*.xml diff --git a/fivegroup-modules/fivegroup-enter/src/main/resources/bootstrap.yml b/fivegroup-modules/fivegroup-enter/src/main/resources/bootstrap.yml index f80c6f0..9ad98c5 100644 --- a/fivegroup-modules/fivegroup-enter/src/main/resources/bootstrap.yml +++ b/fivegroup-modules/fivegroup-enter/src/main/resources/bootstrap.yml @@ -29,6 +29,7 @@ spring: transport: # 控制台地址 dashboard: 101.34.69.116:8718 + # # nacos配置持久化 # datasource: # ds1: diff --git a/fivegroup-modules/fivegroup-gen/src/main/resources/bootstrap.yml b/fivegroup-modules/fivegroup-gen/src/main/resources/bootstrap.yml index 1e7454f..85a6fac 100644 --- a/fivegroup-modules/fivegroup-gen/src/main/resources/bootstrap.yml +++ b/fivegroup-modules/fivegroup-gen/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9202 + port: 9230 # Spring spring: diff --git a/fivegroup-modules/fivegroup-real/pom.xml b/fivegroup-modules/fivegroup-real/pom.xml index 299fe4d..c5b02a9 100644 --- a/fivegroup-modules/fivegroup-real/pom.xml +++ b/fivegroup-modules/fivegroup-real/pom.xml @@ -86,6 +86,14 @@ com.fivegroup fivegroup-common-security + + org.junit.platform + junit-platform-commons + + + com.google.code.gson + gson + diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLog.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLog.java new file mode 100644 index 0000000..09ee926 --- /dev/null +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLog.java @@ -0,0 +1,25 @@ +package com.fivegroup.real.aop; + +import org.springframework.web.bind.annotation.RestController; + +import java.lang.annotation.*; + +/** + * 切面类 + * + * @author ZhangXushuo + * @version 2023/12/4 - 19:31 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +@Documented +public @interface WebLog { + /** + * 日志名称 + * + * @return + */ + String value() default ""; + + +} diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLogAspect.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLogAspect.java new file mode 100644 index 0000000..2bb18d6 --- /dev/null +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/aop/WebLogAspect.java @@ -0,0 +1,94 @@ +package com.fivegroup.real.aop; + +import com.google.gson.Gson; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.aspectj.lang.ProceedingJoinPoint; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; + +/** + * 日志切面 + * + * @author ZhangXushuo + * @version 2023/12/4 - 19:35 + */ +@Aspect +@Component +public class WebLogAspect { + private final static Logger logger= LoggerFactory.getLogger(WebLogAspect.class); + private static final Gson gson=new Gson(); + + + private static final String LINE_SEPARATOR = System.lineSeparator(); + + @Pointcut("@annotation(com.fivegroup.real.aop.WebLog)") + public void webLog(){} + @Before("webLog()") + public void doBefore(JoinPoint joinPoint){ + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + if (attributes!=null) { + HttpServletRequest request = attributes.getRequest(); + //获取@WebLog()注解的描述信息 + String methodDescription; + try { + methodDescription = getAspectLogDescription(joinPoint); + }catch (Exception e){ + methodDescription="无法获取方法描述信息"; + logger.error("获取方法描述信息时发生的异常:",e); + } + logger.info("======================start======================="); + logger.info("URL: :{}",request.getRequestURL().toString()); + logger.info("描述信息 :{}",methodDescription); + logger.info("HTTP: {}",request.getMethod()); + logger.info("类方法 :{},{}",joinPoint.getSignature()); + logger.info("Ip :{}",request.getRemoteAddr()); + logger.info("请求参数 :{}",gson.toJson(joinPoint.getArgs())); + } + } + @Around("webLog()") + public void daAfter(){ + logger.info("=========================end=========================="); + } + + /** + * 环绕通知 + * @param proceedingJoinPoint + * @return + * @throws Throwable + */ + @Around("webLog()") + public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { + long startTime = System.currentTimeMillis(); + Object result = proceedingJoinPoint.proceed(); + logger.info("执行方法:"+gson.toJson(result)); + logger.info(",耗时:"+(System.currentTimeMillis()-startTime)+"毫秒"); + return result; + } + + + private String getAspectLogDescription(JoinPoint joinPoint) throws ClassNotFoundException { + String targetName = joinPoint.getTarget().getClass().getName(); + String methodName = joinPoint.getSignature().getName(); + Object[] arguments= joinPoint.getArgs(); + Class targetClass = Class.forName(targetName); + Method[] methods = targetClass.getMethods(); + for (Method method : methods) { + if (method.getName().equals(methodName) && method.getParameterTypes().length == arguments.length) { + WebLog webLog = method.getAnnotation(WebLog.class); + if (webLog != null) { + return webLog.value(); + } + } + } + return ""; + } + +} diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/controller/RealController.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/controller/RealController.java index d07f1d3..e33acd0 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/controller/RealController.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/controller/RealController.java @@ -1,12 +1,15 @@ package com.fivegroup.real.controller; import com.fivegroup.common.core.domain.Result; +import com.fivegroup.common.core.trajectory.Vehicle; import com.fivegroup.common.log.annotation.Log; import com.fivegroup.common.log.enums.BusinessType; import com.fivegroup.common.real.domain.Car; import com.fivegroup.common.security.annotation.RequiresPermissions; import com.fivegroup.real.domain.RequestVehicle; +import com.fivegroup.real.domain.VehicleData; +import com.fivegroup.real.domain.response.ResponseCar; import com.fivegroup.real.service.RealService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; @@ -26,16 +29,25 @@ import java.util.List; @Log4j2 public class RealController { + /** + * 车辆连表的信息 + */ @Autowired public RealService realService; + @PostMapping("ResponseCarList") + public Result> ResponseCarList(){ + return realService.ResponseCarList(); + } /** - * 车辆列表 + * 所有的车辆数据 * @return */ - @PostMapping("/carList") - public List carList(){ - return realService.carList(); + @PostMapping("vehicleList") + private Result> vehicleList(){ + List list= realService.vehicleList(); + Result> result = Result.success(list); + return result; } /** @@ -50,6 +62,19 @@ public class RealController { return result; } + /** + * 查看车辆信息 + * @return + * @return + */ +// @RequiresPermissions("car:car:seeList") + @PostMapping("seeList") + public Result> seeList(){ + List list = realService.seeList(); + Result> result = Result.success(list); + return result; + } + /** * 车辆添加 * @param car @@ -90,20 +115,30 @@ public class RealController { return result; } + /** + * 添加车辆信息 + * @param requestVehicle + * @return + */ // @RequiresPermissions("car:insertVehicle") @PostMapping("insertVehicle") public Result insertVehicle(@RequestBody RequestVehicle requestVehicle){ return realService.insertVehicle(requestVehicle); } - @PostMapping("/insert") - public Result insert(@RequestBody Car car){ - return realService.insert(car); - } + + /** + * 用ID删除车辆信息 + * @param carId + * @return + */ + @PostMapping("/delete/{carId}") public int delete(@RequestBody Integer carId){ return realService.delete(carId); } - - + @PostMapping("/insert") + public int insert(@RequestBody Car carId){ + return realService.insert(carId); + } } diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Car.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Car.java index e31d7f7..914f321 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Car.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Car.java @@ -24,7 +24,7 @@ public class Car { * 车牌号 * */ - private String carCode; + private String carBh; /** * vin */ @@ -36,7 +36,7 @@ public class Car { /** * 电子围栏id */ - private Integer fenceId; + private Integer wallId; /** * 车辆状态 */ @@ -44,19 +44,19 @@ public class Car { /** * 电机厂商 */ - private Integer batterymakerId; + private Integer motorManufacturerId; /** * 电池产商 */ - private Integer motormanufacturerId; + private Integer batteryMakerId; /** * 电池编号 */ - private Integer motorId; + private Integer motorBh; /** * 电机编号 */ - private Integer batteryId; + private Integer batteryBh; /** * 审核状态 */ diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/VehicleData.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/VehicleData.java new file mode 100644 index 0000000..c9e432d --- /dev/null +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/VehicleData.java @@ -0,0 +1,308 @@ +package com.fivegroup.real.domain; + +import lombok.*; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 车辆所有数据 + * + * @author ZhangXushuo + * @version 2023/12/4 - 21:28 + */ +@Data +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class VehicleData { + /** + * 主键id + */ + + private Integer id; + + /** + * VIN + */ + private String vin; + + /** + * 时间戳 + */ + private Date createTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String latitude; + + /** + * 速度 + */ + private String speed; + + /** + * 里程 + */ + private BigDecimal mileage; + + /** + * 总电压 + */ + private String voltage; + + /** + * 总电流 + */ + private String current; + + /** + * 绝缘电阻 + */ + private String resistance; + + /** + * 档位 + */ + private String gear; + + /** + * 加速踏板行程值 + */ + private String accelerationPedal; + + /** + * 制动踏板行程值 + */ + private String brakePedal; + + /** + * 燃料消耗率 + */ + private String fuelConsumptionRate; + + /** + * 电机控制器温度 + */ + private String motorControllerTemperature; + + /** + * 电机转速 + */ + private String motorSpeed; + + /** + * 电机转矩 + */ + private String motorTorque; + + /** + * 电机温度 + */ + private String motorTemperature; + + /** + * 电机电压 + */ + private String motorVoltage; + + /** + * 电机电流 + */ + private String motorCurrent; + + /** + * 动力电池剩余电量SOC + */ + private BigDecimal remainingBattery; + + + /** + * 当前状态允许的最大反馈功率 + */ + private String maximumFeedbackPower; + + /** + * 当前状态允许最大放电功率 + */ + private String maximumDischargePower; + + /** + * BMS自检计数器 + */ + private String selfCheckCounter; + + /** + * 动力电池充放电电流 + */ + private String totalBatteryCurrent; + + /** + * 动力电池负载端总电压V3 + */ + private String totalBatteryVoltage; + + /** + * 单次最大电压 + */ + private String singleBatteryMaxVoltage; + + /** + * 单体电池最低电压 + */ + private String singleBatteryMinVoltage; + + /** + * 单体电池最高温度 + */ + private String singleBatteryMaxTemperature; + + /** + * 单体电池最低温度 + */ + private String singleBatteryMinTemperature; + + /** + * 动力电池可用容量 + */ + private String availableBatteryCapacity; + + /** + * 车辆状态 + */ + private int vehicleStatus; + + /** + * 充电状态 + */ + private int chargingStatus; + + /** + * 运行状态 + */ + private int operatingStatus; + + /** + * SOC + */ + private int socStatus; + + /** + * 可充电储能装置工作状态 + */ + private int chargingEnergyStorageStatus; + + /** + * 驱动电机状态 + */ + private int driveMotorStatus; + + /** + * 定位是否有效 + */ + private int positionStatus; + + /** + * EAS(汽车防盗系统)状态 + */ + private int easStatus; + + /** + * PTC(电动加热器)状态 + */ + private int ptcStatus; + + /** + * EPS(电动助力系统)状态 + */ + private int epsStatus; + + /** + * ABS(防抱死)状态 + */ + private int absStatus; + + /** + * MCU(电机/逆变器)状态 + */ + private int mcuStatus; + + /** + * 动力电池加热状态 + */ + private int heatingStatus; + + /** + * 动力电池当前状态 + */ + private int batteryStatus; + + /** + * 动力电池保温状态 + */ + private int batteryInsulationStatus; + + + public static VehicleData getBuild(String messages) { + char start = messages.charAt(0); + char end = messages.charAt(messages.length() - 1); + System.out.println(start); + System.out.println(end); + return VehicleData.builder() + .vin(messages.substring(1, 18)) + //messages.substring(18, 31) + .createTime(new Date()) + .longitude(messages.substring(31, 42)) + .latitude(messages.substring(42, 52)) + .speed(messages.substring(52, 58)) + .mileage(new BigDecimal(messages.substring(58, 69))) + .voltage(messages.substring(69, 75)) + .current(messages.substring(75, 80)) + .resistance(messages.substring(80, 89)) + .gear(messages.substring(89, 90)) + .accelerationPedal(messages.substring(90, 92)) + .brakePedal(messages.substring(92, 94)) + .fuelConsumptionRate(messages.substring(94, 99)) + .motorControllerTemperature(messages.substring(99, 105)) + .motorSpeed(messages.substring(105, 110)) + .motorTorque(messages.substring(110, 114)) + .motorTemperature(messages.substring(114, 120)) + .motorVoltage(messages.substring(120, 125)) + .motorCurrent(messages.substring(125, 133)) + .remainingBattery(new BigDecimal(messages.substring(133, 139))) + .maximumFeedbackPower(messages.substring(139, 145)) + .maximumDischargePower(messages.substring(145, 151)) + .selfCheckCounter(messages.substring(151, 153)) + .totalBatteryCurrent(messages.substring(153, 158)) + .totalBatteryVoltage(messages.substring(158, 164)) + .singleBatteryMaxVoltage(messages.substring(164, 168)) + .singleBatteryMinVoltage(messages.substring(168, 172)) + .singleBatteryMaxTemperature(messages.substring(172, 178)) + .singleBatteryMinTemperature(messages.substring(178, 184)) + .availableBatteryCapacity(messages.substring(184, 190)) + .vehicleStatus(Integer.valueOf(messages.substring(190, 191))) + .chargingStatus(Integer.valueOf(messages.substring(191, 192))) + .operatingStatus(Integer.valueOf(messages.substring(192, 193))) + .socStatus(Integer.valueOf(messages.substring(193, 194))) + .chargingEnergyStorageStatus(Integer.valueOf(messages.substring(194, 195))) + .driveMotorStatus(Integer.valueOf(messages.substring(195, 196))) + .positionStatus(Integer.valueOf(messages.substring(196, 197))) + .easStatus(Integer.valueOf(messages.substring(197, 198))) + .ptcStatus(Integer.valueOf(messages.substring(198, 199))) + .epsStatus(Integer.valueOf(messages.substring(199, 200))) + .absStatus(Integer.valueOf(messages.substring(200, 201))) + .mcuStatus(Integer.valueOf(messages.substring(201, 202))) + .heatingStatus(Integer.valueOf(messages.substring(202, 203))) + .batteryStatus(Integer.valueOf(messages.substring(203, 204))) + .batteryInsulationStatus(Integer.valueOf(messages.substring(204, 205))) + .build(); + + } +} diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Wall.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Wall.java new file mode 100644 index 0000000..7e4baf0 --- /dev/null +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/Wall.java @@ -0,0 +1,47 @@ +package com.fivegroup.real.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 电子围栏信息 + * + * @author ZhangXushuo + * @version 2023/12/3 - 19:12 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class Wall { + /** + * 电子围栏id + */ + private Integer wallId; + /** + * 电子围栏名字 + */ + private String wallName; + /** + * 电子围栏时间 + */ + + private String wallData; + /** + * 电子围栏状态 + */ + + private Integer status; + /** + *行驶类型 + */ + + private Integer allarmType; + /** + * 电子围栏标签id + */ + private Integer wallTagId; + +} diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/response/ResponseCar.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/response/ResponseCar.java index b30ff4a..6690e0e 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/response/ResponseCar.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/domain/response/ResponseCar.java @@ -1,10 +1,14 @@ package com.fivegroup.real.domain.response; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; /** * 车辆系统响应 @@ -106,5 +110,80 @@ public class ResponseCar { @ApiModelProperty(name = "电池厂家名称") @TableField("battery_maker_name") private String batterymakerName; + /** + * 电子围栏id + */ + @ApiModelProperty(name = "电子围栏id") + @TableField("wall_id") + private Integer wallId; + /** + * 电子围栏名字 + */ + @ApiModelProperty(name = "电子围栏名字") + @TableField("wall_name") + private String wallName; + /** + * 电子围栏时间 + */ + @ApiModelProperty(name = "电子围栏时间") + @TableField("wall_data") + private String wallData; + /** + * 电子围栏状态 + */ + @ApiModelProperty(name = "电子围栏状态") + @TableField("status") + private Integer status; + /** + *行驶类型 + */ + @ApiModelProperty(name = "行驶类型") + @TableField("allarm_type") + private Integer allarmType; + /** + * 电子围栏标签id + */ + @ApiModelProperty(name = "电子围栏标签id") + @TableField("wall_tag_id") + private Integer wallTagId; + /** + * 电机厂家name + */ + @ApiModelProperty(name = "电机厂家name") + @TableField("motor_manufacturer_name") + private String motorManufacturerName; + /** + * 电池厂家 + */ + @ApiModelProperty(name = "电池厂家name") + @TableField("battery_maker_name") + private String batteryMakerName; + /** + * 公司名称 + */ + @TableField("firm_name") + private String firmName; + /** + * 公司管理员 + */ + @TableField("firm_admin") + private String firmAdmin; + /** + * 公司创建时间 + */ + @TableField("firm_time") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date firmTime; + /** + * 公司地址 + */ + @TableField("firm_home") + private String firmHome; + /** + * 公司vip等级 + */ + @TableField("firm_vip") + private Integer firmVip; } diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/mapper/RealMapper.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/mapper/RealMapper.java index dc972dd..ece940c 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/mapper/RealMapper.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/mapper/RealMapper.java @@ -3,9 +3,10 @@ package com.fivegroup.real.mapper; import com.fivegroup.common.core.domain.Result; import com.fivegroup.common.real.domain.Car; import com.fivegroup.real.domain.RequestVehicle; +import com.fivegroup.real.domain.VehicleData; +import com.fivegroup.real.domain.response.ResponseCar; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; - import java.util.List; /** @@ -18,21 +19,22 @@ public interface RealMapper { void deleteCar(Integer carId); - List carList(); List showCar(); - List list(); - - Result insertVehicle(RequestVehicle requestVehicle); - - Result insert(Car car); - + int insert(Car carId); int delete(@Param("carId") Integer carId); + List seeList(); + + + Result> ResponseCarList(); + + List vehicleList(); + } diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/RealService.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/RealService.java index d10cbbd..a5a70e4 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/RealService.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/RealService.java @@ -3,6 +3,8 @@ package com.fivegroup.real.service; import com.fivegroup.common.core.domain.Result; import com.fivegroup.common.real.domain.Car; import com.fivegroup.real.domain.RequestVehicle; +import com.fivegroup.real.domain.VehicleData; +import com.fivegroup.real.domain.response.ResponseCar; import java.util.List; @@ -13,25 +15,24 @@ import java.util.List; public interface RealService { void insertCar(Car car); - void updateCar(Car carId); - void deleteCar(Integer carId); - List carList(); - List showCar(); - List list(); - - Result insertVehicle(RequestVehicle requestVehicle); - - Result insert(Car car); - int delete(Integer carId); + List seeList(); + + Result> ResponseCarList(); + + int insert(Car carId); + + List vehicleList(); + + } diff --git a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/impl/RealServiceImpl.java b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/impl/RealServiceImpl.java index d03dc16..afd580b 100644 --- a/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/impl/RealServiceImpl.java +++ b/fivegroup-modules/fivegroup-real/src/main/java/com/fivegroup/real/service/impl/RealServiceImpl.java @@ -2,11 +2,15 @@ package com.fivegroup.real.service.impl; import com.fivegroup.common.core.domain.Result; import com.fivegroup.common.core.exception.ServiceException; +import com.fivegroup.common.log.annotation.Log; import com.fivegroup.common.real.domain.Car; import com.fivegroup.real.domain.RequestVehicle; +import com.fivegroup.real.domain.VehicleData; +import com.fivegroup.real.domain.response.ResponseCar; import com.fivegroup.real.mapper.RealMapper; import com.fivegroup.real.service.RealService; import lombok.extern.log4j.Log4j2; +import org.bouncycastle.cert.ocsp.jcajce.JcaRespID; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -18,6 +22,7 @@ import java.util.List; * @version 2023/11/24 - 21:21 */ @Service +@Log4j2 public class RealServiceImpl implements RealService { @Autowired private RealMapper realMapper; @@ -34,49 +39,51 @@ public class RealServiceImpl implements RealService { } } - @Override - public Result insert(Car car) { - Result result= realMapper.insert(car); - if(result!=null){ - return result; - }else { - return null; - } - } - @Override public int delete(Integer carId) { int i= realMapper.delete(carId); if(i!=0){ - System.out.println("删除失败"); + log.info("删除成功"); return 0; }else { - System.out.println("删除成功"); + log.info("删除成功"); return i; } } @Override - public List carList() { - List car= realMapper.carList(); + public List seeList() { + List car= realMapper.seeList(); return car; } + @Override + public Result> ResponseCarList() { + if(realMapper.ResponseCarList()==null){ + return realMapper.ResponseCarList(); + } + if(realMapper.ResponseCarList()!=null){ + return realMapper.ResponseCarList(); + } + return Result.success(); + } + + @Override + public int insert(Car carId) { + return 0; + } + + @Override + public List vehicleList() { + return realMapper.vehicleList(); + } + + @Override public List showCar() { return realMapper.showCar(); } - @Override - public List list() { - return realMapper.list(); - } -// @Override -// public void insertCar(Car car) { -// realMapper.insertCar(car); -// } - - @Override public void insertCar(Car car) { diff --git a/fivegroup-modules/fivegroup-real/src/main/resources/mapper/RealMapper.xml b/fivegroup-modules/fivegroup-real/src/main/resources/mapper/RealMapper.xml index 8a0bf1f..cfecaa7 100644 --- a/fivegroup-modules/fivegroup-real/src/main/resources/mapper/RealMapper.xml +++ b/fivegroup-modules/fivegroup-real/src/main/resources/mapper/RealMapper.xml @@ -6,6 +6,7 @@ + @@ -17,10 +18,10 @@ - insert into t_car ('car_id','car_code','car_vin', 'car_type_id', 'fence_id', 'car_status', 'battery_maker_id' + insert into t_car ('car_id','car_bh','car_vin', 'car_type_id', 'fence_id', 'car_status', 'battery_maker_id' ,'motor_manufacturer_id','motor_id', 'battery_id','actuate_id', 'operating_area','firm_id') values (#{carId}, - #{carCode}, + #{carBh}, #{carVin}, #{cartypeId}, #{fenceId}, @@ -44,7 +45,8 @@ update t_car - set car_vin =carVin, + set car_bh=carBh, + car_vin =carVin, car_type_id =cartypeId, fence_id =fenceId, car_status =carStatus, @@ -67,6 +69,7 @@ - + SELECT * FROM t_car t1 + LEFT JOIN t_car_type t2 ON t1.car_type_id = t2.car_type_id + LEFT JOIN t_wall t3 ON t1.wall_id = t3.wall_id + LEFT JOIN t_battery_maker t4 ON t1.battery_maker_id = t4.battery_maker_id + LEFT JOIN t_motor_manufacturer t5 ON t1.motor_manufacturer_id = t5.motor_manufacturer_id + LEFT JOIN t_firm t6 ON t1.firm_id = t6.firm_id + + + + diff --git a/fivegroup-modules/fivegroup-system/src/main/resources/bootstrap.yml b/fivegroup-modules/fivegroup-system/src/main/resources/bootstrap.yml index a05bfc3..7d74c84 100644 --- a/fivegroup-modules/fivegroup-system/src/main/resources/bootstrap.yml +++ b/fivegroup-modules/fivegroup-system/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9201 + port: 9220 # Spring spring: