Compare commits
6 Commits
e577970e3e
...
96c0d4a944
Author | SHA1 | Date |
---|---|---|
|
96c0d4a944 | |
|
4d3a6aa0ca | |
|
bf385a19dd | |
|
9c7e12caf7 | |
|
6f6b879821 | |
|
b251514cc2 |
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<description>通用工具模块</description>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-base-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,68 @@
|
|||
package com.nu.config;
|
||||
|
||||
import org.springframework.amqp.core.*;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||
import org.springframework.amqp.support.converter.Jackson2JavaTypeMapper;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class RabbitMQConfig {
|
||||
|
||||
@Bean
|
||||
public RabbitAdmin rabbitAdmin(ConnectionFactory connectionFactory) {
|
||||
return new RabbitAdmin(connectionFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON消息转换器
|
||||
*/
|
||||
@Bean
|
||||
public Jackson2JsonMessageConverter jsonMessageConverter() {
|
||||
Jackson2JsonMessageConverter converter = new Jackson2JsonMessageConverter();
|
||||
converter.setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence.TYPE_ID);
|
||||
return converter;
|
||||
}
|
||||
|
||||
// 交换器(以Topic为例)
|
||||
@Bean
|
||||
public DirectExchange fwzlExchange() {
|
||||
return new DirectExchange("hldy.fwzl");
|
||||
}
|
||||
|
||||
// 队列
|
||||
@Bean
|
||||
public Queue nu001FwzlAsyncQueue() {
|
||||
return new Queue("nu001.fwzl.async", true);
|
||||
}
|
||||
@Bean
|
||||
public Queue nu001FwzlStatusQueue() {
|
||||
return new Queue("nu001.fwzl.status", true);
|
||||
}
|
||||
@Bean
|
||||
public Queue nu002FwzlAsyncQueue() {
|
||||
return new Queue("nu002.fwzl.async", true);
|
||||
}
|
||||
@Bean
|
||||
public Queue nu002FwzlStatusQueue() {
|
||||
return new Queue("nu002.fwzl.status", true);
|
||||
}
|
||||
@Bean
|
||||
public Binding binding1(Queue nu001FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
||||
return BindingBuilder.bind(nu001FwzlAsyncQueue).to(fwzlExchange).with("nu001.fwzl.async");
|
||||
}
|
||||
@Bean
|
||||
public Binding binding2(Queue nu001FwzlStatusQueue, DirectExchange fwzlExchange) {
|
||||
return BindingBuilder.bind(nu001FwzlStatusQueue).to(fwzlExchange).with("nu001.fwzl.status");
|
||||
}
|
||||
@Bean
|
||||
public Binding binding3(Queue nu002FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
||||
return BindingBuilder.bind(nu002FwzlAsyncQueue).to(fwzlExchange).with("nu002.fwzl.async");
|
||||
}
|
||||
@Bean
|
||||
public Binding binding4(Queue nu002FwzlStatusQueue, DirectExchange fwzlExchange) {
|
||||
return BindingBuilder.bind(nu002FwzlStatusQueue).to(fwzlExchange).with("nu002.fwzl.status");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DirectiveMQDto {
|
||||
List<String> ids;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StatusMQDto {
|
||||
int status;
|
||||
String message;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.nu.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* MQ消息处理状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum MQStatus {
|
||||
|
||||
SUCCESS(200, "消息处理成功"),
|
||||
INVALID_PARAM(400, "请求参数不合法"),
|
||||
PROCESS_FAILED(500, "消息处理失败"),
|
||||
MAX_RETRY_EXCEEDED(1001, "已达到最大重试次数"),
|
||||
MESSAGE_FORMAT_ERROR(1002, "消息格式错误"),
|
||||
TIMEOUT(1003, "处理超时"),
|
||||
DUPLICATE_MESSAGE(1004, "消息重复消费"),
|
||||
UNKNOWN_ERROR(9999, "未知错误");
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
MQStatus(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态码查找枚举
|
||||
*/
|
||||
public static MQStatus findByCode(int code) {
|
||||
for (MQStatus status : values()) {
|
||||
if (status.code == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return UNKNOWN_ERROR; // 默认返回未知错误
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否成功状态
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
return this == SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否可重试错误
|
||||
*/
|
||||
public boolean isRetryable() {
|
||||
return this == PROCESS_FAILED || this == TIMEOUT;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
package com.nu.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.amqp.core.*;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
||||
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
public class RabbitMQUtil {
|
||||
private static final Logger logger = LoggerFactory.getLogger(RabbitMQUtil.class);
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
private ConnectionFactory connectionFactory;
|
||||
|
||||
@Autowired
|
||||
private RabbitAdmin rabbitAdmin;
|
||||
|
||||
@Autowired
|
||||
private Jackson2JsonMessageConverter jsonMessageConverter;
|
||||
|
||||
// 初始化配置
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
rabbitTemplate.setMessageConverter(jsonMessageConverter);
|
||||
}
|
||||
|
||||
// 基础消息操作
|
||||
|
||||
/**
|
||||
* 发送消息到指定队列(使用默认直接交换机)
|
||||
*
|
||||
* @param queueName 目标队列名称
|
||||
* @param message 消息内容(自动JSON序列化)
|
||||
*/
|
||||
public void sendToQueue(String queueName, Object message) {
|
||||
rabbitTemplate.convertAndSend("", queueName, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息到指定交换机
|
||||
*
|
||||
* @param exchange 交换机名称
|
||||
* @param routingKey 路由键
|
||||
* @param message 消息内容
|
||||
*/
|
||||
public void sendToExchange(String exchange, String routingKey, Object message) {
|
||||
rabbitTemplate.convertAndSend(exchange, routingKey, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从队列接收消息(自动确认)
|
||||
*
|
||||
* @return 返回消息对象,队列为空时返回null
|
||||
*/
|
||||
public Object receiveFromQueue(String queueName) {
|
||||
return rabbitTemplate.receiveAndConvert(queueName);
|
||||
}
|
||||
|
||||
// 队列与交换机管理
|
||||
|
||||
/**
|
||||
* 创建持久化队列
|
||||
*
|
||||
* @param queueName 队列名称
|
||||
* @return 队列对象
|
||||
*/
|
||||
public Queue createQueue(String queueName) {
|
||||
try {
|
||||
Queue queue = new Queue(queueName, true, false, false);
|
||||
rabbitAdmin.declareQueue(queue);
|
||||
return queue;
|
||||
} catch (Exception e) {
|
||||
logger.error("队列[{}]创建失败", queueName, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建带死信队列的队列
|
||||
*
|
||||
* @param queueName 主队列名称
|
||||
* @param dlxExchange 死信交换机名称
|
||||
* @param dlxRoutingKey 死信路由键
|
||||
*/
|
||||
public Queue createQueueWithDLX(String queueName, String dlxExchange, String dlxRoutingKey) {
|
||||
try {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
args.put("x-dead-letter-exchange", dlxExchange);
|
||||
args.put("x-dead-letter-routing-key", dlxRoutingKey);
|
||||
Queue queue = new Queue(queueName, true, false, false, args);
|
||||
rabbitAdmin.declareQueue(queue);
|
||||
return queue;
|
||||
} catch (Exception e) {
|
||||
logger.error("带死信的队列[{}]创建失败", queueName, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定队列到主题交换机
|
||||
*
|
||||
* @param queue 队列名称
|
||||
* @param exchange 交换机名称
|
||||
* @param routingKey 路由规则
|
||||
*/
|
||||
public void bindToTopicExchange(String queue, String exchange, String routingKey) {
|
||||
try {
|
||||
Binding binding = BindingBuilder.bind(new Queue(queue))
|
||||
.to(new TopicExchange(exchange)).with(routingKey);
|
||||
rabbitAdmin.declareBinding(binding);
|
||||
} catch (Exception e) {
|
||||
logger.error("队列[{}]绑定到交换机[{}]失败", queue, exchange, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// 监听器管理
|
||||
|
||||
/**
|
||||
* 创建消息监听容器
|
||||
*
|
||||
* @param queueName 监听的队列
|
||||
* @param listener 消息处理器
|
||||
* @param concurrency 并发消费者数量
|
||||
*/
|
||||
public SimpleMessageListenerContainer createListener(
|
||||
String queueName,
|
||||
ChannelAwareMessageListener listener,
|
||||
int concurrency) {
|
||||
try {
|
||||
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
|
||||
container.addQueues(new Queue(queueName));
|
||||
container.setAcknowledgeMode(AcknowledgeMode.MANUAL);
|
||||
container.setMessageListener(listener);
|
||||
container.setConcurrentConsumers(concurrency);
|
||||
container.start();
|
||||
return container;
|
||||
} catch (Exception e) {
|
||||
logger.error("监听器[{}]创建失败", queueName, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -37,6 +37,12 @@
|
|||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- COMMON 通用工具模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.nu.modules.directiveTag.controller;
|
||||
package com.nu.modules.directivetag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directiveTag.service.IDirectiveTagService;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,15 +1,11 @@
|
|||
package com.nu.modules.directiveTag.entity;
|
||||
package com.nu.modules.directivetag.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
@ -1,9 +1,6 @@
|
|||
package com.nu.modules.directiveTag.mapper;
|
||||
package com.nu.modules.directivetag.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.directiveTag.mapper.DirectiveTagMapper">
|
||||
<mapper namespace="com.nu.modules.directivetag.mapper.DirectiveTagMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,6 +1,6 @@
|
|||
package com.nu.modules.directiveTag.service;
|
||||
package com.nu.modules.directivetag.service;
|
||||
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
|
@ -1,11 +1,9 @@
|
|||
package com.nu.modules.directiveTag.service.impl;
|
||||
package com.nu.modules.directivetag.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directiveTag.mapper.DirectiveTagMapper;
|
||||
import com.nu.modules.directiveTag.service.IDirectiveTagService;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.nu.modules.directivetag.mapper.DirectiveTagMapper;
|
||||
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -13,7 +11,6 @@ import org.springframework.stereotype.Service;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 指令标签
|
|
@ -1,10 +1,10 @@
|
|||
package com.nu.modules.serviceCategory.controller;
|
||||
package com.nu.modules.servicecategory.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.serviceCategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.serviceCategory.service.IConfigServiceCategoryService;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,15 +1,11 @@
|
|||
package com.nu.modules.serviceCategory.entity;
|
||||
package com.nu.modules.servicecategory.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
@ -1,9 +1,6 @@
|
|||
package com.nu.modules.serviceCategory.mapper;
|
||||
package com.nu.modules.servicecategory.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.serviceCategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.serviceCategory.mapper.ConfigServiceCategoryMapper">
|
||||
<mapper namespace="com.nu.modules.servicecategory.mapper.ConfigServiceCategoryMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,6 +1,6 @@
|
|||
package com.nu.modules.serviceCategory.service;
|
||||
package com.nu.modules.servicecategory.service;
|
||||
|
||||
import com.nu.modules.serviceCategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
|
@ -1,13 +1,13 @@
|
|||
package com.nu.modules.serviceCategory.service.impl;
|
||||
package com.nu.modules.servicecategory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.nu.modules.ServiceType.entity.ConfigServiceType;
|
||||
import com.nu.modules.ServiceType.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.serviceCategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.serviceCategory.mapper.ConfigServiceCategoryMapper;
|
||||
import com.nu.modules.serviceCategory.service.IConfigServiceCategoryService;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.servicecategory.entity.ConfigServiceCategory;
|
||||
import com.nu.modules.servicecategory.mapper.ConfigServiceCategoryMapper;
|
||||
import com.nu.modules.servicecategory.service.IConfigServiceCategoryService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
|
@ -1,14 +1,18 @@
|
|||
package com.nu.modules.serviceDirective.controller;
|
||||
package com.nu.modules.servicedirective.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.dto.DirectiveMQDto;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
@ -22,10 +26,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -41,6 +42,8 @@ import java.util.stream.Collectors;
|
|||
public class ConfigServiceDirectiveController extends JeecgController<ConfigServiceDirective, IConfigServiceDirectiveService> {
|
||||
@Autowired
|
||||
private IConfigServiceDirectiveService configServiceDirectiveService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
@ -54,10 +57,24 @@ 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();
|
||||
ids.add("aaa");
|
||||
ids.add("bbb");
|
||||
ids.add("ccc");
|
||||
directiveMQDto.setIds(ids);
|
||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu001.fwzl.async", directiveMQDto);
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("categoryId", QueryRuleEnum.LIKE_WITH_OR);
|
||||
|
@ -73,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()));
|
||||
}
|
||||
}
|
||||
|
@ -99,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("添加成功!");
|
||||
|
@ -119,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("编辑成功!");
|
|
@ -1,8 +1,8 @@
|
|||
package com.nu.modules.serviceDirective.entity;
|
||||
package com.nu.modules.servicedirective.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -148,4 +148,7 @@ public class ConfigServiceDirective implements Serializable {
|
|||
//服务指令标签
|
||||
@TableField(exist = false)
|
||||
List<DirectiveTag> tagList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orgCode;
|
||||
}
|
|
@ -1,11 +1,9 @@
|
|||
package com.nu.modules.serviceDirective.mapper;
|
||||
package com.nu.modules.servicedirective.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper">
|
||||
<mapper namespace="com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper">
|
||||
|
||||
<!-- 自定义结果映射 -->
|
||||
<resultMap id="ConfigServiceDirectiveResultMap"
|
||||
type="com.nu.modules.serviceDirective.entity.ConfigServiceDirective">
|
||||
type="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<id property="id" column="id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
|
@ -31,7 +31,7 @@
|
|||
<result property="previewFile" column="preview_file"/>
|
||||
<result property="immediateFile" column="immediate_file"/>
|
||||
|
||||
<collection property="tagList" ofType="com.nu.modules.directiveTag.entity.DirectiveTag">
|
||||
<collection property="tagList" ofType="com.nu.modules.directivetag.entity.DirectiveTag">
|
||||
<id property="id" column="tagId"/>
|
||||
<result property="tagName" column="tagName"/>
|
||||
</collection>
|
||||
|
@ -80,7 +80,7 @@
|
|||
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 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}
|
|
@ -1,13 +1,10 @@
|
|||
package com.nu.modules.serviceDirective.service;
|
||||
package com.nu.modules.servicedirective.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 服务指令
|
|
@ -1,22 +1,15 @@
|
|||
package com.nu.modules.serviceDirective.service.impl;
|
||||
package com.nu.modules.servicedirective.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.directiveTag.entity.DirectiveTag;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -28,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()){
|
|
@ -1,10 +1,10 @@
|
|||
package com.nu.modules.ServiceType.controller;
|
||||
package com.nu.modules.servicetype.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.ServiceType.entity.ConfigServiceType;
|
||||
import com.nu.modules.ServiceType.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,15 +1,11 @@
|
|||
package com.nu.modules.ServiceType.entity;
|
||||
package com.nu.modules.servicetype.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
@ -1,9 +1,6 @@
|
|||
package com.nu.modules.ServiceType.mapper;
|
||||
package com.nu.modules.servicetype.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.ServiceType.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.ServiceType.mapper.ConfigServiceTypeMapper">
|
||||
<mapper namespace="com.nu.modules.servicetype.mapper.ConfigServiceTypeMapper">
|
||||
|
||||
</mapper>
|
|
@ -1,6 +1,6 @@
|
|||
package com.nu.modules.ServiceType.service;
|
||||
package com.nu.modules.servicetype.service;
|
||||
|
||||
import com.nu.modules.ServiceType.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
|
@ -1,11 +1,11 @@
|
|||
package com.nu.modules.ServiceType.service.impl;
|
||||
package com.nu.modules.servicetype.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.nu.modules.ServiceType.entity.ConfigServiceType;
|
||||
import com.nu.modules.ServiceType.mapper.ConfigServiceTypeMapper;
|
||||
import com.nu.modules.ServiceType.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.serviceDirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.serviceDirective.service.IConfigServiceDirectiveService;
|
||||
import com.nu.modules.servicetype.entity.ConfigServiceType;
|
||||
import com.nu.modules.servicetype.mapper.ConfigServiceTypeMapper;
|
||||
import com.nu.modules.servicetype.service.IConfigServiceTypeService;
|
||||
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
|
@ -0,0 +1,35 @@
|
|||
package com.nu.mq.directive.exceptionhandler;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
|
||||
import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component("directiveMQErrorHandler")
|
||||
public class DirectiveMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||
|
||||
@Override
|
||||
public Object handleError(Message message, org.springframework.messaging.Message<?> message1, ListenerExecutionFailedException e) {
|
||||
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
||||
|
||||
// 根据异常类型选择处理策略
|
||||
if (isRetryable(e)) {
|
||||
// 可重试异常:抛出异常触发重试
|
||||
throw e;
|
||||
} else {
|
||||
// 不可恢复异常:拒绝消息且不重新入队
|
||||
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断异常是否可重试
|
||||
*/
|
||||
private boolean isRetryable(ListenerExecutionFailedException e) {
|
||||
// 示例:网络异常、数据库临时锁超时可重试
|
||||
return e.getCause() instanceof RuntimeException; // 根据实际业务调整
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.nu.mq.directive.listener;
|
||||
|
||||
import com.nu.dto.StatusMQDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DirectiveMQListener {
|
||||
|
||||
@RabbitListener(queues = "nu001.fwzl.status", errorHandler = "directiveMQErrorHandler")
|
||||
public void handleMessage(StatusMQDto dto) {
|
||||
try {
|
||||
System.out.println("接收到了消息:" + dto.getStatus() + "消息体:" + dto.getMessage());
|
||||
} catch (Exception e) {
|
||||
System.out.println("异常了:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -132,10 +132,10 @@ public class SysDepartController {
|
|||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryDepartTreeSync", method = RequestMethod.GET)
|
||||
public Result<List<SysDepartTreeModel>> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId,@RequestParam(name = "ids", required = false) String ids, @RequestParam(name = "primaryKey", required = false) String primaryKey) {
|
||||
public Result<List<SysDepartTreeModel>> queryDepartTreeSync(@RequestParam(name = "pid", required = false) String parentId,@RequestParam(name = "ids", required = false) String ids, @RequestParam(name = "primaryKey", required = false) String primaryKey, @RequestParam(name = "platType", required = false) String platType) {
|
||||
Result<List<SysDepartTreeModel>> result = new Result<>();
|
||||
try {
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeListByPid(parentId,ids, primaryKey);
|
||||
List<SysDepartTreeModel> list = sysDepartService.queryTreeListByPid(parentId,ids, primaryKey,platType);
|
||||
result.setResult(list);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -54,6 +54,10 @@ public class SysDepart implements Serializable {
|
|||
/**机构编码*/
|
||||
@Excel(name="机构编码",width=15)
|
||||
private String orgCode;
|
||||
/**业务平台类型*/
|
||||
@Excel(name="业务平台类型",width=15)
|
||||
@Dict(dicCode = "iz_test_site")
|
||||
private String platType;
|
||||
/**运营开始时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
|
|
|
@ -39,6 +39,8 @@ public class SysDepartTreeModel implements Serializable{
|
|||
|
||||
private String parentId;
|
||||
|
||||
private String platType;
|
||||
|
||||
private String departName;
|
||||
|
||||
private String departNameEn;
|
||||
|
@ -103,6 +105,7 @@ public class SysDepartTreeModel implements Serializable{
|
|||
this.title = sysDepart.getDepartName();
|
||||
this.id = sysDepart.getId();
|
||||
this.parentId = sysDepart.getParentId();
|
||||
this.platType = sysDepart.getPlatType();
|
||||
this.departName = sysDepart.getDepartName();
|
||||
this.departNameEn = sysDepart.getDepartNameEn();
|
||||
this.departNameAbbr = sysDepart.getDepartNameAbbr();
|
||||
|
@ -199,6 +202,14 @@ public class SysDepartTreeModel implements Serializable{
|
|||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getPlatType() {
|
||||
return platType;
|
||||
}
|
||||
|
||||
public void setPlatType(String platType) {
|
||||
this.platType = platType;
|
||||
}
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
@ -411,6 +422,7 @@ public class SysDepartTreeModel implements Serializable{
|
|||
SysDepartTreeModel model = (SysDepartTreeModel) o;
|
||||
return Objects.equals(id, model.id) &&
|
||||
Objects.equals(parentId, model.parentId) &&
|
||||
Objects.equals(platType, model.platType) &&
|
||||
Objects.equals(departName, model.departName) &&
|
||||
Objects.equals(departNameEn, model.departNameEn) &&
|
||||
Objects.equals(departNameAbbr, model.departNameAbbr) &&
|
||||
|
@ -444,7 +456,7 @@ public class SysDepartTreeModel implements Serializable{
|
|||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(id, parentId, departName, departNameEn, departNameAbbr,
|
||||
return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr,
|
||||
departOrder, description, orgCategory, orgType, orgCode,
|
||||
operationStartTime, operationEndTime, contractStartTime, contractEndTime,
|
||||
mobile, fax, address, memo, status, delFlag, qywxIdentifier,
|
||||
|
|
|
@ -141,9 +141,10 @@ public interface ISysDepartService extends IService<SysDepart>{
|
|||
* @param parentId 父id
|
||||
* @param ids 多个部门id
|
||||
* @param primaryKey 主键字段(id或者orgCode)
|
||||
* @param platType syjg试验机构 ywjg业务机构
|
||||
* @return
|
||||
*/
|
||||
List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids, String primaryKey);
|
||||
List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids, String primaryKey,String platType);
|
||||
|
||||
/**
|
||||
* 获取某个部门的所有父级部门的ID
|
||||
|
|
|
@ -597,10 +597,11 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||
* @param parentId
|
||||
* @param ids 前端回显传递
|
||||
* @param primaryKey 主键字段(id或者orgCode)
|
||||
* @param platType syjg试验机构 ywjg业务机构
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids, String primaryKey) {
|
||||
public List<SysDepartTreeModel> queryTreeListByPid(String parentId,String ids, String primaryKey,String platType) {
|
||||
Consumer<LambdaQueryWrapper<SysDepart>> square = i -> {
|
||||
if (oConvertUtils.isNotEmpty(ids)) {
|
||||
if (CommonConstant.DEPART_KEY_ORG_CODE.equals(primaryKey)) {
|
||||
|
@ -628,6 +629,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||
//update-begin---author:wangshuai ---date:20220527 for:[VUEN-1143]排序不对,vue3和2应该都有问题,应该按照升序排------------
|
||||
lqw.orderByAsc(SysDepart::getDepartOrder);
|
||||
//update-end---author:wangshuai ---date:20220527 for:[VUEN-1143]排序不对,vue3和2应该都有问题,应该按照升序排--------------
|
||||
//查询试验机构 或 业务机构
|
||||
if(StringUtils.isNotBlank(platType)){
|
||||
lqw.eq(true,SysDepart::getPlatType,platType);
|
||||
}
|
||||
List<SysDepart> list = list(lqw);
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人 创建用户的时候不需要处理
|
||||
//设置用户id,让前台显示
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
<artifactId>nu-system-start</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- COMMON 通用工具模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- SYSTEM 系统管理模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
|
|
|
@ -186,6 +186,13 @@ spring:
|
|||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
#rabbitmq 配置
|
||||
rabbitmq:
|
||||
host: 192.168.2.199
|
||||
prot: 5672
|
||||
username: hldy
|
||||
password: hldy
|
||||
virtual-host: /hldy
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:com/nu/**/xml/*Mapper.xml
|
||||
|
|
15
pom.xml
15
pom.xml
|
@ -70,6 +70,8 @@
|
|||
<modules>
|
||||
<!-- 框架基础包模块 -->
|
||||
<module>nursing-unit-base-core</module>
|
||||
<!-- 框架基础包模块 -->
|
||||
<module>nursing-unit-common</module>
|
||||
<!-- 框架demo功能模块 -->
|
||||
<module>nursing-unit-demo</module>
|
||||
<!-- 进销存 -->
|
||||
|
@ -161,6 +163,12 @@
|
|||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- RabbitMQ -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -186,7 +194,12 @@
|
|||
<artifactId>seata-spring-boot-starter</artifactId>
|
||||
<version>${seata.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- COMMON 通用工具模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- system 模块-->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
|
|
Loading…
Reference in New Issue