Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
1bc2743dc7 | |||
563588b835 |
@ -14,6 +14,7 @@
|
||||
<module>ruoyi-job</module>
|
||||
<module>ruoyi-resource</module>
|
||||
<module>ruoyi-workflow</module>
|
||||
<module>ruoyi-synjinlangyun</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
|
27
ruoyi-modules/ruoyi-synjinlangyun/Dockerfile
Normal file
27
ruoyi-modules/ruoyi-synjinlangyun/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
|
||||
FROM bellsoft/liberica-openjdk-rocky:17.0.15-cds
|
||||
#FROM bellsoft/liberica-openjdk-rocky:21.0.7-cds
|
||||
#FROM findepi/graalvm:java17-native
|
||||
|
||||
LABEL maintainer="Lion Li"
|
||||
|
||||
RUN mkdir -p /ruoyi/synjinlangyun/logs \
|
||||
/ruoyi/synjinlangyun/temp \
|
||||
/ruoyi/skywalking/agent
|
||||
|
||||
WORKDIR /ruoyi/synjinlangyun
|
||||
|
||||
ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
|
||||
|
||||
EXPOSE ${SERVER_PORT}
|
||||
|
||||
ADD ./target/ruoyi-synjinlangyun.jar ./app.jar
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
|
||||
#-Dskywalking.agent.service_name=ruoyi-synjinlangyun \
|
||||
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
|
||||
-jar app.jar
|
||||
|
123
ruoyi-modules/ruoyi-synjinlangyun/pom.xml
Normal file
123
ruoyi-modules/ruoyi-synjinlangyun/pom.xml
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-synjinlangyun</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-synjinlangyun同步锦浪云模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-nacos</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-service-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-dubbo</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-seata</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-idempotent</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-translation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-encrypt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openmuc</groupId>
|
||||
<artifactId>j60870</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,23 @@
|
||||
package org.dromara.synjinlangyun;
|
||||
|
||||
|
||||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||
|
||||
/**
|
||||
* 同步锦浪云模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableDubbo
|
||||
@SpringBootApplication
|
||||
public class RuoYiSynjinlangyunApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication application = new SpringApplication(RuoYiSynjinlangyunApplication.class);
|
||||
application.setApplicationStartup(new BufferingApplicationStartup(2048));
|
||||
application.run(args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 同步锦浪云模块启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.synjinlangyun.client;
|
||||
|
||||
import org.dromara.synjinlangyun.listener.J60870ClientListener;
|
||||
import org.openmuc.j60870.ClientConnectionBuilder;
|
||||
import org.openmuc.j60870.Connection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
|
||||
public class J60870Client implements Runnable {
|
||||
|
||||
//监听类
|
||||
private J60870ClientListener listener;
|
||||
//连接类
|
||||
private Connection connection;
|
||||
//连接参数
|
||||
private ClientConnectionBuilder clientConnectionBuilder;
|
||||
|
||||
|
||||
public J60870Client() throws IOException{
|
||||
try {
|
||||
//获取server对象,从站的IP地址对象
|
||||
InetAddress address = InetAddress.getByName("127.0.0.1");
|
||||
|
||||
//创建连接参数对象
|
||||
clientConnectionBuilder = new ClientConnectionBuilder(address);
|
||||
//设置socket的连接超时时间
|
||||
clientConnectionBuilder.setConnectionTimeout(60000);
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
//主站与从站连接
|
||||
connection = clientConnectionBuilder.build();
|
||||
|
||||
//配置数据回调类
|
||||
listener = new J60870ClientListener();
|
||||
connection.startDataTransfer(listener);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//关闭连接
|
||||
public void disconnect(){
|
||||
try {
|
||||
this.connection.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package org.dromara.synjinlangyun.listener;
|
||||
|
||||
import org.openmuc.j60870.ASdu;
|
||||
import org.openmuc.j60870.ConnectionEventListener;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class J60870ClientListener implements ConnectionEventListener {
|
||||
|
||||
//监听从站发来的数据
|
||||
@Override
|
||||
public void newASdu(ASdu aSdu) {
|
||||
System.out.println(aSdu.toString());
|
||||
}
|
||||
|
||||
//监听连接关闭
|
||||
@Override
|
||||
public void connectionClosed(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9202
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-synjinlangyun
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: @profiles.active@
|
||||
|
||||
--- # nacos 配置
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
# nacos 服务地址
|
||||
server-addr: @nacos.server@
|
||||
username: @nacos.username@
|
||||
password: @nacos.password@
|
||||
discovery:
|
||||
# 注册组
|
||||
group: @nacos.discovery.group@
|
||||
namespace: ${spring.profiles.active}
|
||||
config:
|
||||
# 配置组
|
||||
group: @nacos.config.group@
|
||||
namespace: ${spring.profiles.active}
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:application-common.yml
|
||||
- optional:nacos:datasource.yml
|
||||
- optional:nacos:${spring.application.name}.yml
|
@ -0,0 +1,10 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/${project.artifactId}" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="console.log.pattern"
|
||||
value="%cyan(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${console.log.pattern}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<include resource="logback-common.xml" />
|
||||
|
||||
<include resource="logback-logstash.xml" />
|
||||
|
||||
<!-- 开启 skywalking 日志收集 -->
|
||||
<include resource="logback-skylog.xml" />
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
</configuration>
|
@ -38,6 +38,16 @@ public class SysDept extends TenantEntity {
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 分包公司ID
|
||||
*/
|
||||
private Long contractorId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ -85,9 +95,19 @@ public class SysDept extends TenantEntity {
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 子菜单
|
||||
* 是否隐藏(0隐藏 1显示)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<SysDept> children = new ArrayList<>();
|
||||
private String isShow;
|
||||
|
||||
/**
|
||||
* 部门类型
|
||||
*/
|
||||
private String deptType;
|
||||
|
||||
// /**
|
||||
// * 子菜单
|
||||
// */
|
||||
// @TableField(exist = false)
|
||||
// private List<SysDept> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
package org.dromara.system.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
@ -31,6 +28,21 @@ public class SysDeptBo extends BaseEntity {
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目部门项目id
|
||||
*/
|
||||
private Long rowProjectId;
|
||||
|
||||
/**
|
||||
* 分包公司ID
|
||||
*/
|
||||
private Long contractorId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ -74,8 +86,19 @@ public class SysDeptBo extends BaseEntity {
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 归属部门id(部门树)
|
||||
* 是否隐藏(0隐藏 1显示)
|
||||
*/
|
||||
private Long belongDeptId;
|
||||
@Pattern(regexp = "^[01]$", message = "isShow字段值必须是0或1")
|
||||
private String isShow;
|
||||
|
||||
/**
|
||||
* 部门类型
|
||||
*/
|
||||
@NotBlank(message = "部门类型不能为空")
|
||||
private String deptType;
|
||||
// /**
|
||||
// * 归属部门id(部门树)
|
||||
// */
|
||||
// private Long belongDeptId;
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
//import org.dromara.contractor.domain.vo.SubContractorVo;
|
||||
//import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -43,6 +45,31 @@ public class SysDeptVo implements Serializable {
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 父部门信息
|
||||
*/
|
||||
private SysDeptVo parent;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 分包公司ID
|
||||
*/
|
||||
private Long contractorId;
|
||||
|
||||
/**
|
||||
* 未绑定项目信息
|
||||
*/
|
||||
// private List<BusProjectVo> projectList;
|
||||
//
|
||||
// /**
|
||||
// * 未绑定分包信息
|
||||
// */
|
||||
// private List<SubContractorVo> contractorList;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@ -95,15 +122,22 @@ public class SysDeptVo implements Serializable {
|
||||
@ExcelDictFormat(dictType = "sys_normal_disable")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 部门类型
|
||||
*/
|
||||
@ExcelProperty(value = "部门类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_dept_type")
|
||||
private String deptType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 子菜单
|
||||
*/
|
||||
private List<SysDept> children = new ArrayList<>();
|
||||
// /**
|
||||
// * 子菜单
|
||||
// */
|
||||
// private List<SysDept> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class RemoteTaskAssigneeServiceImpl implements RemoteTaskAssigneeService
|
||||
Map<String, Object> params = bo.getParams();
|
||||
params.put("beginTime", taskQuery.getBeginTime());
|
||||
params.put("endTime", taskQuery.getEndTime());
|
||||
bo.setBelongDeptId(Convert.toLong(taskQuery.getGroupId()));
|
||||
// bo.setBelongDeptId(Convert.toLong(taskQuery.getGroupId()));
|
||||
TableDataInfo<SysDeptVo> page = deptService.selectPageDeptList(bo, pageQuery);
|
||||
// 使用封装的字段映射方法进行转换
|
||||
List<RemoteTaskAssigneeVo.TaskHandler> handlers = RemoteTaskAssigneeVo.convertToHandlerList(page.getRows(),
|
||||
|
@ -19,10 +19,12 @@ import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.common.redis.utils.CacheUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
import org.dromara.system.domain.SysPost;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.bo.SysDeptBo;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.domain.vo.SysPostVo;
|
||||
import org.dromara.system.mapper.SysDeptMapper;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.dromara.system.mapper.SysUserMapper;
|
||||
@ -37,6 +39,8 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
@ -90,7 +94,6 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysDept> buildQueryWrapper(SysDeptBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysDept> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SysDept::getDelFlag, SystemConstants.NORMAL);
|
||||
lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId());
|
||||
@ -98,22 +101,37 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeptCategory()), SysDept::getDeptCategory, bo.getDeptCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus());
|
||||
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
SysDept::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsShow()), SysDept::getIsShow, bo.getIsShow());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeptType()), SysDept::getDeptType, bo.getDeptType());
|
||||
lqw.orderByAsc(SysDept::getAncestors);
|
||||
lqw.orderByAsc(SysDept::getParentId);
|
||||
lqw.orderByAsc(SysDept::getOrderNum);
|
||||
lqw.orderByAsc(SysDept::getDeptId);
|
||||
if (ObjectUtil.isNotNull(bo.getBelongDeptId())) {
|
||||
//部门树搜索
|
||||
lqw.and(x -> {
|
||||
Long parentId = bo.getBelongDeptId();
|
||||
List<SysDept> deptList = baseMapper.selectListByParentId(parentId);
|
||||
List<Long> deptIds = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||
deptIds.add(parentId);
|
||||
x.in(SysDept::getDeptId, deptIds);
|
||||
});
|
||||
}
|
||||
// Map<String, Object> params = bo.getParams();
|
||||
// LambdaQueryWrapper<SysDept> lqw = Wrappers.lambdaQuery();
|
||||
// lqw.eq(SysDept::getDelFlag, SystemConstants.NORMAL);
|
||||
// lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId());
|
||||
// lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), SysDept::getParentId, bo.getParentId());
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName());
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getDeptCategory()), SysDept::getDeptCategory, bo.getDeptCategory());
|
||||
// lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus());
|
||||
// lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
// SysDept::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
// lqw.orderByAsc(SysDept::getAncestors);
|
||||
// lqw.orderByAsc(SysDept::getParentId);
|
||||
// lqw.orderByAsc(SysDept::getOrderNum);
|
||||
// lqw.orderByAsc(SysDept::getDeptId);
|
||||
// if (ObjectUtil.isNotNull(bo.getBelongDeptId())) {
|
||||
// //部门树搜索
|
||||
// lqw.and(x -> {
|
||||
// Long parentId = bo.getBelongDeptId();
|
||||
// List<SysDept> deptList = baseMapper.selectListByParentId(parentId);
|
||||
// List<Long> deptIds = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||
// deptIds.add(parentId);
|
||||
// x.in(SysDept::getDeptId, deptIds);
|
||||
// });
|
||||
// }
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@ -128,19 +146,98 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||
if (CollUtil.isEmpty(depts)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return TreeBuildUtils.buildMultiRoot(
|
||||
depts,
|
||||
SysDeptVo::getDeptId,
|
||||
SysDeptVo::getParentId,
|
||||
(node, treeNode) -> treeNode
|
||||
.setId(node.getDeptId())
|
||||
.setParentId(node.getParentId())
|
||||
.setName(node.getDeptName())
|
||||
.setWeight(node.getOrderNum())
|
||||
.putExtra("disabled", SystemConstants.DISABLE.equals(node.getStatus()))
|
||||
);
|
||||
// 获取当前列表中每一个节点的parentId,然后在列表中查找是否有id与其parentId对应,若无对应,则表明此时节点列表中,该节点在当前列表中属于顶级节点
|
||||
List<Tree<Long>> treeList = CollUtil.newArrayList();
|
||||
for (SysDeptVo d : depts) {
|
||||
Long parentId = d.getParentId();
|
||||
SysDeptVo sysDeptVo = StreamUtils.findFirst(depts, it -> it.getDeptId().longValue() == parentId);
|
||||
if (ObjectUtil.isNull(sysDeptVo)) {
|
||||
List<Tree<Long>> trees = TreeBuildUtils.build(depts, parentId, (dept, tree) -> {
|
||||
tree.setId(dept.getDeptId())
|
||||
.setParentId(dept.getParentId())
|
||||
.setName(dept.getDeptName())
|
||||
.setWeight(dept.getOrderNum())
|
||||
.putExtra("disabled", SystemConstants.DISABLE.equals(dept.getStatus()));
|
||||
tree.putExtra("deptType", dept.getDeptType());
|
||||
}
|
||||
);
|
||||
Tree<Long> tree = StreamUtils.findFirst(trees, it -> it.getId().longValue() == d.getDeptId());
|
||||
treeList.add(tree);
|
||||
}
|
||||
}
|
||||
return treeList;
|
||||
// if (CollUtil.isEmpty(depts)) {
|
||||
// return CollUtil.newArrayList();
|
||||
// }
|
||||
// return TreeBuildUtils.buildMultiRoot(
|
||||
// depts,
|
||||
// SysDeptVo::getDeptId,
|
||||
// SysDeptVo::getParentId,
|
||||
// (node, treeNode) -> treeNode
|
||||
// .setId(node.getDeptId())
|
||||
// .setParentId(node.getParentId())
|
||||
// .setName(node.getDeptName())
|
||||
// .setWeight(node.getOrderNum())
|
||||
// .putExtra("disabled", SystemConstants.DISABLE.equals(node.getStatus()))
|
||||
// );
|
||||
}
|
||||
|
||||
//TODO 同步xinnengyuan的service
|
||||
|
||||
// /**
|
||||
// * 构建前端所需要下拉树结构
|
||||
// *
|
||||
// * @param projectId 项目id
|
||||
// * @return 下拉树结构列表
|
||||
// */
|
||||
// @Override
|
||||
// public List<Tree<Long>> buildDeptTreeByProjectId(Long projectId) {
|
||||
// SysDept dept = baseMapper.selectOne(
|
||||
// new LambdaQueryWrapper<>(SysDept.class)
|
||||
// .eq(SysDept::getProjectId, projectId)
|
||||
// .eq(SysDept::getDeptType, SysDeptTypeEnum.PROJECT.getCode())
|
||||
// .eq(SysDept::getStatus, SystemConstants.NORMAL)
|
||||
// );
|
||||
// if (dept == null) {
|
||||
// return List.of();
|
||||
// }
|
||||
// List<Long> deptIds = Stream.concat(
|
||||
// Arrays.stream(dept.getAncestors().split(","))
|
||||
// .filter(StringUtils::isNotBlank)
|
||||
// .map(Long::parseLong),
|
||||
// Stream.of(dept.getDeptId())
|
||||
// ).toList();
|
||||
// List<SysDeptVo> deptVoList = baseMapper.selectVoByIds(deptIds);
|
||||
// List<SysPostVo> postVos = postMapper.selectVoList(
|
||||
// new LambdaQueryWrapper<>(SysPost.class)
|
||||
// .in(SysPost::getDeptId, deptIds)
|
||||
// .eq(SysPost::getStatus, SystemConstants.NORMAL)
|
||||
// );
|
||||
// Map<Long, List<SysPostVo>> postVoMap = postVos.stream().collect(Collectors.groupingBy(SysPostVo::getDeptId));
|
||||
// // 获取当前列表中每一个节点的parentId,然后在列表中查找是否有id与其parentId对应,若无对应,则表明此时节点列表中,该节点在当前列表中属于顶级节点
|
||||
// List<Tree<Long>> treeList = CollUtil.newArrayList();
|
||||
// for (SysDeptVo d : deptVoList) {
|
||||
// Long parentId = d.getParentId();
|
||||
// SysDeptVo sysDeptVo = StreamUtils.findFirst(deptVoList, it -> it.getDeptId().longValue() == parentId);
|
||||
// if (ObjectUtil.isNull(sysDeptVo)) {
|
||||
// List<Tree<Long>> trees = TreeBuildUtils.build(deptVoList, parentId, (deptVo, tree) -> {
|
||||
// Long deptId = deptVo.getDeptId();
|
||||
// tree.setId(deptId)
|
||||
// .setParentId(deptVo.getParentId())
|
||||
// .setName(deptVo.getDeptName())
|
||||
// .setWeight(deptVo.getOrderNum())
|
||||
// .putExtra("disabled", SystemConstants.DISABLE.equals(deptVo.getStatus()));
|
||||
// tree.putExtra("deptType", deptVo.getDeptType());
|
||||
// tree.putExtra("postVoList", postVoMap.get(deptId));
|
||||
// }
|
||||
// );
|
||||
// Tree<Long> tree = StreamUtils.findFirst(trees, it -> it.getId().longValue() == d.getDeptId());
|
||||
// treeList.add(tree);
|
||||
// }
|
||||
// }
|
||||
// return treeList;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
|
@ -40,9 +40,9 @@ spring.sql.init.platform=mysql
|
||||
db.num=1
|
||||
|
||||
### Connect URL of DB:
|
||||
db.url.0=jdbc:mysql://127.0.0.1:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
db.user.0=root
|
||||
db.password.0=root
|
||||
db.url.0=jdbc:mysql://192.168.110.149:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
|
||||
db.user.0=zhihuiyunweidev
|
||||
db.password.0=zhihuiyunweidev
|
||||
|
||||
### the maximum retry times for push
|
||||
nacos.config.push.maxRetryTime=50
|
||||
|
Reference in New Issue
Block a user