feat: 类型排序增加系列批次号条件

This commit is contained in:
曹鹏飞 2025-07-08 15:08:45 +08:00
parent b47600b88b
commit 68995b9f43
5 changed files with 8 additions and 7 deletions

View File

@ -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));
}
/**

View File

@ -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);
}

View File

@ -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);

View File

@ -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

View File

@ -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>