@@ -111,7 +111,7 @@ func GetAllDatabaseDev() *[]model.DbMapping { | |||||
if cfg.Local { // 本地调试 加快速度 | if cfg.Local { // 本地调试 加快速度 | ||||
fmt.Println("notice:LOCAL TEST, only masterId:** 123456 ** available!") | fmt.Println("notice:LOCAL TEST, only masterId:** 123456 ** available!") | ||||
err = Db.Where("deleted_at != ? AND is_dev = '1' AND db_master_id= ?", 1, 123456). | err = Db.Where("deleted_at != ? AND is_dev = '1' AND db_master_id= ?", 1, 123456). | ||||
Or("db_master_id = ?", 23674801).Find(&m) | |||||
Or("db_master_id = ?", 25616402).Find(&m) | |||||
} else { | } else { | ||||
err = Db.Where("deleted_at != ? AND is_dev = '1' ", 1).Find(&m) | err = Db.Where("deleted_at != ? AND is_dev = '1' ", 1).Find(&m) | ||||
} | } | ||||
@@ -11,31 +11,31 @@ type NewFlexibleEmploymentPupiaoOrdDb struct { | |||||
Db *xorm.Engine `json:"model"` | Db *xorm.Engine `json:"model"` | ||||
} | } | ||||
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Set(masterId string) { // set方法 | |||||
NewFlexibleEmploymentPupiaoOrdDb.Db = commDb.DBs[masterId] | |||||
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Set(masterId string) { // set方法 | |||||
newFlexibleEmploymentPupiaoOrdDb.Db = commDb.DBs[masterId] | |||||
} | } | ||||
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Get(outBatchNo string) (m *model.NewFlexibleEmploymentPupiaoOrd, err error) { | |||||
m = new(model.NewFlexibleEmploymentPupiaoOrd) | |||||
has, err := NewFlexibleEmploymentPupiaoOrdDb.Db.Where("out_batch_no = ?", outBatchNo).Get(m) | |||||
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Get(outBatchNo string) (*model.NewFlexibleEmploymentPupiaoOrd, error) { | |||||
var m model.NewFlexibleEmploymentPupiaoOrd | |||||
has, err := newFlexibleEmploymentPupiaoOrdDb.Db.Where("out_batch_no = ?", outBatchNo).Get(&m) | |||||
if err != nil { | if err != nil { | ||||
return nil, logx.Error(err) | return nil, logx.Error(err) | ||||
} | } | ||||
if has == false { | if has == false { | ||||
return nil, nil | return nil, nil | ||||
} | } | ||||
return m, nil | |||||
return &m, nil | |||||
} | } | ||||
func (NewFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Update(id interface{}, m *model.NewFlexibleEmploymentPupiaoOrd, forceColums ...string) (int64, error) { | |||||
func (newFlexibleEmploymentPupiaoOrdDb *NewFlexibleEmploymentPupiaoOrdDb) Update(id interface{}, m *model.NewFlexibleEmploymentPupiaoOrd, forceColums ...string) (int64, error) { | |||||
var ( | var ( | ||||
affected int64 | affected int64 | ||||
err error | err error | ||||
) | ) | ||||
if forceColums != nil { | if forceColums != nil { | ||||
affected, err = NewFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Cols(forceColums...).Update(m) | |||||
affected, err = newFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Cols(forceColums...).Update(m) | |||||
} else { | } else { | ||||
affected, err = NewFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Update(m) | |||||
affected, err = newFlexibleEmploymentPupiaoOrdDb.Db.Where("id=?", id).Update(m) | |||||
} | } | ||||
if err != nil { | if err != nil { | ||||
return 0, err | return 0, err | ||||
@@ -3,9 +3,10 @@ package enum | |||||
type PuPiaoMethodName string | type PuPiaoMethodName string | ||||
const ( | const ( | ||||
OpenApiContractSignApply = "/open/api/contract/signApply" | |||||
OpenApiPaymentReceiveOrder = "/open/api/payment/receiveOrder" | |||||
OpenApiPaymentConfirmPay = "/open/api/payment/confirmPay" | |||||
OpenApiContractSignApply = "/open/api/contract/signApply" | |||||
OpenApiPaymentReceiveOrder = "/open/api/payment/receiveOrder" | |||||
NewOpenApiPaymentReceiveOrder = "/merchant/exportApi/pay/payApi" | |||||
OpenApiPaymentConfirmPay = "/open/api/payment/confirmPay" | |||||
) | ) | ||||
func (gt PuPiaoMethodName) String() string { | func (gt PuPiaoMethodName) String() string { | ||||
@@ -13,7 +14,9 @@ func (gt PuPiaoMethodName) String() string { | |||||
case OpenApiContractSignApply: | case OpenApiContractSignApply: | ||||
return "申请签约接口" | return "申请签约接口" | ||||
case OpenApiPaymentReceiveOrder: | case OpenApiPaymentReceiveOrder: | ||||
return "发起制单" | |||||
return "发起制单(废弃)" | |||||
case NewOpenApiPaymentReceiveOrder: | |||||
return "委托代征佣金发放API" | |||||
case OpenApiPaymentConfirmPay: | case OpenApiPaymentConfirmPay: | ||||
return "确认支付" | return "确认支付" | ||||
default: | default: | ||||
@@ -1,7 +1,6 @@ | |||||
package flexible_employment | package flexible_employment | ||||
import ( | import ( | ||||
"applet/app/cfg" | |||||
"applet/app/utils" | "applet/app/utils" | ||||
"crypto/md5" | "crypto/md5" | ||||
"encoding/hex" | "encoding/hex" | ||||
@@ -23,12 +22,12 @@ type PuPiaoService struct { | |||||
SecretKey string | SecretKey string | ||||
} | } | ||||
const NewUrlForPrd = "http://merchant-hlg.youjiayun.com" | |||||
const NewUrlForPrd = "http://merchant.linglong.net.cn" | |||||
const NewUrlForDev = "http://saas-merchant-test.youjiayun.com" | const NewUrlForDev = "http://saas-merchant-test.youjiayun.com" | ||||
func NewNewPuPiao(appKey, secretKey, merchantNo, agreementId string) *PuPiaoService { | func NewNewPuPiao(appKey, secretKey, merchantNo, agreementId string) *PuPiaoService { | ||||
var baseURL string | var baseURL string | ||||
if cfg.Prd { | |||||
if true { | |||||
baseURL = NewUrlForPrd | baseURL = NewUrlForPrd | ||||
} else { | } else { | ||||
baseURL = NewUrlForDev | baseURL = NewUrlForDev | ||||
@@ -100,7 +100,7 @@ func initConsumes() { | |||||
jobs[consumeMd.WithdrawConsumeFunName] = WithdrawConsume | jobs[consumeMd.WithdrawConsumeFunName] = WithdrawConsume | ||||
jobs[consumeMd.FlexibleEmploymentWithdrawForGongMaoConsumeFunName] = FlexibleEmploymentWithdrawForGongMaoConsume | jobs[consumeMd.FlexibleEmploymentWithdrawForGongMaoConsumeFunName] = FlexibleEmploymentWithdrawForGongMaoConsume | ||||
jobs[consumeMd.FlexibleEmploymentWithdrawForPupiaoConsumeFunName] = FlexibleEmploymentWithdrawForPupiaoConsume | jobs[consumeMd.FlexibleEmploymentWithdrawForPupiaoConsumeFunName] = FlexibleEmploymentWithdrawForPupiaoConsume | ||||
//jobs[consumeMd.NewFlexibleEmploymentWithdrawForPupiaoConsumeFunName] = NewFlexibleEmploymentWithdrawForPupiaoConsume | |||||
jobs[consumeMd.NewFlexibleEmploymentWithdrawForPupiaoConsumeFunName] = NewFlexibleEmploymentWithdrawForPupiaoConsume | |||||
jobs[consumeMd.ServiceAwardDividendRelationConsumeFunName] = ServiceAwardDividendRelationConsume | jobs[consumeMd.ServiceAwardDividendRelationConsumeFunName] = ServiceAwardDividendRelationConsume | ||||
jobs[consumeMd.DividendRewardConsumeFunName] = DividendRewardConsume //蜂蜜分红 | jobs[consumeMd.DividendRewardConsumeFunName] = DividendRewardConsume //蜂蜜分红 | ||||
@@ -1,7 +1,6 @@ | |||||
package consume | package consume | ||||
import ( | import ( | ||||
"applet/app/cfg" | |||||
"applet/app/db" | "applet/app/db" | ||||
db2 "applet/app/flexible_employment/db" | db2 "applet/app/flexible_employment/db" | ||||
"applet/app/flexible_employment/enum" | "applet/app/flexible_employment/enum" | ||||
@@ -11,7 +10,6 @@ import ( | |||||
"applet/app/utils/logx" | "applet/app/utils/logx" | ||||
"applet/consume/md" | "applet/consume/md" | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" | "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/rule/one_circles" | |||||
"encoding/json" | "encoding/json" | ||||
"errors" | "errors" | ||||
"fmt" | "fmt" | ||||
@@ -33,8 +31,6 @@ func NewFlexibleEmploymentWithdrawForPupiaoConsume(queue md.MqQueue) { | |||||
ch.Qos(1) | ch.Qos(1) | ||||
delivery := ch.Consume(queue.Name, false) | delivery := ch.Consume(queue.Name, false) | ||||
one_circles.Init(cfg.RedisAddr) | |||||
var res amqp.Delivery | var res amqp.Delivery | ||||
var ok bool | var ok bool | ||||
for { | for { | ||||
@@ -132,7 +128,7 @@ func handleNewFlexibleEmploymentWithdrawForPupiaoConsume(msgData []byte) error { | |||||
bankType = "3" | bankType = "3" | ||||
payMethod = "2" | payMethod = "2" | ||||
} | } | ||||
result, err := puPiao.CurlPost(enum.OpenApiPaymentReceiveOrder, map[string]interface{}{ | |||||
result, err := puPiao.CurlPost(puPiao.BaseURL+enum.NewOpenApiPaymentReceiveOrder, map[string]interface{}{ | |||||
"bizOrderNo": flexibleEmploymentPupiaoOrd.OutBatchNo, | "bizOrderNo": flexibleEmploymentPupiaoOrd.OutBatchNo, | ||||
"totalCount": "1", | "totalCount": "1", | ||||
"totalAmount": flexibleEmploymentPupiaoOrd.TotalAmount, | "totalAmount": flexibleEmploymentPupiaoOrd.TotalAmount, | ||||