diff --git a/example/admin/companyinout.go b/example/admin/companyinout.go index 35aa71f..1ecffa2 100644 --- a/example/admin/companyinout.go +++ b/example/admin/companyinout.go @@ -483,10 +483,10 @@ func decodeData2Sql(table [][]string, this *Context, orgId int) error { companyData["industry_id"] = industry.GetCeilInt("id") } - company := this.Db.Get("company", "id", Map{"sn": companyData["sn"]}) + company := this.Db.Get("company", "id", Map{"name": companyData["name"]}) //没有则创建 - if company == nil { - company = this.Db.Get("company", "id", Map{"name": companyData["name"]}) + if company == nil && companyData.GetString("sn") != "暂无" { + company = this.Db.Get("company", "id", Map{"sn": companyData["sn"]}) } //没有则创建 diff --git a/example/admin/org4.go b/example/admin/org4.go index 9b79b5b..8838ac6 100644 --- a/example/admin/org4.go +++ b/example/admin/org4.go @@ -495,9 +495,16 @@ func ctgAnalyse(datas []Map, totalAnalyse Map) Map { } resTotal["区域经营收入"] = resTotal.GetFloat64("区域经营收入") + uploadData.GetFloat64("IEDC2NYYSR") - resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + +uploadData.GetFloat64("IEDCYNSJ") + - uploadData.GetFloat64("IEDC2NYJSJ") + uploadData.GetFloat64("IEDCNSZE") + - uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") + if uploadData.GetFloat64("IEDCYNSJ") != 0 { + resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDCYNSJ") + } else { + resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDC2NYJSJ") + + uploadData.GetFloat64("IEDCNSZE") + + uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") + } + //resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + +uploadData.GetFloat64("IEDCYNSJ") + + // uploadData.GetFloat64("IEDC2NYJSJ") + uploadData.GetFloat64("IEDCNSZE") + + // uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") resTotal["区域资产总额"] = resTotal.GetFloat64("区域资产总额") + uploadData.GetFloat64("IEDCZCZE") resTotal["独角兽企业数"] = resTotal.GetInt("独角兽企业数") + uploadData.GetInt("IEDCDJSQY") + @@ -778,9 +785,13 @@ func totalAnalyse(datas []Map) (Map, Map, Map, Map) { } resTotal["区域经营收入"] = resTotal.GetFloat64("区域经营收入") + uploadData.GetFloat64("IEDC2NYYSR") - resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDCYNSJ") + - uploadData.GetFloat64("IEDC2NYJSJ") + uploadData.GetFloat64("IEDCNSZE") + - uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") + if uploadData.GetFloat64("IEDCYNSJ") != 0 { + resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDCYNSJ") + } else { + resTotal["区域纳税总值"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDC2NYJSJ") + + uploadData.GetFloat64("IEDCNSZE") + + uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") + } resTotal["区域资产总额"] = resTotal.GetFloat64("区域资产总额") + uploadData.GetFloat64("IEDCZCZE") @@ -923,7 +934,15 @@ func totalAnalyse(datas []Map) (Map, Map, Map, Map) { //6 resTotal[level+"类企业营业收入"] = resTotal.GetFloat64(level+"类企业营业收入") + uploadData.GetFloat64("IEDC2NYYSR") + uploadData.GetFloat64("IEDCYYSR") - resTotal[level+"类企业税收"] = resTotal.GetFloat64(level+"类企业税收") + uploadData.GetFloat64("IEDCYNSJ") + uploadData.GetFloat64("IEDCYJSJ") + //resTotal[level+"类企业税收"] = resTotal.GetFloat64(level+"类企业税收") + + // uploadData.GetFloat64("IEDCYNSJ") + uploadData.GetFloat64("IEDCYJSJ") + if uploadData.GetFloat64("IEDCYNSJ") != 0 { + resTotal[level+"类企业税收"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDCYNSJ") + } else { + resTotal[level+"类企业税收"] = resTotal.GetFloat64("区域纳税总值") + uploadData.GetFloat64("IEDC2NYJSJ") + + uploadData.GetFloat64("IEDCNSZE") + + uploadData.GetFloat64("IEDC2NSJSJ") + uploadData.GetFloat64("IEDCYJSJ") + } resTotal[level+"类企业占地面积"] = resTotal.GetFloat64(level+"类企业占地面积") + uploadData.GetFloat64("IEDCYDMJ") + uploadData.GetFloat64("IEDCZDMJ") resTotal[level+"类企业社保人数"] = resTotal.GetInt(level+"类企业社保人数") + uploadData.GetInt("IEDCSBRS") diff --git a/example/app/analyse.go b/example/app/analyse.go index 294d761..bd00d31 100644 --- a/example/app/analyse.go +++ b/example/app/analyse.go @@ -374,23 +374,23 @@ var analyseCtr = Ctr{ res["upload_data"] = res.GetMap("upload_data") res["collect_data"] = res.GetMap("collect_data") res["collect_data"] = res.GetMap("collect_data") - //if res.GetMap("collect_data") == nil && page == 1 { - // go func(res Map, this *Context) { - // path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json") - // - // data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path) - // - // if len(data) != 0 { - // data["path"] = path - // this.Db.Update("company", Map{"collect_data": data.ToJsonString(), - // "address": data.GetString("companyAddress"), - // "sn": data.GetString("creditNo"), - // "unit": data.GetString("authority"), - // }, Map{"id": res.GetCeilInt("id")}) - // res["collect_data"] = data - // } - // }(res, this) - //} + if res.GetMap("collect_data") == nil && page == 1 { + go func(res Map, this *Context) { + path := "company/" + Md5(res.GetString("name")) + time.Now().Format("/200601021504.json") + + data := getCompany(res.GetString("name"), this.Config.GetString("tpt")+"/"+path) + + if len(data) != 0 { + data["path"] = path + this.Db.Update("company", Map{"collect_data": data.ToJsonString(), + "address": data.GetString("companyAddress"), + "sn": data.GetString("creditNo"), + "unit": data.GetString("authority"), + }, Map{"id": res.GetCeilInt("id")}) + res["collect_data"] = data + } + }(res, this) + } } diff --git a/example/iedc.exe b/example/iedc.exe index a81f636..be7d504 100644 Binary files a/example/iedc.exe and b/example/iedc.exe differ