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

This commit is contained in:
maimaishu
2026-01-02 17:27:53 +08:00
parent 7bd44ffca9
commit 2e761d1867
8 changed files with 62 additions and 165 deletions

View File

@@ -13,7 +13,6 @@ import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;

View File

@@ -0,0 +1,25 @@
package com.zt.plat.module.system.api.esp;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
import com.zt.plat.module.system.api.esp.dto.EspDto;
import com.zt.plat.module.system.service.dept.IEspService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Validated
public class EspApiImpl implements EspApi {
@Resource
private IEspService deptService;
@Override
public CommonResult<List<EspDto>> pushMsg(DeptSaveReqDTO syncReqDTO)
{
return CommonResult.success(deptService.pushMsg(syncReqDTO));
}
}

View File

@@ -25,4 +25,7 @@ public class EspSaveRespVo extends DeptExternalCodeBaseVO {
@Schema(description = "最后更新时间")
private LocalDateTime updateTime;
@Schema(description = "是否发送消息")
private Integer isSendMsg;
}

View File

@@ -55,4 +55,9 @@ public class DeptPushMsgDO extends TenantBaseDO {
*/
private String remark;
/**
* 是否发送消息
*/
private Integer isSendMsg;
}

View File

@@ -3,10 +3,12 @@ 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.api.dept.dto.DeptSaveReqDTO;
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 org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 部门推送消息接口Mapper
@@ -54,4 +56,10 @@ public interface EspMapper extends BaseMapperX<DeptPushMsgDO> {
return selectList(DeptPushMsgDO::getSystemCode, systemCode);
}
@Select("SELECT ID,DEPT_ID, SYSTEM_CODE,EXTERNAL_DEPT_CODE,EXTERNAL_DEPT_NAME,STATUS,REMARK,TENANT_ID,CREATOR,CREATE_TIME,UPDATER,UPDATE_TIME\n" +
"FROM \n" +
"\t\tSYSTEM_DEPT_PUSH_MSG\n" +
"WHERE\n" +
" IS_SEND_MSG = '0' AND DELETED = '0' ")
List<DeptPushMsgDO> selectpushMsg(@Param("syncReqDTO") DeptSaveReqDTO syncReqDTO);
}

View File

@@ -1,10 +1,11 @@
package com.zt.plat.module.system.service.dept;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.system.api.dept.dto.DeptSaveReqDTO;
import com.zt.plat.module.system.api.esp.dto.EspDto;
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;
/**
@@ -27,7 +28,6 @@ public interface IEspService {
/**
* 删除映射关系
*
* @param id 记录编号
*/
void deleteDeptPushMsg(Long id);
@@ -47,33 +47,11 @@ public interface IEspService {
*/
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 部门编号
* 推送部门数据到外部系统
* @param syncReqDTO 同步请求
*/
//void deleteDeptExternalCodesByDeptId(Long deptId);
/**
* 根据外部系统与外部组织编码查询映射
*/
//DeptExternalCodeDO getBySystemCodeAndExternalCode(String systemCode, String externalDeptCode);
/**
* 根据外部系统与部门编号查询映射
*/
//DeptExternalCodeDO getBySystemCodeAndDeptId(String systemCode, Long deptId);
List<EspDto> pushMsg(DeptSaveReqDTO syncReqDTO);
}