Commit 879409b1 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.7.7' into MVP1.7.7

parents 0254a835 3110d6b7
apiVersion: apps/v1
kind: Deployment
metadata:
name: yifu-prd-webcsp
namespace: prd-mvp
spec:
selector:
matchLabels:
app: yifu-prd-webcsp
replicas: 1
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-prd-webcsp
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-prd-webcsp" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "8889" #这个参数告诉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-type: worker
containers:
- name: yifu-prd-webcsp
image: hub.worfu.com/prd-mvp/yifu-prd-webcsp:1.0.0
imagePullPolicy: Always
ports:
- containerPort: 8889
env:
- name: TZ
value: Asia/Shanghai
resources:
requests:
memory: "100Mi"
limits:
memory: "200Mi"
imagePullSecrets:
- name: login
apiVersion: v1
kind: Service
metadata:
name: yifu-prd-webcsp
namespace: prd-mvp
labels:
k8s-app: yifu-prd-webcsp
spec:
ports:
- name: yifu-prd-webcsp
port: 80
protocol: TCP
targetPort: 8889
selector:
app: yifu-prd-webcsp
...@@ -89,7 +89,7 @@ public class FileUploadServiceImpl implements FileUploadService { ...@@ -89,7 +89,7 @@ public class FileUploadServiceImpl implements FileUploadService {
true, true,
"1", authorities, "1", "1", authorities, "1",
null, null, null, null,
null); null,null);
attaInfo.setCreateBy(user.getId()); attaInfo.setCreateBy(user.getId());
attaInfo.setCreateName(user.getNickname()); attaInfo.setCreateName(user.getNickname());
attaInfo = tAttaInfoService.add(attaInfo); attaInfo = tAttaInfoService.add(attaInfo);
......
...@@ -1719,7 +1719,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1719,7 +1719,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
true, true,
"1", authorities, "1", "1", authorities, "1",
null, null, null, null,
null); null,null);
} }
/** /**
......
...@@ -117,7 +117,7 @@ public class YifuTokenEndpoint { ...@@ -117,7 +117,7 @@ public class YifuTokenEndpoint {
CommonConstants.STATUS_NORMAL.equals(user.getLockFlag()), CommonConstants.STATUS_NORMAL.equals(user.getLockFlag()),
user.getUserGroup(),authorities, user.getLdapDn(), user.getUserGroup(),authorities, user.getLdapDn(),
info.getClientRoleMap(),info.getSettleIdList(), info.getClientRoleMap(),info.getSettleIdList(),
user.getType()); user.getType(),info.getCspPermMap());
thisUser.setClientRoleMap(info.getClientRoleMap()); thisUser.setClientRoleMap(info.getClientRoleMap());
return thisUser; return thisUser;
} }
......
...@@ -5,6 +5,8 @@ import cn.hutool.core.util.CharsetUtil; ...@@ -5,6 +5,8 @@ import cn.hutool.core.util.CharsetUtil;
import cn.hutool.http.HttpStatus; import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.yifu.cloud.plus.v1.yifu.auth.constants.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.auth.constants.SecurityConstants;
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;
......
...@@ -597,7 +597,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh ...@@ -597,7 +597,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
true, true,
"1", authorities, "1", "1", authorities, "1",
null, null, null, null,
null); null,null);
// 调用以前的批量校验 // 调用以前的批量校验
R<List<TCheckIdCard>> returnR = this.checkSalaryIdCard(list, user); R<List<TCheckIdCard>> returnR = this.checkSalaryIdCard(list, user);
if (returnR != null) { if (returnR != null) {
......
package com.yifu.cloud.plus.v1.yifu.admin.api.vo; package com.yifu.cloud.plus.v1.yifu.common.core.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -33,7 +32,13 @@ public class UserPermissionVo implements Serializable { ...@@ -33,7 +32,13 @@ public class UserPermissionVo implements Serializable {
* 用户ID * 用户ID
*/ */
private String userId; private String userId;
/**
* 关联项目编码 fxj 2025-02-25
*/
private String projectNo;
/**
private Map<String,UserPermissionVo> permissionVoMap; * 关联项目名称 fxj 2025-02-25
*/
private String projectName;
} }
...@@ -92,9 +92,18 @@ public class YifuUser extends User { ...@@ -92,9 +92,18 @@ public class YifuUser extends User {
@Getter @Getter
@Setter @Setter
private List<String> settleIdList; private List<String> settleIdList;
/**
* @Author fxj
* @Description 客户服务平台 项目权限及项目对应的数据权限
* @Date 14:48 2025/2/25
**/
@Getter
@Setter
private List<UserPermissionVo> cspPermMap;
/** /**
* @Author fxj * @Author fxj
* @Description 员工类型 * @Description 员工类型 0 系统用户 1 LDAP用户 2 B端用户 3.微信用户 默认系统用户 4.甲方客户端
**/ **/
@Getter @Getter
private String type; private String type;
...@@ -104,7 +113,8 @@ public class YifuUser extends User { ...@@ -104,7 +113,8 @@ public class YifuUser extends User {
boolean credentialsNonExpired, boolean accountNonLocked, boolean credentialsNonExpired, boolean accountNonLocked,
String userGroup, Collection<? extends GrantedAuthority> authorities, String ldapDn, String userGroup, Collection<? extends GrantedAuthority> authorities, String ldapDn,
Map<String, List<Long>> clientRoleMap, Map<String, List<Long>> clientRoleMap,
List<String> settleIdList,String type) { List<String> settleIdList,String type,
List<UserPermissionVo> cspPermMap) {
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
this.id = id; this.id = id;
this.deptId = deptId; this.deptId = deptId;
...@@ -117,5 +127,6 @@ public class YifuUser extends User { ...@@ -117,5 +127,6 @@ public class YifuUser extends User {
this.clientRoleMap=clientRoleMap; this.clientRoleMap=clientRoleMap;
this.settleIdList=settleIdList; this.settleIdList=settleIdList;
this.type=type; this.type=type;
this.cspPermMap=cspPermMap;
} }
} }
...@@ -94,6 +94,6 @@ public class WxUserDetailService implements UserDetailsService { ...@@ -94,6 +94,6 @@ public class WxUserDetailService implements UserDetailsService {
user.getPhone(), true, true, true, user.getPhone(), true, true, true,
StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL), StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL),
user.getUserGroup(),authorities, user.getLdapDn(),info.getClientRoleMap(), user.getUserGroup(),authorities, user.getLdapDn(),info.getClientRoleMap(),
info.getSettleIdList(),user.getType()); info.getSettleIdList(),user.getType(),null);
} }
} }
...@@ -72,7 +72,7 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered { ...@@ -72,7 +72,7 @@ public interface YifuUserDetailsService extends UserDetailsService, Ordered {
user.getPhone(), true, true, true, user.getPhone(), true, true, true,
StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL), StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL),
user.getUserGroup(),authorities, user.getLdapDn(),info.getClientRoleMap(), user.getUserGroup(),authorities, user.getLdapDn(),info.getClientRoleMap(),
info.getSettleIdList(),user.getType()); info.getSettleIdList(),user.getType(),info.getCspPermMap());
} }
/** /**
......
...@@ -53,10 +53,6 @@ ...@@ -53,10 +53,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId> <artifactId>spring-boot-starter-undertow</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
</dependencies> </dependencies>
......
...@@ -51,4 +51,11 @@ public class UserDTO extends SysUser { ...@@ -51,4 +51,11 @@ public class UserDTO extends SysUser {
*/ */
private String newpassword1; private String newpassword1;
/**
* 姓名或者手机号搜索
* chenyuxi
* @since 1.9.7
*/
private String nameOrPhone;
} }
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.dto; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.dto;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -76,4 +77,11 @@ public class UserInfo implements Serializable { ...@@ -76,4 +77,11 @@ public class UserInfo implements Serializable {
* @Date 13:53 2023/1/3 * @Date 13:53 2023/1/3
**/ **/
private List<String> settleIdList; private List<String> settleIdList;
/**
* @Author fxj
* @Description 客户服务平台 项目权限及项目对应的数据权限
* @Date 14:48 2025/2/25
**/
private List<UserPermissionVo> cspPermMap;
} }
...@@ -23,6 +23,8 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -23,6 +23,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
/** /**
* 项目下用户部门及权限 * 项目下用户部门及权限
* *
...@@ -35,22 +37,30 @@ public class SysUserDeptPermission extends Model<SysUserDeptPermission> { ...@@ -35,22 +37,30 @@ public class SysUserDeptPermission extends Model<SysUserDeptPermission> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "user_id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@Schema(description = "主键id") @Schema(description = "主键id")
private String id; private String id;
@NotBlank(message = "用户id 不能为空")
@Schema(description = "用户id") @Schema(description = "用户id")
private String userId; private String userId;
@NotBlank(message = "部门id 不能为空")
@Schema(description = "部门id") @Schema(description = "部门id")
private Long deptId; private Long deptId;
@NotBlank(message = "关联项目编码 不能为空")
@Schema(description = "关联项目编码") @Schema(description = "关联项目编码")
private String projectNo; private String projectNo;
@Schema(description = "归属系统 0 mvp 1 甲方客户端") @NotBlank(message = "关联项目名称 不能为空")
@Schema(description = "关联项目名称")
private String projectName;
@Schema(description = "归属系统 yifu-mvp、yifu-csp")
private String client; private String client;
@NotBlank(message = "账号类型 不能为空")
@Schema(description = "账号类型:0 管理员, 1 普通成员") @Schema(description = "账号类型:0 管理员, 1 普通成员")
private String userType; private String userType;
......
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import lombok.Data;
import javax.sql.rowset.serial.SerialArray;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2025/2/26
* @Description 部门排序树
* @Version 1.0
*/
@Data
public class DeptSortVo implements Serializable {
/**
* @Author fxj
* @Description 部门ID
* @Date 17:27 2025/2/26
**/
private String id;
/**
* @Author fxj
* @Description 部门排序
* @Date 17:27 2025/2/26
**/
private String sort;
}
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* 客户服务平台——部门树
*
* @author chenyuxi
* @since 1.9.7
*/
@Data
public class DeptTreeSelectVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 部门ID
*/
private Long deptId;
/**
* 父部门ID
*/
private Long parentId;
/**
* 祖级列表
*/
private String ancestors;
/**
* 部门名称
*/
private String name;
/**
* 父部门名称
*/
private String parentName;
/**
* 部门总人数
*/
private String peopleNum;
private Integer sortOrder;
private List<DeptTreeSelectVO> children;
public DeptTreeSelectVO(SysDeptVo dept) {
this.deptId = dept.getDeptId();
this.parentId = dept.getParentId();
this.ancestors = dept.getAncestors();
this.name = dept.getName();
this.sortOrder = dept.getSortOrder();
this.parentName = dept.getParentName();
this.peopleNum =dept.getPeopleNum();
if(dept.getChildren() != null){
this.children = dept.getChildren().stream().map(DeptTreeSelectVO::new).collect(Collectors.toList());
}
}
}
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 客户服务平台——部门包装类
*
* @author chenyuxi
* @since 1.9.7
*/
@Data
public class SysDeptMoveVo implements Serializable {
/**
* @Author fxj
* @Description 部门ID
* @Date 17:29 2025/2/26
**/
private String sysDeptId;
/**
* @Author fxj
* @Description 部门父级ID
* @Date 17:29 2025/2/26
**/
private String parentId;
/**
* @Author fxj
* @Description 部门排序信息
* @Date 17:29 2025/2/26
**/
private List<DeptSortVo> deptSortList;
}
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 客户服务平台——部门包装类
*
* @author chenyuxi
* @since 1.9.7
*/
@Data
public class SysDeptVo extends SysDept {
/** 子部门 */
private List<SysDeptVo> children;
/**
* 父部门名称
*/
private String parentName;
/**
* 部门人数
*/
private String peopleNum;
}
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author lengleng
* @date 2019/2/1
*/
@Data
public class UserCspVO extends SysUser implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户Id
*/
private String userId;
/**
* 用户名
*/
@NotBlank(message = "用户名 不能为空")
private String username;
/**
* 用户昵称
*/
@NotBlank(message = "用户昵称 不能为空")
private String nickname;
/**
* 手机号码
*/
@NotBlank(message = "手机号码 不能为空")
private String phone;
/**
* 部门ID
*/
@NotBlank(message = "部门ID 不能为空")
private Long deptId;
//关系表数据开始
@NotBlank(message = "关联项目编码 不能为空")
@Schema(description = "关联项目编码")
private String projectNo;
@NotBlank(message = "关联项目名称 不能为空")
@Schema(description = "关联项目名称")
private String projectName;
@Schema(description = "归属系统 0 yifu-mvp 1 yifu-csp")
private String client;
@NotBlank(message = "账号类型 不能为空")
@Schema(description = "账号类型:0 管理员, 1 普通成员")
private String userType;
}
package com.yifu.cloud.plus.v1.yifu.admin.constants;
/**
* @Author fxj
* @Description 客户服务平台相关常量
* @Date 16:45 2025/2/26
* @Param
* @return
**/
public class UserDeptPermConstants {
// 社保补缴配置有误!
public static final String PERMISSION_SAVE_ERROR = "客户服务平台用户更新异常!";
public static final String ADMIN_DISABLE_ERROR = "管理员账号禁止收回,如需操作请先修改用户为普通用户!";
public static final String USER_EXITS_ERROR = "已存在对应用户数据,请勿重复配置!";
public static final String CUSTOMER_SERVICE_PLATFORM = "客户服务平台用户";
public static final String DEFAULT_PASSWORD = "123456";
public static final String ERROR_TEMPLATE = "模板中已存在对应员工";
public static final String YL = "养老";
public static final String DB = "大病";
public static final String SY = "失业";
public static final String BIR = "生育";
public static final String GS = "工伤";
public static final String YB = "医保";
public static final String BJ = "补缴";
public static final String YEAR_1970 = "1970-02";
public static final String NOT_EXIT_SETTLEiNFO = "未找到该人员对应的项目信息,请核实";
public static final String ERROR_PRI = "该人员归属的";
public static final String ERROR_END = "信息缺失,将导致后续无法结算,请联系卢名旭处理";
}
...@@ -18,7 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.controller; ...@@ -18,7 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.controller;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DeptTreeSelectVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptMoveVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService;
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.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.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
...@@ -154,4 +159,103 @@ public class DeptController { ...@@ -154,4 +159,103 @@ public class DeptController {
public R innerUpdateDeptByLdap() { public R innerUpdateDeptByLdap() {
return R.ok(sysDeptService.updateDeptByLdap()); return R.ok(sysDeptService.updateDeptByLdap());
} }
/**
* 客户服务平台——获取部门树(用于下拉选择)
* @return 树形菜单
*/
@GetMapping(value = "/csp/list")
public R<List<DeptTreeSelectVO>> cspList(SysDeptVo dept) {
if(Common.isEmpty(dept.getProjectNo())){
R.failed("项目编码不能为空");
}
return R.ok(sysDeptService.cspDeptTreeSelect(dept));
}
/**
* 客户服务平台——获取部门树(带部门下人数)
* @return 树形菜单
*/
@GetMapping(value = "/csp/tree")
public R<List<DeptTreeSelectVO>> cspTree(SysDeptVo dept) {
if(Common.isEmpty(dept.getProjectNo())){
R.failed("项目编码不能为空");
}
return R.ok(sysDeptService.cspDeptTree(dept));
}
/**
* 客户服务平台——添加部门
* @param sysDept 实体
* @return success/false
*/
@SysLog("客户服务平台——添加部门")
@PostMapping("/csp")
public R<String> saveCspDept(@RequestBody SysDept sysDept) {
if(Common.isEmpty(sysDept.getProjectNo())){
R.failed("项目编码不能为空");
}
// todo 名字长度
if(Common.isEmpty(sysDept.getName())){
R.failed("部门名称不能为空");
}
// 父级不传,默认增顶级部门
if (Common.isEmpty(sysDept.getParentId())){
sysDept.setParentId(0L);
}
return sysDeptService.saveCspDept(sysDept);
}
/**
* 客户服务平台——编辑部门
* @param sysDept 实体
* @return success/false
*/
@SysLog("客户服务平台——编辑部门")
@PutMapping("/csp")
public R<String> updateCspDept(@RequestBody SysDept sysDept) {
if(Common.isEmpty(sysDept.getDeptId())){
R.failed("ID不能为空");
}
if(Common.isEmpty(sysDept.getName())){
R.failed("部门名称不能为空");
}
return sysDeptService.updateCspDept(sysDept);
}
/**
* 删除
* @param id ID
* @return success/false
*/
@SysLog("客户服务平台——删除部门")
@DeleteMapping("/csp/{id:\\d+}")
public R<String> removeCspDeptById(@PathVariable Long id) {
if(Common.isEmpty(id)){
R.failed("项目Id不能为空");
}
return sysDeptService.removeCspDeptById(id);
}
/**
* 客户服务平台——获取项目下部门总数
* @return R<Integer> 部门总数
*/
@GetMapping(value = "/csp/getDeptCount")
public R<Integer> cspDeptCount(SysDeptVo dept) {
if(Common.isEmpty(dept.getProjectNo())){
R.failed("项目编码不能为空");
}
return R.ok(sysDeptService.cspDeptCount(dept.getProjectNo()));
}
/**
* @Author fxj
* @Description 获取
* @Date 17:27 2025/2/26
**/
@PostMapping(value = "/cspUpdateDept")
public R<Boolean> cspUpdateDept(SysDeptMoveVo dept) {
return sysDeptService.cspUpdateDept(dept);
}
} }
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yifu.cloud.plus.v1.yifu.admin.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.icbc.api.request.ErrorHandlingProRequestV1;
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.HcmRoleInfoVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserCspVO;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysRoleMenuService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysRoleService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserDeptPermissionService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
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 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.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* @Author fxj
* @Description 客户服务平台 账号 部门 项目 关系表
* @Date 18:38 2025/2/25
* @Param
* @return
**/
@RestController
@RequiredArgsConstructor
@RequestMapping("/userDeprtPermission")
@Tag(name = "客户服务平台账号授权")
public class SysUserDeptPermissionController {
private final SysUserDeptPermissionService sysUserDeptPermissionService;
private final SysUserService sysUserService;
/**
* 新增
* @Description 新增用户
* @return success、false
*/
@SysLog("新增用户")
@PostMapping("add")
public R<Boolean> save(@Valid @RequestBody UserCspVO entity) {
return sysUserDeptPermissionService.saveAsso(entity);
}
/**
* 修改用户
* @param entity 修改用户
* @return success/false
*/
@SysLog("修改用户")
@PostMapping("/update")
public R<Boolean> update(@Valid @RequestBody UserCspVO entity) {
return sysUserDeptPermissionService.updateByIdAsso(entity);
}
/**
* 收回用户
* @param userId
* @return
*/
@SysLog("收回用户")
@DeleteMapping("/disable")
public R<Boolean> removeById(@RequestParam(required = true,value = "userId") String userId,
@RequestParam(required = true,value = "projectNo") String projectNo) {
return sysUserDeptPermissionService.removeUserDeptPermissionById(userId,projectNo);
}
}
...@@ -597,7 +597,7 @@ public class UserController { ...@@ -597,7 +597,7 @@ public class UserController {
* @param userByApprovalRole * @param userByApprovalRole
* @author chenyuxi * @author chenyuxi
* @date 2025-01-10 17:47:32 * @date 2025-01-10 17:47:32
* @since 1.7.5 * @since 1.9.5
**/ **/
@Inner @Inner
@PostMapping("/inner/getUser/getUserByRoleIdForCrm") @PostMapping("/inner/getUser/getUserByRoleIdForCrm")
...@@ -623,4 +623,34 @@ public class UserController { ...@@ -623,4 +623,34 @@ public class UserController {
public Boolean selectExitDeptCompany(@RequestBody String deptId) { public Boolean selectExitDeptCompany(@RequestBody String deptId) {
return userService.selectExitDeptCompany(deptId); return userService.selectExitDeptCompany(deptId);
} }
/**
* 分页查询系统里所有用户
*
* @param page 参数集
* @param userDTO 查询参数列表
* @return 用户集合
*
* @author chenyuxi
* @since 1.9.7
*/
@GetMapping("/allUserPage")
public R<IPage<SysUser>> getAllUserPage(Page page, UserDTO userDTO) {
return R.ok(userService.getAllUserPage(page, userDTO));
}
/**
* @Author fxj
* @Description 按项目对应部门查询客户服务平台的用户信息
* @Date 14:27 2025/2/26
* @Param
* @return
**/
@GetMapping("/cspUserPage")
public R<IPage<SysUser>> cspUserPage(Page page, @RequestParam(required = true,value = "deptId") String deptId,
@RequestParam(required = false,value = "userName") String userName,
@RequestParam(required = false,value = "nickName") String nickName) {
return userService.cspUserPage(page, deptId,userName,nickName);
}
} }
/*
* Copyright (c) 2020 yifu4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yifu.cloud.plus.v1.yifu.admin.controller;
import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DeptTreeSelectVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserDeptPermissionService;
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.common.security.annotation.Inner;
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 javax.validation.Valid;
import java.util.List;
/**
* 项目下用户部门及权限
*
* @author chenyuxi
* @since 1.9.7
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/userDeptPermission")
@Tag(name = "项目下用户部门及权限")
public class UserDeptPermissionController {
private final SysUserDeptPermissionService sysUserDeptPermissionService;
/**
* 客户服务平台——获取用户权限
* @param sysUserDeptPermission 实体
* @return success/false
*/
@GetMapping("/info")
public R<SysUserDeptPermission> getInfo(SysUserDeptPermission sysUserDeptPermission) {
if(Common.isEmpty(sysUserDeptPermission.getProjectNo())){
R.failed("项目编码不能为空");
}
if(Common.isEmpty(sysUserDeptPermission.getUserId())){
R.failed("用户ID不能为空");
}
return R.ok(sysUserDeptPermissionService.getInfo(sysUserDeptPermission.getProjectNo(),sysUserDeptPermission.getUserId()));
}
/**
* 客户服务平台——用户权限控制
* @param sysUserDeptPermission 实体
* @return success/false
*/
@SysLog("客户服务平台——用户权限控制")
@PostMapping("/permission")
public R<String> saveUserPermission(@RequestBody SysUserDeptPermission sysUserDeptPermission) {
if(Common.isEmpty(sysUserDeptPermission.getProjectNo())){
R.failed("项目编码不能为空");
}
if(Common.isEmpty(sysUserDeptPermission.getUserId())){
R.failed("用户ID不能为空");
}
if (Common.isEmpty(sysUserDeptPermission.getPermissionsType())){
R.failed("数据权限不能为空");
}
if (CommonConstants.THREE_STRING.equals(sysUserDeptPermission.getPermissionsType())
&& Common.isEmpty(sysUserDeptPermission.getAppointDeptScope())
){
R.failed("指定部门时,部门范围不能为空");
}
return sysUserDeptPermissionService.saveUserPermission(sysUserDeptPermission);
}
/**
* 客户服务平台——绑定项目
* @param sysUserDeptPermission 实体
* @return success/false
*/
@SysLog("客户服务平台——绑定项目")
@PostMapping("/relation")
public R<String> relationUser(@RequestBody SysUserDeptPermission sysUserDeptPermission) {
if(Common.isEmpty(sysUserDeptPermission.getProjectNo())){
R.failed("项目编码不能为空");
}
if(Common.isEmpty(sysUserDeptPermission.getProjectName())){
R.failed("项目名称不能为空");
}
if(Common.isEmpty(sysUserDeptPermission.getUserId())){
R.failed("用户ID不能为空");
}
if (Common.isEmpty(sysUserDeptPermission.getDeptId())){
R.failed("部门ID不能为空");
}
return sysUserDeptPermissionService.relationUser(sysUserDeptPermission);
}
}
...@@ -18,6 +18,8 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper; ...@@ -18,6 +18,8 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DeptSortVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -47,4 +49,44 @@ public interface SysDeptMapper extends BaseMapper<SysDept> { ...@@ -47,4 +49,44 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
SysDept selectDeptDn(@Param("deptDn")String deptDn); SysDept selectDeptDn(@Param("deptDn")String deptDn);
List<SysDept> getDeptListByDeptId(@Param("deptIdSplit") String deptIdSplit, @Param("deptId") Long deptId); List<SysDept> getDeptListByDeptId(@Param("deptIdSplit") String deptIdSplit, @Param("deptId") Long deptId);
/**
* 客户服务平台——查询部门管理数据
*
* @param dept 部门信息
*/
List<SysDeptVo> cspDeptList(@Param("dept") SysDeptVo dept);
/**
* 客户服务平台——查询部门管理数据(带部门下人数)
*
*/
List<SysDeptVo> cspDeptUserList(@Param("dept") SysDeptVo dept);
/**
* 客户服务平台——查询同项目下同级部门
*
*/
SysDept checkDeptNameUnique(@Param("projectNo") String projectNo, @Param("deptName") String deptName, @Param("parentId") Long parentId);
/**
* 客户服务平台——是否存在子节点
*
* @param deptId 部门ID
* @return 结果
*/
int hasChildByDeptId(@Param("deptId") Long deptId);
/**
* 客户服务平台——查询部门是否存在用户
*
* @param deptId 部门ID
* @return 结果
*/
int checkDeptExistUser(@Param("deptId") Long deptId);
int cspDeptCount(@Param("projectNo") String projectNo);
void batchUpdateSort(@Param("moveVos")List<DeptSortVo> moveVos);
} }
...@@ -83,4 +83,22 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -83,4 +83,22 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
List<SysUser> getUserManagerByUpDepartIdUp(@Param("departId") Integer departId, @Param("roleId")String roleId); List<SysUser> getUserManagerByUpDepartIdUp(@Param("departId") Integer departId, @Param("roleId")String roleId);
String selectExitDeptCompany(@Param("deptId") String deptId); String selectExitDeptCompany(@Param("deptId") String deptId);
/**
* 分页查询系统里所有用户
* @param page 分页
* @param userDTO 查询参数
* @return list
*/
IPage<SysUser> getAllUserPage(Page page, @Param("query") UserDTO userDTO);
/**
* 分页查询系统里所有用户(带或查询的条件)
* @param page 分页
* @param userDTO 查询参数
* @return list
*/
IPage<SysUser> getAllUserPageWhere(Page page, @Param("query") UserDTO userDTO);
IPage<SysUser> cspUserPage(Page page, @Param("deptId")String deptId, @Param("userName")String userName, @Param("nickName")String nickName);
} }
...@@ -19,6 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.admin.service; ...@@ -19,6 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.admin.service;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DeptTreeSelectVO;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptMoveVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List; import java.util.List;
...@@ -79,4 +82,56 @@ public interface SysDeptService extends IService<SysDept> { ...@@ -79,4 +82,56 @@ public interface SysDeptService extends IService<SysDept> {
* @return R * @return R
*/ */
R updateDeptByLdap(); R updateDeptByLdap();
/**
* 客户服务平台——获取部门树(用于下拉选择)
*
* @param dept 部门信息
* @return 下拉树结构列表
*/
List<DeptTreeSelectVO> cspDeptTreeSelect(SysDeptVo dept);
/**
* 客户服务平台——获取部门树(带部门下人数)
*
* @param dept 部门信息
* @return 部门树列表
*/
List<DeptTreeSelectVO> cspDeptTree(SysDeptVo dept);
/**
* 客户服务平台——添加部门
*
* @param dept 部门信息
* @return 结果
*/
R<String> saveCspDept(SysDept dept);
/**
* 客户服务平台——编辑部门
*
* @param dept 部门信息
* @return 结果
*/
R<String> updateCspDept(SysDept dept);
/**
* 客户服务平台——删除部门
*
* @param id 部门id
* @return 结果
*/
R<String> removeCspDeptById(Long id);
/**
* 客户服务平台——获取项目下部门总数
*
* @param projectNo 项目编码
* @return R<Integer> 部门总数
*/
Integer cspDeptCount(String projectNo);
R<Boolean> cspUpdateDept(SysDeptMoveVo dept);
} }
...@@ -18,10 +18,14 @@ package com.yifu.cloud.plus.v1.yifu.admin.service; ...@@ -18,10 +18,14 @@ package com.yifu.cloud.plus.v1.yifu.admin.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPermissionVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserCspVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 项目下用户部门及权限 * 项目下用户部门及权限
* *
...@@ -30,6 +34,16 @@ import java.util.Map; ...@@ -30,6 +34,16 @@ import java.util.Map;
*/ */
public interface SysUserDeptPermissionService extends IService<SysUserDeptPermission> { public interface SysUserDeptPermissionService extends IService<SysUserDeptPermission> {
/**
* 项目下用户数据权限
* @param projectNo 项目编号
* @param userId 用户ID
*
* @return UserPermissionVo 用户在指定项目下的权限
*/
SysUserDeptPermission getInfo(String projectNo, String userId);
/** /**
* 项目下用户数据权限 * 项目下用户数据权限
* @param projectNo 项目编号 * @param projectNo 项目编号
...@@ -47,4 +61,25 @@ public interface SysUserDeptPermissionService extends IService<SysUserDeptPermis ...@@ -47,4 +61,25 @@ public interface SysUserDeptPermissionService extends IService<SysUserDeptPermis
*/ */
Map<String, UserPermissionVo> getUserPermissionFlush(String userId); Map<String, UserPermissionVo> getUserPermissionFlush(String userId);
/**
* 客户服务平台——用户权限控制
* @param sysUserDeptPermission 实体
* @return success/false
*/
R<String> saveUserPermission(SysUserDeptPermission sysUserDeptPermission);
/**
* 客户服务平台——绑定项目
* @param sysUserDeptPermission 实体
* @return success/false
*/
R<String> relationUser(SysUserDeptPermission sysUserDeptPermission);
List<UserPermissionVo> getUserPermission(String userId);
R<Boolean> saveAsso(UserCspVO entity);
R<Boolean> updateByIdAsso(UserCspVO entity);
R<Boolean> removeUserDeptPermissionById(String userId, String projectNo);
} }
...@@ -192,4 +192,18 @@ public interface SysUserService extends IService<SysUser> { ...@@ -192,4 +192,18 @@ public interface SysUserService extends IService<SysUser> {
Boolean selectExitDeptCompany(String deptId); Boolean selectExitDeptCompany(String deptId);
/**
* 分页查询系统里所有用户
*
* @param page 参数集
* @param userDTO 查询参数列表
* @return 用户集合
*
* @author chenyuxi
* @since 1.9.7
*/
IPage<SysUser> getAllUserPage(Page page, UserDTO userDTO);
R<IPage<SysUser>> cspUserPage(Page page, String deptId, String userName, String nickName);
} }
...@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver; ...@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.*; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.*;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.*; import com.yifu.cloud.plus.v1.yifu.admin.mapper.*;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserDeptPermissionService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -100,6 +101,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -100,6 +101,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private final PermissionDaprUtil permissionDaprUtil; private final PermissionDaprUtil permissionDaprUtil;
private final SysUserDeptPermissionService userDeptPermissionService;
@Value("${hrms.id}") @Value("${hrms.id}")
private String hcmId; private String hcmId;
...@@ -186,6 +189,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -186,6 +189,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userInfo.setSettleIdList(sdRes.getData().getDeptIds()); userInfo.setSettleIdList(sdRes.getData().getDeptIds());
} }
userInfo.setClientRoleMap(clientRoleMap); userInfo.setClientRoleMap(clientRoleMap);
// 客户服务平台的项目权限及对应项目的数据权限
userInfo.setCspPermMap(userDeptPermissionService.getUserPermission(sysUser.getUserId()));
return userInfo; return userInfo;
} }
/** /**
...@@ -962,4 +967,30 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -962,4 +967,30 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return deptList.stream().anyMatch(dn::contains); return deptList.stream().anyMatch(dn::contains);
} }
/**
* 分页查询系统里所有用户
*
* @param page 参数集
* @param userDTO 查询参数列表
* @return 用户集合
*
* @author chenyuxi
* @since 1.9.7
*/
@Override
public IPage<SysUser> getAllUserPage(Page page, UserDTO userDTO) {
if(Common.isEmpty(userDTO.getNameOrPhone())){
return baseMapper.getAllUserPage(page, userDTO);
}
return baseMapper.getAllUserPageWhere(page, userDTO);
}
@Override
public R<IPage<SysUser>> cspUserPage(Page page, String deptId, String userName, String nickName) {
if (Common.isEmpty(deptId)){
return R.failed(null,CommonConstants.PARAM_IS_NOT_ERROR);
}
return R.ok(baseMapper.cspUserPage(page,deptId,userName,nickName));
}
} }
...@@ -6,8 +6,8 @@ spring: ...@@ -6,8 +6,8 @@ spring:
activate: activate:
on-profile: test on-profile: test
redis: redis:
host: 192.168.1.65 host: 127.0.0.1
port: 22379 port: 6379
password: '@yf_2017' password: '@yf_2017'
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
......
...@@ -63,6 +63,53 @@ ...@@ -63,6 +63,53 @@
and (dept_id = #{deptId} or ancestors like concat(#{deptIdSplit}, '%')) and (dept_id = #{deptId} or ancestors like concat(#{deptIdSplit}, '%'))
</select> </select>
<select id="cspDeptList" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo">
select d.dept_id, d.name, d.parent_id,d.ancestors,sort_order
from sys_dept d
where d.del_flag = '0'
<if test="dept.projectNo != null and dept.projectNo != ''">
AND d.project_no = #{dept.projectNo}
</if>
<if test="dept.deptId != null and dept.deptId != 0">
AND d.dept_id = #{dept.deptId}
</if>
<if test="dept.parentId != null and dept.parentId != 0">
AND d.parent_id = #{dept.parentId}
</if>
<if test="dept.name != null and dept.name != ''">
AND d.name like concat('%', #{dept.name}, '%')
</if>
order by d.create_time desc,d.sort_order asc
</select>
<select id="cspDeptUserList" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo">
select d.dept_id, d.name, d.parent_id,d.ancestors,sort_order,
(select count(*) from sys_user_dept_permission where dept_id = d.dept_id) as peoplenum
from sys_dept d
where d.del_flag = '0'
<if test="dept.projectNo != null and dept.projectNo != ''">
AND d.project_no = #{dept.projectNo}
</if>
order by d.create_time desc,d.sort_order asc
</select>
<select id="checkDeptNameUnique" resultMap="BaseResultMap">
select dept_id,name from sys_dept
where project_no = #{projectNo} and name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<select id="checkDeptExistUser" resultType="int">
select count(1) from sys_user_dept_permission where dept_id = #{deptId}
</select>
<select id="hasChildByDeptId" resultType="int">
select count(1) from sys_dept where del_flag = '0' and parent_id = #{deptId}
</select>
<select id="cspDeptCount" resultType="int">
select count(1) from sys_dept where del_flag = '0' and project_no = #{projectNo}
</select>
<update id="updateDeptById"> <update id="updateDeptById">
update sys_dept update sys_dept
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
...@@ -74,4 +121,21 @@ ...@@ -74,4 +121,21 @@
</trim> </trim>
WHERE dept_id=#{dept.deptId} WHERE dept_id=#{dept.deptId}
</update> </update>
<update id="batchUpdateSort">
UPDATE sys_dept
<trim prefix="SET" suffixOverrides=",">
<trim prefix="sort_order = CASE" suffix="END,">
<foreach collection="moveVos" item="m">
WHEN dept_id = #{m.id} THEN #{m.sort}
</foreach>
</trim>
</trim>
WHERE dept_id IN
<foreach collection="moveVos" item="m" open="(" separator="," close=")">
#{m.id}
</foreach>
</update>
</mapper> </mapper>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<result column="user_id" property="userId"/> <result column="user_id" property="userId"/>
<result column="dept_id" property="deptId"/> <result column="dept_id" property="deptId"/>
<result column="project_no" property="projectNo"/> <result column="project_no" property="projectNo"/>
<result column="project_name" property="projectName"/>
<result column="client" property="client"/> <result column="client" property="client"/>
<result column="user_type" property="userType"/> <result column="user_type" property="userType"/>
<result column="permissions_type" property="permissionsType"/> <result column="permissions_type" property="permissionsType"/>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
a.user_id, a.user_id,
a.dept_id, a.dept_id,
a.project_no, a.project_no,
a.project_name,
a.client, a.client,
a.user_type, a.user_type,
a.permissions_type, a.permissions_type,
......
...@@ -386,4 +386,48 @@ ...@@ -386,4 +386,48 @@
from from
sys_dept where dept_id = #{deptId} limit 1 sys_dept where dept_id = #{deptId} limit 1
</select> </select>
<select id="getAllUserPage" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser">
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
ORDER BY create_time DESC
</select>
<select id="getAllUserPageWhere" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser">
select u.* from
(SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
<bind name="usernameLike" value="'%' + query.nameOrPhone + '%'"/>
and nickname LIKE #{usernameLike}
</if>
union
SELECT user_id,nickname,phone,create_time,username FROM sys_user
where del_flag = '0' and lock_flag = '0'
<if test="query.nameOrPhone != null and query.nameOrPhone != ''">
and phone = #{query.nameOrPhone}
</if>
) u
ORDER BY u.create_time DESC
</select>
<select id="cspUserPage" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser">
select u.user_id,u.nickname,u.phone,u.create_time,u.username from sys_user u
LEFT JOIN sys_user_dept_permission p on u.user_id=p.user_id
where
1=1
<if test="nickName != null and nickName != ''">
and u.nickname LIKE CONCAT('%',#{nickName},'%')
</if>
<if test="userName != null and username != ''">
and u.username LIKE CONCAT('%',#{userName,'%')
</if>
<if test="null != deptId and deptId != ''">
p.dept_id in (
select d.dept_id from sys_dept d where d.ancestors like CONCAT("0","%",#{deptId},"%")
)
</if>
ORDER BY u.create_time DESC
</select>
</mapper> </mapper>
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