Ver Fonte

巡检监控

xyxie há 1 dia atrás
pai
commit
cfa19e6fd1
2 ficheiros alterados com 12 adições e 8 exclusões
  1. 5 1
      controllers/data_stat/edb_terminal.go
  2. 7 7
      services/data/edb_inspection.go

+ 5 - 1
controllers/data_stat/edb_terminal.go

@@ -308,12 +308,16 @@ func (c *EdbTerminalController) GetEdbInfoList() {
 	pageSize, _ := c.GetInt("PageSize")
 	currentIndex, _ := c.GetInt("CurrentIndex")
 
+	var startSize int
+	
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
 	}
 	if currentIndex <= 0 {
 		currentIndex = 1
 	}
+	startSize = utils.StartIndex(currentIndex, pageSize)
+
 	if source <= 0 {
 		br.Msg = "来源不能为空"
 		br.ErrMsg = "来源不能为空"
@@ -338,7 +342,7 @@ func (c *EdbTerminalController) GetEdbInfoList() {
 		pars = append(pars, "%"+keyword+"%")
 	}
 
-	list, err := data_manage.GetSimpleEdbListPageByCondition(condition, pars, currentIndex, pageSize)
+	list, err := data_manage.GetSimpleEdbListPageByCondition(condition, pars, startSize, pageSize)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + err.Error()

+ 7 - 7
services/data/edb_inspection.go

@@ -113,12 +113,12 @@ func SaveEdbInspectionConfig(req *edb_inspection.EdbInspectionConfigAddReq) (err
 		isSendEmail = false
 		return
 	}
-	if req.DateType == 1 && lenConf > 5 {
-		errMsg = "巡检时间设置最多不超过5个"
-		err = errors.New(errMsg)
-		isSendEmail = false
-		return
-	}
+	// if req.DateType == 1 && lenConf > 5 {
+	// 	errMsg = "巡检时间设置最多不超过5个"
+	// 	err = errors.New(errMsg)
+	// 	isSendEmail = false
+	// 	return
+	// }
 
 	tmpArr := []string{"每自然日", "每交易日", "每周"}
 	// 配置的map,避免同一种类型配置同一个时间
@@ -139,7 +139,7 @@ func SaveEdbInspectionConfig(req *edb_inspection.EdbInspectionConfigAddReq) (err
 		}
 
 		// 配置的map,避免同一种类型配置同一个时间
-		key := fmt.Sprint(v.InspectionFrequency, "_", v.InspectionFrequencyDay, "_", v.InspectionTime)
+		key := fmt.Sprint(v.InspectionFrequency, "_", v.InspectionDate, "_", v.InspectionTime)
 		if _, ok := configMap[key]; ok {
 			errMsg = "巡检频率和日期不能重复"
 			err = errors.New(errMsg)