فهرست منبع

[Feature] Message Send Interface: Update Message Sending Interface

AA 11 ماه پیش
والد
کامیت
9612a24bb9

+ 5 - 3
src/main/java/com/dragon/tj/portal/auth/module/hmac/HmacAuthenticationFilter.java

@@ -17,6 +17,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.UUID;
 
 public class HmacAuthenticationFilter extends AbstractAuthenticationProcessingFilter {
     private static final Logger LOGGER = LoggerFactory.getLogger(HmacAuthenticationFilter.class);
@@ -57,7 +58,7 @@ public class HmacAuthenticationFilter extends AbstractAuthenticationProcessingFi
 
         String appSecret;
         try {
-            appSecret = jdbcTemplate.queryForObject("select app_secret from app_info where app_key = ?",
+            appSecret = jdbcTemplate.queryForObject("select app_secret from app_info where system_number = ?",
                     String.class, appKey);
         } catch (Exception e) {
             throw new BadCredentialsException("查询应用出错,appKey: " + appKey, e);
@@ -89,10 +90,11 @@ public class HmacAuthenticationFilter extends AbstractAuthenticationProcessingFi
     }
 
     public static void main(String[] args) {
+        System.out.println(UUID.randomUUID().toString().replace("-", ""));
         long l = System.currentTimeMillis();
         System.out.println("timestamp: " + l);
-        String appSecret = "c5f9de99eb3641a98ac49b9d743dab4d";
-        String signPayload = String.format("%s:%s:%s", "cfaf75fe4cc945f789bc6518354ded53", l, "123455");
+        String appSecret = "ae14ac8a78104a4392920636c40335ca";
+        String signPayload = String.format("%s:%s:%s", "xxdj05", l, "412710e34fee4c8ba29a210462be8e6b");
         System.out.println(new HmacUtils(HmacAlgorithms.HMAC_SHA_256, appSecret).hmacHex(signPayload));
     }
 }

+ 9 - 18
src/main/java/com/dragon/tj/portal/common/dto/notice/NoticeInfoReq.java

@@ -17,9 +17,8 @@ import javax.validation.constraints.NotNull;
 public class NoticeInfoReq {
 
     /**
-     * 范围id 为appCode
+     * 应用系统编号
      */
-    @NotBlank(message = "应用编码不能为空")
     private String scopeId;
 
     @NotBlank(message = "应用url不能为空")
@@ -54,27 +53,19 @@ public class NoticeInfoReq {
      */
     private String attachmentPath;
 
-    @NotNull(message = "毫秒时间戳 不能为空")
-    private Long t;
-
     /**
      * 推送人的信息
      */
-    @NotBlank(message = "推送人id 不能为空")
-    private String clientId;
+    @NotBlank(message = "推送人身份证号 不能为空")
+    private String createIdCard;
 
-    @NotBlank(message = "推送人组织code 不能为空")
-    private String clientOrgCode;
+    @NotBlank(message = "推送人姓名 不能为空")
+    private String createUserName;
 
-    @NotBlank(message = "推送人组织名称 不能为空")
-    private String clientOrgName;
+    @NotBlank(message = "推送人部门编码 不能为空")
+    private String createOrgCode;
 
-    @NotBlank(message = "推送人名称 不能为空")
-    private String clientName;
-    /**
-     * md5 (登录人标识+t)
-     */
-    @NotBlank(message = "调用者身份验证标识 不能为空")
-    private String k;
+    @NotBlank(message = "推送人部门名称 不能为空")
+    private String createOrgName;
 
 }

+ 7 - 0
src/main/java/com/dragon/tj/portal/controller/AppController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -86,6 +87,12 @@ public class AppController {
         return R.ok(appService.add(appInfo, loginUser));
     }
 
+    @SysLog(value = "重置密钥", module = ModuleEnum.APP_UPDATE)
+    @GetMapping("resetSecret")
+    public R resetSecret(@RequestParam Long id) {
+        return R.ok(appService.resetSecret(id));
+    }
+
     @SysLog(value = "应用删除", module = ModuleEnum.APP_DELETE)
     @GetMapping("delete/{id}")
     public R delete(@PathVariable("id") Long id) {

+ 0 - 85
src/main/java/com/dragon/tj/portal/controller/MessageCenterController.java

@@ -1,85 +0,0 @@
-package com.dragon.tj.portal.controller;
-
-
-import com.alibaba.fastjson.JSON;
-import com.dragon.tj.portal.auth.model.LoginUser;
-import com.dragon.tj.portal.auth.util.SecurityUtils;
-import com.dragon.tj.portal.common.base.R;
-import com.dragon.tj.portal.common.dto.message.MessageInfoReq;
-import com.dragon.tj.portal.common.dto.notice.NoticeInfoReq;
-import com.dragon.tj.portal.component.message.MessageProducer;
-import com.dragon.tj.portal.component.page.KafkaUtil;
-import com.dragon.tj.portal.service.MessageInfoService;
-import com.dragon.tj.portal.service.NoticeInfoService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.concurrent.ExecutionException;
-
-/**
- * <p>
- * 消息对接
- * </p>
- *
- * @author huey
- * @since 2023-06-15
- */
-@Slf4j
-@RestController
-@RequestMapping("/api/message")
-public class MessageCenterController {
-
-    @Autowired
-    private MessageInfoService messageInfoService;
-
-    @Autowired
-    private NoticeInfoService noticeInfoService;
-
-    /**
-     * @author huey China.
-     * @Description : 信息发送
-     * @Date Created in 2023/7/11 15:14
-     */
-    @PostMapping("/publish")
-    public R publish(@Validated @RequestBody MessageInfoReq messageInfoReq) {
-        LoginUser loginUser = SecurityUtils.getLoginUser();
-        log.info("api/message/publish-req-is {}-{}", JSON.toJSONString(loginUser), JSON.toJSONString(messageInfoReq));
-        return messageInfoService.push(messageInfoReq, loginUser);
-    }
-
-    /**
-     * @author huey China.
-     * @Description : 消息提醒发送
-     * @Date Created in 2023/7/11 16:12
-     */
-    @PostMapping("/send")
-    public R send(@Validated @RequestBody NoticeInfoReq noticeInfoReq) {
-        log.info("api/message/send-req-is {}", JSON.toJSONString(noticeInfoReq));
-        return noticeInfoService.send(noticeInfoReq);
-    }
-
-    @Autowired
-    private KafkaUtil kafkaUtil;
-
-    @GetMapping("/createTopic")
-    public R createTopic(@RequestParam String appId,@RequestParam String topic) throws ExecutionException, InterruptedException {
-        kafkaUtil.create(topic);
-
-        return R.ok();
-    }
-
-    /**
-    * @author huey China.
-    * @Description : 获取信息和消息的待办和已办的个数
-    * @Date Created in 2023/7/21 15:29
-    */
-    @GetMapping("/getCount")
-    public R getCount() {
-        return R.ok(messageInfoService.getCount());
-    }
-
-
-}
-

+ 25 - 3
src/main/java/com/dragon/tj/portal/controller/MessageInfoController.java

@@ -1,9 +1,12 @@
 package com.dragon.tj.portal.controller;
 
-
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dragon.tj.portal.auth.model.LoginUser;
+import com.dragon.tj.portal.auth.util.SecurityUtils;
 import com.dragon.tj.portal.common.base.R;
+import com.dragon.tj.portal.common.dto.message.MessageInfoReq;
 import com.dragon.tj.portal.common.enums.log.ModuleEnum;
 import com.dragon.tj.portal.common.vo.message.ContactMemberVO;
 import com.dragon.tj.portal.common.vo.message.MessageInfoParam;
@@ -11,9 +14,15 @@ import com.dragon.tj.portal.common.vo.message.MessageInfoVO;
 import com.dragon.tj.portal.common.vo.message.MessagePageParam;
 import com.dragon.tj.portal.component.log.annotation.SysLog;
 import com.dragon.tj.portal.service.MessageInfoService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -25,6 +34,7 @@ import java.util.List;
  * @author huey
  * @since 2023-06-15
  */
+@Slf4j
 @RestController
 @RequestMapping("/messageInfo")
 public class MessageInfoController {
@@ -32,6 +42,13 @@ public class MessageInfoController {
     @Autowired
     private MessageInfoService messageInfoService;
 
+    @PostMapping("/publish")
+    public R publish(@Validated @RequestBody MessageInfoReq messageInfoReq) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        log.info("api/message/publish-req-is {}-{}", JSON.toJSONString(loginUser), JSON.toJSONString(messageInfoReq));
+        return messageInfoService.push(messageInfoReq, loginUser);
+    }
+
     /**
      * 分页查询
      *
@@ -80,9 +97,14 @@ public class MessageInfoController {
     }
 
     @GetMapping("contacts")
-    public R getContactsMemberList(@RequestParam(value = "limit",defaultValue = "10") Integer limit) {
+    public R getContactsMemberList(@RequestParam(value = "limit", defaultValue = "10") Integer limit) {
         List<ContactMemberVO> list = messageInfoService.getContactsMemberList(limit);
         return R.ok(list);
     }
+
+    @GetMapping("/getCount")
+    public R getCount() {
+        return R.ok(messageInfoService.getCount());
+    }
 }
 

+ 5 - 2
src/main/java/com/dragon/tj/portal/controller/NoticeInfoController.java

@@ -1,6 +1,5 @@
 package com.dragon.tj.portal.controller;
 
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dragon.tj.portal.common.base.R;
@@ -12,7 +11,11 @@ import com.dragon.tj.portal.component.log.annotation.SysLog;
 import com.dragon.tj.portal.service.NoticeInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 

+ 50 - 0
src/main/java/com/dragon/tj/portal/controller/api/NoticeApiController.java

@@ -0,0 +1,50 @@
+package com.dragon.tj.portal.controller.api;
+
+import com.alibaba.fastjson.JSON;
+import com.dragon.tj.portal.common.base.R;
+import com.dragon.tj.portal.common.dto.notice.NoticeInfoReq;
+import com.dragon.tj.portal.component.page.KafkaUtil;
+import com.dragon.tj.portal.service.NoticeInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+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.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.ExecutionException;
+
+@Slf4j
+@RestController
+@RequestMapping("/api/message")
+public class NoticeApiController {
+
+    @Autowired
+    private KafkaUtil kafkaUtil;
+    @Autowired
+    private NoticeInfoService noticeInfoService;
+
+    /**
+     * @author huey China.
+     * @Description : 消息提醒发送
+     * @Date Created in 2023/7/11 16:12
+     */
+    @PostMapping("/send")
+    public R send(@Validated @RequestBody NoticeInfoReq noticeInfoReq, @RequestHeader String appKey) {
+        noticeInfoReq.setScopeId(appKey);
+        log.info("api/message/send-req-is {}", JSON.toJSONString(noticeInfoReq));
+        return noticeInfoService.send(noticeInfoReq);
+    }
+
+    @GetMapping("/createTopic")
+    public R createTopic(@RequestParam String appId, @RequestParam String topic) throws ExecutionException, InterruptedException {
+        kafkaUtil.create(topic);
+        return R.ok();
+    }
+
+}
+

+ 5 - 0
src/main/java/com/dragon/tj/portal/entity/AppInfo.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.experimental.Accessors;
@@ -121,6 +122,10 @@ public class AppInfo implements Serializable {
      */
     private Long hits;
 
+    private String appKey;
+    @JsonIgnore
+    private String appSecret;
+
     /*
      * 排序
      */

+ 3 - 1
src/main/java/com/dragon/tj/portal/service/AppService.java

@@ -15,7 +15,9 @@ public interface AppService {
     /*
      * CRUD
      * */
-    int add(AppInfo appInfo, LoginUser loginUser);
+    String add(AppInfo appInfo, LoginUser loginUser);
+
+    String resetSecret(Long id);
 
     int delete(Long id);
 

+ 1 - 2
src/main/java/com/dragon/tj/portal/service/impl/AppInfoServiceImpl.java

@@ -36,8 +36,7 @@ public class AppInfoServiceImpl extends ServiceImpl<AppInfoMapper, AppInfo> impl
     public AppInfo getOneByCode(String code) {
         LambdaQueryWrapper<AppInfo> wrapper = Wrappers.lambdaQuery();
         wrapper.eq(AppInfo::getSystemNumber, code);
-        AppInfo one = this.getOne(wrapper);
-        return one;
+        return this.getOne(wrapper);
     }
 
 }

+ 25 - 2
src/main/java/com/dragon/tj/portal/service/impl/AppServiceImpl.java

@@ -19,6 +19,7 @@ import com.dragon.tj.portal.mapper.app.InstallInfoMapper;
 import com.dragon.tj.portal.service.AppService;
 import com.dragon.tj.portal.service.FileManageService;
 import com.dragon.tj.portal.service.SysDictItemService;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -34,8 +35,10 @@ import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 public class AppServiceImpl implements AppService {
     private static final Logger LOGGER = LoggerFactory.getLogger(AppServiceImpl.class);
@@ -66,10 +69,30 @@ public class AppServiceImpl implements AppService {
      * CRUD
      * */
     @Override
-    public int add(AppInfo appInfo, LoginUser loginUser) {
+    public String add(AppInfo appInfo, LoginUser loginUser) {
         appInfo.setCreateUser(loginUser.getUsername());
+        String appKey = UUID.randomUUID().toString().replace("-", "");
+        String appSecret = UUID.randomUUID().toString().replace("-", "");
+        appInfo.setAppKey(appKey);
+        appInfo.setAppSecret(appSecret);
+        appInfoMapper.insert(appInfo);
+        log.info("应用{}新增成功, 应用编号: {}, appSecret: {}",
+                appInfo.getSystemName(), appInfo.getSystemNumber(), appSecret);
+        return appSecret;
+    }
 
-        return appInfoMapper.insert(appInfo);
+    @Override
+    public String resetSecret(Long id) {
+        AppInfo appInfo = new AppInfo();
+        appInfo.setId(id);
+        appInfo.setUpdateTime(LocalDateTime.now());
+
+        String appSecret = UUID.randomUUID().toString().replace("-", "");
+        appInfo.setAppSecret(appSecret);
+        appInfoMapper.updateById(appInfo);
+        log.info("应用重置密钥成功, user: {}, id: {}, appSecret: {}",
+                SecurityUtils.getLoginUser().getIdCard(), id, appSecret);
+        return appSecret;
     }
 
     @Override

+ 3 - 1
src/main/java/com/dragon/tj/portal/service/impl/FileManageServiceImpl.java

@@ -12,6 +12,7 @@ import com.dragon.tj.portal.entity.SysLog;
 import com.dragon.tj.portal.mapper.FileManageMapper;
 import com.dragon.tj.portal.service.FileManageService;
 import com.dragon.tj.portal.service.SysLogService;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -57,7 +58,8 @@ public class FileManageServiceImpl implements FileManageService {
         File newFile = new File(dateDir.getPath(), originalFilename);
 
         try {
-            file.transferTo(newFile);
+            FileUtils.copyInputStreamToFile(file.getInputStream(), newFile);
+            // file.transferTo(newFile); // 相对路径会出错
         } catch (IOException e) {
             e.printStackTrace();
             return null;

+ 37 - 66
src/main/java/com/dragon/tj/portal/service/impl/NoticeInfoServiceImpl.java

@@ -38,7 +38,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -80,29 +79,45 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
     @Autowired
     private AppInfoService appInfoService;
 
-    @Value("${notice-secret:true}")
-    private boolean noticeSecret;
-
     @Override
     public R send(NoticeInfoReq noticeInfoReq) {
-        if (this.validate(noticeInfoReq)) {
-            return R.ok(this.transferIds(noticeInfoReq));
+        // 120101510000 120000450200
+        // 120222197001010001 120222197001010002
+        boolean isSend;
+        Integer messageType = noticeInfoReq.getMessageType();
+        String scopeId = noticeInfoReq.getScopeId();
+        AppInfo appInfo = appInfoService.getOneByCode(scopeId);
+        if (Objects.isNull(appInfo)) {
+            throw new MessageInfoException(MessageInfoErrorEnums.Code.NOTICE_INFO_ERROR);
+        }
+        noticeInfoReq.setScopeName(appInfo.getSystemName());
+        Set<String> messageClientIds = getMessageClientIds(messageType, scopeId);
+        log.info("transferIds-scopeId-{}-{}", scopeId, messageClientIds);
+        if (CollUtil.isNotEmpty(messageClientIds)) {
+            NoticeInfoSend noticeInfoSend = doSaveNoticeInfo(noticeInfoReq, messageClientIds);
+            isSend = producer.send(BusinessConstants.TOPIC_PRE + scopeId, JSON.toJSONString(noticeInfoSend));
+            if (isSend) {
+                MsgRecord msgRecord = new MsgRecord();
+                msgRecord.setCreateBy(BusinessConstants.DEFAULT_ADMIN);
+                msgRecord.setCreateTime(LocalDateTime.now());
+                msgRecord.setReqContent(JSON.toJSONString(noticeInfoSend));
+                msgRecord.setType(MsgRecordTypeEnum.NOTICE.value());
+                msgRecordService.save(msgRecord);
+            }
         }
-        // 封装消息
-        // 保存及推送mq
-        return R.failed("发送消息验证失败");
+        return R.ok(true);
     }
 
     @Override
     public NoticeInfoVO detail(Long id) {
-        NoticeInfo noticeInfo = this.getById(id);
+        NoticeInfo noticeInfo = getById(id);
         return noticeInfoVOConvert.toVo(noticeInfo);
     }
 
     @Override
     public boolean update(NoticeInfoParam noticeInfoParam) {
         NoticeInfo messageInfo = noticeInfoVOConvert.paramTo(noticeInfoParam);
-        return this.updateById(messageInfo);
+        return updateById(messageInfo);
     }
 
     @Override
@@ -135,34 +150,6 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
         return queryPage;
     }
 
-    private boolean transferIds(NoticeInfoReq noticeInfoReq) {
-        // 120101510000 120000450200
-        // 120222197001010001 120222197001010002
-        boolean isSend = false;
-        Integer messageType = noticeInfoReq.getMessageType();
-        String scopeId = noticeInfoReq.getScopeId();
-        AppInfo appInfo = appInfoService.getOneByCode(noticeInfoReq.getScopeId());
-        if (Objects.isNull(appInfo)) {
-            throw new MessageInfoException(MessageInfoErrorEnums.Code.NOTICE_INFO_ERROR);
-        }
-        noticeInfoReq.setScopeName(appInfo.getSystemName());
-        Set<String> messageClientIds = this.getMessageClientIds(messageType, scopeId);
-        log.info("transferIds-scopeId-{}-{}", scopeId, messageClientIds);
-        if (CollUtil.isNotEmpty(messageClientIds)) {
-            NoticeInfoSend noticeInfoSend = this.doSaveNoticeInfo(noticeInfoReq, messageClientIds);
-            isSend = producer.send(BusinessConstants.TOPIC_PRE + noticeInfoReq.getScopeId(), JSON.toJSONString(noticeInfoSend));
-            if (isSend) {
-                MsgRecord msgRecord = new MsgRecord();
-                msgRecord.setCreateBy(BusinessConstants.DEFAULT_ADMIN);
-                msgRecord.setCreateTime(LocalDateTime.now());
-                msgRecord.setReqContent(JSON.toJSONString(noticeInfoSend));
-                msgRecord.setType(MsgRecordTypeEnum.NOTICE.value());
-                msgRecordService.save(msgRecord);
-            }
-        }
-        return isSend;
-    }
-
     /**
      * @author huey China.
      * @Description :
@@ -183,26 +170,9 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
         return messageClientIds;
     }
 
-    private boolean validate(NoticeInfoReq noticeInfoReq) {
-
-        String id = noticeInfoReq.getClientId();
-        Long t = noticeInfoReq.getT();
-        String scopeId = noticeInfoReq.getScopeId();
-        log.info("noticeInfoReq-validate-start-{}", noticeInfoReq.getClientId());
-        if (noticeSecret) {
-            String correctHash = DigestUtils.md5Hex(id + t);
-            if (!correctHash.equalsIgnoreCase(noticeInfoReq.getK())) {
-                return false;
-            }
-        }
-
-        log.info("noticeInfoReq-validate-end-{}-{}", scopeId, id);
-        return true;
-    }
-
     @Transactional(rollbackFor = Exception.class)
     public NoticeInfoSend doSaveNoticeInfo(NoticeInfoReq noticeInfoReq, Set<String> messageClientIds) {
-        log.info("doSaveNoticeInfo-start-{}-{}", noticeInfoReq.getClientId(), messageClientIds);
+        log.info("doSaveNoticeInfo-start-{}-{}", noticeInfoReq.getCreateIdCard(), messageClientIds);
         Integer messageType = noticeInfoReq.getMessageType();
         ScopeEnums scopeEnums = ScopeEnums.ofMessageType(messageType);
         List<NoticeInfoScope> insertList = Lists.newArrayList();
@@ -210,24 +180,25 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
         noticeInfoSend.setNoticeInfoReq(noticeInfoReq);
         noticeInfoSend.setClientIds(messageClientIds);
 
+        String scopeId = noticeInfoReq.getScopeId();
         NoticeInfo noticeInfo = noticeReqConvert.reqToInfo(noticeInfoReq);
-        noticeInfo.setCreateBy(noticeInfoReq.getClientId());
-        noticeInfo.setCreateUser(noticeInfoReq.getClientName());
-        noticeInfo.setCreateOrgCode(noticeInfoReq.getClientOrgCode());
-        noticeInfo.setCreateOrgName(noticeInfoReq.getClientOrgName());
-        noticeInfo.setScopeId(noticeInfoReq.getScopeId());
+        noticeInfo.setCreateBy(noticeInfoReq.getCreateIdCard());
+        noticeInfo.setCreateUser(noticeInfoReq.getCreateUserName());
+        noticeInfo.setCreateOrgCode(noticeInfoReq.getCreateOrgCode());
+        noticeInfo.setCreateOrgName(noticeInfoReq.getCreateOrgName());
+        noticeInfo.setScopeId(scopeId);
         noticeInfo.setScopeUrl(noticeInfoReq.getScopeUrl());
         noticeInfo.setScopeName(noticeInfoReq.getScopeName());
         // 存储
         boolean isSaveBatchSuccess = false;
         try {
-            isSaveBatchSuccess = this.save(noticeInfo);
+            isSaveBatchSuccess = save(noticeInfo);
             noticeInfoSend.setNoticeInfo(noticeInfo);
 
             messageClientIds.forEach(e -> {
                 NoticeInfoScope noticeInfoScope = new NoticeInfoScope();
                 noticeInfoScope.setNoticeInfoId(noticeInfo.getId());
-                noticeInfoScope.setScopeId(noticeInfoReq.getScopeId());
+                noticeInfoScope.setScopeId(scopeId);
                 noticeInfoScope.setMemberId(e);
                 noticeInfoScope.setScopeType(scopeEnums.value());
                 // messageInfoScope.setScopeLevel("");
@@ -241,7 +212,7 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
         // 批量存储失败,则逐个存储
         if (!isSaveBatchSuccess) {
             try {
-                this.save(noticeInfo);
+                save(noticeInfo);
                 insertList.forEach(e -> {
                     noticeInfoScopeService.save(e);
                 });
@@ -249,7 +220,7 @@ public class NoticeInfoServiceImpl extends ServiceImpl<NoticeInfoMapper, NoticeI
                 log.warn("消息中心 存储失败 {}", e);
             }
         }
-        log.info("doSaveNoticeInfo-end-{}-{}", noticeInfoReq.getClientId(), messageClientIds);
+        log.info("doSaveNoticeInfo-end-{}-{}", noticeInfoReq.getCreateIdCard(), messageClientIds);
         return noticeInfoSend;
     }