feat: 产品中心
This commit is contained in:
parent
878c73d602
commit
88cfd1df74
|
|
@ -3,6 +3,8 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors
|
||||
public class FrontendProductModelSearchVO {
|
||||
|
|
@ -53,4 +55,9 @@ public class FrontendProductModelSearchVO {
|
|||
* 机型特点
|
||||
*/
|
||||
private String feature;
|
||||
|
||||
/**
|
||||
* 主要参数列表
|
||||
*/
|
||||
private List<ProductModelParamVO> params;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class FrontendProductTypeSearchVO extends FrontendProductSeriesSearchVO{
|
||||
|
|
@ -16,4 +18,9 @@ public class FrontendProductTypeSearchVO extends FrontendProductSeriesSearchVO{
|
|||
* 机型说明
|
||||
*/
|
||||
private String modelDesc;
|
||||
|
||||
/**
|
||||
* 机型列表
|
||||
*/
|
||||
private List<ProductModelSimpleVO> models;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,21 @@ public class ProductModelSimpleVO {
|
|||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模块ID
|
||||
*/
|
||||
private Integer moduleId;
|
||||
|
||||
/**
|
||||
* 系列名称
|
||||
*/
|
||||
private String seriesName;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 机型型号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,11 +2,18 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductTypeVO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 系列名称
|
||||
*/
|
||||
private String seriesName;
|
||||
|
||||
/**
|
||||
* 类型编号
|
||||
*/
|
||||
|
|
@ -26,4 +33,9 @@ public class ProductTypeVO {
|
|||
* 类型介绍
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 机型列表
|
||||
*/
|
||||
private List<ProductModelSimpleVO> models;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ package com.nflg.mobilebroken.repository.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ProductModelSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.FrontendProductModelSearchVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelInfoVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelSearchVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.*;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModel;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -28,4 +25,6 @@ public interface ProductModelMapper extends BaseMapper<ProductModel> {
|
|||
ProductModelInfoVO getInfo(Integer modelId, String language);
|
||||
|
||||
Page<FrontendProductModelSearchVO> search(String name, String language, Page<?> page);
|
||||
|
||||
List<ProductModelSimpleVO> getSimpleList(Integer moduleId, String seriesName, String typeNo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,4 +48,6 @@ public interface IProductModelService extends IService<ProductModel> {
|
|||
void saveSort(@NotEmpty List<Integer> ids);
|
||||
|
||||
Page<FrontendProductModelSearchVO> search(@Valid ProductSeriesSearchRequest request, String language);
|
||||
|
||||
List<ProductModelSimpleVO> getSimpleList(Integer moduleId, String seriesName, String typeNo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,16 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
|
||||
@Override
|
||||
public Page<FrontendProductModelSearchVO> search(ProductSeriesSearchRequest request, String language) {
|
||||
return baseMapper.search(request.getName(),language,new Page<>(request.getPage(), request.getPageSize()));
|
||||
Page<FrontendProductModelSearchVO> datas=baseMapper.search(request.getName(),language,new Page<>(request.getPage(), request.getPageSize()));
|
||||
datas.getRecords().forEach(it->{
|
||||
it.setParams(productPartParamsService.getListByLanguage(it.getId(), language,true));
|
||||
});
|
||||
return datas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelSimpleVO> getSimpleList(Integer moduleId, String seriesName, String typeNo) {
|
||||
return baseMapper.getSimpleList(moduleId,seriesName,typeNo);
|
||||
}
|
||||
|
||||
private ProductModelCompareInfoVO getModelCompareInfo(Integer modelId, String language){
|
||||
|
|
|
|||
|
|
@ -101,7 +101,11 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
|
||||
@Override
|
||||
public List<ProductTypeVO> get(Integer moduleId,String seriesNo,String language) {
|
||||
return baseMapper.get(moduleId,seriesNo,language);
|
||||
List<ProductTypeVO> vos=baseMapper.get(moduleId,seriesNo,language);
|
||||
vos.forEach(vo->{
|
||||
vo.setModels(productModelService.getSimpleList(moduleId,vo.getSeriesName(),vo.getTypeNo()));
|
||||
});
|
||||
return vos;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -252,7 +256,11 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
|
||||
@Override
|
||||
public Page<FrontendProductTypeSearchVO> search(ProductSeriesSearchRequest request, String language) {
|
||||
return baseMapper.search(request.getName(), language, new Page<>(request.getPage(), request.getPageSize()));
|
||||
Page<FrontendProductTypeSearchVO> datas=baseMapper.search(request.getName(), language, new Page<>(request.getPage(), request.getPageSize()));
|
||||
datas.getRecords().forEach(it->{
|
||||
it.setModels(productModelService.getSimpleList(it.getModuleId(), it.getSeriesName(), it.getName()));
|
||||
});
|
||||
return datas;
|
||||
}
|
||||
|
||||
private void delete(Integer typeId){
|
||||
|
|
|
|||
|
|
@ -66,4 +66,12 @@
|
|||
AND (pm.`no` LIKE CONCAT('%', #{name}, '%') OR pmii.`desc` LIKE CONCAT('%', #{name}, '%') OR
|
||||
pmii.feature LIKE CONCAT('%', #{name}, '%'))
|
||||
</select>
|
||||
|
||||
<select id="getSimpleList" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO">
|
||||
SELECT *
|
||||
FROM product_model
|
||||
WHERE `enable`=1 AND state=1 AND module_id=#{moduleId} AND series_name=#{seriesName} AND type_name=#{typeNo}
|
||||
ORDER BY recommend DESC,sort,id DESC
|
||||
LIMIT 8
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</select>
|
||||
|
||||
<select id="get" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeVO">
|
||||
SELECT pt.id,pt.name as 'typeNo',pti.*
|
||||
SELECT pt.id,pt.series_name,pt.name as 'typeNo',pti.*
|
||||
FROM product_type pt
|
||||
LEFT JOIN product_type_info pti ON pti.type_id=pt.id AND pti.language_code=#{language}
|
||||
WHERE pt.state=1 AND pt.enable=1 AND pt.module_id=#{moduleId} AND pt.series_name=#{seriesNo}
|
||||
|
|
|
|||
Loading…
Reference in New Issue