更改商品bug
This commit is contained in:
@@ -19,6 +19,7 @@ import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.product.TbProductGroup;
|
||||
import cn.ysk.cashier.dto.product.TbProductGroupDto;
|
||||
|
||||
import cn.ysk.cashier.utils.ListUtil;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import org.mapstruct.Mapping;
|
||||
@@ -38,13 +39,7 @@ import java.util.stream.Collectors;
|
||||
public interface TbProductGroupMapper extends BaseMapper<TbProductGroupDto, TbProductGroup> {
|
||||
// 自定义的字符串到整数列表的转换方法
|
||||
default List<Integer> map(String value) {
|
||||
if (value == null || value.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 分割字符串,然后将每个数字字符串转换为Integer,收集到List中
|
||||
return Arrays.stream(value.split(","))
|
||||
.map(Integer::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
return ListUtil.stringChangeIntegerList(value);
|
||||
}
|
||||
|
||||
// 如果需要从DTO转回实体,也可能需要实现反向的映射方法
|
||||
|
||||
Reference in New Issue
Block a user