yzc 2 жил өмнө
parent
commit
c17e433337

+ 7 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerFollowRecordsDto.java

@@ -1,9 +1,12 @@
 package com.fjhx.customer.entity.customer.dto;
 
 import com.fjhx.customer.entity.customer.po.CustomerFollowRecords;
+import com.fjhx.file.entity.ObsFile;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * 客户跟进记录新增编辑入参实体
  *
@@ -14,4 +17,8 @@ import lombok.Setter;
 @Setter
 public class CustomerFollowRecordsDto extends CustomerFollowRecords {
 
+    /**
+     * 文件列表
+     */
+    List<ObsFile> fileList;
 }

+ 10 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerFollowRecordsServiceImpl.java

@@ -1,9 +1,12 @@
 package com.fjhx.customer.service.customer.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.fjhx.customer.entity.customer.po.CustomerFollowRecords;
 import com.fjhx.customer.mapper.customer.CustomerFollowRecordsMapper;
 import com.fjhx.customer.service.customer.CustomerFollowRecordsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.file.utils.ObsFileUtil;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.customer.entity.customer.vo.CustomerFollowRecordsVo;
@@ -11,6 +14,7 @@ import com.fjhx.customer.entity.customer.dto.CustomerFollowRecordsSelectDto;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.fjhx.customer.entity.customer.dto.CustomerFollowRecordsDto;
 import cn.hutool.core.bean.BeanUtil;
+import oshi.util.FileUtil;
 
 
 /**
@@ -39,19 +43,25 @@ public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollow
         return result;
     }
 
+    @DSTransactional
     @Override
     public void add(CustomerFollowRecordsDto customerFollowRecordsDto) {
         this.save(customerFollowRecordsDto);
+        ObsFileUtil.saveFile(customerFollowRecordsDto.getFileList(),customerFollowRecordsDto.getId());
     }
 
+    @DSTransactional
     @Override
     public void edit(CustomerFollowRecordsDto customerFollowRecordsDto) {
         this.updateById(customerFollowRecordsDto);
+        ObsFileUtil.editFile(customerFollowRecordsDto.getFileList(),customerFollowRecordsDto.getId());
     }
 
+    @DSTransactional
     @Override
     public void delete(Long id) {
         this.removeById(id);
+        ObsFileUtil.removeFile(id);
     }
 
 }