|
|
@ -8,13 +8,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.dromara.system.domain.AiLabelPost; |
|
|
|
import org.dromara.system.domain.vo.AiLabelPostVo; |
|
|
|
import org.dromara.system.mapper.AiLabelMapper; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.dromara.system.domain.bo.AiLablePostBo; |
|
|
|
import org.dromara.system.domain.vo.AiLablePostVo; |
|
|
|
import org.dromara.system.domain.AiLablePost; |
|
|
|
import org.dromara.system.mapper.AiLablePostMapper; |
|
|
|
import org.dromara.system.service.IAiLablePostService; |
|
|
|
import org.dromara.system.domain.bo.AiLabelPostBo; |
|
|
|
import org.dromara.system.mapper.AiLabelPostMapper; |
|
|
|
import org.dromara.system.service.IAiLabelPostService; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -28,9 +28,9 @@ import java.util.Collection; |
|
|
|
*/ |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Service |
|
|
|
public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
public class AiLablePostServiceImpl implements IAiLabelPostService { |
|
|
|
|
|
|
|
private final AiLablePostMapper baseMapper; |
|
|
|
private final AiLabelPostMapper baseMapper; |
|
|
|
private final AiLabelMapper aiLabelMapper; |
|
|
|
|
|
|
|
/** |
|
|
@ -40,7 +40,7 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
* @return 职能-标签关系 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public AiLablePostVo queryById(Long lableId){ |
|
|
|
public AiLabelPostVo queryById(Long lableId){ |
|
|
|
return baseMapper.selectVoById(lableId); |
|
|
|
} |
|
|
|
|
|
|
@ -52,10 +52,10 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
* @return 职能-标签关系分页列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public TableDataInfo<AiLablePostVo> queryPageList(AiLablePostBo bo, PageQuery pageQuery) { |
|
|
|
public TableDataInfo<AiLabelPostVo> queryPageList(AiLabelPostBo bo, PageQuery pageQuery) { |
|
|
|
QueryWrapper queryWrapper = new QueryWrapper(); |
|
|
|
queryWrapper.eq("a.post_id", bo.getPostId()); |
|
|
|
Page<AiLablePostVo> result = baseMapper.selectAiLablePostPage(pageQuery.build(), queryWrapper); |
|
|
|
Page<AiLabelPostVo> result = baseMapper.selectAiLabelPostPage(pageQuery.build(), queryWrapper); |
|
|
|
return TableDataInfo.build(result); |
|
|
|
} |
|
|
|
|
|
|
@ -66,14 +66,14 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
* @return 职能-标签关系列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<AiLablePostVo> queryList(AiLablePostBo bo) { |
|
|
|
LambdaQueryWrapper<AiLablePost> lqw = buildQueryWrapper(bo); |
|
|
|
public List<AiLabelPostVo> queryList(AiLabelPostBo bo) { |
|
|
|
LambdaQueryWrapper<AiLabelPost> lqw = buildQueryWrapper(bo); |
|
|
|
return baseMapper.selectVoList(lqw); |
|
|
|
} |
|
|
|
|
|
|
|
private LambdaQueryWrapper<AiLablePost> buildQueryWrapper(AiLablePostBo bo) { |
|
|
|
private LambdaQueryWrapper<AiLabelPost> buildQueryWrapper(AiLabelPostBo bo) { |
|
|
|
Map<String, Object> params = bo.getParams(); |
|
|
|
LambdaQueryWrapper<AiLablePost> lqw = Wrappers.lambdaQuery(); |
|
|
|
LambdaQueryWrapper<AiLabelPost> lqw = Wrappers.lambdaQuery(); |
|
|
|
return lqw; |
|
|
|
} |
|
|
|
|
|
|
@ -84,12 +84,12 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
* @return 是否新增成功 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Boolean insertByBo(AiLablePostBo bo) { |
|
|
|
AiLablePost add = MapstructUtils.convert(bo, AiLablePost.class); |
|
|
|
public Boolean insertByBo(AiLabelPostBo bo) { |
|
|
|
AiLabelPost add = MapstructUtils.convert(bo, AiLabelPost.class); |
|
|
|
validEntityBeforeSave(add); |
|
|
|
boolean flag = baseMapper.insert(add) > 0; |
|
|
|
if (flag) { |
|
|
|
bo.setLableId(add.getLableId()); |
|
|
|
bo.setLableId(add.getLabelId()); |
|
|
|
} |
|
|
|
return flag; |
|
|
|
} |
|
|
@ -101,8 +101,8 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
* @return 是否修改成功 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Boolean updateByBo(AiLablePostBo bo) { |
|
|
|
AiLablePost update = MapstructUtils.convert(bo, AiLablePost.class); |
|
|
|
public Boolean updateByBo(AiLabelPostBo bo) { |
|
|
|
AiLabelPost update = MapstructUtils.convert(bo, AiLabelPost.class); |
|
|
|
validEntityBeforeSave(update); |
|
|
|
return baseMapper.updateById(update) > 0; |
|
|
|
} |
|
|
@ -110,7 +110,7 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
/** |
|
|
|
* 保存前的数据校验 |
|
|
|
*/ |
|
|
|
private void validEntityBeforeSave(AiLablePost entity){ |
|
|
|
private void validEntityBeforeSave(AiLabelPost entity){ |
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
} |
|
|
|
|
|
|
@ -130,7 +130,7 @@ public class AiLablePostServiceImpl implements IAiLablePostService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<AiLablePostVo> queryListByLable(Long postId) { |
|
|
|
public List<AiLabelPostVo> queryListByLabel(Long postId) { |
|
|
|
return List.of(); |
|
|
|
} |
|
|
|
} |
|
|
|