1.优化代码格式

2.swagger文档
更新时间09282021
dev.eventProcess
微醺 2024-09-28 20:21:08 +08:00
parent 411a454c1b
commit 26d3ffda93
44 changed files with 904 additions and 501 deletions

View File

@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* --
* @ClassName CarCompany
* @Description
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@TableName(value = "t_company") @TableName(value = "car_company")
@Tag(name = "企业表")
public class CarCompany { public class CarCompany {
/** /**
* *

View File

@ -0,0 +1,48 @@
package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* --
* @ClassName CarConfig
* @Description
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Tag(name = "车辆配置表")
@TableName(value = "car_config")
public class CarConfig {
/**
*
*/
@TableId(value = "config_id",type = IdType.AUTO)
private Long configId;
/**
* 1. 2. 3.
*/
private String configName;
/**
*
*/
private String energyType;
/**
* 1. 2.
*/
private Integer gearType;
/**
* id
*/
private Integer companyId;
}

View File

@ -0,0 +1,114 @@
package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* --
* @ClassName CarManage
* @Description
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Tag(name = "车辆表")
@Builder
@TableName(value = "car_manage",autoResultMap = true)
public class CarManage {
/**
*
*/
@TableId(value = "car_id",type = IdType.AUTO)
private Long carId;
/**
*
*/
private String carFrame;
/**
*
*/
private String carCode;
/**
* 1. 2.绿 3. 4. 5.
*/
private Integer carColor;
/**
* VIN
*/
private String carVin;
/**
*
*/
private long userId;
/**
*
*/
private long configId;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date audditTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date licenseTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date insuranceTime;
/**
* 线 1. 2. 3.
*/
private Integer carStayus;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
private Integer carGears;
/**
*
*/
private String carModel;
/**
*
*/
private String cardDrand;
/** 最后一次连线时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date carLastJoinTime;
/** 最后一次离线时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date carLastOfflineTime;
/**
* id
*/
private Long companyId;
/**
* 1.轿 2. 3. 4. 5. 6.
*/
private Integer carType;
}

View File

@ -1,5 +1,7 @@
package com.muyu.enterprise.domain; package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -8,22 +10,24 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* --
* @ClassName CarMessage * @ClassName CarMessage
* @Description * @Description
* @Author YiBo.Liu * @author MingWei.Zong
* @Date 2024/9/22 22:24 * @Date 2024/9/28 16:52
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
@Tag(name = "报文表") @Tag(name = "报文表")
@TableName(value = "t_car_message") @TableName(value = "car_message")
public class CarMessage { public class CarMessage {
/** /**
* *
*/ */
@TableId(value = "message_id" ,type = IdType.AUTO)
private Long messageId; private Long messageId;
/** /**
* *

View File

@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* --
* @ClassName CarMessageType
* @Description
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@TableName(value = "t_message_type") @TableName(value = "car_message_type")
@Tag(name = "报文类型表")
public class CarMessageType { public class CarMessageType {
/** /**
* *

View File

@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
* --
* @ClassName CarTemplate
* @Description
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@TableName(value = "t_template") @TableName(value = "car_template")
@Tag(name = "报文模版表")
public class CarTemplate { public class CarTemplate {
/** /**

View File

@ -1,5 +1,7 @@
package com.muyu.enterprise.domain; package com.muyu.enterprise.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -8,22 +10,24 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* --
* @ClassName CarType * @ClassName CarType
* @Description * @Description
* @Author YiBo.Liu * @author YiBo.Liu
* @Date 2024/9/22 16:53 * @Date 2024/9/28 16:52
*/ */
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder @Builder
@Tag(name = "车辆类型表") @Tag(name = "车辆类型表")
@TableName(value = "t_car_type") @TableName(value = "car_type")
public class CarType { public class CarType {
/** /**
* id * id
*/ */
@TableId(value = "car_type_id",type = IdType.AUTO)
private Integer carTypeId; private Integer carTypeId;
/** /**

View File

@ -82,6 +82,13 @@
<groupId>com.muyu</groupId> <groupId>com.muyu</groupId>
<artifactId>cloud-modules-enterprise-common</artifactId> <artifactId>cloud-modules-enterprise-common</artifactId>
</dependency> </dependency>
<!-- MyBatisPlus - 依赖包 -->
<dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join</artifactId>
<version>1.4.13</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,44 @@
package com.muyu.enterprise.controller;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* --
* @ClassName CarCompanyController
* @Description Controller
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@RestController
@RequestMapping("/company")
@Tag(name = "CarCompanyController", description = "企业表")
public class CarCompanyController extends BaseController {
@Autowired
private CarCompanyService sysCarCompanyService;
/**
*
*/
@PostMapping("selectCompany")
public Result<List<CarCompany>> selectCompany(){
return Result.success(sysCarCompanyService.list());
}
/**
* ID
*/
@PostMapping("selectCompanyByCompanyId")
public Result<CarCompany> selectCompanyByCompanyId(@RequestParam("companyId") Long companyId){
return Result.success(sysCarCompanyService.getById(companyId));
}
}

View File

@ -1,10 +1,13 @@
package com.muyu.enterprise.controller; package com.muyu.enterprise.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.enterprise.domain.CarManage;
import com.muyu.enterprise.domain.dto.CarDTO; import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO; import com.muyu.enterprise.domain.vo.CarVO;
import com.muyu.enterprise.service.SysCarCompanyService; import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.enterprise.service.SysCarService; import com.muyu.enterprise.service.CarManageService;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
@ -17,19 +20,22 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* * --
* * @ClassName CarManageController
* @author muyu * @Description Controller
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/ */
@RestController @RestController
@RequestMapping("/manage") @RequestMapping("/carManage")
@Tag(name = "SysCarController", description = "系统参数配置") @Tag(name = "CarManageController", description = "车辆管理")
public class SysCarController extends BaseController { public class CarManageController extends BaseController {
@Autowired @Autowired
private SysCarCompanyService sysCarCompanyService; private CarCompanyService sysCarCompanyService;
@Autowired @Autowired
private SysCarService sysCarService; private CarManageService sysCarService;
/** /**
* 2 * 2
@ -37,7 +43,7 @@ public class SysCarController extends BaseController {
* @return * @return
*/ */
@PostMapping("CarListShow") @PostMapping("CarListShow")
public Result<List<CarVO>> CarListShow(@RequestBody CarDTO carDTO){ public Result<List<CarManage>> CarListShow(@RequestBody CarDTO carDTO){
return Result.success(sysCarService.CarListShow(carDTO)); return Result.success(sysCarService.CarListShow(carDTO));
} }
@ -46,22 +52,22 @@ public class SysCarController extends BaseController {
* @param carId * @param carId
* @return * @return
*/ */
@PostMapping("CarListShowByCarId") @PostMapping("CarManageShowByCarId")
public Result<List<CarVO>> CarListShowByCarId(@RequestParam("carId") Long carId){ public Result CarManageShowByCarId(@RequestParam("carId") Long carId){
return Result.success(sysCarService.CarListShowByCarId(carId)); return Result.success(sysCarService.getById(carId));
} }
/** // /**
* 1 // * 车辆列表1
* @param carVO // * @param carVO
* @return // * @return
*/ // */
@PostMapping("CarList") // @PostMapping("CarList")
@Operation(summary = "查询列表",description = "车辆管理列表") // @Operation(summary = "查询列表",description = "车辆管理列表")
public Result<TableDataInfo<CarVO>> CarList(@RequestBody CarVO carVO){ // public Result<TableDataInfo<CarManage>> CarList(@RequestBody CarVO carVO){
startPage(); // startPage();
return getDataTable(sysCarService.carList(carVO)); // return getDataTable(sysCarService.carList(carVO));
} // }
/** /**
@ -70,14 +76,14 @@ public class SysCarController extends BaseController {
* @return * @return
*/ */
@PostMapping("insertCar") @PostMapping("insertCar")
public Result insertCar(@RequestBody CarVO carVO){ public Result insertCar(@RequestBody CarManage carVO){
String key = RandomUtil.randomNumbers(9); String key = RandomUtil.randomNumbers(9);
// 随机生成车架号 // 随机生成车架号
carVO.setCarFrame(key); carVO.setCarFrame(key);
// 随机生成VIN码 // 随机生成VIN码
String key2 = RandomUtil.randomNumbers(17); String key2 = RandomUtil.randomNumbers(17);
carVO.setCarVin(key2); carVO.setCarVin(key2);
sysCarService.insertCar(carVO); sysCarService.save(carVO);
return Result.success("车辆添加成功"); return Result.success("车辆添加成功");
} }
@ -88,7 +94,7 @@ public class SysCarController extends BaseController {
* @return * @return
*/ */
@PostMapping("updataCar") @PostMapping("updataCar")
public Result updataCar(@RequestBody CarVO carVO){ public Result updataCar(@RequestBody CarManage carVO){
// //
carVO.setUserId(SecurityUtils.getUserId()); carVO.setUserId(SecurityUtils.getUserId());
sysCarService.updateById(carVO); sysCarService.updateById(carVO);
@ -102,7 +108,7 @@ public class SysCarController extends BaseController {
*/ */
@PostMapping("deleteCar") @PostMapping("deleteCar")
public Result deleteCar(@RequestParam("ids") List<Long> ids){ public Result deleteCar(@RequestParam("ids") List<Long> ids){
sysCarService.deleteCar(ids); sysCarService.removeBatchByIds(ids);
return Result.success("车辆删除成功"); return Result.success("车辆删除成功");
} }

View File

@ -2,28 +2,37 @@ package com.muyu.enterprise.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.enterprise.domain.CarMessage; import com.muyu.enterprise.domain.CarMessage;
import com.muyu.enterprise.service.CarMessageService; import com.muyu.enterprise.service.CarMessageService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
/** /**
* * --
* @ClassName CarMessageController * @ClassName carMessageController
* @Description * @Description Controller
* @Author YiBo.Liu * @author MingWei.Zong
* @Date 2024/9/22 22:28 * @Date 2024/9/28 16:52
*/ */
@RestController @RestController
@RequestMapping("/carMessage") @RequestMapping("/carMessage")
public class CarMessageController { @Tag(name = "报文",description = "报文模块")
public class CarMessageController extends BaseController {
@Autowired @Autowired
private CarMessageService carMessageService; private CarMessageService sysCarMessageService;
/**
*
* @return
*/
@PostMapping("selectMessageShow")
public List<CarMessage> selectMessageShow(@RequestParam("templateId") Long templateId){
return sysCarMessageService.selectMessageShow(templateId);
}
/** /**
* id * id
@ -32,8 +41,46 @@ public class CarMessageController {
*/ */
@GetMapping("/selectByTemplateId") @GetMapping("/selectByTemplateId")
private Result<List<CarMessage>> selectByTemplateId(@RequestParam("templateId") Integer templateId) { private Result<List<CarMessage>> selectByTemplateId(@RequestParam("templateId") Integer templateId) {
return Result.success(carMessageService.list return Result.success(sysCarMessageService.list
(new LambdaQueryWrapper<CarMessage>().eq(CarMessage::getTemplateId, templateId))); (new LambdaQueryWrapper<CarMessage>().eq(CarMessage::getTemplateId, templateId)));
} }
/**
* id
* @return
*/
@PostMapping("selectMessageByMessageId")
public CarMessage selectMessageByMessageId(@RequestParam("messageId") Long messageId){
return sysCarMessageService.selectMessageByMessageId(messageId);
}
/**
*
* @return carMessage
*/
@PostMapping("insertMessage")
public Result insertMessage(@RequestBody CarMessage carMessage){
sysCarMessageService.save(carMessage);
return Result.success("添加成功");
}
/**
*
* @return carMessage
*/
@PostMapping("updataMessage")
public Result updataMessage(@RequestBody CarMessage carMessage){
sysCarMessageService.updateById(carMessage);
return Result.success("修改成功");
}
/**
*
* @return carMessage
*/
@PostMapping("deleteMessage")
public Result deleteMessage(@RequestParam("ids") List<Long> ids){
sysCarMessageService.removeBatchByIds(ids);
return Result.success("删除成功");
}
} }

View File

@ -0,0 +1,91 @@
package com.muyu.enterprise.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.enterprise.domain.CarMessageType;
import com.muyu.enterprise.service.CarMessageTypeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* --
* @ClassName CarMessageTypeController
* @Description Controller
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@RestController
@RequestMapping("carMessageType")
@Tag(name = "报文类型" ,description = "报文类型")
public class CarMessageTypeController extends BaseController {
@Autowired
private CarMessageTypeService sysCarMessageTypeService;
/**
*
* @return
*/
@PostMapping("messageTypeList")
public Result messageTypeList(){
sysCarMessageTypeService.messageTypeList();
List<CarMessageType> list = sysCarMessageTypeService.list();
return Result.success(list);
}
@PostMapping("inserMessageType")
public Result inserMessageType(@RequestBody CarMessageType carMessageType){
/** id 检验 */
if(carMessageType.getMessageTypeId()>0){
return Result.error("添加要什么id");
}
/** token 检验 */
if(SecurityUtils.getToken().isEmpty()){
return Result.error("token不为空");
}
/** 报文类型 */
if(StringUtils.isEmpty(carMessageType.getMessageType())){
return Result.error("报文类型不能为空");
}
/** 报文 */
if(StringUtils.isEmpty(carMessageType.getMessageName())){
return Result.error("报文不能为空");
}
/** 报文编码 */
if(StringUtils.isEmpty(carMessageType.getMessageCode())){
return Result.error("报文编码不能为空");
}
/** 报文字段类型 */
if(StringUtils.isEmpty(carMessageType.getMessageClass())){
return Result.error("报文字段类型不能为空");
}
sysCarMessageTypeService.save(carMessageType);
return Result.success("添加成功");
}
/**
*
* @param carMessageType
* @return
*/
@PostMapping("updateMessageType")
public Result updateMessageType(@RequestBody CarMessageType carMessageType){
/** id */
if(carMessageType.getMessageTypeId() < 0 ){
return Result.error("修改需要id");
}
/** 报文编号 */
if(StringUtils.isEmpty(carMessageType.getMessageCode())){
return Result.error("");
}
sysCarMessageTypeService.updateById(carMessageType);
return Result.success("修改成功");
}
}

View File

@ -1,7 +1,7 @@
package com.muyu.enterprise.controller; package com.muyu.enterprise.controller;
import com.muyu.enterprise.domain.CarTemplate; import com.muyu.enterprise.domain.CarTemplate;
import com.muyu.enterprise.service.SysCarTemplateService; import com.muyu.enterprise.service.CarTemplateService;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController; import com.muyu.common.core.web.controller.BaseController;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -9,13 +9,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/**
* --
* @ClassName CarTemplateController
* @Description Controller
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@RestController @RestController
@RequestMapping("/template") // 报文 @RequestMapping("/carTemplate") // 报文模版
@Tag(name = "模版模块",description = "报文模版模块") @Tag(name = "模版模块",description = "报文模版模块")
public class SysCarTemplateController extends BaseController { public class CarTemplateController extends BaseController {
@Autowired @Autowired
private SysCarTemplateService sysCarTemplateService; private CarTemplateService sysCarTemplateService;
/** /**
* *

View File

@ -3,6 +3,7 @@ package com.muyu.enterprise.controller;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.enterprise.domain.CarType; import com.muyu.enterprise.domain.CarType;
import com.muyu.enterprise.service.CarTypeService; import com.muyu.enterprise.service.CarTypeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -16,6 +17,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequestMapping("/carType") @RequestMapping("/carType")
@Tag(name = "CarTypeController",description = "车辆类型")
public class CarTypeController { public class CarTypeController {
@Autowired @Autowired

View File

@ -1,31 +0,0 @@
package com.muyu.enterprise.controller;
import com.muyu.enterprise.service.SysCarCompanyService;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
*
* @author muyu
*/
@RestController
@RequestMapping("/company")
@Tag(name = "SysCarCompanyController", description = "系统参数配置")
public class SysCarCompanyController extends BaseController {
@Autowired
private SysCarCompanyService sysCarCompanyService;
/**
*
*/
@PostMapping("selectCompany")
public Result selectCompany(){
return Result.success(sysCarCompanyService.list());
}
}

View File

@ -1,66 +0,0 @@
package com.muyu.enterprise.controller;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.enterprise.domain.CarMessage;
import com.muyu.enterprise.service.SysCarMessageService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/car-message")
@Tag(name = "报文",description = "报文模块")
public class SysCarMessageController extends BaseController {
@Autowired
private SysCarMessageService sysCarMessageService;
/**
*
* @return
*/
@PostMapping("selectMessageShow")
public List<CarMessage> selectMessageShow(@RequestParam("templateId") Long templateId){
return sysCarMessageService.selectMessageShow(templateId);
}
/**
* id
* @return
*/
@PostMapping("selectMessageByMessageId")
public CarMessage selectMessageByMessageId(@RequestParam("messageId") Long messageId){
return sysCarMessageService.selectMessageByMessageId(messageId);
}
/**
*
* @return carMessage
*/
@PostMapping("insertMessage")
public Result insertMessage(@RequestBody CarMessage carMessage){
sysCarMessageService.save(carMessage);
return Result.success("添加成功");
}
/**
*
* @return carMessage
*/
@PostMapping("updataMessage")
public Result updataMessage(@RequestBody CarMessage carMessage){
sysCarMessageService.updateById(carMessage);
return Result.success("修改成功");
}
/**
*
* @return carMessage
*/
@PostMapping("deleteMessage")
public Result deleteMessage(@RequestParam("ids") List<Long> ids){
sysCarMessageService.removeBatchByIds(ids);
return Result.success("删除成功");
}
}

View File

@ -0,0 +1,16 @@
package com.muyu.enterprise.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarCompany;
/**
* --
* @ClassName CarCompanyMapper
* @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarCompanyMapper extends BaseMapper<CarCompany> {
}

View File

@ -2,19 +2,22 @@ package com.muyu.enterprise.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarManage;
import com.muyu.enterprise.domain.dto.CarDTO; import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO; import com.muyu.enterprise.domain.vo.CarVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
* @author zmw * --
* @description: mybatis * @ClassName CarManageMapper
* @Date 2023-11-13 10:05 * @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/ */
public interface SysCarMapper extends BaseMapper<CarVO> {
public interface CarManageMapper extends BaseMapper<CarManage> {
/** /**
* *
* @param queryWrapper * @param queryWrapper

View File

@ -4,6 +4,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarMessage; import com.muyu.enterprise.domain.CarMessage;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* --
* @ClassName CarMessageMapper
* @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Mapper @Mapper
public interface CarMessageMapper extends BaseMapper<CarMessage> { public interface CarMessageMapper extends BaseMapper<CarMessage> {
/**
*
* @param templateId
* @return
*/
List<CarMessage> selectMessageShow(Long templateId);
} }

View File

@ -0,0 +1,15 @@
package com.muyu.enterprise.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarMessageType;
import org.apache.ibatis.annotations.Mapper;
/**
* --
* @ClassName CarMessageTypeMapper
* @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Mapper
public interface CarMessageTypeMapper extends BaseMapper<CarMessageType> {
}

View File

@ -5,9 +5,15 @@ import com.muyu.enterprise.domain.CarTemplate;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
/**
* --
* @ClassName CarTemplateMapper
* @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Mapper @Mapper
public interface SysCarTemplateMapper extends BaseMapper<CarTemplate> { public interface CarTemplateMapper extends BaseMapper<CarTemplate> {
/** /**
* *
* @return * @return

View File

@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarType; import com.muyu.enterprise.domain.CarType;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/**
* --
* @ClassName CarTypeMapper
* @Description Mapper
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Mapper @Mapper
public interface CarTypeMapper extends BaseMapper<CarType> { public interface CarTypeMapper extends BaseMapper<CarType> {
CarType findById(@Param("catTypeId") Integer catTypeId); CarType findById(@Param("catTypeId") Integer catTypeId);
} }

View File

@ -1,14 +0,0 @@
package com.muyu.enterprise.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarCompany;
/**
* @author zmw
* @description: mybatis
* @Date 2023-11-13 10:05
*/
public interface SysCarCompanyMapper extends BaseMapper<CarCompany> {
}

View File

@ -1,17 +0,0 @@
package com.muyu.enterprise.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.enterprise.domain.CarMessage;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysCarMessageMapper extends BaseMapper<CarMessage> {
/**
*
* @param templateId
* @return
*/
List<CarMessage> selectMessageShow(Long templateId);
}

View File

@ -3,11 +3,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarCompany; import com.muyu.enterprise.domain.CarCompany;
/** /**
* @author zmw * --
* @description: plus * @ClassName CarCompanyService
* @Date 2023-11-13 10:06 * @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/ */
public interface SysCarCompanyService extends IService<CarCompany> { public interface CarCompanyService extends IService<CarCompany> {
/** /**
* *

View File

@ -0,0 +1,50 @@
package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarManage;
import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO;
import java.util.List;
/**
* --
* @ClassName CarManageService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarManageService extends IService<CarManage> {
// /**
// * 车辆列表
// * @param carVO
// * @return
// */
// List<CarManage> carList(CarVO carVO);
//
// /**
// * 车辆添加
// * @param carVO
// */
// void insertCar(CarVO carVO);
//
// /**
// * 车辆删除
// * @param ids
// */
// void deleteCar(List<Long> ids);
//
//
/**
* 2
* @param carDTO
* @return
*/
List<CarManage> CarListShow(CarDTO carDTO);
//
// /**
// * 通过id查询
// * @param carId
// * @return
// */
// List<CarVO> CarListShowByCarId(Long carId);
}

View File

@ -3,5 +3,26 @@ package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarMessage; import com.muyu.enterprise.domain.CarMessage;
import java.util.List;
/**
* --
* @ClassName CarMessageService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarMessageService extends IService<CarMessage> { public interface CarMessageService extends IService<CarMessage> {
/**
*
* @param templateId
* @return
*/
List<CarMessage> selectMessageShow(Long templateId);
/**
* id
* @param messageId
* @return
*/
CarMessage selectMessageByMessageId(Long messageId);
} }

View File

@ -0,0 +1,16 @@
package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarMessageType;
import java.util.List;
/**
* --
* @ClassName CarMessageTypeService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarMessageTypeService extends IService<CarMessageType> {
List<CarMessageType> messageTypeList();
}

View File

@ -4,8 +4,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarTemplate; import com.muyu.enterprise.domain.CarTemplate;
import java.util.List; import java.util.List;
/**
public interface SysCarTemplateService extends IService<CarTemplate> { * --
* @ClassName CarTemplateService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarTemplateService extends IService<CarTemplate> {
/** /**
* *
* @return * @return

View File

@ -2,7 +2,13 @@ package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarType; import com.muyu.enterprise.domain.CarType;
/**
* --
* @ClassName CarTypeService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
public interface CarTypeService extends IService<CarType> { public interface CarTypeService extends IService<CarType> {
CarType findById(Integer catTypeId); CarType findById(Integer catTypeId);

View File

@ -1,22 +0,0 @@
package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarMessage;
import java.util.List;
public interface SysCarMessageService extends IService<CarMessage> {
/**
*
* @param templateId
* @return
*/
List<CarMessage> selectMessageShow(Long templateId);
/**
* id
* @param messageId
* @return
*/
CarMessage selectMessageByMessageId(Long messageId);
}

View File

@ -1,52 +0,0 @@
package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO;
import java.util.List;
/**
* @author zmw
* @description: plus
* @Date 2023-11-13 10:06
*/
public interface SysCarService extends IService<CarVO> {
/**
*
* @param carVO
* @return
*/
List<CarVO> carList(CarVO carVO);
/**
*
* @param carVO
*/
void insertCar(CarVO carVO);
/**
*
* @param ids
*/
void deleteCar(List<Long> ids);
// /**
// * 车辆修改
// * @param carVO
// */
// void updataCar(CarVO carVO);
/**
* 2
* @param carDTO
* @return
*/
List<CarVO> CarListShow(CarDTO carDTO);
/**
* id
* @param carId
* @return
*/
List<CarVO> CarListShowByCarId(Long carId);
}

View File

@ -0,0 +1,39 @@
package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.mapper.CarCompanyMapper;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* --
* @ClassName CarCompanyServiceImpl
* @Description ServiceImpl
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
/**
* --
* @ClassName CarCompanyService
* @Description Service
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Service
public class CarCompanyServiceImpl extends ServiceImpl<CarCompanyMapper, CarCompany>
implements CarCompanyService {
@Autowired
private RedisService redisService;
@Autowired
private CarCompanyMapper sysCarCompanyMapper;
// @Override
// public List<CarCompany> selectCompany() {
// return sysCarCompanyMapper.;
// }
}

View File

@ -0,0 +1,151 @@
package com.muyu.enterprise.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.enterprise.controller.CarCompanyController;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.CarManage;
import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO;
import com.muyu.enterprise.mapper.CarManageMapper;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.enterprise.service.CarManageService;
import com.muyu.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* --
* @ClassName CarManageServiceImpl
* @Description ServiceImpl
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Service
public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage>
implements CarManageService {
// @Autowired
// private RedisService redisService;
// @Autowired
// private CarManageMapper carMapper;
// // 企业 service
// @Autowired
// private CarCompanyService carCompanyService;
// /**
// * 车辆列表
// * @param carVO
// * @return
// */
// @Override
// public List<CarVO> carList(CarVO carVO) {
//
//// MPJLambdaWrapper<CarVO> queryWrapper = new MPJLambdaWrapper<>();
//// carMapper.selectJoinList(CarVO.class,
//// queryWrapper.selectAll(CarVO.class)// 主表查询所有
//// .select(Type::getTypeName)// 获取附表的字段
//// .select(Type::getEnergyType)
//// .select(Type::getGearType)
//// .leftJoin(Type.class,Type::getTypeId,Car::getTypeId)// 左链接
//// );
//// // vin码--精确
//// if(StringUtils.isNotEmpty(carVO.getCarVin())){
//// queryWrapper.eq(CarVO::getCarVin,carVO.getCarVin());
//// }
//// // 车辆型号
//// if(StringUtils.isNotEmpty(carVO.getTypeName())){
//// queryWrapper.like(CarVO::getTypeName,carVO.getTypeName());
//// }
//// // 能源类型 1.电动 2.纯油 3.混动
//// if(carVO.getEnergyType()>0){
//// queryWrapper.eq(CarVO::getEnergyType,carVO.getEnergyType());
//// }
//// // 档的类型 1.手动 2.自动
//// if(carVO.getGearType()>0){
//// queryWrapper.eq(CarVO::getGearType,carVO.getGearType());
//// }
//// // 自定义列表查询
////// @Select("")
////// this.list(queryWrapper);
//// // mybatis列表查询
//// //return carMapper.carList(queryWrapper);
//// // 单表的列表查询
//// this.list(
//// new LambdaQueryWrapper<CarVO>()
//// .eq(StringUtils.isNotEmpty(carVO.getCarVin()),CarVO::getCarVin,carVO.getCarVin())
//// .eq(carVO.getEnergyType()>0,CarVO::getEnergyType,carVO.getEnergyType())
//// .eq(carVO.getGearType()>0,CarVO::getGearType,carVO.getGearType())
//// .like(StringUtils.isNotEmpty(carVO.getTypeName()),CarVO::getTypeName,carVO.getTypeName())
//// );
//// return this.list(queryWrapper);
// return null;
// }
//
// /**
// * 车辆添加
// * @param carVO
// */
// @Override
// public void insertCar(CarVO carVO) {
// carMapper.insert(carVO);
// }
//
//// /**
//// * 车辆修改
//// * @param carVO
//// */
//// @Override
//// public void updataCar(CarVO carVO) {
//// carMapper.updateById(carVO);
//// }
//
/**
* 2
* @param carDTO
* @return
*/
@Override
public List<CarManage> CarListShow(CarDTO carDTO) {
// 获取 企业
// CarCompanyController carCompanyController = new CarCompanyController();
CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class);
return lambdaQuery()
.eq(StringUtils.isNotEmpty(carManage.getCarVin()), CarManage::getCarVin, carManage.getCarVin())
.eq(carManage.getConfigId() > 0, CarManage::getCarVin, carManage.getConfigId())
.list();
// list.forEach(carManage1 -> {
// // 获取 企业 id
// carCompanyController.selectCompanyByCompanyId(carManage1.getCompanyId());
// });
//
// List<CarCompany> data = carCompanyController.selectCompany().getData();
// getById()
}
//
// /**
// * 通过id查询
// * @param carId
// * @return
// */
// @Override
// public CarManage CarListShowByCarId(Long carId) {
// return carMapper.CarListShowByCarId(carId);
// }
//
//
// /**
// * 车辆删除
// * @param ids
// */
// @Override
// public void deleteCar(List<Long> ids) {
// carMapper.deleteBatchIds(ids);
// }
}

View File

@ -7,18 +7,36 @@ import com.muyu.enterprise.service.CarMessageService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* --
* @ClassName CarMessageServiceImpl * @ClassName CarMessageServiceImpl
* @Description * @Description ServiceImpl
* @Author YiBo.Liu * @author MingWei.Zong
* @Date 2024/9/22 22:29 * @Date 2024/9/28 16:52
*/ */
@Service @Service
public class CarMessageServiceImpl public class CarMessageServiceImpl extends ServiceImpl<CarMessageMapper, CarMessage> implements CarMessageService {
extends ServiceImpl<CarMessageMapper, CarMessage>
implements CarMessageService {
@Autowired @Autowired
private CarMessageMapper carMessageMapper; private CarMessageMapper sysCarMessageMapper;
/**
*
* @param templateId
* @return
*/
@Override
public List<CarMessage> selectMessageShow(Long templateId) {
return sysCarMessageMapper.selectMessageShow(templateId);
}
/**
* id
* @param messageId
* @return
*/
@Override
public CarMessage selectMessageByMessageId(Long messageId) {
return sysCarMessageMapper.selectById(messageId);
}
} }

View File

@ -0,0 +1,25 @@
package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.CarMessageType;
import com.muyu.enterprise.mapper.CarMessageTypeMapper;
import com.muyu.enterprise.service.CarMessageTypeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* --
* @ClassName CarMessageTypeServiceImpl
* @Description ServiceImpl
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Service
public class CarMessageTypeServiceImpl extends ServiceImpl<CarMessageTypeMapper, CarMessageType> implements CarMessageTypeService {
@Override
public List<CarMessageType> messageTypeList() {
return null;
}
}

View File

@ -2,18 +2,24 @@ package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.CarTemplate; import com.muyu.enterprise.domain.CarTemplate;
import com.muyu.enterprise.mapper.SysCarTemplateMapper; import com.muyu.enterprise.mapper.CarTemplateMapper;
import com.muyu.enterprise.service.SysCarTemplateService; import com.muyu.enterprise.service.CarTemplateService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
/**
* --
* @ClassName CarTemplateServiceImpl
* @Description ServiceImpl
* @author MingWei.Zong
* @Date 2024/9/28 16:52
*/
@Service @Service
public class SysCarTemplateServiceImpl extends ServiceImpl<SysCarTemplateMapper, CarTemplate> implements SysCarTemplateService { public class CarTemplateServiceImpl extends ServiceImpl<CarTemplateMapper, CarTemplate> implements CarTemplateService {
@Autowired @Autowired
private SysCarTemplateMapper sysCarTemplateMapper; private CarTemplateMapper sysCarTemplateMapper;
/** /**
* *
* @return * @return

View File

@ -8,10 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* @ClassName CarServiceImpl * --
* @Description * @ClassName CarTypeTypeServiceImpl
* @Author YiBo.Liu * @Description ServiceImpl
* @Date 2024/9/22 16:52 * @author MingWei.Zong
* @Date 2024/9/28 16:52
*/ */
@Service @Service
public class CarTypeTypeServiceImpl public class CarTypeTypeServiceImpl

View File

@ -1,30 +0,0 @@
package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.mapper.SysCarCompanyMapper;
import com.muyu.enterprise.service.SysCarCompanyService;
import com.muyu.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zmw
* @description: plus
* @Date 2023-11-13 10:06
*/
@Service
public class SysCarCompanyServiceImpl extends ServiceImpl<SysCarCompanyMapper, CarCompany>
implements SysCarCompanyService {
@Autowired
private RedisService redisService;
@Autowired
private SysCarCompanyMapper sysCarCompanyMapper;
// @Override
// public List<CarCompany> selectCompany() {
// return sysCarCompanyMapper.;
// }
}

View File

@ -1,36 +0,0 @@
package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.CarMessage;
import com.muyu.enterprise.mapper.SysCarMessageMapper;
import com.muyu.enterprise.service.SysCarMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SysCarMessageServiceImpl extends ServiceImpl<SysCarMessageMapper, CarMessage> implements SysCarMessageService {
@Autowired
private SysCarMessageMapper sysCarMessageMapper;
/**
*
* @param templateId
* @return
*/
@Override
public List<CarMessage> selectMessageShow(Long templateId) {
return sysCarMessageMapper.selectMessageShow(templateId);
}
/**
* id
* @param messageId
* @return
*/
@Override
public CarMessage selectMessageByMessageId(Long messageId) {
return sysCarMessageMapper.selectById(messageId);
}
}

View File

@ -1,126 +0,0 @@
package com.muyu.enterprise.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.enterprise.domain.dto.CarDTO;
import com.muyu.enterprise.domain.vo.CarVO;
import com.muyu.enterprise.mapper.SysCarMapper;
import com.muyu.enterprise.service.SysCarService;
import com.muyu.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zmw
* @description: plus
* @Date 2023-11-13 10:06
*/
@Service
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, CarVO>
implements SysCarService {
@Autowired
private RedisService redisService;
@Autowired
private SysCarMapper carMapper;
/**
*
* @param carVO
* @return
*/
@Override
public List<CarVO> carList(CarVO carVO) {
// MPJLambdaWrapper<CarVO> queryWrapper = new MPJLambdaWrapper<>();
// carMapper.selectJoinList(CarVO.class,
// queryWrapper.selectAll(CarVO.class)// 主表查询所有
// .select(Type::getTypeName)// 获取附表的字段
// .select(Type::getEnergyType)
// .select(Type::getGearType)
// .leftJoin(Type.class,Type::getTypeId,Car::getTypeId)// 左链接
// );
// // vin码--精确
// if(StringUtils.isNotEmpty(carVO.getCarVin())){
// queryWrapper.eq(CarVO::getCarVin,carVO.getCarVin());
// }
// // 车辆型号
// if(StringUtils.isNotEmpty(carVO.getTypeName())){
// queryWrapper.like(CarVO::getTypeName,carVO.getTypeName());
// }
// // 能源类型 1.电动 2.纯油 3.混动
// if(carVO.getEnergyType()>0){
// queryWrapper.eq(CarVO::getEnergyType,carVO.getEnergyType());
// }
// // 档的类型 1.手动 2.自动
// if(carVO.getGearType()>0){
// queryWrapper.eq(CarVO::getGearType,carVO.getGearType());
// }
// // 自定义列表查询
//// @Select("")
//// this.list(queryWrapper);
// // mybatis列表查询
// //return carMapper.carList(queryWrapper);
// // 单表的列表查询
// this.list(
// new LambdaQueryWrapper<CarVO>()
// .eq(StringUtils.isNotEmpty(carVO.getCarVin()),CarVO::getCarVin,carVO.getCarVin())
// .eq(carVO.getEnergyType()>0,CarVO::getEnergyType,carVO.getEnergyType())
// .eq(carVO.getGearType()>0,CarVO::getGearType,carVO.getGearType())
// .like(StringUtils.isNotEmpty(carVO.getTypeName()),CarVO::getTypeName,carVO.getTypeName())
// );
// return this.list(queryWrapper);
return null;
}
/**
*
* @param carVO
*/
@Override
public void insertCar(CarVO carVO) {
carMapper.insert(carVO);
}
// /**
// * 车辆修改
// * @param carVO
// */
// @Override
// public void updataCar(CarVO carVO) {
// carMapper.updateById(carVO);
// }
/**
* 2
* @param carDTO
* @return
*/
@Override
public List<CarVO> CarListShow(CarDTO carDTO) {
return carMapper.CarListShow(carDTO);
}
/**
* id
* @param carId
* @return
*/
@Override
public List<CarVO> CarListShowByCarId(Long carId) {
return carMapper.CarListShowByCarId(carId);
}
/**
*
* @param ids
*/
@Override
public void deleteCar(List<Long> ids) {
carMapper.deleteBatchIds(ids);
}
}

View File

@ -2,30 +2,30 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.enterprise.mapper.SysCarMapper"> <mapper namespace="com.muyu.enterprise.mapper.CarManageMapper">
<!-- 车辆列表 --> <!-- 车辆列表 -->
<select id="carList" resultType="com.muyu.enterprise.domain.vo.CarVO"> <select id="carList" resultType="com.muyu.enterprise.domain.vo.CarVO">
SELECT SELECT
tc.*, cman.*,
tt.energy_type, cc.config_name,
tt.gear_type, cc.energy_type,
tt.type_name cc.gear_type
FROM FROM
`t_car` tc `car_manage` cman
LEFT JOIN `t_type` tt ON tc.type_id = tt.type_id LEFT JOIN `car_config` cc ON cman.config_id = cc.config_id
<where> <where>
<if test="carVin != null and carVin != ''"> <if test="carVin != null and carVin != ''">
and tc.car_vin = #{carVin} and cman.car_vin = #{carVin}
</if> </if>
<if test="typeName != null and typeName != ''"> <if test="typeName != null and typeName != ''">
and tt.type_name like concat('%',#{typeName},'%') and cc.config_name like concat('%',#{typeName},'%')
</if> </if>
<if test="energyType != null and energyType > 0 "> <if test="energyType != null and energyType > 0 ">
and tt.energy_type = #{energyType} and cc.energy_type = #{energyType}
</if> </if>
<if test="gearType != null and gearType > 0 "> <if test="gearType != null and gearType > 0 ">
and tt.gear_type = #{gearType} and cc.gear_type = #{gearType}
</if> </if>
</where> </where>
</select> </select>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.enterprise.mapper.SysCarMessageMapper"> <mapper namespace="com.muyu.enterprise.mapper.CarMessageMapper">
<!-- 查询所有报文信息 --> <!-- 查询所有报文信息 -->

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.enterprise.mapper.SysCarTemplateMapper"> <mapper namespace="com.muyu.enterprise.mapper.CarTemplateMapper">
<!-- 查询所有报文信息 --> <!-- 查询所有报文信息 -->