diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java index c064174..4ddcfc7 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/MessagePushRecordDto.java @@ -22,4 +22,7 @@ public class MessagePushRecordDto extends MessagePushRecordEntity implements Ser @NotNull private List types; + @ApiModelProperty("创建人") + private Long createUser; + } diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java index 39bd263..c64316e 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/entity/MessagePushRecordEntity.java @@ -68,6 +68,9 @@ public class MessagePushRecordEntity extends MessageTemplateEntity { @ApiModelProperty(value = "内容") private String content; + @ApiModelProperty("阿里云短信模板参数") + private String smsParam; + @ApiModelProperty(value = "计划推送时间") @JsonFormat(pattern = DateUtil.PATTERN_DATETIME) @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) diff --git a/hzims-service/inspect/src/main/resources/db/1.0.0.sql b/hzims-service/inspect/src/main/resources/db/1.0.0.sql new file mode 100644 index 0000000..9053136 --- /dev/null +++ b/hzims-service/inspect/src/main/resources/db/1.0.0.sql @@ -0,0 +1,4 @@ +-- 巡检计划添加消息模板字段 +alter table `hz_st_re_plan` add column `message_template_id` bigint(20) comment '消息模板ID'; +-- 巡检任务添加消息模板字段 +alter table `hz_st_ex_task` add column `message_template_id` bigint(20) comment '消息模板ID'; \ No newline at end of file diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java index 3505e11..5869b26 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java @@ -18,6 +18,7 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; @@ -58,6 +59,10 @@ public class MessageClient extends BladeController implements IMessageClient{ request.getTypes().forEach(type -> { MessagePushRecordEntity entity = BeanUtil.copy(request,MessagePushRecordEntity.class); entity.setType(type); + if(Func.isEmpty(AuthUtil.getUserId())) { + entity.setCreateUser(request.getCreateUser()); + entity.setCreateDept(request.getCreateDept()); + } entity.setMessageId(messageId); recordService.saveAndSend(entity); }); diff --git a/hzims-service/message/src/main/resources/db/1.0.0.sql b/hzims-service/message/src/main/resources/db/1.0.0.sql index 9bee075..fb8dac5 100644 --- a/hzims-service/message/src/main/resources/db/1.0.0.sql +++ b/hzims-service/message/src/main/resources/db/1.0.0.sql @@ -25,7 +25,7 @@ SET FOREIGN_KEY_CHECKS = 1; CREATE TABLE IF NOT EXISTS `hzims_message_push_record` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `TASK_ID` bigint(20) NOT NULL COMMENT '消息类型', - `TEMPLATE_ID` bigint(20) NOT NULL COMMENT '消息模板ID', + `TEMPLATE_ID` bigint(20) COMMENT '消息模板ID', `PUSHER` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推送人', `PUSHER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '推送人名称', `CONTENT` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '内容', diff --git a/hzims-service/message/src/main/resources/db/1.0.1.sql b/hzims-service/message/src/main/resources/db/1.0.1.sql index 308434e..39833ff 100644 --- a/hzims-service/message/src/main/resources/db/1.0.1.sql +++ b/hzims-service/message/src/main/resources/db/1.0.1.sql @@ -1,4 +1,6 @@ -- 添加消息ID alter table hzims_message_push_record add COLUMN `MESSAGE_ID` bigint(20) DEFAULT NULL comment '消息ID'; -- 添加消息推送类型 -alter table hzims_message_push_record add COLUMN `PUSH_TYPE` VARCHAR(2) DEFAULT NULL comment '推送类型,0:即时推送,1:计划推送'; \ No newline at end of file +alter table hzims_message_push_record add COLUMN `PUSH_TYPE` VARCHAR(2) DEFAULT NULL comment '推送类型,0:即时推送,1:计划推送'; +-- 添加短信推送参数 +alter table `hzims_message_push_record` add COLUMN `SMS_PARAM` VARCHAR(255) COMMENT '阿里云短信模板参数';