瀏覽代碼

Merge remote-tracking branch 'origin/eta/1.0.2' into debug

# Conflicts:
#	controllers/data_manage/excel/excel_info.go
#	utils/logs.go
Roc 1 年之前
父節點
當前提交
b763a52574
共有 3 個文件被更改,包括 3 次插入43 次删除
  1. 0 41
      controllers/data_manage/excel/excel_info.go
  2. 0 0
      etalogs/binlog/20231023.log
  3. 3 2
      models/data_manage/excel/excel_info.go

+ 0 - 41
controllers/data_manage/excel/excel_info.go

@@ -1214,47 +1214,6 @@ func (c *ExcelInfoController) GetExcelTableData() {
 	br.Data = resp
 }
 
-// UpdateExcelInfoFileUrl 更新excel表格的下载地址
-func UpdateExcelInfoFileUrl(excelInfo *excel3.ExcelInfo) {
-	var err error
-	defer func() {
-		if err != nil {
-			go alarm_msg.SendAlarmMsg(fmt.Sprintf("更新excel表格的下载地址失败,表格id:%d;表格名称:%s; ERR:%s", excelInfo.ExcelInfoId, excelInfo.ExcelName, err), 3)
-		}
-	}()
-	fileName := excelInfo.ExcelName + "_" + excelInfo.UniqueCode + ".xlsx"
-	luckySheetData, err := excel.GetLuckySheetData(excelInfo.Content)
-	if err != nil {
-		fmt.Println("err:", err)
-		return
-	}
-	//_, err = luckySheetData.GetTableDataByLuckySheetDataStr()
-	downloadFilePath, err := luckySheetData.ToExcel()
-	defer func() {
-		_ = os.Remove(downloadFilePath)
-	}()
-	if err != nil {
-		fmt.Println("err:", err)
-		return
-	}
-
-	resourceUrl := ``
-	//上传到阿里云 和 minio
-	if utils.ObjectStorageClient == "minio" {
-		resourceUrl, err = services.UploadImgToMinIo(fileName, downloadFilePath)
-		if err != nil {
-			return
-		}
-	} else {
-		resourceUrl, err = services.UploadAliyunV2(fileName, downloadFilePath)
-		if err != nil {
-			return
-		}
-	}
-	excelInfo.FileUrl = resourceUrl
-	err = excelInfo.Update([]string{"FileUrl"})
-}
-
 //func init() {
 //
 //	excelInfo, err := data_manage.GetExcelInfoById(52)

+ 0 - 0
etalogs/binlog/20231023.log


+ 3 - 2
models/data_manage/excel/excel_info.go

@@ -247,10 +247,11 @@ func GetFirstExcelInfoByClassifyId(classifyId int) (item *ExcelInfo, err error)
 // UpdateExcelInfoSortByClassifyId 根据表格id更新排序
 func UpdateExcelInfoSortByClassifyId(classifyId, nowSort, prevExcelInfoId int, updateSort string) (err error) {
 	o := orm.NewOrmUsingDB("data")
-	sql := ` update excel_info set sort = ` + updateSort + ` WHERE excel_classify_id=? and sort > ? AND is_delete=0 `
+	sql := ` update excel_info set sort = ` + updateSort + ` WHERE excel_classify_id=? AND is_delete=0 AND ( sort > ? `
 	if prevExcelInfoId > 0 {
-		sql += ` or (excel_info_id > ` + fmt.Sprint(prevExcelInfoId) + ` and sort = ` + fmt.Sprint(nowSort) + `)`
+		sql += ` or (excel_info_id < ` + fmt.Sprint(prevExcelInfoId) + ` and sort = ` + fmt.Sprint(nowSort) + `)`
 	}
+	sql += `)`
 	_, err = o.Raw(sql, classifyId, nowSort).Exec()
 	return
 }