xuzhiheng 1 жил өмнө
parent
commit
8682586244

+ 10 - 0
api/biService.api

@@ -48,6 +48,14 @@ type (
 		IsTask     int64                    `json:"isTask"`
 		IsTask     int64                    `json:"isTask"`
 	}
 	}
 
 
+	DistributeClueShowReq {
+		ClueIdList string                   `json:"clueIdList"`
+		Datas      []map[string]interface{} `json:"datas"`
+		PositionId int64                    `header:"positionId,optional"`
+		IsTask     int64                    `json:"isTask"`
+		DataType   int64                    `json:"dataType"`
+	}
+
 	ClueImportReq {
 	ClueImportReq {
 		PositionId int64  `header:"positionId,optional"`
 		PositionId int64  `header:"positionId,optional"`
 		Pcbh       string `json:"pcbh"`
 		Pcbh       string `json:"pcbh"`
@@ -116,6 +124,8 @@ service biService-api {
 	post /biService/call (callReq) returns (biResp)	//拨打电话
 	post /biService/call (callReq) returns (biResp)	//拨打电话
 	@handler DistributeClue
 	@handler DistributeClue
 	post /biService/distributeClue (DistributeClueReq) returns (biResp)
 	post /biService/distributeClue (DistributeClueReq) returns (biResp)
+	@handler DistributeClueShow
+	post /biService/distributeClueShow (DistributeClueShowReq) returns (biResp)
 	@handler ClueImport
 	@handler ClueImport
 	post /biService/clueImport (ClueImportReq) returns (biResp)
 	post /biService/clueImport (ClueImportReq) returns (biResp)
 	@handler ClueAdd
 	@handler ClueAdd

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

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

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

@@ -42,6 +42,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/biService/distributeClue",
 				Path:    "/biService/distributeClue",
 				Handler: DistributeClueHandler(serverCtx),
 				Handler: DistributeClueHandler(serverCtx),
 			},
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/distributeClueShow",
+				Handler: DistributeClueShowHandler(serverCtx),
+			},
 			{
 			{
 				Method:  http.MethodPost,
 				Method:  http.MethodPost,
 				Path:    "/biService/clueImport",
 				Path:    "/biService/clueImport",

+ 46 - 0
api/internal/logic/distributeclueshowlogic.go

@@ -0,0 +1,46 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
+	"bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
+	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type DistributeClueShowLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewDistributeClueShowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DistributeClueShowLogic {
+	return &DistributeClueShowLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *DistributeClueShowLogic) DistributeClueShow(req *types.DistributeClueShowReq) (resp *types.BiResp, err error) {
+	// todo: add your logic here and delete this line
+
+	datas := []*biservice.DistributeClueShows{}
+	for _, v := range req.Datas {
+		data := &biservice.DistributeClueShows{
+			PositionId:       gconv.Int64(v["positionId"]),
+			DistributedCount: gconv.Int64(v["distributedCount"]),
+		}
+		datas = append(datas, data)
+	}
+	res, err := l.svcCtx.BiServiceRpc.DistributeClueShow(l.ctx, &biservice.DistributeClueShowReq{
+		DataType:   req.DataType,
+		ClueIdList: req.ClueIdList,
+		PositionId: req.PositionId,
+		Datas:      datas,
+		IsTask:     req.IsTask,
+	})
+	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
+}

+ 8 - 0
api/internal/types/types.go

@@ -48,6 +48,14 @@ type DistributeClueReq struct {
 	IsTask     int64                    `json:"isTask"`
 	IsTask     int64                    `json:"isTask"`
 }
 }
 
 
+type DistributeClueShowReq struct {
+	ClueIdList string                   `json:"clueIdList"`
+	Datas      []map[string]interface{} `json:"datas"`
+	PositionId int64                    `header:"positionId,optional"`
+	IsTask     int64                    `json:"isTask"`
+	DataType   int64                    `json:"dataType"`
+}
+
 type ClueImportReq struct {
 type ClueImportReq struct {
 	PositionId int64  `header:"positionId,optional"`
 	PositionId int64  `header:"positionId,optional"`
 	Pcbh       string `json:"pcbh"`
 	Pcbh       string `json:"pcbh"`