证书标签

This commit is contained in:
wuchunlei
2025-04-03 11:14:25 +08:00
parent d4cfd54ed3
commit 49351eb1f8
6 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
package com.peanut.modules.common.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.UserCertificateLabel;
import java.util.List;
public interface UserCertificateLabelService extends IService<UserCertificateLabel> {
List<UserCertificateLabel> userCertificateLabelList();
}

View File

@@ -0,0 +1,36 @@
package com.peanut.modules.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.UserCertificateLabelDao;
import com.peanut.modules.common.entity.CourseMedicine;
import com.peanut.modules.common.entity.UserCertificateLabel;
import com.peanut.modules.common.service.UserCertificateLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service("commonUserCertificateLabelService")
public class UserCertificateLabelServiceImpl extends ServiceImpl<UserCertificateLabelDao, UserCertificateLabel> implements UserCertificateLabelService {
@Override
public List<UserCertificateLabel> userCertificateLabelList() {
return this.labels(0);
}
private List<UserCertificateLabel> labels(int id){
List<UserCertificateLabel> list = this.list(new LambdaQueryWrapper<UserCertificateLabel>()
.eq(UserCertificateLabel::getPid, id)
.orderByAsc(UserCertificateLabel::getSort));
for (UserCertificateLabel label : list){
if(label.getIsLast()!=1){
List<UserCertificateLabel> childrens = this.labels(label.getId());
label.setChildren(childrens);
}
}
return list;
}
}