更改商品bug

This commit is contained in:
liuyingfang
2024-03-05 16:38:12 +08:00
parent 5463204fb5
commit c6744bc012
17 changed files with 72 additions and 56 deletions

View File

@@ -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转回实体也可能需要实现反向的映射方法