Browse Source

fix: remove withdraw subscribe remnants

Codex 4 weeks ago
parent
commit
c4de04bc64

+ 2 - 0
go/gopath/src/fohow.com/apps/controllers/cron_controller/init.go

@@ -77,6 +77,8 @@ func (self *CronController) run(name string) {
 func exec(name string) {
 	switch name {
 	case "take_cash": //提现
+		// 自动审核已停用,提现改为用户提交后直接确认微信零钱收款。
+		// autoTakeCash()
 		beego.BeeLogger.Warn("cron task take_cash auto audit is disabled")
 		return
 	case "admin_take_cash": //提现

+ 0 - 11
go/gopath/src/fohow.com/apps/controllers/cron_controller/sync_balance.go

@@ -204,11 +204,6 @@ func processTakeCashTimeoutOrder(order *balance_model.TakeCashOrder, result *Tak
 	if refundTakeCashTimeout(order) && result != nil {
 		result.Refunded++
 	}
-	if notifyErr := wx_mp.SendTakeCashTimeoutSubscribe(wxUser.Openid, order.Count+order.Fee); notifyErr != nil {
-		beego.BeeLogger.Error("take cash timeout subscribe order[%s] err[%s]", order.OrderId, notifyErr)
-	} else if result != nil {
-		result.Notified++
-	}
 }
 
 func prepareTimeoutMerchantTransfer(order *balance_model.TakeCashOrder, payCode string) (string, bool) {
@@ -281,7 +276,6 @@ func updateTakeCashByMerchantTransfer(order *balance_model.TakeCashOrder, openid
 		ret *wx_mp.MerchantTransferResponse
 		err error
 	)
-	createdTransfer := order.TradeNo == ""
 	if order.TradeNo != "" {
 		ret, err = wx_mp.QueryMerchantTransferByOutBillNo(order.OrderId, payCode)
 	} else {
@@ -297,11 +291,6 @@ func updateTakeCashByMerchantTransfer(order *balance_model.TakeCashOrder, openid
 		return ret, err
 	}
 	applyMerchantTransferResult(order, ret)
-	if createdTransfer {
-		if notifyErr := wx_mp.SendTakeCashArrivedSubscribe(openid, order.Id, order.Count+order.Fee, order.Fee, order.Count, ret.State, ret.PackageInfo); notifyErr != nil {
-			beego.BeeLogger.Error("Take cash subscribe order[%s] err[%s]", order.OrderId, notifyErr)
-		}
-	}
 	return ret, nil
 }
 

+ 1 - 8
go/gopath/src/fohow.com/apps/controllers/railsadmin_controller/take_cash_controller.go

@@ -193,14 +193,7 @@ func errString(err error) string {
 }
 
 func sendTakeCashSubscribeIfNeeded(createdTransfer bool, openid string, order *balance_model.TakeCashOrder, ret *wx_mp.MerchantTransferResponse) error {
-	if !createdTransfer || order == nil || ret == nil {
-		return nil
-	}
-	err := wx_mp.SendTakeCashArrivedSubscribe(openid, order.Id, order.Count+order.Fee, order.Fee, order.Count, ret.State, ret.PackageInfo)
-	if err != nil {
-		beego.BeeLogger.Error("Railsadmin take cash subscribe order[%s] err[%s]", order.OrderId, err)
-	}
-	return err
+	return nil
 }
 
 func railsadminFirstNotEmpty(values ...string) string {

+ 0 - 23
go/gopath/src/fohow.com/libs/wx_mp/xcx.go

@@ -121,8 +121,6 @@ type Template3MessageData struct {
 	Kerword3 DataKeywordValue `json:"keyword3"`
 }
 
-const TakeCashSubscribeTemplateId = "L073dR84XibBZNxfvTkvTIemd7JAbj5o2Og7-VBAiX8"
-
 type SubscribeDataValue struct {
 	Value string `json:"value"`
 }
@@ -141,27 +139,6 @@ type SubscribeMessageResponse struct {
 	ErrMsg  string `json:"errmsg"`
 }
 
-type TakeCashArrivedSubscribeData struct {
-	Amount3 SubscribeDataValue `json:"amount3"`
-	Amount4 SubscribeDataValue `json:"amount4"`
-	Amount5 SubscribeDataValue `json:"amount5"`
-}
-
-func SendTakeCashStatusSubscribe(openid string, withdrawAmount int64, remark string) error {
-	return nil
-}
-
-func SendTakeCashArrivedSubscribe(openid string, orderId, withdrawAmount, fee, arriveAmount int64, state, packageInfo string) error {
-	if openid == "" || packageInfo == "" || !MerchantTransferStatePending(state) {
-		return nil
-	}
-	return SendTakeCashStatusSubscribe(openid, withdrawAmount, "已审核 ,待您确认后到帐!")
-}
-
-func SendTakeCashTimeoutSubscribe(openid string, withdrawAmount int64) error {
-	return SendTakeCashStatusSubscribe(openid, withdrawAmount, "超时未确认,请您重新提现!")
-}
-
 func SendTemplateMessage(toUserOpenId string, templateId string, page string, formId string, data json.RawMessage, emphasisKeyword string) {
 	token := GetAccessToken(beego.AppConfig.String("WxFohowXcxAppId"), beego.AppConfig.String("WxFohowXcxAppSecret"))
 	beego.BeeLogger.Info("TestSendingTemplatemsgController got token: %s", token)