diff --git a/iniDataForLinux b/iniDataForLinux index 5cc6ab3..b4d4a32 100755 Binary files a/iniDataForLinux and b/iniDataForLinux differ diff --git a/iniDataForMacOs b/iniDataForMacOs index 66c0a1b..c3055d0 100755 Binary files a/iniDataForMacOs and b/iniDataForMacOs differ diff --git a/main.go b/main.go index 876f7df..b2cca76 100644 --- a/main.go +++ b/main.go @@ -460,8 +460,8 @@ func batchInsert(fileName string, isLastCall bool, excludedFilename string) int var batchName, dataFileName string if isLastCall { - batchName = fmt.Sprintf("lastCall-%s-%s-%s", record[1], excludedFilename, strconv.Itoa(int(communicationChannelID))) - dataFileName = fmt.Sprintf("lastCall-%s-%s", excludedFilename, fileName) + batchName = fmt.Sprintf("lastCall-%s-%s-%s", record[1], record[0], excludedFilename) + dataFileName = fmt.Sprintf("lastCall-%s", excludedFilename) } else { batchName = fmt.Sprintf("%s-%s", record[1], record[0]) dataFileName = fileName @@ -627,8 +627,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile fields := strings.Split(fileName, "_") datetime := fields[len(fields)-1] if lastCallKeys != nil { - newFileName := "Communication_definition_SMS_1_wemedia_" + datetime - fileNameDate = fmt.Sprintf("lastCall-%s-%s", excludedFilename, newFileName) + fileNameDate = fmt.Sprintf("lastCall-%s", excludedFilename) fmt.Printf("fileNameDate : %s\n", fileNameDate) // 模糊查询文件名包含“20230103”字符串的批次记录 db.Table("batches b1"). @@ -637,7 +636,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile Joins("INNER JOIN (SELECT communication_channel_id, MAX(created_at) AS created_at FROM batches GROUP BY communication_channel_id) b2 ON b1.communication_channel_id = b2.communication_channel_id AND b1.created_at = b2.created_at"). Order("b1.created_at desc"). Find(&batches) - dataFileName = fmt.Sprintf("lastCall-%s-%s", excludedFilename, fileName) + dataFileName = fmt.Sprintf("lastCall-%s", excludedFilename) } else { fileNameDate = datetime[:8] db.Table("batches b1"). @@ -646,7 +645,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile Joins("INNER JOIN (SELECT communication_channel_id, MAX(created_at) AS created_at FROM batches GROUP BY communication_channel_id) b2 ON b1.communication_channel_id = b2.communication_channel_id AND b1.created_at = b2.created_at"). Order("b1.created_at desc"). Find(&batches) - dataFileName = fileName + dataFileName = strings.Replace(fileName, "targets", "definition", -1) } batchCount := len(batches) @@ -660,7 +659,7 @@ func batchDataInsert(fileName string, lastCallKeys map[string]bool, excludedFile // 定义一个名为result的map类型的变量,并以CommunicationChannelID作为键 result := make(map[string][]Batch) for _, batch := range batches { - cckdKey := strconv.FormatUint(uint64(batch.CommunicationChannelID), 10) + cckdKey := batch.CommunicationChannelID result[cckdKey] = append(result[cckdKey], batch) print(batch.CommunicationChannelID, "\n") }