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