From 4786c656a9060962f2044d372950435b8701095e Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 26 Jul 2024 18:08:30 +0800 Subject: [PATCH] update --- ...e_order_for_numerical_statement_consume.go | 29 +++++++++++++++++-- consume/init.go | 22 +++++++------- go.mod | 2 +- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/consume/canal_guide_order_for_numerical_statement_consume.go b/consume/canal_guide_order_for_numerical_statement_consume.go index 7cc514a..08f3b28 100644 --- a/consume/canal_guide_order_for_numerical_statement_consume.go +++ b/consume/canal_guide_order_for_numerical_statement_consume.go @@ -7,6 +7,7 @@ import ( "applet/app/utils/logx" "applet/consume/md" "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" db2 "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official" "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models/official/model" "encoding/json" @@ -162,12 +163,23 @@ func handleCanalGuideOrderForNumericalStatementTable(msg []byte) error { placeOrderNumOfPeopleValue := decimal.NewFromInt(int64(placeOrderNumOfPeople)) customerUnitPrice = paymentTotalValue.Div(placeOrderNumOfPeopleValue).String() //客单价 } + if masterId == 24336737 { + db.Db.InsertOne(models.GuideOrderForNumericalStatementLog{ + MasterId: utils.IntToStr(masterId), + Data: utils.SerializeStr(canalMsg.Data), + UpdateFieldName: "", + OldValue: "", + NowValue: item.State, + Kind: 1, + CreateAt: now.Format("2006-01-02 15:04:05"), + }) + } isUpdate = true } } if canalMsg.Type == md.CanalMsgUpdateSqlType { - judgeSate := JudgeSate(*canalMsg) + judgeSate := JudgeSate(*canalMsg, utils.IntToStr(masterId)) if judgeSate > 0 { if judgeSate == 2 { //TODO::未收货失效 @@ -260,7 +272,7 @@ func SecondsUntilTomorrow(now time.Time) int64 { } // JudgeSate 处理订单状态(judgeSate[0:不需要处理 1:收货 2:未收货失效 3:已收货失效]) -func JudgeSate(message md.CanalGuideOrderMessage[md.CanalGuideOrder]) (judgeSate int) { +func JudgeSate(message md.CanalGuideOrderMessage[md.CanalGuideOrder], masterId string) (judgeSate int) { oldData := message.Old //1、获取 旧的订单状态 @@ -302,5 +314,18 @@ func JudgeSate(message md.CanalGuideOrderMessage[md.CanalGuideOrder]) (judgeSate return 3 } } + + if masterId == "24336737" { + db.Db.InsertOne(models.GuideOrderForNumericalStatementLog{ + MasterId: masterId, + Data: utils.SerializeStr(message), + UpdateFieldName: "state", + OldValue: oldOrdState, + NowValue: nowOrdState, + Kind: 1, + CreateAt: time.Now().Format("2006-01-02 15:04:05"), + }) + } + return } diff --git a/consume/init.go b/consume/init.go index 5cac412..a320291 100644 --- a/consume/init.go +++ b/consume/init.go @@ -75,15 +75,15 @@ func initConsumes() { //jobs[consumeMd.MallAddSupplyGoodsFunName] = MallAddSupplyGoodsConsume //////////////////////////////////////// bigData ///////////////////////////////////////////////////// - //jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume - //jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume - //jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume - //jobs[consumeMd.CanalUserVirtualCcoinFlowFunName] = CanalUserVirtualCoinFlowConsume - //jobs[consumeMd.CanalGuideOrderForNumericalStatementConsumeFunName] = CanalGuideOrderForNumericalStatementConsume - //jobs[consumeMd.CanalMallOrderForNumericalStatementConsumeFunName] = CanalMallOrderForNumericalStatementConsume - //jobs[consumeMd.CanalO2oOrderForNumericalStatementConsumeFunName] = CanalO2oOrderForNumericalStatementConsume - //jobs[consumeMd.CanalO2oPayOrderForNumericalStatementConsumeFunName] = CanalO2oPayOrderForNumericalStatementConsume - //jobs[consumeMd.CanalB2cOrderForNumericalStatementConsumeFunName] = CanalB2cOrderForNumericalStatementConsume + jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume + jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume + jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume + jobs[consumeMd.CanalUserVirtualCcoinFlowFunName] = CanalUserVirtualCoinFlowConsume + jobs[consumeMd.CanalGuideOrderForNumericalStatementConsumeFunName] = CanalGuideOrderForNumericalStatementConsume + jobs[consumeMd.CanalMallOrderForNumericalStatementConsumeFunName] = CanalMallOrderForNumericalStatementConsume + jobs[consumeMd.CanalO2oOrderForNumericalStatementConsumeFunName] = CanalO2oOrderForNumericalStatementConsume + jobs[consumeMd.CanalO2oPayOrderForNumericalStatementConsumeFunName] = CanalO2oPayOrderForNumericalStatementConsume + jobs[consumeMd.CanalB2cOrderForNumericalStatementConsumeFunName] = CanalB2cOrderForNumericalStatementConsume //////////////////////////////////////// oneCircles ///////////////////////////////////////////////////// @@ -108,8 +108,8 @@ func initConsumes() { //jobs[consumeMd.InstallmentPaymentAutoRepaidConsumeFunName] = InstallmentPaymentAutoRepaidConsume //分期付 - 自动扣款 ////////////////////////////////////// SuperCloudIssuance ///////////////////////////////////////////////////// - jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume - jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume + //jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume + //jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume ////////////////////////////////////// DMS ///////////////////////////////////////////////////// //jobs[consumeMd.CanalGimMessageConsumeFunName] = CanalGimMessageConsume diff --git a/go.mod b/go.mod index 978c1fe..d15db48 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20240719082936-c249de79edce code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git v1.6.2-0.20231116085701-9ba6e19f877b code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240725031213-6f248783bdec - code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240724040702-a331e3a17921 + code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240726093338-fed880ca12ce github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/boombuler/barcode v1.0.1