iedc-go/example/admin/org4.go
2022-02-24 06:26:36 +08:00

1192 lines
44 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package admin
import (
. "../../common"
"fmt"
"sort"
"strings"
)
type Org4 struct {
}
func (that *Org4) analyse(data Map) Map {
res := Map{}
//亩均收入
res["MJSR"] = data.GetFloat64("IEDC2NYYSR") / data.GetFloat64("IEDCYDMJ")
res["MJSRDF"] = "" //亩均收入得分
//亩均税收
res["MJSS"] = data.GetFloat64("IEDCYNSJ") / data.GetFloat64("IEDCYDMJ")
res["MJSSDF"] = "" //亩均税收得分
//人均收入
res["RJSR"] = data.GetFloat64("IEDC2NYYSR") / data.GetFloat64("IEDCSBRS")
res["RJSRDF"] = "" //人均收入得分
//研发经费投入强度
res["YFJFTRQD"] = data.GetFloat64("IEDCNYFFY") / data.GetFloat64("IEDC2NYYSR")
res["YFJFTRQDDF"] = "" //研发经费投入强度得分
//单位能耗税收
res["DWNHSS"] = data.GetFloat64("IEDCYNSJ") / data.GetFloat64("IEDCZHNH")
res["DWNHSSDF"] = "" //单位能耗税收得分
//主要污染物税收
//不足1按1计算
if data.GetFloat64("IEDCZYWRWPFDL") < 1 {
data["IEDCZYWRWPFDL"] = 1
}
res["ZYWRWSS"] = data.GetFloat64("IEDCYNSJ") / data.GetFloat64("IEDCZYWRWPFDL")
res["ZYWRWSSDF"] = "" //主要污染物税收
res["NXZBDF"] = "" //6项指标得分
for k, _ := range res {
if res.GetString(k) == "无" {
res[k] = "否"
}
}
//独角兽、瞪羚企业得分,一个一分
res["DJSDLQYDF"] = 0
if data.GetString("IEDCDJSQY") != "" && data.GetString("IEDCDJSQY") != "否" {
res["DJSDLQYDF"] = res.GetFloat64("DJSDLQYDF") + 1
}
if data.GetString("IEDCDLQY ") != "" && data.GetString("IEDCDLQY") != "否" {
res["DJSDLQYDF"] = res.GetFloat64("DJSDLQYDF") + 1
}
//企业获得国家级、省级、市级企业技术中心,国家级省级得1分市级得0.5
res["JSZXDF"] = 0
//国家级及省级
if (data.GetString("IEDCGJJQYJSZX") != "" && data.GetString("IEDCGJJQYJSZX") != "否") || //国家级
(data.GetString("IEDCSJQYJSZX") != "" && data.GetString("IEDCSJQYJSZX") != "否") || //省级
(data.GetString("IEDCGJJGCJSZX") != "" && data.GetString("IEDCGJJGCJSZX") != "否") || //国家级
(data.GetString("IEDCSJGCJSZX") != "" && data.GetString("IEDCSJGCJSZX") != "否") { //省级
res["JSZXDF"] = res.GetFloat64("JSZXDF") + 1
} else
//市级
if (data.GetString("IEDCSJQYJSZX0") != "" && data.GetString("IEDCSJQYJSZX0") != "否") ||
(data.GetString("IEDCSJGCJSZX0") != "" && data.GetString("IEDCSJQYJSZX") != "否") {
res["JSZXDF"] = res.GetFloat64("JSZXDF") + 0.5
}
//研发费用得分
res["YFFYDF"] = 0
if data.GetString("IEDCTRQD1WHZ3YS") != "" && data.GetString("IEDCTRQD1WHZ3YS") != "否" {
res["YFFYDF"] = 1
}
//高新技术企业得分
res["GXJSQYDF"] = 0
if data.GetString("IEDCGXJSQY") != "" && data.GetString("IEDCGXJSQY") != "否" {
res["GXJSQYDF"] = 1
}
//发展潜力总分
res["FZQLDF"] = res.GetFloat64("GXJSQYDF") + res.GetFloat64("YFFYDF") +
res.GetFloat64("JSZXDF") + res.GetFloat64("DJSDLQYDF")
//首台(套)、首批次、首版次企业
res["STTDF"] = 0
if data.GetString("IEDCSTTSPCSBCQY") != "" && data.GetString("IEDCSTTSPCSBCQY") != "否" {
res["STTDF"] = 1
}
//专利得分
res["ZLDF"] = 0
res["ZLDF"] = data.GetFloat64("IEDCPGJZL") +
data.GetFloat64("IEDCFMZL")*0.5 +
data.GetFloat64("IEDCSYXXZL")*0.1 +
data.GetFloat64("IEDCWGSJZL")*0.1
if res.GetFloat64("ZLDF") > 1 {
res["ZLDF"] = 1
}
//推广目录得分
res["TGMLDF"] = 0
if data.GetString("IEDCZMPPQY") != "" && data.GetString("IEDCZMPPQY") != "否" {
res["TGMLDF"] = 1
}
//知识产权总得分ZSCQDF
res["ZSCQDF"] = res.GetFloat64("ZLDF") + res.GetFloat64("STTDF") + res.GetFloat64("TGMLDF")
//连续3年盈利得分
res["LXSNYLDF"] = 3
//18年
if data.GetFloat64("IEDC1NLRZE") < 0 {
res["LXSNYLDF"] = res.GetInt("LXSNYLDF") - 1
}
//19年
if data.GetFloat64("IEDC1NLRZE0") < 0 {
res["LXSNYLDF"] = res.GetInt("LXSNYLDF") - 1
}
//20年
if data.GetFloat64("IEDC2NLRZE") < 0 {
res["LXSNYLDF"] = res.GetInt("LXSNYLDF") - 1
}
if res.GetInt("LXSNYLDF") == 3 {
res["LXSNYLDF"] = 1
} else if res.GetInt("LXSNYLDF") > 0 {
res["LXSNYLDF"] = 0.5
}
//当年利润总额得分
res["DNLRZEDF"] = 0
//企业利润率
res["QYLRL"] = data.GetFloat64("IEDC2NLRZE") / data.GetFloat64("IEDC2NYYSR")
if res.GetFloat64("QYLRL") > 0.1 {
res["DNLRZEDF"] = 1
} else if res.GetFloat64("QYLRL") > 0 {
res["DNLRZEDF"] = 0.5
}
//企业盈利能力总得分
res["QYYLNLZDF"] = res.GetFloat64("DNLRZEDF") + res.GetFloat64("LXSNYLDF")
//发展质量指标总分
res["FZZLZBZDF"] = res.GetFloat64("QYYLNLZDF") + res.GetFloat64("ZSCQDF") + res.GetFloat64("FZQLDF")
//企业连续3年亏损得分
res["KSDF"] = 3
//18年
if data.GetFloat64("IEDC1NLRZE") < 0 {
res["KSDF"] = res.GetInt("LXSNYLDF") - 1
}
//19年
if data.GetFloat64("IEDC1NLRZE0") < 0 {
res["KSDF"] = res.GetInt("LXSNYLDF") - 1
}
//20年
if data.GetFloat64("IEDC2NLRZE") < 0 {
res["KSDF"] = res.GetInt("LXSNYLDF") - 1
}
//先统一扣0.5分
if res.GetInt("LXSNYLDF") == 0 {
res["KSDF"] = 0.5
} else {
res["KSDF"] = 0
}
//环保检查得分
res["HBJCDF"] = 1
if data.GetString("IEDCHBJCHBCCZBFXWT") == "一般" {
res["HBJCDF"] = 0.5
}
if data.GetString("IEDCHBJCHBCCZBFXWT") == "重大" {
res["HBJCDF"] = 0
}
//减排技术升级改造
res["JPJSSJDF"] = 0
if data.GetString("IEDCJPJSSJGZ") != "" && data.GetString("IEDCJPJSSJGZ") != "否" {
res["JPJSSJDF"] = 1
}
//绿色生产工艺
res["LSSCGYDF"] = res.GetFloat64("JPJSSJDF") + res.GetFloat64("HBJCDF")
//安全检查得分
res["AQJCDF"] = 0
if data.GetString("IEDCHBJCHBCCZBFXWT") == "一般" {
res["AQJCDF"] = -1
}
if data.GetString("IEDCHBJCHBCCZBFXWT") == "重大" {
res["AQJCDF"] = -2
}
//安全事故得分
res["AQSGDF"] = 0
if data.GetString("IEDCFSAQSG") == "轻微" {
res["AQSGDF"] = -0.5
}
if data.GetString("IEDCFSAQSG") == "一般" {
res["AQSGDF"] = -1
}
if data.GetString("IEDCFSAQSG") == "重大" {
res["AQSGDF"] = -2
}
//企业风险隐患双预控体系建设得分
res["QYFXYHSKTXJSDF"] = 0
if data.GetString("IEDCFXYHSYKTXJS") != "" && data.GetString("IEDCFXYHSYKTXJS") != "否" {
res["QYFXYHSKTXJSDF"] = 1
}
//企业安全生产是否达标得分
res["QYAQSCDBDF"] = 0
if data.GetString("IEDCQYSCBZHJS") == "达标" {
res["QYAQSCDBDF"] = 1
}
//安全生产管理得分AQSCGLDF
res["AQSCGLDF"] = res.GetFloat64("QYAQSCDBDF") + res.GetFloat64("QYFXYHSKTXJSDF") +
res.GetFloat64("AQSGDF") + res.GetFloat64("AQJCDF")
//"绿色安全指标得分",
res["LSAQZBDF"] = (res.GetFloat64("AQSCGLDF") + res.GetFloat64("LSSCGYDF")) / 4 * 5
//产业链30户得分
res["CYL30HDF"] = 0
if data.GetString("IEDCCYLLZ、SJZD、SJ3HLTQY") != "" && data.GetString("IEDCCYLLZ、SJZD、SJ3HLTQY") != "否" {
res["CYL30HDF"] = 1
}
//市级100户重点企业得分
res["SJ100HZDQYDF"] = 0
if data.GetString("IEDCSJ1HZDQYQSXZDQY") != "" && data.GetString("IEDCSJ1HZDQYQSXZDQY") != "否" {
res["SJ100HZDQYDF"] = 1
}
//区域重点企业得分
res["QYZDQYDF"] = res.GetFloat64("CYL30HDF") + res.GetFloat64("SJ100HZDQYDF")
//符合地区重点产业得分
res["FHDQZDCYDF"] = 0
if data.GetString("IEDCFHDQZDCY") != "" && data.GetString("IEDCFHDQZDCY") != "否" {
res["FHDQZDCYDF"] = 1
}
//协作发展指标得分XZFZZBDF
res["XZFZZBDF"] = (res.GetFloat64("FHDQZDCYDF") + res.GetFloat64("QYZDQYDF")) / 3 * 5
//3项指标
res["SXZBDF"] = res.GetFloat64("XZFZZBDF") + res.GetFloat64("LSAQZBDF") + res.GetFloat64("FZZLZBZDF")
//产业人才得分
res["CYRCDF"] = 0
res["CYRCDF"] = data.GetInt("IEDCCYRC") * 2
if res.GetInt("CYRCDF") > 5 {
res["CYRCDF"] = 5
}
//资产负债率得分
res["ZCFZLDF"] = 0
IEDCZCFZL := ObjToFloat64(strings.Replace(data.GetString("IEDCZCFZL"), "%", "", -1))
if IEDCZCFZL <= 80 {
res["ZCFZLDF"] = 1
}
//科研人员占比得分
res["KYRYZBDF"] = 0
KYRYZBDF := ObjToFloat64(strings.Replace(data.GetString("IEDCKYRYZB"), "%", "", -1))
if KYRYZBDF >= 8 {
res["KYRYZBDF"] = 1
}
//2年研发占比得分
res["YFZBDF"] = 0
YFZBDF := ObjToFloat64(strings.Replace(data.GetString("IEDC2NYFZB"), "%", "", -1))
if YFZBDF >= 1.5 {
res["YFZBDF"] = 1
}
//具备专精特新知识产权要求得分
res["JBZJTXZSCQYQDF"] = 0
if data.GetString("IEDCZDHCYBZZDQY") != "" && data.GetString("IEDCZDHCYBZZDQY") != "否" {
res["JBZJTXZSCQYQDF"] = 1
}
//具备专精特新环境及条件得分
res["JBZJTXHJJTJDF"] = 0
if data.GetString("IEDCJPJSSJGZ") != "" && data.GetString("IEDCJPJSSJGZ") != "否" {
res["JBZJTXHJJTJDF"] = 1
}
//具备专精特新企业要求产品得分
res["JBZJTXQYYQCPDF"] = 0
if data.GetString("IEDCJBZJTXQYYQCP") != "" && data.GetString("IEDCJBZJTXQYYQCP") != "否" {
res["JBZJTXQYYQCPDF"] = 1
}
//具备专精特新企业基础要求得分
res["JBZJTXQYJCYQDF"] = 0
if data.GetString("IEDCJBZJTXQYJCYQ") != "" && data.GetString("IEDCJBZJTXQYJCYQ") != "否" {
res["JBZJTXQYJCYQDF"] = 1
}
ZJTXQLDFTotal := res.GetFloat64("JBZJTXQYJCYQDF") +
res.GetFloat64("JBZJTXQYYQCPDF") +
res.GetFloat64("JBZJTXHJJTJDF") +
res.GetFloat64("JBZJTXZSCQYQDF") +
res.GetFloat64("YFZBDF") +
res.GetFloat64("KYRYZBDF") +
res.GetFloat64("ZCFZLDF")
res["ZJTXQLDF"] = 0
if ZJTXQLDFTotal >= 5 {
res["ZJTXQLDF"] = 10
} else if ZJTXQLDFTotal >= 3 {
res["ZJTXQLDF"] = 6
} else if ZJTXQLDFTotal >= 1 {
res["ZJTXQLDF"] = 3
}
res["JGTZ"] = data.GetFloat64("IEDCXZTZQK")
return res
}
//6+3+n及首页数据分析
func ctgAnalyse(datas []Map, totalAnalyse Map) Map {
home_data := totalAnalyse.GetMap("home_data")
resTotal := Map{
//经济效益
"区域生产总值": "暂无",
"区域企业总数": len(datas),
"梯度培育企业数": "暂无",
"上市企业数": "暂无",
"征地企业数/租赁企业数": "暂无",
"征地企业总面积": "暂无",
"租赁企业总面积": "暂无",
"厂房总面积": "暂无",
"楼宇总面积": "暂无",
"办公楼总面积": "暂无",
"研发楼总面积": "暂无",
"区域综合用电": "暂无",
"区域综合用水": "暂无",
"研究生及以上学历人数": "暂无",
"本科学历人数": "暂无",
"大专学历人数": "暂无",
"大专以下学历人数": "暂无",
"区域职工平均年收入": "暂无",
"技术证书持有人数": "暂无",
"拥有环境管理体系数": "暂无",
"拥有职业健康体系数": "暂无",
"属于本区重点企业配套数": "无",
"宿舍总面积": "无",
}
for _, v := range datas {
uploadData := v.GetMap("upload_data")
//上传数据
//uploadData := company.GetMap("upload_data")
for k, _ := range uploadData {
strV := uploadData.GetString(k)
strV = strings.Replace(strV, " ", "", -1)
strV = strings.Replace(strV, "符合", "", -1)
strV = strings.Replace(strV, "条", "", -1)
v := float64(0)
if strV == "无" {
strV = "否"
}
if strV == "未完成" {
strV = "否"
}
switch strV {
case "年度实现盈利":
v = 2
case "未达标":
v = -1
case "轻微":
v = 1
case "一般":
v = 2
case "重大":
v = 3
case "市级":
v = 1
case "省级":
v = 2
case "国家级":
v = 3
case "国家级、行业":
v = 3
case "主导、国家级":
v = 8
case "“一带一路”区域":
v = 3
case "国际":
v = 4
case "行业":
v = 5
case "专精特新":
v = 10
case "区(市)县重点企业":
v = 6
case "市级100户重点企业":
v = 7
case "区域领先":
v = 1
case "国内领先":
v = 2
case "全球领先":
v = 3
case "200万以上":
v = 2
case "20%以上":
v = 0.2
case "15%-20%":
v = 0.15
case "10%-15%":
v = 0.1
case "5%-10%":
v = 0.05
case "0%-5%":
v = 0.01
case "0%-3%":
v = 0
case "3-5%":
v = 0.03
case "3%-5%":
v = 0.03
case "增长15%以上":
v = 0.15
case "增长10-15%":
v = 0.1
case "增长5-10%":
v = 0.05
case "增长0-5%":
v = 0.01
case "下降0-5%":
v = -0.01
case "下降5-10%":
v = -0.05
case "下降10-15%":
v = -0.1
case "下降15%以上":
v = -0.15
}
if strings.Index(strV, "%") == len(strV)-1 && len(strV) != 0 {
v = uploadData.GetFloat64(strings.Replace(strV, "%", "", -1)) / 100
}
flV := uploadData.GetFloat64(k)
if flV != 0 && v == 0 {
v = flV
}
if v == 0 && strV != "否" && strV != "0" {
v = 1
}
uploadData[k] = v
//vm.Run("key['"+k+"']="+ObjToStr(v)+"")
//vm.Set(k, v)
}
resTotal["区域经营收入"] = resTotal.GetFloat64("区域经营收入") + uploadData.GetFloat64("IEDC2NYYSR")
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") +
uploadData.GetInt("IEDCSJZDJSQY")
resTotal["瞪羚企业数"] = resTotal.GetInt("瞪羚企业数") + uploadData.GetInt("IEDCDLQY") +
uploadData.GetInt("IEDCYYDJSQYDLQYCH")
resTotal["专精特新企业数"] = resTotal.GetInt("专精特新企业数") + uploadData.GetInt("IEDCGJJZJTX") +
uploadData.GetInt("IEDCSJZJTX") + uploadData.GetInt("IEDCSJZJTX0") + uploadData.GetInt("IEDCYYZJTXCH") +
uploadData.GetInt("IEDCSFZJTXQY")
//规上企业数
//if v.GetInt("gs") == 1 {
resTotal["规上企业数"] = resTotal.GetInt("规上企业数") + 1
//}
resTotal["技术改造投资备案数"] = resTotal.GetInt("技术改造投资备案数")
if uploadData.GetFloat64("IEDCXZTZQK") > 0 {
resTotal["技术改造投资备案数"] = resTotal.GetInt("技术改造投资备案数") + 1
}
resTotal["固定资产投入"] = resTotal.GetFloat64("固定资产投入")
if uploadData.GetFloat64("IEDCXZTZQK") > 0 {
resTotal["固定资产投入"] = resTotal.GetFloat64("固定资产投入") + uploadData.GetFloat64("IEDCXZTZQK")
}
//技术中心
resTotal["企业技术中心数"] = resTotal.GetInt("企业技术中心数") + uploadData.GetInt("IEDCGJJGCJSZX") +
uploadData.GetInt("IEDCSJQYJSZX0") + uploadData.GetInt("IEDCYYQYJSZXGCJSZX") + uploadData.GetInt("IEDCSJQYJSZX")
//工程技术中心
resTotal["工程技术中心数"] = resTotal.GetInt("工程技术中心数") + uploadData.GetInt("IEDCSJGCJSZX0") +
uploadData.GetInt("IEDCSJGCJSZX") + uploadData.GetInt("IEDCGJJGCJSZX") + uploadData.GetInt("IEDCSJQYJSZX")
resTotal["高新技术企业数"] = resTotal.GetInt("高新技术企业数") + uploadData.GetInt("IEDCGXJSQY")
resTotal["知名品牌数"] = resTotal.GetInt("知名品牌数") + uploadData.GetInt("IEDCZMPPQY")
resTotal["首台套/首批次/首版次数"] = resTotal.GetInt("首台套/首批次/首版次数") + uploadData.GetInt("IEDCSTTSPCSBCQY")
resTotal["知识产权数"] = resTotal.GetInt("知识产权数") + uploadData.GetInt("IEDCPGJZL") +
uploadData.GetInt("IEDCFMZL") + uploadData.GetInt("IEDCSYXXZL") +
uploadData.GetInt("IEDCWGSJZL") + uploadData.GetInt("IEDCpZL")
resTotal["区域工业土地总面积"] = resTotal.GetFloat64("区域工业土地总面积") + uploadData.GetFloat64("IEDCYDMJ") +
uploadData.GetFloat64("IEDCZDMJ")
resTotal["区域综合用煤"] = resTotal.GetFloat64("区域综合用煤") + uploadData.GetFloat64("IEDCZHNH") +
uploadData.GetFloat64("IEDCZHNHDBZM") + uploadData.GetFloat64("IEDCDBMYL") +
uploadData.GetFloat64("IEDCDBM") + uploadData.GetFloat64("IEDCDBMYL")
resTotal["区域总人数"] = resTotal.GetInt("区域总人数") + uploadData.GetInt("IEDCSBRS") +
uploadData.GetInt("IEDCNPJZGRS")
resTotal["产业人才数"] = resTotal.GetInt("产业人才数") + uploadData.GetInt("IEDCCYRC") +
uploadData.GetInt("IEDCCYRCSL")
resTotal["环保抽查处理数"] = resTotal.GetInt("环保抽查处理数")
if uploadData.GetInt("IEDCHBJCHBCCZBFXWT") > 0 {
resTotal["环保抽查处理数"] = resTotal.GetInt("环保抽查处理数") + 1
}
resTotal["安全抽查隐患处理数"] = resTotal.GetInt("安全抽查隐患处理数")
if uploadData.GetInt("IEDCFXAQFXYH") > 0 {
resTotal["安全抽查隐患处理数"] = resTotal.GetInt("安全抽查隐患处理数") + 1
}
resTotal["亡人事故数"] = resTotal.GetInt("亡人事故数")
if uploadData.GetInt("IEDCFSAQSG") > 2 {
resTotal["亡人事故数"] = resTotal.GetInt("亡人事故数") + 1
}
resTotal["拥有安全管理体系数"] = resTotal.GetInt("拥有安全管理体系数")
if uploadData.GetInt("IEDCAQGLTXJQ") > 0 || uploadData.GetInt("IEDCZYJKYAQGLTX") > 0 ||
uploadData.GetInt("IEDCFXYHSYKTXJS") > 0 || uploadData.GetInt("IEDCQYYYISTXSL") > 0 {
resTotal["拥有安全管理体系数"] = resTotal.GetInt("拥有安全管理体系数") + 1
}
resTotal["拥有质量管理体系数"] = resTotal.GetInt("拥有质量管理体系数")
if uploadData.GetInt("IEDCZLGLTX") > 0 || uploadData.GetInt("IEDCQYYYISTXSL") > 0 ||
uploadData.GetInt("IEDCQYYYISTXSL") > 0 {
resTotal["拥有质量管理体系数"] = resTotal.GetInt("拥有质量管理体系数") + 1
}
resTotal["区域100户重点企业数"] = resTotal.GetInt("区域100户重点企业数")
if uploadData.GetInt("IEDCSJ1HZDQY") > 0 || uploadData.GetInt("IEDCSJ1HZDQYQSXZDQY") > 0 {
resTotal["区域100户重点企业数"] = resTotal.GetInt("区域100户重点企业数") + 1
}
resTotal["符合本区重点发展产业数"] = resTotal.GetInt("符合本区重点发展产业数")
if uploadData.GetInt("IEDCFHDQZDCY") > 0 {
resTotal["符合本区重点发展产业数"] = resTotal.GetInt("符合本区重点发展产业数") + 1
}
resTotal["属于本区重点企业配套数"] = resTotal.GetInt("属于本区重点企业配套数")
if uploadData.GetInt("IEDCBDQZDQYDZYPTQY") > 0 ||
uploadData.GetInt("IEDCQYWSSZDQYDZYPTQY") > 0 || uploadData.GetInt("IEDCQYWSSZDQYDZYPTQY") > 0 {
resTotal["属于本区重点企业配套数"] = resTotal.GetInt("属于本区重点企业配套数") + 1
}
resTotal["企业社保人数"] = resTotal.GetFloat64("企业社保人数") + uploadData.GetFloat64("IEDCSBRS")
resTotal["企业研发费用"] = resTotal.GetFloat64("企业研发费用") + uploadData.GetFloat64("IEDCNYFFY") +
uploadData.GetFloat64("IEDCYFJFZC") + uploadData.GetFloat64("IEDCYFFY")
resTotal["企业总能耗"] = resTotal.GetFloat64("企业总能耗") + uploadData.GetFloat64("IEDCZHNH") +
uploadData.GetFloat64("IEDCZHNHDBZM") + uploadData.GetFloat64("IEDCDBMYL")
resTotal["企业主要污染物排放量"] = resTotal.GetFloat64("企业主要污染物排放量") + uploadData.GetFloat64("IEDCZYWRWPFDL") + uploadData.GetFloat64("IEDCWRW")
}
resTotalNew := Map{}
for k, _ := range resTotal {
if resTotal.GetString(k) != "暂无" {
resTotalNew[k] = resTotal.GetFloat64(k)
resTotalNew[k+"比值"] = resTotal.GetFloat64(k) / home_data.GetFloat64(k)
if resTotalNew.GetFloat64(k+"比值") == 0 {
resTotalNew[k+"比值"] = "0"
}
} else {
resTotalNew[k+"比值"] = "暂无"
resTotalNew[k] = "暂无"
}
}
return resTotalNew
}
//6+3+n及首页数据分析
func totalAnalyse(datas []Map) (Map, Map, Map, Map) {
resTotal := Map{
//经济效益
"区域生产总值": "暂无",
"区域企业总数": len(datas),
"梯度培育企业数": "暂无",
"上市企业数": "暂无",
"征地企业数/租赁企业数": "暂无",
"征地企业总面积": "暂无",
"租赁企业总面积": "暂无",
"厂房总面积": "暂无",
"楼宇总面积": "暂无",
"办公楼总面积": "暂无",
"研发楼总面积": "暂无",
"区域综合用电": "暂无",
"区域综合用水": "暂无",
"研究生及以上学历人数": "暂无",
"本科学历人数": "暂无",
"大专学历人数": "暂无",
"大专以下学历人数": "暂无",
"区域职工平均年收入": "暂无",
"技术证书持有人数": "暂无",
"拥有环境管理体系数": "暂无",
"拥有职业健康体系数": "暂无",
"属于本区重点企业配套数": "无",
"宿舍总面积": "无",
}
sixItem := Map{} //6
threeItem := Map{} //3
nItem := Map{} //N
for _, v := range datas {
uploadData := v.GetMap("upload_data")
for k, _ := range uploadData {
strV := uploadData.GetString(k)
strV = strings.Replace(strV, " ", "", -1)
strV = strings.Replace(strV, "符合", "", -1)
strV = strings.Replace(strV, "条", "", -1)
v := float64(0)
if strV == "无" {
strV = "否"
}
if strV == "未完成" {
strV = "否"
}
switch strV {
case "年度实现盈利":
v = 2
case "未达标":
v = -1
case "轻微":
v = 1
case "一般":
v = 2
case "重大":
v = 3
case "市级":
v = 1
case "省级":
v = 2
case "国家级":
v = 3
case "国家级、行业":
v = 3
case "主导、国家级":
v = 8
case "“一带一路”区域":
v = 3
case "国际":
v = 4
case "行业":
v = 5
case "专精特新":
v = 10
case "区(市)县重点企业":
v = 6
case "市级100户重点企业":
v = 7
case "区域领先":
v = 1
case "国内领先":
v = 2
case "全球领先":
v = 3
case "200万以上":
v = 2
case "20%以上":
v = 0.2
case "15%-20%":
v = 0.15
case "10%-15%":
v = 0.1
case "5%-10%":
v = 0.05
case "0%-5%":
v = 0.01
case "0%-3%":
v = 0
case "3-5%":
v = 0.03
case "3%-5%":
v = 0.03
case "增长15%以上":
v = 0.15
case "增长10-15%":
v = 0.1
case "增长5-10%":
v = 0.05
case "增长0-5%":
v = 0.01
case "下降0-5%":
v = -0.01
case "下降5-10%":
v = -0.05
case "下降10-15%":
v = -0.1
case "下降15%以上":
v = -0.15
}
if strings.Index(strV, "%") == len(strV)-1 && len(strV) != 0 {
v = uploadData.GetFloat64(strings.Replace(strV, "%", "", -1)) / 100
}
flV := uploadData.GetFloat64(k)
if flV != 0 && v == 0 {
v = flV
}
if v == 0 && strV != "否" && strV != "0" {
v = 1
}
uploadData[k] = v
//vm.Run("key['"+k+"']="+ObjToStr(v)+"")
//vm.Set(k, v)
}
resTotal["区域经营收入"] = resTotal.GetFloat64("区域经营收入") + uploadData.GetFloat64("IEDC2NYYSR")
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") +
uploadData.GetInt("IEDCSJZDJSQY")
resTotal["瞪羚企业数"] = resTotal.GetInt("瞪羚企业数") + uploadData.GetInt("IEDCDLQY") +
uploadData.GetInt("IEDCYYDJSQYDLQYCH")
resTotal["专精特新企业数"] = resTotal.GetInt("专精特新企业数") + uploadData.GetInt("IEDCGJJZJTX") +
uploadData.GetInt("IEDCSJZJTX") + uploadData.GetInt("IEDCSJZJTX0") + uploadData.GetInt("IEDCYYZJTXCH") +
uploadData.GetInt("IEDCSFZJTXQY")
//规上企业数
//if v.GetInt("gs") == 1 {
resTotal["规上企业数"] = resTotal.GetInt("规上企业数") + 1
//}
resTotal["技术改造投资备案数"] = resTotal.GetInt("技术改造投资备案数")
if uploadData.GetFloat64("IEDCXZTZQK") > 0 {
resTotal["技术改造投资备案数"] = resTotal.GetInt("技术改造投资备案数") + 1
}
resTotal["固定资产投入"] = resTotal.GetFloat64("固定资产投入")
if uploadData.GetFloat64("IEDCXZTZQK") > 0 {
resTotal["固定资产投入"] = resTotal.GetFloat64("固定资产投入") + uploadData.GetFloat64("IEDCXZTZQK")
}
//技术中心
resTotal["企业技术中心数"] = resTotal.GetInt("企业技术中心数") + uploadData.GetInt("IEDCGJJGCJSZX") +
uploadData.GetInt("IEDCSJQYJSZX0") + uploadData.GetInt("IEDCYYQYJSZXGCJSZX") + uploadData.GetInt("IEDCSJQYJSZX")
//工程技术中心
resTotal["工程技术中心数"] = resTotal.GetInt("工程技术中心数") + uploadData.GetInt("IEDCSJGCJSZX0") +
uploadData.GetInt("IEDCSJGCJSZX") + uploadData.GetInt("IEDCGJJGCJSZX") + uploadData.GetInt("IEDCSJQYJSZX")
threeItem["投建企业技术中心/工程技术中心企业数"] = resTotal.GetInt("投建企业技术中心/工程技术中心企业数") + uploadData.GetInt("IEDCSJGCJSZX0") +
uploadData.GetInt("IEDCSJGCJSZX") + uploadData.GetInt("IEDCGJJGCJSZX") + uploadData.GetInt("IEDCGJJGCJSZX") +
uploadData.GetInt("IEDCSJQYJSZX0") + uploadData.GetInt("IEDCYYQYJSZXGCJSZX") + uploadData.GetInt("IEDCSJQYJSZX")
resTotal["高新技术企业数"] = resTotal.GetInt("高新技术企业数") + uploadData.GetInt("IEDCGXJSQY")
threeItem["高新技术企业数"] = threeItem.GetInt("高新技术企业数") + uploadData.GetInt("IEDCGXJSQY")
//if uploadData.GetString("IEDCGXJSQY") != "" && uploadData.GetString("IEDCGXJSQY") != "否" {
// resTotal["高新技术企业数"] = resTotal.GetInt("高新技术企业数") + 1
// threeItem["高新技术企业数"] = threeItem.GetInt("高新技术企业数") + 1
//}
resTotal["知名品牌数"] = resTotal.GetInt("知名品牌数") + uploadData.GetInt("IEDCZMPPQY")
resTotal["首台套/首批次/首版次数"] = resTotal.GetInt("首台套/首批次/首版次数") + uploadData.GetInt("IEDCSTTSPCSBCQY")
threeItem["首台套/首批次/首版次数"] = threeItem.GetInt("首台套/首批次/首版次数") + uploadData.GetInt("IEDCSTTSPCSBCQY")
threeItem["发明专利/实用新型专利/PCT国际专利企业数"] = threeItem.GetInt("发明专利/实用新型专利/PCT国际专利企业数")
if uploadData.GetInt("IEDCSYXXZL") != 0 ||
uploadData.GetInt("IEDCFMZL") != 0 ||
uploadData.GetInt("IEDCPGJZL") != 0 || uploadData.GetInt("IEDCpZL") != 0 {
threeItem["发明专利/实用新型专利/PCT国际专利企业数"] = threeItem.GetInt("发明专利/实用新型专利/PCT国际专利企业数") + 1
}
resTotal["知识产权数"] = resTotal.GetInt("知识产权数") + uploadData.GetInt("IEDCPGJZL") +
uploadData.GetInt("IEDCFMZL") + uploadData.GetInt("IEDCSYXXZL") +
uploadData.GetInt("IEDCWGSJZL") + uploadData.GetInt("IEDCpZL")
resTotal["区域工业土地总面积"] = resTotal.GetFloat64("区域工业土地总面积") + uploadData.GetFloat64("IEDCYDMJ") +
uploadData.GetFloat64("IEDCZDMJ")
resTotal["区域综合用煤"] = resTotal.GetFloat64("区域综合用煤") + uploadData.GetFloat64("IEDCZHNH") +
uploadData.GetFloat64("IEDCZHNHDBZM") + uploadData.GetFloat64("IEDCDBMYL") +
uploadData.GetFloat64("IEDCDBM") + uploadData.GetFloat64("IEDCDBMYL")
resTotal["区域总人数"] = resTotal.GetInt("区域总人数") + uploadData.GetInt("IEDCSBRS") +
uploadData.GetInt("IEDCNPJZGRS")
resTotal["产业人才数"] = resTotal.GetInt("产业人才数") + uploadData.GetInt("IEDCCYRC") +
uploadData.GetInt("IEDCCYRCSL")
resTotal["实施减排升级改造数"] = resTotal.GetInt("实施减排升级改造数")
threeItem["减排技术升级改造企业数"] = threeItem.GetInt("减排技术升级改造企业数")
if uploadData.GetInt("IEDCJPJSSJGZ") > 0 || uploadData.GetInt("IEDCSSJPJSSJGZQY") > 0 {
resTotal["实施减排升级改造数"] = resTotal.GetInt("实施减排升级改造数") + 1
threeItem["减排技术升级改造企业数"] = threeItem.GetInt("减排技术升级改造企业数") + 1
}
resTotal["环保抽查处理数"] = resTotal.GetInt("环保抽查处理数")
if uploadData.GetInt("IEDCHBJCHBCCZBFXWT") > 0 {
resTotal["环保抽查处理数"] = resTotal.GetInt("环保抽查处理数") + 1
}
resTotal["安全抽查隐患处理数"] = resTotal.GetInt("安全抽查隐患处理数")
if uploadData.GetInt("IEDCFXAQFXYH") > 0 {
resTotal["安全抽查隐患处理数"] = resTotal.GetInt("安全抽查隐患处理数") + 1
}
resTotal["亡人事故数"] = resTotal.GetInt("亡人事故数")
if uploadData.GetInt("IEDCFSAQSG") > 0 {
resTotal["亡人事故数"] = resTotal.GetInt("亡人事故数") + 1
}
resTotal["拥有安全管理体系数"] = resTotal.GetInt("拥有安全管理体系数")
if uploadData.GetInt("IEDCAQGLTXJQ") > 0 || uploadData.GetInt("IEDCZYJKYAQGLTX") > 0 ||
uploadData.GetInt("IEDCFXYHSYKTXJS") > 0 || uploadData.GetInt("IEDCQYYYISTXSL") > 0 {
resTotal["拥有安全管理体系数"] = resTotal.GetInt("拥有安全管理体系数") + 1
}
resTotal["拥有质量管理体系数"] = resTotal.GetInt("拥有质量管理体系数")
if uploadData.GetInt("IEDCZLGLTX") > 0 || uploadData.GetInt("IEDCQYYYISTXSL") > 0 ||
uploadData.GetInt("IEDCQYYYISTXSL") > 0 {
resTotal["拥有质量管理体系数"] = resTotal.GetInt("拥有质量管理体系数") + 1
}
resTotal["区域100户重点企业数"] = resTotal.GetInt("区域100户重点企业数")
if uploadData.GetInt("IEDCSJ1HZDQY") > 0 || uploadData.GetInt("IEDCSJ1HZDQYQSXZDQY") > 0 {
resTotal["区域100户重点企业数"] = resTotal.GetInt("区域100户重点企业数") + 1
}
resTotal["符合本区重点发展产业数"] = resTotal.GetInt("符合本区重点发展产业数")
if uploadData.GetInt("IEDCFHDQZDCY") > 0 {
resTotal["符合本区重点发展产业数"] = resTotal.GetInt("符合本区重点发展产业数") + 1
}
resTotal["属于本区重点企业配套数"] = resTotal.GetInt("属于本区重点企业配套数")
if uploadData.GetInt("IEDCBDQZDQYDZYPTQY") > 0 ||
uploadData.GetInt("IEDCQYWSSZDQYDZYPTQY") > 0 || uploadData.GetInt("IEDCQYWSSZDQYDZYPTQY") > 0 {
resTotal["属于本区重点企业配套数"] = resTotal.GetInt("属于本区重点企业配套数") + 1
}
resTotal["企业社保人数"] = resTotal.GetFloat64("企业社保人数") + uploadData.GetFloat64("IEDCSBRS")
resTotal["企业研发费用"] = resTotal.GetFloat64("企业研发费用") + uploadData.GetFloat64("IEDCNYFFY") +
uploadData.GetFloat64("IEDCYFJFZC") + uploadData.GetFloat64("IEDCYFFY")
threeItem["研发经费投入1000万元企业数"] = threeItem.GetInt("研发经费投入1000万元企业数")
if uploadData.GetFloat64("IEDCNYFFY") > 1000 ||
uploadData.GetFloat64("IEDCYFJFZC") > 1000 ||
uploadData.GetFloat64("IEDCTRQD1WHZ3YS") > 0 {
threeItem["研发经费投入1000万元企业数"] = threeItem.GetInt("研发经费投入1000万元企业数") + 1
}
resTotal["企业总能耗"] = resTotal.GetFloat64("企业总能耗") + uploadData.GetFloat64("IEDCZHNH") +
uploadData.GetFloat64("IEDCZHNHDBZM") + uploadData.GetFloat64("IEDCDBMYL") +
uploadData.GetFloat64("IEDCDBM")
resTotal["企业主要污染物排放量"] = resTotal.GetFloat64("企业主要污染物排放量") + uploadData.GetFloat64("IEDCZYWRWPFDL") + uploadData.GetFloat64("IEDCWRW")
run := func(level string) {
resTotal[level+"类企业数"] = resTotal.GetInt(level+"类企业数") + 1
resTotal[level+"类企业数总分"] = resTotal.GetFloat64(level+"类企业数总分") + v.GetFloat64("score")
if v.GetFloat64("score") > resTotal.GetFloat64(level+"类企业数最高分") {
resTotal[level+"类企业数最高分"] = v.GetFloat64("score")
}
if v.GetFloat64("score") < resTotal.GetFloat64(level+"类企业数最低分") ||
resTotal.GetFloat64(level+"类企业数最低分") == 0 {
resTotal[level+"类企业数最低分"] = v.GetFloat64("score")
}
//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("IEDCYDMJ") +
uploadData.GetFloat64("IEDCZDMJ")
resTotal[level+"类企业社保人数"] = resTotal.GetInt(level+"类企业社保人数") + uploadData.GetInt("IEDCSBRS")
resTotal[level+"类企业研发费用"] = resTotal.GetFloat64(level+"类企业研发费用") + uploadData.GetFloat64("IEDCNYFFY") +
uploadData.GetFloat64("IEDCYFJFZC") + uploadData.GetFloat64("IEDCYFFY")
resTotal[level+"类企业总能耗"] = resTotal.GetFloat64(level+"类企业总能耗") + uploadData.GetFloat64("IEDCZHNH") +
uploadData.GetFloat64("IEDCZHNHDBZM") + uploadData.GetFloat64("IEDCDBMYL") +
uploadData.GetFloat64("IEDCDBM")
resTotal[level+"类企业主要污染物排放量"] = resTotal.GetFloat64(level+"类企业主要污染物排放量") + uploadData.GetFloat64("IEDCZYWRWPFDL") + uploadData.GetFloat64("IEDCWRW")
}
switch v.GetCeilInt("level") {
case 0:
run("A")
case 1:
run("B")
case 2:
run("C")
case 3:
run("D")
}
//3
threeItem["进入本地区名优产品目录企业数"] = threeItem.GetInt("进入本地区名优产品目录企业数") + uploadData.GetInt("IEDCZMPPQY") + uploadData.GetInt("IEDCCDSMYCP")
threeItem["连续3年盈利/首年度盈利企业数"] = threeItem.GetInt("连续3年盈利/首年度盈利企业数") + uploadData.GetInt("IEDCLX3NYLQY")
//if analyse.GetInt("LXSNYLDF") == 1 {
// threeItem["连续3年盈利/首年度盈利企业数"] = threeItem.GetInt("连续3年盈利/首年度盈利企业数") + 1
//}
threeItem["环保检/抽查受一般性处理企业数"] = threeItem.GetInt("环保检/抽查受一般性处理企业数")
if uploadData.GetInt("IEDCHBJCHBCCZBFXWT") == 2 {
threeItem["环保检/抽查受一般性处理企业数"] = threeItem.GetInt("环保检/抽查受一般性处理企业数") + 1
}
threeItem["安全检/抽查存在风险隐患受一般性处理企业数"] = threeItem.GetInt("安全检/抽查存在风险隐患受一般性处理企业数")
if uploadData.GetInt("IEDCHBJCHBCCZBFXWT") == 2 {
threeItem["安全检/抽查存在风险隐患受一般性处理企业数"] = threeItem.GetInt("安全检/抽查存在风险隐患受一般性处理企业数") + 1
}
threeItem["安全事故发生企业数"] = threeItem.GetInt("安全事故发生企业数")
if uploadData.GetInt("IEDCFSAQSG") != 0 {
threeItem["安全事故发生企业数"] = threeItem.GetInt("安全事故发生企业数") + 1
}
threeItem["已建/在建风险隐患双预控体系企业数"] = threeItem.GetInt("已建/在建风险隐患双预控体系企业数")
if uploadData.GetInt("IEDCFXYHSYKTXJS") != 0 || uploadData.GetInt("IEDCFXYHSYKTXJS") != 0 {
threeItem["已建/在建风险隐患双预控体系企业数"] = threeItem.GetInt("已建/在建风险隐患双预控体系企业数") + 1
}
threeItem["生产标准不达标企业数"] = threeItem.GetInt("生产标准不达标企业数")
if uploadData.GetInt("IEDCFXYHSYKTXJS") == -1 {
threeItem["生产标准不达标企业数"] = threeItem.GetInt("生产标准不达标企业数") + 1
}
threeItem["所处产业符合本地区重点发展产业企业数"] = threeItem.GetInt("所处产业符合本地区重点发展产业企业数")
if uploadData.GetInt("IEDCFHDQZDCY") > 0 {
threeItem["所处产业符合本地区重点发展产业企业数"] = threeItem.GetInt("所处产业符合本地区重点发展产业企业数") + 1
}
threeItem["产业链链主/省级重点/市级30户龙头企业数"] = threeItem.GetInt("产业链链主/省级重点/市级30户龙头企业数") +
uploadData.GetInt("IEDCCYLLZSJZDSJ3HLTQY")
threeItem["市级100户重点/区市县重点企业数"] = threeItem.GetInt("市级100户重点/区市县重点企业数") + uploadData.GetInt("IEDCSJ1HZDQY") +
uploadData.GetInt("IEDCSJ1HZDQYQSXZDQY") + uploadData.GetInt("IEDCSJ1HZDQYQSXZDQY")
//N
nItem["配备年薪≥30万元人才企业数"] = nItem.GetInt("配备年薪≥30万元人才企业数")
if uploadData.GetInt("IEDCCYRC") > 0 ||
uploadData.GetInt("IEDCCYRCSL") > 0 ||
uploadData.GetInt("IEDCCYRCSL") > 0 {
nItem["配备年薪≥30万元人才企业数"] = nItem.GetInt("配备年薪≥30万元人才企业数") + 1
}
nItem["有效发明专利≥2项/满足参与制定标准企业数"] = nItem.GetInt("有效发明专利≥2项/满足参与制定标准企业数")
if uploadData.GetInt("IEDCZDHCYBZZDQY") > 0 ||
uploadData.GetInt("IEDCQYSCBZHJS") > 0 ||
uploadData.GetInt("IEDCZDHCYBZZDQYS") > 0 {
nItem["有效发明专利≥2项/满足参与制定标准企业数"] = nItem.GetInt("有效发明专利≥2项/满足参与制定标准企业数") + 1
}
nItem["具备技术创新任务设备/环境企业数"] = nItem.GetInt("具备技术创新任务设备/环境企业数")
if uploadData.GetInt("IEDCJBZJTXHJJTJ") > 0 {
nItem["具备技术创新任务设备/环境企业数"] = nItem.GetInt("具备技术创新任务设备/环境企业数") + 1
}
nItem["特定细分≥3年且主导产品≥营收60%企业数"] = nItem.GetInt("特定细分≥3年且主导产品≥营收60%企业数")
if uploadData.GetInt("IEDCDXGJCP") > 0 ||
uploadData.GetInt("IEDCTGCPQY") > 0 ||
uploadData.GetInt("IEDCQYHZYCPJRSJ5Q") > 0 {
nItem["特定细分≥3年且主导产品≥营收60%企业数"] = nItem.GetInt("特定细分≥3年且主导产品≥营收60%企业数") + 1
}
nItem["大专/中级职称占比≥35企业数"] = nItem.GetInt("大专/中级职称占比≥35企业数")
if uploadData.GetInt("IEDCDZYSXLZBDDYQ") > 0 {
nItem["大专/中级职称占比≥35企业数"] = nItem.GetInt("大专/中级职称占比≥35企业数") + 1
}
nItem["进行技术改造企业数"] = nItem.GetInt("进行技术改造企业数")
if uploadData.GetInt("IEDCJPJSSJGZ") > 0 ||
uploadData.GetInt("IEDCSSJPJSSJGZQY") > 0 {
nItem["进行技术改造企业数"] = nItem.GetInt("进行技术改造企业数") + 1
}
resTotal["企业总分"] = ObjToFloat64(resTotal.GetFloat64("企业总分") + v.GetFloat64("score"))
}
resTotal["企业平均分"] = ObjToFloat64(resTotal.GetFloat64("企业总分") / float64(len(datas)))
sixItem["亩均收入"] = ObjToFloat64(resTotal.GetFloat64("区域经营收入") / resTotal.GetFloat64("区域工业土地总面积"))
sixItem["亩均税收"] = ObjToFloat64(resTotal.GetFloat64("区域纳税总值") / resTotal.GetFloat64("区域工业土地总面积"))
sixItem["人均收入"] = ObjToFloat64(resTotal.GetFloat64("区域经营收入") / resTotal.GetFloat64("企业社保人数"))
sixItem["研发经费投入强度"] = ObjToFloat64(resTotal.GetFloat64("企业研发费用") / resTotal.GetFloat64("区域经营收入"))
sixItem["单位能耗税收"] = ObjToFloat64(resTotal.GetFloat64("区域纳税总值") / resTotal.GetFloat64("企业总能耗"))
sixItem["主要污染物税收"] = ObjToFloat64(resTotal.GetFloat64("区域纳税总值") / resTotal.GetFloat64("企业主要污染物排放量"))
run1 := func(level string) {
resTotal[level+"类企业数平均分"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业数总分") / resTotal.GetFloat64(level+"类企业数"))
sixItem[level+"类亩均收入"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业营业收入") / resTotal.GetFloat64(level+"类企业占地面积"))
sixItem[level+"类亩均税收"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业税收") / resTotal.GetFloat64(level+"类企业占地面积"))
sixItem[level+"类人均收入"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业营业收入") / resTotal.GetFloat64(level+"类企业社保人数"))
sixItem[level+"类研发经费投入强度"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业研发费用") / resTotal.GetFloat64(level+"类企业营业收入"))
sixItem[level+"类单位能耗税收"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业税收") / resTotal.GetFloat64(level+"类企业总能耗"))
if resTotal.GetFloat64(level+"类企业主要污染物排放量") == 0 {
fmt.Println(level, resTotal[level+"类企业主要污染物排放量"], resTotal.GetFloat64(level+"类企业主要污染物排放量"))
resTotal[level+"类企业主要污染物排放量"] = 1
}
sixItem[level+"类主要污染物税收"] = ObjToFloat64(resTotal.GetFloat64(level+"类企业税收") / resTotal.GetFloat64(level+"类企业主要污染物排放量"))
}
run1("A")
run1("B")
run1("C")
run1("D")
return resTotal, sixItem, threeItem, nItem
}
//单个企业分析
func (that *Org4) analyseSort(datas []Map) []Map {
cs := append(Companys{}, datas...)
sort6Get := func(指标名称 string, 指标得分名称 string, cs Companys, point float64) Companys {
csLength := len(cs)
analyseTypeName = "analyse"
analyseSortType = 指标名称 //亩均收入得分
sort.Sort(cs)
for _, data := range cs {
v := data.GetMap("analyse")
k := len(cs) - 1
if v.GetFloat64(analyseSortType) == cs[k].GetMap("analyse").GetFloat64(analyseSortType) {
v[analyseSortType+"排名"] = k + 1
} else {
for k1, data1 := range cs {
v1 := data1.GetMap("analyse")
if v.GetFloat64(analyseSortType) >= v1.GetFloat64(analyseSortType) {
k = k1
v[analyseSortType+"排名"] = k1 + 1
break
}
}
}
if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.1 {
v[指标得分名称] = point * 1.0
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.3 {
v[指标得分名称] = point * 0.85
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.5 {
v[指标得分名称] = point * 0.75
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.7 {
v[指标得分名称] = point * 0.6
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.9 {
v[指标得分名称] = point * 0.5
} else {
v[指标得分名称] = point * 0.25
}
if v.GetFloat64(指标名称) == 0 {
v[指标得分名称] = point * 0
}
//6项指标得分
if 指标名称 == "ZYWRWSS" {
v["NXZBDF"] = v.GetFloat64("MJSRDF") + v.GetFloat64("MJSSDF") +
v.GetFloat64("RJSRDF") + v.GetFloat64("YFJFTRQDDF") +
v.GetFloat64("DWNHSSDF") + v.GetFloat64("ZYWRWSSDF")
}
}
return cs
}
sort6Get("MJSR", "MJSRDF", cs, 15)
sort6Get("MJSS", "MJSSDF", cs, 15)
sort6Get("RJSR", "RJSRDF", cs, 10)
sort6Get("YFJFTRQD", "YFJFTRQDDF", cs, 10)
sort6Get("DWNHSS", "DWNHSSDF", cs, 5)
sort6Get("ZYWRWSS", "ZYWRWSSDF", cs, 5)
csLength := len(cs)
analyseSortType = "IEDCXZTZQK" //技改投资
analyseTypeName = "upload_data"
sort.Sort(cs)
for _, data := range cs {
//fmt.Println("dasdas", data.GetString("name"), data.GetMap("upload_data").GetFloat64(analyseSortType))
v := data.GetMap("analyse")
k := len(cs) - 1
if v.GetFloat64(analyseSortType) == cs[k].GetMap("analyse").GetFloat64(analyseSortType) {
v[analyseSortType+"排名"] = k + 1
} else {
for k1, data1 := range cs {
v1 := data1.GetMap("analyse")
if v.GetFloat64(analyseSortType) >= v1.GetFloat64(analyseSortType) {
k = k1
v[analyseSortType+"排名"] = k1 + 1
break
}
}
}
v["JGTZPM"] = k + 1
if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.3 {
v["JGTZDF"] = 5
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.6 {
v["JGTZDF"] = 4
} else {
v["JGTZDF"] = 2
}
if v.GetFloat64("JGTZ") == 0 {
v["JGTZDF"] = 2
}
//N总得分以及所有项总分以及企业评级
v["NZDF"] = v.GetFloat64("JGTZDF") + v.GetFloat64("ZJTXQLDF") + v.GetFloat64("CYRCDF")
v["ZDF"] = v.GetFloat64("NZDF") + v.GetFloat64("SXZBDF") + v.GetFloat64("NXZBDF")
}
analyseTypeName = "analyse"
analyseSortType = "ZDF" //技改投资
sort.Sort(cs)
for _, data := range cs {
v := data.GetMap("analyse")
//v := data.GetMap("analyse")
k := len(cs) - 1
//fmt.Println(v.GetFloat64(analyseSortType),cs[k].GetMap("analyse").GetFloat64(analyseSortType))
if v.GetFloat64(analyseSortType) == cs[k].GetMap("analyse").GetFloat64(analyseSortType) {
v[analyseSortType+"排名"] = k + 1
} else {
for k1, data1 := range cs {
v1 := data1.GetMap("analyse")
if v.GetFloat64(analyseSortType) >= v1.GetFloat64(analyseSortType) {
k = k1
v[analyseSortType+"排名"] = k + 1
break
}
}
}
v["ZPM"] = k + 1
v["ZQYS"] = len(cs)
if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.1 {
v["PJ"] = "A"
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.8 {
v["PJ"] = "B"
} else if ObjToFloat64(k) <= ObjToFloat64(csLength)*0.89 {
v["PJ"] = "C"
} else {
v["PJ"] = "D"
}
}
return cs
}