Browse Source

Merge branch 'fix/excel_style' into debug

# Conflicts:
#	controllers/user_login.go
#	main.go
Roc 1 year ago
parent
commit
cac9c76817

+ 8 - 1
controllers/data_manage/chart_info.go

@@ -2271,7 +2271,14 @@ func (this *ChartInfoController) ChartInfoBase64Upload() {
 	select {
 	case <-time.After(30 * time.Second):
 		utils.FileLog.Info("执行超过30秒 杀死超时进程")
-		cmd.Process.Kill()
+		e := cmd.Process.Kill()
+		if e != nil {
+			fmt.Println("cmd kill err: ", e.Error())
+			utils.FileLog.Info(fmt.Sprintf("cmd kill err: %s", e.Error()))
+			br.Msg = "图片生成失败"
+			br.ErrMsg = "图片生成失败, 执行超时" + e.Error()
+			return
+		}
 		fmt.Println("timeout kill process")
 	case <-doneChannel:
 		fmt.Println("done")

+ 8 - 1
controllers/data_manage/future_good/future_good_chart_info.go

@@ -2419,7 +2419,14 @@ func (this *FutureGoodChartInfoController) ChartInfoBase64Upload() {
 	select {
 	case <-time.After(30 * time.Second):
 		utils.FileLog.Info("执行超过30秒 杀死超时进程")
-		cmd.Process.Kill()
+		e := cmd.Process.Kill()
+		if e != nil {
+			fmt.Println("cmd kill err: ", e.Error())
+			utils.FileLog.Info(fmt.Sprintf("cmd kill err: %s", e.Error()))
+			br.Msg = "图片生成失败"
+			br.ErrMsg = "图片生成失败, 执行超时" + e.Error()
+			return
+		}
 		fmt.Println("timeout kill process")
 	case <-doneChannel:
 		fmt.Println("done")

+ 0 - 1
controllers/user_login.go

@@ -964,7 +964,6 @@ func (this *UserLoginController) CheckUserLdap() {
 		this.Data["json"] = br
 		this.ServeJSON()
 	}()
-
 	type CheckUserLdapReq struct {
 		UserName string `description:"用户名"`
 	}

+ 2 - 0
main.go

@@ -26,7 +26,9 @@ func main() {
 	// 异常处理
 	web.ErrorController(&controllers.ErrorController{})
 
+	// 内存调整
 	web.BConfig.MaxMemory = 1024 * 1024 * 128
+
 	web.BConfig.RecoverFunc = Recover
 	web.Run()
 }

+ 1 - 1
models/data_manage/request/meeting_probabilities.go

@@ -22,7 +22,7 @@ type ISheet struct {
 	ChWidth                  int              `json:"ch_width"`
 	RhHeight                 int              `json:"rh_height"`
 	LuckySheetSelectionRange []int            `json:"luckysheet_selection_range"`
-	ZoomRatio                int              `json:"zoomRatio"`
+	ZoomRatio                float64          `json:"zoomRatio"`
 	CellData                 []ISheetCellData `json:"celldata"`
 }
 type ISheetData struct {

+ 1 - 1
services/data/excel/custom_analysis.go

@@ -405,7 +405,7 @@ type LuckySheet struct {
 	Config           interface{}
 	Index            string               `json:"index"`
 	Order            int                  `json:"order"`
-	ZoomRatio        int                  `json:"zoomRatio"`
+	ZoomRatio        float64              `json:"zoomRatio"`
 	ShowGridLines    string               `json:"showGridLines"`
 	DefaultColWidth  int                  `json:"defaultColWidth"`
 	DefaultRowHeight int                  `json:"defaultRowHeight"`

+ 4 - 0
services/minio.go

@@ -409,7 +409,11 @@ func (m *MinioOss) UploadFile(fileName, filePath, savePath string) (string, erro
 	}
 
 	ctx := context.Background()
+	// 此处兼容一下前后端endpoint不一致的情况, 前端用minio_endpoint后端用minio_back_endpoint, minio_back_endpoint为空则都取前者
 	endpoint := utils.MinIoEndpoint
+	if utils.MinIoBackEndpoint != "" {
+		endpoint = utils.MinIoBackEndpoint
+	}
 	accessKeyID := utils.MinIoAccessKeyId
 	secretAccessKey := utils.MinIoAccessKeySecret
 	useSSL := false

+ 2 - 0
utils/config.go

@@ -184,6 +184,7 @@ var BusinessCode string
 var (
 	MinIoBucketname       string
 	MinIoEndpoint         string
+	MinIoBackEndpoint     string
 	MinIoImghost          string
 	MinIoUploadDir        string
 	MinIoUpload_Audio_Dir string
@@ -502,6 +503,7 @@ func init() {
 	// MinIo相关
 	{
 		MinIoEndpoint = config["minio_endpoint"]
+		MinIoBackEndpoint = config["minio_back_endpoint"]
 		MinIoBucketname = config["minio_bucket_name"]
 		MinIoImghost = config["minio_img_host"]
 		MinIoUploadDir = config["minio_upload_dir"]