Merge branch 'feature/product' into develop
This commit is contained in:
commit
ae8a4e2cde
|
|
@ -146,10 +146,11 @@ public class ProductModelController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取机型列表用于排序
|
||||
* @param typeNumber 类型系列号
|
||||
*/
|
||||
@GetMapping("/getListForSort")
|
||||
public ApiResult<List<ProductModelSearchVO>> getListForSort(){
|
||||
return ApiResult.success(productModelService.getListForSort());
|
||||
public ApiResult<List<ProductModelSearchVO>> getListForSort(@Valid @RequestParam @NotNull String typeNumber){
|
||||
return ApiResult.success(productModelService.getListForSort(typeNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -105,10 +105,11 @@ public class ProductTypeController extends ControllerBase{
|
|||
|
||||
/**
|
||||
* 获取类型列表用于排序
|
||||
* @param seriesNumber 系列批次号
|
||||
*/
|
||||
@GetMapping("/getTypeListForSort")
|
||||
public ApiResult<List<ProductTypeSearchVO>> getTypeListForSort(){
|
||||
return ApiResult.success(productTypeService.getListForSort());
|
||||
public ApiResult<List<ProductTypeSearchVO>> getTypeListForSort(@Valid @RequestParam @NotNull String seriesNumber){
|
||||
return ApiResult.success(productTypeService.getListForSort(seriesNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,11 +69,60 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
<excludeGroupIds>${project.groupId}</excludeGroupIds>
|
||||
<includeScope>runtime</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.nflg.mobilebroken.auth.AuthApplication</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>${project.groupId}:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -69,19 +69,61 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||
<excludeGroupIds>${project.groupId}</excludeGroupIds>
|
||||
<includeScope>runtime</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.nflg.mobilebroken.product.ProductApplication</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>${project.groupId}:*</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ public interface ProductModelMapper extends BaseMapper<ProductModel> {
|
|||
|
||||
List<ProductModelSimpleVO> getSimpleList(String typeNumber);
|
||||
|
||||
List<ProductModelSearchVO> getListForSort();
|
||||
List<ProductModelSearchVO> getListForSort(String typeNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,4 +31,6 @@ public interface ProductModelParamsMapper extends BaseMapper<ProductModelParams>
|
|||
List<ParamsSortListVO> getImportantParamsListForSort(Integer paramId, String language);
|
||||
|
||||
List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language);
|
||||
|
||||
List<ProductModelParamVO> getCompareListByLanguage(Integer modelId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ public interface ProductTypeMapper extends BaseMapper<ProductType> {
|
|||
|
||||
List<ProductTypeSimpleVO> getSimpleListByLanguage(String batchNumber, String language);
|
||||
|
||||
List<ProductTypeSearchVO> getListForSort();
|
||||
List<ProductTypeSearchVO> getListForSort(String seriesNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,6 @@ public interface IProductModelParamsService extends IService<ProductModelParams>
|
|||
void saveImportantSort(@Valid ParamsSortSaveRequest request);
|
||||
|
||||
List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language);
|
||||
|
||||
List<ProductModelParamVO> getCompareListByLanguage(Integer modelId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public interface IProductModelService extends IService<ProductModel> {
|
|||
|
||||
void deleteByParent(String typeNumber);
|
||||
|
||||
List<ProductModelSearchVO> getListForSort();
|
||||
List<ProductModelSearchVO> getListForSort(String typeNumber);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public interface IProductTypeService extends IService<ProductType> {
|
|||
|
||||
void deleteByParent(String name);
|
||||
|
||||
List<ProductTypeSearchVO> getListForSort();
|
||||
List<ProductTypeSearchVO> getListForSort(String seriesNumber);
|
||||
|
||||
void saveSort(SortSaveRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -289,4 +289,9 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
public List<ProductParamsItemVO> getImportantListByLanguage(Integer modelId, String language) {
|
||||
return baseMapper.getImportantListByLanguage(modelId,language);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelParamVO> getCompareListByLanguage(Integer modelId, String language) {
|
||||
return baseMapper.getCompareListByLanguage(modelId,language);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.eq(ProductModel::getTypeNumber, typeNumber)
|
||||
.eq(ProductModel::getEnable, true)
|
||||
.eq(ProductModel::getState, PublishState.Published.getState())
|
||||
.orderByAsc(ProductModel::getSort)
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(list)){
|
||||
return list.stream().map(item -> new ProductModelVO()
|
||||
|
|
@ -355,7 +356,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelSearchVO> getListForSort() {
|
||||
public List<ProductModelSearchVO> getListForSort(String typeNumber) {
|
||||
// return Convert.toList(ProductModelSearchVO.class,
|
||||
// lambdaQuery()
|
||||
// .eq(ProductModel::getEnable, true)
|
||||
|
|
@ -364,7 +365,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
// .orderByAsc(ProductModel::getSort)
|
||||
// .list()
|
||||
// );
|
||||
return baseMapper.getListForSort();
|
||||
return baseMapper.getListForSort(typeNumber);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
@ -410,6 +411,6 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.setId(productModel.getId())
|
||||
.setNo(productModel.getNo())
|
||||
.setImage(productModel.getImage())
|
||||
.setParams(productPartParamsService.getAllListByLanguage(modelId, language));
|
||||
.setParams(productPartParamsService.getCompareListByLanguage(modelId, language));
|
||||
}
|
||||
}
|
||||
|
|
@ -266,8 +266,8 @@ public class ProductTypeServiceImpl extends ServiceImpl<ProductTypeMapper, Produ
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ProductTypeSearchVO> getListForSort() {
|
||||
return baseMapper.getListForSort();
|
||||
public List<ProductTypeSearchVO> getListForSort(String seriesNumber) {
|
||||
return baseMapper.getListForSort(seriesNumber);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
select *
|
||||
,(SELECT `name` FROM product_type WHERE batch_number=type_number AND state!=2 ORDER BY state DESC LIMIT 1) as 'typeName'
|
||||
from product_model
|
||||
where enable=1 and state=1
|
||||
where enable=1 and state=1 and type_number=#{typeNumber}
|
||||
order by typeName, sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -65,4 +65,15 @@
|
|||
AND pmpi.language_code = #{language}
|
||||
ORDER BY pmpi.important_sort
|
||||
</select>
|
||||
|
||||
<select id="getCompareListByLanguage" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductModelParamVO">
|
||||
SELECT pmpi.index_name, pmpi.`name`, pmpi.`value`
|
||||
FROM product_model_params pmp
|
||||
INNER JOIN product_model_params_item pmpi ON pmp.id = pmpi.model_params_id
|
||||
WHERE pmp.model_id = #{modelId}
|
||||
AND pmp.state = 1
|
||||
AND pmpi.compare = 1
|
||||
AND pmpi.language_code = #{language}
|
||||
ORDER BY pmpi.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
FROM product_series ps
|
||||
LEFT JOIN product_series_info psi ON psi.series_id = ps.id AND psi.language_code = #{language}
|
||||
WHERE ps.state = 1 AND ps.enable = 1 AND ps.module_id = #{moduleId}
|
||||
ORDER BY ps.sort DESC
|
||||
ORDER BY ps.sort
|
||||
</select>
|
||||
|
||||
<select id="copyItems">
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
select *
|
||||
,(SELECT `name` FROM product_series WHERE batch_number=series_number AND state!=2 ORDER BY state DESC LIMIT 1) as 'seriesName'
|
||||
from product_type
|
||||
where enable=1 and state=1
|
||||
where enable=1 and state=1 and series_number=#{seriesNumber}
|
||||
order by seriesName, sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue