feat: 产品中心
This commit is contained in:
parent
c99ca55169
commit
89379b1683
|
|
@ -131,10 +131,11 @@ public class ProductSeriesController extends ControllerBase{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取下拉的系列列表
|
* 获取下拉的系列列表
|
||||||
|
* @param moduleId 模块id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getSimpleList")
|
@GetMapping("/getSimpleList")
|
||||||
public ApiResult<Set<String>> getSimpleList(){
|
public ApiResult<Set<String>> getSimpleList(@Valid @RequestParam @NotNull Integer moduleId){
|
||||||
return ApiResult.success(productSeriesService.getSimpleList());
|
return ApiResult.success(productSeriesService.getSimpleList(moduleId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,9 @@ public class ProductTypeController extends ControllerBase{
|
||||||
* @param seriesName 系列名称
|
* @param seriesName 系列名称
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getSimpleList")
|
@GetMapping("/getSimpleList")
|
||||||
public ApiResult<Set<String>> getSimpleList(@Valid @RequestParam @NotBlank String seriesName){
|
public ApiResult<Set<String>> getSimpleList(@Valid @RequestParam @NotNull Integer moduleId
|
||||||
return ApiResult.success(productTypeService.getSimpleList(seriesName));
|
,@Valid @RequestParam @NotBlank String seriesName){
|
||||||
|
return ApiResult.success(productTypeService.getSimpleList(moduleId,seriesName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,15 @@ import java.time.LocalDateTime;
|
||||||
@Data
|
@Data
|
||||||
public class ProductTypeSearchRequest extends PageRequest{
|
public class ProductTypeSearchRequest extends PageRequest{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块id
|
||||||
|
*/
|
||||||
|
private Integer moduleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系列名称
|
* 系列名称
|
||||||
*/
|
*/
|
||||||
private Integer seriesName;
|
private String seriesName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ public class ProductTypeInfoVO {
|
||||||
*/
|
*/
|
||||||
private String seriesName;
|
private String seriesName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多语言数据
|
* 多语言数据
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public interface IProductSeriesService extends IService<ProductSeries> {
|
||||||
|
|
||||||
void enable(@Valid EnableRequest request);
|
void enable(@Valid EnableRequest request);
|
||||||
|
|
||||||
Set<String> getSimpleList();
|
Set<String> getSimpleList(Integer moduleId);
|
||||||
|
|
||||||
ProductSeriesInfoVO getInfo(@Valid @NotNull Integer seriesId);
|
ProductSeriesInfoVO getInfo(@Valid @NotNull Integer seriesId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import com.nflg.mobilebroken.common.pojo.vo.ProductTypeVO;
|
||||||
import com.nflg.mobilebroken.repository.entity.ProductType;
|
import com.nflg.mobilebroken.repository.entity.ProductType;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -39,7 +38,7 @@ public interface IProductTypeService extends IService<ProductType> {
|
||||||
|
|
||||||
void publish(@Valid ProductPublishRequest request);
|
void publish(@Valid ProductPublishRequest request);
|
||||||
|
|
||||||
Set<String> getSimpleList(@Valid @NotBlank String seriesName);
|
Set<String> getSimpleList(Integer moduleId,String seriesName);
|
||||||
|
|
||||||
ProductTypeInfoVO getInfo(@Valid @NotNull Integer typeId);
|
ProductTypeInfoVO getInfo(@Valid @NotNull Integer typeId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,9 +180,10 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesMapper, P
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getSimpleList() {
|
public Set<String> getSimpleList(Integer moduleId) {
|
||||||
return lambdaQuery()
|
return lambdaQuery()
|
||||||
.eq(ProductSeries::getEnable,true)
|
.eq(ProductSeries::getEnable,true)
|
||||||
|
.eq(ProductSeries::getModuleId,moduleId)
|
||||||
.list()
|
.list()
|
||||||
.stream()
|
.stream()
|
||||||
.map(ProductSeries::getName)
|
.map(ProductSeries::getName)
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,9 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getSimpleList(String seriesName) {
|
public Set<String> getSimpleList(Integer moduleId,String seriesName) {
|
||||||
return lambdaQuery()
|
return lambdaQuery()
|
||||||
|
.eq(ProductType::getModuleId, moduleId)
|
||||||
.eq(ProductType::getSeriesName, seriesName)
|
.eq(ProductType::getSeriesName, seriesName)
|
||||||
.eq(ProductType::getEnable, true)
|
.eq(ProductType::getEnable, true)
|
||||||
.list()
|
.list()
|
||||||
|
|
@ -204,6 +205,7 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
||||||
return new ProductTypeInfoVO()
|
return new ProductTypeInfoVO()
|
||||||
.setId(info.getId())
|
.setId(info.getId())
|
||||||
.setModuleId(info.getModuleId())
|
.setModuleId(info.getModuleId())
|
||||||
|
.setSort(info.getSort())
|
||||||
.setSeriesName(info.getSeriesName())
|
.setSeriesName(info.getSeriesName())
|
||||||
.setItems(productTypeInfoService.getInfo(typeId))
|
.setItems(productTypeInfoService.getInfo(typeId))
|
||||||
.setFiles(productTypeFileService.getInfo(typeId));
|
.setFiles(productTypeFileService.getInfo(typeId));
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.ProductTypeMapper">
|
<mapper namespace="com.nflg.mobilebroken.repository.mapper.ProductTypeMapper">
|
||||||
|
|
||||||
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeSearchVO">
|
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeSearchVO">
|
||||||
SELECT pt.*,() AS 'seriesName',di.name as 'moduleName'
|
SELECT pt.*,di.name as 'moduleName'
|
||||||
FROM product_type pt
|
FROM product_type pt
|
||||||
LEFT JOIN dictionary_item di ON pt.module_id=di.id
|
LEFT JOIN dictionary_item di ON pt.module_id=di.id
|
||||||
<where>
|
<where>
|
||||||
<if test="request.seriesName != null">
|
<if test="request.moduleId!=null">
|
||||||
AND pt.series_name = #{request.seriesName}
|
AND pt.module_id=#{request.moduleId}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.enable!=null">
|
<if test="request.enable!=null">
|
||||||
AND ps.enable=#{request.enable}
|
AND pt.enable=#{request.enable}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.state != null">
|
<if test="request.state != null">
|
||||||
AND pt.state = #{request.state}
|
AND pt.state = #{request.state}
|
||||||
|
|
@ -22,11 +22,14 @@
|
||||||
<if test="request.endTime != null">
|
<if test="request.endTime != null">
|
||||||
AND pt.publish_time <= #{request.endTime}
|
AND pt.publish_time <= #{request.endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="request.seriesName != null">
|
||||||
|
AND pt.series_name = #{request.seriesName}
|
||||||
|
</if>
|
||||||
<if test="request.name != null and request.name != ''">
|
<if test="request.name != null and request.name != ''">
|
||||||
AND pt.name LIKE CONCAT('%', #{request.name}, '%')
|
AND pt.name LIKE CONCAT('%', #{request.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY pt.state,pt.series_id,pt.name,pt.publish_time DESC
|
ORDER BY pt.state,pt.series_name,pt.name,pt.publish_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="get" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeVO">
|
<select id="get" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductTypeVO">
|
||||||
|
|
@ -34,6 +37,6 @@
|
||||||
FROM product_type pt
|
FROM product_type pt
|
||||||
LEFT JOIN product_type_info pti ON pti.type_id=pt.id AND pti.language_code=#{language}
|
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}
|
WHERE pt.state=1 AND pt.enable=1 AND pt.module_id=#{moduleId} AND pt.series_name=#{seriesNo}
|
||||||
ORDER BY pt.sort DESC
|
ORDER BY pt.sort
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue