diff --git a/consume/init.go b/consume/init.go index 7d64d19..378a0ac 100644 --- a/consume/init.go +++ b/consume/init.go @@ -17,58 +17,58 @@ func Init() { // 增加消费任务队列 func initConsumes() { - jobs[consumeMd.ZhiosUserUpLvFunName] = ZhiosUserUpLv - jobs[consumeMd.CanalGuideOrderByUserUpLvConsume] = CanalGuideOrderByUserUpLvConsume - jobs[consumeMd.ZhiosOrderFreeFunName] = ZhiosOrderFree - jobs[consumeMd.ZhiosOrderTotalFunName] = ZhiosOrderTotal - jobs[consumeMd.ZhiosOrderTotalSecondFunName] = ZhiosOrderTotalSecond + //jobs[consumeMd.ZhiosUserUpLvFunName] = ZhiosUserUpLv + //jobs[consumeMd.CanalGuideOrderByUserUpLvConsume] = CanalGuideOrderByUserUpLvConsume + //jobs[consumeMd.ZhiosOrderFreeFunName] = ZhiosOrderFree + //jobs[consumeMd.ZhiosOrderTotalFunName] = ZhiosOrderTotal + //jobs[consumeMd.ZhiosOrderTotalSecondFunName] = ZhiosOrderTotalSecond + //// + //jobs[consumeMd.ZhiosOrderSettleTotalFunName] = ZhiosSettleTotal + //jobs[consumeMd.ZhiosOrderHjyFunName] = ZhiosOrderHjy + //jobs[consumeMd.ZhiosOrderBuckleFunName] = ZhiosOrderBuckle + //// + //jobs[consumeMd.ZhiosSupplierAfterOrderFunName] = ZhiosSupplierAfterOrder + //jobs[consumeMd.ZhiosGuideStoreOrderFunName] = ZhiosGuideStoreOrder // - jobs[consumeMd.ZhiosOrderSettleTotalFunName] = ZhiosSettleTotal - jobs[consumeMd.ZhiosOrderHjyFunName] = ZhiosOrderHjy - jobs[consumeMd.ZhiosOrderBuckleFunName] = ZhiosOrderBuckle + ////jobs[consumeMd.ZhiosAppreciationDevFunName] = ZhiosAppreciation // - jobs[consumeMd.ZhiosSupplierAfterOrderFunName] = ZhiosSupplierAfterOrder - jobs[consumeMd.ZhiosGuideStoreOrderFunName] = ZhiosGuideStoreOrder - - //jobs[consumeMd.ZhiosAppreciationDevFunName] = ZhiosAppreciation - - jobs[consumeMd.ZhiosAppreciationFunName] = ZhiosAppreciation - jobs[consumeMd.ZhiosValidUserFunName] = ZhiosValidUser - - //jobs[consumeMd.ZhiosAcquisitionConditionDevFunName] = ZhiosAcquisitionCondition - - jobs[consumeMd.ZhiosAcquisitionConditionFunName] = ZhiosAcquisitionCondition - jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume - jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume - jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume - - jobs[consumeMd.DouShenUserRegisterConsumeForOfficialFunName] = DouShenUserRegisterConsumeForOfficial - jobs[consumeMd.DouShenUserRegisterConsumeForOperationCenterFunName] = DouShenUserRegisterConsumeForOperationCenter - jobs[consumeMd.DouShenUserRegisterConsumeForMyRecommenderFunName] = DouShenUserRegisterConsumeForMyRecommender - jobs[consumeMd.DouShenUserRegisterConsumeForMyFansFunName] = DouShenUserRegisterConsumeForMyFans - jobs[consumeMd.DouShenUserRegisterConsumeForUserRegisterUpLvFunName] = DouShenUserRegisterConsumeForUserRegisterUpLv - - jobs[consumeMd.ZhiosFastReturnOrderPayFunName] = ZhiosFastReturnOrderPay - jobs[consumeMd.ZhiosFastReturnOrderSuccessFunName] = ZhiosFastReturnOrderSuccess - jobs[consumeMd.ZhiosFastReturnOrderRefundFunName] = ZhiosFastReturnOrderRefund - jobs[consumeMd.ZhiosFastReturnOrderRefundSecondFunName] = ZhiosFastReturnOrderRefundSecond - - //jobs[consumeMd.CanalMallOrdForYouMiShangFunName] = CanalMallOrdForYouMiShang - jobs[consumeMd.YoumishangExchangeStoreFunName] = YoumishangExchangeStore - - jobs[consumeMd.ZhiosRechargeOrderFailFunName] = ZhiosRechargeOrderFail - - jobs[consumeMd.CloudIssuanceAsyncMLoginFunName] = CloudIssuanceAsyncMLoginConsume - jobs[consumeMd.ZhiosTikTokUpdateFunName] = ZhiosTikTokUpdate - jobs[consumeMd.ZhiosTikTokAllUpdateFunName] = ZhiosTikTokAllUpdate - - jobs[consumeMd.ZhiosCapitalPoolOrderTotalFunName] = ZhiosCapitalPoolOrderTotal - jobs[consumeMd.ZhiosExpressOrderFail] = ZhiosExpressOrderFail - jobs[consumeMd.ZhiosWithdrawReward] = ZhiosWithdrawReward - - //jobs[consumeMd.ZhiosRechargeOrderFailDevFunName] = ZhiosRechargeOrderFailDev - - jobs[consumeMd.CloudIssuanceMsgCallBackFunName] = CloudIssuanceMsgCallBackConsume + //jobs[consumeMd.ZhiosAppreciationFunName] = ZhiosAppreciation + //jobs[consumeMd.ZhiosValidUserFunName] = ZhiosValidUser + // + ////jobs[consumeMd.ZhiosAcquisitionConditionDevFunName] = ZhiosAcquisitionCondition + // + //jobs[consumeMd.ZhiosAcquisitionConditionFunName] = ZhiosAcquisitionCondition + //jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume + //jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume + //jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume + // + //jobs[consumeMd.DouShenUserRegisterConsumeForOfficialFunName] = DouShenUserRegisterConsumeForOfficial + //jobs[consumeMd.DouShenUserRegisterConsumeForOperationCenterFunName] = DouShenUserRegisterConsumeForOperationCenter + //jobs[consumeMd.DouShenUserRegisterConsumeForMyRecommenderFunName] = DouShenUserRegisterConsumeForMyRecommender + //jobs[consumeMd.DouShenUserRegisterConsumeForMyFansFunName] = DouShenUserRegisterConsumeForMyFans + //jobs[consumeMd.DouShenUserRegisterConsumeForUserRegisterUpLvFunName] = DouShenUserRegisterConsumeForUserRegisterUpLv + // + //jobs[consumeMd.ZhiosFastReturnOrderPayFunName] = ZhiosFastReturnOrderPay + //jobs[consumeMd.ZhiosFastReturnOrderSuccessFunName] = ZhiosFastReturnOrderSuccess + //jobs[consumeMd.ZhiosFastReturnOrderRefundFunName] = ZhiosFastReturnOrderRefund + //jobs[consumeMd.ZhiosFastReturnOrderRefundSecondFunName] = ZhiosFastReturnOrderRefundSecond + // + ////jobs[consumeMd.CanalMallOrdForYouMiShangFunName] = CanalMallOrdForYouMiShang + //jobs[consumeMd.YoumishangExchangeStoreFunName] = YoumishangExchangeStore + // + //jobs[consumeMd.ZhiosRechargeOrderFailFunName] = ZhiosRechargeOrderFail + // + //jobs[consumeMd.CloudIssuanceAsyncMLoginFunName] = CloudIssuanceAsyncMLoginConsume + //jobs[consumeMd.ZhiosTikTokUpdateFunName] = ZhiosTikTokUpdate + //jobs[consumeMd.ZhiosTikTokAllUpdateFunName] = ZhiosTikTokAllUpdate + // + //jobs[consumeMd.ZhiosCapitalPoolOrderTotalFunName] = ZhiosCapitalPoolOrderTotal + //jobs[consumeMd.ZhiosExpressOrderFail] = ZhiosExpressOrderFail + //jobs[consumeMd.ZhiosWithdrawReward] = ZhiosWithdrawReward + // + ////jobs[consumeMd.ZhiosRechargeOrderFailDevFunName] = ZhiosRechargeOrderFailDev + // + //jobs[consumeMd.CloudIssuanceMsgCallBackFunName] = CloudIssuanceMsgCallBackConsume jobs[consumeMd.SupplyCloudChainFenxiaoNewChangeFunName] = SupplyCloudChainFenxiaoNewChangeConsume } diff --git a/consume/supply_cloud_chain_fenxiao_new_change.go b/consume/supply_cloud_chain_fenxiao_new_change.go index 7cea1e5..3cc05dc 100644 --- a/consume/supply_cloud_chain_fenxiao_new_change.go +++ b/consume/supply_cloud_chain_fenxiao_new_change.go @@ -134,58 +134,58 @@ func SupplyCloudChainFenxiaoNewChangeConsume(queue md.MqQueue) { } utils.FilePutContents("cloudChainGoods", utils.SerializeStr(cloudChainGoods)) - - for _, id := range ids { - if cloudChainGoods[id] == nil { - continue - } - var goods model.MallGoods - goods.CloudChainGoodsId = id - goods.MerchantId = systemMerchant.Id - getV2, err11 := goods.GetV2(svc2.MasterDb(c)) - if err11 != nil { - fmt.Println("!!!!!!", err11.Error()) - return - } - if getV2 { - continue - } - var req md2.AddGoodsReq - req.Base.GoodsType = 1 - req.Base.CloudChainGoodsId = id - req.Base.SaleState = enum.MallGoodsSaleStateOnShelf - req.Base.CategoryId = utils.StrToInt(t.CategoryId) - req.Base.MerchantId = systemMerchant.Id - - err = svc.CloudChainFenXiaoGoodsChangeMallGoods(c, cloudChainGoods[id], &req) - if err != nil { - switch err.(type) { - case e.E: - err1 := err.(e.E) - fmt.Println("!!!!!!", err1.Error()) - return - default: - fmt.Println("!!!!!!", err.Error()) + go func() { + for _, id := range ids { + if cloudChainGoods[id] == nil { + continue + } + var goods model.MallGoods + goods.CloudChainGoodsId = id + goods.MerchantId = systemMerchant.Id + getV2, err11 := goods.GetV2(svc2.MasterDb(c)) + if err11 != nil { + fmt.Println("!!!!!!", err11.Error()) return } - } + if getV2 { + continue + } + var req md2.AddGoodsReq + req.Base.GoodsType = 1 + req.Base.CloudChainGoodsId = id + req.Base.SaleState = enum.MallGoodsSaleStateOnShelf + req.Base.CategoryId = utils.StrToInt(t.CategoryId) + req.Base.MerchantId = systemMerchant.Id - err1 := svc.AddMallGoods(c, &req) - if err1 != nil { - switch err1.(type) { - case e.E: - err1 := err1.(e.E) - fmt.Println("!!!!!!", err1.Error()) - return - default: - fmt.Println("!!!!!!", err.Error()) - return + err = svc.CloudChainFenXiaoGoodsChangeMallGoods(c, cloudChainGoods[id], &req) + if err != nil { + switch err.(type) { + case e.E: + err1 := err.(e.E) + fmt.Println("!!!!!!", err1.Error()) + return + default: + fmt.Println("!!!!!!", err.Error()) + return + } } - } - time.Sleep(10 * time.Millisecond) - } + err1 := svc.AddMallGoods(c, &req) + if err1 != nil { + switch err1.(type) { + case e.E: + err1 := err1.(e.E) + fmt.Println("!!!!!!", err1.Error()) + return + default: + fmt.Println("!!!!!!", err.Error()) + return + } + } + time.Sleep(10 * time.Millisecond) + } + }() _ = res.Ack(true) } else { panic(errors.New("error getting message"))