소스 검색

忽略操作

Jianghan 1 년 전
부모
커밋
e930f25c81

+ 18 - 0
api/application.api

@@ -206,6 +206,11 @@ type (
 		EntId        string `header:"entId,optional"`
 		EntUserId    string `header:"entUserId,optional"`
 		DeptId       string `header:"deptId,optional"` //部门id
+		PartyA       string `json:"partyA,optional"` //甲方
+		Supplier     string `json:"supplier,optional"` //供应商
+		Heterotophy  string `json:"heterotophy,optional"` //同甲异业
+		Intermediary string `json:"intermediary,optional"` //中间人
+		Agency       string `json:"agency,optional"` //代理机构
 		PageNum      int64  `json:"pageNum"`
 		PageSize     int64  `json:"pageSize"`
 		BusinessType string `json:"businessType"`
@@ -267,6 +272,15 @@ type (
 		Current_page    string `json:"current_page,optional"`
 		Project_matchme string `json:"project_matchme,optional"`
 	}
+	IgnoreReq {
+		PositionId int64  `header:"positionId"`
+		EntUserId  int64  `header:"entUserId,optional"`
+		EntId      int64  `header:"entId,optional"`
+		EntDeptId  int64  `header:"entDeptId,optional"`
+		RelateId   string `json:"relateId,optional"`
+		Source     int    `json:"source,optional"`
+		Action     int    `json:"action,optional"`
+	}
 )
 
 @server (
@@ -353,5 +367,9 @@ service crmApplication {
 	@doc "人脉库-列表"
 	@handler list
 	post /crmApplication/network/list (NetWorkListReq) returns (Reply)
+
+	@doc "忽略操作"
+	@handler ignoreAction
+	post /crmApplication/ignore/action (IgnoreReq) returns (Reply)
 }
 

+ 28 - 0
api/internal/handler/ignoreactionhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/logic"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func ignoreActionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IgnoreReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewIgnoreActionLogic(r.Context(), svcCtx)
+		resp, err := l.IgnoreAction(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 5 - 0
api/internal/handler/routes.go

@@ -47,6 +47,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/crmApplication/file/upload",
 				Handler: fileUploadHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/crmApplication/ignore/action",
+				Handler: ignoreActionHandler(serverCtx),
+			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/crmApplication/ignore/operate",

+ 75 - 0
api/internal/logic/ignoreactionlogic.go

@@ -0,0 +1,75 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jybase/date"
+	T "bp.jydev.jianyu360.cn/CRM/application/api/common"
+	"context"
+	"time"
+
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
+	"bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type IgnoreActionLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewIgnoreActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IgnoreActionLogic {
+	return &IgnoreActionLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *IgnoreActionLogic) IgnoreAction(req *types.IgnoreReq) (resp *types.Reply, err error) {
+	resp = &types.Reply{}
+	query := map[string]interface{}{
+		"position_id": req.PositionId,
+		"itype":       req.Source,
+		"relate_id":   req.RelateId,
+	}
+	info := T.CrmMysql.FindOne("connection_status", query, "id", "")
+	if info != nil && len(*info) > 0 {
+		update := map[string]interface{}{
+			"is_ignore": req.Action,
+		}
+		if req.Action == 1 {
+			update["is_handle"] = 1
+		}
+		b := T.CrmMysql.Update("connection_status", query, update)
+		if !b {
+			resp.Error_code = -1
+			resp.Error_msg = "更新失败"
+		}
+
+	} else {
+		if req.Action == 1 {
+			save := map[string]interface{}{
+				"position_id": req.PositionId,
+				"ent_id":      req.EntId,
+				"ent_dept_id": req.EntDeptId,
+				"ent_user id": req.EntUserId,
+				"relate_id":   req.RelateId,
+				"itype":       req.Source,
+				"is_handle":   1,
+				"is_ignore":   req.Action,
+				"create_time": time.Now().Format(date.Date_Full_Layout),
+				"update_time": time.Now().Format(date.Date_Full_Layout),
+			}
+			i := T.CrmMysql.Insert("connection_status", save)
+			if i <= 0 {
+				resp.Error_code = -1
+				resp.Error_msg = "更新失败"
+			}
+		} else {
+			resp.Error_code = -1
+			resp.Error_msg = "更新失败"
+		}
+	}
+	return
+}

+ 5 - 0
api/internal/service/plistService.go

@@ -1,6 +1,7 @@
 package service
 
 import (
+	"bp.jydev.jianyu360.cn/CRM/application/service"
 	"context"
 	"fmt"
 	"strings"
@@ -41,6 +42,10 @@ type ProjectEntry struct {
 }
 
 func GetProjectList(req *types.ProjectListReq) (resultList []map[string]interface{}, hasNextPage bool, total int) {
+
+	buyerM := service.BuyerList(req.PartyA, req.Supplier, req.Heterotophy, req.Intermediary, req.Agency)
+	service.MonitorStatusInit(req.PositionId, buyerM, t.SourceType)
+
 	preSales := preSalesStatus(req.PositionId)
 	isSqlPage := false
 	if req.SaleStatus == 0 {

+ 16 - 1
api/internal/types/types.go

@@ -159,6 +159,16 @@ type IgnoreOperateReq struct {
 	EmployType int64  `json:"employType"` //来源方式来源;1招标采购、2企业、3采购单位、4拟在建项目
 }
 
+type IgnoreReq struct {
+	PositionId int64  `header:"positionId"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	EntDeptId  int64  `header:"entDeptId,optional"`
+	RelateId   string `json:"relateId,optional"`
+	Source     int    `json:"source,optional"`
+	Action     int    `json:"action,optional"`
+}
+
 type InfoEmployinfoReq struct {
 	AppId        string `header:"appId,default=10000"`
 	BaseUserId   int64  `header:"newUserId"`
@@ -217,7 +227,12 @@ type ProjectListReq struct {
 	PositionId   int64  `header:"positionId,optional"`
 	EntId        string `header:"entId,optional"`
 	EntUserId    string `header:"entUserId,optional"`
-	DeptId       string `header:"deptId,optional"` //部门id
+	DeptId       string `header:"deptId,optional"`     //部门id
+	PartyA       string `json:"partyA,optional"`       //甲方
+	Supplier     string `json:"supplier,optional"`     //供应商
+	Heterotophy  string `json:"heterotophy,optional"`  //同甲异业
+	Intermediary string `json:"intermediary,optional"` //中间人
+	Agency       string `json:"agency,optional"`       //代理机构
 	PageNum      int64  `json:"pageNum"`
 	PageSize     int64  `json:"pageSize"`
 	BusinessType string `json:"businessType"`