瀏覽代碼

企业备案信息表-新增回执单信息

heguanxun 9 月之前
父節點
當前提交
a63a5166ea

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordattachment/param/QyRecordAttachmentIdParam.java

@@ -32,4 +32,8 @@ public class QyRecordAttachmentIdParam {
     @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotBlank(message = "id不能为空")
     private String id;
+
+    public QyRecordAttachmentIdParam(String id) {
+        this.id = id;
+    }
 }

+ 11 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfo/service/impl/QyRecordInfoServiceImpl.java

@@ -33,6 +33,7 @@ import vip.xiaonuo.biz.modular.qyrecardbody.service.QyRecardBodyService;
 import vip.xiaonuo.biz.modular.qyrecordattachment.entity.QyRecordAttachment;
 import vip.xiaonuo.biz.modular.qyrecordattachment.param.QyRecordAttachmentAddParam;
 import vip.xiaonuo.biz.modular.qyrecordattachment.param.QyRecordAttachmentEditParam;
+import vip.xiaonuo.biz.modular.qyrecordattachment.param.QyRecordAttachmentIdParam;
 import vip.xiaonuo.biz.modular.qyrecordattachment.service.QyRecordAttachmentService;
 import vip.xiaonuo.biz.modular.qyrecordinfochecklist.entity.QyRecordInfoCheckList;
 import vip.xiaonuo.biz.modular.qyrecordinfochecklist.service.QyRecordInfoCheckListService;
@@ -143,6 +144,16 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
             });
             qyRecardBodyService.delete(bodyIdParams);
         }
+        List<QyRecordAttachment> list_ = qyRecordAttachmentService.list(new LambdaQueryWrapper<QyRecordAttachment>().eq(QyRecordAttachment::getQyRecordInfoId, qyRecordInfo.getId()));
+        if(CollectionUtil.isNotEmpty(list_)){
+            List<String> ids = list.stream().map(qyRecordAttachment -> qyRecordAttachment.getId()).collect(Collectors.toList());
+            List<QyRecordAttachmentIdParam> attachmentIdParams = new ArrayList<>();
+            ids.forEach(id ->{
+                attachmentIdParams.add(new QyRecordAttachmentIdParam(id));
+            });
+            qyRecordAttachmentService.delete(attachmentIdParams);
+        }
+
         List<QyRecardBodyEditParam> bodyAddParams = qyRecordInfoEditParam.getQyRecardBodyEditParams();
         if (CollectionUtil.isNotEmpty(bodyAddParams)){
             bodyAddParams.stream().forEach(qyRecardBodyAddParam -> {
@@ -152,7 +163,6 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
                 qyRecardBodyService.save(qyRecardBody);
             });
         }
-
         List<QyRecordAttachmentEditParam> attachmentEditParams = qyRecordInfoEditParam.getQyRecordAttachmentEditParams();
         if(CollectionUtil.isNotEmpty(attachmentEditParams)){
             attachmentEditParams.stream().forEach(qyRecordAttachmentAddParam -> {