feat: 触控交互
This commit is contained in:
parent
6c25b37827
commit
b0ce09777f
@ -66,6 +66,12 @@
|
||||
<artifactId>cmvr-iot-vi</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 触控交互-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-ti</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<env>dev</env>
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
package com.cmvr.web.controller.ti;
|
||||
|
||||
import com.cmvr.common.annotation.Log;
|
||||
import com.cmvr.common.core.controller.BaseController;
|
||||
import com.cmvr.common.core.domain.AjaxResult;
|
||||
import com.cmvr.common.enums.BusinessType;
|
||||
import com.cmvr.ti.model.domain.TiVehicleConfig;
|
||||
import com.cmvr.ti.model.vo.VehicleConfigTreeVO;
|
||||
import com.cmvr.ti.service.ITiVehicleConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "触控交互--车辆配置")
|
||||
@RestController
|
||||
@RequestMapping("/ti/config")
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleConfigController extends BaseController {
|
||||
|
||||
private final ITiVehicleConfigService tiVehicleConfigService;
|
||||
|
||||
@ApiOperation("查询车辆配置列表")
|
||||
@PreAuthorize("@ss.hasPermi('ti:config:list')")
|
||||
@GetMapping("/list")
|
||||
public List<VehicleConfigTreeVO> list() {
|
||||
return tiVehicleConfigService.selectTiVehicleConfigList();
|
||||
}
|
||||
|
||||
@ApiOperation("获取车辆配置详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ti:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tiVehicleConfigService.selectTiVehicleConfigById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增车辆配置")
|
||||
@PreAuthorize("@ss.hasPermi('ti:config:add')")
|
||||
@Log(title = "车辆配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TiVehicleConfig tiVehicleConfig) {
|
||||
return toAjax(tiVehicleConfigService.insertTiVehicleConfig(tiVehicleConfig));
|
||||
}
|
||||
|
||||
@ApiOperation("修改车辆配置")
|
||||
@PreAuthorize("@ss.hasPermi('ti:config:edit')")
|
||||
@Log(title = "车辆配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TiVehicleConfig tiVehicleConfig) {
|
||||
return toAjax(tiVehicleConfigService.updateTiVehicleConfig(tiVehicleConfig));
|
||||
}
|
||||
|
||||
@ApiOperation("删除车辆配置")
|
||||
@PreAuthorize("@ss.hasPermi('ti:config:remove')")
|
||||
@Log(title = "车辆配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(tiVehicleConfigService.deleteTiVehicleConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.cmvr.web.controller.ti;
|
||||
|
||||
import com.cmvr.common.annotation.Log;
|
||||
import com.cmvr.common.core.controller.BaseController;
|
||||
import com.cmvr.common.core.domain.AjaxResult;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
import com.cmvr.common.enums.BusinessType;
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
import com.cmvr.ti.service.ITiVehicleFunctionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "触控交互--车机功能")
|
||||
@RestController
|
||||
@RequestMapping("/ti/function")
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleFunctionController extends BaseController {
|
||||
private final ITiVehicleFunctionService tiVehicleFunctionService;
|
||||
|
||||
@ApiOperation("查询车机功能列表")
|
||||
@PreAuthorize("@ss.hasPermi('ti:function:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TiVehicleFunction tiVehicleFunction) {
|
||||
startPage();
|
||||
List<TiVehicleFunction> list = tiVehicleFunctionService.selectTiVehicleFunctionList(tiVehicleFunction);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取车机功能详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ti:function:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tiVehicleFunctionService.selectTiVehicleFunctionById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:function:add')")
|
||||
@Log(title = "车机功能", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TiVehicleFunction tiVehicleConfig) {
|
||||
return toAjax(tiVehicleFunctionService.insertTiVehicleFunction(tiVehicleConfig));
|
||||
}
|
||||
|
||||
@ApiOperation("修改车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:function:edit')")
|
||||
@Log(title = "车机功能", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TiVehicleFunction tiVehicleConfig) {
|
||||
return toAjax(tiVehicleFunctionService.updateTiVehicleFunction(tiVehicleConfig));
|
||||
}
|
||||
|
||||
@ApiOperation("删除车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:function:remove')")
|
||||
@Log(title = "车机功能", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(tiVehicleFunctionService.deleteTiVehicleFunctionByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.cmvr.web.controller.ti;
|
||||
|
||||
import com.cmvr.common.annotation.Log;
|
||||
import com.cmvr.common.core.controller.BaseController;
|
||||
import com.cmvr.common.core.domain.AjaxResult;
|
||||
import com.cmvr.common.core.page.TableDataInfo;
|
||||
import com.cmvr.common.enums.BusinessType;
|
||||
import com.cmvr.ti.model.domain.TiVehicleUi;
|
||||
import com.cmvr.ti.service.ITiVehicleFunctionService;
|
||||
import com.cmvr.ti.service.ITiVehicleUiService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "触控交互--车机界面")
|
||||
@RestController
|
||||
@RequestMapping("/ti/ui")
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleUiController extends BaseController {
|
||||
private final ITiVehicleUiService tiVehicleUiService;
|
||||
|
||||
@ApiOperation("查询车机功能列表")
|
||||
@PreAuthorize("@ss.hasPermi('ti:ui:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TiVehicleUi tiVehicleUi) {
|
||||
startPage();
|
||||
List<TiVehicleUi> list = tiVehicleUiService.selectTiVehicleUiList(tiVehicleUi);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取车机功能详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ti:ui:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tiVehicleUiService.selectTiVehicleUiById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:ui:add')")
|
||||
@Log(title = "车机界面", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TiVehicleUi tiVehicleUi) {
|
||||
return toAjax(tiVehicleUiService.insertTiVehicleUi(tiVehicleUi));
|
||||
}
|
||||
|
||||
@ApiOperation("修改车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:ui:edit')")
|
||||
@Log(title = "车机界面", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TiVehicleUi tiVehicleUi) {
|
||||
return toAjax(tiVehicleUiService.updateTiVehicleUi(tiVehicleUi));
|
||||
}
|
||||
|
||||
@ApiOperation("删除车机功能")
|
||||
@PreAuthorize("@ss.hasPermi('ti:ui:remove')")
|
||||
@Log(title = "车机界面", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(tiVehicleUiService.deleteTiVehicleUiByIds(ids));
|
||||
}
|
||||
}
|
||||
33
cmvr-iot-ti/pom.xml
Normal file
33
cmvr-iot-ti/pom.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot</artifactId>
|
||||
<version>3.8.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cmvr-iot-ti</artifactId>
|
||||
|
||||
<description>
|
||||
触控交互模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 测试流程-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,10 @@
|
||||
package com.cmvr.ti.mapper;
|
||||
|
||||
import com.cmvr.ti.model.domain.TiVehicleConfig;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 车辆配置Mapper接口
|
||||
*/
|
||||
public interface TiVehicleConfigMapper extends MPJBaseMapper<TiVehicleConfig> {
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.cmvr.ti.mapper;
|
||||
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 车机功能Mapper接口
|
||||
*/
|
||||
public interface TiVehicleFunctionMapper extends MPJBaseMapper<TiVehicleFunction> {
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.cmvr.ti.mapper;
|
||||
|
||||
import com.cmvr.ti.model.domain.TiVehicleUi;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 车机界面Mapper接口
|
||||
*/
|
||||
public interface TiVehicleUiMapper extends MPJBaseMapper<TiVehicleUi> {
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.cmvr.ti.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.cmvr.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("触控交互--车辆配置")
|
||||
public class TiVehicleConfig extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("父节点ID(0 表示根节点)")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("节点名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("节点类型(oem / model / version)")
|
||||
private String type;
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.cmvr.ti.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.cmvr.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("触控交互--车机功能")
|
||||
public class TiVehicleFunction extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("车辆配置ID")
|
||||
private Long vehicleConfigId;
|
||||
|
||||
@ApiModelProperty("所属界面ID")
|
||||
private Long uiId;
|
||||
|
||||
@ApiModelProperty("功能字典键值(sys_dict_data.value)")
|
||||
private String funcKey;
|
||||
|
||||
@ApiModelProperty("图标URL")
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.cmvr.ti.model.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.cmvr.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("触控交互--车机界面")
|
||||
@Data
|
||||
public class TiVehicleUi extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("车辆配置ID")
|
||||
private Long vehicleConfigId;
|
||||
|
||||
@ApiModelProperty("界面功能")
|
||||
private String funcIds;
|
||||
|
||||
@ApiModelProperty("界面字典键值(sys_dict_data.value)")
|
||||
private String uiKey;
|
||||
|
||||
@ApiModelProperty("界面截图URL")
|
||||
private String uiUrl;
|
||||
|
||||
}
|
||||
65
cmvr-iot-ti/src/main/java/com/cmvr/ti/model/te.sql
Normal file
65
cmvr-iot-ti/src/main/java/com/cmvr/ti/model/te.sql
Normal file
@ -0,0 +1,65 @@
|
||||
CREATE TABLE `te_vehicle_config`
|
||||
(
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
|
||||
`oem` VARCHAR(50) NOT NULL COMMENT '车企名称',
|
||||
`model` VARCHAR(50) NOT NULL COMMENT '车型名称',
|
||||
`version` VARCHAR(50) NOT NULL COMMENT '车机版本',
|
||||
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
|
||||
|
||||
`create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='触控交互-车辆配置表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `ti_vehicle_ui`;
|
||||
CREATE TABLE `ti_vehicle_ui`
|
||||
(
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
|
||||
`vehicle_config_id` BIGINT(20) NOT NULL COMMENT '所属车辆配置ID(te_vehicle_config.id)',
|
||||
|
||||
`ui_key` VARCHAR(50) NOT NULL COMMENT '界面字典键值(来自 sys_dict_data.value)',
|
||||
|
||||
`ui_url` VARCHAR(255) DEFAULT NULL COMMENT '界面截图URL',
|
||||
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
|
||||
`create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='触控交互-车机界面表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `ti_vehicle_function`;
|
||||
CREATE TABLE `ti_vehicle_function`
|
||||
(
|
||||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
|
||||
`vehicle_config_id` BIGINT(20) NOT NULL COMMENT '关联车辆配置ID(te_vehicle_config.id)',
|
||||
`ui_id` BIGINT(20) NOT NULL COMMENT '所属界面ID(ti_vehicle_ui.id)',
|
||||
|
||||
`func_key` VARCHAR(50) NOT NULL COMMENT '功能字典键值(来自 sys_dict_data.value)',
|
||||
|
||||
`icon_url` VARCHAR(255) DEFAULT NULL COMMENT '图标URL(可选)',
|
||||
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
|
||||
`create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='触控交互-车机功能表';
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package com.cmvr.ti.model.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("车辆配置树形VO")
|
||||
public class VehicleConfigTreeVO {
|
||||
|
||||
@ApiModelProperty("节点ID(对应车辆配置ID)")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("父节点ID(0表示根节点)")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("节点名称")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty("节点类型(oem / model / version)")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("子节点")
|
||||
private List<VehicleConfigTreeVO> children;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.cmvr.ti.service;
|
||||
|
||||
import com.cmvr.ti.model.domain.TiVehicleConfig;
|
||||
import com.cmvr.ti.model.vo.VehicleConfigTreeVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆配置Service接口
|
||||
*/
|
||||
public interface ITiVehicleConfigService {
|
||||
/**
|
||||
* 查询车辆配置
|
||||
*
|
||||
* @param id 车辆配置主键
|
||||
* @return 车辆配置
|
||||
*/
|
||||
public TiVehicleConfig selectTiVehicleConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车辆配置列表
|
||||
*/
|
||||
public List<VehicleConfigTreeVO> selectTiVehicleConfigList();
|
||||
|
||||
/**
|
||||
* 新增车辆配置
|
||||
*
|
||||
* @param tiVehicleConfig 车辆配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTiVehicleConfig(TiVehicleConfig tiVehicleConfig);
|
||||
|
||||
/**
|
||||
* 修改车辆配置
|
||||
*
|
||||
* @param tiVehicleConfig 车辆配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTiVehicleConfig(TiVehicleConfig tiVehicleConfig);
|
||||
|
||||
/**
|
||||
* 批量删除车辆配置
|
||||
*
|
||||
* @param ids 需要删除的车辆配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTiVehicleConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除车辆配置信息
|
||||
*
|
||||
* @param id 车辆配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTiVehicleConfigById(Long id);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.cmvr.ti.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆功能Service接口
|
||||
*/
|
||||
public interface ITiVehicleFunctionService extends IService<TiVehicleFunction> {
|
||||
/**
|
||||
* 查询车辆功能
|
||||
*
|
||||
* @param id 车辆功能主键
|
||||
* @return 车辆功能
|
||||
*/
|
||||
public TiVehicleFunction selectTiVehicleFunctionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车辆功能列表
|
||||
*
|
||||
* @param tiVehicleFunction 车辆功能
|
||||
* @return 列表
|
||||
*/
|
||||
public List<TiVehicleFunction> selectTiVehicleFunctionList(TiVehicleFunction tiVehicleFunction);
|
||||
|
||||
/**
|
||||
* 新增车辆功能
|
||||
*
|
||||
* @param tiVehicleFunction 车辆功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTiVehicleFunction(TiVehicleFunction tiVehicleFunction);
|
||||
|
||||
/**
|
||||
* 修改车辆功能
|
||||
*
|
||||
* @param tiVehicleFunction 车辆功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTiVehicleFunction(TiVehicleFunction tiVehicleFunction);
|
||||
|
||||
/**
|
||||
* 批量删除车辆功能
|
||||
*
|
||||
* @param ids 需要删除的车辆功能主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTiVehicleFunctionByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.cmvr.ti.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cmvr.ti.model.domain.TiVehicleUi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车机界面Service接口
|
||||
*/
|
||||
public interface ITiVehicleUiService extends IService<TiVehicleUi> {
|
||||
/**
|
||||
* 查询车机界面
|
||||
*
|
||||
* @param id 车机界面主键
|
||||
* @return 车机界面
|
||||
*/
|
||||
public TiVehicleUi selectTiVehicleUiById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车机界面列表
|
||||
*
|
||||
* @param TiVehicleUi 车机界面
|
||||
* @return 车机界面集合
|
||||
*/
|
||||
public List<TiVehicleUi> selectTiVehicleUiList(TiVehicleUi TiVehicleUi);
|
||||
|
||||
/**
|
||||
* 新增车机界面
|
||||
*
|
||||
* @param TiVehicleUi 车机界面
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTiVehicleUi(TiVehicleUi TiVehicleUi);
|
||||
|
||||
/**
|
||||
* 修改车机界面
|
||||
*
|
||||
* @param TiVehicleUi 车机界面
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTiVehicleUi(TiVehicleUi TiVehicleUi);
|
||||
|
||||
/**
|
||||
* 批量删除车机界面
|
||||
*
|
||||
* @param ids 需要删除的车机界面主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTiVehicleUiByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package com.cmvr.ti.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.common.exception.GlobalException;
|
||||
import com.cmvr.ti.mapper.TiVehicleConfigMapper;
|
||||
import com.cmvr.ti.model.domain.TiVehicleConfig;
|
||||
import com.cmvr.ti.model.vo.VehicleConfigTreeVO;
|
||||
import com.cmvr.ti.service.ITiVehicleConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 车辆配置Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleConfigServiceImpl
|
||||
extends ServiceImpl<TiVehicleConfigMapper, TiVehicleConfig>
|
||||
implements ITiVehicleConfigService {
|
||||
|
||||
@Override
|
||||
public TiVehicleConfig selectTiVehicleConfigById(Long id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回树结构:OEM → Model → Version
|
||||
*/
|
||||
@Override
|
||||
public List<VehicleConfigTreeVO> selectTiVehicleConfigList() {
|
||||
|
||||
// 1. 获取全部节点
|
||||
List<TiVehicleConfig> list = this.list();
|
||||
|
||||
// 2. 转为 VO
|
||||
List<VehicleConfigTreeVO> treeNodes = list.stream().map(cfg -> {
|
||||
VehicleConfigTreeVO vo = new VehicleConfigTreeVO();
|
||||
vo.setId(cfg.getId());
|
||||
vo.setParentId(cfg.getParentId());
|
||||
vo.setLabel(cfg.getName());
|
||||
vo.setType(cfg.getType());
|
||||
vo.setRemark(cfg.getRemark());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 3. 组装树
|
||||
return buildTree(treeNodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准树构建
|
||||
*/
|
||||
private List<VehicleConfigTreeVO> buildTree(List<VehicleConfigTreeVO> nodes) {
|
||||
Map<Long, VehicleConfigTreeVO> map = nodes.stream()
|
||||
.collect(Collectors.toMap(VehicleConfigTreeVO::getId, n -> n));
|
||||
|
||||
List<VehicleConfigTreeVO> root = new ArrayList<>();
|
||||
|
||||
for (VehicleConfigTreeVO node : nodes) {
|
||||
if (node.getParentId() == 0) {
|
||||
root.add(node);
|
||||
} else {
|
||||
VehicleConfigTreeVO parent = map.get(node.getParentId());
|
||||
if (parent != null) {
|
||||
if (parent.getChildren() == null) {
|
||||
parent.setChildren(new ArrayList<>());
|
||||
}
|
||||
parent.getChildren().add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTiVehicleConfig(TiVehicleConfig tiVehicleConfig) {
|
||||
return this.baseMapper.insert(tiVehicleConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTiVehicleConfig(TiVehicleConfig tiVehicleConfig) {
|
||||
return this.baseMapper.updateById(tiVehicleConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteTiVehicleConfigByIds(Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
long childCount = this.lambdaQuery()
|
||||
.eq(TiVehicleConfig::getParentId, id)
|
||||
.count();
|
||||
if (childCount > 0) {
|
||||
throw new GlobalException("节点下存在子节点,无法批量删除!");
|
||||
}
|
||||
}
|
||||
return this.baseMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
@Override
|
||||
public int deleteTiVehicleConfigById(Long id) {
|
||||
|
||||
long childCount = this.lambdaQuery()
|
||||
.eq(TiVehicleConfig::getParentId, id)
|
||||
.count();
|
||||
|
||||
if (childCount > 0) {
|
||||
throw new GlobalException("当前节点存在子节点,无法删除,请先删除其子节点!");
|
||||
}
|
||||
|
||||
return this.baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.cmvr.ti.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.ti.mapper.TiVehicleFunctionMapper;
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
import com.cmvr.ti.service.ITiVehicleFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车机功能Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleFunctionServiceImpl extends ServiceImpl<TiVehicleFunctionMapper, TiVehicleFunction> implements ITiVehicleFunctionService {
|
||||
|
||||
@Override
|
||||
public TiVehicleFunction selectTiVehicleFunctionById(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TiVehicleFunction> selectTiVehicleFunctionList(TiVehicleFunction tiVehicleFunction) {
|
||||
LambdaQueryWrapper<TiVehicleFunction> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotEmpty(tiVehicleFunction.getFuncKey()), TiVehicleFunction::getFuncKey, tiVehicleFunction.getFuncKey())
|
||||
.like(StrUtil.isNotEmpty(tiVehicleFunction.getRemark()), TiVehicleFunction::getRemark, tiVehicleFunction.getRemark());
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTiVehicleFunction(TiVehicleFunction TiVehicleFunction) {
|
||||
return this.baseMapper.insert(TiVehicleFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTiVehicleFunction(TiVehicleFunction TiVehicleFunction) {
|
||||
return this.baseMapper.updateById(TiVehicleFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteTiVehicleFunctionByIds(Long[] ids) {
|
||||
return this.baseMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.cmvr.ti.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cmvr.ti.mapper.TiVehicleUiMapper;
|
||||
import com.cmvr.ti.model.domain.TiVehicleFunction;
|
||||
import com.cmvr.ti.model.domain.TiVehicleUi;
|
||||
import com.cmvr.ti.service.ITiVehicleUiService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车机界面Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TiVehicleUiServiceImpl extends ServiceImpl<TiVehicleUiMapper, TiVehicleUi> implements ITiVehicleUiService {
|
||||
|
||||
@Override
|
||||
public TiVehicleUi selectTiVehicleUiById(Long id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TiVehicleUi> selectTiVehicleUiList(TiVehicleUi tiVehicleUi) {
|
||||
LambdaQueryWrapper<TiVehicleUi> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotEmpty(tiVehicleUi.getUiKey()), TiVehicleUi::getUiKey, tiVehicleUi.getUiKey())
|
||||
.like(StrUtil.isNotEmpty(tiVehicleUi.getRemark()), TiVehicleUi::getRemark, tiVehicleUi.getRemark());
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTiVehicleUi(TiVehicleUi tiVehicleUi) {
|
||||
return this.baseMapper.insert(tiVehicleUi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTiVehicleUi(TiVehicleUi tiVehicleUi) {
|
||||
return this.baseMapper.updateById(tiVehicleUi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteTiVehicleUiByIds(Long[] ids) {
|
||||
return this.baseMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
8
pom.xml
8
pom.xml
@ -267,6 +267,13 @@
|
||||
<version>${cmvr-iot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 触控交互-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
<artifactId>cmvr-iot-ti</artifactId>
|
||||
<version>${cmvr-iot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 大模型调用-->
|
||||
<dependency>
|
||||
<groupId>com.cmvr</groupId>
|
||||
@ -322,6 +329,7 @@
|
||||
<module>cmvr-iot-test</module>
|
||||
<module>cmvr-iot-api</module>
|
||||
<module>cmvr-iot-vi</module>
|
||||
<module>cmvr-iot-ti</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user