Commit 679c7247 authored by huyuchen's avatar huyuchen

Merge branch 'MVP1.5.8' into develop

# Conflicts:
#	yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmpContractAlertServiceImpl.java
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TPaymentInfoServiceImpl.java
parents 9438684b d9931267
apiVersion: apps/v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Deployment # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
name: yifu-permission # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
selector: # 选择器
matchLabels: # 匹配标签
app: yifu-permission
replicas: 1 # 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
# maxSurge: 30% # 最大额外可以存在的副本数,可以为百分比,也可以为整数
# maxUnavailable: 30% # 示在更新过程中能够进入不可用状态的 Pod 的最大值,可以为百分比,也可以为整数
# type: RollingUpdate # 滚动更新策略
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-permission
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-permission" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "5027" #这个参数告诉Dapr你的应用程序正在监听哪个端口。
#dapr.io/log-level: "debug" #为 Dapr sidecar设置日志级别。 允许的值是debug,info,warn,error。 默认是 info
#dapr.io/log-as-json: "false" #将此参数设置为true以JSON格式输出日志。 默认值为 false.
#dapr.io/config: file #告诉 Dapr 要使用哪个配置 CRD
dapr.io/app-protocol: "http" #告诉 Dapr 你的应用程序正在使用哪种协议。 有效选项是 http and grpc。 Default is http
#dapr.io/app-max-concurrency: "20" #限制应用程序的并发量。 有效的数值是大于 0
#dapr.io/app-ssl: "false" #告诉Dapr通过不安全的SSL连接调用应用程序。 同时适用于HTTP和gRPC。 Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. 默认值为 false.
dapr.io/metrics-port: "9090" #设置 sidecar 度量服务器的端口。 默认值为 9090
#dapr.io/sidecar-cpu-limit: 2 #Dapr sidecar可以使用的最大CPU数量。 默认情况下未设置
#dapr.io/sidecar-memory-limit: "800Mi" #Dapr sidecar可以使用的最大内存量。默认情况下未设置 请参阅 https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ 的有效值。
#dapr.io/sidecar-cpu-request: 1 #Dapr sidecar要求的 CPU 数量
#dapr.io/sidecar-memory-request #Dapr sidecar 请求的内存数量
dapr.io/http-max-request-size: "100" #增加http和grpc服务器请求正文参数的最大大小,单位为MB,以处理大文件的上传。 默认值为 4 MB
dapr.io/http-read-buffer-size: "16" #Dapr has a default limit of 4KB for the http header read buffer size. When sending http headers that are bigger than the default 4KB, you can increase this value. Otherwise, you may encounter a Too big request header
dapr.io/sidecar-listen-addresses: "0.0.0.0"
# 更多dapr配置请参考 https://www.bookstack.cn/read/dapr-1.5-zh/cc77b74e2cc2f4d4.md
spec: # 资源规范字段
nodeSelector: # node 选择器
node-type: worker # node标签
kubernetes.io/hostname: yfmaster1
containers: # 容器
- name: yifu-permission # 容器的名字
#image: 192.168.1.110:5500/qas-mvp/yifu-permission-biz:1.0.0 # 容器镜像地址
image: hub.worfu.com/qas-mvp/yifu-permission-biz:1.0.0 #临时地址
imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
ports:
- containerPort: 5027 # 容器端口
env: # 启动环境配置信息 active and timeZone set
- name: SPRING_PROFILES_ACTIVE
value: test
- name: TZ
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "4096Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
memory: "500Mi"
#livenessProbe: # pod 内部健康检查的设置
# httpGet: # 通过httpget检查健康,返回200-399之间,则认为容器正常
# path: /healthCheck # URI地址
# port: 8080 # 端口
# scheme: HTTP # 协议
# # host: 127.0.0.1 # 主机地址
# initialDelaySeconds: 30 # 表明第一次检测在容器启动后多长时间后开始
# timeoutSeconds: 5 # 检测的超时时间
# periodSeconds: 30 # 检查间隔时间
# successThreshold: 1 # 成功门槛
# failureThreshold: 5 # 失败门槛,连接失败5次,pod杀掉,重启一个新的pod
# readinessProbe: # Pod 准备服务健康检查设置
# httpGet:
# path: /healthCheck
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 30
# timeoutSeconds: 5
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 5
#也可以用这种方法
#exec: 执行命令的方法进行监测,如果其退出码不为0,则认为容器正常
# command:
# - cat
# - /tmp/health
#也可以用这种方法
#tcpSocket: # 通过tcpSocket检查健康
# port: number
#ports:
# - name: http # 名称
# containerPort: 8080 # 容器开发对外的端口
# protocol: TCP # 协议
imagePullSecrets: # 镜像仓库拉取密钥
- name: login
#affinity: # 亲和性调试
# nodeAffinity: # 节点亲和力
# requiredDuringSchedulingIgnoredDuringExecution: # pod 必须部署到满足条件的节点上
# nodeSelectorTerms: # 节点满足任何一个条件就可以
# - matchExpressions: # 有多个选项,则只有同时满足这些逻辑选项的节点才能运行 pod
# - key: beta.kubernetes.io/arch
# operator: In
# values:
# - amd64
\ No newline at end of file
apiVersion: v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Service # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
labels: # 设定资源的标签
app: yifu-permission # 资源的名字,在同一个namespace中必须唯一
name: yifu-permission # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
ports:
- port: 5027 # service 端口
protocol: TCP # 协议
targetPort: 5027 # 容器暴露的端口
name: http-permission # 端口名称
- port: 3500 # service 端口
protocol: TCP # 协议
targetPort: 3500 # 容器暴露的端口
name: http-permission-dapr
selector: # 选择器
app: yifu-permission # 资源名称
type: ClusterIP # ClusterIP 类型
\ No newline at end of file
apiVersion: apps/v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Deployment # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
name: yifu-permission # 资源的名字,在同一个namespace中必须唯一
namespace: prd-mvp # 部署在哪个namespace中
spec: # 资源规范字段
selector: # 选择器
matchLabels: # 匹配标签
app: yifu-permission
replicas: 1 # 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
# maxSurge: 30% # 最大额外可以存在的副本数,可以为百分比,也可以为整数
# maxUnavailable: 30% # 示在更新过程中能够进入不可用状态的 Pod 的最大值,可以为百分比,也可以为整数
# type: RollingUpdate # 滚动更新策略
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-permission
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-permission" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "5026" #这个参数告诉Dapr你的应用程序正在监听哪个端口。
#dapr.io/log-level: "debug" #为 Dapr sidecar设置日志级别。 允许的值是debug,info,warn,error。 默认是 info
#dapr.io/log-as-json: "false" #将此参数设置为true以JSON格式输出日志。 默认值为 false.
#dapr.io/config: file #告诉 Dapr 要使用哪个配置 CRD
dapr.io/app-protocol: "http" #告诉 Dapr 你的应用程序正在使用哪种协议。 有效选项是 http and grpc。 Default is http
#dapr.io/app-max-concurrency: "20" #限制应用程序的并发量。 有效的数值是大于 0
#dapr.io/app-ssl: "false" #告诉Dapr通过不安全的SSL连接调用应用程序。 同时适用于HTTP和gRPC。 Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. 默认值为 false.
dapr.io/metrics-port: "9090" #设置 sidecar 度量服务器的端口。 默认值为 9090
#dapr.io/sidecar-cpu-limit: 2 #Dapr sidecar可以使用的最大CPU数量。 默认情况下未设置
#dapr.io/sidecar-memory-limit: "800Mi" #Dapr sidecar可以使用的最大内存量。默认情况下未设置 请参阅 https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ 的有效值。
#dapr.io/sidecar-cpu-request: 1 #Dapr sidecar要求的 CPU 数量
#dapr.io/sidecar-memory-request #Dapr sidecar 请求的内存数量
dapr.io/http-max-request-size: "100" #增加http和grpc服务器请求正文参数的最大大小,单位为MB,以处理大文件的上传。 默认值为 4 MB
dapr.io/http-read-buffer-size: "16" #Dapr has a default limit of 4KB for the http header read buffer size. When sending http headers that are bigger than the default 4KB, you can increase this value. Otherwise, you may encounter a Too big request header
dapr.io/sidecar-listen-addresses: "0.0.0.0"
# 更多dapr配置请参考 https://www.bookstack.cn/read/dapr-1.5-zh/cc77b74e2cc2f4d4.md
spec: # 资源规范字段
nodeSelector: # node 选择器
node-type: worker # node标签
kubernetes.io/hostname: yfmaster1
containers: # 容器
- name: yifu-permission # 容器的名字
#image: 192.168.1.110:5500/prd-mvp/yifu-permission-biz:1.0.0 # 容器镜像地址
image: hub.worfu.com/prd-mvp/yifu-permission-biz:1.0.0 #临时地址
imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
ports:
- containerPort: 5027 # 容器端口
env: # 启动环境配置信息 active and timeZone set
- name: SPRING_PROFILES_ACTIVE
value: test
- name: TZ
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "4096Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
memory: "500Mi"
#livenessProbe: # pod 内部健康检查的设置
# httpGet: # 通过httpget检查健康,返回200-399之间,则认为容器正常
# path: /healthCheck # URI地址
# port: 8080 # 端口
# scheme: HTTP # 协议
# # host: 127.0.0.1 # 主机地址
# initialDelaySeconds: 30 # 表明第一次检测在容器启动后多长时间后开始
# timeoutSeconds: 5 # 检测的超时时间
# periodSeconds: 30 # 检查间隔时间
# successThreshold: 1 # 成功门槛
# failureThreshold: 5 # 失败门槛,连接失败5次,pod杀掉,重启一个新的pod
# readinessProbe: # Pod 准备服务健康检查设置
# httpGet:
# path: /healthCheck
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 30
# timeoutSeconds: 5
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 5
#也可以用这种方法
#exec: 执行命令的方法进行监测,如果其退出码不为0,则认为容器正常
# command:
# - cat
# - /tmp/health
#也可以用这种方法
#tcpSocket: # 通过tcpSocket检查健康
# port: number
#ports:
# - name: http # 名称
# containerPort: 8080 # 容器开发对外的端口
# protocol: TCP # 协议
imagePullSecrets: # 镜像仓库拉取密钥
- name: login
#affinity: # 亲和性调试
# nodeAffinity: # 节点亲和力
# requiredDuringSchedulingIgnoredDuringExecution: # pod 必须部署到满足条件的节点上
# nodeSelectorTerms: # 节点满足任何一个条件就可以
# - matchExpressions: # 有多个选项,则只有同时满足这些逻辑选项的节点才能运行 pod
# - key: beta.kubernetes.io/arch
# operator: In
# values:
# - amd64
\ No newline at end of file
apiVersion: v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Service # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
labels: # 设定资源的标签
app: yifu-permission # 资源的名字,在同一个namespace中必须唯一
name: yifu-permission # 资源的名字,在同一个namespace中必须唯一
namespace: prd-mvp # 部署在哪个namespace中
spec: # 资源规范字段
ports:
- port: 5027 # service 端口
protocol: TCP # 协议
targetPort: 5027 # 容器暴露的端口
name: http-permission # 端口名称
- port: 3500 # service 端口
protocol: TCP # 协议
targetPort: 3500 # 容器暴露的端口
name: http-permission-dapr
selector: # 选择器
app: yifu-permission # 资源名称
type: ClusterIP # ClusterIP 类型
\ No newline at end of file
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
<module>yifu-mail</module> <module>yifu-mail</module>
<module>yifu-business</module> <module>yifu-business</module>
<module>yifu-msg</module> <module>yifu-msg</module>
<module>yifu-permission</module>
</modules> </modules>
<dependencyManagement> <dependencyManagement>
......
...@@ -215,6 +215,8 @@ public class SalaryProveController { ...@@ -215,6 +215,8 @@ public class SalaryProveController {
} else { } else {
return R.failed("参数出错!"); return R.failed("参数出错!");
} }
// 存储最近一次选择的档案信息
tProveApplyService.setCompanyRedisInfo(record.getUnitName(),record.getUnitAddr(),record.getPhone());
return R.ok(record); return R.ok(record);
} }
...@@ -427,4 +429,14 @@ public class SalaryProveController { ...@@ -427,4 +429,14 @@ public class SalaryProveController {
return R.failed("无此证明记录!"); return R.failed("无此证明记录!");
} }
} }
/**
* 获取最近一次选择的客户名称
*
* @author fxj
* @date 2023-08-23 17:31:05
**/
@GetMapping("/getLastCompanyName")
public R<TCompanyInfo> getLastCompanyName() {
return tProveApplyService.getLastCompanyName();
}
} }
...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -37,6 +38,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -37,6 +38,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -89,7 +91,7 @@ public class TCompanyInfoController { ...@@ -89,7 +91,7 @@ public class TCompanyInfoController {
*/ */
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tcompanyinfo_get')") @Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tcompanyinfo_get')")
@GetMapping("/{id}") @GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo_get')") @PreAuthorize("@pms.hasPermission('tcompanyinfo_get')")
public R<TCompanyInfo> getById(@PathVariable("id") String id) { public R<TCompanyInfo> getById(@PathVariable("id") String id) {
return R.ok(tCompanyInfoService.getById(id)); return R.ok(tCompanyInfoService.getById(id));
} }
...@@ -100,10 +102,10 @@ public class TCompanyInfoController { ...@@ -100,10 +102,10 @@ public class TCompanyInfoController {
* @param tCompanyInfo 收入证明 中的 单位信息维护表 * @param tCompanyInfo 收入证明 中的 单位信息维护表
* @return R * @return R
*/ */
@Operation(summary = "新增收入证明 中的 单位信息维护表", description = "新增收入证明 中的 单位信息维护表:hasPermission('demo_tcompanyinfo_add')") @Operation(summary = "新增收入证明 中的 单位信息维护表", description = "新增收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_add')")
@SysLog("新增收入证明 中的 单位信息维护表") @SysLog("新增收入证明 中的 单位信息维护表")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo_add')") @PreAuthorize("@pms.hasPermission('tcompanyinfo_add')")
public R<Boolean> save(@RequestBody TCompanyInfo tCompanyInfo) { public R<Boolean> save(@RequestBody TCompanyInfo tCompanyInfo) {
TCompanyInfo exits = tCompanyInfoService.getOne(Wrappers.<TCompanyInfo>query().lambda() TCompanyInfo exits = tCompanyInfoService.getOne(Wrappers.<TCompanyInfo>query().lambda()
.eq(TCompanyInfo::getDeleteFlag,CommonConstants.ZERO_STRING) .eq(TCompanyInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
...@@ -111,6 +113,11 @@ public class TCompanyInfoController { ...@@ -111,6 +113,11 @@ public class TCompanyInfoController {
if (Common.isNotNull(exits)){ if (Common.isNotNull(exits)){
return R.failed("已存在相同公司名称的有效数据!"); return R.failed("已存在相同公司名称的有效数据!");
} }
tCompanyInfo.setCreateName(SecurityUtils.getUser().getNickname());
tCompanyInfo.setCreateBy(SecurityUtils.getUser().getId());
tCompanyInfo.setCreateTime(LocalDateTime.now());
tCompanyInfo.setUpdateBy(SecurityUtils.getUser().getId());
tCompanyInfo.setUpdateTime(LocalDateTime.now());
return R.ok(tCompanyInfoService.save(tCompanyInfo)); return R.ok(tCompanyInfoService.save(tCompanyInfo));
} }
/** /**
...@@ -119,10 +126,10 @@ public class TCompanyInfoController { ...@@ -119,10 +126,10 @@ public class TCompanyInfoController {
* @param tCompanyInfo 收入证明 中的 单位信息维护表 * @param tCompanyInfo 收入证明 中的 单位信息维护表
* @return R * @return R
*/ */
@Operation(summary = "修改收入证明 中的 单位信息维护表", description = "修改收入证明 中的 单位信息维护表:hasPermission('demo_tcompanyinfo_edit')") @Operation(summary = "修改收入证明 中的 单位信息维护表", description = "修改收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_edit')")
@SysLog("修改收入证明 中的 单位信息维护表") @SysLog("修改收入证明 中的 单位信息维护表")
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo_edit')") @PreAuthorize("@pms.hasPermission('tcompanyinfo_edit')")
public R<Boolean> updateById(@RequestBody TCompanyInfo tCompanyInfo) { public R<Boolean> updateById(@RequestBody TCompanyInfo tCompanyInfo) {
TCompanyInfo exits = tCompanyInfoService.getOne(Wrappers.<TCompanyInfo>query().lambda() TCompanyInfo exits = tCompanyInfoService.getOne(Wrappers.<TCompanyInfo>query().lambda()
.eq(TCompanyInfo::getDeleteFlag,CommonConstants.ZERO_STRING) .eq(TCompanyInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
...@@ -131,6 +138,9 @@ public class TCompanyInfoController { ...@@ -131,6 +138,9 @@ public class TCompanyInfoController {
if (Common.isNotNull(exits)){ if (Common.isNotNull(exits)){
return R.failed("已存在相同公司名称的有效数据!"); return R.failed("已存在相同公司名称的有效数据!");
} }
tCompanyInfo.setCreateTime(LocalDateTime.now());
tCompanyInfo.setUpdateBy(SecurityUtils.getUser().getId());
tCompanyInfo.setUpdateTime(LocalDateTime.now());
return R.ok(tCompanyInfoService.updateById(tCompanyInfo)); return R.ok(tCompanyInfoService.updateById(tCompanyInfo));
} }
...@@ -140,10 +150,10 @@ public class TCompanyInfoController { ...@@ -140,10 +150,10 @@ public class TCompanyInfoController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id删除收入证明 中的 单位信息维护表", description = "通过id删除收入证明 中的 单位信息维护表:hasPermission('demo_tcompanyinfo_del')") @Operation(summary = "通过id删除收入证明 中的 单位信息维护表", description = "通过id删除收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_del')")
@SysLog("通过id删除收入证明 中的 单位信息维护表") @SysLog("通过id删除收入证明 中的 单位信息维护表")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo_del')") @PreAuthorize("@pms.hasPermission('tcompanyinfo_del')")
public R<Boolean> removeById(@PathVariable String id) { public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tCompanyInfoService.removeById(id)); return R.ok(tCompanyInfoService.removeById(id));
} }
...@@ -155,10 +165,10 @@ public class TCompanyInfoController { ...@@ -155,10 +165,10 @@ public class TCompanyInfoController {
* @date 2023-08-23 17:31:05 * @date 2023-08-23 17:31:05
**/ **/
@SneakyThrows @SneakyThrows
@Operation(description = "批量新增收入证明 中的 单位信息维护表 hasPermission('demo_tcompanyinfo-batch-import')") @Operation(description = "批量新增收入证明 中的 单位信息维护表 hasPermission('tcompanyinfo-batch-import')")
@SysLog("批量新增收入证明 中的 单位信息维护表") @SysLog("批量新增收入证明 中的 单位信息维护表")
@PostMapping("/importListAdd") @PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo-batch-import')") @PreAuthorize("@pms.hasPermission('tcompanyinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) { public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tCompanyInfoService.importDiy(file.getInputStream()); return tCompanyInfoService.importDiy(file.getInputStream());
} }
...@@ -169,9 +179,9 @@ public class TCompanyInfoController { ...@@ -169,9 +179,9 @@ public class TCompanyInfoController {
* @author fxj * @author fxj
* @date 2023-08-23 17:31:05 * @date 2023-08-23 17:31:05
**/ **/
@Operation(description = "导出收入证明 中的 单位信息维护表 hasPermission('demo_tcompanyinfo-export')") @Operation(description = "导出收入证明 中的 单位信息维护表 hasPermission('tcompanyinfo-export')")
@PostMapping("/export") @PostMapping("/export")
@PreAuthorize("@pms.hasPermission('demo_tcompanyinfo-export')") @PreAuthorize("@pms.hasPermission('tcompanyinfo-export')")
public void export(HttpServletResponse response, @RequestBody TCompanyInfoSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TCompanyInfoSearchVo searchVo) {
tCompanyInfoService.listExport(response, searchVo); tCompanyInfoService.listExport(response, searchVo);
} }
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply; import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -23,4 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> { ...@@ -23,4 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> {
R<String> validSave(TProveApply proveApply, String[] attaIdArray); R<String> validSave(TProveApply proveApply, String[] attaIdArray);
R<TCompanyInfo> getLastCompanyName();
void setCompanyRedisInfo(String unitName, String unitAddr, String phone);
} }
...@@ -280,46 +280,44 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -280,46 +280,44 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
public R<Boolean> taskCreateContractAlert() { public R<Boolean> taskCreateContractAlert() {
// 获取合同为在档、员工类型为“0外包”、“1派遣”、最近一次合同审核通过、过期或离过期还有3个月的数据 // 获取合同为在档、员工类型为“0外包”、“1派遣”、最近一次合同审核通过、过期或离过期还有3个月的数据
List<TEmployeeContractInfo> alertList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query() List<TEmployeeContractInfo> alertList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.TWO_STRING) .lambda().eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING)
.isNotNull(TEmployeeContractInfo::getAuditTimeLast) .isNotNull(TEmployeeContractInfo::getAuditTimeLast)
.eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getContractType,CommonConstants.ONE_STRING)
.eq(TEmployeeContractInfo::getContractType, CommonConstants.ONE_STRING) .eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getWorkFlag, CommonConstants.ZERO_STRING) .ne(TEmployeeContractInfo::getSituation,"续签")
.ne(TEmployeeContractInfo::getSituation, "续签 ") .ne(TEmployeeContractInfo::getSituation,"终止")
.ne(TEmployeeContractInfo::getSituation, "终止") .le(TEmployeeContractInfo::getContractEnd,DateUtil.dateIncreaseByDay(
.le(TEmployeeContractInfo::getContractEnd, DateUtil.dateIncreaseByDay(
DateUtil.dateIncreaseByMonth(DateUtil.getCurrentDateTime(), DateUtil.dateIncreaseByMonth(DateUtil.getCurrentDateTime(),
CommonConstants.dingleDigitIntArray[3]), CommonConstants.dingleDigitIntArray[1])) CommonConstants.dingleDigitIntArray[3]),CommonConstants.dingleDigitIntArray[1]))
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
// 获取所有未审核通过的合同数据 // 获取所有未审核通过的合同数据
List<TEmployeeContractInfo> notAccessList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda() List<TEmployeeContractInfo> notAccessList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query().lambda()
.and(obj -> obj.eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ZERO_STRING) .and(obj->obj.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ZERO_STRING)
.or().eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ONE_STRING)) .or().eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_STRING))
.eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getWorkFlag, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING)); Map<String,TEmpContractAlert> alertMap = new HashMap<>();
Map<String, TEmpContractAlert> alertMap = new HashMap<>(); Map<String,TEmpContractAlert> existMap = new HashMap<>();
Map<String, TEmpContractAlert> existMap = new HashMap<>();
initExistMap(existMap); initExistMap(existMap);
if (Common.isNotNull(alertList)) { if (Common.isNotNull(alertList)){
Date nowDate = new Date(); Date nowDate = new Date();
for (TEmployeeContractInfo contract : alertList) { for (TEmployeeContractInfo contract:alertList){
extracted(nowDate, contract, alertMap, existMap); extracted(nowDate, contract,alertMap,existMap);
} }
} }
if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)) { if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){
TEmpContractAlert exist; TEmpContractAlert exist;
for (TEmployeeContractInfo contract : notAccessList) { for (TEmployeeContractInfo contract:notAccessList){
exist = alertMap.get(contract.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contract.getDeptNo()); exist = alertMap.get(contract.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+contract.getDeptNo());
if (Common.isNotNull(exist)) { if (Common.isNotNull(exist)){
exist.setHandleStatus(CommonConstants.ONE_STRING); exist.setHandleStatus(CommonConstants.ONE_STRING);
alertMap.put(contract.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contract.getDeptNo(), exist); alertMap.put(contract.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+contract.getDeptNo(),exist);
} }
} }
} }
baseMapper.truncate(); baseMapper.truncate();
if (Common.isNotNull(alertMap)) { if (Common.isNotNull(alertMap)){
this.saveBatch(alertMap.values()); this.saveBatch(alertMap.values());
} }
return R.ok(); return R.ok();
......
...@@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply; import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService; import com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +30,8 @@ import java.util.List; ...@@ -27,7 +30,8 @@ import java.util.List;
*/ */
@Service @Service
public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService { public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService {
@Autowired
private RedisUtil redisUtil;
@Autowired @Autowired
private TAttaInfoService tAttaInfoService; private TAttaInfoService tAttaInfoService;
...@@ -79,5 +83,30 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv ...@@ -79,5 +83,30 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
return R.ok("操作成功!"); return R.ok("操作成功!");
} }
@Override
public R<TCompanyInfo> getLastCompanyName() {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId();
Object info = redisUtil.get(userKey);
if(Common.isEmpty(info)){
return R.ok(null);
}
return R.ok((TCompanyInfo)info);
}
@Override
public void setCompanyRedisInfo(String unitName, String unitAddr, String phone) {
YifuUser user = SecurityUtils.getUser();
if (!Common.isEmpty(user)){
String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId();
TCompanyInfo info = new TCompanyInfo();
info.setCompanyName(unitName);
info.setCompanyTel(phone);
info.setCompanyAddress(unitAddr);
redisUtil.set(userKey,info);
}
}
} }
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
AND a.id = #{tCompanyInfo.id} AND a.id = #{tCompanyInfo.id}
</if> </if>
<if test="tCompanyInfo.companyName != null and tCompanyInfo.companyName.trim() != ''"> <if test="tCompanyInfo.companyName != null and tCompanyInfo.companyName.trim() != ''">
AND a.COMPANY_NAME = #{tCompanyInfo.companyName} AND a.COMPANY_NAME like CONCAT('%',#{tCompanyInfo.companyName},'%')
</if> </if>
<if test="tCompanyInfo.companyAddress != null and tCompanyInfo.companyAddress.trim() != ''"> <if test="tCompanyInfo.companyAddress != null and tCompanyInfo.companyAddress.trim() != ''">
AND a.COMPANY_ADDRESS = #{tCompanyInfo.companyAddress} AND a.COMPANY_ADDRESS = #{tCompanyInfo.companyAddress}
......
...@@ -167,4 +167,9 @@ public interface CacheConstants { ...@@ -167,4 +167,9 @@ public interface CacheConstants {
String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock"; String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock";
public static final String WX_ACCOSS_TOKEN = "WX_ACCOSS_TOKEN"; public static final String WX_ACCOSS_TOKEN = "WX_ACCOSS_TOKEN";
/**
* 登录用户最近一次选择的收入证明单位名称
*/
public static final String WXHR_LAST_SELECT_COMPANY_NAME = "wxhr_last_select_company_name";
} }
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author hgw
* @Date 2023-9-5 09:42:31
* @Description EKP数据权限
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.permission", ignoreInvalidFields = false)
public class DaprEkpPermissionProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
...@@ -26,4 +26,8 @@ dapr.business.appId=yifu-business ...@@ -26,4 +26,8 @@ dapr.business.appId=yifu-business
#\u6D4B\u8BD5\u73AF\u5883-\u6D88\u606F\u63D0\u9192\u670D\u52A1 #\u6D4B\u8BD5\u73AF\u5883-\u6D88\u606F\u63D0\u9192\u670D\u52A1
dapr.msg.appUrl=http://yifu-msg.qas-mvp.svc.cluster.local:3500/v1.0/invoke/ dapr.msg.appUrl=http://yifu-msg.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.msg.appId=yifu-msg dapr.msg.appId=yifu-msg
\ No newline at end of file
#\u6D4B\u8BD5\u73AF\u5883-EKP\u6743\u9650
dapr.permission.appUrl=http://yifu-permission.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.permission.appId=yifu-permission
\ No newline at end of file
...@@ -313,5 +313,7 @@ public class EkpSalaryParam implements Serializable { ...@@ -313,5 +313,7 @@ public class EkpSalaryParam implements Serializable {
private String fd_3bcd41d77e4812; private String fd_3bcd41d77e4812;
// 应发工资(导表金额) // 应发工资(导表金额)
private String fd_3bcdee91cacb6c; private String fd_3bcdee91cacb6c;
// 创建人
private String fd_3c3e5ff65115a2;
} }
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprEkpPermissionProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Author hgw
* @Description EKP权限定时任务
* @Date 2023-9-5 09:40:09
**/
@Component(value = "ekpPermissionTask")
@Slf4j
@EnableConfigurationProperties(DaprEkpPermissionProperties.class)
public class EkpPermissionTask {
@Autowired
private DaprEkpPermissionProperties daprEkpPermissionProperties;
/**
* @return
* @Author hgw
* @Description 刷新EKP权限里的账号信息
* @Date 2023-9-5 09:45:22
* @Param
**/
public void doRefreshEkpUser() throws Exception {
log.info("-------------刷新EKP权限里的账号信息-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpPermissionProperties.getAppUrl(), daprEkpPermissionProperties.getAppId(),
"/sysuserinfo/inner/doRefreshEkpUser", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------刷新EKP权限里的账号信息-定时任务结束------------");
}
}
\ No newline at end of file
...@@ -116,7 +116,13 @@ ...@@ -116,7 +116,13 @@
b1.fd_id ORDER_ID, b1.fd_id ORDER_ID,
'1' AS ALERT_TYPE, '1' AS ALERT_TYPE,
DATE_ADD(NOW(), INTERVAL 30 MINUTE) as 'date1', DATE_ADD(NOW(), INTERVAL 30 MINUTE) as 'date1',
IF(b1.fd_3b779ba2168eea = 1,DATE_ADD(a.fd_start_date,INTERVAL 3 HOUR),IF(b1.fd_3b779ba2168eea = 4,DATE_ADD(a.fd_start_date,INTERVAL 5 HOUR),DATE_ADD(a.fd_start_date,INTERVAL 8 HOUR))) as 'date2' IF(b1.fd_3b779ba2168eea = 1,
DATE_ADD(a.fd_start_date,INTERVAL 3 HOUR),
IF(b1.fd_3b779ba2168eea = 4,
DATE_ADD(a.fd_start_date,INTERVAL 5 HOUR),
IF(b1.fd_3b779ba2168eea = 7,
DATE_ADD(a.fd_start_date,INTERVAL 8 HOUR),
DATE_ADD(a.fd_start_date,INTERVAL 2 MONTH)))) as 'date2'
FROM FROM
lbpm_workitem a lbpm_workitem a
LEFT JOIN lbpm_node e ON e.fd_id = a.fd_node_id LEFT JOIN lbpm_node e ON e.fd_id = a.fd_node_id
...@@ -127,7 +133,7 @@ ...@@ -127,7 +133,7 @@
e.fd_fact_node_id = 'N5' e.fd_fact_node_id = 'N5'
AND b1.fd_id IS NOT NULL AND b1.fd_id IS NOT NULL
) x ) x
where x.date1 > date2 GROUP BY x.ORDER_NO where x.date1 >= date2 GROUP BY x.ORDER_NO
</select> </select>
<select id="getMsgByTaskOne" resultMap="msgInfoMap"> <select id="getMsgByTaskOne" resultMap="msgInfoMap">
......
# 忽略匹配下列规则的Git 提交 V2.1.0
### gradle ###
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.settings/
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
*.lock
rebel.xml
### NetBeans ###
nbproject/private/
build/
nbbuild/
nbdist/
.nb-gradle/
### maven ###
target/
*.war
*.ear
*.zip
*.tar
*.tar.gz
### logs ####
/logs/
*.log
### temp ignore ###
*.cache
*.diff
*.patch
*.tmp
*.java~
*.properties~
*.xml~
### system ignore ###
.DS_Store
Thumbs.db
Servers
.metadata
upload
gen_code
### node ###
node_modules
<?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>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yifu-permission</artifactId>
<description>EKP-权限服务</description>
<packaging>pom</packaging>
<!--项目子模块-->
<modules>
<module>yifu-permission-api</module>
<module>yifu-permission-biz</module>
</modules>
</project>
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu</artifactId>
<version>1.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>yifu-permission-api</artifactId>
<packaging>jar</packaging>
<description>EKP 权限配置</description>
<dependencies>
<!-- core 工具类 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<!--swagger 注解-->
<!--<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>-->
<!--feign 注解依赖-->
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<optional>true</optional>
</dependency>-->
<!--mybatis 依赖-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
</project>
package com.yifu.cloud.plus.v1.yifu.permission.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_menu")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-菜单表")
public class SysMenu extends BaseEntity {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "ID")
private String id;
/**
* 菜单名称
*/
@Schema(description = "菜单名称")
private String menuName;
/**
* 上级菜单名称
*/
@Schema(description = "上级菜单名称")
private String menuNameParent;
/**
* 上级菜单id
*/
@Schema(description = "上级菜单id")
private String menuParentId;
/**
* 表单ID
*/
@Schema(description = "表单ID")
private String modelId;
/**
* 视图ID
*/
@Schema(description = "视图ID")
private String viewId;
/**
* 权限维度
*/
@Schema(description = "权限维度")
private String permissionType;
/**
* 授权状态(0启用、1禁用)
*/
@Schema(description = "授权状态(0启用、1禁用)")
private String permissionStatus;
/**
* 删除状态(0是、1否)
*/
@Schema(description = "删除状态(0是、1否)")
private String deleteStatus;
/**
* 收入权限id
*/
@Schema(description = "收入权限id")
private String incomeId;
/**
* 客户权限id
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属
*/
@Schema(description = "客户权限id")
private String customerId;
/**
* 合同权限id
*/
@Schema(description = "合同权限id")
private String contractId;
/**
* 商机权限id
*/
@Schema(description = "商机权限id")
private String bussinessId;
/**
* 报价单权限id
*/
@Schema(description = "报价单权限id")
private String quotationId;
/**
* 项目权限id
*/
@Schema(description = "项目权限id")
private String domainId;
/**
* BU归属权限id
*/
@Schema(description = "BU归属权限id")
private String buId;
/**
* 条线类型权限id
*/
@Schema(description = "条线类型权限id")
private String lineId;
/**
* 部门权限id
*/
@Schema(description = "部门权限id")
private String deptId;
/**
* 权限idList
*/
@Schema(description = "权限idList")
@TableField(exist = false)
private List<String> columnIdList;
/**
* 是否开关(0开、1关)
*/
@Schema(description = "是否开关(0开、1关)")
private String isOpen;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_role_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-角色表")
public class SysRoleInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 角色名称
*/
@ExcelAttribute(name = "角色名称", isNotEmpty = true, errorInfo = "角色名称不能为空", maxLength = 20)
@NotBlank(message = "角色名称不能为空")
@Length(max = 20, message = "角色名称不能超过20个字符")
@ExcelProperty("角色名称")
@Schema(description = "角色名称")
private String roleName;
/**
* 角色描述
*/
@ExcelAttribute(name = "角色描述", maxLength = 200)
@Length(max = 200, message = "角色描述不能超过200个字符")
@ExcelProperty("角色描述")
@Schema(description = "角色描述")
private String remark;
/**
* 状态:0:正常;1:冻结/停用
*/
@ExcelAttribute(name = "状态:0:正常;1:冻结/停用", isNotEmpty = true, errorInfo = "状态:0:正常;1:冻结/停用不能为空")
@NotBlank(message = "状态:0:正常;1:冻结/停用不能为空")
@ExcelProperty("状态:0:正常;1:冻结/停用")
@Schema(description = "状态:0:正常;1:冻结/停用")
private Integer status;
/**
* 删除状态图:0:正常;1:删除
*/
@ExcelAttribute(name = "删除状态图:0:正常;1:删除", isNotEmpty = true, errorInfo = "删除状态图:0:正常;1:删除不能为空")
@NotBlank(message = "删除状态图:0:正常;1:删除不能为空")
@ExcelProperty("删除状态图:0:正常;1:删除")
@Schema(description = "删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
*/
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空", maxLength = 50)
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能超过50个字符")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
private String dataAuth;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_role_menu_res")
@Schema(description = "新权限-角色-菜单-关联表")
public class SysRoleMenuRes {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 角色ID
*/
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID不能为空", maxLength = 36)
@NotBlank(message = "角色ID不能为空")
@Length(max = 36, message = "角色ID不能超过36个字符")
@ExcelProperty("角色ID")
@Schema(description = "角色ID")
private String roleId;
/**
* 菜单ID
*/
@ExcelAttribute(name = "菜单ID", isNotEmpty = true, errorInfo = "菜单ID不能为空", maxLength = 36)
@NotBlank(message = "菜单ID不能为空")
@Length(max = 36, message = "菜单ID不能超过36个字符")
@ExcelProperty("菜单ID")
@Schema(description = "菜单ID")
private String menuId;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_user_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-账号管理表")
public class SysUserInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* ele表-员工姓名
*/
@ExcelAttribute(name = "ele表-员工姓名", maxLength = 200)
@Length(max = 200, message = "ele表-员工姓名不能超过200个字符")
@ExcelProperty("ele表-员工姓名")
@Schema(description = "ele表-员工姓名")
private String fdName;
/**
* per表-登录账号
*/
@ExcelAttribute(name = "per表-登录账号", maxLength = 200)
@Length(max = 200, message = "per表-登录账号不能超过200个字符")
@ExcelProperty("per表-登录账号")
@Schema(description = "per表-登录账号")
private String fdLoginName;
/**
* ele表-所在部门
*/
@ExcelAttribute(name = "ele表-所在部门", maxLength = 450)
@Length(max = 450, message = "ele表-所在部门不能超过450个字符")
@ExcelProperty("ele表-所在部门")
@Schema(description = "ele表-所在部门")
private String fdLdapDn;
/**
* 所在部门
*/
@ExcelAttribute(name = "所在部门", maxLength = 100)
@Length(max = 100, message = "所在部门不能超过100个字符")
@ExcelProperty("所在部门")
@Schema(description = "所在部门")
private String fdDeptName;
/**
* per表-手机号
*/
@ExcelAttribute(name = "per表-手机号", maxLength = 150)
@Length(max = 150, message = "per表-手机号不能超过150个字符")
@ExcelProperty("per表-手机号")
@Schema(description = "per表-手机号")
private String fdMobileNo;
/**
* per表-邮箱
*/
@ExcelAttribute(name = "per表-邮箱", maxLength = 200)
@Length(max = 200, message = "per表-邮箱不能超过200个字符")
@ExcelProperty("per表-邮箱")
@Schema(description = "per表-邮箱")
private String fdEmail;
/**
* 状态:0正常;1冻结
*/
@ExcelAttribute(name = "状态:0正常;1冻结", isNotEmpty = true, errorInfo = "状态:0正常;1冻结不能为空")
@NotBlank(message = "状态:0正常;1冻结不能为空")
@ExcelProperty("状态:0正常;1冻结")
@Schema(description = "状态:0正常;1冻结")
private Integer status;
/**
* 角色名称合集
*/
@TableField(exist = false)
private String roleNames;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_user_permission")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-用户权限表")
public class SysUserPermission extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private String id;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 登录账号
*/
@Schema(description = "登录账号")
private String empLoginName;
/**
* 用户id
*/
@Schema(description = "用户id")
private String userId;
/**
* 所在部门
*/
@Schema(description = "所在部门")
private String empDept;
/**
* 权限类型 客户、商机、报价单、
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属
*/
@Schema(description = "权限类型")
private String permissionType;
/**
* 名称
*/
@Schema(description = "名称")
private String name;
/**
* 编码
*/
@Schema(description = "编码")
private String code;
/**
* 是否包含(0 是 1否)
*/
@Schema(description = "是否包含(0 是 1否)")
private String isContains;
/**
* 授权状态(0启用、1禁用)
*/
@Schema(description = "授权状态(0启用、1禁用)")
private String permissionStatus;
/**
* 删除状态(0是、1否)
*/
@Schema(description = "删除状态(0是、1否)")
private String deleteFlag;
/**
* 部门id
*/
@Schema(description = "部门id")
private String domainId;
/**
* 0:从EKP同步的;1:MVP新增的。
*/
@Schema(description = "来源")
private String sourceType;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_user_role_res")
@Schema(description = "新权限-账号-角色关联表")
public class SysUserRoleRes {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 账号ID
*/
@ExcelAttribute(name = "账号ID", isNotEmpty = true, errorInfo = "账号ID不能为空", maxLength = 36)
@NotBlank(message = "账号ID不能为空")
@Length(max = 36, message = "账号ID不能超过36个字符")
@ExcelProperty("账号ID")
@Schema(description = "账号ID")
private String userId;
/**
* 角色ID
*/
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID不能为空", maxLength = 36)
@NotBlank(message = "角色ID不能为空")
@Length(max = 36, message = "角色ID不能超过36个字符")
@ExcelProperty("角色ID")
@Schema(description = "角色ID")
private String roleId;
@TableField(exist = false)
private String roleName;
@TableField(exist = false)
private String userName;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author hgw
* @Date 2023-9-21 17:03:57
* @Description
* @Version 1.0
*/
@Data
public class IdTypeEkpVo implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private String fdId;
/**
* 类型
*/
@Schema(description = "类型")
private String type;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 新权限-字段vo
*
* @author huyc
* @date 2023-09-04 14:49:40
*/
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Data
public class SysDictVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String id;
/**
* 编码
*/
@Schema(description = "编码")
private String name;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public class SysMenuSearchVo extends SysMenu {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public class SysMenuVo extends RowIndex implements Serializable {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "ID 不能为空")
@Length(max = 36, message = "ID 不能超过36 个字符")
@ExcelAttribute(name = "ID", isNotEmpty = true, errorInfo = "ID 不能为空", maxLength = 36)
@Schema(description = "ID")
@ExcelProperty("ID")
private String id;
/**
* 菜单名称
*/
@Length(max = 20, message = "菜单名称 不能超过20 个字符")
@ExcelAttribute(name = "菜单名称", maxLength = 20)
@Schema(description = "菜单名称")
@ExcelProperty("菜单名称")
private String menuName;
/**
* 上级菜单名称
*/
@Length(max = 20, message = "上级菜单名称 不能超过20 个字符")
@ExcelAttribute(name = "上级菜单名称", maxLength = 20)
@Schema(description = "上级菜单名称")
@ExcelProperty("上级菜单名称")
private String menuNameParent;
/**
* 上级菜单id
*/
@Length(max = 36, message = "上级菜单id 不能超过36 个字符")
@ExcelAttribute(name = "上级菜单id", maxLength = 36)
@Schema(description = "上级菜单id")
@ExcelProperty("上级菜单id")
private String menuParentId;
/**
* 表单ID
*/
@Length(max = 36, message = "表单ID 不能超过36 个字符")
@ExcelAttribute(name = "表单ID", maxLength = 36)
@Schema(description = "表单ID")
@ExcelProperty("表单ID")
private String modelId;
/**
* 视图ID
*/
@Length(max = 36, message = "视图ID 不能超过36 个字符")
@ExcelAttribute(name = "视图ID", maxLength = 36)
@Schema(description = "视图ID")
@ExcelProperty("视图ID")
private String viewId;
/**
* 授权状态(0启用、1禁用)
*/
@Length(max = 1, message = "授权状态(0启用、1禁用) 不能超过1 个字符")
@ExcelAttribute(name = "授权状态(0启用、1禁用)", maxLength = 1)
@Schema(description = "授权状态(0启用、1禁用)")
@ExcelProperty("授权状态(0启用、1禁用)")
private String permissionStatus;
/**
* 删除状态(0是、1否)
*/
@Length(max = 1, message = "删除状态(0是、1否) 不能超过1 个字符")
@ExcelAttribute(name = "删除状态(0是、1否)", maxLength = 1)
@Schema(description = "删除状态(0是、1否)")
@ExcelProperty("删除状态(0是、1否)")
private String deleteStatus;
/**
* 收入权限id
*/
@Length(max = 20, message = "收入权限id 不能超过20 个字符")
@ExcelAttribute(name = "收入权限id", maxLength = 20)
@Schema(description = "收入权限id")
@ExcelProperty("收入权限id")
private String incomeId;
/**
* 客户权限id
*/
@Length(max = 20, message = "客户权限id 不能超过20 个字符")
@ExcelAttribute(name = "客户权限id", maxLength = 20)
@Schema(description = "客户权限id")
@ExcelProperty("客户权限id")
private String customerId;
/**
* 合同权限id
*/
@Length(max = 20, message = "合同权限id 不能超过20 个字符")
@ExcelAttribute(name = "合同权限id", maxLength = 20)
@Schema(description = "合同权限id")
@ExcelProperty("合同权限id")
private String contractId;
/**
* 商机权限id
*/
@Length(max = 20, message = "商机权限id 不能超过20 个字符")
@ExcelAttribute(name = "商机权限id", maxLength = 20)
@Schema(description = "商机权限id")
@ExcelProperty("商机权限id")
private String bussinessId;
/**
* 报价单权限id
*/
@Length(max = 20, message = "报价单权限id 不能超过20 个字符")
@ExcelAttribute(name = "报价单权限id", maxLength = 20)
@Schema(description = "报价单权限id")
@ExcelProperty("报价单权限id")
private String quotationId;
/**
* 项目权限id
*/
@Length(max = 20, message = "项目权限id 不能超过20 个字符")
@ExcelAttribute(name = "项目权限id", maxLength = 20)
@Schema(description = "项目权限id")
@ExcelProperty("项目权限id")
private String domainId;
/**
* BU归属权限id
*/
@Length(max = 20, message = "BU归属权限id 不能超过20 个字符")
@ExcelAttribute(name = "BU归属权限id", maxLength = 20)
@Schema(description = "BU归属权限id")
@ExcelProperty("BU归属权限id")
private String buId;
/**
* 条线类型权限id
*/
@Length(max = 20, message = "条线类型权限id 不能超过20 个字符")
@ExcelAttribute(name = "条线类型权限id", maxLength = 20)
@Schema(description = "条线类型权限id")
@ExcelProperty("条线类型权限id")
private String lineId;
/**
* 部门权限id
*/
@Length(max = 20, message = "部门权限id 不能超过20 个字符")
@ExcelAttribute(name = "部门权限id", maxLength = 20)
@Schema(description = "部门权限id")
@ExcelProperty("部门权限id")
private String deptId;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.lang.tree.Tree;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 角色新增vo
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleInfoSaveVo implements Serializable {
private SysRoleInfo role;
private List<SysRoleMenuRes> resList;
private List<Tree<String>> tree;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleInfoSearchVo extends SysRoleInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间起")
private LocalDateTime createTimeStart;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间止")
private LocalDateTime createTimeEnd;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 角色名称
*/
@NotBlank(message = "角色名称 不能为空")
@Length(max = 20, message = "角色名称 不能超过20 个字符")
@ExcelAttribute(name = "角色名称", isNotEmpty = true, errorInfo = "角色名称 不能为空", maxLength = 20)
@Schema(description = "角色名称")
@ExcelProperty("角色名称")
private String roleName;
/**
* 角色描述
*/
@Length(max = 200, message = "角色描述 不能超过200 个字符")
@ExcelAttribute(name = "角色描述", maxLength = 200)
@Schema(description = "角色描述")
@ExcelProperty("角色描述")
private String remark;
/**
* 状态:0:正常;1:冻结/停用
*/
@NotBlank(message = "状态:0:正常;1:冻结/停用 不能为空")
@ExcelAttribute(name = "状态:0:正常;1:冻结/停用", isNotEmpty = true, errorInfo = "状态:0:正常;1:冻结/停用 不能为空")
@Schema(description = "状态:0:正常;1:冻结/停用")
@ExcelProperty("状态:0:正常;1:冻结/停用")
private Integer status;
/**
* 删除状态图:0:正常;1:删除
*/
@NotBlank(message = "删除状态图:0:正常;1:删除 不能为空")
@ExcelAttribute(name = "删除状态图:0:正常;1:删除", isNotEmpty = true, errorInfo = "删除状态图:0:正常;1:删除 不能为空")
@Schema(description = "删除状态图:0:正常;1:删除")
@ExcelProperty("删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
*/
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能超过50 个字符")
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空", maxLength = 50)
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
private String dataAuth;
/**
* 创建人id
*/
@Length(max = 36, message = "创建人id 不能超过36 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 36)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 200, message = "创建人姓名 不能超过200 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 200)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Length(max = 200, message = "更新人id 不能超过200 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 200)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleMenuResSearchVo extends SysRoleMenuRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleMenuResVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 角色ID
*/
@NotBlank(message = "角色ID 不能为空")
@Length(max = 36, message = "角色ID 不能超过36 个字符")
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID 不能为空", maxLength = 36)
@Schema(description = "角色ID")
@ExcelProperty("角色ID")
private String roleId;
/**
* 菜单ID
*/
@NotBlank(message = "菜单ID 不能为空")
@Length(max = 36, message = "菜单ID 不能超过36 个字符")
@ExcelAttribute(name = "菜单ID", isNotEmpty = true, errorInfo = "菜单ID 不能为空", maxLength = 36)
@Schema(description = "菜单ID")
@ExcelProperty("菜单ID")
private String menuId;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 新权限-账号管理表
*
* @author huyc
* @date 2023-09-04 14:49:40
*/
@Data
public class SysUserDeptVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String name;
/**
* 编码
*/
@Schema(description = "编码")
private String code;
/**
* 类型
*/
@Schema(description = "类型")
private String type;
/**
* 登录名
*/
@Schema(description = "登录名")
private String loginName;
/**
* 部门id
*/
@Schema(description = "部门id")
private String domainId;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 账号新增vo
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserInfoSaveVo implements Serializable {
private SysUserInfo user;
private List<SysUserRoleRes> resList;
private String dataAuth;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserInfoSearchVo extends SysUserInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* ele表-员工姓名
*/
@Length(max = 200, message = "ele表-员工姓名 不能超过200 个字符")
@ExcelAttribute(name = "ele表-员工姓名", maxLength = 200)
@Schema(description = "ele表-员工姓名")
@ExcelProperty("ele表-员工姓名")
private String fdName;
/**
* per表-登录账号
*/
@Length(max = 200, message = "per表-登录账号 不能超过200 个字符")
@ExcelAttribute(name = "per表-登录账号", maxLength = 200)
@Schema(description = "per表-登录账号")
@ExcelProperty("per表-登录账号")
private String fdLoginName;
/**
* ele表-所在部门
*/
@Length(max = 450, message = "ele表-所在部门 不能超过450 个字符")
@ExcelAttribute(name = "ele表-所在部门", maxLength = 450)
@Schema(description = "ele表-所在部门")
@ExcelProperty("ele表-所在部门")
private String fdLdapDn;
/**
* 所在部门
*/
@Length(max = 100, message = "所在部门 不能超过100 个字符")
@ExcelAttribute(name = "所在部门", maxLength = 100)
@Schema(description = "所在部门")
@ExcelProperty("所在部门")
private String fdDeptName;
/**
* per表-手机号
*/
@Length(max = 150, message = "per表-手机号 不能超过150 个字符")
@ExcelAttribute(name = "per表-手机号", maxLength = 150)
@Schema(description = "per表-手机号")
@ExcelProperty("per表-手机号")
private String fdMobileNo;
/**
* per表-邮箱
*/
@Length(max = 200, message = "per表-邮箱 不能超过200 个字符")
@ExcelAttribute(name = "per表-邮箱", maxLength = 200)
@Schema(description = "per表-邮箱")
@ExcelProperty("per表-邮箱")
private String fdEmail;
/**
* 状态:0正常;1冻结
*/
@NotBlank(message = "状态:0正常;1冻结 不能为空")
@ExcelAttribute(name = "状态:0正常;1冻结", isNotEmpty = true, errorInfo = "状态:0正常;1冻结 不能为空")
@Schema(description = "状态:0正常;1冻结")
@ExcelProperty("状态:0正常;1冻结")
private Integer status;
/**
* 角色名称合集
*/
@Length(max = 200, message = "角色名称合集 不能超过200 个字符")
@ExcelAttribute(name = "角色名称合集", maxLength = 200)
@Schema(description = "角色名称合集")
@ExcelProperty("角色名称合集")
private String roleNames;
/**
* 创建人id
*/
@Length(max = 36, message = "创建人id 不能超过36 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 36)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 200, message = "创建人姓名 不能超过200 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 200)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Length(max = 200, message = "更新人id 不能超过200 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 200)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserPermissionExportVo implements Serializable {
/**
* 员工姓名
*/
@Length(max = 20, message = "员工姓名 不能超过20 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 登录账号
*/
@NotBlank(message = "登录账号 不能为空")
@Length(max = 10, message = "登录账号 不能超过10 个字符")
@ExcelAttribute(name = "登录账号", isNotEmpty = true, errorInfo = "登录账号 不能为空", maxLength = 10)
@Schema(description = "登录账号")
@ExcelProperty("登录账号")
private String empLoginName;
/**
* 所属部门
*/
@Length(max = 20, message = "所属部门 不能超过20 个字符")
@ExcelAttribute(name = "所属部门", maxLength = 20)
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String empDept;
/**
* 权限类型
*/
@Length(max = 8, message = "权限类型 不能超过8 个字符")
@ExcelAttribute(name = "权限类型", maxLength = 8)
@Schema(description = "权限类型")
@ExcelProperty("权限类型")
private String permissionType;
/**
* 名称
*/
@Length(max = 20, message = "名称 不能超过20 个字符")
@ExcelAttribute(name = "名称", maxLength = 20)
@Schema(description = "名称")
@ExcelProperty("名称")
private String name;
/**
* 编码
*/
@Length(max = 30, message = "编码 不能超过30 个字符")
@ExcelAttribute(name = "编码", maxLength = 30)
@Schema(description = "编码")
@ExcelProperty("编码")
private String code;
/**
* 是否包含(0 是 1否)
*/
@Length(max = 1, message = "是否含下级部门 不能超过1 个字符")
@ExcelAttribute(name = "是否含下级部门", maxLength = 1)
@Schema(description = "是否含下级部门")
@ExcelProperty("是否含下级部门")
private String isContains;
/**
* 授权状态(0启用、1禁用)
*/
@Length(max = 1, message = "授权状态 不能超过1 个字符")
@ExcelAttribute(name = "授权状态", maxLength = 1)
@Schema(description = "授权状态")
@ExcelProperty("授权状态")
private String permissionStatus;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserPermissionSearchVo extends SysUserPermission {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,数组")
private List<String> idList;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@Length(max = 20, message = "员工姓名 不能超过20 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 登录账号
*/
@NotBlank(message = "登录账号 不能为空")
@Length(max = 20, message = "登录账号 不能超过20 个字符")
@ExcelAttribute(name = "登录账号", isNotEmpty = true, errorInfo = "登录账号 不能为空", maxLength = 20)
@Schema(description = "登录账号")
@ExcelProperty("登录账号")
private String empLoginName;
/**
* 用户id
*/
@Schema(description = "用户id")
@ExcelAttribute(name = "用户id")
private String userId;
/**
* 所属部门
*/
@Length(max = 20, message = "所属部门 不能超过20 个字符")
@ExcelAttribute(name = "所属部门", maxLength = 20)
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String empDept;
/**
* 权限类型
*/
@NotBlank(message = "权限类型 不能为空")
@Length(max = 8, message = "权限类型 不能超过8 个字符")
@ExcelAttribute(name = "权限类型", isNotEmpty = true, errorInfo = "权限类型 不能为空", maxLength = 8)
@Schema(description = "权限类型")
@ExcelProperty("权限类型")
private String permissionType;
/**
* 名称
*/
@Length(max = 200, message = "名称 不能超过200 个字符")
@ExcelAttribute(name = "名称", maxLength = 200)
@Schema(description = "名称")
@ExcelProperty("名称")
private String name;
/**
* 编码
*/
@Length(max = 30, message = "编码 不能超过30 个字符")
@ExcelAttribute(name = "编码", maxLength = 30)
@Schema(description = "编码")
@ExcelProperty("编码")
private String code;
/**
* 是否包含(0 是 1否)
*/
@Length(max = 1, message = "是否含下级部门 不能超过1 个字符")
@ExcelAttribute(name = "是否含下级部门", maxLength = 1)
@Schema(description = "是否含下级部门")
@ExcelProperty("是否含下级部门")
private String isContains;
/**
* 授权状态(0启用、1禁用)
*/
@Length(max = 1, message = "授权状态 不能超过1 个字符")
@ExcelAttribute(name = "授权状态", maxLength = 1)
@Schema(description = "授权状态")
@ExcelProperty("授权状态")
private String permissionStatus;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserRoleResSearchVo extends SysUserRoleRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserRoleResVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 账号ID
*/
@NotBlank(message = "账号ID 不能为空")
@Length(max = 36, message = "账号ID 不能超过36 个字符")
@ExcelAttribute(name = "账号ID", isNotEmpty = true, errorInfo = "账号ID 不能为空", maxLength = 36)
@Schema(description = "账号ID")
@ExcelProperty("账号ID")
private String userId;
/**
* 角色ID
*/
@NotBlank(message = "角色ID 不能为空")
@Length(max = 36, message = "角色ID 不能超过36 个字符")
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID 不能为空", maxLength = 36)
@Schema(description = "角色ID")
@ExcelProperty("角色ID")
private String roleId;
}
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.msg.utils.EkpMsgUtil
\ No newline at end of file
FROM moxm/java:1.8-full
RUN mkdir -p /yifu-permission-biz
WORKDIR yifu-permission-biz
ARG JAR_FILE=target/yifu-permission-biz.jar
COPY ${JAR_FILE} app.jar
EXPOSE 5026
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
CMD sleep 60; java -jar app.jar $JAVA_OPTS
#!/usr/bin/env bash
mvn clean package -Pprd -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Ptest -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-permission-biz</artifactId>
<packaging>jar</packaging>
<description>EKP-权限配置</description>
<dependencies>
<!--选配: 依赖seata模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-seata</artifactId>
</dependency>
<!--选配: orm 模块-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--必备:安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-security</artifactId>
</dependency>
<!--必备:日志处理-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<!--必备:undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-msg-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-permission-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<serverId>docker-hub</serverId>
<!--指定生成的镜像名-->
<imageName>${my.hub.host}/${map.group.name}/${project.artifactId}:${project.version}</imageName>
<dockerDirectory>${project.basedir}/</dockerDirectory>
<!--指定远程 docker api地址-->
<!--<dockerHost>http://172.16.66.232:2375</dockerHost>-->
<!-- 这里是复制 jar 包到 docker 容器指定目录配置-->
<resources>
<resource>
<targetPath>/</targetPath>
<!--jar 包所在的路径 此处配置的 即对应 target 目录-->
<directory>${project.build.directory}</directory>
<!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 -->
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<forceTags>true</forceTags>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.yifu.cloud.plus.v1.permission;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author pig archetype
* <p>
* 项目启动类
*/
@EnableYifuResourceServer
@SpringBootApplication
public class PermissionApplication {
public static void main(String[] args) {
SpringApplication.run(PermissionApplication.class, args);
}
}
package com.yifu.cloud.plus.v1.msg.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description:
* @return: 企业微信配置
**/
@Configuration
@Data
@Slf4j
public class WxConfig {
@Value("${wx.corpid}")
private String corpid;
@Value("${wx.corpsecret}")
private String corpsecret;
@Value("${wx.agentid}")
private String agentid;
@Value("${wx.authUrl}")
private String authUrl;
@Autowired
private RedisTemplate redisTemplate;
//未授权
private String accossTokenInvliad = "40014";
/**
* @param
* @Author: huyc
* @Date: 2023/7/28
* @Description: 获取微信accos_token
* @return: java.lang.String
**/
public String getAccessToken(RestTemplate restTemplate) {
if (Common.isNotNull(agentid)) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
public String getAccessToken(RestTemplate restTemplate,String corpsecret)throws AuthenticationServiceException {
if(Common.isEmpty(corpsecret)){
throw new AuthenticationServiceException("未找到对应的corpsecret请联系管理员配置");
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
/**
* @param restTemplate
* @param tokenKey
* @param corpsecretKey
* @Description: 获取token
* @Author: huyc
* @Date: 2023/7/28 14:46
* @return: java.lang.String
**/
public String getToken(RestTemplate restTemplate,String tokenKey, String corpsecretKey) {
Object wxToken = redisTemplate.opsForValue().get(tokenKey);
if (null != wxToken) {
return String.valueOf(wxToken);
}
String requestTokenUrl = String.format(SecurityConstants.WX_GET_ACCOSS_TOKEN, corpid, corpsecretKey);
String result = restTemplate.getForObject(requestTokenUrl, String.class);
if (Common.isEmpty(result)) {
throw new CheckedException("微信授权失败");
}
String token = JSON.parseObject(result).getString("access_token");
if (Common.isEmpty(token)) {
log.info(result);
throw new CheckedException("获取微信token失败");
}
redisTemplate.opsForValue().set(tokenKey, token);
redisTemplate.expire(tokenKey, 3600, TimeUnit.SECONDS);
return token;
}
/**
* @param
* @Author: huyc
* @Date: 2023/7/28 14:43
* @Description: 移除微信accossToken
* @return: java.lang.String
**/
public void removeAccessToken() {
redisTemplate.delete(CacheConstants.WX_ACCOSS_TOKEN);
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:48
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public boolean sendTextCard(RestTemplate restTemplate, Map<String, Object> requestMap) {
// 必须加上header说明
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.info(gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.info(JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
String errcode = jsonBody.getString("errcode");
if (accossTokenInvliad.equals(errcode)) {
//删除accossToken缓存
removeAccessToken();
return false;
}
if (!CommonConstants.ZERO_STRING.equals(errcode)) { //非正常,则打印错误日志
log.info(jsonObject.toJSONString());
}
} else {
log.info(jsonObject.toJSONString());
}
return true;
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:50
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public boolean sendAppTextCard(RestTemplate restTemplate, Map<String, Object> requestMap) {
// 必须加上header说明
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.info("发企业微信===请求:{}", gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAppAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.info("发企业微信===返回:{}",JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
String errcode = jsonBody.getString("errcode");
if (accossTokenInvliad.equals(errcode)) {
//删除accossToken缓存
removeAccessToken();
return false;
}
if (!CommonConstants.ZERO_STRING.equals(errcode)) { //非正常,则打印错误日志
log.info(jsonObject.toJSONString());
}
} else {
log.info(jsonObject.toJSONString());
}
return true;
}
/**
* 功能描述: 获取微信accos_token
* @Author: huyc
* @Date: 2023/7/28 14:50
* @return: java.lang.String
*/
public String getAppAccessToken(RestTemplate restTemplate) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysMenuService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysmenu")
@Tag(name = "新权限-菜单表管理")
public class SysMenuController {
private final SysMenuService sysMenuService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysMenu 新权限-菜单表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysMenu>> getSysMenuPage(Page<SysMenu> page, SysMenuSearchVo sysMenu) {
return new R<>(sysMenuService.getSysMenuPage(page, sysMenu));
}
/**
* 新增新权限-菜单表
*
* @param sysMenu 新权限-菜单表
* @return R
*/
@Operation(description = "新增新权限-菜单表:hasPermission('permission_sysmenu_add')")
@SysLog("新增新权限-菜单表")
@PostMapping("/addMenu")
@PreAuthorize("@pms.hasPermission('permission_sysmenu_add')")
public R<Boolean> save(@RequestBody SysMenu sysMenu) {
return sysMenuService.saveMenu(sysMenu);
}
/**
* 修改新权限-菜单表
*
* @param sysMenu 新权限-菜单表
* @return R
*/
@Operation(description = "修改新权限-菜单表:hasPermission('permission_sysmenu_edit')")
@SysLog("修改新权限-菜单表")
@PostMapping("/updateMenu")
@PreAuthorize("@pms.hasPermission('permission_sysmenu_edit')")
public R<Boolean> updateById(@RequestBody SysMenu sysMenu) {
return sysMenuService.updateMenu(sysMenu);
}
/**
* 修改新权限-菜单表
*
* @param sysMenu 新权限-菜单表
* @return R
*/
@Operation(description = "修改新权限-菜单表:hasPermission('permission_sysmenu_edit')")
@SysLog("修改新权限-菜单表")
@PostMapping("/updateMenuById")
@PreAuthorize("@pms.hasPermission('permission_sysmenu_edit')")
public R<Boolean> updateMenu(@RequestBody SysMenu sysMenu) {
return new R<>(sysMenuService.updateById(sysMenu));
}
/**
* 通过id查询新权限-菜单表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<SysMenu> getById(@PathVariable("id") String id) {
return R.ok(sysMenuService.getById(id));
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysRoleInfoService;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysroleinfo")
@Tag(name = "新权限-角色表管理")
public class SysRoleInfoController {
private final SysRoleInfoService sysRoleInfoService;
private final SysUserRoleResService sysUserRoleResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysRoleInfo 新权限-角色表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysRoleInfo>> getSysRoleInfoPage(Page<SysRoleInfo> page, SysRoleInfoSearchVo sysRoleInfo) {
return new R<>(sysRoleInfoService.getSysRoleInfoPage(page, sysRoleInfo));
}
/**
* 不分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_get')" )
public R<List<SysRoleInfo>> getSysRoleInfoNoPage(@RequestBody SysRoleInfoSearchVo sysRoleInfo) {
return R.ok(sysRoleInfoService.noPageDiy(sysRoleInfo));
}
/**
* 通过id查询新权限-角色表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{fdId}")
public R<SysRoleInfoSaveVo> getById(@PathVariable("fdId") String fdId) {
return sysRoleInfoService.getInfoById(fdId);
}
/**
* @param roleIdList 角色列表
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo>
**/
@Operation(summary = "给前端使用:根据角色id组合获取角色权限", description = "给前端使用:根据角色id组合获取角色权限")
@PostMapping("/getRoleDataAuthByRoleId")
public R<String> getRoleDataAuthByRoleId(@RequestBody List<String> roleIdList) {
return R.ok(sysRoleInfoService.getRoleDataAuthByRoleId(roleIdList));
}
/**
* 新增新权限-角色表
*
* @param vo 新权限-角色表
* @return R
*/
@Operation(summary = "新增或编辑新权限-角色表", description = "新增或保存新权限-角色表:hasPermission('ekp_sysroleinfo_add')")
@SysLog("新增或编辑新权限-角色表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_add')")
public R<String> saveOrUpdateRoleInfo(@RequestBody SysRoleInfoSaveVo vo) {
return sysRoleInfoService.saveOrUpdateRoleInfo(vo);
}
/**
* 修改新权限-角色表
*
* @param sysRoleInfo 新权限-角色表
* @return R
*/
@Operation(summary = "修改新权限-角色表(可以修改状态)", description = "修改新权限-角色表:hasPermission('ekp_sysroleinfo_edit')")
@SysLog("修改新权限-角色表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_edit')")
public R<Boolean> updateById(@RequestBody SysRoleInfo sysRoleInfo) {
return R.ok(sysRoleInfoService.updateById(sysRoleInfo));
}
/**
* 通过id删除新权限-角色表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-角色表-假删除", description = "通过id删除新权限-角色表:hasPermission('ekp_sysroleinfo_del')")
@SysLog("通过id删除新权限-角色表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
SysRoleInfo roleInfo = sysRoleInfoService.getById(fdId);
if (roleInfo == null || Common.isEmpty(roleInfo.getFdId()) || Common.isEmpty(roleInfo.getRoleName())) {
return R.failed("未找到角色");
}
// 删除关联表
sysUserRoleResService.deleteByRoleId(fdId);
// 假删除角色表
roleInfo.setDeleteFlag(CommonConstants.ONE_INT);
sysRoleInfoService.updateById(roleInfo);
return R.ok();
}
/**
* 通过id删除新权限-角色表
*
* @param fdId id
* @return R
*/
@Operation(summary = "冻结-角色表", description = "冻结-角色表:hasPermission('ekp_sysroleinfo_freeze')")
@SysLog("冻结-角色表")
@PostMapping("/freezeById")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_freeze')")
public R<Boolean> freezeById(@RequestParam String fdId) {
SysRoleInfo roleInfo = sysRoleInfoService.getById(fdId);
if (roleInfo == null || Common.isEmpty(roleInfo.getFdId()) || Common.isEmpty(roleInfo.getRoleName())) {
return R.failed("未找到角色");
}
// 删除关联表
sysUserRoleResService.deleteByRoleId(fdId);
// 冻结角色表
roleInfo.setStatus(CommonConstants.ONE_INT);
sysRoleInfoService.updateById(roleInfo);
return R.ok();
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysRoleMenuResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysrolemenures")
@Tag(name = "新权限-角色-菜单-关联表管理")
public class SysRoleMenuResController {
private final SysRoleMenuResService sysRoleMenuResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysRoleMenuRes>> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes) {
return new R<>(sysRoleMenuResService.getSysRoleMenuResPage(page, sysRoleMenuRes));
}
/**
* 不分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<SysRoleMenuRes>> getSysRoleMenuResNoPage(@RequestBody SysRoleMenuResSearchVo sysRoleMenuRes) {
return R.ok(sysRoleMenuResService.noPageDiy(sysRoleMenuRes));
}
/**
* 通过id查询新权限-角色-菜单-关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysrolemenures_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysrolemenures_get')")
public R<SysRoleMenuRes> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysRoleMenuResService.getById(fdId));
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserinfo")
@Tag(name = "新权限-账号管理表管理")
public class SysUserInfoController {
private final SysUserInfoService sysUserInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysUserInfo 新权限-账号管理表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysUserInfo>> getSysUserInfoPage(Page<SysUserInfo> page, SysUserInfoSearchVo sysUserInfo) {
return new R<>(sysUserInfoService.getSysUserInfoPage(page, sysUserInfo));
}
/**
* 不分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_get')" )
public R<List<SysUserInfo>> getSysUserInfoNoPage(@RequestBody SysUserInfoSearchVo sysUserInfo) {
return R.ok(sysUserInfoService.noPageDiy(sysUserInfo));
}
/**
* 通过id查询新权限-账号管理表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{fdId}")
public R<SysUserInfoSaveVo> getById(@PathVariable("fdId") String fdId) {
return sysUserInfoService.getInfoById(fdId);
}
/**
* 新增新权限-账号管理表
*
* @param vo 新权限-账号管理表
* @return R
*/
@Operation(summary = "新增或编辑新权限-账号管理表", description = "新增或编辑新权限-账号管理表:hasPermission('ekp_sysuserinfo_add')")
@SysLog("新增或编辑新权限-账号管理表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_add')")
public R<String> saveOrUpdateUserInfo(@RequestBody SysUserInfoSaveVo vo) {
return sysUserInfoService.saveOrUpdateUserInfo(vo);
}
/**
* 修改新权限-账号管理表
*
* @param sysUserInfo 新权限-账号管理表
* @return R
*/
@Operation(summary = "修改新权限-账号管理表", description = "修改新权限-账号管理表:hasPermission('ekp_sysuserinfo_edit')")
@SysLog("修改新权限-账号管理表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_edit')")
public R<Boolean> updateById(@RequestBody SysUserInfo sysUserInfo) {
return R.ok(sysUserInfoService.updateById(sysUserInfo));
}
/**
* 通过id删除新权限-账号管理表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-账号管理表", description = "通过id删除新权限-账号管理表:hasPermission('ekp_sysuserinfo_del')")
@SysLog("通过id删除新权限-账号管理表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
return R.ok(sysUserInfoService.removeById(fdId));
}
/**
* @Description: 手动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/5 16:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "手动同步并更新账号信息", description = "手动同步并更新账号信息")
@SysLog("手动同步并更新账号信息")
@PostMapping("/startRefreshEkpUser")
public R<String> startRefreshEkpUser() {
sysUserInfoService.doRefreshEkpUser();
return R.ok();
}
/**
* @param
* @Description: 定时任务-自动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 16:07
* @return: void
**/
@Inner
@Operation(description = "定时任务-自动同步并更新账号信息")
@PostMapping("/inner/doRefreshEkpUser")
public void doRefreshEkpUser() {
sysUserInfoService.doRefreshEkpUser();
}
/**
* @Description: 手动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/5 16:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "测试权限sql", description = "测试权限sql")
@SysLog("测试权限sql")
@PostMapping("/testPermission")
public R<String> testPermission(@RequestParam String modelId, @RequestParam(required = false) String userId) {
return R.ok(sysUserInfoService.testPermission(modelId, userId));
}
/**
* 简单分页查询
* hyc 2023-9-11 15:25:50
* @param page 分页对象
* @param name 新权限-账号管理表
* @return
*/
@Operation(description = "根据编码或者登录名简单分页查询")
@GetMapping("/getUserByCodeOrLoginName")
public R<IPage<SysUserInfo>> getUserByCodeOrLoginName(Page<SysUserInfo> page, String name) {
return new R<>(sysUserInfoService.getUserByCodeOrLoginName(page, name));
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserPermissionService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.IdTypeEkpVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserpermission")
@Tag(name = "用户权限表管理")
public class SysUserPermissionController {
private final SysUserPermissionService sysUserPermissionService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysUserPermission 新权限-用户权限表
* @return
*/
@Operation(summary = "简单分页查询",description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysUserPermission>> getSysUserPermissionPage(Page<SysUserPermission> page, SysUserPermissionSearchVo sysUserPermission) {
return new R<>(sysUserPermissionService.getSysUserPermissionPage(page, sysUserPermission));
}
/**
* 通过id查询新权限-用户权限表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<SysUserPermission> getById(@PathVariable("id") String id) {
return R.ok(sysUserPermissionService.getById(id));
}
/**
* 新增新权限-用户权限表
*
* @param sysUserPermission 新权限-用户权限表
* @return R
*/
@Operation(summary = "新增用户权限表",description = "新增用户权限表:hasPermission('permission_sysuserpermission_add')")
@SysLog("新增用户权限表")
@PostMapping("/savePermission")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_add')")
public R save(@RequestBody SysUserPermission sysUserPermission) {
return sysUserPermissionService.savePermission(sysUserPermission);
}
/**
* 修改新权限-用户权限表
*
* @param sysUserPermissionList 用户权限表list
* @return R
*/
@Operation(summary = "修改用户权限表",description = "修改用户权限表:hasPermission('permission_sysuserpermission_edit')")
@SysLog("修改用户权限表")
@PostMapping("/updatePermission")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_edit')")
public R<Boolean> updateById(@RequestBody List<SysUserPermission> sysUserPermissionList) {
for (SysUserPermission permission : sysUserPermissionList) {
sysUserPermissionService.updateById(permission);
}
return R.ok();
}
/**
* 通过id删除新权限-用户权限表
*
* @param idList
* @return R
*/
@Operation(summary = "通过id删除用户权限表",description = "通过id删除用户权限表:hasPermission('permission_sysuserpermission_del')")
@SysLog("通过id删除用户权限表")
@PostMapping("/deleteByIds")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_del')")
public R<Boolean> removeById(@RequestBody List<String> idList) {
return R.ok(sysUserPermissionService.removeBatchByIds(idList));
}
/**
* 新权限-用户权限表 批量导入
*
* @author hyc
* @date 2023-08-29 14:49:40
**/
@SneakyThrows
@Operation(summary = "批量新增用户权限表",description = "批量新增用户权限表 hasPermission('permission_sysuserpermission-batch-import')")
@SysLog("批量新增用户权限表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return sysUserPermissionService.importDiy(file.getInputStream());
}
/**
* 新权限-用户权限表 批量导出
*
* @author hyc
* @date 2023-08-29 14:49:40
**/
@Operation(summary = "导出用户权限表",description = "导出用户权限表")
@PostMapping("/export")
@SysLog("批量导出用户权限表")
public void export(HttpServletResponse response, @RequestBody SysUserPermissionSearchVo searchVo) {
sysUserPermissionService.listExport(response, searchVo);
}
/**
* 名称,编码模糊搜索
*
* @param page 分页对象
* @param searchVo 新权限-用户权限表
* @return
*/
@Operation(summary = "根据名称,编码模糊搜索",description = "根据名称,编码模糊搜索")
@GetMapping("/customerPage")
public R<IPage<SysUserDeptVo>> getNameCodePage(Page<SysUserDeptVo> page, SysUserDeptVo searchVo) {
return new R<>(sysUserPermissionService.getNameCodePage(page,searchVo));
}
/**
* 根据类型查询字典值
*
* @param type 字典类型
* @return
*/
@Operation(summary = "根据类型查询字典值",description = "根据类型查询字典值")
@PostMapping("/selectDictByType")
public R<List<SysDictVo>> selectDictByType(@RequestParam String type) {
return new R<>(sysUserPermissionService.selectDictByType(type));
}
/**
* 修改项目表--EKP调用接口
* @author hyc
* @param jsonStr 项目表
* @return R
*/
@Operation(summary = "自动同步权限--EKP调用接口", description = "自动同步权限--EKP调用接口")
@SysLog("自动同步权限--EKP调用接口")
@PostMapping("/autoCreateAuth")
public R<String> autoCreateAuth(@RequestBody String jsonStr) {
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<IdTypeEkpVo> list= JSONObject.parseArray(jsonStr, IdTypeEkpVo.class);
if (list != null && !list.isEmpty()) {
return sysUserPermissionService.autoCreateAuth(list.get(0));
}
return R.failed("自动同步权限错误-无参数");
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserroleres")
@Tag(name = "新权限-账号-角色关联表管理")
public class SysUserRoleResController {
private final SysUserRoleResService sysUserRoleResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysUserRoleRes>> getSysUserRoleResPage(Page<SysUserRoleRes> page, SysUserRoleResSearchVo sysUserRoleRes) {
return new R<>(sysUserRoleResService.getSysUserRoleResPage(page, sysUserRoleRes));
}
/**
* 不分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<SysUserRoleRes>> getSysUserRoleResNoPage(@RequestBody SysUserRoleResSearchVo sysUserRoleRes) {
return R.ok(sysUserRoleResService.noPageDiy(sysUserRoleRes));
}
/**
* 根据角色id获取被使用的账号名称
* @return
*/
@Operation(summary = "根据角色id获取被使用的账号名称", description = "根据角色id获取被使用的账号名称")
@GetMapping("/getSysUserByRoleId")
public R<List<String>> getSysUserByRoleId(@RequestParam String roleId) {
return R.ok(sysUserRoleResService.getSysUserByRoleId(roleId));
}
/**
* 通过id查询新权限-账号-角色关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysuserroleres_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_get')")
public R<SysUserRoleRes> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysUserRoleResService.getById(fdId));
}
/**
* 新增新权限-账号-角色关联表
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return R
*/
@Operation(summary = "新增新权限-账号-角色关联表", description = "新增新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_add')")
@SysLog("新增新权限-账号-角色关联表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_add')")
public R<Boolean> save(@RequestBody SysUserRoleRes sysUserRoleRes) {
return R.ok(sysUserRoleResService.save(sysUserRoleRes));
}
/**
* 修改新权限-账号-角色关联表
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return R
*/
@Operation(summary = "修改新权限-账号-角色关联表", description = "修改新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_edit')")
@SysLog("修改新权限-账号-角色关联表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_edit')")
public R<Boolean> updateById(@RequestBody SysUserRoleRes sysUserRoleRes) {
return R.ok(sysUserRoleResService.updateById(sysUserRoleRes));
}
/**
* 通过id删除新权限-账号-角色关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-账号-角色关联表", description = "通过id删除新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_del')")
@SysLog("通过id删除新权限-账号-角色关联表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
return R.ok(sysUserRoleResService.removeById(fdId));
}
}
package com.yifu.cloud.plus.v1.permission.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {
/**
* 新权限-菜单表简单分页查询
*
* @param sysMenu 新权限-菜单表
* @Author: huyc
* @Date: 2023/8/29 14:19
* @return
*/
IPage<SysMenu> getSysMenuPage(Page<SysMenu> page, @Param("sysMenu") SysMenuSearchVo sysMenu);
/**
* 判断是否存在此菜单
*
* @param modelId 表单id
* @Author: huyc
* @Date: 2023/8/30 14:20
* @return
*/
long selectMenuId(@Param("modelId") String modelId);
/**
* 判断是否存在此菜单视图
*
* @param modelId 表单id
* @Author: huyc
* @Date: 2023/8/30 14:20
* @return
*/
long selectViewId(@Param("viewId") String viewId,@Param("modelId") String modelId);
/**
* 判断是否存在此字段
*
* @param modelId 表单id
* @Author: huyc
* @Date: 2023/8/30 14:41
* @return
*/
List<String> selectColumnList(@Param("modelId") String modelId);
/**
* @param modelId
* @Description: 根据modelId获取菜单
* @Author: hgw
* @Date: 2023/9/11 11:48
* @return: com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu
**/
SysMenu getSysMenuByModelId(@Param("modelId") String modelId);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> {
/**
* 新权限-角色表简单分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
IPage<SysRoleInfo> getSysRoleInfoPage(Page<SysRoleInfo> page, @Param("sysRoleInfo") SysRoleInfoSearchVo sysRoleInfo);
/**
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:21
* @return: java.util.List<java.lang.String>
**/
List<String> getRoleDataAuthByRoleId(@Param("roleIdList") List<String> roleIdList);
/**
* @param userId
* @Description: 获取账号的所有权限
* @Author: hgw
* @Date: 2023/9/8 9:22
* @return: java.util.List<java.lang.String>
**/
List<String> getAllRoleDataAuthByUserId(@Param("userId") String userId);
/**
* @param roleName
* @param roleId
* @Description: 查找名称是否存在
* @Author: hgw
* @Date: 2023/9/8 9:22
* @return: int
**/
int checkExistenceRole(@Param("roleName") String roleName, @Param("roleId") String roleId);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysRoleMenuResMapper extends BaseMapper<SysRoleMenuRes> {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, @Param("sysRoleMenuRes") SysRoleMenuRes sysRoleMenuRes);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
boolean deleteByRoleId(@Param("roleId") String roleId);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
/**
* 新权限-账号管理表简单分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, @Param("sysUserInfo") SysUserInfo sysUserInfo);
/**
* @param
* @Description: 获取EKP全部账号
* @Author: hgw
* @Date: 2023/9/4 11:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo>
**/
List<SysUserInfo> getEkpUser();
List<SysUserRoleRes> getResAndRoleNameUserId(@Param("userId") String userId);
/**
* @Description: 获取列表是否全量的权限
* @Author: hgw
* @Date: 2023/9/8 17:00
* @return: java.lang.int
**/
int getAuthByUserIdAndModelId(@Param("modelId") String modelId, @Param("userId") String userId);
/**
* @Description: 根据编码或者登录名简单分页查询
* @Author: huyc
* @Date: 2023/9/11 10:00
* @return:
**/
IPage<SysUserInfo> getUserByCodeOrLoginName(Page<SysUserInfo> page, @Param("code") String code);
}
package com.yifu.cloud.plus.v1.permission.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionExportVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
/**
* 新权限-用户权限表简单分页查询
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
IPage<SysUserPermission> getSysUserPermissionPage(Page<SysUserPermission> page, @Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 导出查询数量
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
long userSelectCount(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 查询导出数据
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
List<SysUserPermissionExportVo> userSelectList(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 根据名称或者编码查询数据
* 单位权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectUnitVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectContractVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectContractSimpleVO(Page<SysUserDeptVo> page, @Param("loginName") String loginName, @Param("name") String name, @Param("type") String type);
/**
* 根据名称或者编码查询数据
* 项目权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectSettleVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名部门编码查询id
* 部门权限
* @param code 编码
* @return
*/
String selectSettleByCode(@Param("code") String code);
/**
* 根据名称或者编码查询数据
* 商机权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectBusinessVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 报价单权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectQuotationVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 部门&&收入归属权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectDeptVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据类型查询字典值
*
* @param type 类型
* @return
*/
List<SysDictVo> selectDictByType(@Param("type") String type);
/**
* 根据类型查询字典值
*
* @param type 类型
* @return
*/
List<SysDictVo> selectDictByTypeOne(@Param("type") String type,@Param("userId") String userId);
/**
* 根据类型和名称判断字典值是否存在
*
* @param type 类型
* @return
*/
Integer selectDictByName(@Param("name") String name,@Param("type") String type);
/**
* 根据名称或者编码查询数据
* 单位权限
* @param name 名称
* @return
*/
Integer selectUnitCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
Integer selectContractCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 项目权限
* @param name 名称
* @return
*/
Integer selectSettleCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 商机权限
* @param name 名称
* @return
*/
Integer selectBusinessCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 报价单权限
* @param name 名称
* @return
*/
Integer selectQuotationCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 部门&&收入归属权限
* @param name 名称
* @return
*/
Integer selectDeptCount(@Param("name") String name);
/**
* @param userId
* @Description: 查找当前用户的所有权限
* @Author: hgw
* @Date: 2023/9/11 11:44
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission>
**/
List<SysUserPermission> getUserPermissionByUserId(@Param("userId") String userId);
List<SysUserPermission> getUserPermissionByAutoCreateKH(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateSJ(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateBJD(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateHT(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateXM(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateHTBG(@Param("fdId") String fdId);
List<SysUserPermission> getUserPermissionByAutoCreateXMBG(@Param("fdId") String fdId);
String selectCodeByFdId(@Param("fdId") String fdId);
void deleteUserPermissionByIdAndType(@Param("code") String code, @Param("permissionType") String permissionType);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysUserRoleResMapper extends BaseMapper<SysUserRoleRes> {
/**
* 新权限-账号-角色关联表简单分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
IPage<SysUserRoleRes> getSysUserRoleResPage(Page<SysUserRoleRes> page, @Param("sysUserRoleRes") SysUserRoleRes sysUserRoleRes);
/**
* @param roleId
* @Description: 根据角色id获取被使用的账号名称
* @Author: hgw
* @Date: 2023/9/8 17:38
* @return: java.util.List<java.lang.String>
**/
List<String> getSysUserByRoleId(@Param("roleId") String roleId);
boolean deleteByUserId(@Param("userId") String userId);
boolean deleteByRoleId(@Param("roleId") String roleId);
}
package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
public interface SysMenuService extends IService<SysMenu> {
/**
* 新权限-菜单表简单分页查询
* @param sysMenu 新权限-菜单表
* @return
*/
IPage<SysMenu> getSysMenuPage(Page<SysMenu> page, SysMenuSearchVo sysMenu);
/**
* 新增菜单表
* @param menu 新权限-菜单表
* @return
*/
R<Boolean> saveMenu(SysMenu menu);
/**
* 更新菜单表
* @param menu 新权限-菜单表
* @return
*/
R<Boolean> updateMenu(SysMenu menu);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysRoleInfoService extends IService<SysRoleInfo> {
/**
* 新权限-角色表简单分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
IPage<SysRoleInfo> getSysRoleInfoPage(Page<SysRoleInfo> page, SysRoleInfoSearchVo sysRoleInfo);
/**
* @param fdId
* @Description: 查看
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSaveVo>
**/
R<SysRoleInfoSaveVo> getInfoById(String fdId);
/**
* @param vo
* @Description: 新增或编辑新权限-角色表
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R<String> saveOrUpdateRoleInfo(SysRoleInfoSaveVo vo);
List<SysRoleInfo> noPageDiy(SysRoleInfoSearchVo searchVo);
/**
* @param userId
* @Description: 各种角色的权限融合
* @Author: hgw
* @Date: 2023/8/30 18:06
* @return: java.lang.String
**/
String getAllRoleDataAuthByUserId(String userId);
/**
* @param roleIdList
* @Description: 给前端使用:根据角色id组合获取角色权限
* @Author: hgw
* @Date: 2023/9/8 9:25
* @return: java.lang.String
**/
String getRoleDataAuthByRoleId(List<String> roleIdList);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysRoleMenuResService extends IService<SysRoleMenuRes> {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes);
List<SysRoleMenuRes> noPageDiy(SysRoleMenuResSearchVo searchVo);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
boolean deleteByRoleId(String roleId);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysUserInfoService extends IService<SysUserInfo> {
/**
* 新权限-账号管理表简单分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, SysUserInfoSearchVo sysUserInfo);
List<SysUserInfo> noPageDiy(SysUserInfoSearchVo searchVo);
/**
* @param fdId
* @Description: 查看
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo>
**/
R<SysUserInfoSaveVo> getInfoById(String fdId);
/**
* @param vo
* @Description: 新增或编辑新权限-账号表
* @Author: hgw
* @Date: 2023/8/30 15:10
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R<String> saveOrUpdateUserInfo(SysUserInfoSaveVo vo);
/**
* @param
* @Description: 同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 11:30
* @return: void
**/
void doRefreshEkpUser();
/**
* @Description: 给EKP用的,获取权限
* @Author: hgw
* @Date: 2023/9/8 16:35
* @return: java.lang.String
**/
String testPermission(String modelId, String userId);
IPage<SysUserInfo> getUserByCodeOrLoginName(Page<SysUserInfo> page, String code);
}
package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.IdTypeEkpVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 新权限-用户权限表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
public interface SysUserPermissionService extends IService<SysUserPermission> {
/**
* 新权限-用户权限表简单分页查询
* @param sysUserPermission 新权限-用户权限表
* @return
*/
IPage<SysUserPermission> getSysUserPermissionPage(Page<SysUserPermission> page, SysUserPermissionSearchVo sysUserPermission);
/**
* 新增权限
* @param sysUserPermission 新权限-用户权限表
*/
R savePermission(SysUserPermission sysUserPermission);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, SysUserPermissionSearchVo searchVo);
/**
* 新权限-用户权限表简单分页查询
* @param searchVo
* @return
*/
IPage<SysUserDeptVo> getNameCodePage(Page<SysUserDeptVo> page, SysUserDeptVo searchVo);
List<SysDictVo> selectDictByType(String type);
R<String> autoCreateAuth(IdTypeEkpVo vo);
}
package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysUserRoleResService extends IService<SysUserRoleRes> {
/**
* 新权限-账号-角色关联表简单分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
IPage<SysUserRoleRes> getSysUserRoleResPage(Page<SysUserRoleRes> page, SysUserRoleResSearchVo sysUserRoleRes);
List<SysUserRoleRes> noPageDiy(SysUserRoleResSearchVo searchVo);
/**
* @param roleId
* @Description: 根据角色id获取被使用的账号名称
* @Author: hgw
* @Date: 2023/9/8 17:38
* @return: java.util.List<java.lang.String>
**/
List<String> getSysUserByRoleId(String roleId);
/**
* @param userId
* @Description: 根据账号删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:45
* @return: boolean
**/
boolean deleteByUserId(String userId);
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:45
* @return: boolean
**/
boolean deleteByRoleId(String roleId);
}
package com.yifu.cloud.plus.v1.permission.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysMenuMapper;
import com.yifu.cloud.plus.v1.permission.service.SysMenuService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 新权限-菜单表
*
* @author hyc
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
/**
* 新权限-菜单表简单分页查询
*
* @param sysMenu 新权限-菜单表
* @return
*/
@Override
public IPage<SysMenu> getSysMenuPage(Page<SysMenu> page, SysMenuSearchVo sysMenu) {
return baseMapper.getSysMenuPage(page, sysMenu);
}
/**
* 新增菜单表
*
* @param menu 新权限-菜单表
* @return
*/
@Override
public R<Boolean> saveMenu(SysMenu menu) {
if (Common.isEmpty(menu.getModelId())) {
return R.failed("表单ID不可为空");
}
//判断表单id是否填写正确
long menuIdCount = baseMapper.selectMenuId(menu.getModelId());
if (menuIdCount < 1) {
return R.failed("表单ID填写错误,请确认");
}
//判断view id是否填写正确并且要属于modeleID
long viewIdCount = baseMapper.selectViewId(menu.getViewId(),menu.getModelId());
if (viewIdCount < 1) {
return R.failed("视图ID不存在或者不属于填写的表单id,请确认");
}
//唯一性校验--视图ID唯一
long modelCount = baseMapper.selectCount(Wrappers.<SysMenu>query().lambda()
.eq(SysMenu::getViewId, menu.getViewId())
.eq(SysMenu::getDeleteStatus, CommonConstants.ONE_STRING));
if (modelCount > 0) {
return R.failed("已存在对应菜单的权限维度");
}
//是否开关为是的话,modelId只能有一个
boolean errorFlag = isOpenCheck(menu);
if (errorFlag) {
return R.failed("只能存在一个开关状态为开的表单ID");
}
//判断菜单是否为一级菜单
if (Common.isNotNull(menu.getMenuName()) && Common.isEmpty(menu.getMenuNameParent())) {
//一级菜单的上级菜单id为0
menu.setMenuParentId(CommonConstants.ZERO_STRING);
}
//错误信息
StringBuilder errorStr = new StringBuilder();
//权限维度
StringBuilder permissionType = new StringBuilder();
this.check(menu,errorStr,permissionType);
//权限维度的控件id填写错误的话统一返回
if (errorStr.length() > 0) {
return R.failed(errorStr.substring(0, errorStr.lastIndexOf(";")));
}
menu.setPermissionType(permissionType.substring(0, permissionType.lastIndexOf("、")));
int res = baseMapper.insert(menu);
if (res <= CommonConstants.ZERO_INT) {
return R.failed();
}
return R.ok();
}
@Override
public R<Boolean> updateMenu(SysMenu menu) {
//是否开关为是的话,modelId只能有一个
boolean errorFlag = isOpenCheck(menu);
if (errorFlag) {
return R.failed("只能存在一个开关状态为开的表单ID");
}
//错误信息
StringBuilder errorStr = new StringBuilder();
//权限维度
StringBuilder permissionType = new StringBuilder();
this.check(menu,errorStr,permissionType);
//权限维度的控件id填写错误的话统一返回
if (errorStr.length() > 0) {
return R.failed(errorStr.substring(0, errorStr.lastIndexOf(";")));
}
menu.setPermissionType(permissionType.substring(0, permissionType.lastIndexOf("、")));
baseMapper.updateById(menu);
return R.ok();
}
public void check(SysMenu menu,StringBuilder errorStr,StringBuilder permissionType) {
//权限类型
String name;
//判断填写的控件id 是否属于表单的字段
List<String> list = baseMapper.selectColumnList(menu.getModelId());
if (!menu.getColumnIdList().isEmpty()) {
for (String columnId : menu.getColumnIdList()) {
name = columnId.substring(0, columnId.indexOf(";"));
permissionType.append(name).append("、");
//label为控件id;columnId格式为【客户权限;fd_3ae495ff53c560】
String label = columnId.substring(columnId.indexOf(";") + 1);
if (list.stream().noneMatch(e -> e.equals(label))) {
errorStr.append(name).append("的控件id填写有误;");
}
}
}
}
public boolean isOpenCheck(SysMenu menu) {
if (Common.isNotNull(menu.getIsOpen()) && CommonConstants.ZERO_STRING.equals(menu.getIsOpen())) {
if (Common.isNotNull(menu.getId())) {
long modelCount = baseMapper.selectCount(Wrappers.<SysMenu>query().lambda()
.eq(SysMenu::getModelId, menu.getModelId())
.eq(SysMenu::getDeleteStatus, CommonConstants.ONE_STRING)
.eq(SysMenu::getIsOpen, CommonConstants.ZERO_STRING)
.ne(SysMenu::getId, menu.getId()));
return modelCount > 0;
}else {
long modelCount = baseMapper.selectCount(Wrappers.<SysMenu>query().lambda()
.eq(SysMenu::getModelId, menu.getModelId())
.eq(SysMenu::getDeleteStatus, CommonConstants.ONE_STRING)
.eq(SysMenu::getIsOpen, CommonConstants.ZERO_STRING));
return modelCount > 0;
}
} else {
return false;
}
}
}
package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysRoleMenuResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysRoleMenuResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
public class SysRoleMenuResServiceImpl extends ServiceImpl<SysRoleMenuResMapper, SysRoleMenuRes> implements SysRoleMenuResService {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Override
public IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes) {
return baseMapper.getSysRoleMenuResPage(page, sysRoleMenuRes);
}
@Override
public List<SysRoleMenuRes> noPageDiy(SysRoleMenuResSearchVo searchVo) {
LambdaQueryWrapper<SysRoleMenuRes> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysRoleMenuRes::getFdId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
return baseMapper.selectList(wrapper);
}
/**
* @param roleId
* @Description: 根据角色删除关联表
* @Author: hgw
* @Date: 2023/8/30 15:19
* @return: boolean
**/
@Override
public boolean deleteByRoleId(String roleId) {
return baseMapper.deleteByRoleId(roleId);
}
private LambdaQueryWrapper buildQueryWrapper(SysRoleMenuResSearchVo entity) {
LambdaQueryWrapper<SysRoleMenuRes> wrapper = Wrappers.lambdaQuery(entity);
return wrapper;
}
}
# 数据源配置
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
config:
activate:
on-profile: dev
redis:
host: 127.0.0.1
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: ll_mysql
url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://127.0.0.1:3000/oauth/check_token
# 直接放行URL
ignore:
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
- /msg/**
\ No newline at end of file
...@@ -225,6 +225,7 @@ ...@@ -225,6 +225,7 @@
<result property="fd_3bcd41da212afe" column="fd_3bcd41da212afe"/> <result property="fd_3bcd41da212afe" column="fd_3bcd41da212afe"/>
<result property="fd_3bcd41d77e4812" column="fd_3bcd41d77e4812"/> <result property="fd_3bcd41d77e4812" column="fd_3bcd41d77e4812"/>
<result property="fd_3bcdee91cacb6c" column="fd_3bcdee91cacb6c"/> <result property="fd_3bcdee91cacb6c" column="fd_3bcdee91cacb6c"/>
<result property="fd_3c3e5ff65115a2" column="fd_3c3e5ff65115a2"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -715,6 +716,7 @@ ...@@ -715,6 +716,7 @@
,ifnull(unitFund.SALARY_MONEY,'0') fd_3bcd41d1f6f58a ,ifnull(unitFund.SALARY_MONEY,'0') fd_3bcd41d1f6f58a
,ifnull(unitSocial.SALARY_MONEY,'0') fd_3bcd41db081b72 ,ifnull(unitSocial.SALARY_MONEY,'0') fd_3bcd41db081b72
,ifnull(if(a.RELAY_SALARY_UNIT is not null and a.RELAY_SALARY_UNIT != 0,a.RELAY_SALARY_UNIT,a.RELAY_SALARY),'0') fd_3bcdee91cacb6c ,ifnull(if(a.RELAY_SALARY_UNIT is not null and a.RELAY_SALARY_UNIT != 0,a.RELAY_SALARY_UNIT,a.RELAY_SALARY),'0') fd_3bcdee91cacb6c
,ifnull(a.CREATE_NAME,'') fd_3c3e5ff65115a2
from t_salary_account a from t_salary_account a
LEFT JOIN t_salary_standard s on a.SALARY_FORM_ID=s.ID LEFT JOIN t_salary_standard s on a.SALARY_FORM_ID=s.ID
left join t_salary_account_item withholidingPersonSocial on withholidingPersonSocial.SALARY_ACCOUNT_ID = a.id and withholidingPersonSocial.JAVA_FIED_NAME='withholidingPersonSocial' left join t_salary_account_item withholidingPersonSocial on withholidingPersonSocial.SALARY_ACCOUNT_ID = a.id and withholidingPersonSocial.JAVA_FIED_NAME='withholidingPersonSocial'
......
...@@ -64,6 +64,12 @@ public class TDispatchInfoExportVo { ...@@ -64,6 +64,12 @@ public class TDispatchInfoExportVo {
@ExcelProperty("员工身份证") @ExcelProperty("员工身份证")
private String empIdcard; private String empIdcard;
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Schema(description = "手机号码" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("手机号码" )
private String empMobile;
@ExcelAttribute(name = "客户名称", maxLength = 50) @ExcelAttribute(name = "客户名称", maxLength = 50)
@Schema(description = "客户名称") @Schema(description = "客户名称")
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment