Browse Source

update

master
dengbiao 5 months ago
parent
commit
4786c656a9
3 changed files with 39 additions and 14 deletions
  1. +27
    -2
      consume/canal_guide_order_for_numerical_statement_consume.go
  2. +11
    -11
      consume/init.go
  3. +1
    -1
      go.mod

+ 27
- 2
consume/canal_guide_order_for_numerical_statement_consume.go View File

@@ -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
}

+ 11
- 11
consume/init.go View File

@@ -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


+ 1
- 1
go.mod View File

@@ -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


Loading…
Cancel
Save