Compare commits
9 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
21aca2f55d | |
|
|
e15cf54d6a | |
|
|
f3988af15d | |
|
|
7633bc5d5e | |
|
|
120d592688 | |
|
|
19889c1f89 | |
|
|
d8b10d161e | |
|
|
a81da88bc4 | |
|
|
2b74e4ac50 |
23
pom.xml
23
pom.xml
|
|
@ -15,16 +15,16 @@
|
||||||
<!-- 各种 module 拓展 -->
|
<!-- 各种 module 拓展 -->
|
||||||
<module>yudao-module-system</module>
|
<module>yudao-module-system</module>
|
||||||
<module>yudao-module-infra</module>
|
<module>yudao-module-infra</module>
|
||||||
<!-- <module>yudao-module-member</module>-->
|
<!-- <module>yudao-module-member</module>-->
|
||||||
<!-- <module>yudao-module-bpm</module>-->
|
<!-- <module>yudao-module-bpm</module>-->
|
||||||
<module>yudao-module-report</module>
|
<module>yudao-module-report</module>
|
||||||
<!-- <module>yudao-module-mp</module>-->
|
<!-- <module>yudao-module-mp</module>-->
|
||||||
<module>yudao-module-pay</module>
|
<module>yudao-module-pay</module>
|
||||||
<!-- <module>yudao-module-mall</module>-->
|
<!-- <module>yudao-module-mall</module>-->
|
||||||
<!-- <module>yudao-module-crm</module>-->
|
<!-- <module>yudao-module-crm</module>-->
|
||||||
<!-- <module>yudao-module-erp</module>-->
|
<!-- <module>yudao-module-erp</module>-->
|
||||||
<module>yudao-module-ai</module>
|
<module>yudao-module-ai</module>
|
||||||
<!-- <module>yudao-module-iot</module>-->
|
<!-- <module>yudao-module-iot</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
|
|
@ -134,6 +134,15 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>17</source>
|
||||||
|
<target>17</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.rocketmq</groupId>
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
<optional>true</optional>
|
<!--<optional>true</optional>-->
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package cn.iocoder.yudao.framework.mq.rocketmq.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bixuan
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2025/5/4 10:22
|
||||||
|
*/
|
||||||
|
public interface GroupConstants {
|
||||||
|
String BIND_CARD_PACKAGE_GROUP = "bind-card-package-group";
|
||||||
|
String UNBIND_CARD_PACKAGE_GROUP = "unbind-card-package-group";
|
||||||
|
String CHANGE_CARD_PACKAGE_GROUP = "change-card-package-group";
|
||||||
|
String SYNC_BATCH_GROUP = "sync-batch-group";
|
||||||
|
String SYNC_CARD_PACKAGE_GROUP = "sync-card-package-group";
|
||||||
|
String SYNC_CARD_PACKAGE_TRAFFIC_GROUP = "sync-card-package-traffic-group";
|
||||||
|
String SYNC_CARD_POOL_TRAFFIC_GROUP = "sync-card-pool-traffic-group";
|
||||||
|
String SYNC_POOL_TRAFFIC_GROUP = "sync-pool-traffic-group";
|
||||||
|
String SYNC_STATISTICS_CARD_POOL_TRAFFIC_GROUP = "sync-statistics-card-pool-traffic-group";
|
||||||
|
String SYNC_STATISTICS_CARD_PACKAGE_TRAFFIC_GROUP = "sync-statistics-card-package-traffic-group";
|
||||||
|
String PAY_ORDER_DELAY_CLOSE_GROUP = "pay-order-delay-close-group";
|
||||||
|
String PAY_ORDER_GENERATE_BILL_GROUP = "pay-order-generate-bill-group";
|
||||||
|
String REFUND_ORDER_WRITE_OFF_BILL_GROUP = "refund-order-write-off-bill-group";
|
||||||
|
String SYNC_PACKAGE_TRAFFIC_GROUP = "sync-package-traffic-group";
|
||||||
|
String PAY_ORDER_REFUND_GROUP = "pay-order-refund-group";
|
||||||
|
String EIOT_CLUB_NOTIFY_SUBPKGLIST_GROUP = "eiot-club-notify-subPkgList-group";
|
||||||
|
String EIOT_CLUB_NOTIFY_REFUND_GROUP = "eiot-club-notify-refund-group";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package cn.iocoder.yudao.framework.mq.rocketmq.core;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: b2b2c-admin
|
||||||
|
* @ClassName TopicNameConstants
|
||||||
|
* @description:
|
||||||
|
* @author: HuangLei
|
||||||
|
* @create: 2025/4/28/周一 9:55
|
||||||
|
* @Version 1.0
|
||||||
|
**/
|
||||||
|
public interface TopicNameConstants {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商主题,相同操作消息可以使用tag区分
|
||||||
|
*/
|
||||||
|
String IOT_OPERATOR = "iot-operator";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事务主题,相同操作消息可以使用tag区分
|
||||||
|
*/
|
||||||
|
String IOT_TRANSACTION = "iot-transaction";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延时主题,相同操作消息可以使用tag区分
|
||||||
|
*/
|
||||||
|
String IOT_DELAY = "iot-delay";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款主题,相同操作消息可以使用tag区分
|
||||||
|
*/
|
||||||
|
String PAY_REFUND_ORDER = "pay-refund-order";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* eiotclub异步通知主题
|
||||||
|
*/
|
||||||
|
String EIOT_CLUB_NOTIFY_TOPIC = "eiot-club-notify";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package cn.iocoder.yudao.framework.mq.rocketmq.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author bixuan
|
||||||
|
* @date 2025/5/4 10:22
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public interface TopicTagConstants {
|
||||||
|
String BIND_CARD_PACKAGE_TAG = "bind_card_package";
|
||||||
|
String UNBIND_CARD_PACKAGE_TAG = "unbind_card_package";
|
||||||
|
String CHANGE_CARD_PACKAGE_TAG = "change_card_package";
|
||||||
|
String SYNC_BATCH_TAG = "sync_batch";
|
||||||
|
String SYNC_CARD_PACKAGE_TAG = "sync_card_package";
|
||||||
|
String SYNC_CARD_PACKAGE_TRAFFIC_TAG = "sync_card_package_traffic";
|
||||||
|
String SYNC_CARD_POOL_TRAFFIC_TAG = "sync_card_pool_traffic";
|
||||||
|
String SYNC_POOL_TRAFFIC_TAG = "sync_pool_traffic";
|
||||||
|
String SYNC_STATISTICS_CARD_POOL_TRAFFIC_TAG = "sync_statistics_card_pool_traffic";
|
||||||
|
String SYNC_STATISTICS_CARD_PACKAGE_TRAFFIC_TAG = "sync_statistics_card_package_traffic";
|
||||||
|
|
||||||
|
String PAY_ORDER_SUCCESS_BILL_TAG = "pay_order_success_bill";
|
||||||
|
String REFUND_SUCCESS_BILL_TAG = "refund_success_bill";
|
||||||
|
String DELAY_PAY_ORDER_DELAY_CLOSE = "delay_pay_order_close";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||||
|
import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
|
|
@ -15,13 +16,17 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RoleMapper extends BaseMapperX<RoleDO> {
|
public interface RoleMapper extends BaseMapperX<RoleDO> {
|
||||||
|
|
||||||
|
|
||||||
default PageResult<RoleDO> selectPage(RolePageReqVO reqVO) {
|
default PageResult<RoleDO> selectPage(RolePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<RoleDO>()
|
PageResult<RoleDO> roleDOPageResult = selectPage(reqVO, new LambdaQueryWrapperX<RoleDO>()
|
||||||
.likeIfPresent(RoleDO::getName, reqVO.getName())
|
.likeIfPresent(RoleDO::getName, reqVO.getName())
|
||||||
.likeIfPresent(RoleDO::getCode, reqVO.getCode())
|
.likeIfPresent(RoleDO::getCode, reqVO.getCode())
|
||||||
.eqIfPresent(RoleDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(RoleDO::getStatus, reqVO.getStatus())
|
||||||
.betweenIfPresent(BaseDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(BaseDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.ne(RoleDO::getCode, RoleCodeEnum.SUPER_ADMIN.getCode())
|
||||||
.orderByAsc(RoleDO::getSort));
|
.orderByAsc(RoleDO::getSort));
|
||||||
|
//过滤掉super_admin及管理员
|
||||||
|
return roleDOPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
default RoleDO selectByName(String name) {
|
default RoleDO selectByName(String name) {
|
||||||
|
|
@ -33,7 +38,9 @@ public interface RoleMapper extends BaseMapperX<RoleDO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<RoleDO> selectListByStatus(@Nullable Collection<Integer> statuses) {
|
default List<RoleDO> selectListByStatus(@Nullable Collection<Integer> statuses) {
|
||||||
return selectList(RoleDO::getStatus, statuses);
|
return selectList(new LambdaQueryWrapperX<RoleDO>()
|
||||||
|
.eq(RoleDO::getStatus, statuses)
|
||||||
|
.ne(RoleDO::getCode, RoleCodeEnum.SUPER_ADMIN.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||||
|
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
|
@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
@ -164,9 +167,39 @@ public class DeptServiceImpl implements DeptService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeptDO> getDeptList(DeptListReqVO reqVO) {
|
public List<DeptDO> getDeptList(DeptListReqVO reqVO) {
|
||||||
List<DeptDO> list = deptMapper.selectList(reqVO);
|
List<DeptDO> list = DataPermissionUtils.executeIgnore(() -> {
|
||||||
list.sort(Comparator.comparing(DeptDO::getSort));
|
return deptMapper.selectList(reqVO);
|
||||||
return list;
|
});
|
||||||
|
Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
|
//从当前登录的部门开始,递归获取子部门
|
||||||
|
// 从当前登录的部门开始, 递归获取所有子部门
|
||||||
|
List<DeptDO> allSubDepts = new ArrayList<>();
|
||||||
|
if (loginUserDeptId != null) {
|
||||||
|
DeptDO currentDept = deptMapper.selectById(loginUserDeptId);
|
||||||
|
if (currentDept != null) {
|
||||||
|
allSubDepts.add(currentDept);
|
||||||
|
collectAllSubDept(allSubDepts, currentDept.getId(), list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 合并所有子部门到结果列表中
|
||||||
|
allSubDepts.sort(Comparator.comparing(DeptDO::getSort));
|
||||||
|
return allSubDepts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归收集所有子部门.
|
||||||
|
*
|
||||||
|
* @param allSubDepts 收集所有子部门的列表
|
||||||
|
* @param parentId 父部门ID
|
||||||
|
* @param allDepts 所有部门的列表
|
||||||
|
*/
|
||||||
|
private void collectAllSubDept(List<DeptDO> allSubDepts, Long parentId, List<DeptDO> allDepts) {
|
||||||
|
for (DeptDO dept : allDepts) {
|
||||||
|
if (parentId.equals(dept.getParentId())) {
|
||||||
|
allSubDepts.add(dept);
|
||||||
|
collectAllSubDept(allSubDepts, dept.getId(), allDepts); // 递归收集子部门
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,12 @@
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
|
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- IoT 物联网相关模块。默认注释,保证编译速度 -->
|
<!-- IoT 物联网相关模块。默认注释,保证编译速度 -->
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||||
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
* 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
|
||||||
*
|
* cn.iocoder.yudao.server
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
|
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
|
||||||
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
|
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module",
|
||||||
|
"${yudao.info.base-package}.framework.*"})
|
||||||
public class YudaoServerApplication {
|
public class YudaoServerApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,14 @@ spring:
|
||||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: 400-infra.server.iocoder.cn # 地址
|
host: 192.168.201.228 # 地址
|
||||||
port: 6379 # 端口
|
port: 31314 # 端口
|
||||||
database: 1 # 数据库索引
|
database: 1 # 数据库索引
|
||||||
# password: 123456 # 密码,建议生产环境开启
|
password: redis.123456 # 密码,建议生产环境开启
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
# 是否开启ssl
|
||||||
|
ssl.enabled: false
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
|
|
@ -96,7 +100,7 @@ spring:
|
||||||
|
|
||||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
|
name-server: 192.168.201.58:9876 # RocketMQ Namesrv
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,10 @@ spring:
|
||||||
port: 31314 # 端口
|
port: 31314 # 端口
|
||||||
database: 2 # 数据库索引
|
database: 2 # 数据库索引
|
||||||
password: redis.123456 # 密码,建议生产环境开启
|
password: redis.123456 # 密码,建议生产环境开启
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 10s
|
||||||
|
# 是否开启ssl
|
||||||
|
ssl.enabled: false
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
|
|
@ -120,7 +124,7 @@ spring:
|
||||||
|
|
||||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
|
name-server: 192.168.201.58:9876 # RocketMQ Namesrv
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue