From a1e979db02775b0523cb60fe26ba2da163a9746c Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 31 May 2022 11:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9C=8D=E5=8A=A1=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E3=80=91=E5=8F=91=E8=B5=B7=E6=9C=8D=E5=8A=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?-=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ServiceProjectFeedbackFormDTO.java | 5 ++- .../IcServiceProjectAttachmentEntity.java | 3 ++ .../impl/IcServiceRecordServiceImpl.java | 31 +++++++++++++------ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java index f45c9b9271..8d0eb4e8b7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java @@ -2,7 +2,6 @@ package com.epmet.dto.form; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.util.List; @Data @@ -23,10 +22,10 @@ public class ServiceProjectFeedbackFormDTO { private String longitude; private String latitude; private String address; - private List attachmentList; + private List attachmentList; @Data - public static class Feedback { + public static class Attachment { private String attachmentName; private String attachmentFormat; private String attachmentType; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java index 3238791176..c6a2858c86 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java @@ -1,5 +1,7 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -24,6 +26,7 @@ public class IcServiceProjectAttachmentEntity extends BaseEpmetEntity { /** * 客户ID */ + @TableField(fill = FieldFill.INSERT) private String customerId; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java index 0d91f722ad..69c421e262 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java @@ -36,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * @@ -200,7 +199,7 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl attachmentList = feedbackDto.getAttachmentList(); + List attachmentList = feedbackDto.getAttachmentList(); if (CollectionUtils.isNotEmpty(attachmentList)) { - attachmentList.forEach(a -> { + for (int i = 0; i < attachmentList.size(); i++) { + ServiceProjectFeedbackFormDTO.Attachment a = attachmentList.get(i); + IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity(); at.setAttachmentFormat(a.getAttachmentFormat()); at.setAttachmentName(a.getAttachmentName()); @@ -229,11 +230,12 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl