Compare commits
2 Commits
55ef2c60f8
...
6465f552bd
Author | SHA1 | Date |
---|---|---|
|
6465f552bd | |
|
652d890293 |
|
@ -53,7 +53,10 @@ public class NuBizAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoM
|
||||||
|
|
||||||
public boolean updateById(NuBizAdvisoryInfo entity) {
|
public boolean updateById(NuBizAdvisoryInfo entity) {
|
||||||
baseMapper.updateById(entity);//插入业务数据
|
baseMapper.updateById(entity);//插入业务数据
|
||||||
serverAdvisoryInfoService.updateById(entity);//插入运维数据
|
// serverAdvisoryInfoService.updateById(entity);//插入运维数据
|
||||||
|
NuBizAdvisoryInfoDto nuBizAdvisoryInfoDto = new NuBizAdvisoryInfoDto();
|
||||||
|
BeanUtils.copyProperties(entity,nuBizAdvisoryInfoDto);
|
||||||
|
rabbitMQUtil.sendToExchange("hldy.register","register.editData",nuBizAdvisoryInfoDto);
|
||||||
//审核通过并且是要成为员工的
|
//审核通过并且是要成为员工的
|
||||||
if(StringUtils.equals("2", entity.getStatus()) && StringUtils.equals("2", entity.getAdvisoryType())){
|
if(StringUtils.equals("2", entity.getStatus()) && StringUtils.equals("2", entity.getAdvisoryType())){
|
||||||
//插入员工数据
|
//插入员工数据
|
||||||
|
|
|
@ -37,30 +37,37 @@ public class RabbitMQConfig {
|
||||||
public Queue nu001FwzlAsyncQueue() {
|
public Queue nu001FwzlAsyncQueue() {
|
||||||
return new Queue("nu001.fwzl.async", true);
|
return new Queue("nu001.fwzl.async", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Queue nu001FwzlStatusQueue() {
|
public Queue nu001FwzlStatusQueue() {
|
||||||
return new Queue("nu001.fwzl.status", true);
|
return new Queue("nu001.fwzl.status", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Queue nu002FwzlAsyncQueue() {
|
public Queue nu002FwzlAsyncQueue() {
|
||||||
return new Queue("nu002.fwzl.async", true);
|
return new Queue("nu002.fwzl.async", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Queue nu002FwzlStatusQueue() {
|
public Queue nu002FwzlStatusQueue() {
|
||||||
return new Queue("nu002.fwzl.status", true);
|
return new Queue("nu002.fwzl.status", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Binding binding1(Queue nu001FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
public Binding binding1(Queue nu001FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
||||||
return BindingBuilder.bind(nu001FwzlAsyncQueue).to(fwzlExchange).with("nu001.fwzl.async");
|
return BindingBuilder.bind(nu001FwzlAsyncQueue).to(fwzlExchange).with("nu001.fwzl.async");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Binding binding2(Queue nu001FwzlStatusQueue, DirectExchange fwzlExchange) {
|
public Binding binding2(Queue nu001FwzlStatusQueue, DirectExchange fwzlExchange) {
|
||||||
return BindingBuilder.bind(nu001FwzlStatusQueue).to(fwzlExchange).with("nu001.fwzl.status");
|
return BindingBuilder.bind(nu001FwzlStatusQueue).to(fwzlExchange).with("nu001.fwzl.status");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Binding binding3(Queue nu002FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
public Binding binding3(Queue nu002FwzlAsyncQueue, DirectExchange fwzlExchange) {
|
||||||
return BindingBuilder.bind(nu002FwzlAsyncQueue).to(fwzlExchange).with("nu002.fwzl.async");
|
return BindingBuilder.bind(nu002FwzlAsyncQueue).to(fwzlExchange).with("nu002.fwzl.async");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Binding binding4(Queue nu002FwzlStatusQueue, DirectExchange fwzlExchange) {
|
public Binding binding4(Queue nu002FwzlStatusQueue, DirectExchange fwzlExchange) {
|
||||||
return BindingBuilder.bind(nu002FwzlStatusQueue).to(fwzlExchange).with("nu002.fwzl.status");
|
return BindingBuilder.bind(nu002FwzlStatusQueue).to(fwzlExchange).with("nu002.fwzl.status");
|
||||||
|
|
|
@ -10,4 +10,9 @@ public class DirectiveMQDto {
|
||||||
private String orgCode;//机构编码
|
private String orgCode;//机构编码
|
||||||
private String idStr;
|
private String idStr;
|
||||||
private List<String> idList;
|
private List<String> idList;
|
||||||
|
|
||||||
|
//同步主表id
|
||||||
|
private String asyncId;
|
||||||
|
//同步子表code
|
||||||
|
private String code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,13 @@ import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class StatusMQDto {
|
public class StatusMQDto {
|
||||||
int status;
|
//同步状态 MQStatus枚举类
|
||||||
String message;
|
private int status;
|
||||||
|
//同步结果
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
//同步表主表id
|
||||||
|
private String asyncId;
|
||||||
|
//同步表子表code
|
||||||
|
private String code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.nu.modules.directivetag.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 服务指令-指令标签中间表
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-4-23 09:26:04
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("nu_directive_tag")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="nu_directive_tag对象", description="服务指令-指令标签中间表")
|
||||||
|
public class DirectiveTagRelation implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String directiveId;
|
||||||
|
private String tagId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.nu.modules.directivetag.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.nu.modules.directivetag.entity.DirectiveTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 指令标签
|
||||||
|
* @Author: 张明远
|
||||||
|
* @Date: 2025-03-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface DirectiveTagRelationMapper extends BaseMapper<DirectiveTagRelation> {
|
||||||
|
void removeAllRelation();
|
||||||
|
|
||||||
|
List<DirectiveTagRelation> selectAllRelation(List<String> ids);
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?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.DirectiveTagRelationMapper">
|
||||||
|
<delete id="removeAllRelation">
|
||||||
|
delete from nu_directive_tag
|
||||||
|
</delete>
|
||||||
|
<select id="selectAllRelation" resultType="com.nu.modules.directivetag.entity.DirectiveTagRelation">
|
||||||
|
select * from nu_directive_tag
|
||||||
|
<where>
|
||||||
|
directive_id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -2,6 +2,9 @@ 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;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.nu.modules.directivetag.entity.DirectiveTagRelation;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 指令标签
|
* @Description: 指令标签
|
||||||
|
@ -17,4 +20,10 @@ public interface IDirectiveTagService extends IService<DirectiveTag> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean isUsed(String id);
|
boolean isUsed(String id);
|
||||||
|
|
||||||
|
public void removeAllRelation();
|
||||||
|
|
||||||
|
public List<DirectiveTagRelation> selectAllRelation(String dataSourceCode, List<String> ids);
|
||||||
|
|
||||||
|
void insertAllRelation(List<DirectiveTagRelation> relations);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
package com.nu.modules.directivetag.service.impl;
|
package com.nu.modules.directivetag.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||||
|
import com.nu.modules.directivetag.entity.DirectiveTagRelation;
|
||||||
import com.nu.modules.directivetag.mapper.DirectiveTagMapper;
|
import com.nu.modules.directivetag.mapper.DirectiveTagMapper;
|
||||||
|
import com.nu.modules.directivetag.mapper.DirectiveTagRelationMapper;
|
||||||
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
||||||
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
import com.nu.modules.servicedirective.mapper.ConfigServiceDirectiveMapper;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 指令标签
|
* @Description: 指令标签
|
||||||
|
@ -23,6 +27,8 @@ public class DirectiveTagServiceImpl extends ServiceImpl<DirectiveTagMapper, Dir
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
private ConfigServiceDirectiveMapper serviceDirectiveMapper;
|
||||||
|
@Autowired
|
||||||
|
private DirectiveTagRelationMapper tagRelationMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUsed(String ids) {
|
public boolean isUsed(String ids) {
|
||||||
|
@ -37,4 +43,22 @@ public class DirectiveTagServiceImpl extends ServiceImpl<DirectiveTagMapper, Dir
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAllRelation() {
|
||||||
|
tagRelationMapper.removeAllRelation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public List<DirectiveTagRelation> selectAllRelation(String dataSourceCode, List<String> ids) {
|
||||||
|
return tagRelationMapper.selectAllRelation(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertAllRelation(List<DirectiveTagRelation> idRelations) {
|
||||||
|
idRelations.forEach(ir -> {
|
||||||
|
tagRelationMapper.insert(ir);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import org.apache.ibatis.annotations.Param;
|
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;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import retrofit2.http.DELETE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 服务指令
|
* @Description: 服务指令
|
||||||
|
@ -44,4 +45,7 @@ public interface ConfigServiceDirectiveMapper extends BaseMapper<ConfigServiceDi
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int queryCountByTagIds(@Param("tagIds") List<String> tagIds);
|
int queryCountByTagIds(@Param("tagIds") List<String> tagIds);
|
||||||
|
|
||||||
|
|
||||||
|
int removeAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,4 +105,8 @@
|
||||||
(#{directive.id}, #{tagId})
|
(#{directive.id}, #{tagId})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<delete id="removeAll">
|
||||||
|
delete from nu_config_service_directive
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -31,4 +31,10 @@ public interface IConfigServiceDirectiveService extends IService<ConfigServiceDi
|
||||||
void removeTags(ConfigServiceDirective configServiceDirective);
|
void removeTags(ConfigServiceDirective configServiceDirective);
|
||||||
|
|
||||||
List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags);
|
List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags);
|
||||||
|
|
||||||
|
void removeAll();
|
||||||
|
|
||||||
|
List<ConfigServiceDirective> selectAllByIds(String dataSourceCode, List<String> idList);
|
||||||
|
|
||||||
|
void insertAllDirectives(List<ConfigServiceDirective> directives);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package com.nu.modules.servicedirective.service.impl;
|
package com.nu.modules.servicedirective.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nu.modules.directivetag.entity.DirectiveTag;
|
import com.nu.modules.directivetag.entity.DirectiveTag;
|
||||||
|
@ -165,6 +169,7 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除改服务指令下指令标签
|
* 移除改服务指令下指令标签
|
||||||
|
*
|
||||||
* @param configServiceDirective
|
* @param configServiceDirective
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -176,4 +181,25 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl<ConfigService
|
||||||
public List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags) {
|
public List<ConfigServiceDirective> queryDirectiveIdByTagIds(String tags) {
|
||||||
return baseMapper.queryDirectiveIdByTagIds(tags);
|
return baseMapper.queryDirectiveIdByTagIds(tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAll() {
|
||||||
|
baseMapper.removeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#dataSourceCode")
|
||||||
|
public List<ConfigServiceDirective> selectAllByIds(String dataSourceCode, List<String> idList) {
|
||||||
|
QueryWrapper<ConfigServiceDirective> qw = new QueryWrapper<>();
|
||||||
|
qw.in("id", idList);
|
||||||
|
return baseMapper.selectList(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertAllDirectives(List<ConfigServiceDirective> directives) {
|
||||||
|
directives.forEach(d -> {
|
||||||
|
baseMapper.insert(d);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,20 +16,13 @@ public class DirectiveMQExceptionHandler implements RabbitListenerErrorHandler {
|
||||||
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
log.error("MQ消息处理失败 | 消息体: {} | 异常原因: {}", new String(message.getBody()), e.getCause().getMessage());
|
||||||
|
|
||||||
// 根据异常类型选择处理策略
|
// 根据异常类型选择处理策略
|
||||||
if (isRetryable(e)) {
|
// if (isRetryable(e)) {
|
||||||
// 可重试异常:抛出异常触发重试
|
// // 可重试异常:抛出异常触发重试
|
||||||
throw e;
|
// throw e;
|
||||||
} else {
|
// } else {
|
||||||
// 不可恢复异常:拒绝消息且不重新入队
|
// 不可恢复异常:拒绝消息且不重新入队
|
||||||
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
throw new AmqpRejectAndDontRequeueException("消息处理失败且禁止重试", e);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断异常是否可重试
|
|
||||||
*/
|
|
||||||
private boolean isRetryable(ListenerExecutionFailedException e) {
|
|
||||||
// 示例:网络异常、数据库临时锁超时可重试
|
|
||||||
return e.getCause() instanceof RuntimeException; // 根据实际业务调整
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,108 @@
|
||||||
package com.nu.mq.directive.listener;
|
package com.nu.mq.directive.listener;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.nu.dto.DirectiveMQDto;
|
import com.nu.dto.DirectiveMQDto;
|
||||||
import com.nu.dto.StatusMQDto;
|
import com.nu.dto.StatusMQDto;
|
||||||
import com.nu.enums.MQStatus;
|
import com.nu.enums.MQStatus;
|
||||||
|
import com.nu.modules.directivetag.entity.DirectiveTagRelation;
|
||||||
|
import com.nu.modules.directivetag.service.IDirectiveTagService;
|
||||||
|
import com.nu.modules.servicedirective.entity.ConfigServiceDirective;
|
||||||
|
import com.nu.modules.servicedirective.service.IConfigServiceDirectiveService;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
import com.nu.utils.RabbitMQUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class DirectiveMQListener {
|
public class DirectiveMQListener {
|
||||||
|
@Autowired
|
||||||
|
private IConfigServiceDirectiveService directiveService;
|
||||||
|
@Autowired
|
||||||
|
private IDirectiveTagService tagService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitMQUtil rabbitMQUtil;
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
|
||||||
@RabbitListener(queues = "nu001.fwzl.async", errorHandler = "directiveMQErrorHandler")
|
/**
|
||||||
public void handleMessage(DirectiveMQDto msg) {
|
* if 未到运营开始时间时 全量变更
|
||||||
|
* else 增量
|
||||||
|
* 备注:指令相应的字典表有相应的实时更新处理 这里无需处理字典表 但是需要处理中间关系表
|
||||||
|
* <p>
|
||||||
|
* 具体逻辑说明
|
||||||
|
* 1、未到运营开始时间时:dto.isIzInc()为true时
|
||||||
|
* 1)先将指令主表、指令标签关系表数据全部删除
|
||||||
|
* 2)将指令标签关系表数据增加进去
|
||||||
|
* 3)将指令主表数据增加进去
|
||||||
|
* <p>
|
||||||
|
* 2、已到运营开始时间:dto.isIzInc()为false时
|
||||||
|
* 1)只传递过来需要增加的指令
|
||||||
|
* 2)先将指令标签关系表数据增加进去
|
||||||
|
* 3)再将指令主表数据增加
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
|
@RabbitListener(queues = "nu002.fwzl.async", errorHandler = "directiveMQErrorHandler")
|
||||||
|
@DSTransactional(rollbackFor = {Exception.class})
|
||||||
|
public void handleMessage(DirectiveMQDto dto) {
|
||||||
try {
|
try {
|
||||||
|
if (!dto.isIzInc()) {
|
||||||
|
//全量移除所有服务指令主表、指令标签中间表数据
|
||||||
|
directiveService.removeAll();
|
||||||
|
tagService.removeAllRelation();
|
||||||
|
dto.setIdList(Arrays.asList(dto.getIdStr().split(",")));
|
||||||
|
} else {
|
||||||
|
//增量:传过来的是已勾选的全部数据,需将重复部分去除
|
||||||
|
//先查出所有指令id 然后进行去重
|
||||||
|
QueryWrapper<ConfigServiceDirective> dtw = new QueryWrapper<>();
|
||||||
|
dtw.select("id");
|
||||||
|
List<ConfigServiceDirective> tempList = directiveService.list(dtw);
|
||||||
|
Set<String> existingIds = tempList.stream()
|
||||||
|
.map(ConfigServiceDirective::getId)
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
String idStr = dto.getIdStr();
|
||||||
|
List<String> inputIds = Arrays.asList(idStr.split(","));
|
||||||
|
|
||||||
|
List<String> uniqueIds = inputIds.stream()
|
||||||
|
.filter(id -> !existingIds.contains(id))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
dto.setIdList(uniqueIds);
|
||||||
|
}
|
||||||
|
//查询指令标签关系 并将指令标签关系表数据增加进自己的库表中
|
||||||
|
if (dto.getIdList() != null && !dto.getIdList().isEmpty()) {
|
||||||
|
List<DirectiveTagRelation> relations = tagService.selectAllRelation("nuro", dto.getIdList());
|
||||||
|
if (relations != null && !relations.isEmpty()) {
|
||||||
|
tagService.insertAllRelation(relations);
|
||||||
|
}
|
||||||
|
//查询服务指令,并将服务指令新增进自己的数据库表中
|
||||||
|
List<ConfigServiceDirective> directives = directiveService.selectAllByIds("nuro", dto.getIdList());
|
||||||
|
if (directives != null && !directives.isEmpty()) {
|
||||||
|
directiveService.insertAllDirectives(directives);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
|
statusMQDto.setStatus(MQStatus.PROCESS_FAILED.getCode());
|
||||||
|
statusMQDto.setMessage(e.getMessage());
|
||||||
|
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||||
|
statusMQDto.setCode("data");
|
||||||
|
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu002.fwzl.status", statusMQDto);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
StatusMQDto statusMQDto = new StatusMQDto();
|
StatusMQDto statusMQDto = new StatusMQDto();
|
||||||
statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
statusMQDto.setStatus(MQStatus.SUCCESS.getCode());
|
||||||
statusMQDto.setMessage("成了!");
|
statusMQDto.setMessage("数据同步成功!");
|
||||||
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu001.fwzl.status", statusMQDto);
|
statusMQDto.setAsyncId(dto.getAsyncId());
|
||||||
} catch (Exception e) {
|
statusMQDto.setCode("data");
|
||||||
System.out.println("异常了:" + e.getMessage());
|
rabbitMQUtil.sendToExchange("hldy.fwzl", "nu002.fwzl.status", statusMQDto);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,366 @@
|
||||||
|
server:
|
||||||
|
port: 8082
|
||||||
|
tomcat:
|
||||||
|
max-swallow-size: -1
|
||||||
|
error:
|
||||||
|
include-exception: true
|
||||||
|
include-stacktrace: ALWAYS
|
||||||
|
include-message: ALWAYS
|
||||||
|
servlet:
|
||||||
|
context-path: /nursing-unit_002
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
min-response-size: 1024
|
||||||
|
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: metrics,jeecghttptrace
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: nursing-unit-002
|
||||||
|
# flyway配置
|
||||||
|
flyway:
|
||||||
|
# 是否启用flyway
|
||||||
|
enabled: false
|
||||||
|
# 编码格式,默认UTF-8
|
||||||
|
encoding: UTF-8
|
||||||
|
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||||
|
locations: classpath:flyway/sql/mysql
|
||||||
|
# 迁移sql脚本文件名称的前缀,默认V
|
||||||
|
sql-migration-prefix: V
|
||||||
|
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||||
|
sql-migration-separator: __
|
||||||
|
# 避免带${}sql执行失败
|
||||||
|
placeholder-prefix: '#('
|
||||||
|
placeholder-suffix: )
|
||||||
|
# 迁移sql脚本文件名称的后缀
|
||||||
|
sql-migration-suffixes: .sql
|
||||||
|
# 迁移时是否进行校验,默认true
|
||||||
|
validate-on-migrate: true
|
||||||
|
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||||
|
baseline-on-migrate: true
|
||||||
|
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||||
|
clean-disabled: true
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
mail:
|
||||||
|
# 定时任务发送邮件
|
||||||
|
timeJobSend: false
|
||||||
|
host: smtp.163.com
|
||||||
|
username: jeecgos@163.com
|
||||||
|
password: ??
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
smtp:
|
||||||
|
auth: true
|
||||||
|
starttls:
|
||||||
|
enable: true
|
||||||
|
required: true
|
||||||
|
## quartz定时任务,采用数据库方式
|
||||||
|
quartz:
|
||||||
|
job-store-type: jdbc
|
||||||
|
initialize-schema: embedded
|
||||||
|
#定时任务启动开关,true-开 false-关
|
||||||
|
auto-startup: true
|
||||||
|
#延迟1秒启动定时任务
|
||||||
|
startup-delay: 1s
|
||||||
|
#启动时更新己存在的Job
|
||||||
|
overwrite-existing-jobs: true
|
||||||
|
properties:
|
||||||
|
org:
|
||||||
|
quartz:
|
||||||
|
scheduler:
|
||||||
|
instanceName: MyScheduler
|
||||||
|
instanceId: AUTO
|
||||||
|
jobStore:
|
||||||
|
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||||||
|
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||||
|
tablePrefix: QRTZ_
|
||||||
|
isClustered: false
|
||||||
|
misfireThreshold: 12000
|
||||||
|
clusterCheckinInterval: 0 #心跳检查 之前是15000
|
||||||
|
acquireTriggersWithinLock: false # 减少锁竞争
|
||||||
|
threadPool:
|
||||||
|
class: org.quartz.simpl.SimpleThreadPool
|
||||||
|
threadCount: 10
|
||||||
|
threadPriority: 5
|
||||||
|
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||||
|
#json 时间戳统一转换
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
jpa:
|
||||||
|
open-in-view: false
|
||||||
|
aop:
|
||||||
|
proxy-target-class: true
|
||||||
|
#配置freemarker
|
||||||
|
freemarker:
|
||||||
|
# 设置模板后缀名
|
||||||
|
suffix: .ftl
|
||||||
|
# 设置文档类型
|
||||||
|
content-type: text/html
|
||||||
|
# 设置页面编码格式
|
||||||
|
charset: UTF-8
|
||||||
|
# 设置页面缓存
|
||||||
|
cache: false
|
||||||
|
prefer-file-system-access: false
|
||||||
|
# 设置ftl文件路径
|
||||||
|
template-loader-path:
|
||||||
|
- classpath:/templates
|
||||||
|
template_update_delay: 0
|
||||||
|
# 设置静态文件路径,js,css等
|
||||||
|
mvc:
|
||||||
|
static-path-pattern: /**
|
||||||
|
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
|
||||||
|
pathmatch:
|
||||||
|
matching-strategy: ant_path_matcher
|
||||||
|
resource:
|
||||||
|
static-locations: classpath:/static/,classpath:/public/
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||||
|
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||||
|
datasource:
|
||||||
|
druid:
|
||||||
|
stat-view-servlet:
|
||||||
|
enabled: true
|
||||||
|
loginUsername: admin
|
||||||
|
loginPassword: 123456
|
||||||
|
allow:
|
||||||
|
web-stat-filter:
|
||||||
|
enabled: true
|
||||||
|
dynamic:
|
||||||
|
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||||
|
# 连接池的配置信息
|
||||||
|
# 初始化大小,最小,最大
|
||||||
|
initial-size: 5
|
||||||
|
min-idle: 5
|
||||||
|
maxActive: 1000
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 3600000
|
||||||
|
validationQuery: SELECT 1
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||||
|
poolPreparedStatements: true
|
||||||
|
maxPoolPreparedStatementPerConnectionSize: 20
|
||||||
|
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||||
|
filters: stat,wall,slf4j
|
||||||
|
# 允许SELECT语句的WHERE子句是一个永真条件
|
||||||
|
wall:
|
||||||
|
selectWhereAlwayTrueCheck: false
|
||||||
|
# 打开mergeSql功能;慢SQL记录
|
||||||
|
stat:
|
||||||
|
merge-sql: true
|
||||||
|
slow-sql-millis: 5000
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://192.168.2.199:3306/nursing_unit_002?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: nu002
|
||||||
|
password: nu002
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
# 多数据源配置-运维系统
|
||||||
|
multi-datasource1:
|
||||||
|
url: jdbc:mysql://192.168.2.199:3306/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: nu_sys
|
||||||
|
password: nu_sys
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
# 多数据源配置-运维系统
|
||||||
|
nuro:
|
||||||
|
url: jdbc:mysql://192.168.2.199:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: nu_ro
|
||||||
|
password: nu_ro
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
#redis 配置
|
||||||
|
redis:
|
||||||
|
database: 0
|
||||||
|
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
|
||||||
|
global-config:
|
||||||
|
# 关闭MP3.0自带的banner
|
||||||
|
banner: false
|
||||||
|
db-config:
|
||||||
|
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
|
||||||
|
id-type: ASSIGN_ID
|
||||||
|
# 默认数据库表下划线命名
|
||||||
|
table-underline: true
|
||||||
|
configuration:
|
||||||
|
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
# 返回类型为Map,显示null对应的字段
|
||||||
|
call-setters-on-nulls: true
|
||||||
|
#jeecg专用配置
|
||||||
|
minidao:
|
||||||
|
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||||
|
jeecg:
|
||||||
|
# AI集成
|
||||||
|
ai-chat:
|
||||||
|
enabled: true
|
||||||
|
model: deepseek-chat
|
||||||
|
apiKey: ??
|
||||||
|
apiHost: https://api.deepseek.com
|
||||||
|
timeout: 60
|
||||||
|
# 平台上线安全配置
|
||||||
|
firewall:
|
||||||
|
# 数据源安全 (开启后,Online报表和图表的数据源为必填)
|
||||||
|
dataSourceSafe: false
|
||||||
|
# 低代码模式(dev:开发模式,prod:发布模式——关闭所有在线开发配置能力)
|
||||||
|
lowCodeMode: dev
|
||||||
|
# 签名密钥串(前后端要一致,正式发布请自行修改)
|
||||||
|
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
|
||||||
|
#签名拦截接口
|
||||||
|
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
|
||||||
|
# 本地:local、Minio:minio、阿里云:alioss
|
||||||
|
uploadType: local
|
||||||
|
# 前端访问地址
|
||||||
|
domainUrl:
|
||||||
|
pc: http://localhost:3100
|
||||||
|
app: http://localhost:8051
|
||||||
|
path:
|
||||||
|
#文件上传根目录 设置
|
||||||
|
upload: /opt/upFiles
|
||||||
|
#webapp文件路径
|
||||||
|
webapp: /opt/webapp
|
||||||
|
shiro:
|
||||||
|
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||||
|
#阿里云oss存储和大鱼短信秘钥配置
|
||||||
|
oss:
|
||||||
|
accessKey: ??
|
||||||
|
secretKey: ??
|
||||||
|
endpoint: oss-cn-beijing.aliyuncs.com
|
||||||
|
bucketName: jeecgdev
|
||||||
|
# 短信模板
|
||||||
|
sms-template:
|
||||||
|
# 签名
|
||||||
|
signature:
|
||||||
|
# 模板code
|
||||||
|
templateCode:
|
||||||
|
# 登录短信、忘记密码模板编码
|
||||||
|
SMS_175435174:
|
||||||
|
# 修改密码短信模板编码
|
||||||
|
SMS_465391221:
|
||||||
|
# 注册账号短信模板编码
|
||||||
|
SMS_175430166:
|
||||||
|
# 在线预览文件服务器地址配置
|
||||||
|
file-view-domain: http://fileview.jeecg.com
|
||||||
|
# minio文件上传
|
||||||
|
minio:
|
||||||
|
minio_url: http://minio.jeecg.com
|
||||||
|
minio_name: ??
|
||||||
|
minio_pass: ??
|
||||||
|
bucketName: otatest
|
||||||
|
#大屏报表参数设置
|
||||||
|
jmreport:
|
||||||
|
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
|
||||||
|
saasMode:
|
||||||
|
# 平台上线安全配置(v1.6.2+ 新增)
|
||||||
|
firewall:
|
||||||
|
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||||
|
dataSourceSafe: false
|
||||||
|
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
||||||
|
lowCodeMode: dev
|
||||||
|
#xxl-job配置
|
||||||
|
xxljob:
|
||||||
|
enabled: false
|
||||||
|
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
||||||
|
appname: ${spring.application.name}
|
||||||
|
accessToken: ''
|
||||||
|
address: 127.0.0.1:30007
|
||||||
|
ip: 127.0.0.1
|
||||||
|
port: 30007
|
||||||
|
logPath: logs/jeecg/job/jobhandler/
|
||||||
|
logRetentionDays: 30
|
||||||
|
#分布式锁配置
|
||||||
|
redisson:
|
||||||
|
address: 127.0.0.1:6379
|
||||||
|
password:
|
||||||
|
type: STANDALONE
|
||||||
|
enabled: true
|
||||||
|
# 百度开放API配置
|
||||||
|
baidu-api:
|
||||||
|
app-id: ??
|
||||||
|
api-key: ??
|
||||||
|
secret-key: ??
|
||||||
|
# ElasticSearch 6设置
|
||||||
|
elasticsearch:
|
||||||
|
cluster-name: jeecg-ES
|
||||||
|
cluster-nodes: 127.0.0.1:9200
|
||||||
|
check-enabled: false
|
||||||
|
#cas单点登录
|
||||||
|
cas:
|
||||||
|
prefixUrl: http://cas.example.org:8443/cas
|
||||||
|
#Mybatis输出sql日志
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.flywaydb: debug
|
||||||
|
org.jeecg.modules.system.mapper: info
|
||||||
|
com.nu.modules.system.mapper: info
|
||||||
|
#swagger
|
||||||
|
knife4j:
|
||||||
|
#开启增强配置
|
||||||
|
enable: true
|
||||||
|
#开启生产环境屏蔽
|
||||||
|
production: false
|
||||||
|
basic:
|
||||||
|
enable: false
|
||||||
|
username: jeecg
|
||||||
|
password: jeecg1314
|
||||||
|
#第三方登录
|
||||||
|
justauth:
|
||||||
|
enabled: true
|
||||||
|
type:
|
||||||
|
GITHUB:
|
||||||
|
client-id: ??
|
||||||
|
client-secret: ??
|
||||||
|
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
|
||||||
|
WECHAT_ENTERPRISE:
|
||||||
|
client-id: ??
|
||||||
|
client-secret: ??
|
||||||
|
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
|
||||||
|
agent-id: ??
|
||||||
|
DINGTALK:
|
||||||
|
client-id: ??
|
||||||
|
client-secret: ??
|
||||||
|
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
|
||||||
|
WECHAT_OPEN:
|
||||||
|
client-id: ??
|
||||||
|
client-secret: ??
|
||||||
|
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
|
||||||
|
cache:
|
||||||
|
type: default
|
||||||
|
prefix: 'demo::'
|
||||||
|
timeout: 1h
|
||||||
|
#tplink登录信息
|
||||||
|
tplink:
|
||||||
|
tums:
|
||||||
|
url: https://121.36.88.64:8888
|
||||||
|
username: admin
|
||||||
|
password: Bl20230518
|
||||||
|
ftp:
|
||||||
|
ip: 1.92.152.160
|
||||||
|
port: 21
|
||||||
|
username: administrator
|
||||||
|
password: Root@123..
|
||||||
|
uploadpath: /
|
Loading…
Reference in New Issue