|
@@ -482,6 +482,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
pMyType += vv.Type
|
|
pMyType += vv.Type
|
|
myChildIds, myChildTypes := "", ""
|
|
myChildIds, myChildTypes := "", ""
|
|
compareId := fmt.Sprint(vv.Id)
|
|
compareId := fmt.Sprint(vv.Id)
|
|
|
|
+ thisLength := len(checkCode)
|
|
if in.Id == "" && v.Name == "甲方" {
|
|
if in.Id == "" && v.Name == "甲方" {
|
|
cccNodes := []*nodeTree{}
|
|
cccNodes := []*nodeTree{}
|
|
cccIndexMap := map[string]int{}
|
|
cccIndexMap := map[string]int{}
|
|
@@ -562,6 +563,9 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
for _, cccNode := range cccNodes {
|
|
for _, cccNode := range cccNodes {
|
|
*convList = append(*convList, cccNode)
|
|
*convList = append(*convList, cccNode)
|
|
}
|
|
}
|
|
|
|
+ if in.CheckCode != "" {
|
|
|
|
+ compareId = "-1"
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
if id != "" {
|
|
if id != "" {
|
|
id += ","
|
|
id += ","
|
|
@@ -601,7 +605,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
MYTYPE: vv.Type,
|
|
MYTYPE: vv.Type,
|
|
}
|
|
}
|
|
//如果甲方的子节点被选中了,父节点跟着被选中,非甲方的要对比子节点可介绍业主
|
|
//如果甲方的子节点被选中了,父节点跟着被选中,非甲方的要对比子节点可介绍业主
|
|
- if v.Name != "甲方" && ((in.ClickId != "" && in.ClickId == fmt.Sprint(vv.Id)) || (in.CheckCode != "" && compareId == fmt.Sprint(vv.Id))) {
|
|
|
|
|
|
+ if thisLength == len(checkCode) && ((in.ClickId != "" && in.ClickId == fmt.Sprint(vv.Id)) || (in.CheckCode != "" && compareId == fmt.Sprint(vv.Id))) {
|
|
checkCode = append(checkCode, cm.CODE)
|
|
checkCode = append(checkCode, cm.CODE)
|
|
}
|
|
}
|
|
*convList = append(*convList, cm)
|
|
*convList = append(*convList, cm)
|
|
@@ -614,7 +618,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
}
|
|
}
|
|
sort.Sort(convList)
|
|
sort.Sort(convList)
|
|
*parentConvList = append(*parentConvList, *convList...)
|
|
*parentConvList = append(*parentConvList, *convList...)
|
|
- var newCheckCode []string
|
|
|
|
|
|
+ newCheckCode := []string{}
|
|
if in.CheckCode != "" {
|
|
if in.CheckCode != "" {
|
|
m := map[string]bool{}
|
|
m := map[string]bool{}
|
|
for _, v := range strings.Split(in.CheckCode, ",") {
|
|
for _, v := range strings.Split(in.CheckCode, ",") {
|
|
@@ -628,7 +632,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
} else {
|
|
} else {
|
|
newCheckCode = checkCode
|
|
newCheckCode = checkCode
|
|
}
|
|
}
|
|
- if in.CheckCode == "" && in.ClickId == "" && len(checkCode) == 0 && len(*parentConvList) > 0 && (*parentConvList)[0].SZ_LEVEL == 0 {
|
|
|
|
|
|
+ if in.CheckCode == "" && in.ClickId == "" && len(newCheckCode) == 0 && len(*parentConvList) > 0 && (*parentConvList)[0].SZ_LEVEL == 0 {
|
|
if (*parentConvList)[0].NAME == "甲方" {
|
|
if (*parentConvList)[0].NAME == "甲方" {
|
|
var level1 *nodeTree
|
|
var level1 *nodeTree
|
|
var level2 *nodeTree
|
|
var level2 *nodeTree
|
|
@@ -648,18 +652,18 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if level3 != nil && level2 != nil && level1 != nil && level3.SZ_PID2 == level2.CODE && level2.SZ_PID1 == level1.CODE {
|
|
if level3 != nil && level2 != nil && level1 != nil && level3.SZ_PID2 == level2.CODE && level2.SZ_PID1 == level1.CODE {
|
|
- checkCode = append(checkCode, level3.CODE)
|
|
|
|
|
|
+ newCheckCode = append(newCheckCode, level3.CODE)
|
|
} else if level2 != nil && level1 != nil && level2.SZ_PID1 == level1.CODE {
|
|
} else if level2 != nil && level1 != nil && level2.SZ_PID1 == level1.CODE {
|
|
- checkCode = append(checkCode, level2.CODE)
|
|
|
|
|
|
+ newCheckCode = append(newCheckCode, level2.CODE)
|
|
} else if level1 != nil {
|
|
} else if level1 != nil {
|
|
- checkCode = append(checkCode, level1.CODE)
|
|
|
|
|
|
+ newCheckCode = append(newCheckCode, level1.CODE)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
for _, v := range *parentConvList {
|
|
for _, v := range *parentConvList {
|
|
if (*parentConvList)[0].NAME != v.SZ_PID0 {
|
|
if (*parentConvList)[0].NAME != v.SZ_PID0 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
- checkCode = append(checkCode, v.CODE)
|
|
|
|
|
|
+ newCheckCode = append(newCheckCode, v.CODE)
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -668,7 +672,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
Data: map[string]interface{}{
|
|
Data: map[string]interface{}{
|
|
"count": count,
|
|
"count": count,
|
|
"list": parentConvList,
|
|
"list": parentConvList,
|
|
- "checked": checkCode,
|
|
|
|
|
|
+ "checked": newCheckCode,
|
|
},
|
|
},
|
|
}
|
|
}
|
|
redis.Put("newother", key, reply, C.CacheTimeOut)
|
|
redis.Put("newother", key, reply, C.CacheTimeOut)
|