| | |
| | | return err |
| | | } |
| | | var tagTypes []string |
| | | var lastAppearanceTime int64 |
| | | //var lastAppearanceTime int64 |
| | | for _, record := range records { |
| | | tagTypes = []string{} |
| | | for _, personId := range record.DocumentNumbers { |
| | | logger.Debugf("document_number_map[personId] %s", document_number_map[personId]) |
| | | tagTypes = append(tagTypes, document_number_map[personId].PersonType) |
| | | lastAppearanceTime = document_number_map[personId].LastAppearanceTime |
| | | //lastAppearanceTime = document_number_map[personId].LastAppearanceTime |
| | | } |
| | | logger.Debugf("tagTypes %s ---------------%s--------", tagTypes, record.DocumentNumbers) |
| | | _, typeNames, err := service.GetPersonTypeNameByTypes(tagTypes) |
| | |
| | | } |
| | | event := strings.Join(typeNames, ",") |
| | | result := &db.ModelTaskResults{ |
| | | Title: m.Task.Name, |
| | | Event: m.eventFormat(event, record.AppearCount), |
| | | ModelID: m.Task.ModelID, |
| | | ModelTaskID: m.Task.ID, |
| | | CommunityId: record.CommunityId, |
| | | OrgID: record.OrgId, |
| | | ObjectIds: strings.Join(record.DocumentNumbers, ","), |
| | | Location: fmt.Sprintf("%s%s%s", domains[record.CommunityId].Name, record.Building, record.Floor), |
| | | Building: record.Building, |
| | | Floor: record.Floor, |
| | | PicDate: time.Unix(lastAppearanceTime, 0).Format("2006-01-02 15:04:05"), |
| | | Title: m.Task.Name, |
| | | Event: m.eventFormat(event, record.AppearCount), |
| | | ModelID: m.Task.ModelID, |
| | | ModelTaskID: m.Task.ID, |
| | | CommunityId: record.CommunityId, |
| | | OrgID: record.OrgId, |
| | | ObjectIds: strings.Join(record.DocumentNumbers, ","), |
| | | Location: fmt.Sprintf("%s%s%s", domains[record.CommunityId].Name, record.Building, record.Floor), |
| | | Building: record.Building, |
| | | Floor: record.Floor, |
| | | //PicDate: time.Unix(lastAppearanceTime, 0).Format("2006-01-02 15:04:05"), |
| | | PicDate: record.PicDate, |
| | | FirstPersonID: record.DocumentNumbers[0], |
| | | } |
| | | results = append(results, result) |