master
huanghai 5 years ago
parent b2bcdacc12
commit 5591565d5e

@ -72,9 +72,11 @@ type logStruct struct {
} }
//系统token //系统token
var SystemToken="" var SystemToken = ""
//是否成功 //是否成功
var success =false var success = false
/** /**
*/ */
@ -164,8 +166,8 @@ func InitFull() {
*/ */
func DataExchange() { func DataExchange() {
//获取系统token //获取系统token
success,SystemToken=getSystemToken() success, SystemToken = getSystemToken()
if !success{ if !success {
return return
} }
//死循环上报中 //死循环上报中
@ -255,7 +257,7 @@ type authStruct struct {
token token
2020-07-22 2020-07-22
*/ */
func getSystemToken() (bool, string) { func getSystemToken() (bool, string) {
//(1)计算出system_token=MD5.hash(MD5.hash(system_id+auth_time)+system_key) //(1)计算出system_token=MD5.hash(MD5.hash(system_id+auth_time)+system_key)
var as authStruct var as authStruct
@ -279,9 +281,9 @@ func getSystemToken() (bool, string) {
p := httpDo("POST", ConfigUtil.DataExchangeSystemAuthUrl, string(jsonBytes)) p := httpDo("POST", ConfigUtil.DataExchangeSystemAuthUrl, string(jsonBytes))
if !p.Success { if !p.Success {
fmt.Println(CommonUtil.GetCurrentTime() + "获取认证签名失败!") fmt.Println(CommonUtil.GetCurrentTime() + "获取认证签名失败!")
return false,"获取认证签名失败!" return false, "获取认证签名失败!"
} }
return true,p.Message return true, p.Message
} }
/** /**
@ -308,6 +310,9 @@ func PostToServer(t tableStruct, list []map[string]interface{}) bool {
break break
} }
ds.DelFlag = list[k]["del_flag"].(int64) ds.DelFlag = list[k]["del_flag"].(int64)
//在内层中需要手动删除掉del_flag
delete(list[k], "del_flag")
ds.OrgId = list[k]["bureau_id"].(string) ds.OrgId = list[k]["bureau_id"].(string)
dsMap = append(dsMap, ds) dsMap = append(dsMap, ds)
} }

@ -21,7 +21,7 @@ SELECT
DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`, DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`,
`t_dm_stage`.`stage_name` AS `stage_name`, `t_dm_stage`.`stage_name` AS `stage_name`,
`t_base_organization`.`org_name` AS `org_name` , `t_base_organization`.`org_name` AS `org_name` ,
case t1.`b_use` when -1 then 1 else 0 end AS `del_flag` case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`
FROM FROM
((t_base_class as t1 JOIN `t_dm_stage` ON ( t1.`stage_id` = `t_dm_stage`.`stage_id` )) ((t_base_class as t1 JOIN `t_dm_stage` ON ( t1.`stage_id` = `t_dm_stage`.`stage_id` ))
JOIN `t_base_organization` ON ( t1.`bureau_id` = `t_base_organization`.`org_id` )) JOIN `t_base_organization` ON ( t1.`bureau_id` = `t_base_organization`.`org_id` ))

@ -31,7 +31,7 @@ SELECT
t1.`area_code` AS `area_code`, t1.`area_code` AS `area_code`,
DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`, DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`,
DATE_FORMAT(t1.`create_time`,'%Y/%m/%d %H:%i:%s') AS `create_time`, DATE_FORMAT(t1.`create_time`,'%Y/%m/%d %H:%i:%s') AS `create_time`,
case t1.`b_use` when -1 then 1 else 0 end AS `del_flag` case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`
FROM FROM
`t_base_organization` as t1 where t1.b_use in (1,-2) `t_base_organization` as t1 where t1.b_use in (1,-2)
) as t1 ) as t1

@ -32,7 +32,7 @@ SELECT
`t_base_organization`.`szdcxlxm` AS `szdcxlxm`, `t_base_organization`.`szdcxlxm` AS `szdcxlxm`,
`t_base_class`.`stage_id` AS `stage_id`, `t_base_class`.`stage_id` AS `stage_id`,
`t_base_class`.`rxnf` AS `rxnf`, `t_base_class`.`rxnf` AS `rxnf`,
case t1.`b_use` when -1 then 1 else 0 end AS `del_flag` case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`
FROM FROM
(( ((
`t_base_student` as t1 `t_base_student` as t1

@ -25,7 +25,7 @@ t1.`state_id` AS `state_id`,
DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`, DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`,
DATE_FORMAT(t1.`cjny`,'%Y/%m/%d %H:%i:%s') AS `cjny`, DATE_FORMAT(t1.`cjny`,'%Y/%m/%d %H:%i:%s') AS `cjny`,
DATE_FORMAT(t1.`create_time`,'%Y/%m/%d %H:%i:%s') AS `create_time`, DATE_FORMAT(t1.`create_time`,'%Y/%m/%d %H:%i:%s') AS `create_time`,
case t1.`b_use` when -1 then 1 else 0 end AS `del_flag`, case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`,
`t_base_organization`.`main_school_type` AS `main_school_type`, `t_base_organization`.`main_school_type` AS `main_school_type`,
`t_base_organization`.`xxbbm` AS `xxbbm`, `t_base_organization`.`xxbbm` AS `xxbbm`,
`t_base_organization`.`xxbxlxm` AS `xxbxlxm`, `t_base_organization`.`xxbxlxm` AS `xxbxlxm`,

@ -8,6 +8,6 @@ SELECT
t1.`sort_id` AS `sort_id`, t1.`sort_id` AS `sort_id`,
cast( t1.`b_use` AS signed ) AS `b_use`, cast( t1.`b_use` AS signed ) AS `b_use`,
'-1' as bureau_id, '-1' as bureau_id,
case t1.`b_use` when -1 then 1 else 0 end AS `del_flag` case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`
FROM FROM
`t_sys_dict` as t1 `t_sys_dict` as t1

@ -1,6 +1,7 @@
package main package main
import ( import (
"dsBaseRpc/DataExchange"
"dsBaseRpc/RpcService/BaseClass/BaseClassProto" "dsBaseRpc/RpcService/BaseClass/BaseClassProto"
"dsBaseRpc/RpcService/BaseClass/BaseClassService" "dsBaseRpc/RpcService/BaseClass/BaseClassService"
"dsBaseRpc/RpcService/BaseGlobal/BaseGlobalProto" "dsBaseRpc/RpcService/BaseGlobal/BaseGlobalProto"
@ -110,9 +111,9 @@ func main() {
BaseRolePersonProto.RegisterBaseRolePersonManageServer(s, &BaseRolePersonService.Rpc{}) BaseRolePersonProto.RegisterBaseRolePersonManageServer(s, &BaseRolePersonService.Rpc{})
//五、开启一个数据上报的协程 //五、开启一个数据上报的协程
//go func() { go func() {
// DataExchange.DataExchange() DataExchange.DataExchange()
//}() }()
//六、 注册反射服务 这个服务是CLI使用的 跟服务本身没有关系 //六、 注册反射服务 这个服务是CLI使用的 跟服务本身没有关系
reflection.Register(s) reflection.Register(s)
//七、启动 //七、启动

Loading…
Cancel
Save