From 411dd0df172658585da0d583d04e37ede892a6f1 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期六, 30 三月 2024 10:59:10 +0800
Subject: [PATCH] 修改crm状态2

---
 controllers/operation.go |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/controllers/operation.go b/controllers/operation.go
index 4925631..9ab5341 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -538,9 +538,6 @@
 					return err
 				}
 			}
-			if operation.Source != "" {
-				go UpdatePurchaseStatus(operation.Source, operation.SourceNumber)
-			}
 
 		}
 
@@ -582,9 +579,6 @@
 					return errors.New("褰撳墠浠撳簱娌℃湁璇ヤ骇鍝�,璇峰厛鍏ュ簱")
 				}
 			}
-			if operation.Source != "" {
-				go UpdateOutStatus(operation.Source, operation.SourceNumber, 4)
-			}
 		}
 
 		if operation.BaseOperationType == constvar.BaseOperationTypeInternal {
@@ -625,6 +619,16 @@
 		util.ResponseFormat(c, code.RequestError, err.Error())
 		return
 	}
+	//淇敼鍏朵粬绯荤粺璁㈠崟鐘舵��
+	if operation.BaseOperationType == constvar.BaseOperationTypeIncoming {
+		if operation.Source != "" {
+			go UpdatePurchaseStatus(operation.Source, operation.SourceNumber)
+		}
+	} else if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing {
+		if operation.Source != "" {
+			go UpdateOutStatus(operation.Source, operation.SourceNumber, 4)
+		}
+	}
 
 	util.ResponseFormat(c, code.Success, "鎿嶄綔鎴愬姛")
 }

--
Gitblit v1.8.0