[+]增加部门推动消息功能

This commit is contained in:
maimaishu
2025-12-31 16:55:20 +08:00
parent e6fc24d3b1
commit 3573217507
9 changed files with 741 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 部门外部组织编码映射分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class EspPageReqVO extends PageParam {
@Schema(description = "部门编号", example = "1024")
private Long deptId;
@Schema(description = "外部系统标识", example = "ERP")
private String systemCode;
@Schema(description = "外部组织编码", example = "100200")
private String externalDeptCode;
@Schema(description = "状态", example = "0")
private Integer status;
}

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 部门外消息推送创建/修改 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class EspSaveRespVo extends DeptExternalCodeBaseVO {
@Schema(description = "映射编号", example = "1024")
private Long id;
@Schema(description = "所属部门名称", example = "技术部")
private String deptName;
@Schema(description = "所属部门编码", example = "DEPT_001")
private String deptCode;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "最后更新时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,58 @@
package com.zt.plat.module.system.dal.dataobject.dept;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zt.plat.framework.common.enums.CommonStatusEnum;
import com.zt.plat.framework.tenant.core.db.TenantBaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 部门推送消息 DO
*/
@TableName("system_dept_push_msg")
@KeySequence("system_dept_push_msg_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class DeptPushMsgDO extends TenantBaseDO {
/**
* 主键编号
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 本系统部门 ID
*/
private Long deptId;
/**
* 外部系统标识
*/
private String systemCode;
/**
* 外部系统组织编码
*/
private String externalDeptCode;
/**
* 外部系统组织名称
*/
private String externalDeptName;
/**
* 映射状态
* 枚举 {@link CommonStatusEnum}
*/
private Integer status;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,57 @@
package com.zt.plat.module.system.dal.mysql.dept;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspPageReqVO;
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspSaveRespVo;
import com.zt.plat.module.system.dal.dataobject.dept.DeptPushMsgDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 部门推送消息接口Mapper
*/
@Mapper
public interface EspMapper extends BaseMapperX<DeptPushMsgDO> {
/**
* 分页查询
* @param reqVO 消息推送VO
* @return PageResult
*/
default PageResult<DeptPushMsgDO> selectPage(EspPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DeptPushMsgDO>()
.eqIfPresent(DeptPushMsgDO::getDeptId,reqVO.getDeptId())
.eqIfPresent(DeptPushMsgDO::getSystemCode, reqVO.getSystemCode())
.likeIfPresent(DeptPushMsgDO::getExternalDeptCode, reqVO.getExternalDeptCode())
.eqIfPresent(DeptPushMsgDO::getStatus, reqVO.getStatus())
.orderByDesc(DeptPushMsgDO::getId));
}
default DeptPushMsgDO selectBySystemCodeAndDeptId(String systemCode, Long deptId) {
return selectOne(new LambdaQueryWrapperX<DeptPushMsgDO>()
.eq(DeptPushMsgDO::getSystemCode, systemCode)
.eq(DeptPushMsgDO::getDeptId, deptId));
}
default DeptPushMsgDO selectBySystemCodeAndExternalCode(String systemCode, String externalDeptCode) {
return selectOne(new LambdaQueryWrapperX<DeptPushMsgDO>()
.eq(DeptPushMsgDO::getSystemCode, systemCode)
.eq(DeptPushMsgDO::getExternalDeptCode, externalDeptCode));
}
default List<DeptPushMsgDO> selectListByDeptId(Long deptId) {
return selectList(DeptPushMsgDO::getDeptId, deptId);
}
default int deleteByDeptId(Long deptId) {
return delete(DeptPushMsgDO::getDeptId, deptId);
}
default List<DeptPushMsgDO> selectListBySystemCode(String systemCode) {
return selectList(DeptPushMsgDO::getSystemCode, systemCode);
}
}

View File

@@ -0,0 +1,79 @@
package com.zt.plat.module.system.service.dept;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspPageReqVO;
import com.zt.plat.module.system.controller.admin.dept.vo.depexternalcode.EspSaveRespVo;
import com.zt.plat.module.system.dal.dataobject.dept.DeptPushMsgDO;
import java.util.List;
/**
* 部门推送消息 Service 接口
*/
public interface IEspService {
/**
* 创建映射关系
* @param createReqVO 创建请求
* @return 新增记录编号
*/
Long createDeptPushMsg(EspSaveRespVo createReqVO);
/**
* 更新映射关系
* @param updateReqVO 更新请求
*/
void updateDeptPushMsg(EspSaveRespVo updateReqVO);
/**
* 删除映射关系
*
* @param id 记录编号
*/
void deleteDeptPushMsg(Long id);
/**
* 获取映射详情
*/
DeptPushMsgDO getDeptPushMsgDetails(Long id);
/**
* 分页查询映射
*/
PageResult<DeptPushMsgDO> getDeptExternalCodePage(EspPageReqVO reqVO);
/**
* 根据部门推送消息
*/
List<DeptPushMsgDO> getPushMsgByDeptId(Long deptId);
/**
* 根据部门与外部系统保存/更新映射(存在则更新,不存在则创建)
* @param deptId 本系统部门 ID
* @param systemCode 外部系统标识
* @param externalDeptCode 外部系统组织编码
* @param externalDeptName 外部系统组织名称(可选)
* @param status 状态,默认启用
* @return 映射记录 ID
*/
/* Long getDeptPushMsgDetails(Long deptId, String systemCode, String externalDeptCode, String externalDeptName,
Integer status);*/
/**
* 根据部门删除全部外部编码映射
*
* @param deptId 部门编号
*/
//void deleteDeptExternalCodesByDeptId(Long deptId);
/**
* 根据外部系统与外部组织编码查询映射
*/
//DeptExternalCodeDO getBySystemCodeAndExternalCode(String systemCode, String externalDeptCode);
/**
* 根据外部系统与部门编号查询映射
*/
//DeptExternalCodeDO getBySystemCodeAndDeptId(String systemCode, Long deptId);
}