Merge remote-tracking branch 'ztcloud/test' into dev
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.system.api.push;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.service.push.ExternalPushConfigService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 外部系统推送配置 Feign API 实现类
|
||||
*
|
||||
* @author ZT Cloud
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class ExternalPushConfigApiImpl implements ExternalPushConfigApi {
|
||||
|
||||
@Resource
|
||||
private ExternalPushConfigService externalPushConfigService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> isPushEnabled(Long companyId, Long deptId, String businessType, String externalSystem) {
|
||||
Boolean result = externalPushConfigService.isPushEnabled(companyId, deptId, businessType, externalSystem);
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.system.controller.admin.integration.iwork.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.zt.plat.module.system.enums.integration.IWorkSyncEntityTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Max;
|
||||
@@ -42,6 +43,66 @@ public class IWorkFullSyncReqVO {
|
||||
@Schema(description = "是否允许更新已存在的本地实体", example = "false")
|
||||
private Boolean allowUpdate = Boolean.FALSE;
|
||||
|
||||
@JsonProperty("departmentcode")
|
||||
@Schema(description = "部门编号")
|
||||
private String departmentCode;
|
||||
|
||||
@JsonProperty("departmentname")
|
||||
@Schema(description = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@JsonProperty("subcompanycode")
|
||||
@Schema(description = "分部编号")
|
||||
private String subcompanyCode;
|
||||
|
||||
@JsonProperty("subcompanyname")
|
||||
@Schema(description = "分部名称")
|
||||
private String subcompanyName;
|
||||
|
||||
@JsonProperty("subcompanyid1")
|
||||
@Schema(description = "分部 ID")
|
||||
private String subcompanyId1;
|
||||
|
||||
@JsonProperty("jobtitlename")
|
||||
@Schema(description = "岗位名称")
|
||||
private String jobTitleName;
|
||||
|
||||
@JsonProperty("workcode")
|
||||
@Schema(description = "人员编号")
|
||||
private String workCode;
|
||||
|
||||
@JsonProperty("loginid")
|
||||
@Schema(description = "登录名")
|
||||
private String loginId;
|
||||
|
||||
@JsonProperty("created")
|
||||
@Schema(description = "创建时间戳(>=)")
|
||||
private String created;
|
||||
|
||||
@JsonProperty("modified")
|
||||
@Schema(description = "修改时间戳(>=)")
|
||||
private String modified;
|
||||
|
||||
@JsonProperty("canceled")
|
||||
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||
private String canceled;
|
||||
|
||||
@JsonProperty("custom_data")
|
||||
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||
private String customData;
|
||||
|
||||
@JsonProperty("base_custom_data")
|
||||
@Schema(description = "基本信息自定义字段列表(逗号分隔)")
|
||||
private String baseCustomData;
|
||||
|
||||
@JsonProperty("person_custom_data")
|
||||
@Schema(description = "个人信息自定义字段列表(逗号分隔)")
|
||||
private String personCustomData;
|
||||
|
||||
@JsonProperty("work_custom_data")
|
||||
@Schema(description = "工作信息自定义字段列表(逗号分隔)")
|
||||
private String workCustomData;
|
||||
|
||||
public Set<IWorkSyncEntityTypeEnum> resolveScopes() {
|
||||
EnumSet<IWorkSyncEntityTypeEnum> defaults = EnumSet.allOf(IWorkSyncEntityTypeEnum.class);
|
||||
if (scopes == null || scopes.isEmpty()) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
package com.zt.plat.module.system.controller.admin.push.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Schema(description = "管理后台 - 业务类型 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusinessTypeRespVO {
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "编码", example = "PURCHASE")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "采购")
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.system.controller.admin.push.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 外部系统推送配置基础信息")
|
||||
@Data
|
||||
public class ExternalPushConfigBaseVO {
|
||||
|
||||
@Schema(description = "公司编号(为空表示不限制公司)", example = "1024")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "部门编号(为空表示公司级配置)", example = "2048")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "业务类型(为空表示所有业务类型)", example = "PURCHASE")
|
||||
@Size(max = 32, message = "业务类型长度不能超过 32 个字符")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "外部系统标识(为空表示所有外部系统)", example = "ERP")
|
||||
@Size(max = 64, message = "外部系统标识长度不能超过 64 个字符")
|
||||
private String externalSystem;
|
||||
|
||||
@Schema(description = "是否启用推送", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
@NotNull(message = "推送开关不能为空")
|
||||
private Boolean enablePush;
|
||||
|
||||
@Schema(description = "备注", example = "ERP 采购单推送配置")
|
||||
@Size(max = 512, message = "备注长度不能超过 512 个字符")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zt.plat.module.system.controller.admin.push.vo;
|
||||
|
||||
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 ExternalPushConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "公司编号", example = "1024")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "部门编号", example = "2048")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "业务类型", example = "PURCHASE")
|
||||
private String businessType;
|
||||
|
||||
@Schema(description = "外部系统标识", example = "ERP")
|
||||
private String externalSystem;
|
||||
|
||||
@Schema(description = "是否启用推送", example = "true")
|
||||
private Boolean enablePush;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.system.controller.admin.push.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外部系统推送配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExternalPushConfigRespVO extends ExternalPushConfigBaseVO {
|
||||
|
||||
@Schema(description = "配置编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公司名称", example = "浙江中天建设集团")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "部门名称", example = "采购部")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zt.plat.module.system.controller.admin.push.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Schema(description = "管理后台 - 外部系统推送配置创建/修改 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExternalPushConfigSaveReqVO extends ExternalPushConfigBaseVO {
|
||||
|
||||
@Schema(description = "配置编号", example = "1024")
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.zt.plat.module.system.dal.dataobject.push;
|
||||
|
||||
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.tenant.core.db.TenantBaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 外部系统推送配置 DO
|
||||
*
|
||||
* 用于配置不同公司/部门/业务类型下的外部系统推送开关
|
||||
*
|
||||
* @author ZT Cloud
|
||||
*/
|
||||
@TableName("system_external_push_config")
|
||||
@KeySequence("system_external_push_config_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ExternalPushConfigDO extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司编号(可为空)
|
||||
*
|
||||
* 关联 system_dept 表,is_company = 1
|
||||
* 为空表示不限制公司
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 部门编号(可为空)
|
||||
*
|
||||
* 关联 system_dept 表,is_company = 0
|
||||
* 为空表示公司级配置
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 业务类型(可为空)
|
||||
*
|
||||
* 枚举值:PURCHASE, SALE, PRODUCTION
|
||||
* 为空表示所有业务类型
|
||||
* 枚举 {@link com.zt.plat.module.system.enums.push.BusinessTypeEnum}
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 外部系统标识(可为空)
|
||||
*
|
||||
* 如:ERP, IWORK
|
||||
* 为空表示所有外部系统
|
||||
* 枚举 {@link com.zt.plat.module.system.enums.dept.ExternalPlatformEnum}
|
||||
*/
|
||||
private String externalSystem;
|
||||
|
||||
/**
|
||||
* 是否启用推送
|
||||
*
|
||||
* true:启用推送
|
||||
* false:停用推送
|
||||
*/
|
||||
private Boolean enablePush;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.system.dal.mysql.push;
|
||||
|
||||
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.push.vo.ExternalPushConfigPageReqVO;
|
||||
import com.zt.plat.module.system.dal.dataobject.push.ExternalPushConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 外部系统推送配置 Mapper
|
||||
*
|
||||
* @author ZT Cloud
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExternalPushConfigMapper extends BaseMapperX<ExternalPushConfigDO> {
|
||||
|
||||
default PageResult<ExternalPushConfigDO> selectPage(ExternalPushConfigPageReqVO reqVO) {
|
||||
LambdaQueryWrapperX<ExternalPushConfigDO> wrapper = new LambdaQueryWrapperX<ExternalPushConfigDO>()
|
||||
.eqIfPresent(ExternalPushConfigDO::getCompanyId, reqVO.getCompanyId())
|
||||
.eqIfPresent(ExternalPushConfigDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(ExternalPushConfigDO::getExternalSystem, reqVO.getExternalSystem())
|
||||
.eqIfPresent(ExternalPushConfigDO::getEnablePush, reqVO.getEnablePush());
|
||||
|
||||
// 如果传了 companyId 但没传 deptId,则只查公司级配置(dept_id IS NULL)
|
||||
if (reqVO.getCompanyId() != null && reqVO.getDeptId() == null) {
|
||||
wrapper.isNull(ExternalPushConfigDO::getDeptId);
|
||||
} else if (reqVO.getDeptId() != null) {
|
||||
// 如果传了 deptId,则查指定部门的配置
|
||||
wrapper.eq(ExternalPushConfigDO::getDeptId, reqVO.getDeptId());
|
||||
}
|
||||
// 如果都没传,则查所有配置
|
||||
|
||||
wrapper.orderByDesc(ExternalPushConfigDO::getId);
|
||||
return selectPage(reqVO, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用查询配置方法
|
||||
*
|
||||
* @param companyId 公司ID(null 表示查询 company_id IS NULL 的记录)
|
||||
* @param deptId 部门ID(null 表示查询 dept_id IS NULL 的记录)
|
||||
* @param businessType 业务类型(null 表示查询 business_type IS NULL 的记录)
|
||||
* @param externalSystem 外部系统(null 表示查询 external_system IS NULL 的记录)
|
||||
* @return 配置对象
|
||||
*/
|
||||
default ExternalPushConfigDO selectByConfig(Long companyId, Long deptId, String businessType, String externalSystem) {
|
||||
LambdaQueryWrapperX<ExternalPushConfigDO> wrapper = new LambdaQueryWrapperX<>();
|
||||
|
||||
if (companyId == null) {
|
||||
wrapper.isNull(ExternalPushConfigDO::getCompanyId);
|
||||
} else {
|
||||
wrapper.eq(ExternalPushConfigDO::getCompanyId, companyId);
|
||||
}
|
||||
|
||||
if (deptId == null) {
|
||||
wrapper.isNull(ExternalPushConfigDO::getDeptId);
|
||||
} else {
|
||||
wrapper.eq(ExternalPushConfigDO::getDeptId, deptId);
|
||||
}
|
||||
|
||||
if (businessType == null) {
|
||||
wrapper.isNull(ExternalPushConfigDO::getBusinessType);
|
||||
} else {
|
||||
wrapper.eq(ExternalPushConfigDO::getBusinessType, businessType);
|
||||
}
|
||||
|
||||
if (externalSystem == null) {
|
||||
wrapper.isNull(ExternalPushConfigDO::getExternalSystem);
|
||||
} else {
|
||||
wrapper.eq(ExternalPushConfigDO::getExternalSystem, externalSystem);
|
||||
}
|
||||
|
||||
return selectOne(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司下所有配置
|
||||
*/
|
||||
default List<ExternalPushConfigDO> selectListByCompanyId(Long companyId) {
|
||||
return selectList(ExternalPushConfigDO::getCompanyId, companyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门下所有配置
|
||||
*/
|
||||
default List<ExternalPushConfigDO> selectListByDeptId(Long deptId) {
|
||||
return selectList(ExternalPushConfigDO::getDeptId, deptId);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user