新增测点配置

This commit is contained in:
2024-09-03 15:52:38 +08:00
parent bfb284c4cc
commit 3b53e9f9b7
37 changed files with 429 additions and 66 deletions

17
service/common.go Normal file
View File

@@ -0,0 +1,17 @@
package service
const (
WATER = iota + 1 // WATER 水
ELECTRICITY // ELECTRICITY 电
)
var EnergyTypeStrMap = map[int]string{
WATER: "水",
ELECTRICITY: "电",
}
type Common struct{}
func (r *Common) GetEnergyTypeMap() map[int]string {
return EnergyTypeStrMap
}

View File

@@ -1,6 +1,7 @@
package service
type groupService struct {
Common
PeakValley
}

View File

@@ -112,8 +112,8 @@ func (r *PeakValley) CreatePeakValleyRule(req *form.CreatePeakValleyRuleReq) {
var total, start, end, blockTotal = 0, 0, 0, 0
// 每个时间段的时间区块ID
var timeBlockIds []uint
var timeBlockIdsMap = make(map[string][]uint)
var timeBlockIds []int
var timeBlockIdsMap = make(map[string][]int)
var timeGroup [][]int
for _, item := range req.RuleItem {
@@ -207,8 +207,8 @@ func (r *PeakValley) UpdatePeakValleyRule(req *form.UpdatePeakValleyRuleReq) {
var total, start, end, blockTotal = 0, 0, 0, 0
// 每个时间段的时间区块ID
var timeBlockIds []uint
var timeBlockIdsMap = make(map[string][]uint)
var timeBlockIds []int
var timeBlockIdsMap = make(map[string][]int)
var timeGroup [][]int
for _, item := range req.RuleItem {