From 7f5f8f45de574e1e573c1104cb8df2666ca21a8b Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 24 Jul 2024 12:34:24 +0800 Subject: [PATCH 1/2] update --- go.mod | 2 +- .../svc/svc_deal_call_back.go | 106 ++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 17808bf..1e14969 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.20240611024753-7cd929a03014 - code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240723093418-66f0c713f459 + code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240724040702-a331e3a17921 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 diff --git a/super_cloud_issuance/svc/svc_deal_call_back.go b/super_cloud_issuance/svc/svc_deal_call_back.go index 76b51b1..75a2ca7 100644 --- a/super_cloud_issuance/svc/svc_deal_call_back.go +++ b/super_cloud_issuance/svc/svc_deal_call_back.go @@ -189,6 +189,7 @@ func (dealSuperCloudIssuanceCallBackService *DealSuperCloudIssuanceCallBackServi return } if superCloudIssuanceUserRobotBindSource != nil { + //1、插入"源头群消息记录" superCloudIssuanceUserRobotBindSourceMessageLog := models.SuperCloudIssuanceUserRobotBindSourceMessageLog{ ActivateGroupId: superCloudIssuanceUserRobotBindSource.ActivateGroupId, MessageType: req.MessageType, @@ -204,6 +205,111 @@ func (dealSuperCloudIssuanceCallBackService *DealSuperCloudIssuanceCallBackServi fmt.Println("DealSourceGroupMessage_Err:::::", err.Error()) return err } + + //初始化云发单类 + cloudIssuanceService := CloudIssuanceService{} + //2、判断消息类型 + var superCloudIssuanceUserRobotBindSourceFollowGroups []*models.SuperCloudIssuanceUserRobotBindSourceFollowGroup + switch req.MessageType { + case 9: + //群聊文本消息 + //3、查询需转发的群 + err = engine.Where("activate_group_id =?", superCloudIssuanceUserRobotBindSource.ActivateGroupId).Find(&superCloudIssuanceUserRobotBindSourceFollowGroups) + if err != nil { + fmt.Println("DealSourceGroupMessage_Err:::::", err.Error()) + return err + } + + cache.NewRedis(cfg.RedisAddr) + for _, superCloudIssuanceUserRobotBindSourceFollowGroup := range superCloudIssuanceUserRobotBindSourceFollowGroups { + //转链 + if superCloudIssuanceUserRobotBindSourceFollowGroup.Uid > 0 { + args := map[string]string{ + "uid": utils.IntToStr(superCloudIssuanceUserRobotBindSourceFollowGroup.Uid), + "platform": "", + "master_id": dealSuperCloudIssuanceCallBackService.Context.GetString("mid"), + "content": req.Data.Content, + } + utils.FilePutContents("cloud_source", utils.SerializeStr(args)) + chain := chain_transfer.TurnChain(MasterDb(dealSuperCloudIssuanceCallBackService.Context), db.Db, db2.ZhimengDb, args) + utils.FilePutContents("cloud_source", utils.SerializeStr(chain)) + if chain.Count != "" { + req.Data.Content = chain.Count + } + } + utils.FilePutContents("cloud", req.Data.Content) + + superCloudIssuanceUserRobotDb := implement.NewSuperCloudIssuanceUserRobotDb(engine, superCloudIssuanceUserRobotBindSourceFollowGroup.Uid, dealSuperCloudIssuanceCallBackService.Context.GetString("mid")) + robot, _ := superCloudIssuanceUserRobotDb.GetSuperCloudIssuanceUserRobot() + if robot != nil { + cloudIssuanceService.Set(nil, enum.RobotMacSendTextMethodName, "127.0.0.1") + err = cloudIssuanceService.RobotMacSendText(md.RobotMacSendTextRequest{ + RobotId: robot.RobotId, + WxId: superCloudIssuanceUserRobotBindSourceFollowGroup.FollowChatRoomId, + Content: req.Data.Content, + }) + if err != nil { + fmt.Println("DealCallBack_err::::", err.Error()) + return + } + } + } + + break + case 10: + //群聊图片消息 + + //3、查询需转发的群 + err = engine.Where("activate_group_id =?", superCloudIssuanceUserRobotBindSource.ActivateGroupId).Find(&superCloudIssuanceUserRobotBindSourceFollowGroups) + if err != nil { + fmt.Println("DealSourceGroupMessage_Err:::::", err.Error()) + return err + } + + for _, superCloudIssuanceUserRobotBindSourceFollowGroup := range superCloudIssuanceUserRobotBindSourceFollowGroups { + superCloudIssuanceUserRobotDb := implement.NewSuperCloudIssuanceUserRobotDb(engine, superCloudIssuanceUserRobotBindSourceFollowGroup.Uid, dealSuperCloudIssuanceCallBackService.Context.GetString("mid")) + robot, _ := superCloudIssuanceUserRobotDb.GetSuperCloudIssuanceUserRobot() + if robot != nil { + cloudIssuanceService.Set(nil, enum.RobotMacSendRecvImageMethodName, "127.0.0.1") + err = cloudIssuanceService.RobotMacSendRecvImage(md.RobotMacSendRecvImageRequest{ + RobotId: robot.RobotId, + WxId: superCloudIssuanceUserRobotBindSourceFollowGroup.FollowChatRoomId, + Content: req.Data.Content, + }) + if err != nil { + fmt.Println("DealCallBack_err::::", err.Error()) + return + } + } + } + break + case 11: + //群聊视屏消息 + + //3、查询需转发的群 + err = engine.Where("activate_group_id =?", superCloudIssuanceUserRobotBindSource.ActivateGroupId).Find(&superCloudIssuanceUserRobotBindSourceFollowGroups) + if err != nil { + fmt.Println("DealSourceGroupMessage_Err:::::", err.Error()) + return err + } + for _, superCloudIssuanceUserRobotBindSourceFollowGroup := range superCloudIssuanceUserRobotBindSourceFollowGroups { + superCloudIssuanceUserRobotDb := implement.NewSuperCloudIssuanceUserRobotDb(engine, superCloudIssuanceUserRobotBindSourceFollowGroup.Uid, dealSuperCloudIssuanceCallBackService.Context.GetString("mid")) + robot, _ := superCloudIssuanceUserRobotDb.GetSuperCloudIssuanceUserRobot() + if robot != nil { + cloudIssuanceService.Set(nil, enum.RobotMacSendRecvViedoMethodName, "127.0.0.1") + err = cloudIssuanceService.RobotMacSendRecvVideo(md.RobotMacSendRecvVideoRequest{ + RobotId: robot.RobotId, + WxId: superCloudIssuanceUserRobotBindSourceFollowGroup.FollowChatRoomId, + Content: req.Data.Content, + }) + if err != nil { + fmt.Println("DealCallBack_err::::", err.Error()) + return + } + } + } + break + } } return From 6e3e432dd2a0b3b46381476e95d54f4720bf5e36 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 24 Jul 2024 12:35:11 +0800 Subject: [PATCH 2/2] update --- consume/init.go | 88 ++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/consume/init.go b/consume/init.go index 7c6ec20..5cac412 100644 --- a/consume/init.go +++ b/consume/init.go @@ -19,48 +19,48 @@ func Init() { func initConsumes() { //jobs[consumeMd.ZhiosGuideStoreOrderFunName] = ZhiosGuideStoreOrder - jobs[consumeMd.ZhiosIntegralProxyRechargeFunName] = ZhiosIntegralProxyRecharge - 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.ZhiosAppreciationFunName] = ZhiosAppreciation - jobs[consumeMd.ZhiosValidUserFunName] = ZhiosValidUser - - jobs[consumeMd.ZhiosAcquisitionConditionFunName] = ZhiosAcquisitionCondition - - 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.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.ZhiosTaskTotal] = ZhiosTaskTotal - jobs[consumeMd.ZhiosAutoUnFreeze] = ZhiosAutoUnFreeze + //jobs[consumeMd.ZhiosIntegralProxyRechargeFunName] = ZhiosIntegralProxyRecharge + //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.ZhiosAppreciationFunName] = ZhiosAppreciation + //jobs[consumeMd.ZhiosValidUserFunName] = ZhiosValidUser + // + //jobs[consumeMd.ZhiosAcquisitionConditionFunName] = ZhiosAcquisitionCondition + // + //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.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.ZhiosTaskTotal] = ZhiosTaskTotal + //jobs[consumeMd.ZhiosAutoUnFreeze] = ZhiosAutoUnFreeze //jobs[consumeMd.ZhiosUserProfileInviteCode] = ZhiosUserProfileInviteCode // @@ -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