|
@@ -768,32 +768,61 @@ func NewTaskRunAll(tt *TTask, budp bool, mapInfo map[string]interface{}) int {
|
|
//res["projectinfo"] = tmp["projectinfo"]
|
|
//res["projectinfo"] = tmp["projectinfo"]
|
|
} else { //常规任务
|
|
} else { //常规任务
|
|
SMap = NewClassificationRun(tt, tmp)
|
|
SMap = NewClassificationRun(tt, tmp)
|
|
- //一级分类时,符合结果中成交规则时
|
|
|
|
- if SMap.Map["toptype"] == "招标" && SMap.Map["subtype"] != "单一" {
|
|
|
|
- if _, ok := tmp["detail"]; ok {
|
|
|
|
- if u.ChargeDetailResult(util.ObjToString(tmp["detail"])) {
|
|
|
|
- SMap.Map["toptype"] = "结果"
|
|
|
|
- resa := ReSub(tt, tmp, "结果")
|
|
|
|
- subtype := resa.Map["subtype"]
|
|
|
|
- delete(SMap.Map, "subtype")
|
|
|
|
- SMap.Map["subtype"] = subtype
|
|
|
|
|
|
+ //1.针对招标分类的特殊处理
|
|
|
|
+ if tt.ID == "57982b4436b82b073c000001" && tt.S_name == "招标分类" {
|
|
|
|
+ //1.一级分类时,符合结果中成交规则时
|
|
|
|
+ //todo 如果没有打上分类,调用ai 模型分类
|
|
|
|
+ if _, ok := SMap.Map["toptype"]; !ok {
|
|
|
|
+ if util.ObjToString(tools.Config["aiurl"]) != "" {
|
|
|
|
+ now := time.Now()
|
|
|
|
+ data := map[string]interface{}{
|
|
|
|
+ "title": tmp["title"],
|
|
|
|
+ "detail": tmp["detail"],
|
|
|
|
+ }
|
|
|
|
+ reqData := map[string]interface{}{
|
|
|
|
+ "texts": []interface{}{data},
|
|
|
|
+ }
|
|
|
|
+ rai := SendAi(reqData, util.ObjToString(tools.Config["aiurl"]))
|
|
|
|
+ log.Println("ai 分类时长", time.Since(now).Seconds())
|
|
|
|
+ if len(rai) > 0 {
|
|
|
|
+ resa := rai["result"]
|
|
|
|
+ if dataa, ok := resa.([]interface{}); ok {
|
|
|
|
+ da := dataa[0]
|
|
|
|
+ if len(util.ObjToString(da)) > 0 {
|
|
|
|
+ cs := strings.Split(util.ObjToString(da), "-")
|
|
|
|
+ SMap.Map["toptype"] = cs[0]
|
|
|
|
+ SMap.Map["subtype"] = cs[1]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //一级分类是预告,但是标题含有招标计划,同时含有 预公告|预公示,变为 采购意向
|
|
|
|
- if SMap.Map["toptype"] == "预告" {
|
|
|
|
- if u.DealYuce(tmp["title"].(string)) {
|
|
|
|
|
|
+ if SMap.Map["toptype"] == "招标" && SMap.Map["subtype"] != "单一" {
|
|
|
|
+ if _, ok := tmp["detail"]; ok {
|
|
|
|
+ if u.ChargeDetailResult(util.ObjToString(tmp["detail"])) {
|
|
|
|
+ SMap.Map["toptype"] = "结果"
|
|
|
|
+ resa := ReSub(tt, tmp, "结果")
|
|
|
|
+ subtype := resa.Map["subtype"]
|
|
|
|
+ delete(SMap.Map, "subtype")
|
|
|
|
+ SMap.Map["subtype"] = subtype
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //2.一级分类是预告,但是标题含有招标计划,同时含有 预公告|预公示,变为 采购意向
|
|
|
|
+ if SMap.Map["toptype"] == "预告" {
|
|
|
|
+ if u.DealYuce(tmp["title"].(string)) {
|
|
|
|
+ SMap.Map["toptype"] = "采购意向"
|
|
|
|
+ SMap.Map["subtype"] = "采购意向"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //3.针对 项目登记 相关数据处理,符合条件的归类为‘采购意向’
|
|
|
|
+ if u.IsPurchasingIntent(tmp) {
|
|
SMap.Map["toptype"] = "采购意向"
|
|
SMap.Map["toptype"] = "采购意向"
|
|
SMap.Map["subtype"] = "采购意向"
|
|
SMap.Map["subtype"] = "采购意向"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //针对 项目登记 相关数据处理,符合条件的归类为‘采购意向’
|
|
|
|
- if u.IsPurchasingIntent(tmp) {
|
|
|
|
- SMap.Map["toptype"] = "采购意向"
|
|
|
|
- SMap.Map["subtype"] = "采购意向"
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- // 针对用户行业分类,单独处理数据
|
|
|
|
|
|
+ //2.针对用户行业分类,单独处理数据
|
|
if mapInfo["stype"] == "yonghuhangye" || strings.TrimSpace(tt.S_name) == "用户行业分类" {
|
|
if mapInfo["stype"] == "yonghuhangye" || strings.TrimSpace(tt.S_name) == "用户行业分类" {
|
|
subs := SMap.Map["subscope_dy"]
|
|
subs := SMap.Map["subscope_dy"]
|
|
delete(SMap.Map, "topscope_dy")
|
|
delete(SMap.Map, "topscope_dy")
|
|
@@ -1671,7 +1700,7 @@ func UdpRunProjectForecast(sid, eid string) {
|
|
tools.Udpclient.WriteUdp(by, mu.OP_TYPE_DATA, addr)
|
|
tools.Udpclient.WriteUdp(by, mu.OP_TYPE_DATA, addr)
|
|
}
|
|
}
|
|
|
|
|
|
-// SendAi 调用大模型招标分类
|
|
|
|
|
|
+// SendAi 调用大模型招标分类;map[result:[结果-中标] status:200]
|
|
func SendAi(data map[string]interface{}, url string) (res map[string]interface{}) {
|
|
func SendAi(data map[string]interface{}, url string) (res map[string]interface{}) {
|
|
// 设置 2 秒的超时
|
|
// 设置 2 秒的超时
|
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|