Browse Source

修改附件

xueyiming 5 months ago
parent
commit
91b3088099

+ 6 - 2
we-com-server/src/main/java/com/tzld/piaoquan/wecom/service/Impl/MessageAttachmentServiceImpl.java

@@ -2,6 +2,7 @@ package com.tzld.piaoquan.wecom.service.Impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.util.BeanUtil;
 import com.tzld.piaoquan.wecom.common.base.CommonResponse;
 import com.tzld.piaoquan.wecom.common.enums.MessageAttachmentTypeEnum;
 import com.tzld.piaoquan.wecom.component.HttpPoolClient;
@@ -19,6 +20,7 @@ import com.tzld.piaoquan.wecom.utils.DateUtil;
 import com.tzld.piaoquan.wecom.utils.LarkRobotUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
@@ -119,8 +121,10 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
                 if (messageAttachment == null) {
                     continue;
                 }
-                messageAttachment.setStaffId(videoParam.getStaffId());
-                messageAttachmentList.add(messageAttachment);
+                MessageAttachment newMessageAttachment = new MessageAttachment();
+                BeanUtils.copyProperties(messageAttachment, newMessageAttachment);
+                newMessageAttachment.setStaffId(videoParam.getStaffId());
+                messageAttachmentList.add(newMessageAttachment);
             }
         }
         addMiniProgram(messageAttachmentList);