|
@@ -2,50 +2,202 @@ package main
|
|
|
|
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "github.com/spf13/viper"
|
|
"github.com/xuri/excelize/v2"
|
|
"github.com/xuri/excelize/v2"
|
|
|
|
+ utils "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"strconv"
|
|
"strconv"
|
|
"strings"
|
|
"strings"
|
|
)
|
|
)
|
|
|
|
|
|
var (
|
|
var (
|
|
- Mgo *mongodb.MongodbSim
|
|
|
|
- baseMap = make(map[string]map[string]interface{})
|
|
|
|
|
|
+ Mgo *mongodb.MongodbSim
|
|
|
|
+ baseMap = make(map[string]map[string]interface{})
|
|
|
|
+ filename string
|
|
|
|
+ GF GlobalConf
|
|
)
|
|
)
|
|
|
|
|
|
-func Init() {
|
|
|
|
|
|
+func InitConfig() (err error) {
|
|
|
|
+ viper.SetConfigFile("config.toml") // 指定配置文件路径
|
|
|
|
+ viper.SetConfigName("config") // 配置文件名称(无扩展名)
|
|
|
|
+ viper.SetConfigType("toml") // 如果配置文件的名称中没有扩展名,则需要配置此项
|
|
|
|
+
|
|
|
|
+ viper.AddConfigPath("./")
|
|
|
|
+ viper.AddConfigPath("./conf/") // 还可以在工作目录中查找配置
|
|
|
|
+ viper.AddConfigPath("../conf/") // 还可以在工作目录中查找配置
|
|
|
|
+ err = viper.ReadInConfig() // 查找并读取配置文件
|
|
|
|
+ if err != nil { // 处理读取配置文件的错误
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = viper.Unmarshal(&GF)
|
|
|
|
+
|
|
|
|
+ return err
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func InitMgo() {
|
|
//181
|
|
//181
|
|
Mgo = &mongodb.MongodbSim{
|
|
Mgo = &mongodb.MongodbSim{
|
|
- //MongodbAddr: "172.17.4.181:27001",
|
|
|
|
- MongodbAddr: "127.0.0.1:27001",
|
|
|
|
- DbName: "mixdata",
|
|
|
|
- Size: 10,
|
|
|
|
- UserName: "",
|
|
|
|
- Password: "",
|
|
|
|
- Direct: true,
|
|
|
|
|
|
+ MongodbAddr: GF.Mongo.Host,
|
|
|
|
+ //MongodbAddr: "127.0.0.1:27001",
|
|
|
|
+ DbName: GF.Mongo.DB,
|
|
|
|
+ Size: 10,
|
|
|
|
+ UserName: GF.Mongo.Username,
|
|
|
|
+ Password: GF.Mongo.Password,
|
|
|
|
+ Direct: GF.Mongo.Direct,
|
|
}
|
|
}
|
|
Mgo.InitPool()
|
|
Mgo.InitPool()
|
|
|
|
+}
|
|
|
|
+func Init() {
|
|
|
|
+ InitConfig()
|
|
|
|
+ InitMgo()
|
|
|
|
+
|
|
|
|
+ filename = GF.Env.File
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func main() {
|
|
func main() {
|
|
Init()
|
|
Init()
|
|
- //InitLog()
|
|
|
|
- //getBaseInfo()
|
|
|
|
- //dealXuKe()
|
|
|
|
|
|
+ //statistic()
|
|
|
|
+
|
|
|
|
+ getBaseInfo() //基础信息
|
|
|
|
+ dealXuKe() //许可信息
|
|
|
|
+ getChanges() //变更记录
|
|
|
|
+ getGuDong() //股东信息
|
|
|
|
+ getEmployee() //高管
|
|
|
|
+ getInves() //投资单位
|
|
|
|
+ getBranch() //分支结构
|
|
|
|
+ getPledge() //股权出质
|
|
|
|
+ getChattel() //动产抵押
|
|
|
|
+ getAbnormal() //经营异常
|
|
|
|
+ getIllegal() //严重违法失信
|
|
|
|
+ getPunish() //行政处罚
|
|
|
|
+ getJustice() //失信被执行人
|
|
|
|
+ getCheck() //获取抽查结果
|
|
|
|
+ getFreeze() //股权冻结
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//statistic 统计企业公布信息
|
|
|
|
+func statistic() {
|
|
|
|
+ sess := Mgo.GetMgoConn()
|
|
|
|
+ defer Mgo.DestoryMongoConn(sess)
|
|
|
|
+
|
|
|
|
+ var (
|
|
|
|
+ total_amount_true, total_amount_false int //资产总额
|
|
|
|
+ debt_amount_true, debt_amount_false int //负债总额
|
|
|
|
+ business_income_true, business_income_false int //销售(营业)收入
|
|
|
|
+ main_business_income_true, main_business_income_false int //主营业收入
|
|
|
|
+ total_profit_amount_true, total_profit_amount_false int //利润总额
|
|
|
|
+ tax_amount_true, tax_amount_false int //纳税总额
|
|
|
|
+ profit_amount_true, profit_amount_false int //净利润
|
|
|
|
+ equity_amount_true, equity_amount_false int //所有者权益合计
|
|
|
|
+ government_support_true, government_support_false int //获得政府扶持资金、补助
|
|
|
|
+ financial_loan_true, financial_loan_false int //金融贷款
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ fmt.Println("开始统计")
|
|
|
|
+ query := sess.DB("mixdata").C("annual_report_asset").Find(nil).Select(nil).Limit(200000).Iter()
|
|
|
|
+ count := 0
|
|
|
|
+ for tmp := make(map[string]interface{}); query.Next(tmp); count++ {
|
|
|
|
+ if count%1000 == 0 {
|
|
|
|
+ fmt.Println("current count", count)
|
|
|
|
+ }
|
|
|
|
+ //1
|
|
|
|
+ total_amount := utils.ObjToString(tmp["total_amount"])
|
|
|
|
+ if total_amount != "" && strings.Contains(total_amount, "不公示") {
|
|
|
|
+ total_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ total_amount_true++
|
|
|
|
+ }
|
|
|
|
+ //2
|
|
|
|
+ debt_amount := utils.ObjToString(tmp["debt_amount"])
|
|
|
|
+ if debt_amount != "" && strings.Contains(debt_amount, "不公示") {
|
|
|
|
+ debt_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ debt_amount_true++
|
|
|
|
+ }
|
|
|
|
+ //3
|
|
|
|
+ business_income := utils.ObjToString(tmp["business_income"])
|
|
|
|
+ if business_income != "" && strings.Contains(business_income, "不公示") {
|
|
|
|
+ business_income_false++
|
|
|
|
+ } else {
|
|
|
|
+ business_income_true++
|
|
|
|
+ }
|
|
|
|
+ //4
|
|
|
|
+ main_business_income := utils.ObjToString(tmp["main_business_income"])
|
|
|
|
+ if main_business_income != "" && strings.Contains(main_business_income, "不公示") {
|
|
|
|
+ main_business_income_false++
|
|
|
|
+ } else {
|
|
|
|
+ main_business_income_true++
|
|
|
|
+ }
|
|
|
|
+ //5
|
|
|
|
+ total_profit_amount := utils.ObjToString(tmp["total_profit_amount"])
|
|
|
|
+ if total_profit_amount != "" && strings.Contains(total_profit_amount, "不公示") {
|
|
|
|
+ total_profit_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ total_profit_amount_true++
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //6
|
|
|
|
+ tax_amount := utils.ObjToString(tmp["tax_amount"])
|
|
|
|
+ if tax_amount != "" && strings.Contains(tax_amount, "不公示") {
|
|
|
|
+ tax_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ tax_amount_true++
|
|
|
|
+ }
|
|
|
|
+ //7
|
|
|
|
+ profit_amount := utils.ObjToString(tmp["profit_amount"])
|
|
|
|
+ if profit_amount != "" && strings.Contains(profit_amount, "不公示") {
|
|
|
|
+ profit_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ profit_amount_true++
|
|
|
|
+ }
|
|
|
|
+ //8
|
|
|
|
+ equity_amount := utils.ObjToString(tmp["equity_amount"])
|
|
|
|
+ if equity_amount != "" && strings.Contains(equity_amount, "不公示") {
|
|
|
|
+ equity_amount_false++
|
|
|
|
+ } else {
|
|
|
|
+ equity_amount_true++
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //9
|
|
|
|
+ government_support := utils.ObjToString(tmp["government_support"])
|
|
|
|
+ if government_support != "" && strings.Contains(government_support, "不公示") {
|
|
|
|
+ government_support_false++
|
|
|
|
+ } else {
|
|
|
|
+ government_support_true++
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //10
|
|
|
|
|
|
- //getChanges()
|
|
|
|
- //getGuDong()
|
|
|
|
- //getEmployee()
|
|
|
|
|
|
+ financial_loan := utils.ObjToString(tmp["financial_loan"])
|
|
|
|
+ if financial_loan != "" && strings.Contains(financial_loan, "不公示") {
|
|
|
|
+ financial_loan_false++
|
|
|
|
+ } else {
|
|
|
|
+ financial_loan_true++
|
|
|
|
+ }
|
|
|
|
|
|
- //getInves()
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- getBranch()
|
|
|
|
|
|
+ fmt.Println("结束统计")
|
|
|
|
+
|
|
|
|
+ fmt.Println("total_amount_true : ", total_amount_true, "total_amount_false: ", total_amount_false)
|
|
|
|
+ fmt.Println("debt_amount_true : ", debt_amount_true, "debt_amount_false: ", debt_amount_false)
|
|
|
|
+ fmt.Println("business_income_true : ", business_income_true, "business_income_false: ", business_income_false)
|
|
|
|
+ fmt.Println("main_business_income_true : ", main_business_income_true, "main_business_income_false: ", main_business_income_false)
|
|
|
|
+ fmt.Println("total_profit_amount_true : ", total_profit_amount_true, "total_profit_amount_false: ", total_profit_amount_false)
|
|
|
|
+ fmt.Println("tax_amount_true : ", tax_amount_true, "tax_amount_false: ", tax_amount_false)
|
|
|
|
+ fmt.Println("profit_amount_true : ", profit_amount_true, "profit_amount_false: ", profit_amount_false)
|
|
|
|
+ fmt.Println("equity_amount_true : ", equity_amount_true, "equity_amount_false: ", equity_amount_false)
|
|
|
|
+ fmt.Println("government_support_true : ", government_support_true, "government_support_false: ", government_support_false)
|
|
|
|
+ fmt.Println("financial_loan_true : ", financial_loan_true, "financial_loan_false: ", financial_loan_false)
|
|
}
|
|
}
|
|
|
|
|
|
//baseInfo 基础信息;
|
|
//baseInfo 基础信息;
|
|
func getBaseInfo() {
|
|
func getBaseInfo() {
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ fmt.Println("开始处理 基本信息")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -57,7 +209,7 @@ func getBaseInfo() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "基本信息"
|
|
baseSheet := "基本信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "统一社会信用代码", "法定代表人", "登记状态", "成立日期", "注册资本", "所属行业", "企业类型", "注册地址", "登记机关", "经营范围", "企业简介", "营业执照有效期自", "营业执照有效期至"}
|
|
baseTitle := []string{"企业名称", "公司ID", "统一社会信用代码", "法定代表人", "登记状态", "成立日期", "注册资本", "所属行业", "企业类型", "注册地址", "登记机关", "经营范围", "企业简介", "营业执照有效期自", "营业执照有效期至"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -75,15 +227,18 @@ func getBaseInfo() {
|
|
_ = f.SetColWidth(baseSheet, "A", "C", 30)
|
|
_ = f.SetColWidth(baseSheet, "A", "C", 30)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
|
|
+ name := strings.TrimSpace(dealName(rows[i][0]))
|
|
base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
baseInfo := *base
|
|
baseInfo := *base
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
- f.SetCellValue("企业名单", fmt.Sprintf("AC%v", i+1), "无")
|
|
|
|
|
|
+ f.SetCellValue("企业名单", fmt.Sprintf("D%v", i+1), "无")
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
baseMap[name] = baseInfo
|
|
baseMap[name] = baseInfo
|
|
@@ -119,7 +274,7 @@ func getBaseInfo() {
|
|
//dealXuKe 许可信息
|
|
//dealXuKe 许可信息
|
|
func dealXuKe() {
|
|
func dealXuKe() {
|
|
fmt.Println("开始处理许可信息")
|
|
fmt.Println("开始处理许可信息")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -131,7 +286,7 @@ func dealXuKe() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "许可信息"
|
|
baseSheet := "许可信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "许可文件名称", "许可机关", "许可内容", "有效期自", "有效期至"}
|
|
baseTitle := []string{"企业名称", "公司ID", "许可文件名称", "许可机关", "许可内容", "有效期自", "有效期至"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -148,13 +303,18 @@ func dealXuKe() {
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 20)
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -203,7 +363,7 @@ func dealXuKe() {
|
|
//getChanges 获取变更记录
|
|
//getChanges 获取变更记录
|
|
func getChanges() {
|
|
func getChanges() {
|
|
fmt.Println("开始处理变更记录")
|
|
fmt.Println("开始处理变更记录")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -215,8 +375,8 @@ func getChanges() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
- baseSheet := "变更记录"
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "变更信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "变更事项", "变更类型", "变更前内容", "变更后内容", "变更日期"}
|
|
baseTitle := []string{"企业名称", "公司ID", "变更事项", "变更类型", "变更前内容", "变更后内容", "变更日期"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
&excelize.Style{
|
|
&excelize.Style{
|
|
@@ -232,13 +392,18 @@ func getChanges() {
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 30)
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 30)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -286,7 +451,7 @@ func getChanges() {
|
|
//getGuDong 股东及其出资信息
|
|
//getGuDong 股东及其出资信息
|
|
func getGuDong() {
|
|
func getGuDong() {
|
|
fmt.Println("开始处理 - 股东及其出资信息")
|
|
fmt.Println("开始处理 - 股东及其出资信息")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -298,7 +463,7 @@ func getGuDong() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "股东及其出资信息"
|
|
baseSheet := "股东及其出资信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "股东名称", "持股比例", "认缴出资额", "实缴出资额", "认缴出资日期", "实缴出质日期"}
|
|
baseTitle := []string{"企业名称", "公司ID", "股东名称", "持股比例", "认缴出资额", "实缴出资额", "认缴出资日期", "实缴出质日期"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -315,13 +480,18 @@ func getGuDong() {
|
|
_ = f.SetColWidth(baseSheet, "A", "C", 30)
|
|
_ = f.SetColWidth(baseSheet, "A", "C", 30)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -378,7 +548,7 @@ func getGuDong() {
|
|
//getEmployee 获取高管
|
|
//getEmployee 获取高管
|
|
func getEmployee() {
|
|
func getEmployee() {
|
|
fmt.Println("开始处理 高管信息")
|
|
fmt.Println("开始处理 高管信息")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -390,7 +560,7 @@ func getEmployee() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "高管信息"
|
|
baseSheet := "高管信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "姓名", "职位"}
|
|
baseTitle := []string{"企业名称", "公司ID", "姓名", "职位"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -407,13 +577,18 @@ func getEmployee() {
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -458,7 +633,7 @@ func getEmployee() {
|
|
//getInves 对外投资
|
|
//getInves 对外投资
|
|
func getInves() {
|
|
func getInves() {
|
|
fmt.Println("开始处理 对外投资信息")
|
|
fmt.Println("开始处理 对外投资信息")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -470,7 +645,7 @@ func getInves() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "对外投资信息"
|
|
baseSheet := "对外投资信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "被投资企业名称", "注册资本", "出资金额", "出资比例", "登记状态", "成立日期"}
|
|
baseTitle := []string{"企业名称", "公司ID", "被投资企业名称", "注册资本", "出资金额", "出资比例", "登记状态", "成立日期"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -487,13 +662,18 @@ func getInves() {
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -542,7 +722,7 @@ func getInves() {
|
|
//getBranch 分支机构信息
|
|
//getBranch 分支机构信息
|
|
func getBranch() {
|
|
func getBranch() {
|
|
fmt.Println("开始处理 分支机构信息")
|
|
fmt.Println("开始处理 分支机构信息")
|
|
- f, err := excelize.OpenFile("./园区企业名单及企业类型表.xlsx")
|
|
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return
|
|
return
|
|
@@ -554,7 +734,7 @@ func getBranch() {
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
|
|
|
|
- rows, err := f.GetRows("企业名单")
|
|
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
baseSheet := "分支机构信息"
|
|
baseSheet := "分支机构信息"
|
|
baseTitle := []string{"企业名称", "公司ID", "分支机构名称", "登记状态", "成立日期", "注册地址"}
|
|
baseTitle := []string{"企业名称", "公司ID", "分支机构名称", "登记状态", "成立日期", "注册地址"}
|
|
styleOne, _ := f.NewStyle(
|
|
styleOne, _ := f.NewStyle(
|
|
@@ -571,13 +751,18 @@ func getBranch() {
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
_ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
|
|
- for i := 6; i < len(rows); i++ {
|
|
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
if i%100 == 0 {
|
|
if i%100 == 0 {
|
|
- fmt.Println(i, rows[i][2])
|
|
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
}
|
|
}
|
|
- name := dealName(rows[i][2])
|
|
|
|
- base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
- baseInfo := *base
|
|
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
if len(baseInfo) == 0 || baseInfo == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -624,6 +809,728 @@ func getBranch() {
|
|
fmt.Println("分支机构信息 处理完毕")
|
|
fmt.Println("分支机构信息 处理完毕")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//getPledge 股权出质
|
|
|
|
+func getPledge() {
|
|
|
|
+ fmt.Println("开始处理 股权出质信息")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "股权出质"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "登记日期", "公示日期", "登记编号", "出质人", "出质股权数额"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_pledge", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["pledge_date"],
|
|
|
|
+ Data["public_date"],
|
|
|
|
+ Data["pledge_code"],
|
|
|
|
+ Data["pledgor"],
|
|
|
|
+ Data["pledge_equity"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("股权出质 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getChattel 获取动产抵押
|
|
|
|
+func getChattel() {
|
|
|
|
+ fmt.Println("开始处理 动产抵押信息")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "动产抵押"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "债权种类", "债权数额", "履行日期", "登记编号", "登记日期", "公示日期", "登记机关", "担保范围", "主债权信息备注", "状态"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_chattel", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["debt_type"],
|
|
|
|
+ Data["debt_amount"],
|
|
|
|
+ Data["debt_term"],
|
|
|
|
+ Data["chattel_code"],
|
|
|
|
+ Data["chattel_date"],
|
|
|
|
+ Data["public_date"],
|
|
|
|
+ Data["authority"],
|
|
|
|
+ Data["guarantee_scope"],
|
|
|
|
+ Data["remark"],
|
|
|
|
+ Data["chattel_status"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("动产抵押 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getAbnormal 获取经营异常
|
|
|
|
+func getAbnormal() {
|
|
|
|
+ fmt.Println("开始处理 经营异常信息")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "经营异常名录"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "列入经营异常名录日期", "列入经营异常名录原因", "列入异常名录部门", "移出经营异常名录日期", "移出经营异常名录原因", "移出异常名录部门"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_abnormal", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["included_date"],
|
|
|
|
+ Data["included_reason"],
|
|
|
|
+ Data["included_authority"],
|
|
|
|
+ Data["removed_date"],
|
|
|
|
+ Data["removed_reason"],
|
|
|
|
+ Data["removed_authority"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("经营异常 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getIllegal 获取 严重违法失信
|
|
|
|
+func getIllegal() {
|
|
|
|
+ fmt.Println("开始处理 严重违法失信")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "严重违法失信"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "列入日期", "列入原因", "列入部门", "移出日期", "移出原因", "移出异常名录部门"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_illegal", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["included_date"],
|
|
|
|
+ Data["included_reason"],
|
|
|
|
+ Data["included_authority"],
|
|
|
|
+ Data["removed_date"],
|
|
|
|
+ Data["removed_reason"],
|
|
|
|
+ Data["removed_authority"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("严重违法失信 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getPunish 获取行政处罚
|
|
|
|
+func getPunish() {
|
|
|
|
+ fmt.Println("开始处理 行政处罚")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "行政处罚"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "处罚决定文书", "处罚日期", "违法行为类型", "处罚内容", "决定机关"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_punish", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["punish_code"],
|
|
|
|
+ Data["punish_date"],
|
|
|
|
+ Data["illegal_type"],
|
|
|
|
+ Data["punish_content"],
|
|
|
|
+ Data["authority"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("行政处罚 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getIllegal 获取失信被执行人
|
|
|
|
+func getJustice() {
|
|
|
|
+ fmt.Println("开始处理 失信被执行人")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "失信被执行人"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "失信人名称", "执行法院", "执行通知书文号", "类型|状态", "股权数额", "创建时间"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_justice", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["executee"],
|
|
|
|
+ Data["exec_court"],
|
|
|
|
+ Data["doc_no"],
|
|
|
|
+ Data["equity_status"],
|
|
|
|
+ Data["equity_amount"],
|
|
|
|
+ Data["create_time"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("失信被执行人 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getCheck 获取抽查结果
|
|
|
|
+func getCheck() {
|
|
|
|
+ fmt.Println("开始处理 抽查结果")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "抽查结果"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "抽查时间", "抽查类型", "抽查结果", "抽查机关"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_check", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["check_date"],
|
|
|
|
+ Data["check_type"],
|
|
|
|
+ Data["check_result"],
|
|
|
|
+ Data["authority"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("抽查结果 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//getFreeze 获取股权冻结
|
|
|
|
+func getFreeze() {
|
|
|
|
+ fmt.Println("开始处理 股权冻结")
|
|
|
|
+ f, err := excelize.OpenFile(filename)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ defer func() {
|
|
|
|
+ f.Save()
|
|
|
|
+ if err := f.Close(); err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ rows, err := f.GetRows(GF.Env.Sheet)
|
|
|
|
+ baseSheet := "股权冻结"
|
|
|
|
+ baseTitle := []string{"企业名称", "公司ID", "被执行人", "股权数额", "执行法院", "执行事项", "执行通知书文号", "执行裁定书文号", "冻结期限自", "冻结期限至", "冻结期限", "冻结公示日期"}
|
|
|
|
+ styleOne, _ := f.NewStyle(
|
|
|
|
+ &excelize.Style{
|
|
|
|
+ Alignment: &excelize.Alignment{
|
|
|
|
+ Horizontal: "left",
|
|
|
|
+ Vertical: "left",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ line := 0
|
|
|
|
+ f.NewSheet(baseSheet)
|
|
|
|
+ _ = f.SetColWidth(baseSheet, "A", "G", 25)
|
|
|
|
+ _ = f.SetRowHeight(baseSheet, line, 20)
|
|
|
|
+
|
|
|
|
+ for i := 1; i < len(rows); i++ {
|
|
|
|
+ if i%100 == 0 {
|
|
|
|
+ fmt.Println(i, rows[i][0])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(rows[i]) <= 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ name := dealName(rows[i][0])
|
|
|
|
+ //base, _ := Mgo.FindOne("company_base", map[string]interface{}{"company_name": name})
|
|
|
|
+ //baseInfo := *base
|
|
|
|
+
|
|
|
|
+ baseInfo := baseMap[name]
|
|
|
|
+ if len(baseInfo) == 0 || baseInfo == nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ company_id := baseInfo["company_id"]
|
|
|
|
+ //1. 基本信息
|
|
|
|
+ // 设置一次表头
|
|
|
|
+ if line == 0 {
|
|
|
|
+ line++
|
|
|
|
+ //设置第一行title
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &baseTitle)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取 分支结构
|
|
|
|
+ pledge, _ := Mgo.Find("company_justice_freeze", map[string]interface{}{"company_id": company_id}, nil, nil, false, -1, -1)
|
|
|
|
+ pledgeDatas := *pledge
|
|
|
|
+ if len(pledgeDatas) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, Data := range pledgeDatas {
|
|
|
|
+ line++
|
|
|
|
+ valus := []interface{}{
|
|
|
|
+ baseInfo["company_name"],
|
|
|
|
+ company_id,
|
|
|
|
+ Data["executee"],
|
|
|
|
+ Data["equity_amount"],
|
|
|
|
+ Data["exec_court"],
|
|
|
|
+ Data["exec_item"],
|
|
|
|
+ Data["doc_no"],
|
|
|
|
+ Data["exec_no"],
|
|
|
|
+ Data["freeze_start_date"],
|
|
|
|
+ Data["freeze_end_date"],
|
|
|
|
+ Data["freeze_years"],
|
|
|
|
+ Data["public_date"],
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ err = f.SetSheetRow(baseSheet, fmt.Sprintf("%s%d", "A", line), &valus)
|
|
|
|
+ _ = f.SetCellStyle(baseSheet, fmt.Sprintf("%s%d", "A", line), "AA"+strconv.Itoa(line), styleOne)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fmt.Println("股权冻结 处理完毕")
|
|
|
|
+}
|
|
|
|
+
|
|
//dealName 处理name
|
|
//dealName 处理name
|
|
func dealName(name string) string {
|
|
func dealName(name string) string {
|
|
if strings.ContainsAny(name, "()()") {
|
|
if strings.ContainsAny(name, "()()") {
|