Merge remote-tracking branch 'ztcloud/main' into main-ztcloud
This commit is contained in:
@@ -36,4 +36,13 @@ public class DeptSaveReqDTO {
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "外部系统标识,用于建立编码映射", example = "ERP")
|
||||
private String externalSystemCode;
|
||||
|
||||
@Schema(description = "外部系统组织编码,用于建立映射", example = "ERP-001")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "外部系统组织名称", example = "ERP总部")
|
||||
private String externalDeptName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 集成接口公用的请求字段(API 专用,不依赖 VO)。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "配置的 iWork 凭证 appId;为空时使用默认凭证", example = "iwork-app")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "iWork 操作人用户编号", example = "1")
|
||||
private String operatorUserId;
|
||||
|
||||
@Schema(description = "是否强制刷新 token", example = "false")
|
||||
private Boolean forceRefreshToken;
|
||||
}
|
||||
@@ -1,21 +1,60 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* iWork 操作结果响应 DTO
|
||||
* iWork 操作结果响应 DTO(结构对齐 VO,独立定义)。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkOperationRespDTO {
|
||||
|
||||
@Schema(description = "是否成功")
|
||||
@Schema(description = "iWork 返回的原始数据结构")
|
||||
private Payload payload;
|
||||
|
||||
@Schema(description = "是否判断为成功")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "iWork 返回的操作编号或实例编号")
|
||||
private String operationId;
|
||||
|
||||
@Schema(description = "提示信息")
|
||||
@Schema(description = "返回提示信息")
|
||||
private String message;
|
||||
|
||||
@Data
|
||||
public static class Payload {
|
||||
|
||||
@Schema(description = "iWork 返回的业务状态码,例如 SUCCESS")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "iWork 返回的数据体")
|
||||
private PayloadData data;
|
||||
|
||||
@Schema(description = "错误信息对象,通常为空对象")
|
||||
private Map<String, Object> errMsg;
|
||||
|
||||
@Schema(description = "返回失败时的详细信息")
|
||||
private ReqFailMsg reqFailMsg;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class PayloadData {
|
||||
|
||||
@Schema(description = "iWork 生成的请求编号 requestid")
|
||||
@JsonProperty("requestid")
|
||||
private Long requestId;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ReqFailMsg {
|
||||
|
||||
@Schema(description = "失败时的关键参数集合")
|
||||
private Map<String, Object> keyParameters;
|
||||
|
||||
@Schema(description = "失败消息对象")
|
||||
private Map<String, Object> msgInfo;
|
||||
|
||||
@Schema(description = "其他附加参数,例如 doAutoApprove")
|
||||
private Map<String, Object> otherParams;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 发起 iWork 流程请求 DTO
|
||||
@@ -9,7 +10,8 @@ import lombok.Data;
|
||||
* 与 IWorkWorkflowCreateReqVO 字段一一对应,便于 Feign 调用。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkWorkflowCreateReqDTO {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class IWorkWorkflowCreateReqDTO extends IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "用印申请人(iWork 人员 ID)", example = "1001")
|
||||
private String jbr;
|
||||
|
||||
@@ -2,20 +2,27 @@ package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作废 / 干预 iWork 流程请求 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkWorkflowVoidReqDTO {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class IWorkWorkflowVoidReqDTO extends IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "iWork 实例编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String instanceId;
|
||||
|
||||
@Schema(description = "操作人 iWork 用户编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String operatorUserId;
|
||||
@Schema(description = "流程请求编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "REQ-001")
|
||||
private String requestId;
|
||||
|
||||
@Schema(description = "作废原因")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "额外参数")
|
||||
private Map<String, Object> extraParams;
|
||||
|
||||
@Schema(description = "额外 Form 数据")
|
||||
private Map<String, String> formExtras;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.zt.plat.module.system.api.sms;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.log.SmsLogRespDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@@ -25,4 +28,8 @@ public interface SmsSendApi {
|
||||
@Operation(summary = "发送单条短信给 Member 用户", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToMember(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/log/get")
|
||||
@Operation(summary = "根据日志编号查询短信状态")
|
||||
CommonResult<SmsLogRespDTO> getSmsLog(@RequestParam("id") Long id);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "RPC 服务 - 短信日志返回 DTO")
|
||||
public class SmsLogRespDTO {
|
||||
|
||||
@Schema(description = "日志编号", example = "123")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "短信渠道编码", example = "HL95")
|
||||
private String channelCode;
|
||||
|
||||
@Schema(description = "模板编码", example = "HL95_TEST")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "短信类型")
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
private String templateContent;
|
||||
|
||||
@Schema(description = "模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
@Schema(description = "短信 API 模板编号")
|
||||
private String apiTemplateId;
|
||||
|
||||
@Schema(description = "手机号", example = "13800138000")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户类型")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "发送状态")
|
||||
private Integer sendStatus;
|
||||
|
||||
@Schema(description = "发送时间")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Schema(description = "发送结果编码")
|
||||
private String apiSendCode;
|
||||
|
||||
@Schema(description = "发送结果信息")
|
||||
private String apiSendMsg;
|
||||
|
||||
@Schema(description = "发送请求ID")
|
||||
private String apiRequestId;
|
||||
|
||||
@Schema(description = "发送序列号")
|
||||
private String apiSerialNo;
|
||||
|
||||
@Schema(description = "接收状态")
|
||||
private Integer receiveStatus;
|
||||
|
||||
@Schema(description = "接收时间")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
@Schema(description = "接收结果编码")
|
||||
private String apiReceiveCode;
|
||||
|
||||
@Schema(description = "接收结果信息")
|
||||
private String apiReceiveMsg;
|
||||
|
||||
}
|
||||
@@ -23,4 +23,6 @@ public interface DictTypeConstants {
|
||||
String SMS_SEND_STATUS = "system_sms_send_status"; // 短信发送状态
|
||||
String SMS_RECEIVE_STATUS = "system_sms_receive_status"; // 短信接收状态
|
||||
|
||||
String DEPT_EXTERNAL_SYSTEM = "system_dept_external_system"; // 部门外部系统标识
|
||||
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode SMS_CHANNEL_NOT_EXISTS = new ErrorCode(1_002_011_000, "短信渠道不存在");
|
||||
ErrorCode SMS_CHANNEL_DISABLE = new ErrorCode(1_002_011_001, "短信渠道不处于开启状态,不允许选择");
|
||||
ErrorCode SMS_CHANNEL_HAS_CHILDREN = new ErrorCode(1_002_011_002, "无法删除,该短信渠道还有短信模板");
|
||||
ErrorCode SMS_CHANNEL_BALANCE_UNSUPPORTED = new ErrorCode(1_002_011_003, "该短信渠道不支持余额查询");
|
||||
|
||||
// ========== 短信模板 1-002-012-000 ==========
|
||||
ErrorCode SMS_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_012_000, "短信模板不存在");
|
||||
@@ -120,6 +121,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode SMS_SEND_MOBILE_NOT_EXISTS = new ErrorCode(1_002_013_000, "手机号不存在");
|
||||
ErrorCode SMS_SEND_MOBILE_TEMPLATE_PARAM_MISS = new ErrorCode(1_002_013_001, "模板参数({})缺失");
|
||||
ErrorCode SMS_SEND_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_013_002, "短信模板不存在");
|
||||
ErrorCode SMS_CALLBACK_SIGN_INVALID = new ErrorCode(1_002_013_100, "短信回调签名校验失败");
|
||||
|
||||
// ========== 短信验证码 1-002-014-000 ==========
|
||||
ErrorCode SMS_CODE_NOT_FOUND = new ErrorCode(1_002_014_000, "验证码不存在");
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.system.enums.dept;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 外部系统 / 平台枚举
|
||||
* <p>
|
||||
* 与字典类型 {@code system_dept_external_system} 对应,用于声明常用的平台标识,便于代码与前端字典对齐。
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ExternalPlatformEnum {
|
||||
|
||||
ERP("ERP", "企业资源计划"),
|
||||
IWORK("IWORK", "iWork 同步");
|
||||
|
||||
private final String code;
|
||||
private final String label;
|
||||
|
||||
public static boolean isValid(String code) {
|
||||
if (code == null) {
|
||||
return false;
|
||||
}
|
||||
for (ExternalPlatformEnum item : values()) {
|
||||
if (item.code.equalsIgnoreCase(code.trim())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user