|
@@ -18,6 +18,7 @@ import (
|
|
|
credit "qfw/util/credit"
|
|
|
"qfw/util/elastic"
|
|
|
. "qfw/util/mongodb"
|
|
|
+ mongodbutil "qfw/util/mongodbutil"
|
|
|
. "qfw/util/msg"
|
|
|
"qfw/util/redis"
|
|
|
qrpc "qfw/util/rpc"
|
|
@@ -464,10 +465,10 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
s_submitname := s.GetString("s_submitname") //提交者名称
|
|
|
i_identificationtype := s.GetString("i_identificationtype") //认证类型
|
|
|
s_id_new := s.GetString("s_id_new") //个人变更企业 更改前的企业注册号
|
|
|
- s_enterprisename_new := s.GetString("s_enterprisename_new") //个人变更企业 更改前的企业名称
|
|
|
- i_organizetype, _ := s.GetInt("i_organizetype") //机构认证 机构类型
|
|
|
- s_comauthenttype := s.GetString("s_comauthenttype") //企业名片认证追加营业执照认证
|
|
|
- i_comauthenttype, _ := s.GetInt("i_comauthenttype") //企业名片认证追加营业执照认证类型
|
|
|
+ //s_enterprisename_new := s.GetString("s_enterprisename_new") //个人变更企业 更改前的企业名称
|
|
|
+ i_organizetype, _ := s.GetInt("i_organizetype") //机构认证 机构类型
|
|
|
+ s_comauthenttype := s.GetString("s_comauthenttype") //企业名片认证追加营业执照认证
|
|
|
+ i_comauthenttype, _ := s.GetInt("i_comauthenttype") //企业名片认证追加营业执照认证类型
|
|
|
//s_mail := s.GetString("s_mail") //年报邮箱
|
|
|
data := make(M)
|
|
|
_status, _ := s.GetInteger("i_identificationstatus")
|
|
@@ -522,6 +523,7 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
title = s_result
|
|
|
content = s_remark
|
|
|
} else {
|
|
|
+ _data4 := make(map[string]interface{})
|
|
|
data4 := make(map[string]interface{})
|
|
|
var query = ""
|
|
|
if s_id != "" {
|
|
@@ -531,7 +533,7 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
//当审核通过的时候,根据企业名称查看企业表是否有数据
|
|
|
query = `{"EntName":"` + s_enterprisename + `"}`
|
|
|
}
|
|
|
- t := Find("enterprise", query, nil, `{"_id":1}`, true, -1, -1)
|
|
|
+ t := mongodbutil.Find("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, query, nil, `{"_id":1}`, true, -1, -1)
|
|
|
ret := (*t)[0]
|
|
|
if nil != ret["_id"] {
|
|
|
//如果存在此企业,取出企业名称和企业id 更新企业表
|
|
@@ -560,9 +562,15 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
i_identType = 1
|
|
|
}
|
|
|
tm := fmt.Sprintf("%d", time.Now().Unix())
|
|
|
- Update("enterprise", &map[string]interface{}{
|
|
|
- "_id": ObjectIdHex(s_enterpriseid),
|
|
|
- }, `{'$set':{'s_action':'`+s_action+`','EntName':'`+s_enterprisename+`','RegNo':'`+s_id+`','s_submitid':'`+s_submitid+`','s_submitname':'`+s_submitname+`','l_submittime':`+tm+`}}`, false, false)
|
|
|
+ mongodbutil.Update("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, M{"_id": ret["_id"]}, M{"$set": M{"EntName": s_enterprisename}}, false, false)
|
|
|
+ Update("enterprise", M{"_id": ret["_id"]}, M{"$set": M{"_id": ret["_id"],
|
|
|
+ "RegNo": s_id,
|
|
|
+ "s_action": s_action,
|
|
|
+ "s_submitid": s_submitid,
|
|
|
+ "s_submitname": s_submitname,
|
|
|
+ "l_submittime": tm,
|
|
|
+ }}, true, false)
|
|
|
+
|
|
|
elastic.UpdateEntDoc(s_enterpriseid)
|
|
|
if i_identificationtype == "5" {
|
|
|
per := FindOne("enterprise", M{"RegNo": s_id_new})
|
|
@@ -571,59 +579,60 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
Del("enterprise", M{"RegNo": s_id_new})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
if i_identificationtype == "5" {
|
|
|
+ s_enterpriseid = s.GetString("s_enterpriseid")
|
|
|
s_action = "01" //是否已认证并判断认证类型-个人变更企业
|
|
|
- data4["SourceType"] = "02" //网站录入个人变更企业信息
|
|
|
+ _data4["SourceType"] = "02" //网站录入个人变更企业信息
|
|
|
data4["s_action"] = s_action //是否已认证并判断认证类型-个人变更企业
|
|
|
- var querynew = ""
|
|
|
- if s_id_new != "" {
|
|
|
- //当审核通过的时候,根据注册号查看企业表是否有数据
|
|
|
- querynew = `{"RegNo":"` + s_id_new + `"}`
|
|
|
- } else {
|
|
|
- //当审核通过的时候,根据企业名称查看企业表是否有数据
|
|
|
- querynew = `{"EntName":"` + s_enterprisename_new + `"}`
|
|
|
- }
|
|
|
- Update("enterprise", querynew, `{'$set':{'s_action':'`+s_action+`','s_submitid':'`+s_submitid+`','EntName':'`+s_enterprisename+`','RegNo':'`+s_id+`'}}`, false, false)
|
|
|
- s_enterpriseid = s.GetString("s_enterpriseid")
|
|
|
+ var querynew = `{"_id":"` + s_enterpriseid + `"}`
|
|
|
+ _data4["EntName"] = s_enterprisename
|
|
|
+ _data4["RegNo"] = s_id
|
|
|
+ mongodbutil.Update("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, querynew, M{"$set": _data4}, false, false)
|
|
|
+ data4["RegNo"] = s_id
|
|
|
+ data4["s_action"] = s_action
|
|
|
+ data4["s_submitid"] = s_submitid
|
|
|
+ Update("enterprise", querynew, M{"$set": data4}, false, false)
|
|
|
elastic.UpdateEntDoc(s_enterpriseid)
|
|
|
-
|
|
|
} else {
|
|
|
+ //如果没有此企业,则把此企业保存到公式企业表里
|
|
|
+ _data4["EntName"] = s.GetString("s_enterprisename") //企业名称
|
|
|
+ _data4["RegNo"] = s_id //注册号
|
|
|
+ _data4["LeRep"] = s.GetString("s_legalrepresentative") //法定代表人
|
|
|
+ _data4["EstDate"], _ = s.GetInt("l_establishmentdate") //成立日期
|
|
|
+ _data4["Dom"] = s.GetString("s_enterpriseaddress") //住所
|
|
|
//如果没有此企业,则把此企业保存到企业表里
|
|
|
- data4["EntName"] = s.GetString("s_enterprisename") //企业名称
|
|
|
- data4["RegNo"] = s_id //注册号
|
|
|
- data4["LeRep"] = s.GetString("s_legalrepresentative") //法定代表人
|
|
|
- data4["EstDate"], _ = s.GetInt("l_establishmentdate") //成立日期
|
|
|
- data4["Dom"] = s.GetString("s_enterpriseaddress") //住所
|
|
|
- data4["i_organizetype"] = i_organizetype //组织机构类型
|
|
|
- data4["s_pic"] = s.GetString("s_pic") //组织机构代码证
|
|
|
- rel := s.GetString("l_submitdate") //提交审核时间
|
|
|
+ data4["RegNo"] = s_id
|
|
|
+ data4["i_organizetype"] = i_organizetype //组织机构类型
|
|
|
+ data4["s_pic"] = s.GetString("s_pic") //组织机构代码证
|
|
|
+ rel := s.GetString("l_submitdate") //提交审核时间
|
|
|
tim, _ := time.ParseInLocation("2006-01-02 15:04:05", rel, time.Local)
|
|
|
data4["l_submitdate"] = tim.Unix()
|
|
|
data4["s_submitname"] = s.GetString("s_submitname")
|
|
|
data4["s_submitid"] = s_submitid
|
|
|
data4["l_submittime"] = time.Now().Unix() //审核时间
|
|
|
if i_identificationtype == "1" {
|
|
|
- data4["SourceType"] = "02" //网站录入企业认证信息
|
|
|
- data4["s_action"] = "01" //是否已认证并判断认证类型-企业认证
|
|
|
+ _data4["SourceType"] = "02" //网站录入企业认证信息
|
|
|
+ data4["s_action"] = "01" //是否已认证并判断认证类型-企业认证
|
|
|
i_identType = 1
|
|
|
} else if i_identificationtype == "2" {
|
|
|
- data4["SourceType"] = "03" //网站录入个人认证信息
|
|
|
- data4["s_action"] = "02" //是否已认证并判断认证类型-个人认证
|
|
|
+ _data4["SourceType"] = "03" //网站录入个人认证信息
|
|
|
+ data4["s_action"] = "02" //是否已认证并判断认证类型-个人认证
|
|
|
i_identType = 2
|
|
|
} else if i_identificationtype == "3" {
|
|
|
- data4["SourceType"] = "04" //网站录入机构认证信息
|
|
|
- data4["s_action"] = "03" //是否已认证并判断认证类型-机构认证
|
|
|
+ _data4["SourceType"] = "04" //网站录入机构认证信息
|
|
|
+ data4["s_action"] = "03" //是否已认证并判断认证类型-机构认证
|
|
|
i_identType = 3
|
|
|
} else if i_identificationtype == "4" {
|
|
|
//data4["SourceType"] = "03" //网站录入商家名称变更信息
|
|
|
data4["s_action"] = "02" //是否已认证并判断认证类型-商家名称变更
|
|
|
i_identType = 2
|
|
|
}
|
|
|
- i := Save("enterprise", data4)
|
|
|
- elastic.UpdateEntDoc(i)
|
|
|
- s_enterpriseid = i
|
|
|
+ _data4_id := mongodbutil.Save("enterprise", SysConfig.EntMongodbAlias, SysConfig.EntMongodbName, _data4)
|
|
|
+ data4["_id"] = ObjectIdHex(_data4_id)
|
|
|
+ Update("enterprise", `{"_id":"`+_data4_id+`"}`, M{"$set": data4}, true, false)
|
|
|
+ elastic.UpdateEntDoc(_data4_id)
|
|
|
+ s_enterpriseid = _data4_id
|
|
|
}
|
|
|
}
|
|
|
//根据提交人id更新到user表中
|
|
@@ -632,9 +641,12 @@ func (s *SystemManage) Updateaudit() error {
|
|
|
data1["freezeremark"] = freezeremark
|
|
|
data1["s_enterprisename"] = s_enterprisename
|
|
|
data1["s_enterpriseid"] = s_enterpriseid
|
|
|
- data1["i_identificationway"] = 1 //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
|
|
|
- data1["s_role"] = "9" //权限设为企业管理员
|
|
|
- data1["s_audittype"] = "y" //作为认证后第一次登录的标识
|
|
|
+ data1["i_identificationway"] = 1 //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
|
|
|
+ data1["s_role"] = "9" //权限设为企业管理员
|
|
|
+ //作为认证后第一次登录的标识
|
|
|
+ if i_identificationtype == "1" || i_identificationtype == "2" || i_identificationtype == "3" {
|
|
|
+ data1["s_audittype"] = "y"
|
|
|
+ }
|
|
|
data1["i_comauthenttype"] = i_comauthenttype //user企业认证是名片认证和营业执照认证
|
|
|
data1["s_audit_record_id"] = _id
|
|
|
if i_identificationtype == "5" {
|