临时提交
This commit is contained in:
parent
6f6b879821
commit
9c7e12caf7
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.servicedirective.controller;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -56,10 +57,16 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
//@AutoLog(value = "服务指令-分页列表查询")
|
||||
@ApiOperation(value = "服务指令-分页列表查询", notes = "服务指令-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ConfigServiceDirective>> queryPageList(ConfigServiceDirective configServiceDirective,
|
||||
@DS("#dataSourceCode")
|
||||
public Result<IPage<ConfigServiceDirective>> queryPageList(String dataSourceCode,ConfigServiceDirective configServiceDirective,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
//切换数据源
|
||||
if (StringUtils.isNotBlank(dataSourceCode)) {
|
||||
pageNo = -1;
|
||||
pageSize = -1;
|
||||
}
|
||||
|
||||
DirectiveMQDto directiveMQDto = new DirectiveMQDto();
|
||||
List<String> ids = Lists.newArrayList();
|
||||
|
@ -67,7 +74,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
ids.add("bbb");
|
||||
ids.add("ccc");
|
||||
directiveMQDto.setIds(ids);
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl","nu001.fwzl.async",directiveMQDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu001.fwzl.async", directiveMQDto);
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
|
@ -83,8 +90,8 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
//如果有服务指令需要提前查询下对应的服务指令id
|
||||
List<ConfigServiceDirective> directiveIds = null;
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByTagIds(configServiceDirective.getTags());
|
||||
if(directiveIds != null && !directiveIds.isEmpty()){
|
||||
directiveIds = configServiceDirectiveService.queryDirectiveIdByTagIds(configServiceDirective.getTags());
|
||||
if (directiveIds != null && !directiveIds.isEmpty()) {
|
||||
queryWrapper.in("id", directiveIds.stream().map(ConfigServiceDirective::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +116,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
configServiceDirectiveService.save(configServiceDirective);
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||
configServiceDirectiveService.saveTags(configServiceDirective);
|
||||
}else{
|
||||
} else {
|
||||
configServiceDirectiveService.removeTags(configServiceDirective);
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
|
@ -129,7 +136,7 @@ public class ConfigServiceDirectiveController extends JeecgController<ConfigServ
|
|||
configServiceDirectiveService.updateById(configServiceDirective);
|
||||
if (StringUtils.isNotBlank(configServiceDirective.getTags())) {
|
||||
configServiceDirectiveService.saveTags(configServiceDirective);
|
||||
}else{
|
||||
} else {
|
||||
configServiceDirectiveService.removeTags(configServiceDirective);
|
||||
}
|
||||
return Result.OK("编辑成功!");
|
||||
|
|
|
@ -148,4 +148,7 @@ public class ConfigServiceDirective implements Serializable {
|
|||
//服务指令标签
|
||||
@TableField(exist = false)
|
||||
List<DirectiveTag> tagList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orgCode;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.servicedirective.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
|
@ -20,7 +21,6 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigServiceDirectiveMapper, ConfigServiceDirective> implements IConfigServiceDirectiveService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<ConfigServiceDirective> pageList(ConfigServiceDirective configServiceDirective,IPage<ConfigServiceDirective> list_) {
|
||||
if(list_.getRecords() == null || list_.getRecords().isEmpty()){
|
||||
|
|
Loading…
Reference in New Issue