|
@@ -48,7 +48,7 @@ func FormatDate(src *interface{}) string {
|
|
|
}
|
|
|
|
|
|
func GetEntInfo(id string) map[string]interface{} {
|
|
|
- res := mongodbutil.FindById("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1,"SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1,"staffinfo":1,"RegCapCurName":1,"excDirect":1}`)
|
|
|
+ res := mongodbutil.FindById("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1,"SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1,"staffinfo":1,"RegCapCurName":1,"Ycml":1,"i_scale":1}`)
|
|
|
if res != nil && len(*res) > 0 {
|
|
|
opl, _ := (*res)["OpLocDistrict"].(string)
|
|
|
if len(opl) >= 2 {
|
|
@@ -67,17 +67,18 @@ func GetEntInfo(id string) map[string]interface{} {
|
|
|
(*res)["OpFrom"] = FormatDate(&OpFrom)
|
|
|
}
|
|
|
OpTo := (*res)["OpTo"]
|
|
|
- if OpFrom != nil {
|
|
|
+ if OpTo != nil {
|
|
|
(*res)["OpTo"] = FormatDate(&OpTo)
|
|
|
}
|
|
|
IssBLicDate := (*res)["IssBLicDate"]
|
|
|
- if OpFrom != nil {
|
|
|
+ if IssBLicDate != nil {
|
|
|
(*res)["IssBLicDate"] = FormatDate(&IssBLicDate)
|
|
|
}
|
|
|
EstDate := (*res)["EstDate"]
|
|
|
- if OpFrom != nil {
|
|
|
+ if EstDate != nil {
|
|
|
(*res)["EstDate"] = FormatDate(&EstDate)
|
|
|
}
|
|
|
+ (*res)["EntTypeCopy"] = (*res)["EntType"]
|
|
|
var EntType string
|
|
|
if (*res)["EntType"] != nil && (*res)["EntType"].(string) != "" {
|
|
|
EntType = (*res)["EntType"].(string)
|
|
@@ -323,22 +324,67 @@ func findRelation(certype, cerno, name, rtype string, level int, ls *list.List,
|
|
|
|
|
|
//存储节点,只关心3个元素,节点名称、节点id、关系节点id
|
|
|
func storeNode(data *map[string]interface{}, ls *list.List, dir /*方向反转*/ bool, level int) {
|
|
|
- invtype := fmt.Sprint((*data)["invtype"])
|
|
|
+ invtype := ""
|
|
|
+ if (*data)["invtype"] != nil {
|
|
|
+ invtype = fmt.Sprint((*data)["invtype"])
|
|
|
+ }
|
|
|
//invcertype, _ := (*data)["invcertype"].(string)
|
|
|
- invcerno := fmt.Sprint((*data)["invcerno"])
|
|
|
- invname := fmt.Sprint((*data)["invname"])
|
|
|
- entregno := fmt.Sprint((*data)["entregno"])
|
|
|
- entname := fmt.Sprint((*data)["entname"])
|
|
|
- invweight := fmt.Sprint((*data)["weight"])
|
|
|
- invacconam := fmt.Sprint((*data)["invacconam"])
|
|
|
- regcap := fmt.Sprint((*data)["regcap"])
|
|
|
- invregcap := fmt.Sprint((*data)["invregcap"])
|
|
|
- legcerno := fmt.Sprint((*data)["legcerno"])
|
|
|
- opstate := fmt.Sprint((*data)["opstate"])
|
|
|
- invopstate := fmt.Sprint((*data)["invopstate"])
|
|
|
- regcapcurname := fmt.Sprint((*data)["regcapcurname"])
|
|
|
- shortname := fmt.Sprint((*data)["shortname"])
|
|
|
- entmid := util.BsonIdToSId((*data)["entmid"])
|
|
|
+ invcerno := ""
|
|
|
+ if (*data)["invcerno"] != nil {
|
|
|
+ invcerno = fmt.Sprint((*data)["invcerno"])
|
|
|
+ }
|
|
|
+ invname := ""
|
|
|
+ if (*data)["invname"] != nil {
|
|
|
+ invname = fmt.Sprint((*data)["invname"])
|
|
|
+ }
|
|
|
+ entregno := ""
|
|
|
+ if (*data)["entregno"] != nil {
|
|
|
+ entregno = fmt.Sprint((*data)["entregno"])
|
|
|
+ }
|
|
|
+ entname := ""
|
|
|
+ if (*data)["entname"] != nil {
|
|
|
+ entname = fmt.Sprint((*data)["entname"])
|
|
|
+ }
|
|
|
+ invweight := "0"
|
|
|
+ if (*data)["weight"] != nil {
|
|
|
+ invweight = fmt.Sprint((*data)["weight"])
|
|
|
+ }
|
|
|
+ invacconam := "0"
|
|
|
+ if (*data)["invacconam"] != nil {
|
|
|
+ invacconam = fmt.Sprint((*data)["invacconam"])
|
|
|
+ }
|
|
|
+ regcap := "0"
|
|
|
+ if (*data)["regcap"] != nil {
|
|
|
+ regcap = fmt.Sprint((*data)["regcap"])
|
|
|
+ }
|
|
|
+ invregcap := "0"
|
|
|
+ if (*data)["invregcap"] != nil {
|
|
|
+ invregcap = fmt.Sprint((*data)["invregcap"])
|
|
|
+ }
|
|
|
+ legcerno := ""
|
|
|
+ if (*data)["legcerno"] != nil {
|
|
|
+ legcerno = fmt.Sprint((*data)["legcerno"])
|
|
|
+ }
|
|
|
+ opstate := ""
|
|
|
+ if (*data)["opstate"] != nil {
|
|
|
+ opstate = fmt.Sprint((*data)["opstate"])
|
|
|
+ }
|
|
|
+ invopstate := ""
|
|
|
+ if (*data)["invopstate"] != nil {
|
|
|
+ invopstate = fmt.Sprint((*data)["invopstate"])
|
|
|
+ }
|
|
|
+ regcapcurname := ""
|
|
|
+ if (*data)["regcapcurname"] != nil {
|
|
|
+ regcapcurname = fmt.Sprint((*data)["regcapcurname"])
|
|
|
+ }
|
|
|
+ shortname := ""
|
|
|
+ if (*data)["shortname"] != nil {
|
|
|
+ shortname = fmt.Sprint((*data)["shortname"])
|
|
|
+ }
|
|
|
+ entmid := ""
|
|
|
+ if (*data)["entmid"] != nil {
|
|
|
+ entmid = util.BsonIdToSId((*data)["entmid"])
|
|
|
+ }
|
|
|
ls.PushBack([]string{invtype, invcerno, invname, entregno, entname, strconv.Itoa(level), invweight, invacconam, regcap, invregcap, legcerno, opstate, invopstate, regcapcurname, util.BsonIdToSId((*data)["_id"]), shortname, entmid})
|
|
|
}
|
|
|
|