|
|
@ -54,7 +54,7 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
* @return ai 识别类型 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public AiLabelVo queryById(Long labelId){ |
|
|
|
public AiLabelVo queryById(Long labelId) { |
|
|
|
return baseMapper.selectVoById(labelId); |
|
|
|
} |
|
|
|
|
|
|
@ -132,7 +132,7 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
/** |
|
|
|
* 保存前的数据校验 |
|
|
|
*/ |
|
|
|
private void validEntityBeforeSave(AiLabel entity){ |
|
|
|
private void validEntityBeforeSave(AiLabel entity) { |
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
} |
|
|
|
|
|
|
@ -145,7 +145,7 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|
|
|
if(isValid){ |
|
|
|
if (isValid) { |
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
} |
|
|
|
return baseMapper.deleteByIds(ids) > 0; |
|
|
@ -154,7 +154,7 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
@Override |
|
|
|
public List<AiLabel> queryListByLabel(List<Long> labelIds) { |
|
|
|
QueryWrapper<AiLabel> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.in(!labelIds.isEmpty(),"label_id",labelIds); |
|
|
|
queryWrapper.in(!labelIds.isEmpty(), "label_id", labelIds); |
|
|
|
return this.baseMapper.selectList(queryWrapper); |
|
|
|
} |
|
|
|
|
|
|
@ -165,10 +165,10 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<AiLabelVo> selectLabelByList(String postCode) { |
|
|
|
SysPostVo sysPostVo = sysPostService.selectLableByList(postCode,null); |
|
|
|
if(sysPostVo != null){ |
|
|
|
SysPostVo sysPostVo = sysPostService.selectLableByList(postCode, null); |
|
|
|
if (sysPostVo != null) { |
|
|
|
List<AiLabelPostVo> postVoList = aiLabelPostService.queryListByLabel(sysPostVo.getPostId()); |
|
|
|
return postVoList.stream() |
|
|
|
return postVoList.stream() |
|
|
|
.map(aiLabel -> { |
|
|
|
AiLabelVo aiLabelVo = new AiLabelVo(); |
|
|
|
aiLabelVo.setLabelId(aiLabel.getLabelId()); |
|
|
@ -181,4 +181,21 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
} |
|
|
|
return ListUtil.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<AiLabelVo> selectLabelList() { |
|
|
|
List<AiLabelPostVo> aiLabelList = aiLabelPostService.getAiLabelList(); |
|
|
|
return aiLabelList.stream() |
|
|
|
.map(aiLabel -> { |
|
|
|
AiLabelVo aiLabelVo = new AiLabelVo(); |
|
|
|
aiLabelVo.setLabelId(aiLabel.getLabelId()); |
|
|
|
aiLabelVo.setLabelEn(aiLabel.getLabelEn()); |
|
|
|
aiLabelVo.setLabelCn(aiLabel.getLabelCn()); |
|
|
|
aiLabelVo.setAiName(aiLabel.getAiName()); |
|
|
|
return aiLabelVo; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|