From 97d5dac0a2d1f744ad94a53a6fc4433148c519ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=AC=A3=E6=82=A6?= <2289014031@qq.com> Date: Sat, 21 Sep 2024 12:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E7=AE=A1=E7=90=86/=E6=8A=A5?= =?UTF-8?q?=E6=96=87=E5=9F=BA=E7=A1=80=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloud-auth/src/main/resources/bootstrap.yml | 4 +- .../service/impl/ValidateCodeServiceImpl.java | 2 +- .../src/main/resources/bootstrap.yml | 4 +- cloud-modules/cloud-modules-car/pom.xml | 2 +- .../controller/CarInformationController.java | 111 +++++++++++ .../car/controller/CarMessageController.java | 53 ++++++ .../com/muyu/car/domain/CarInformation.java | 22 ++- .../java/com/muyu/car/domain/CarMessage.java | 84 +++++++++ .../car/domain/req/CarInformationUpdReq.java | 95 ++++++++++ .../muyu/car/mapper/CarInformationMapper.java | 64 +++++++ .../com/muyu/car/mapper/CarMessageMapper.java | 22 +++ .../car/service/CarInformationService.java | 64 +++++++ .../muyu/car/service/CarMessageService.java | 22 +++ .../Impl/CarInformationServiceImpl.java | 66 +++++++ .../service/Impl/CarMessageServiceImpl.java | 30 +++ .../src/main/resources/bootstrap.yml | 4 +- .../mapper/car/CarInformationMapper.xml | 177 ++++++++++++++++++ .../resources/mapper/car/CarMessageMapper.xml | 63 +++++++ .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- .../src/main/resources/bootstrap.yml | 4 +- 22 files changed, 886 insertions(+), 19 deletions(-) create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarInformationController.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarMessageController.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarMessage.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarInformationMapper.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarMessageMapper.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarInformationService.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarMessageService.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarInformationServiceImpl.java create mode 100644 cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarMessageServiceImpl.java create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarInformationMapper.xml create mode 100644 cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarMessageMapper.xml diff --git a/cloud-auth/src/main/resources/bootstrap.yml b/cloud-auth/src/main/resources/bootstrap.yml index 45285f9..b3c1ab8 100644 --- a/cloud-auth/src/main/resources/bootstrap.yml +++ b/cloud-auth/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # Spring spring: application: diff --git a/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java b/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java index 879d887..978a3b4 100644 --- a/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java +++ b/cloud-gateway/src/main/java/com/muyu/gateway/service/impl/ValidateCodeServiceImpl.java @@ -50,7 +50,7 @@ public class ValidateCodeServiceImpl implements ValidateCodeService { CaptchaCodeResp.CaptchaCodeRespBuilder respBuilder = CaptchaCodeResp.builder() .captchaEnabled(captchaEnabled); if (!captchaEnabled) { - return Result.success(respBuilder); + return Result.success(respBuilder.build()); } // 保存验证码信息 diff --git a/cloud-gateway/src/main/resources/bootstrap.yml b/cloud-gateway/src/main/resources/bootstrap.yml index f93e94c..7e843a9 100644 --- a/cloud-gateway/src/main/resources/bootstrap.yml +++ b/cloud-gateway/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # Spring spring: diff --git a/cloud-modules/cloud-modules-car/pom.xml b/cloud-modules/cloud-modules-car/pom.xml index 82c1282..c7be081 100644 --- a/cloud-modules/cloud-modules-car/pom.xml +++ b/cloud-modules/cloud-modules-car/pom.xml @@ -17,7 +17,6 @@ UTF-8 - @@ -109,4 +108,5 @@ + diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarInformationController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarInformationController.java new file mode 100644 index 0000000..783deb0 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarInformationController.java @@ -0,0 +1,111 @@ +package com.muyu.car.controller; + +import com.github.pagehelper.PageInfo; +import com.muyu.car.domain.CarInformation; +import com.muyu.car.domain.req.CarInformationAddReq; +import com.muyu.car.domain.req.CarInformationListReq; +import com.muyu.car.domain.req.CarInformationUpdReq; +import com.muyu.car.service.CarInformationService; +import com.muyu.common.core.domain.Result; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Controller; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.annotation.RequestScope; + +import javax.annotation.Resource; +import java.util.List; + + +@Log4j2 +@RestController +@RequestMapping("/carinformation") +@Tag(name = "车辆信息管理控制层" ,description = "进行车辆管理基础业务操作") +public class CarInformationController { + @Resource + private CarInformationService carInformationService; + + /** + * 企业车辆管理列表 + * 联查--> 车辆管理--车辆类型表--车辆电子围栏 + * 搜索-->(车辆唯一VIN carInformationVIN 精确查 + * 车辆类型ID carTypeId 精确查 + * 车辆电子围栏外键ID carInformationFence 精确查 + * 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中) + * carInformationState 精确查 + * 车辆电机厂商 carInformationMotorManufacturer 模糊查 + * 车辆电机型号 carInformationMotorModel 精确查 + * 车辆电池厂商 carInformationBatteryManufacturer 模糊查 + * 车辆电池型号 carInformationBatteryModel 精确查 + * ) + * 分页--> 分页页数 pageNum 分页条数 pageSize + * + * @param carInformationListReq + * @return + */ + @PostMapping("/selectCarInformationList") + @Operation(summary = "企业车辆管理列表") + public Result> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) { + PageInfo pageInfo = carInformationService.selectCarInformationList(carInformationListReq); + log.info("企业车辆管理列表查询",carInformationListReq,pageInfo); + return Result.success(pageInfo); + + } + + + /** + * 企业车辆添加管理 + * @param carInformationAddReq + * @return + */ + @PostMapping("/addCarInformation") + @Operation(summary = "企业车辆添加管理") + public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){ + return carInformationService.addCarInformation(carInformationAddReq); + } + + /** + * 企业车辆删除 + * @param carInformationId + * @return + */ + @GetMapping("/delBycarInformationId/{carInformationId}") + @Operation(summary = "企业车辆删除") + public Result delBycarInformationId(@Validated @PathVariable("carInformationId") Integer carInformationId){ + return carInformationService.delBycarInformationId(carInformationId); + } + + + /** + * 企业车辆修改管理 + * @param carInformationUpdReq + * @return + */ + @PostMapping("/updatecarInformation") + @Operation(summary = "企业车辆修改管理") + public Result updatecarInformation(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq) { + log.info(carInformationUpdReq); + return carInformationService.updatecarInformation(carInformationUpdReq); + } + + + + /** + * To 电子围栏负责人 + * 查询企业车辆 carInformationID 和 carInformationLicensePlate + * 无参 + * @return + */ + @GetMapping("/selectCarInformationIdAndLicensePlate") + @Operation(summary = "查询企业车辆 carInformationID 和 carInformationLicensePlate") + public Result> selectCarInformationIdAndLicensePlate(){ + List carInformations = carInformationService.selectBycarInformationIDAndLicensePlate(); + return Result.success(carInformations); + } + + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarMessageController.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarMessageController.java new file mode 100644 index 0000000..d13152d --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarMessageController.java @@ -0,0 +1,53 @@ +package com.muyu.car.controller; + +import com.muyu.car.domain.CarMessage; +import com.muyu.car.service.CarMessageService; +import com.muyu.common.core.domain.Result; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.log4j.Log4j2; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@Log4j2 +@RestController +@RequestMapping("/carMessage") +@Tag(name = "信息报文模块" ) +public class CarMessageController { + @Resource + private CarMessageService carMessageService; + /** + * 根据所属车类别 解析 车辆报文模板 + * @param + * @return + */ + @PostMapping("/selectCarMessageList") + @Operation(summary = "报文模板展示列表") + public Result> selectCarMessageList(){ + List carMessages = carMessageService.selectCarMessageList(); + return Result.success(carMessages); + } + + + /** + * 添加车辆报文规则 + */ + @PostMapping("/insertCarMessage") + @Operation(summary = "添加报文信息") + public Result insertCarMessage(@Validated @RequestBody CarMessage carMessage){ + Result carMessage1 = carMessageService.insertCarMessage(carMessage); + return Result.success(carMessage); + } + + + + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarInformation.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarInformation.java index b392c33..2427db7 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarInformation.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarInformation.java @@ -9,25 +9,29 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + @Data @AllArgsConstructor @NoArgsConstructor @SuperBuilder -@TableName(value = "carinformation",autoResultMap = true) +@TableName(value = "企业车辆管理实体类",autoResultMap = true) public class CarInformation { /** * 车辆ID */ - private Integer carInformationId; + private Long carInformationId; /** * 车辆唯一VIN + * 固定(不可修改) */ private String carInformationVIN; /** * 车牌号 + * 固定(不可修改) */ private String carInformationLicensePlate; @@ -48,10 +52,11 @@ public class CarInformation { /** * 车检到期日期 + * 固定(不可修改) */ @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") - private String carInformationExamineEnddata; + private Date carInformationExamineEnddata; /** * 车辆电机厂商 @@ -104,4 +109,15 @@ public class CarInformation { */ private String carTypeName; + //电子围栏 + /** + *电子围栏ID + */ + private Integer fenceid; + + /** + * 电子围栏名 + */ + private String fencename; + } diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarMessage.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarMessage.java new file mode 100644 index 0000000..551156d --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarMessage.java @@ -0,0 +1,84 @@ +package com.muyu.car.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.models.security.SecurityScheme; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@TableName(value = "车辆报文模板实体类",autoResultMap = true) +public class CarMessage { + //报文类型模块表 + /** + * 自增主键 + */ + private Long messageTypeId; + /** + * 报文编码 + */ + private String messageTypeCode; + /** + * 报文名称 + */ + private String messageTypeName; + /** + * 报文所属类别 + */ + private String messageTypeBelongs; + + //报文拆分位置主表 + /** + * 自增主键 + */ + private Long carMessageId; + /** + * 车辆类型外键 + */ + private Integer carMessageCartype; + /** + * 车辆报文类型外键 + */ + private Integer carMessageType; + /** + * 开始位下标 + */ + private Integer carMessageStartIndex; + /** + * 结束位下标 + */ + private Integer carMessageEndIndex; + /** + * 报文数据类型 (固定值 区间随机值) + */ + private String messageTypeClass; + /** + * 报文是否开启故障检测(0默认未开启 1开启) + */ + private Integer carMessageState; + + + +/* + private Long messageTypeId ; + private String messageTypeCode ; + private String messageTypeName ; + private String messageTypeBelongs ; + private String messageTypeClass ; + private Long carMessageId ; + private Integer carMessageCartype ; + private Integer carMessageType ; + private Integer carMessageStartIndex ; + private Integer carMessageEndIndex ; + private Integer carMessageState ; + */ + + + + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/req/CarInformationUpdReq.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/req/CarInformationUpdReq.java index 19284e9..e846045 100644 --- a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/req/CarInformationUpdReq.java +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/req/CarInformationUpdReq.java @@ -1,4 +1,99 @@ package com.muyu.car.domain.req; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@SuperBuilder +@Tag(name = "车辆管理修改操作请求对象") public class CarInformationUpdReq { + + /** + * 车辆ID + */ + @Schema(title = "车辆管理主键", type = "Long") + private Long carInformationId; + + /** + * 车辆品牌 + */ + @Schema(title = "车辆品牌", type = "String") + private String carInformationBrand; + + /** + * 车辆颜色 + */ + @Schema(title = "车辆颜色", type = "String") + private String carInformationColor; + + /** + * 车辆驾驶员 + */ + @Schema(title = "车辆驾驶员", type = "String") + private String carInformationDriver; + /** + * 车辆电机厂商 + */ + @Schema(title = "车辆电机厂商", type = "String") + private String carInformationMotorManufacturer; + + /** + * 车辆电机型号 + */ + @Schema(title = "车辆电机型号", type = "String") + private String carInformationMotorModel; + + /** + * 车辆电池厂商 + */ + @Schema(title = "车辆电池厂商", type = "String") + private String carInformationBatteryManufacturer; + + /** + * 车辆电池型号 + */ + @Schema(title = "车辆电池型号", type = "String") + private String carInformationBatteryModel; + + /** + * 车辆电子围栏外键ID + */ + @Schema(title = "车辆电子围栏外键ID", type = "Integer") + private Integer carInformationFence; + + /** + * 车辆类型外键ID + */ + @Schema(title = "车辆类型外键ID", type = "Integer") + private Integer carInformationType; + + /** + * 是否重点车辆 (0否默认 1是 ) + */ + @Schema(title = "是否重点车辆 (0否默认 1是 )", type = "Integer") + private Integer carInformationFocus; + + /** + * 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中) + */ + @Schema(title = "启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)", type = "Integer") + private Integer carInformationState; + + + + + + + + + + + + } diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarInformationMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarInformationMapper.java new file mode 100644 index 0000000..9206aa9 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarInformationMapper.java @@ -0,0 +1,64 @@ +package com.muyu.car.mapper; + + +import com.muyu.car.domain.CarInformation; +import com.muyu.car.domain.req.CarInformationAddReq; +import com.muyu.car.domain.req.CarInformationListReq; +import com.muyu.car.domain.req.CarInformationUpdReq; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface CarInformationMapper { +/** + * 企业车辆管理列表 + * 联查--> 车辆管理--车辆类型表--车辆电子围栏 + * 搜索-->(车辆唯一VIN carInformationVIN 精确查 + * 车辆类型ID carTypeId 精确查 + * 车辆电子围栏外键ID carInformationFence 精确查 + * 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中) + * carInformationState 精确查 + * 车辆电机厂商 carInformationMotorManufacturer 模糊查 + * 车辆电机型号 carInformationMotorModel 精确查 + * 车辆电池厂商 carInformationBatteryManufacturer 模糊查 + * 车辆电池型号 carInformationBatteryModel 精确查 + * ) + * 分页--> 分页页数 pageNum 分页条数 pageSize + * @param carInformationListReq + * @return + */ + List selectCarInformationList(CarInformationListReq carInformationListReq); + +/** + * 企业车辆添加管理 + * @param carInformationAddReq + * @return + */ + Integer addCarInformation(CarInformationAddReq carInformationAddReq); + +/** + * 企业车辆删除 + * @param carInformationId + * @return + */ + Integer delBycarInformationId(Integer carInformationId); + + +/** + * 企业车辆修改管理 + * @param carInformationUpdReq + * @return + */ + Integer updatecarInformation(CarInformationUpdReq carInformationUpdReq); + +/** + * To 电子围栏负责人 + * 查询企业车辆 carInformationID 和 carInformationLicensePlate + * 无参 + * @return + */ + List selectBycarInformationIDAndLicensePlate(); + + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarMessageMapper.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarMessageMapper.java new file mode 100644 index 0000000..4042eea --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarMessageMapper.java @@ -0,0 +1,22 @@ +package com.muyu.car.mapper; + +import com.muyu.car.domain.CarMessage; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface CarMessageMapper { + /** + * 根据所属车类别 解析 车辆报文模板 + * @param + * @return + */ + List selectCarMessageList(); + + + /** + * 添加车辆报文规则 + */ + Integer insertCarMessage(CarMessage carMessage); +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarInformationService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarInformationService.java new file mode 100644 index 0000000..62e733b --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarInformationService.java @@ -0,0 +1,64 @@ +package com.muyu.car.service; + +import com.github.pagehelper.PageInfo; +import com.muyu.car.domain.CarInformation; +import com.muyu.car.domain.req.CarInformationAddReq; +import com.muyu.car.domain.req.CarInformationListReq; +import com.muyu.car.domain.req.CarInformationUpdReq; +import com.muyu.common.core.domain.Result; + +import java.util.List; + +public interface CarInformationService { + /** + * 企业车辆管理列表 + * 联查--> 车辆管理--车辆类型表--车辆电子围栏 + * 搜索-->(车辆唯一VIN carInformationVIN 精确查 + * 车辆类型ID carTypeId 精确查 + * 车辆电子围栏外键ID carInformationFence 精确查 + * 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中) + * carInformationState 精确查 + * 车辆电机厂商 carInformationMotorManufacturer 模糊查 + * 车辆电机型号 carInformationMotorModel 精确查 + * 车辆电池厂商 carInformationBatteryManufacturer 模糊查 + * 车辆电池型号 carInformationBatteryModel 精确查 + * ) + * 分页--> 分页页数 pageNum 分页条数 pageSize + * @param carInformationListReq + * @return + */ + PageInfo selectCarInformationList(CarInformationListReq carInformationListReq); + + + /** + * 企业车辆添加管理 + * @param carInformationAddReq + * @return + */ + Result addCarInformation(CarInformationAddReq carInformationAddReq); + + /** + * 企业车辆删除 + * @param carInformationId + * @return + */ + Result delBycarInformationId(Integer carInformationId); + + + /** + * 企业车辆修改管理 + * @param carInformationUpdReq + * @return + */ + Result updatecarInformation(CarInformationUpdReq carInformationUpdReq); + + + /** + * To 电子围栏负责人 + * 查询企业车辆 carInformationID 和 carInformationLicensePlate + * 无参 + * @return + */ + List selectBycarInformationIDAndLicensePlate(); + +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarMessageService.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarMessageService.java new file mode 100644 index 0000000..e5a7e56 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarMessageService.java @@ -0,0 +1,22 @@ +package com.muyu.car.service; + +import com.muyu.car.domain.CarMessage; +import com.muyu.common.core.domain.Result; + +import java.util.List; + +public interface CarMessageService { + + /** + * 根据所属车类别 解析 车辆报文模板 + * @param + * @return + */ + List selectCarMessageList(); + + + /** + * 添加车辆报文规则 + */ + Result insertCarMessage(CarMessage carMessage); +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarInformationServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarInformationServiceImpl.java new file mode 100644 index 0000000..053884d --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarInformationServiceImpl.java @@ -0,0 +1,66 @@ +package com.muyu.car.service.Impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.muyu.car.domain.CarInformation; +import com.muyu.car.domain.req.CarInformationAddReq; +import com.muyu.car.domain.req.CarInformationListReq; +import com.muyu.car.domain.req.CarInformationUpdReq; +import com.muyu.car.mapper.CarInformationMapper; +import com.muyu.car.service.CarInformationService; +import com.muyu.common.core.domain.Result; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class CarInformationServiceImpl implements CarInformationService { + @Resource + private CarInformationMapper carInformationMapper; + @Autowired + private HttpServletResponse response; + + + @Override + public PageInfo selectCarInformationList(CarInformationListReq carInformationListReq) { + PageHelper.startPage(carInformationListReq.getPageNum(),carInformationListReq.getPageSize()); + List carInformations = carInformationMapper.selectCarInformationList(carInformationListReq); + PageInfo pageInfo = new PageInfo<>(carInformations); + return pageInfo; + } + + @Override + public Result addCarInformation(CarInformationAddReq carInformationAddReq) { + Integer addCarInformation = carInformationMapper.addCarInformation(carInformationAddReq); + if(addCarInformation > 0){ + return Result.success(addCarInformation,"添加车辆成功"); + } + return Result.error(402,"添加车辆失败"); + } + + @Override + public Result delBycarInformationId(Integer carInformationId) { + Integer delBycarInformationId = carInformationMapper.delBycarInformationId(carInformationId); + if (delBycarInformationId > 0){ + return Result.success(delBycarInformationId ,"删除车辆成功"); + } + return Result.success(402,"删除车辆失败"); + } + + @Override + public Result updatecarInformation(CarInformationUpdReq carInformationUpdReq) { + Integer updatecarInformation = carInformationMapper.updatecarInformation(carInformationUpdReq); + if (updatecarInformation > 0){ + return Result.success(updatecarInformation,"修改车辆信息成功"); + } + return Result.error(402,"修改车辆信息失败"); + } + + @Override + public List selectBycarInformationIDAndLicensePlate() { + return carInformationMapper.selectBycarInformationIDAndLicensePlate(); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarMessageServiceImpl.java b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarMessageServiceImpl.java new file mode 100644 index 0000000..a5d9356 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarMessageServiceImpl.java @@ -0,0 +1,30 @@ +package com.muyu.car.service.Impl; + +import com.muyu.car.domain.CarMessage; +import com.muyu.car.mapper.CarMessageMapper; +import com.muyu.car.service.CarMessageService; +import com.muyu.common.core.domain.Result; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class CarMessageServiceImpl implements CarMessageService { + @Resource + private CarMessageMapper carMessageMapper; + + @Override + public List selectCarMessageList() { + return carMessageMapper.selectCarMessageList(); + } + + @Override + public Result insertCarMessage(CarMessage carMessage) { + Integer inserted = carMessageMapper.insertCarMessage(carMessage); + if (inserted > 0){ + return Result.success(inserted,"添加成功"); + } + return Result.error(402,"添加失败"); + } +} diff --git a/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml index 34b5d26..c66ccae 100644 --- a/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml +++ b/cloud-modules/cloud-modules-car/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all # Spring spring: diff --git a/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarInformationMapper.xml b/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarInformationMapper.xml new file mode 100644 index 0000000..1325b02 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarInformationMapper.xml @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + car_information_id, + car_information_VIN, + car_information_license_plate, + car_information_brand, + car_information_color, + car_information_driver, + car_information_examine_enddata, + car_information_motor_manufacturer, + car_information_motor_model, + car_information_battery_manufacturer, + car_information_battery_model, + car_information_fence, + car_information_type, + car_information_focus, + car_information_state + FROM `car_information` + + + + + + + + + INSERT INTO `car_information` + ( + car_information_VIN, + car_information_license_plate, + car_information_brand, + car_information_color, + car_information_driver, + car_information_examine_enddata, + car_information_motor_manufacturer, + car_information_motor_model, + car_information_battery_manufacturer, + car_information_battery_model, + car_information_fence, + car_information_type ) + VALUES ( + #{carInformationVIN}, + #{carInformationLicensePlate}, + #{carInformationBrand} , + #{carInformationColor}, + #{carInformationDriver}, + #{carInformationExamineEnddata}, + #{carInformationMotorManufacturer}, + #{carInformationMotorModel}, + #{carInformationBatteryManufacturer}, + #{carInformationBatteryModel}, + #{carInformationFence}, + #{carInformationType} ); + + + + UPDATE `car_information` + SET + `car_information_VIN` = #{carInformationVIN}, + + `car_information_license_plate` = #{carInformationLicensePlate}, + + `car_information_brand` = #{carInformationBrand}, + + `car_information_color` = #{carInformationColor}, + + `car_information_driver` = #{carInformationDriver}, + + `car_information_examine_enddata` = #{carInformationExamineEnddata}, + + `car_information_motor_manufacturer` = #{carInformationMotorManufacturer}, + + `car_information_motor_model` = #{carInformationMotorModel} , + + `car_information_battery_manufacturer` = #{carInformationBatteryManufacturer}, + + `car_information_battery_model` = #{carInformationBatteryModel}, + + `car_information_fence` = #{carInformationFence}, + + `car_information_type` = #{carInformationType} + + WHERE `car_information_id` = #{carInformationId} + + + + + DELETE FROM `car_information` + WHERE `car_information`.car_information_id= #{carInformationId} + + + + + + + diff --git a/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarMessageMapper.xml b/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarMessageMapper.xml new file mode 100644 index 0000000..2b81290 --- /dev/null +++ b/cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarMessageMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + INSERT INTO `car_message` ( + car_message_cartype, + car_message_type, + car_message_start_index, + car_message_end_index, + message_type_class, + car_message_state + ) + VALUES( + #{carMessageCartype}, + #{carMessageType}, + #{carMessageStartIndex}, + #{carMessageEndIndex}, + #{messageTypeClass}, + #{carMessageState} + ) + + + + diff --git a/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml index 5f9488f..b7db4c1 100644 --- a/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml +++ b/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # Spring spring: diff --git a/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml index 827aa50..3bfd19c 100644 --- a/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml +++ b/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # Spring spring: diff --git a/cloud-modules/cloud-modules-system/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-system/src/main/resources/bootstrap.yml index 64069d7..2576c29 100644 --- a/cloud-modules/cloud-modules-system/src/main/resources/bootstrap.yml +++ b/cloud-modules/cloud-modules-system/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all # Spring spring: diff --git a/cloud-visual/cloud-visual-monitor/src/main/resources/bootstrap.yml b/cloud-visual/cloud-visual-monitor/src/main/resources/bootstrap.yml index 175626d..5fca758 100644 --- a/cloud-visual/cloud-visual-monitor/src/main/resources/bootstrap.yml +++ b/cloud-visual/cloud-visual-monitor/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: # nacos线上地址 nacos: - addr: 47.116.173.119:8848 + addr: 159.75.188.178:8848 user-name: nacos password: nacos - namespace: eight + namespace: xxy # Spring spring: