Sfoglia il codice sorgente

是否是管理员添加

WH01243 9 mesi fa
parent
commit
e4c2c8abf4

+ 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

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

@@ -33,6 +33,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 - 17
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
@@ -329,7 +327,6 @@ func LastTimeCoop(buyerId, ent, stype string) (bool, int64) {
 	return near, zbtime
 }
 
-//
 func LastTimeCoopBath(positionId int64, buyerIds, winners, agencys []string) (map[string]map[string]*Cooperate, map[string]map[string]*Cooperate) {
 	if len(buyerIds) > 50 {
 		buyerIds = buyerIds[:50]

+ 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{}{}

+ 2 - 4
api/internal/types/types.go

@@ -149,12 +149,11 @@ type UpdateInitInfoReq struct {
 	Company      string `json:"company,optional"`
 	EntId        int64  `header:"entId,optional"`
 	MgoUserId    string `header:"mgoUserId,optional"` //原userId
-	NewUserId    int64  `header:"newUserId"`
-	AccountId    int64  `header:"accountId,optional"`
 	PositionId   int64  `header:"positionId,optional"`
 	PositionType int64  `header:"positionType,optional"`
 	EntUserId    int64  `header:"entUserId,optional"`
 	EntRole      int64  `header:"entRole,optional"`
+	NewUserId    int64  `header:"newUserId,optional"`
 	EntName      string `header:"entName,optional"`
 	EntDeptId    int64  `header:"entDeptId,optional"`
 }
@@ -163,10 +162,9 @@ 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 {