服务指令bug修复
This commit is contained in:
parent
2f3d6c38f0
commit
9a7761dd12
|
@ -26,6 +26,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
||||
|
@ -69,6 +70,14 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
customeRuleMap.put("izEnabled", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<ConfigServiceDirective> queryWrapper = QueryGenerator.initQueryWrapper(configServiceDirective, req.getParameterMap(), customeRuleMap);
|
||||
queryWrapper.select("id");
|
||||
//如果有服务指令需要提前查询下对应的服务指令id
|
||||
List<ConfigServiceDirective> directiveIds = null;
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByTagIds(configServiceDirective.getTags());
|
||||
if(directiveIds != null && !directiveIds.isEmpty()){
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
Page<ConfigServiceDirective> page = new Page<ConfigServiceDirective>(pageNo, pageSize);
|
||||
IPage<ConfigServiceDirective> list = configServiceDirectiveService.page(page, queryWrapper);
|
||||
List<ConfigServiceDirective> pageList = service.pageList(configServiceDirective, list);
|
||||
|
|
|
@ -35,6 +35,12 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
|||
|
||||
int saveTags(@Param("directive") ConfigServiceDirective configServiceDirective);
|
||||
|
||||
/**
|
||||
* 根据指令标签查询对应的服务指令id
|
||||
* @return
|
||||
*/
|
||||
List<ConfigServiceDirective> queryDirectiveIdByTagIds(@Param("tagIds") String tagIds);
|
||||
|
||||
/**
|
||||
* 查询指令标签是否被使用
|
||||
* @return
|
||||
|
|
|
@ -76,6 +76,13 @@
|
|||
ORDER BY c.category_id ASC, c.type_id ASC, c.instruction_tag_id ASC,c.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryDirectiveIdByTagIds" resultType="com.nu.modules.serviceDirective.entity.ConfigServiceDirective">
|
||||
SELECT distinct directive_id as id FROM nu_directive_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds.split(',')" item="tagId" open="(" separator="," close=")">
|
||||
#{tagId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryCountByTagIds" resultType="java.lang.Integer">
|
||||
SELECT COUNT(*) FROM nu_directive_tag WHERE tag_id IN
|
||||
<foreach collection="tagIds" item="item" open="(" separator="," close=")">
|
||||
|
|
|
@ -32,4 +32,6 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
|||
* @param configServiceDirective
|
||||
*/
|
||||
void removeTags(ConfigServiceDirective configServiceDirective);
|
||||
|
||||
List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags);
|
||||
}
|
||||
|
|
|
@ -179,4 +179,9 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
|||
public void removeTags(ConfigServiceDirective configServiceDirective) {
|
||||
baseMapper.deleteTags(configServiceDirective);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags) {
|
||||
return baseMapper.queryDirectiveIdByTagIds(tags);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue