|
|
@@ -100,17 +100,17 @@ func (s *RtxService) AutoSyncOrgList() bool {
|
|
|
func (s *RtxService) RecursionOrganize(rtxOrganizes []RtxOrganize) bool {
|
|
|
orgSvc := organize.GetOrganizeService(s.DBE)
|
|
|
for _, rtxOrg := range rtxOrganizes {
|
|
|
- var baseOrganize *organize.Base_Organize
|
|
|
- where := "1=1 and Innerphone='" + rtxOrg.Id + "'"
|
|
|
+ var baseOrganize organize.Base_Organize
|
|
|
+ where := "1=1 and InnerPhone='" + rtxOrg.Id + "'"
|
|
|
orgSvc.GetEntity(&baseOrganize, where)
|
|
|
- if baseOrganize == nil {
|
|
|
+ /*if baseOrganize == nil {
|
|
|
baseOrganize = new(organize.Base_Organize)
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
parentId := 0
|
|
|
if len(rtxOrg.ParentId) > 0 {
|
|
|
var baseParentOrganize organize.Base_Organize
|
|
|
- where := "1=1 and Innerphone='" + rtxOrg.ParentId + "'"
|
|
|
+ where := "1=1 and InnerPhone='" + rtxOrg.ParentId + "'"
|
|
|
orgSvc.GetEntity(&baseParentOrganize, where)
|
|
|
parentId = baseParentOrganize.Id
|
|
|
}
|
|
|
@@ -141,7 +141,7 @@ func (s *RtxService) RecursionOrganize(rtxOrganizes []RtxOrganize) bool {
|
|
|
baseOrganize.Modifieduserid = 284
|
|
|
orgSvc.UpdateEntityById(baseOrganize.Id, baseOrganize)
|
|
|
}
|
|
|
- if rtxOrg.Children != nil || len(rtxOrg.Children) > 0 {
|
|
|
+ if rtxOrg.Children != nil && len(rtxOrg.Children) > 0 {
|
|
|
s.RecursionOrganize(rtxOrg.Children)
|
|
|
}
|
|
|
}
|
|
|
@@ -196,7 +196,7 @@ func (s *RtxService) HandlePtrLogin(username string, password string) *http.Resp
|
|
|
var rtxRespToken RtxRespToken
|
|
|
json.Unmarshal(jsonBlob, &rtxRespToken)
|
|
|
|
|
|
- if rtxRespToken.Code == "2000" {
|
|
|
+ if rtxRespToken.Code == 2000 {
|
|
|
log.Println("hahaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
|
|
//在这里生成好的token
|
|
|
} else {
|