|
@@ -18,6 +18,7 @@ import (
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
+ "unicode/utf8"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -135,6 +136,23 @@ func biddingTask(mapInfo map[string]interface{}) {
|
|
|
wg.Wait()
|
|
|
log.Info("biddingTask over", zap.Int("count", c1), zap.Int("index", index))
|
|
|
|
|
|
+ //发送udp,
|
|
|
+ //data := map[string]interface{}{
|
|
|
+ // "stype": "update",
|
|
|
+ // "gtid": mongodb.StringTOBsonId(mapInfo["gtid"].(string)),
|
|
|
+ // "lteid": mongodb.StringTOBsonId(mapInfo["lteid"].(string)),
|
|
|
+ //}
|
|
|
+ //target := &net.UDPAddr{
|
|
|
+ // Port: 1782,
|
|
|
+ // IP: net.ParseIP("127.0.0.1"),
|
|
|
+ //}
|
|
|
+ //bytes, _ := json.Marshal(data)
|
|
|
+ //err := UdpClient.WriteUdp(bytes, udp.OP_TYPE_DATA, target)
|
|
|
+ //if err != nil {
|
|
|
+ // log.Info("biddingTask ", zap.Any("WriteUdp err", err), zap.Any("target", target))
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ //log.Info("biddingTask ", zap.Any("target", target))
|
|
|
// 重采平台需要
|
|
|
//mapInfo["stype"] = ""
|
|
|
//datas, _ := json.Marshal(mapInfo)
|
|
@@ -589,8 +607,19 @@ func getFileText(tmp map[string]interface{}) (filetext string) {
|
|
|
if resultMap, ok := result.(map[string]interface{}); resultMap != nil && ok {
|
|
|
if attach_url := util.ObjToString(resultMap["attach_url"]); attach_url != "" {
|
|
|
bs := oss.OssGetObject(attach_url, mongodb.BsonIdToSId(tmp["_id"])) //oss读数据
|
|
|
- if len(bs) > 0 {
|
|
|
+ if utf8.RuneCountInString(filetext+bs) < 550000 {
|
|
|
filetext += bs + "\n"
|
|
|
+ } else {
|
|
|
+ if len(bs) > 50000 {
|
|
|
+ filetext += bs[0:50000]
|
|
|
+ } else {
|
|
|
+ filetext += bs
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //附件总长度限制550000
|
|
|
+ if utf8.RuneCountInString(filetext) >= 550000 {
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
//正式环境
|