|
@@ -7,6 +7,7 @@ import (
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
"net/url"
|
|
|
"strings"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
// CallBack 回调
|
|
@@ -41,12 +42,20 @@ func CallBack(r *ghttp.Request) {
|
|
|
qData := gconv.Map(r.Get("data"))
|
|
|
switch qData["taskType"] {
|
|
|
case "2": //电子发票开具
|
|
|
- <-service.JyInvoiceManager.RunPool //可进行下次开票请求
|
|
|
+ select {
|
|
|
+ case <-service.JyInvoiceManager.RunPool: //可进行下次开票请求
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
+ g.Log().Infof(ctx, "开具发票结束 蓝票 RunPool 放回超时")
|
|
|
+ }
|
|
|
g.Log().Infof(ctx, "开具发票结束")
|
|
|
case "4": //活体认证
|
|
|
case "5": //验证电子税局登录授权
|
|
|
case "9": //红冲
|
|
|
- <-service.JyInvoiceManager.RunPool //可进行下次开票请求
|
|
|
+ select {
|
|
|
+ case <-service.JyInvoiceManager.RunPool: //可进行下次开票请求
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
+ g.Log().Infof(ctx, "开具发票结束 红冲 RunPool 放回超时")
|
|
|
+ }
|
|
|
g.Log().Infof(ctx, "发票冲红结束")
|
|
|
default:
|
|
|
g.Log().Infof(ctx, "未知回调任务退出 %+v", qData)
|
|
@@ -65,7 +74,7 @@ func CallBack(r *ghttp.Request) {
|
|
|
|
|
|
// printFilter 打印参数调试
|
|
|
func printFilter(value url.Values) map[string][]string {
|
|
|
- var filter = []string{"pdf"} //过滤部分字段
|
|
|
+ var filter = []string{"pdf", "xml"} //过滤部分字段
|
|
|
res := map[string][]string{}
|
|
|
for key, val := range value {
|
|
|
add := true
|