From 1222ce7dfd00e7336beaebdfb0199ec3597aeec2 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期二, 02 六月 2026 15:02:01 +0800
Subject: [PATCH] fix: 对销售台账产品进行发货,点击发货按钮后,发货状态直接变更为已发货,
---
src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java | 42 +++++++++++++++++++++++++++---------------
1 files changed, 27 insertions(+), 15 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 5c5e540..8d7477b 100644
--- a/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
+++ b/src/main/java/com/ruoyi/approve/service/impl/ApprovalInstanceServiceImpl.java
@@ -105,6 +105,30 @@
}
records.forEach(vo -> {
vo.setBusinessName(TypeEnums.getLabelByValue(vo.getBusinessType()));
+
+ // 鏍规嵁涓氬姟绫诲瀷鏌ヨ瀵瑰簲鐨勫崟鍙�
+ if (vo.getBusinessType() != null && vo.getBusinessId() != null) {
+ 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());
+ }
+ } else if (TypeEnums.QUOTATION_APPROVAL.getCode().equals(vo.getBusinessType())) {
+ // 鎶ヤ环瀹℃壒 - 鏌ヨ鎶ヤ环鍗曞彿
+ SalesQuotation salesQuotation = salesQuotationMapper.selectById(vo.getBusinessId());
+ if (salesQuotation != null) {
+ vo.setQuotationNo(salesQuotation.getQuotationNo());
+ }
+ } else if (TypeEnums.SHIPPING_APPROVAL.getCode().equals(vo.getBusinessType())) {
+ // 鍙戣揣瀹℃壒 - 鏌ヨ鍙戣揣鍗曞彿
+ ShippingInfo shippingInfo = shippingInfoMapper.selectById(vo.getBusinessId());
+ if (shippingInfo != null) {
+ vo.setShippingNo(shippingInfo.getShippingNo());
+ }
+ }
+ }
});
Long currentUserId = SecurityUtils.getUserId();
@@ -396,20 +420,8 @@
instance.setStatus("REJECTED");
instance.setFinishTime(now);
this.updateById(instance);
- // 椹冲洖瀵瑰簲鐨勪紒涓氭柊闂伙紝 宸梾鎶ラ攢
- if (instance.getBusinessType().equals(TypeEnums.ENTERPRISE_NEWS_APPROVAL.getCode())) {
- enterpriseNewsMapper.update(
- new LambdaUpdateWrapper<EnterpriseNews>()
- .eq(EnterpriseNews::getId, instance.getBusinessId())
- .set(EnterpriseNews::getStatus, "REJECTED")
- );
- }else if (instance.getBusinessType().equals(TypeEnums.TRAVEL_REIMBURSEMENT_APPROVAL.getCode())||instance.getBusinessType().equals(TypeEnums.EXPENSE_APPROVAL.getCode())) {
- finReimbursementMapper.update(
- new LambdaUpdateWrapper<FinReimbursement>()
- .eq(FinReimbursement::getId, instance.getBusinessId())
- .set(FinReimbursement::getBillStatus, "REJECTED")
- );
- }
+ // 缁熶竴澶勭悊涓氬姟鐘舵�佹洿鏂�
+ handleBusinessAfterApprovalFinished(instance);
return R.ok("瀹℃壒宸查┏鍥�");
}
@@ -658,7 +670,7 @@
private void handleShippingApprovalFinished(ApprovalInstance instance, String status) {
ShippingInfo shippingInfo = shippingInfoMapper.selectOne(
new LambdaQueryWrapper<ShippingInfo>()
- .eq(ShippingInfo::getId, instance.getTitle())
+ .eq(ShippingInfo::getShippingNo, instance.getTitle())
.orderByDesc(ShippingInfo::getCreateTime)
.last("limit 1")
);
--
Gitblit v1.9.3