Browse Source

Merge commit '05260585a1eccbed830c78286ad364833b6bfc2b'

* commit '05260585a1eccbed830c78286ad364833b6bfc2b':
  字段替换
  字段替换
  添加日志
  是否是管理员添加

# Conflicts:
#	api/internal/types/types.go
Jianghan 9 months ago
parent
commit
090c68acb9

+ 1 - 10
api/etc/networkmanage.yaml

@@ -5,13 +5,4 @@ Timeout: 20000
 Gateway:
   ServerCode: networkManage
   Etcd:
-    - 192.168.3.207:2379
-    - 192.168.3.165:2379
-    - 192.168.3.204:2379
-Hosts:
-  - 192.168.3.207:2379
-  - 192.168.3.165:2379
-  - 192.168.3.204:2379
-UserCenterKey: "usercenter.rpc" #用户中台rpc
-PowerCheckCenterKey: "powercheck.rpc" #权益校验中台
-EntManageApplication: "entmanageapplication.rpc" #企业管理中台
+    - 127.0.0.1:2379

+ 3 - 0
api/internal/logic/findinitinfologic.go

@@ -3,6 +3,7 @@ package logic
 import (
 	"bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/service"
 	"context"
+	"log"
 
 	"bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/svc"
 	"bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/types"
@@ -25,6 +26,7 @@ func NewFindInitInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Find
 }
 
 func (l *FindInitInfoLogic) FindInitInfo(req *types.FindInitInfoReq) (resp *types.Reply, err error) {
+	log.Println("入参", req)
 	// todo: add your logic here and delete this line
 	resp = &types.Reply{}
 	initInfoService := &service.InitInfoService{
@@ -33,6 +35,7 @@ func (l *FindInitInfoLogic) FindInitInfo(req *types.FindInitInfoReq) (resp *type
 		EntId:        req.EntId,
 		PositionId:   req.PositionId,
 		EntUserId:    req.EntUserId,
+		EntRole:      req.EntRole,
 	}
 	data := initInfoService.FindInitInfo()
 	resp.Data = data

+ 1 - 0
api/internal/logic/updateinitinfologic.go

@@ -36,6 +36,7 @@ func (l *UpdateInitInfoLogic) UpdateInitInfo(req *types.UpdateInitInfoReq) (resp
 		EntId:        req.EntId,
 		PositionId:   req.PositionId,
 		EntUserId:    req.EntUserId,
+		EntRole:      req.EntRole,
 	}
 	fool := initInfoService.UpdateInitInfo(req.Company, req.Business)
 	if fool {

+ 14 - 16
api/internal/service/CoopHistoryService.go

@@ -28,22 +28,20 @@ var (
 )
 
 type ResultData struct {
-	SourceType       string  `json:"SourceType"`
-	EntName          string  `json:"EntName"`
-	EntId            string  `json:"EntId"`
-	EntPerson        string  `json:"EntPerson"`
-	Middleman        string  `json:"Middleman"`
-	ProjectNum       int     `json:"ProjectNum"`
-	TotalAmount      float64 `json:"TotalAmount"`
-	RecentTime       int64   `json:"RecentTime"`
-	NearlyYears      bool    `json:"NearlyYears"`
-	SupEnt           string  `json:"SupEnt"`       // 上级
-	NextEnt          string  `json:"NextEnt"`      // 下级
-	Relationship     string  `json:"Relationship"` // 关系
-	BuyerId          string  `json:"BuyerId"`
-	IsCreateCustomer bool    `json:"isCreateCustomer"`
-	IsIgnore         bool    `json:"isIgnore"`
-	IsMonitor        bool    `json:"isMonitor"`
+	SourceType   string  `json:"SourceType"`
+	EntName      string  `json:"EntName"`
+	EntId        string  `json:"EntId"`
+	EntPerson    string  `json:"EntPerson"`
+	Middleman    string  `json:"Middleman"`
+	ProjectNum   int     `json:"ProjectNum"`
+	TotalAmount  float64 `json:"TotalAmount"`
+	RecentTime   int64   `json:"RecentTime"`
+	NearlyYears  bool    `json:"NearlyYears"`
+	SupEnt       string  `json:"SupEnt"`       // 上级
+	NextEnt      string  `json:"NextEnt"`      // 下级
+	Relationship string  `json:"Relationship"` // 关系
+	BuyerId      string  `json:"BuyerId"`
+	IsIgnore     bool    `json:"isIgnore"`
 }
 
 type ResultDatas []*ResultData

+ 11 - 52
api/internal/service/owner.go

@@ -48,16 +48,14 @@ type OwnerService struct {
 }
 
 type BuyerProject struct {
-	BuyerId          string
-	BuyerName        string
-	Project          ProjectEntity
-	IsMonitor        bool
-	IsCreateCustomer bool
-	IsIgnore         bool
-	Area             string
-	Zbtime           int64
-	BuyerType        string
-	CId              string
+	BuyerId   string
+	BuyerName string
+	Project   ProjectEntity
+	IsMonitor bool
+	Area      string
+	Zbtime    int64
+	BuyerType string
+	CId       string
 }
 type ProjectEntity struct {
 	Number          int64
@@ -111,8 +109,9 @@ func (t *OwnerService) OwnerlList() map[string]interface{} {
 		}
 		//项目数量处理
 		projectMap, _, dataMap = ProjectHandle(buyerArr, t.EntAccountId, t.SearchEntName, t.Area, businessStr, dataMap)
+	} else {
+		return map[string]interface{}{}
 	}
-
 	endTime := time.Now().Unix()
 	fmt.Println("用时时间:", endTime-startTime)
 	if len(*dataMap) == 0 {
@@ -151,7 +150,6 @@ func (t *OwnerService) OwnerlList() map[string]interface{} {
 		if value.BuyerId != "" {
 			buyerIdArr = append(buyerIdArr, fmt.Sprintf("'%s'", value.BuyerId))
 		}
-
 	}
 	//可介绍业主人脉处理
 	a3 := time.Now().Unix()
@@ -648,45 +646,6 @@ func FindStatus(positionId int64) (map[string]bool, map[string]bool, map[string]
 	return untreatedMap, ignoredMap, createdMap
 }
 
-// 处理状态初始化
-func ProcessingStatusInit(positionId int64, dataMap *map[string]map[string]interface{}, processingStatus string) {
-	//收录数据处理
-	untreatedMap, ignoredMap, createdMap := FindStatus(positionId)
-	newMap := &map[string]map[string]interface{}{}
-	//所有采购单位和处理状态对比
-	for buyerId, value := range *dataMap {
-		if _, ok := ignoredMap[buyerId]; ok {
-			value["isIgnore"] = true
-		}
-		if _, ok := createdMap[buyerId]; ok {
-			value["isCreateCustomer"] = true
-		}
-		for _, v := range strings.Split(processingStatus, ",") {
-			switch v {
-			case "1":
-				if _, ok := untreatedMap[buyerId]; !ok {
-					(*newMap)[buyerId] = value
-				}
-			case "2":
-				if _, ok := ignoredMap[buyerId]; ok {
-					(*newMap)[buyerId] = value
-				}
-
-			case "3":
-				if _, ok := createdMap[buyerId]; ok {
-					(*newMap)[buyerId] = value
-				}
-			case "全部", "":
-				(*newMap)[buyerId] = value
-			}
-		}
-
-	}
-	if newMap != nil {
-		*dataMap = *newMap
-	}
-}
-
 // 采购单位查询
 func BuyerList(partyA, supplier, heterotophy, intermediary, agency string, positionId int64) *map[string]map[string]interface{} {
 	dataMap := &map[string]map[string]interface{}{}
@@ -758,7 +717,7 @@ func BuyerList(partyA, supplier, heterotophy, intermediary, agency string, posit
 	return dataMap
 }
 
-// 项目数量查
+// 项目数量查
 func ProjectHandle(buyerArr []string, entAccountId int64, entName, area, businessStr string, dataMap *map[string]map[string]interface{}) (*map[string]map[string]interface{}, *map[string]map[string]interface{}, *map[string]map[string]interface{}) {
 	projectMap := &map[string]map[string]interface{}{}
 	returnMap := &map[string]map[string]interface{}{}

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

@@ -191,3 +191,34 @@ type UpdateInitInfoReq struct {
 	EntName      string `header:"entName,optional"`
 	EntDeptId    int64  `header:"entDeptId,optional"`
 }
+<<<<<<< HEAD
+=======
+
+type FindInitInfoReq struct {
+	EntId        int64  `header:"entId,optional"`
+	MgoUserId    string `header:"mgoUserId,optional"` //原userId
+	PositionType int64  `header:"positionType,optional"`
+	NewUserId    int64  `header:"newUserId"`
+	AccountId    int64  `header:"accountId,optional"`
+	PositionId   int64  `header:"positionId,optional"`
+	EntUserId    int64  `header:"entUserId,optional"`
+	EntRole      int64  `header:"entRole,optional"`
+}
+
+type PrMonitorListReq struct {
+	MgoUserId  string `header:"mgoUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	PageSize   int    `json:"pageSize"`
+	PageNum    int    `json:"pageNum"`
+}
+
+type PrCollectListReq struct {
+	UserId     string `header:"userId,optional"`
+	MgoUserId  string `header:"mgoUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	EntId      int64  `header:"entId,optional"`
+	PageSize   int    `json:"pageSize"`
+	PageNum    int    `json:"pageNum"`
+}
+>>>>>>> 05260585a1eccbed830c78286ad364833b6bfc2b

+ 1 - 0
api/networkmanage.api

@@ -159,6 +159,7 @@ type (
 		AccountId    int64  `header:"accountId,optional"`
 		PositionId   int64  `header:"positionId,optional"`
 		EntUserId    int64  `header:"entUserId,optional"`
+		EntRole      int64  `header:"entRole,optional"`
 	}
 	PrMonitorListReq {
 		MgoUserId  string `header:"mgoUserId,optional"`