upd
parent
68a64a9382
commit
1e8f75ede5
|
@ -1,5 +1,8 @@
|
||||||
package com.dragon.vehicle.firm.domain.common;
|
package com.dragon.vehicle.firm.domain.common;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.dragon.common.core.annotation.Excel;
|
import com.dragon.common.core.annotation.Excel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -16,10 +19,12 @@ import lombok.NoArgsConstructor;
|
||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@TableName("firm_info")
|
||||||
public class FirmInfo {
|
public class FirmInfo {
|
||||||
/**
|
/**
|
||||||
*编号
|
*编号
|
||||||
*/
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
@Excel(name = "编号")
|
@Excel(name = "编号")
|
||||||
private String firmId;
|
private String firmId;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package dragon.vehicle.firm.server.controller;
|
package dragon.vehicle.firm.server.controller;
|
||||||
|
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.common.security.utils.SecurityUtils;
|
|
||||||
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
||||||
import dragon.vehicle.firm.server.service.FirmService;
|
import dragon.vehicle.firm.server.service.FirmInfoService;
|
||||||
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.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -17,13 +16,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/firm")
|
@RequestMapping("/firm")
|
||||||
public class FirmController {
|
public class FirmInfoController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*注入公司service
|
*注入公司service
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private FirmService firmService;
|
private FirmInfoService firmService;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @description: 通过userId获取用户的公司
|
* @description: 通过userId获取用户的公司
|
|
@ -11,5 +11,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
* @date 2023/11/21 13:57
|
* @date 2023/11/21 13:57
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface FirmMapper extends BaseMapper<FirmInfo> {
|
public interface FirmInfoMapper extends BaseMapper<FirmInfo> {
|
||||||
}
|
}
|
|
@ -10,7 +10,7 @@ import com.dragon.vehicle.firm.domain.common.FirmInfo;
|
||||||
* @description:
|
* @description:
|
||||||
* @date 2023/11/21 13:57
|
* @date 2023/11/21 13:57
|
||||||
*/
|
*/
|
||||||
public interface FirmService extends IService<FirmInfo> {
|
public interface FirmInfoService extends IService<FirmInfo> {
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.dragon.common.redis.service.RedisService;
|
import com.dragon.common.redis.service.RedisService;
|
||||||
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
import com.dragon.vehicle.firm.domain.cache.FirmInfoCache;
|
||||||
import com.dragon.vehicle.firm.domain.common.FirmInfo;
|
import com.dragon.vehicle.firm.domain.common.FirmInfo;
|
||||||
import dragon.vehicle.firm.server.mapper.FirmMapper;
|
import dragon.vehicle.firm.server.mapper.FirmInfoMapper;
|
||||||
import dragon.vehicle.firm.server.service.FirmService;
|
import dragon.vehicle.firm.server.service.FirmInfoService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -20,10 +20,10 @@ import org.springframework.util.Assert;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implements FirmService {
|
public class FirmInfoServiceImpl extends ServiceImpl<FirmInfoMapper,FirmInfo> implements FirmInfoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FirmMapper firmMapper;
|
private FirmInfoMapper firmInfoMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
@ -45,7 +45,7 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, FirmInfo> implement
|
||||||
LambdaQueryWrapper<FirmInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<FirmInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
Assert.notNull(userId,"用户不能为空");
|
Assert.notNull(userId,"用户不能为空");
|
||||||
queryWrapper.eq(FirmInfo::getCreateBy,userId);
|
queryWrapper.eq(FirmInfo::getCreateBy,userId);
|
||||||
firmInfoCache= FirmInfoCache.getCache(firmMapper.selectOne(queryWrapper));
|
firmInfoCache= FirmInfoCache.getCache(firmInfoMapper.selectOne(queryWrapper));
|
||||||
log.info(firmInfoCache);
|
log.info(firmInfoCache);
|
||||||
return firmInfoCache;
|
return firmInfoCache;
|
||||||
}
|
}
|
Loading…
Reference in New Issue