Explorar el Código

更新

order_statistics
huangjiajun hace 5 meses
padre
commit
1fdca3fd00
Se han modificado 2 ficheros con 62 adiciones y 0 borrados
  1. +3
    -0
      consume/zhios_acquisition_condition.go
  2. +59
    -0
      consume/zhios_acquisition_condition_dev.go

+ 3
- 0
consume/zhios_acquisition_condition.go Ver fichero

@@ -554,6 +554,7 @@ func checkAllCompleteTmp(eg *xorm.Engine, user *md.User, acqCfg *md.AcquisitionC
}
}
if acqCfg.SuccessConditions.OrderPay.Open == "1" {
//AcqOrderPay(eg, user, acqCfg)
res = res && AcqOrderPay(eg, user, acqCfg)
if res {
str += ",OrderPay"
@@ -653,6 +654,8 @@ func commAmount(eg *xorm.Engine, uid string, endTime, types int, acqCfg *md.Acqu
count := sqlSelect(eg, uid, endTime, types, acqCfg, arr)
arr = []string{"ol.paid_price", "privilege_card_ord", "ord_list_relate", "ol.ord_id", "ol.uid", " and ol.state=1"}
count += sqlSelect(eg, uid, endTime, types, acqCfg, arr)
arr = []string{"ol.money", "express_order", "ord_list_relate", "ol.oid", "ol.uid", " and ol.status in('待取件','运输中','已完成')"}
count += sqlSelect(eg, uid, endTime, types, acqCfg, arr)
arr = []string{"ol.commission", "duoyou_ord_list", "ord_list_relate", "ol.oid", "ol.uid", " and ol.id>0"}
count += sqlSelect(eg, uid, endTime, types, acqCfg, arr)
arr = []string{"ol.amount", "recharge_order", "ord_list_relate", "ol.oid", "ol.uid", " and ol.status<>'已退款'"}


+ 59
- 0
consume/zhios_acquisition_condition_dev.go Ver fichero

@@ -0,0 +1,59 @@
package consume

import (
"applet/app/utils"
"applet/app/utils/logx"
"applet/consume/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"encoding/json"
"errors"
"fmt"
"github.com/streadway/amqp"
)

func ZhiosAcquisitionConditionDev(queue md.MqQueue) {
fmt.Println(">>>>>>>>>>>>>>>>>>>>>>>>")
ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
logx.Error(err)
return
}
defer ch.Release()
//1、将自己绑定到交换机上
ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey)
//2、取出数据进行消费
ch.Qos(300)
delivery := ch.Consume(queue.Name, false)

var res amqp.Delivery
var ok bool
for {
res, ok = <-delivery
if ok == true {
//fmt.Println(string(res.Body))
fmt.Println(">>>>>>>>>>>>>>>>ZhiosAcquisitionCondition<<<<<<<<<<<<<<<<<<<<<<<<<")
err = handleZhiosAcquisition(res.Body)
//_ = res.Reject(false)
fmt.Println(err)
if err == nil {
_ = res.Ack(true)
} else {

var canalMsg *md.ZhiosAcquisition
var tmpString string
err := json.Unmarshal(res.Body, &tmpString)
if err == nil {
fmt.Println(tmpString)
err = json.Unmarshal([]byte(tmpString), &canalMsg)
if err == nil {
ch.Publish(queue.ExchangeName, utils.SerializeStr(canalMsg), queue.RoutKey)
}
}

}
} else {
panic(errors.New("error getting message"))
}
}
fmt.Println("get msg done")
}

Cargando…
Cancelar
Guardar