ly 1 anno fa
parent
commit
3c9ace5faf

+ 10 - 0
src/main/java/cn/ezhizao/project/business/collection/controller/BizCollectionController.java

@@ -36,6 +36,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.core.io.ResourceLoader;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -310,6 +311,15 @@ public class BizCollectionController extends BaseController {
                     contract.setCollectionStatus((byte) (collection.getStatus() == 1 ? 2 : 3));
                     archiveInputService.saveOrUpdate(contract);
                 }
+                if(!CollectionUtils.isEmpty(collection.getEvidenceFiles())){
+                    List<SysFileStorage> fileStorageList = collection.getEvidenceFiles();
+                    fileStorageList.forEach(l -> {
+                        l.setId(l.getId() == null || l.getId().equals(0L) ? snowflakeIdWorker.nextId() : l.getId());
+                        l.setMasterId(collection.getId());
+                        l.setMasterTableName("biz_collection");
+                    });
+                    fileStorageService.saveBatch(fileStorageList);
+                }
             }
             return collectionService.saveOrUpdate(collection) ? success(collection) : error();
 

+ 2 - 0
src/main/java/cn/ezhizao/project/business/collection/domain/BizCollection.java

@@ -203,6 +203,8 @@ public class BizCollection extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private List<String> dateFilter;
 
+    @TableField(exist = false)
+    private List<SysFileStorage> evidenceFiles;
     public String getRemark()
     {
         return remark;

+ 10 - 0
src/main/java/cn/ezhizao/project/business/payment/controller/BizPaymentController.java

@@ -38,6 +38,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -330,6 +331,15 @@ public class BizPaymentController extends BaseController {
     public AjaxResult verified(@RequestBody BizPayment payment) {
         try {
             payment.setVerifyDate(payment.getVerifyDate() == null ? DateTime.now().toTimestamp() : payment.getVerifyDate());
+            if(!CollectionUtils.isEmpty(payment.getEvidenceFiles())){
+                List<SysFileStorage> fileStorageList = payment.getEvidenceFiles();
+                fileStorageList.forEach(l -> {
+                    l.setId(l.getId() == null || l.getId().equals(0L) ? snowflakeIdWorker.nextId() : l.getId());
+                    l.setMasterId(payment.getId());
+                    l.setMasterTableName("biz_payment");
+                });
+                fileStorageService.saveBatch(fileStorageList);
+            }
             return paymentService.saveOrUpdate(payment) ? success(payment) : error();
         } catch (Exception e) {
             throw new ServiceException(e.getMessage());

+ 3 - 0
src/main/java/cn/ezhizao/project/business/payment/domain/BizPayment.java

@@ -178,4 +178,7 @@ public class BizPayment extends BaseEntity {
 
     @ApiModelProperty(value = "收款账户开户银行")
     private String bankNo;
+
+    @TableField(exist = false)
+    private List<SysFileStorage> evidenceFiles;
 }