1.feat(): 添加:三个入口

2.fix(): 修复了:

更新时间10121143
dev.entBusiness
微醺 2024-10-12 11:43:48 +08:00
parent 38ff70f541
commit bc56698b2f
15 changed files with 13 additions and 205 deletions

View File

@ -29,6 +29,12 @@
<groupId>com.muyu</groupId> <groupId>com.muyu</groupId>
<artifactId>cloud-common-security</artifactId> <artifactId>cloud-common-security</artifactId>
</dependency> </dependency>
<!-- 公共核心依赖 -->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-core</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -30,7 +30,9 @@ public interface RemoteEntService {
* @param entId ID * @param entId ID
* @return * @return
*/ */
@GetMapping(value = "/{entId}") @GetMapping(value = "/getById/{entId}")
public Result<SysEnt> getById(@PathVariable(value = "entId") Long entId); Result<SysEnt> getById(@PathVariable(value = "entId") Long entId);
// @GetMapping(value = "/{entId}")
// Result<EntResp> getById(@PathVariable(value = "entId") Long entId);
} }

View File

@ -1,8 +1,6 @@
package com.muyu.enterprise.cache; package com.muyu.enterprise.cache;
import com.muyu.common.cache.config.CacheAbsBasic; import com.muyu.common.cache.config.CacheAbsBasic;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.FaultType;
import com.muyu.enterprise.domain.SysCarFault; import com.muyu.enterprise.domain.SysCarFault;
/** /**

View File

@ -1,8 +1,6 @@
package com.muyu.enterprise.cache; package com.muyu.enterprise.cache;
import com.muyu.common.cache.config.CacheAbsBasic; import com.muyu.common.cache.config.CacheAbsBasic;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.CarTemplate;
import com.muyu.enterprise.domain.vo.CarTemplateVO; import com.muyu.enterprise.domain.vo.CarTemplateVO;
/** /**

View File

@ -1,7 +1,6 @@
package com.muyu.enterprise.cache; package com.muyu.enterprise.cache;
import com.muyu.common.cache.config.CacheAbsBasic; import com.muyu.common.cache.config.CacheAbsBasic;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.dateBase.ElectronicFence; import com.muyu.enterprise.domain.dateBase.ElectronicFence;
/** /**

View File

@ -1,35 +0,0 @@
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 CarCompany
* @Description
* @author MingWei.Zong()
* @Date 2024/9/28 16:52
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value = "car_company")
@Tag(name = "企业表")
public class CarCompany {
/**
*
*/
@TableId(value = "enterprise_id",type = IdType.AUTO)
private Long enterpriseId;
/**
*
*/
private String companyName;
}

View File

@ -1,51 +0,0 @@
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 lombok.RequiredArgsConstructor;
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("/carCompany")
/** 构造必备注解 只有用 final 修饰 才会被构造注入 */
@RequiredArgsConstructor //制动构造注入 默认无参 Lombook包下
@Tag(name = "CarCompanyController", description = "企业表")
public class CarCompanyController extends BaseController {
private final CarCompanyService sysCarCompanyService;
/**
*
*/
@PostMapping("selectCompany")
public Result<List<CarCompany>> selectCompany(){
startPage();
List<CarCompany> list = sysCarCompanyService.list();
list.forEach(carCompany -> {
});
return Result.success(list);
}
/**
* ID
*/
@PostMapping("selectCompanyByCompanyId")
public Result<CarCompany> selectCompanyByCompanyId(@RequestParam("enterpriseId") Long enterpriseId){
return Result.success(sysCarCompanyService.selectCompanyByCompanyId(enterpriseId));
}
}

View File

@ -2,19 +2,14 @@ package com.muyu.enterprise.controller;
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.enterprise.domain.CarCompany;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.enterprise.service.CarConfigService; import com.muyu.enterprise.service.CarConfigService;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* -- * --
* @ClassName CarCompanyController * @ClassName CarCompanyController

View File

@ -5,7 +5,6 @@ import com.muyu.enterprise.cache.CarManageCacheService;
import com.muyu.enterprise.domain.CarManage; 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.CarCompanyService;
import com.muyu.enterprise.service.CarManageService; 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;
@ -32,8 +31,6 @@ public class CarManageController extends BaseController {
private final CarManageCacheService carManageCacheService; private final CarManageCacheService carManageCacheService;
private final CarCompanyService sysCarCompanyService;
private final CarManageService carManageService; private final CarManageService carManageService;

View File

@ -1,16 +0,0 @@
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

@ -1,21 +0,0 @@
package com.muyu.enterprise.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.enterprise.domain.CarCompany;
/**
* --
* @ClassName CarCompanyService
* @Description Service
* @author MingWei.Zong()
* @Date 2024/9/28 16:52
*/
public interface CarCompanyService extends IService<CarCompany> {
/**
* @param enterpriseId
* @return
*/
CarCompany selectCompanyByCompanyId(Long enterpriseId);
}

View File

@ -1,45 +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.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 carCompanyMapper;
/**
*
* @param enterpriseId
* @return
*/
@Override
public CarCompany selectCompanyByCompanyId(Long enterpriseId) {
return carCompanyMapper.selectById(enterpriseId);
}
}

View File

@ -1,24 +1,12 @@
package com.muyu.enterprise.service.impl; package com.muyu.enterprise.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.CarConfig; import com.muyu.enterprise.domain.CarConfig;
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.CarConfigMapper; import com.muyu.enterprise.mapper.CarConfigMapper;
import com.muyu.enterprise.mapper.CarManageMapper;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.enterprise.service.CarConfigService; import com.muyu.enterprise.service.CarConfigService;
import com.muyu.enterprise.service.CarManageService;
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.ArrayList;
import java.util.List;
/** /**
* -- * --
* @ClassName CarConfigServiceImpl * @ClassName CarConfigServiceImpl

View File

@ -3,16 +3,13 @@ package com.muyu.enterprise.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.muyu.common.system.domain.SysEnt;
import com.muyu.common.system.remote.RemoteEntService; import com.muyu.common.system.remote.RemoteEntService;
import com.muyu.enterprise.cache.CarManageCacheService; import com.muyu.enterprise.cache.CarManageCacheService;
import com.muyu.enterprise.domain.CarCompany;
import com.muyu.enterprise.domain.CarConfig; import com.muyu.enterprise.domain.CarConfig;
import com.muyu.enterprise.domain.CarManage; 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.mapper.CarManageMapper; import com.muyu.enterprise.mapper.CarManageMapper;
import com.muyu.enterprise.service.CarCompanyService;
import com.muyu.enterprise.service.CarConfigService; import com.muyu.enterprise.service.CarConfigService;
import com.muyu.enterprise.service.CarManageService; import com.muyu.enterprise.service.CarManageService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -32,8 +29,6 @@ import java.util.List;
public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage> public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage>
implements CarManageService { implements CarManageService {
@Autowired
private CarCompanyService carCompanyService;
@Autowired @Autowired
private CarConfigService carConfigService; private CarConfigService carConfigService;
@Autowired @Autowired
@ -71,8 +66,8 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
carVO.setEnergyType(carConfig.getEnergyType()); carVO.setEnergyType(carConfig.getEnergyType());
carVO.setGearType(carConfig.getGearType()); carVO.setGearType(carConfig.getGearType());
// 查询出对象,用于赋值 ----------远调企业 // 查询出对象,用于赋值 ----------远调企业
SysEnt data = remoteEntService.getById(carVO.getEnterpriseId()).getData(); // SysEnt data = remoteEntService.getById(carVO.getEnterpriseId()).getData();
carVO.setName(data.getName()); // carVO.setName(data.getName());
// 存到 redis // 存到 redis
carManageCacheService.put(carVO.getCarVin(),carVOS); carManageCacheService.put(carVO.getCarVin(),carVOS);
}); });
@ -84,12 +79,10 @@ public class CarManageServiceImpl extends ServiceImpl<CarManageMapper, CarManage
CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class); CarManage carManage = BeanUtil.copyProperties(carDTO, CarManage.class);
return carManageMapper.selectJoinList(CarVO.class, new MPJLambdaWrapper<CarManage>() return carManageMapper.selectJoinList(CarVO.class, new MPJLambdaWrapper<CarManage>()
.selectAll(CarManage.class) // 查询所有车辆表 .selectAll(CarManage.class) // 查询所有车辆表
.select(CarCompany::getCompanyName)
.select(CarConfig::getConfigName) .select(CarConfig::getConfigName)
.select(CarConfig::getGearType) .select(CarConfig::getGearType)
.select(CarConfig::getEnergyType) .select(CarConfig::getEnergyType)
.leftJoin(CarConfig.class, CarConfig::getConfigId, CarManage::getConfigId) .leftJoin(CarConfig.class, CarConfig::getConfigId, CarManage::getConfigId)
.leftJoin(CarCompany.class, CarCompany::getEnterpriseId, CarManage::getEnterpriseId)
.eq(carManage.getCarVin() != null && carManage.getCarVin() != "", CarManage::getCarVin, carManage.getCarVin()) .eq(carManage.getCarVin() != null && carManage.getCarVin() != "", CarManage::getCarVin, carManage.getCarVin())
.eq(carManage.getCarModel() != null && carManage.getCarModel() != "", CarManage::getCarModel, carManage.getCarModel()) .eq(carManage.getCarModel() != null && carManage.getCarModel() != "", CarManage::getCarModel, carManage.getCarModel())
.eq(carManage.getCarBrand() != null && carManage.getCarBrand() != "", CarManage::getCarBrand, carManage.getCarBrand()) .eq(carManage.getCarBrand() != null && carManage.getCarBrand() != "", CarManage::getCarBrand, carManage.getCarBrand())

View File

@ -57,7 +57,7 @@ public class CarTemplateServiceImpl extends ServiceImpl<CarTemplateMapper, CarTe
// 通过 车辆类型ID 获取 车辆信息 // 通过 车辆类型ID 获取 车辆信息
CarManage carManage = carManageService.carManageShowByCarTypeId(carType.getCarTypeId()); CarManage carManage = carManageService.carManageShowByCarTypeId(carType.getCarTypeId());
// 将报文信息存储到 redis // 将报文信息存储到 redis
carTemplateCacheService.put(carManage.getCarVin(),carTemplate); // carTemplateCacheService.put(carManage.getCarVin(),carTemplate);
return carTemplate; return carTemplate;
} }
} }