feat: 产品中心
This commit is contained in:
parent
0596db6631
commit
55a950fc36
|
|
@ -16,5 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
*/
|
*/
|
||||||
public interface ProductAttrMapper extends BaseMapper<ProductAttr> {
|
public interface ProductAttrMapper extends BaseMapper<ProductAttr> {
|
||||||
|
|
||||||
IPage<ProductAttrSearchVO> getList(ProductAttrSearchRequest request);
|
IPage<ProductAttrSearchVO> getList(ProductAttrSearchRequest request, IPage<?> page);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@ package com.nflg.mobilebroken.repository.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.mobilebroken.common.constant.Constant;
|
import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.*;
|
import com.nflg.mobilebroken.common.pojo.request.*;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.ProductAttrInfoVO;
|
import com.nflg.mobilebroken.common.pojo.vo.ProductAttrInfoVO;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.ProductAttrSearchVO;
|
import com.nflg.mobilebroken.common.pojo.vo.ProductAttrSearchVO;
|
||||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||||
|
import com.nflg.mobilebroken.common.util.VUtils;
|
||||||
import com.nflg.mobilebroken.repository.entity.ProductAttr;
|
import com.nflg.mobilebroken.repository.entity.ProductAttr;
|
||||||
import com.nflg.mobilebroken.repository.mapper.ProductAttrMapper;
|
import com.nflg.mobilebroken.repository.mapper.ProductAttrMapper;
|
||||||
import com.nflg.mobilebroken.repository.service.IProductAttrInfoService;
|
import com.nflg.mobilebroken.repository.service.IProductAttrInfoService;
|
||||||
|
|
@ -17,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -80,12 +83,13 @@ public class ProductAttrServiceImpl extends ServiceImpl<ProductAttrMapper, Produ
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<ProductAttrSearchVO> getList(ProductAttrSearchRequest request) {
|
public IPage<ProductAttrSearchVO> getList(ProductAttrSearchRequest request) {
|
||||||
return baseMapper.getList(request);
|
return baseMapper.getList(request,new Page<>(request.getPage(),request.getPageSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductAttrInfoVO getInfo(Integer id) {
|
public ProductAttrInfoVO getInfo(Integer id) {
|
||||||
ProductAttr info = getById(id);
|
ProductAttr info = getById(id);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
return new ProductAttrInfoVO()
|
return new ProductAttrInfoVO()
|
||||||
.setId(info.getId())
|
.setId(info.getId())
|
||||||
.setItems(productAttrInfoService.getInfo(id));
|
.setItems(productAttrInfoService.getInfo(id));
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@ public class ProductHonorServiceImpl extends ServiceImpl<ProductHonorMapper, Pro
|
||||||
@Override
|
@Override
|
||||||
public ProductHonorInfoVO getInfo(Integer honorId) {
|
public ProductHonorInfoVO getInfo(Integer honorId) {
|
||||||
ProductHonor info = getById(honorId);
|
ProductHonor info = getById(honorId);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
return new ProductHonorInfoVO()
|
return new ProductHonorInfoVO()
|
||||||
.setId(info.getId())
|
.setId(info.getId())
|
||||||
.setObtainingTime(info.getObtainingTime())
|
.setObtainingTime(info.getObtainingTime())
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ public class ProductIntroServiceImpl extends ServiceImpl<ProductIntroMapper, Pro
|
||||||
@Override
|
@Override
|
||||||
public ProductIntroInfoVO getInfo(Integer introId) {
|
public ProductIntroInfoVO getInfo(Integer introId) {
|
||||||
ProductIntro info=getById(introId);
|
ProductIntro info=getById(introId);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
return new ProductIntroInfoVO()
|
return new ProductIntroInfoVO()
|
||||||
.setId(info.getId())
|
.setId(info.getId())
|
||||||
.setDictionaryItemId(info.getDictionaryItemId())
|
.setDictionaryItemId(info.getDictionaryItemId())
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ public class ProductMobilebrokenIntroServiceImpl extends ServiceImpl<ProductMobi
|
||||||
@Override
|
@Override
|
||||||
public ProductMobilebrokenIntroInfoVO getInfo(Integer introId) {
|
public ProductMobilebrokenIntroInfoVO getInfo(Integer introId) {
|
||||||
ProductMobilebrokenIntro intro = getById(introId);
|
ProductMobilebrokenIntro intro = getById(introId);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(intro)).throwMessage("无效的数据");
|
||||||
return new ProductMobilebrokenIntroInfoVO()
|
return new ProductMobilebrokenIntroInfoVO()
|
||||||
.setId(intro.getId())
|
.setId(intro.getId())
|
||||||
.setItems(productMobilebrokenIntroInfoService.getInfo(introId));
|
.setItems(productMobilebrokenIntroInfoService.getInfo(introId));
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, Produ
|
||||||
@Override
|
@Override
|
||||||
public ProductPartInfoVO getInfo(Integer partId) {
|
public ProductPartInfoVO getInfo(Integer partId) {
|
||||||
ProductPartInfoVO part = baseMapper.getInfo(partId);
|
ProductPartInfoVO part = baseMapper.getInfo(partId);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(part)).throwMessage("无效的数据");
|
||||||
part.setItems(productPartInfoService.getInfo(partId));
|
part.setItems(productPartInfoService.getInfo(partId));
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
||||||
@Override
|
@Override
|
||||||
public ProductTypeInfoVO getInfo(Integer typeId) {
|
public ProductTypeInfoVO getInfo(Integer typeId) {
|
||||||
ProductType info = getById(typeId);
|
ProductType info = getById(typeId);
|
||||||
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
return new ProductTypeInfoVO()
|
return new ProductTypeInfoVO()
|
||||||
.setId(info.getId())
|
.setId(info.getId())
|
||||||
.setSeriesName(info.getSeriesName())
|
.setSeriesName(info.getSeriesName())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue