Jianghan 1 سال پیش
والد
کامیت
d1a32aa422
2فایلهای تغییر یافته به همراه14 افزوده شده و 12 حذف شده
  1. 2 2
      api/internal/logic/infodetaillogic.go
  2. 12 10
      api/internal/service/plistService.go

+ 2 - 2
api/internal/logic/infodetaillogic.go

@@ -47,11 +47,11 @@ func (l *InfoDetailLogic) InfoDetail(req *types.InfoDetailReq) (resp *types.Repl
 	row := T.ClickhouseConn.QueryRow(context.TODO(), sql, req.InfoId)
 	err1 := row.ScanStruct(&info)
 	if err1 == nil {
-		info.DataJsonId = encrypt.CommonEncodeArticle("content", info.DataJsonId)
+		info.DataJsonId = encrypt.EncodeArticleId2ByCheck(info.DataJsonId)
 		binfo, b := T.MgoBidding.FindById("bidding", info.DataJsonId, map[string]interface{}{"title": 1, "projectname": 1})
 		if b && binfo != nil && len(*binfo) > 0 {
 			info.ProjectName = common.ObjToString((*binfo)["projectname"])
-			info.Href = fmt.Sprintf("/article/content/%s.html", encrypt.CommonEncodeArticle("content", info.DataJsonId))
+			info.Href = fmt.Sprintf("/article/content/%s.html", encrypt.EncodeArticleId2ByCheck(info.DataJsonId))
 		}
 		resp.Data = info
 	} else {

+ 12 - 10
api/internal/service/plistService.go

@@ -9,6 +9,7 @@ import (
 	"context"
 	"fmt"
 	"github.com/shopspring/decimal"
+	"strconv"
 	"strings"
 )
 
@@ -53,7 +54,8 @@ type ProjectEntry struct {
 	SourceType    string          `json:"SourceType"` // firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	Person        string          `json:"Person"`
 	Num           int             `json:"Num"`
-	FocusId       string          `json:"FocusId"`
+	FocusId       string          `json:"FocusId"` // 监控主键
+	IsFocus       int             `json:"IsFocus"`
 }
 
 func GetProjectList(req *types.ProjectListReq) (resultList []*ProjectEntry, hasNextPage bool, total int) {
@@ -226,22 +228,25 @@ func getQuerySql(req *types.ProjectListReq, isPage bool, buyerArr []string) (cou
 // @Date 2024/4/18
 func filterData(req *types.ProjectListReq, resultList []*ProjectEntry, preSales, mmp map[string]interface{}, isSqlPage bool) []*ProjectEntry {
 	var newList []*ProjectEntry
-	f := make(map[string]int, 3)
-	if strings.Contains(req.SaleStatus, "1") {
+	f := make(map[string]int, 1)
+	if req.SaleStatus == "1" {
 		f["is_handle"] = 0
-	} else if strings.Contains(req.SaleStatus, "2") {
+	} else if req.SaleStatus == "2" {
 		f["is_ignore"] = 1
-	} else if strings.Contains(req.SaleStatus, "3") {
+	} else if req.SaleStatus == "3" {
 		f["is_create"] = 1
 	}
 	for _, m := range resultList {
+		// 处理/忽略/销售机会
 		if m1, ok := preSales[m.ProjectId].(map[string]interface{}); ok {
+			m.IsIgnore = common.IntAll(m1["is_handle"])
 			m.IsIgnore = common.IntAll(m1["is_ignore"])
 			m.IsCreate = common.IntAll(m1["is_create"])
 		}
+		// 监控
 		for _, s := range strings.Split(m.InfoId, ",") {
 			if mmp[s] != nil {
-				m.IsHandle = 1
+				m.IsFocus = 1
 				m.FocusId = common.ObjToString(mmp[s])
 				break
 			}
@@ -250,13 +255,10 @@ func filterData(req *types.ProjectListReq, resultList []*ProjectEntry, preSales,
 			for k, v := range f {
 				if k == "is_handle" && m.IsHandle == v {
 					newList = append(newList, m)
-					break
 				} else if k == "is_ignore" && m.IsIgnore == v {
 					newList = append(newList, m)
-					break
 				} else if k == "is_create" && m.IsCreate == v {
 					newList = append(newList, m)
-					break
 				}
 			}
 		}
@@ -384,7 +386,7 @@ func MonitorStatus(uid string) map[string]interface{} {
 	m1 := make(map[string]interface{})
 	info := T.BaseMysql.SelectBySql(sql_4, uid)
 	for _, m := range *info {
-		m1[common.ObjToString(m["s_id"])] = util.EncodeId(common.ObjToString(m["id"]))
+		m1[common.ObjToString(m["s_id"])] = util.EncodeId(strconv.Itoa(common.IntAll(m["id"])))
 	}
 	return m1
 }