package com.xiaopeng.maintenance.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xiaopeng.api.model.maintenance.XpErrorType; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.maintenance.mapper.XpErrorTypeMapper; import com.xiaopeng.maintenance.service.IXpErrorTypeService; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** *

* 意见反馈类型表 服务实现类 *

* * @author mitao * @since 2026-02-03 */ @Service public class XpErrorTypeServiceImpl extends ServiceImpl implements IXpErrorTypeService { @Override public R> errorTypeList() { Map> errorType = this.lambdaQuery().list() .stream().collect(Collectors.groupingBy(XpErrorType::getParentId)); List xpErrorTypes = errorType.get(0L); for (XpErrorType xpErrorType : xpErrorTypes) { xpErrorType.setChild(errorType.get(xpErrorType.getId())); } return R.ok(xpErrorTypes); } }