ljy121 1 vuosi sitten
vanhempi
commit
4539bcb959

+ 12 - 0
zjugis-module-infra/zjugis-module-infra-biz/src/main/java/com/zjugis/module/infra/service/ding/DingServiceImpl.java

@@ -10,6 +10,7 @@ import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
 import com.dingtalk.api.response.OapiUserGetByMobileResponse;
 import com.taobao.api.ApiException;
 import com.zjugis.module.infra.api.ding.dto.DingMessageDto;
+import com.zjugis.module.infra.api.ding.dto.Form;
 import com.zjugis.module.infra.api.ding.dto.Link;
 import com.zjugis.module.infra.api.ding.dto.OA;
 import lombok.extern.slf4j.Slf4j;
@@ -18,6 +19,9 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author ljy
  * @version 1.0
@@ -71,6 +75,14 @@ public class DingServiceImpl implements DingService{
         OapiMessageCorpconversationAsyncsendV2Request.OA entity = new OapiMessageCorpconversationAsyncsendV2Request.OA();
         OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head();
         OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body();
+        List<Form> forms = oa.getBody().getForm();
+        List<OapiMessageCorpconversationAsyncsendV2Request.Form> dingForms = new ArrayList<>(forms.size());
+        for (Form form : forms) {
+            OapiMessageCorpconversationAsyncsendV2Request.Form dingForm = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            BeanUtils.copyProperties(form,dingForm);
+            dingForms.add(dingForm);
+        }
+        body.setForm(dingForms);
         BeanUtils.copyProperties(oa.getHead(),head);
         BeanUtils.copyProperties(oa.getBody(),body);
         entity.setHead(head);