소스 검색

feat(退款):退款修改

Wangyafan 6 달 전
부모
커밋
e2b5182d73

+ 29 - 0
src/main/java/com/sunxung/factoring/entity/refundsManagement/RefundDetails.java

@@ -10,6 +10,7 @@ import com.sunxung.factoring.entity.BaseEntity;
 
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * <p>
@@ -72,6 +73,18 @@ public class RefundDetails extends BaseEntity {
     @TableField("label")
     private Integer label;
 
+    /**
+     * 分账单号
+     */
+    @TableField(exist = false)
+    private String ledgerNumber;
+
+    /**
+     * 入账时间
+     */
+    @TableField(exist = false)
+    private Date ledgerDate;
+
     public Long getRefundManagementId() {
         return refundManagementId;
     }
@@ -133,6 +146,22 @@ public class RefundDetails extends BaseEntity {
         this.label = label;
     }
 
+    public String getLedgerNumber() {
+        return ledgerNumber;
+    }
+
+    public void setLedgerNumber(String ledgerNumber) {
+        this.ledgerNumber = ledgerNumber;
+    }
+
+    public Date getLedgerDate() {
+        return ledgerDate;
+    }
+
+    public void setLedgerDate(Date ledgerDate) {
+        this.ledgerDate = ledgerDate;
+    }
+
     @Override
     public String toString() {
         return "RefundDetails{" +

+ 14 - 0
src/main/java/com/sunxung/factoring/entity/refundsManagement/RefundsApplyDetails.java

@@ -151,6 +151,12 @@ public class RefundsApplyDetails extends BaseEntity {
     @TableField(exist = false)
     private List<Long> planIds;
 
+    /**
+     * 应退明细
+     */
+    @TableField(exist = false)
+    private List<RefundDetails> refundDetailsList;
+
     public Integer getApplyType() {
         return applyType;
     }
@@ -326,4 +332,12 @@ public class RefundsApplyDetails extends BaseEntity {
     public void setPlanIds(List<Long> planIds) {
         this.planIds = planIds;
     }
+
+    public List<RefundDetails> getRefundDetailsList() {
+        return refundDetailsList;
+    }
+
+    public void setRefundDetailsList(List<RefundDetails> refundDetailsList) {
+        this.refundDetailsList = refundDetailsList;
+    }
 }

+ 12 - 1
src/main/java/com/sunxung/factoring/service/refundsManagement/impl/RefundManagementApprovalServiceImpl.java

@@ -178,7 +178,18 @@ public class RefundManagementApprovalServiceImpl extends ServiceImpl<RefundManag
                                     .map(RefundManagementPayCollPlanFactoringRef::getPayCollPlanFactoringId).collect(Collectors.toList());
                             apply.setPlanIds(planIds);
                         }
-
+                        //关联的履约保证金和质保金
+                        List<RefundDetails> refundDetailsList = refundDetailsService.lambdaQuery()
+                                .eq(RefundDetails::getRefundManagementId, approval.getRefundManagementId())
+                                .eq(RefundDetails::getStatus, 0).list();
+                        if (CollectionUtil.isNotEmpty(refundDetailsList)){
+                            refundDetailsList.forEach(details->{
+                                LedgerAccountBasicInfo ledgerAccountBasicInfo = ledgerAccountBasicInfoService.getDetail(details.getLedgerAccountBasicInfoId());
+                                details.setLedgerDate(ledgerAccountBasicInfo.getLedgerDate());
+                                details.setLedgerNumber(ledgerAccountBasicInfo.getLedgerNumber());
+                            });
+                        }
+                        apply.setRefundDetailsList(refundDetailsList);
                         ResponseEntity<ResponseJson> responseEntity = null;
                         try {
                             responseEntity = restTemplate.postForEntity(applyOtherOAUrl, apply, ResponseJson.class);