feat:硬件设备分组
This commit is contained in:
1 parent
79be68e8dc
commit
7b05ba6711
19 files changed
+554
-157
No files matched your search
@@ -9,6 +9,7 @@ CREATE TABLE hard_manager
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
merchant_id bigint COMMENT '商户id',
|
||||
group_id bigint COMMENT '分组id',
|
||||
dept_id bigint COMMENT '商家部门id',
|
||||
name varchar(128) NOT NULL COMMENT '设备名',
|
||||
type char(10) NOT NULL COMMENT '设备类型',
|
||||
@@ -34,6 +35,26 @@ CREATE TABLE hard_manager
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='设备管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_group`;
|
||||
CREATE TABLE hard_group
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
dept_id bigint COMMENT '部门id',
|
||||
name varchar(128) NOT NULL COMMENT '分组名',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='设备分组管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_invoice
|
||||
-- ----------------------------
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardGroupDto extends HardGroupEntity {
|
||||
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.bsd.pjcloud.hard.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 设备分组
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-14 16:31:20
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_group")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "设备分组")
|
||||
public class HardGroupEntity extends Model<HardGroupEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 分组名
|
||||
*/
|
||||
@Schema(description="分组名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardGroupVo extends HardGroupEntity implements BaseDeptInterface {
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.bsd.pjcloud.hard.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardGroupDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardGroupService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备分组
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-14 16:31:20
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hard-group")
|
||||
@Tag(description = "hard-group", name = "设备分组管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardGroupController {
|
||||
|
||||
private final HardGroupService hardGroupService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardGroupDto dto) {
|
||||
return R.ok(hardGroupService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_view')")
|
||||
public R getHardGroupPage(@ParameterObject Page page, @ParameterObject HardGroupEntity hardGroup) {
|
||||
LambdaQueryWrapper<HardGroupEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(hardGroupService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(hardGroupService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增设备分组", description = "新增设备分组")
|
||||
@SysLog("新增设备分组")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_add')")
|
||||
public R save(@RequestBody HardGroupEntity hardGroup) {
|
||||
return R.ok(hardGroupService.save(hardGroup));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改设备分组", description = "修改设备分组")
|
||||
@SysLog("修改设备分组")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_edit')")
|
||||
public R updateById(@RequestBody HardGroupEntity hardGroup) {
|
||||
return R.ok(hardGroupService.updateById(hardGroup));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除设备分组", description = "通过id删除设备分组")
|
||||
@SysLog("通过id删除设备分组")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardGroupService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardGroup_export')")
|
||||
public List<HardGroupEntity> export(HardGroupEntity hardGroup, Long[] ids) {
|
||||
return hardGroupService.list(Wrappers.lambdaQuery(hardGroup).in(ArrayUtil.isNotEmpty(ids), HardGroupEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardGroupDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardGroupVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardGroupMapper extends PjcloudBaseMapper<HardGroupEntity> {
|
||||
|
||||
default Page<HardGroupVo> pageJoin(Page page, HardGroupDto dto) {
|
||||
MPJLambdaWrapper<HardGroupEntity> wrapper = new MPJLambdaWrapper<HardGroupEntity>()
|
||||
.like(HardGroupEntity::getName, dto.getName());
|
||||
return selectJoinPage(page, HardGroupVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<HardGroupVo> scopePageList(Page page, HardGroupDto dto) {
|
||||
LambdaQueryWrapper<HardGroupEntity> wrapper = new LambdaQueryWrapper<HardGroupEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardGroupEntity::getName, dto.getName());
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardGroupVo.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardGroupDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardGroupVo;
|
||||
|
||||
public interface HardGroupService extends IService<HardGroupEntity> {
|
||||
|
||||
Page<HardGroupVo> pageJoin(Page page, HardGroupDto dto);
|
||||
|
||||
Page<HardGroupVo> scopePageList(Page page, HardGroupDto dto);
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardGroupDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardGroupVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardManagerVo;
|
||||
import com.bsd.pjcloud.hard.mapper.HardGroupMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardGroupService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备分组
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-14 16:31:20
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class HardGroupServiceImpl extends ServiceImpl<HardGroupMapper, HardGroupEntity> implements HardGroupService {
|
||||
|
||||
private final RemoteDeptService deptService;
|
||||
|
||||
@Override
|
||||
public Page<HardGroupVo> pageJoin(Page page, HardGroupDto dto) {
|
||||
Page<HardGroupVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardGroupVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardGroupVo> scopePageList(Page page, HardGroupDto dto) {
|
||||
Page<HardGroupVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardGroupVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.HardGroupMapper">
|
||||
<resultMap id="hardGroupMap" type="com.bsd.pjcloud.hard.api.entity.HardGroupEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+1
-1
@@ -58,5 +58,5 @@ public interface RemoteMqttEventService {
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-face-change-msg")
|
||||
R<Boolean> sendFaceChangeMsg(@RequestParam List<Long> parentDeptList, @RequestParam Long userId);
|
||||
R<Boolean> sendFaceChangeMsg(@RequestParam List<Long> parentDeptList, @RequestParam Long userId, @RequestParam(required = false) Boolean isGlobalFace);
|
||||
}
|
||||
+2
@@ -8,4 +8,6 @@ public class HardCustomerMsg extends MqttHardBaseMsg {
|
||||
|
||||
private String userId;
|
||||
|
||||
private Boolean isGlobalFace;
|
||||
|
||||
}
|
||||
+4
-1
@@ -109,7 +109,7 @@ public class MqttEventController {
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/send-face-change-msg")
|
||||
public R<Boolean> sendFaceChangeMsg(@RequestParam List<Long> parentDeptList, @RequestParam Long userId) {
|
||||
public R<Boolean> sendFaceChangeMsg(@RequestParam List<Long> parentDeptList, @RequestParam Long userId, @RequestParam(required = false) Boolean isGlobalFace) {
|
||||
MqttBaseDto dto = new MqttBaseDto();
|
||||
MchManageVo mchDept = remoteMchService.getFirstMch(parentDeptList).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchDept)) {
|
||||
@@ -118,6 +118,9 @@ public class MqttEventController {
|
||||
dto.setAction(MqttActionEnum.FACE);
|
||||
HardCustomerMsg msg = new HardCustomerMsg();
|
||||
msg.setUserId(String.valueOf(userId));
|
||||
if (ObjectUtil.isNotEmpty(isGlobalFace)) {
|
||||
msg.setIsGlobalFace(isGlobalFace);
|
||||
}
|
||||
dto.setData(msg);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
|
||||
+2
@@ -14,4 +14,6 @@ public class SysUserFaceDto extends SysUserFaceEntity {
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private String isGlobalFace;
|
||||
|
||||
}
|
||||
+153
-150
@@ -44,186 +44,189 @@ import java.time.LocalDateTime;
|
||||
@Schema(description = "用户")
|
||||
public class SysUser extends Model<SysUser> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "user_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "user_id", type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0-正常,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
/**
|
||||
* 0-正常,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
/**
|
||||
* 密码过期标记
|
||||
*/
|
||||
@Schema(description = "密码过期标记")
|
||||
private String passwordExpireFlag;
|
||||
/**
|
||||
* 密码过期标记
|
||||
*/
|
||||
@Schema(description = "密码过期标记")
|
||||
private String passwordExpireFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 密码修改时间
|
||||
*/
|
||||
@Schema(description = "密码修改时间")
|
||||
private LocalDateTime passwordModifyTime;
|
||||
/**
|
||||
* 密码修改时间
|
||||
*/
|
||||
@Schema(description = "密码修改时间")
|
||||
private LocalDateTime passwordModifyTime;
|
||||
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("手机号")
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "用户所属部门id")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "用户所属部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "用户所属租户id")
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "用户所属租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@Schema(description = "微信openid")
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
@Schema(description = "微信openid")
|
||||
private String wxOpenid;
|
||||
|
||||
/**
|
||||
* 企微微信 userid
|
||||
*/
|
||||
@Schema(description = "企微微信 userid")
|
||||
private String wxCpUserid;
|
||||
/**
|
||||
* 企微微信 userid
|
||||
*/
|
||||
@Schema(description = "企微微信 userid")
|
||||
private String wxCpUserid;
|
||||
|
||||
/**
|
||||
* 钉钉 userid
|
||||
*/
|
||||
@Schema(description = "钉钉 userid")
|
||||
private String wxDingUserid;
|
||||
/**
|
||||
* 钉钉 userid
|
||||
*/
|
||||
@Schema(description = "钉钉 userid")
|
||||
private String wxDingUserid;
|
||||
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
@Schema(description = "微信小程序openid")
|
||||
private String miniOpenid;
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
@Schema(description = "微信小程序openid")
|
||||
private String miniOpenid;
|
||||
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@Schema(description = "QQ openid")
|
||||
private String qqOpenid;
|
||||
/**
|
||||
* QQ openid
|
||||
*/
|
||||
@Schema(description = "QQ openid")
|
||||
private String qqOpenid;
|
||||
|
||||
/**
|
||||
* 码云唯一标识
|
||||
*/
|
||||
@Schema(description = "码云唯一标识")
|
||||
private String giteeLogin;
|
||||
/**
|
||||
* 码云唯一标识
|
||||
*/
|
||||
@Schema(description = "码云唯一标识")
|
||||
private String giteeLogin;
|
||||
|
||||
/**
|
||||
* 开源中国唯一标识
|
||||
*/
|
||||
@Schema(description = "开源中国唯一标识")
|
||||
private String oscId;
|
||||
/**
|
||||
* 开源中国唯一标识
|
||||
*/
|
||||
@Schema(description = "开源中国唯一标识")
|
||||
private String oscId;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("邮箱")
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@DiffInclude
|
||||
@PropertyName("邮箱")
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* 员工浙政钉编码
|
||||
*/
|
||||
@Schema(description="员工浙政钉编码")
|
||||
private String dingtalkEmployeeCode;
|
||||
/**
|
||||
* 员工浙政钉编码
|
||||
*/
|
||||
@Schema(description = "员工浙政钉编码")
|
||||
private String dingtalkEmployeeCode;
|
||||
|
||||
|
||||
@Schema(description="员工所属系统类型")
|
||||
private String systemType;
|
||||
@Schema(description = "员工所属系统类型")
|
||||
private String systemType;
|
||||
|
||||
@Schema(description = "是否为全局人脸")
|
||||
private String isGlobalFace;
|
||||
}
|
||||
@@ -205,6 +205,13 @@ public class UserVO implements BaseFacesInterface, Serializable {
|
||||
/**
|
||||
* 人脸
|
||||
*/
|
||||
@Schema(description = "人脸")
|
||||
private String faceImgs;
|
||||
|
||||
/**
|
||||
* 是否为全局人脸
|
||||
*/
|
||||
@Schema(description = "是否为全局人脸")
|
||||
private String isGlobalFace;
|
||||
|
||||
}
|
||||
+7
@@ -93,6 +93,13 @@ public class SysUserFaceController {
|
||||
}
|
||||
/* ************************************* start android start ************************************* */
|
||||
|
||||
@Operation(summary = "设置为全局人脸", description = "设置为全局人脸")
|
||||
@PostMapping("/global-face")
|
||||
@SysLog("设置为全局人脸")
|
||||
public R editGlobalFace(@RequestBody SysUserFaceDto dto) {
|
||||
return R.ok(sysUserFaceService.editGlobalFace(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@pms.hasPermission('userFace_sysUserFace_view')")
|
||||
|
||||
+2
@@ -14,6 +14,8 @@ public interface SysUserFaceService extends IService<SysUserFaceEntity> {
|
||||
|
||||
void edit(SysUserFaceEntity sysUserFace);
|
||||
|
||||
Boolean editGlobalFace(SysUserFaceDto dto);
|
||||
|
||||
void delByIds(ArrayList<Long> list);
|
||||
|
||||
Page<SysUserFaceVo> scopePageList(Page page, SysUserFaceDto dto);
|
||||
|
||||
+19
-5
@@ -13,6 +13,7 @@ import com.bsd.pjcloud.admin.mapper.SysUserFaceMapper;
|
||||
import com.bsd.pjcloud.admin.service.SysDeptService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserFaceService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserService;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.exception.CheckedException;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.mqtt.api.feign.RemoteMqttEventService;
|
||||
@@ -52,7 +53,7 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
updateObj.setAutoCode(String.valueOf(count));
|
||||
baseMapper.updateById(updateObj);
|
||||
// 发送mq
|
||||
sendFaceMq(List.of(sysUserFace.getUserId()));
|
||||
sendFaceMq(List.of(sysUserFace.getUserId()), null);
|
||||
return sysUserFace.getId();
|
||||
}
|
||||
|
||||
@@ -64,7 +65,20 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
}
|
||||
baseMapper.selectById(userFace.getUserId());
|
||||
// 发送mq
|
||||
sendFaceMq(List.of(sysUserFace.getUserId()));
|
||||
sendFaceMq(List.of(sysUserFace.getUserId()), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean editGlobalFace(SysUserFaceDto dto) {
|
||||
SysUser user = sysUserService.getById(dto.getUserId());
|
||||
if (ObjectUtil.isEmpty(user)) throw new RuntimeException("用户不存在");
|
||||
SysUser updateObj = new SysUser();
|
||||
updateObj.setUserId(dto.getUserId());
|
||||
updateObj.setIsGlobalFace(dto.getIsGlobalFace());
|
||||
sysUserService.updateById(updateObj);
|
||||
// 发送mq
|
||||
sendFaceMq(List.of(dto.getUserId()), ObjectUtil.equal(YesNoEnum.YES.getCode(), dto.getIsGlobalFace()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +89,7 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
.in(SysUserFaceEntity::getId, list)
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(faceList)) {
|
||||
sendFaceMq(faceList.stream().map(SysUserFaceEntity::getUserId).toList());
|
||||
sendFaceMq(faceList.stream().map(SysUserFaceEntity::getUserId).toList(), null);
|
||||
}
|
||||
baseMapper.deleteBatchIds(list);
|
||||
}
|
||||
@@ -103,7 +117,7 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
}
|
||||
|
||||
// 发送mq
|
||||
private void sendFaceMq(List<Long> userIds) {
|
||||
private void sendFaceMq(List<Long> userIds, Boolean isGlobalFace) {
|
||||
if (ObjectUtil.isEmpty(userIds)) return;
|
||||
List<SysUser> list = sysUserService.list(new LambdaQueryWrapper<SysUser>().in(SysUser::getUserId, userIds));
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
@@ -111,7 +125,7 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
List<SysDept> parentDeptList = sysDeptService.getParentDeptList(v.getDeptId());
|
||||
if (ObjectUtil.isEmpty(parentDeptList)) continue;
|
||||
List<Long> deptIds = parentDeptList.stream().map(SysDept::getDeptId).toList();
|
||||
remoteMqttEventService.sendFaceChangeMsg(deptIds, v.getUserId());
|
||||
remoteMqttEventService.sendFaceChangeMsg(deptIds, v.getUserId(), isGlobalFace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="is_global_face" property="isGlobalFace"/>
|
||||
<result column="dingtalk_employee_code" property="dingtalkEmployeeCode"/>
|
||||
<collection property="roleList" ofType="com.bsd.pjcloud.admin.api.entity.SysRole"
|
||||
select="com.bsd.pjcloud.admin.mapper.SysRoleMapper.listRolesByUserId" column="user_id">
|
||||
@@ -159,6 +160,7 @@
|
||||
u.nickname,
|
||||
u.name,
|
||||
u.email,
|
||||
u.is_global_face,
|
||||
d.name dept_name
|
||||
FROM
|
||||
sys_user u
|
||||
|
||||
Reference in new issue
Block a user