From 684e4306a08feeae188070f264148e6765da8dcf Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 20 九月 2026 19:25:15 +0800
Subject: [PATCH] feat(account): 更新往来付款回款流水表及接口
---
src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java b/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
index 8d7477b..0e8825b 100644
--- a/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
+++ b/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
@@ -40,9 +40,11 @@
import com.ruoyi.purchase.mapper.PurchaseLedgerMapper;
import com.ruoyi.purchase.pojo.PurchaseLedger;
import com.ruoyi.quality.utils.QualityInspectHelper;
+import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
import com.ruoyi.sales.mapper.SalesQuotationMapper;
import com.ruoyi.sales.mapper.ShippingInfoMapper;
+import com.ruoyi.sales.pojo.SalesLedger;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import com.ruoyi.sales.pojo.SalesQuotation;
import com.ruoyi.sales.pojo.ShippingInfo;
@@ -84,6 +86,7 @@
private final SalesLedgerProductMapper salesLedgerProductMapper;
private final StockUtils stockUtils;
private final SalesQuotationMapper salesQuotationMapper;
+ private final SalesLedgerMapper salesLedgerMapper;
private final ShippingInfoMapper shippingInfoMapper;
private final QualityInspectHelper qualityInspectHelper;
private final EnterpriseNewsScopeUserMapper enterpriseNewsScopeUserMapper;
@@ -111,7 +114,6 @@
if (TypeEnums.PURCHASE_APPROVAL.getCode().equals(vo.getBusinessType())) {
// 閲囪喘瀹℃壒 - 鏌ヨ閲囪喘鍗曞彿
PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(vo.getBusinessId());
- System.out.println("涓氬姟绫诲瀷锛�" + purchaseLedger.getPurchaseContractNumber());
if (purchaseLedger != null) {
vo.setPurchaseContractNumber(purchaseLedger.getPurchaseContractNumber());
}
@@ -126,6 +128,12 @@
ShippingInfo shippingInfo = shippingInfoMapper.selectById(vo.getBusinessId());
if (shippingInfo != null) {
vo.setShippingNo(shippingInfo.getShippingNo());
+ }
+ } else if (TypeEnums.SALES_LEDGER_APPROVAL.getCode().equals(vo.getBusinessType())) {
+ // 閿�鍞彴璐﹀鎵� - 鏌ヨ閿�鍞悎鍚屽彿
+ SalesLedger salesLedger = salesLedgerMapper.selectById(vo.getBusinessId());
+ if (salesLedger != null) {
+ vo.setSalesContractNo(salesLedger.getSalesContractNo());
}
}
}
@@ -537,6 +545,10 @@
handleShippingApprovalFinished(instance, status);
return;
}
+ if (TypeEnums.SALES_LEDGER_APPROVAL.getCode().equals(businessType)) {
+ handleSalesLedgerApprovalFinished(instance, status);
+ return;
+ }
if (TypeEnums.TRAVEL_REIMBURSEMENT_APPROVAL.getCode().equals(businessType)
|| TypeEnums.EXPENSE_APPROVAL.getCode().equals(businessType)) {
handleReimbursementApprovalFinished(instance, status);
@@ -667,6 +679,25 @@
salesQuotationMapper.updateById(salesQuote);
}
+ /**
+ * 閿�鍞彴璐﹀鎵圭粨鏉燂細鍙洖鍐欏彴璐︾殑瀹℃壒鐘舵�侊紝涓嶉攣瀹氬崟鎹�佷笉鑷姩鐢熸垚涓嬫父鍗曟嵁
+ */
+ private void handleSalesLedgerApprovalFinished(ApprovalInstance instance, String status) {
+ SalesLedger salesLedger = salesLedgerMapper.selectById(instance.getBusinessId());
+ if (salesLedger == null) {
+ return;
+ }
+
+ if ("APPROVED".equals(status)) {
+ salesLedger.setApprovalStatus(SalesQuotationStatusEnum.APPROVED.getCode());
+ } else if ("REJECTED".equals(status)) {
+ salesLedger.setApprovalStatus(SalesQuotationStatusEnum.REJECTED.getCode());
+ } else if ("PENDING".equals(status)) {
+ salesLedger.setApprovalStatus(SalesQuotationStatusEnum.IN_PROGRESS.getCode());
+ }
+ salesLedgerMapper.updateById(salesLedger);
+ }
+
private void handleShippingApprovalFinished(ApprovalInstance instance, String status) {
ShippingInfo shippingInfo = shippingInfoMapper.selectOne(
new LambdaQueryWrapper<ShippingInfo>()
@@ -745,10 +776,29 @@
String title = StringUtils.hasText(instance.getTemplateName()) ? instance.getTemplateName() : "瀹℃壒鎻愰啋";
String message = "瀹℃壒鍗曞彿 " + instance.getInstanceNo() + " 闇�瑕佹偍瀹℃壒";
- String jumpPath = "/officeProcessAutomation/ApproveManage/approve-list?id=" + instance.getId();
+ String jumpPath = getJumpPathByBusinessType(instance.getBusinessType(), instance.getId());
sysNoticeService.simpleNoticeByUser(title, message, approverIds, jumpPath);
}
+ private String getJumpPathByBusinessType(Long businessType, Long instanceId) {
+ if (businessType == null) {
+ return "/collaborativeApproval/approve-list?id=" + instanceId;
+ }
+ if (TypeEnums.LEAVE_APPROVAL.getCode().equals(businessType)) {
+ return "/collaborativeApproval/AttendManage/leave-apply?id=" + instanceId;
+ }
+ if (TypeEnums.OVERTIME_APPROVAL.getCode().equals(businessType)) {
+ return "/collaborativeApproval/AttendManage/overtime-apply?id=" + instanceId;
+ }
+ if (TypeEnums.TRAVEL_REIMBURSEMENT_APPROVAL.getCode().equals(businessType)) {
+ return "/collaborativeApproval/ReimburseManage/travel-reimburse?id=" + instanceId;
+ }
+ if (TypeEnums.EXPENSE_APPROVAL.getCode().equals(businessType)) {
+ return "/collaborativeApproval/ReimburseManage/cost-reimburse?id=" + instanceId;
+ }
+ return "/collaborativeApproval/approve-list?id=" + instanceId;
+ }
+
private void sendEnterpriseNewsNotice(Long newsId) {
EnterpriseNews enterpriseNews = enterpriseNewsMapper.selectById(newsId);
if (enterpriseNews == null) {
--
Gitblit v1.9.3